aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/.clang-format2
-rw-r--r--test/ARCMT/Inputs/test1.m.in10
-rw-r--r--test/ARCMT/Inputs/test1.m.in.result10
-rw-r--r--test/ARCMT/checking-in-arc.m51
-rw-r--r--test/ARCMT/checking.m14
-rw-r--r--test/ARCMT/driver-migrate.m3
-rw-r--r--test/ARCMT/lit.local.cfg2
-rw-r--r--test/ARCMT/objcmt-arc-cf-annotations.m2047
-rw-r--r--test/ARCMT/objcmt-arc-cf-annotations.m.result2093
-rw-r--r--test/ARCMT/objcmt-atomic-property.m229
-rw-r--r--test/ARCMT/objcmt-atomic-property.m.result202
-rw-r--r--test/ARCMT/objcmt-deprecated-category.m48
-rw-r--r--test/ARCMT/objcmt-deprecated-category.m.result48
-rw-r--r--test/ARCMT/objcmt-instancetype-2.m103
-rw-r--r--test/ARCMT/objcmt-instancetype-2.m.result103
-rw-r--r--test/ARCMT/objcmt-instancetype.m111
-rw-r--r--test/ARCMT/objcmt-instancetype.m.result111
-rw-r--r--test/ARCMT/objcmt-migrate-all.m135
-rw-r--r--test/ARCMT/objcmt-migrate-all.m.result134
-rw-r--r--test/ARCMT/objcmt-ns-macros.m296
-rw-r--r--test/ARCMT/objcmt-ns-macros.m.result279
-rw-r--r--test/ARCMT/objcmt-ns-nonatomic-iosonly.m236
-rw-r--r--test/ARCMT/objcmt-ns-nonatomic-iosonly.m.result209
-rw-r--r--test/ARCMT/objcmt-ns-returns-inner-pointer.m129
-rw-r--r--test/ARCMT/objcmt-ns-returns-inner-pointer.m.result129
-rw-r--r--test/ARCMT/objcmt-property-availability.m46
-rw-r--r--test/ARCMT/objcmt-property-availability.m.result43
-rw-r--r--test/ARCMT/objcmt-property.m237
-rw-r--r--test/ARCMT/objcmt-property.m.result210
-rw-r--r--test/ARCMT/objcmt-protocol-conformance.m114
-rw-r--r--test/ARCMT/objcmt-protocol-conformance.m.result114
-rw-r--r--test/ARCMT/verify.m2
-rw-r--r--test/ARCMT/whitelisted/Inputs/header1.h1
-rw-r--r--test/ARCMT/whitelisted/header1.h5
-rw-r--r--test/ARCMT/whitelisted/header1.h.result4
-rw-r--r--test/ARCMT/whitelisted/header2.h5
-rw-r--r--test/ARCMT/whitelisted/header2.h.result4
-rw-r--r--test/ARCMT/whitelisted/objcmt-with-whitelist.m12
-rw-r--r--test/ARCMT/with-arc-mode-check.m9
-rw-r--r--test/ARCMT/with-arc-mode-migrate.m13
-rw-r--r--test/ARCMT/with-arc-mode-migrate.m.result12
-rw-r--r--test/ASTMerge/Inputs/lit.local.cfg1
-rw-r--r--test/ASTMerge/category.m2
-rw-r--r--test/ASTMerge/class-template.cpp2
-rw-r--r--test/ASTMerge/class.cpp2
-rw-r--r--test/ASTMerge/enum.c2
-rw-r--r--test/ASTMerge/function.c2
-rw-r--r--test/ASTMerge/interface.m2
-rw-r--r--test/ASTMerge/namespace.cpp2
-rw-r--r--test/ASTMerge/property.m2
-rw-r--r--test/ASTMerge/struct.c2
-rw-r--r--test/ASTMerge/typedef.c2
-rw-r--r--test/ASTMerge/var.c2
-rw-r--r--test/Analysis/Inputs/system-header-simulator-cxx.h89
-rw-r--r--test/Analysis/Inputs/system-header-simulator-objc.h1
-rw-r--r--test/Analysis/Inputs/system-header-simulator.h4
-rw-r--r--test/Analysis/MismatchedDeallocator-checker-test.mm3
-rw-r--r--test/Analysis/MismatchedDeallocator-path-notes.cpp2
-rw-r--r--test/Analysis/NSContainers.m88
-rw-r--r--test/Analysis/NewDelete-checker-test.cpp152
-rw-r--r--test/Analysis/NewDelete-path-notes.cpp140
-rw-r--r--test/Analysis/NoReturn.m8
-rw-r--r--test/Analysis/analyzer-config.cpp3
-rw-r--r--test/Analysis/array-struct-region.cpp25
-rw-r--r--test/Analysis/auto-obj-dtors-cfg-output.cpp1415
-rw-r--r--test/Analysis/blocks.m45
-rw-r--r--test/Analysis/builtin-functions.cpp24
-rw-r--r--test/Analysis/casts.cpp12
-rw-r--r--test/Analysis/casts.m13
-rw-r--r--test/Analysis/cfg.cpp152
-rw-r--r--test/Analysis/conditional-operator.cpp2
-rw-r--r--test/Analysis/conditional-path-notes.c (renamed from test/Analysis/conditional-operator-path-notes.c)501
-rw-r--r--test/Analysis/crash-trace.c19
-rw-r--r--test/Analysis/ctor.mm (renamed from test/Analysis/ctor-inlining.mm)174
-rw-r--r--test/Analysis/cxx-for-range.cpp1668
-rw-r--r--test/Analysis/cxx11-crashes.cpp29
-rw-r--r--test/Analysis/derived-to-base.cpp25
-rw-r--r--test/Analysis/diagnostics/Inputs/include/report-issues-within-main-file.h43
-rw-r--r--test/Analysis/diagnostics/Inputs/include/sys/queue.h1
-rw-r--r--test/Analysis/diagnostics/deref-track-symbolic-region.c2
-rw-r--r--test/Analysis/diagnostics/explicit-suppression.cpp2
-rw-r--r--test/Analysis/diagnostics/report-issues-within-main-file.cpp1756
-rw-r--r--test/Analysis/diagnostics/text-diagnostics.c21
-rw-r--r--test/Analysis/diagnostics/undef-value-caller.c2
-rw-r--r--test/Analysis/diagnostics/undef-value-param.c2
-rw-r--r--test/Analysis/diagnostics/undef-value-param.m2
-rw-r--r--test/Analysis/dtor.cpp35
-rw-r--r--test/Analysis/edges-new.mm19628
-rw-r--r--test/Analysis/func.c14
-rw-r--r--test/Analysis/html-diags-multifile.c4
-rw-r--r--test/Analysis/html-diags.c8
-rw-r--r--test/Analysis/identical-expressions.cpp942
-rw-r--r--test/Analysis/initializer.cpp34
-rw-r--r--test/Analysis/initializers-cfg-output.cpp20
-rw-r--r--test/Analysis/inline-plist.c2
-rw-r--r--test/Analysis/inline-unique-reports.c2
-rw-r--r--test/Analysis/inline.c6
-rw-r--r--test/Analysis/inline.cpp16
-rw-r--r--test/Analysis/inlining/DynDispatchBifurcate.m4
-rw-r--r--test/Analysis/inlining/InlineObjCClassMethod.m27
-rw-r--r--test/Analysis/inlining/eager-reclamation-path-notes.c2
-rw-r--r--test/Analysis/inlining/eager-reclamation-path-notes.cpp2
-rw-r--r--test/Analysis/inlining/false-positive-suppression.c8
-rw-r--r--test/Analysis/inlining/inline-defensive-checks.c29
-rw-r--r--test/Analysis/inlining/path-notes.c2
-rw-r--r--test/Analysis/inlining/path-notes.cpp488
-rw-r--r--test/Analysis/inlining/path-notes.m1005
-rw-r--r--test/Analysis/inlining/stl.cpp19
-rw-r--r--test/Analysis/lambdas.cpp2
-rw-r--r--test/Analysis/lit.local.cfg2
-rw-r--r--test/Analysis/live-variables.cpp23
-rw-r--r--test/Analysis/live-variables.m24
-rw-r--r--test/Analysis/logical-ops.c12
-rw-r--r--test/Analysis/malloc-plist.c2
-rw-r--r--test/Analysis/malloc.c131
-rw-r--r--test/Analysis/malloc.m15
-rw-r--r--test/Analysis/method-call-path-notes.cpp2
-rw-r--r--test/Analysis/misc-ps-arm.m2
-rw-r--r--test/Analysis/misc-ps-region-store.cpp65
-rw-r--r--test/Analysis/misc-ps.c18
-rw-r--r--test/Analysis/new-with-exceptions.cpp32
-rw-r--r--test/Analysis/new.cpp155
-rw-r--r--test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m6
-rw-r--r--test/Analysis/null-deref-path-notes.m2
-rw-r--r--test/Analysis/nullptr.cpp6
-rw-r--r--test/Analysis/objc-arc.m1874
-rw-r--r--test/Analysis/objc-for.m256
-rw-r--r--test/Analysis/objc-properties.m2
-rw-r--r--test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m2
-rw-r--r--test/Analysis/objc_invalidation.m4
-rw-r--r--test/Analysis/operator-calls.cpp47
-rw-r--r--test/Analysis/out-of-bounds.c12
-rw-r--r--test/Analysis/plist-macros.cpp1597
-rw-r--r--test/Analysis/plist-output-alternate.m10
-rw-r--r--test/Analysis/plist-output.m10
-rw-r--r--test/Analysis/pointer-to-member.cpp1
-rw-r--r--test/Analysis/ptr-arith.c16
-rw-r--r--test/Analysis/ptr-arith.cpp22
-rw-r--r--test/Analysis/rdar-6540084.m4
-rw-r--r--test/Analysis/reference.cpp7
-rw-r--r--test/Analysis/reinterpret-cast.cpp17
-rw-r--r--test/Analysis/retain-release-path-notes-gc.m18
-rw-r--r--test/Analysis/retain-release-path-notes.m1977
-rw-r--r--test/Analysis/retain-release.m98
-rw-r--r--test/Analysis/security-syntax-checks.m3
-rw-r--r--test/Analysis/self-init.m4
-rw-r--r--test/Analysis/simple-stream-checks.c4
-rw-r--r--test/Analysis/stack-addr-ps.cpp4
-rw-r--r--test/Analysis/string.c6
-rw-r--r--test/Analysis/taint-tester.cpp10
-rw-r--r--test/Analysis/temp-obj-dtors-cfg-output.cpp51
-rw-r--r--test/Analysis/templates.cpp22
-rw-r--r--test/Analysis/temporaries.cpp146
-rw-r--r--test/Analysis/uninit-sometimes.cpp58
-rw-r--r--test/Analysis/uninit-vals-ps-region.m15
-rw-r--r--test/Analysis/unions.cpp61
-rw-r--r--test/Analysis/unix-fns.c108
-rw-r--r--test/Analysis/unreachable-code-path.c19
-rw-r--r--test/Analysis/weak-functions.c117
-rw-r--r--test/CXX/basic/basic.link/p6.cpp53
-rw-r--r--test/CXX/basic/basic.link/p7.cpp73
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp10
-rw-r--r--test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp45
-rw-r--r--test/CXX/basic/basic.start/basic.start.main/p2.cpp16
-rw-r--r--test/CXX/class.access/class.friend/p1.cpp34
-rw-r--r--test/CXX/class.access/class.friend/p11.cpp80
-rw-r--r--test/CXX/class.access/class.friend/p3-cxx0x.cpp13
-rw-r--r--test/CXX/class.access/class.friend/p6.cpp4
-rw-r--r--test/CXX/class.access/p4.cpp10
-rw-r--r--test/CXX/class.access/p6.cpp4
-rw-r--r--test/CXX/class.derived/class.abstract/p16.cpp4
-rw-r--r--test/CXX/class.derived/class.member.lookup/p7.cpp11
-rw-r--r--test/CXX/class.derived/class.virtual/p3-0x.cpp20
-rw-r--r--test/CXX/class/class.friend/p6.cpp4
-rw-r--r--test/CXX/class/class.nested.type/p1.cpp8
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp4
-rw-r--r--test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp4
-rw-r--r--test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp30
-rw-r--r--test/CXX/dcl.dcl/dcl.link/p7-2.cpp8
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp3
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp12
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp20
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p12-1y.cpp17
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3-generic-lambda-1y.cpp74
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p4.cpp2
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp6
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp (renamed from test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6-1y.cpp)3
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7.cpp13
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp2
-rw-r--r--test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p7.cpp2
-rw-r--r--test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp10
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.array/p3.cpp209
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p10.cpp6
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct/p2-cxx0x.cpp2
-rw-r--r--test/CXX/drs/dr0xx.cpp1040
-rw-r--r--test/CXX/drs/dr1xx.cpp1011
-rw-r--r--test/CXX/drs/dr2xx.cpp726
-rw-r--r--test/CXX/drs/dr4xx.cpp32
-rw-r--r--test/CXX/except/except.spec/p14.cpp4
-rw-r--r--test/CXX/except/except.spec/p4.cpp5
-rw-r--r--test/CXX/expr/expr.const/p2-0x.cpp12
-rw-r--r--test/CXX/expr/expr.const/p3-0x.cpp2
-rw-r--r--test/CXX/expr/expr.post/expr.call/p7-0x.cpp7
-rw-r--r--test/CXX/expr/expr.post/expr.const.cast/p1-0x.cpp20
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp32
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm2
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/generic-lambda-unimplemented-1y.cpp31
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp77
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp12
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p2-generic-lambda-1y.cpp25
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p2.cpp2
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp25
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p4-1y.cpp66
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp8
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p4.mm2
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p5-generic-lambda-1y.cpp131
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp5
-rw-r--r--test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp2
-rw-r--r--test/CXX/expr/expr.unary/expr.sizeof/p1.cpp28
-rw-r--r--test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp9
-rw-r--r--test/CXX/expr/expr.unary/expr.unary.op/p4.cpp4
-rw-r--r--test/CXX/lex/lex.literal/lex.ext/p11.cpp22
-rw-r--r--test/CXX/lex/lex.literal/lex.ext/p12.cpp21
-rw-r--r--test/CXX/lex/lex.literal/lex.ext/p3.cpp2
-rw-r--r--test/CXX/lex/lex.literal/lex.ext/p5.cpp4
-rw-r--r--test/CXX/lex/lex.literal/lex.ext/p7.cpp4
-rw-r--r--test/CXX/over/over.over/p2-resolve-single-template-id.cpp2
-rw-r--r--test/CXX/over/over.over/p2.cpp3
-rw-r--r--test/CXX/special/class.copy/implicit-move-def.cpp2
-rw-r--r--test/CXX/special/class.copy/implicit-move.cpp147
-rw-r--r--test/CXX/special/class.copy/p11.0x.copy.cpp8
-rw-r--r--test/CXX/special/class.copy/p11.0x.move.cpp21
-rw-r--r--test/CXX/special/class.copy/p12-0x.cpp4
-rw-r--r--test/CXX/special/class.copy/p23-cxx11.cpp38
-rw-r--r--test/CXX/special/class.ctor/p5-0x.cpp2
-rw-r--r--test/CXX/special/class.inhctor/p1.cpp13
-rw-r--r--test/CXX/special/class.inhctor/p4.cpp13
-rw-r--r--test/CXX/special/class.inhctor/p8.cpp4
-rw-r--r--test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp2
-rw-r--r--test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp4
-rw-r--r--test/CXX/temp/temp.decls/temp.alias/p3.cpp4
-rw-r--r--test/CXX/temp/temp.decls/temp.class.spec/p8-1y.cpp35
-rw-r--r--test/CXX/temp/temp.decls/temp.class/temp.mem.enum/p1.cpp6
-rw-r--r--test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp2
-rw-r--r--test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp7
-rw-r--r--test/CXX/temp/temp.decls/temp.friend/p4.cpp17
-rw-r--r--test/CXX/temp/temp.decls/temp.friend/p5.cpp8
-rw-r--r--test/CXX/temp/temp.decls/temp.mem/p2.cpp12
-rw-r--r--test/CXX/temp/temp.decls/temp.variadic/p2.cpp2
-rw-r--r--test/CXX/temp/temp.decls/temp.variadic/p5.cpp12
-rw-r--r--test/CXX/temp/temp.decls/temp.variadic/sizeofpack.cpp203
-rw-r--r--test/CXX/temp/temp.param/p5.cpp9
-rw-r--r--test/CXX/temp/temp.res/temp.local/p6.cpp69
-rw-r--r--test/CXX/temp/temp.spec/cxx1y-variable-template-no-body.cpp37
-rw-r--r--test/CXX/temp/temp.spec/no-body.cpp63
-rw-r--r--test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp2
-rw-r--r--test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp2
-rw-r--r--test/CXX/temp/temp.spec/temp.inst/p1.cpp11
-rw-r--r--test/CodeCompletion/call.c6
-rw-r--r--test/CodeCompletion/call.cpp4
-rw-r--r--test/CodeCompletion/documentation.cpp4
-rw-r--r--test/CodeCompletion/enum-switch-case-qualified.cpp2
-rw-r--r--test/CodeCompletion/enum-switch-case.c4
-rw-r--r--test/CodeCompletion/enum-switch-case.cpp2
-rw-r--r--test/CodeCompletion/functions.cpp2
-rw-r--r--test/CodeCompletion/member-access.c2
-rw-r--r--test/CodeCompletion/namespace-alias.cpp2
-rw-r--r--test/CodeCompletion/namespace.cpp2
-rw-r--r--test/CodeCompletion/nested-name-specifier.cpp2
-rw-r--r--test/CodeCompletion/objc-expr.m4
-rw-r--r--test/CodeCompletion/operator.cpp2
-rw-r--r--test/CodeCompletion/stdin.c2
-rw-r--r--test/CodeCompletion/tag.c2
-rw-r--r--test/CodeCompletion/tag.cpp2
-rw-r--r--test/CodeCompletion/truncation.c4
-rw-r--r--test/CodeCompletion/using-namespace.cpp2
-rw-r--r--test/CodeCompletion/using.cpp2
-rw-r--r--test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c7
-rw-r--r--test/CodeGen/2004-11-27-InvalidConstantExpr.c10
-rw-r--r--test/CodeGen/2004-11-27-StaticFunctionRedeclare.c8
-rw-r--r--test/CodeGen/2007-02-25-C-DotDotDot.c2
-rw-r--r--test/CodeGen/2007-03-05-DataLayout.c55
-rw-r--r--test/CodeGen/2007-04-14-FNoBuiltin.c7
-rw-r--r--test/CodeGen/2007-05-07-PaddingElements.c4
-rw-r--r--test/CodeGen/2008-01-11-ChainConsistency.c3
-rw-r--r--test/CodeGen/2008-01-25-ByValReadNone.c5
-rw-r--r--test/CodeGen/2008-03-05-syncPtr.c12
-rw-r--r--test/CodeGen/2008-03-24-BitField-And-Alloca.c2
-rw-r--r--test/CodeGen/2008-05-19-AlwaysInline.c3
-rw-r--r--test/CodeGen/2008-07-30-implicit-initialization.c6
-rw-r--r--test/CodeGen/2008-07-31-asm-labels.c6
-rw-r--r--test/CodeGen/2008-07-31-promotion-of-compound-pointer-arithmetic.c6
-rw-r--r--test/CodeGen/2008-08-07-AlignPadding2.c2
-rw-r--r--test/CodeGen/2010-01-18-Inlined-Debug.c2
-rw-r--r--test/CodeGen/2010-03-5-LexicalScope.c2
-rw-r--r--test/CodeGen/2010-07-08-DeclDebugLineNo.c2
-rw-r--r--test/CodeGen/2010-08-12-asm-aggr-arg.c2
-rw-r--r--test/CodeGen/3dnow-builtins.c50
-rw-r--r--test/CodeGen/Atomics.c4
-rw-r--r--test/CodeGen/PR15826.c19
-rw-r--r--test/CodeGen/PR3589-freestanding-libcalls.c2
-rw-r--r--test/CodeGen/PR5060-align.c2
-rw-r--r--test/CodeGen/_Bool-conversion.c2
-rw-r--r--test/CodeGen/aarch64-arguments.c24
-rw-r--r--test/CodeGen/aarch64-neon-2velem.c1698
-rw-r--r--test/CodeGen/aarch64-neon-across.c271
-rw-r--r--test/CodeGen/aarch64-neon-copy.c1319
-rw-r--r--test/CodeGen/aarch64-neon-crypto.c94
-rw-r--r--test/CodeGen/aarch64-neon-extract.c148
-rw-r--r--test/CodeGen/aarch64-neon-fcvt-intrinsics.c133
-rw-r--r--test/CodeGen/aarch64-neon-intrinsics.c11725
-rw-r--r--test/CodeGen/aarch64-neon-ldst-one.c2047
-rw-r--r--test/CodeGen/aarch64-neon-misc.c2005
-rw-r--r--test/CodeGen/aarch64-neon-perm.c1093
-rw-r--r--test/CodeGen/aarch64-neon-scalar-copy.c173
-rw-r--r--test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c255
-rw-r--r--test/CodeGen/aarch64-neon-shifts.c43
-rw-r--r--test/CodeGen/aarch64-neon-tbl.c463
-rw-r--r--test/CodeGen/aarch64-neon-vcombine.c91
-rw-r--r--test/CodeGen/aarch64-neon-vget-hilo.c176
-rw-r--r--test/CodeGen/aarch64-poly64.c283
-rw-r--r--test/CodeGen/aarch64-varargs.c14
-rw-r--r--test/CodeGen/address-space.c8
-rw-r--r--test/CodeGen/alias.c6
-rw-r--r--test/CodeGen/align-param.c4
-rw-r--r--test/CodeGen/align-x68_64.c11
-rw-r--r--test/CodeGen/alignment.c5
-rw-r--r--test/CodeGen/annotations-var.c4
-rw-r--r--test/CodeGen/arm-aapcs-vfp.c2
-rw-r--r--test/CodeGen/arm-arguments.c122
-rw-r--r--test/CodeGen/arm-asm-diag.c10
-rw-r--r--test/CodeGen/arm-asm-warn.c11
-rw-r--r--test/CodeGen/arm-cc.c8
-rw-r--r--test/CodeGen/arm-clear.c17
-rw-r--r--test/CodeGen/arm-crc32.c63
-rw-r--r--test/CodeGen/arm-interrupt-attr.c38
-rw-r--r--test/CodeGen/arm-neon-shifts.c45
-rw-r--r--test/CodeGen/arm-neon-vget.c124
-rw-r--r--test/CodeGen/arm-pcs.c2
-rw-r--r--test/CodeGen/arm-pnaclcall.c8
-rw-r--r--test/CodeGen/arm_neon_intrinsics.c11636
-rw-r--r--test/CodeGen/asm-label.c12
-rw-r--r--test/CodeGen/assign.c4
-rw-r--r--test/CodeGen/atomic-ops.c7
-rw-r--r--test/CodeGen/atomics-inlining.c90
-rw-r--r--test/CodeGen/attr-availability.c12
-rw-r--r--test/CodeGen/attr-coldhot.c2
-rw-r--r--test/CodeGen/attr-minsize.cpp2
-rw-r--r--test/CodeGen/attr-weakref.c4
-rw-r--r--test/CodeGen/available-externally-suppress.c4
-rw-r--r--test/CodeGen/avx-builtins.c18
-rw-r--r--test/CodeGen/avx-cmp-builtins.c48
-rw-r--r--test/CodeGen/avx2-builtins.c22
-rw-r--r--test/CodeGen/big-atomic-ops.c323
-rw-r--r--test/CodeGen/bitfield-2.c18
-rw-r--r--test/CodeGen/bitfield-assign.c6
-rw-r--r--test/CodeGen/bitfield.c21
-rw-r--r--test/CodeGen/block-byref-aggr.c4
-rw-r--r--test/CodeGen/blocks-2.c18
-rw-r--r--test/CodeGen/blocks.c16
-rw-r--r--test/CodeGen/bool_test.c2
-rw-r--r--test/CodeGen/bounds-checking.c19
-rw-r--r--test/CodeGen/branch-on-bool.c22
-rw-r--r--test/CodeGen/builtin-ms-noop.cpp2
-rw-r--r--test/CodeGen/builtins-arm-exclusive.c112
-rw-r--r--test/CodeGen/builtins-arm.c10
-rw-r--r--test/CodeGen/builtins-mips-msa.c829
-rw-r--r--test/CodeGen/builtins-ms.c9
-rw-r--r--test/CodeGen/builtins-multiprecision.c38
-rw-r--r--test/CodeGen/builtins-nvptx.c9
-rw-r--r--test/CodeGen/builtins-overflow.c175
-rw-r--r--test/CodeGen/builtins-ppc-altivec.c10
-rw-r--r--test/CodeGen/builtins-x86.c12
-rw-r--r--test/CodeGen/builtins.c8
-rw-r--r--test/CodeGen/builtinshufflevector2.c13
-rw-r--r--test/CodeGen/byval-memcpy-elim.c6
-rw-r--r--test/CodeGen/c-strings.c10
-rw-r--r--test/CodeGen/c11atomics-ios.c12
-rw-r--r--test/CodeGen/c11atomics.c29
-rw-r--r--test/CodeGen/capture-complex-expr-in-block.c2
-rw-r--r--test/CodeGen/captured-statements-nested.c126
-rw-r--r--test/CodeGen/captured-statements.c80
-rw-r--r--test/CodeGen/catch-undef-behavior.c4
-rw-r--r--test/CodeGen/char-literal.c6
-rw-r--r--test/CodeGen/complex-convert.c2
-rw-r--r--test/CodeGen/complex-indirect.c2
-rw-r--r--test/CodeGen/complex-init-list.c4
-rw-r--r--test/CodeGen/complex.c9
-rw-r--r--test/CodeGen/compound-assign-overflow.c3
-rw-r--r--test/CodeGen/compound-literal.c4
-rw-r--r--test/CodeGen/const-init.c2
-rw-r--r--test/CodeGen/convertvector.c114
-rw-r--r--test/CodeGen/cxx-default-arg.cpp2
-rw-r--r--test/CodeGen/darwin-string-literals.c4
-rw-r--r--test/CodeGen/debug-info-args.c2
-rw-r--r--test/CodeGen/debug-info-block-decl.c19
-rw-r--r--test/CodeGen/debug-info-enum.c11
-rw-r--r--test/CodeGen/debug-info-limited.c11
-rw-r--r--test/CodeGen/debug-info-version.c8
-rw-r--r--test/CodeGen/debug-info-vla.c3
-rw-r--r--test/CodeGen/decl-in-prototype.c4
-rw-r--r--test/CodeGen/dependent-lib.c15
-rw-r--r--test/CodeGen/designated-initializers.c87
-rw-r--r--test/CodeGen/dllimport-dllexport.c4
-rw-r--r--test/CodeGen/dwarf-version.c14
-rw-r--r--test/CodeGen/exceptions-seh.c18
-rw-r--r--test/CodeGen/exceptions.c4
-rw-r--r--test/CodeGen/exprs.c12
-rw-r--r--test/CodeGen/ext-vector.c15
-rw-r--r--test/CodeGen/fast-math.c2
-rw-r--r--test/CodeGen/finite-math.c2
-rw-r--r--test/CodeGen/fp16-ops.c2
-rw-r--r--test/CodeGen/func-return-member.c6
-rw-r--r--test/CodeGen/function-attributes.c12
-rw-r--r--test/CodeGen/functions.c6
-rw-r--r--test/CodeGen/implicit-arg.c2
-rw-r--r--test/CodeGen/incomplete-function-type.c2
-rw-r--r--test/CodeGen/inline.c91
-rw-r--r--test/CodeGen/inline2.c48
-rw-r--r--test/CodeGen/integer-overflow.c6
-rw-r--r--test/CodeGen/le32-arguments.c18
-rw-r--r--test/CodeGen/le32-libcall-pow.c27
-rw-r--r--test/CodeGen/libcall-declarations.c570
-rw-r--r--test/CodeGen/libcalls-complex.c4
-rw-r--r--test/CodeGen/libcalls-d.c4
-rw-r--r--test/CodeGen/libcalls-ld.c4
-rw-r--r--test/CodeGen/libcalls.c21
-rw-r--r--test/CodeGen/link-bitcode-file.c6
-rw-r--r--test/CodeGen/linkage-redecl.c2
-rw-r--r--test/CodeGen/linux-arm-atomic.c2
-rw-r--r--test/CodeGen/long-double-x86-nacl.c2
-rw-r--r--test/CodeGen/mangle-windows-rtd.c10
-rw-r--r--test/CodeGen/mangle-windows.c34
-rw-r--r--test/CodeGen/may-alias.c25
-rw-r--r--test/CodeGen/microsoft-call-conv-x64.c4
-rw-r--r--test/CodeGen/microsoft-call-conv.c16
-rw-r--r--test/CodeGen/mips-byval-arg.c4
-rw-r--r--test/CodeGen/mips-clobber-reg.c206
-rw-r--r--test/CodeGen/mips-constraints-mem.c2
-rw-r--r--test/CodeGen/mips-inline-asm-modifiers.c11
-rw-r--r--test/CodeGen/mips-target-data.c2
-rw-r--r--test/CodeGen/mips-vector-return.c6
-rw-r--r--test/CodeGen/mips64-class-return.cpp4
-rw-r--r--test/CodeGen/mips64-padding-arg.c24
-rw-r--r--test/CodeGen/mmx-inline-asm-error.c13
-rw-r--r--test/CodeGen/mrtd.c11
-rw-r--r--test/CodeGen/ms-declspecs.c5
-rw-r--r--test/CodeGen/ms-inline-asm-64.c2
-rw-r--r--test/CodeGen/ms-inline-asm.c2
-rw-r--r--test/CodeGen/ms-inline-asm.cpp16
-rw-r--r--test/CodeGen/ms_abi.c20
-rw-r--r--test/CodeGen/mult-alt-generic.c1
-rw-r--r--test/CodeGen/no-opt-volatile-memcpy.c6
-rw-r--r--test/CodeGen/nomathbuiltin.c12
-rw-r--r--test/CodeGen/nvptx-abi.c17
-rw-r--r--test/CodeGen/nvptx-inlineasm-ptx.c40
-rw-r--r--test/CodeGen/object-size.c34
-rw-r--r--test/CodeGen/override-layout.c48
-rw-r--r--test/CodeGen/packed-arrays.c30
-rw-r--r--test/CodeGen/packed-nest-unpacked.c2
-rw-r--r--test/CodeGen/packed-structure.c20
-rw-r--r--test/CodeGen/ppc64-extend.c2
-rw-r--r--test/CodeGen/ppc64-struct-onefloat.c6
-rw-r--r--test/CodeGen/ppc64-struct-onevect.c13
-rw-r--r--test/CodeGen/pr12251.c2
-rw-r--r--test/CodeGen/pr2394.c2
-rw-r--r--test/CodeGen/pr3518.c2
-rw-r--r--test/CodeGen/pr4349.c2
-rw-r--r--test/CodeGen/pr9614.c2
-rw-r--r--test/CodeGen/pragma-comment.c23
-rw-r--r--test/CodeGen/pragma-detect_mismatch.c12
-rw-r--r--test/CodeGen/pragma-pack-2.c4
-rw-r--r--test/CodeGen/pragma-pack-3.c4
-rw-r--r--test/CodeGen/pragma-visibility.c4
-rw-r--r--test/CodeGen/pragma-weak.c88
-rw-r--r--test/CodeGen/predefined-expr.c12
-rw-r--r--test/CodeGen/regparm.c2
-rw-r--r--test/CodeGen/sections.c28
-rw-r--r--test/CodeGen/sha-builtins.c35
-rw-r--r--test/CodeGen/sparcv9-abi.c181
-rw-r--r--test/CodeGen/sret.c2
-rw-r--r--test/CodeGen/sret2.c2
-rw-r--r--test/CodeGen/sse-builtins.c65
-rw-r--r--test/CodeGen/statements.c7
-rw-r--r--test/CodeGen/static-order.c2
-rw-r--r--test/CodeGen/stdcall-fastcall.c30
-rw-r--r--test/CodeGen/string-literal-unicode-conversion.c11
-rw-r--r--test/CodeGen/struct-init.c2
-rw-r--r--test/CodeGen/struct-matching-constraint.c2
-rw-r--r--test/CodeGen/switch-dce.c2
-rw-r--r--test/CodeGen/switch.c20
-rw-r--r--test/CodeGen/systemz-inline-asm.c36
-rw-r--r--test/CodeGen/tbaa-class.cpp64
-rw-r--r--test/CodeGen/tbaa-for-vptr.cpp7
-rw-r--r--test/CodeGen/tbaa-ms-abi.cpp22
-rw-r--r--test/CodeGen/tbaa-struct.cpp8
-rw-r--r--test/CodeGen/tbaa-thread-sanitizer.cpp14
-rw-r--r--test/CodeGen/tbaa.cpp85
-rw-r--r--test/CodeGen/tbm-builtins.c137
-rw-r--r--test/CodeGen/transparent-union.c2
-rw-r--r--test/CodeGen/trapv.c8
-rw-r--r--test/CodeGen/unsigned-overflow.c20
-rw-r--r--test/CodeGen/unsigned-promotion.c24
-rw-r--r--test/CodeGen/unwind-attr.c2
-rw-r--r--test/CodeGen/vector.c7
-rw-r--r--test/CodeGen/visibility.c36
-rw-r--r--test/CodeGen/vla.c12
-rw-r--r--test/CodeGen/vld_dup.c2
-rw-r--r--test/CodeGen/volatile-1.c60
-rw-r--r--test/CodeGen/volatile-2.c16
-rw-r--r--test/CodeGen/volatile-complex.c67
-rw-r--r--test/CodeGen/wchar-const.c4
-rw-r--r--test/CodeGen/x86_32-arguments-darwin.c102
-rw-r--r--test/CodeGen/x86_32-arguments-linux.c2
-rw-r--r--test/CodeGen/x86_32-arguments-nommx.c4
-rw-r--r--test/CodeGen/x86_32-arguments-realign.c2
-rw-r--r--test/CodeGen/x86_32-arguments-win32.c18
-rw-r--r--test/CodeGen/x86_32-fpcc-struct-return.c34
-rw-r--r--test/CodeGen/x86_64-arguments-nacl.c30
-rw-r--r--test/CodeGen/x86_64-arguments.c110
-rw-r--r--test/CodeGen/xcore-abi.c129
-rw-r--r--test/CodeGenCUDA/address-spaces.cu6
-rw-r--r--test/CodeGenCUDA/ptx-kernels.cu4
-rw-r--r--test/CodeGenCXX/2004-11-27-FriendDefaultArgCrash.cpp2
-rw-r--r--test/CodeGenCXX/2005-02-14-BitFieldOffset.cpp12
-rw-r--r--test/CodeGenCXX/2007-05-03-VectorInit.cpp2
-rw-r--r--test/CodeGenCXX/2010-05-10-Var-DbgInfo.cpp2
-rw-r--r--test/CodeGenCXX/DynArrayInit.cpp2
-rw-r--r--test/CodeGenCXX/PR5050-constructor-conversion.cpp4
-rw-r--r--test/CodeGenCXX/aarch64-mangle-neon-vectors.cpp85
-rw-r--r--test/CodeGenCXX/aarch64-neon.cpp13
-rw-r--r--test/CodeGenCXX/abstract-class-ctors-dtors.cpp8
-rw-r--r--test/CodeGenCXX/address-of-fntemplate.cpp4
-rw-r--r--test/CodeGenCXX/alloca-align.cpp6
-rw-r--r--test/CodeGenCXX/anonymous-namespaces.cpp21
-rw-r--r--test/CodeGenCXX/anonymous-union-member-initializer.cpp12
-rw-r--r--test/CodeGenCXX/apple-kext-indirect-virtual-dtor-call.cpp4
-rw-r--r--test/CodeGenCXX/apple-kext-linkage.C12
-rw-r--r--test/CodeGenCXX/arm-vaarg.cpp27
-rw-r--r--test/CodeGenCXX/arm.cpp52
-rw-r--r--test/CodeGenCXX/array-construction.cpp4
-rw-r--r--test/CodeGenCXX/array-operator-delete-call.cpp4
-rw-r--r--test/CodeGenCXX/atomic.cpp2
-rw-r--r--test/CodeGenCXX/atomicinit.cpp6
-rw-r--r--test/CodeGenCXX/attr-cleanup.cpp11
-rw-r--r--test/CodeGenCXX/attr.cpp2
-rw-r--r--test/CodeGenCXX/bitfield-layout.cpp4
-rw-r--r--test/CodeGenCXX/bitfield.cpp84
-rw-r--r--test/CodeGenCXX/block-byref-cxx-objc.cpp8
-rw-r--r--test/CodeGenCXX/block-in-ctor-dtor.cpp20
-rw-r--r--test/CodeGenCXX/blocks-cxx11.cpp4
-rw-r--r--test/CodeGenCXX/blocks.cpp28
-rw-r--r--test/CodeGenCXX/bool-bitfield.cpp4
-rw-r--r--test/CodeGenCXX/builtins.cpp21
-rw-r--r--test/CodeGenCXX/c-linkage.cpp6
-rw-r--r--test/CodeGenCXX/c99-variable-length-array.cpp2
-rw-r--r--test/CodeGenCXX/call-arg-zero-temp.cpp4
-rw-r--r--test/CodeGenCXX/captured-statements.cpp189
-rw-r--r--test/CodeGenCXX/cast-conversion.cpp4
-rw-r--r--test/CodeGenCXX/catch-undef-behavior.cpp158
-rw-r--r--test/CodeGenCXX/catch-undef-behavior2.cpp9
-rw-r--r--test/CodeGenCXX/compound-literals.cpp4
-rw-r--r--test/CodeGenCXX/condition.cpp8
-rw-r--r--test/CodeGenCXX/conditional-gnu-ext.cpp8
-rw-r--r--test/CodeGenCXX/conditional-temporaries.cpp6
-rw-r--r--test/CodeGenCXX/const-init-cxx11.cpp110
-rw-r--r--test/CodeGenCXX/const-init-cxx1y.cpp48
-rw-r--r--test/CodeGenCXX/const-init.cpp2
-rw-r--r--test/CodeGenCXX/constructor-attr.cpp2
-rw-r--r--test/CodeGenCXX/constructor-conversion.cpp4
-rw-r--r--test/CodeGenCXX/constructor-default-arg.cpp4
-rw-r--r--test/CodeGenCXX/constructor-destructor-return-this.cpp138
-rw-r--r--test/CodeGenCXX/constructor-for-array-members.cpp4
-rw-r--r--test/CodeGenCXX/constructor-init.cpp16
-rw-r--r--test/CodeGenCXX/constructor-template.cpp4
-rw-r--r--test/CodeGenCXX/constructors.cpp22
-rw-r--r--test/CodeGenCXX/conversion-function.cpp4
-rw-r--r--test/CodeGenCXX/convert-to-fptr.cpp4
-rw-r--r--test/CodeGenCXX/copy-assign-synthesis-1.cpp16
-rw-r--r--test/CodeGenCXX/copy-assign-synthesis-2.cpp2
-rw-r--r--test/CodeGenCXX/copy-assign-synthesis.cpp2
-rw-r--r--test/CodeGenCXX/copy-constructor-elim-2.cpp6
-rw-r--r--test/CodeGenCXX/copy-constructor-elim.cpp4
-rw-r--r--test/CodeGenCXX/copy-constructor-synthesis-2.cpp2
-rw-r--r--test/CodeGenCXX/copy-constructor-synthesis.cpp45
-rw-r--r--test/CodeGenCXX/copy-initialization.cpp2
-rw-r--r--test/CodeGenCXX/crash.cpp35
-rw-r--r--test/CodeGenCXX/ctor-dtor-alias.cpp163
-rw-r--r--test/CodeGenCXX/cxx-block-objects.cpp4
-rw-r--r--test/CodeGenCXX/cxx0x-delegating-ctors.cpp2
-rw-r--r--test/CodeGenCXX/cxx0x-initializer-array.cpp12
-rw-r--r--test/CodeGenCXX/cxx0x-initializer-constructors.cpp24
-rw-r--r--test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-pr12086.cpp107
-rw-r--r--test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-startend.cpp10
-rw-r--r--test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp202
-rw-r--r--test/CodeGenCXX/cxx11-exception-spec.cpp2
-rw-r--r--test/CodeGenCXX/cxx11-initializer-array-new.cpp106
-rw-r--r--test/CodeGenCXX/cxx11-thread-local-reference.cpp4
-rw-r--r--test/CodeGenCXX/cxx11-thread-local.cpp21
-rw-r--r--test/CodeGenCXX/cxx1y-deduced-return-type.cpp32
-rw-r--r--test/CodeGenCXX/cxx1y-init-captures.cpp102
-rw-r--r--test/CodeGenCXX/cxx1y-initializer-aggregate.cpp17
-rw-r--r--test/CodeGenCXX/cxx1y-sized-deallocation.cpp110
-rw-r--r--test/CodeGenCXX/cxx1y-variable-template.cpp24
-rw-r--r--test/CodeGenCXX/debug-info-artificial-arg.cpp8
-rw-r--r--test/CodeGenCXX/debug-info-class-limited.cpp52
-rw-r--r--test/CodeGenCXX/debug-info-class-nolimit.cpp30
-rw-r--r--test/CodeGenCXX/debug-info-class.cpp87
-rw-r--r--test/CodeGenCXX/debug-info-cxx1y.cpp7
-rw-r--r--test/CodeGenCXX/debug-info-decl-nested.cpp61
-rw-r--r--test/CodeGenCXX/debug-info-enum-class.cpp8
-rw-r--r--test/CodeGenCXX/debug-info-enum.cpp40
-rw-r--r--test/CodeGenCXX/debug-info-friend.cpp19
-rw-r--r--test/CodeGenCXX/debug-info-function-context.cpp36
-rw-r--r--test/CodeGenCXX/debug-info-gline-tables-only.cpp10
-rw-r--r--test/CodeGenCXX/debug-info-global-ctor-dtor.cpp6
-rw-r--r--test/CodeGenCXX/debug-info-globalinit.cpp12
-rw-r--r--test/CodeGenCXX/debug-info-limit-type.cpp24
-rw-r--r--test/CodeGenCXX/debug-info-limit.cpp14
-rw-r--r--test/CodeGenCXX/debug-info-limited.cpp33
-rw-r--r--test/CodeGenCXX/debug-info-method.cpp5
-rw-r--r--test/CodeGenCXX/debug-info-namespace.cpp66
-rw-r--r--test/CodeGenCXX/debug-info-nullptr.cpp2
-rw-r--r--test/CodeGenCXX/debug-info-pubtypes.cpp5
-rw-r--r--test/CodeGenCXX/debug-info-same-line.cpp25
-rw-r--r--test/CodeGenCXX/debug-info-scope.cpp32
-rw-r--r--test/CodeGenCXX/debug-info-static-member.cpp14
-rw-r--r--test/CodeGenCXX/debug-info-template-limit.cpp4
-rw-r--r--test/CodeGenCXX/debug-info-template-member.cpp89
-rw-r--r--test/CodeGenCXX/debug-info-template-quals.cpp12
-rw-r--r--test/CodeGenCXX/debug-info-template.cpp138
-rw-r--r--test/CodeGenCXX/debug-info-thunk.cpp2
-rw-r--r--test/CodeGenCXX/debug-info-union-template.cpp2
-rw-r--r--test/CodeGenCXX/debug-info-uuid.cpp19
-rw-r--r--test/CodeGenCXX/debug-info-zero-length-arrays.cpp2
-rw-r--r--test/CodeGenCXX/debug-info.cpp53
-rw-r--r--test/CodeGenCXX/debug-lambda-expressions.cpp30
-rw-r--r--test/CodeGenCXX/decl-ref-init.cpp4
-rw-r--r--test/CodeGenCXX/default-arg-temps.cpp6
-rw-r--r--test/CodeGenCXX/default-arguments.cpp8
-rw-r--r--test/CodeGenCXX/default-constructor-for-members.cpp4
-rw-r--r--test/CodeGenCXX/default-constructor-template-member.cpp3
-rw-r--r--test/CodeGenCXX/deferred-global-init.cpp4
-rw-r--r--test/CodeGenCXX/delayed-template-parsing.cpp18
-rw-r--r--test/CodeGenCXX/delete-two-arg.cpp8
-rw-r--r--test/CodeGenCXX/delete.cpp18
-rw-r--r--test/CodeGenCXX/derived-to-base-conv.cpp6
-rw-r--r--test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp2
-rw-r--r--test/CodeGenCXX/destructor-exception-spec.cpp2
-rw-r--r--test/CodeGenCXX/destructors.cpp114
-rw-r--r--test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp20
-rw-r--r--test/CodeGenCXX/devirtualize-virtual-function-calls.cpp2
-rw-r--r--test/CodeGenCXX/dynamic_cast-no-rtti.cpp26
-rw-r--r--test/CodeGenCXX/eh.cpp30
-rw-r--r--test/CodeGenCXX/empty-classes.cpp2
-rw-r--r--test/CodeGenCXX/empty-nontrivially-copyable.cpp25
-rw-r--r--test/CodeGenCXX/exceptions.cpp12
-rw-r--r--test/CodeGenCXX/explicit-instantiation.cpp8
-rw-r--r--test/CodeGenCXX/fastcall.cpp4
-rw-r--r--test/CodeGenCXX/for-range.cpp8
-rw-r--r--test/CodeGenCXX/forward-enum.cpp2
-rw-r--r--test/CodeGenCXX/fp16-mangle.cpp4
-rw-r--r--test/CodeGenCXX/function-template-explicit-specialization.cpp4
-rw-r--r--test/CodeGenCXX/global-array-destruction.cpp2
-rw-r--r--test/CodeGenCXX/global-block-literal-helpers.cpp16
-rw-r--r--test/CodeGenCXX/global-dtor-no-atexit.cpp2
-rw-r--r--test/CodeGenCXX/global-init.cpp4
-rw-r--r--test/CodeGenCXX/goto.cpp2
-rw-r--r--test/CodeGenCXX/implicit-copy-assign-operator.cpp2
-rw-r--r--test/CodeGenCXX/implicit-copy-constructor.cpp2
-rw-r--r--test/CodeGenCXX/implicit-instantiation-1.cpp2
-rw-r--r--test/CodeGenCXX/inheriting-constructor.cpp14
-rw-r--r--test/CodeGenCXX/init-invariant.cpp4
-rw-r--r--test/CodeGenCXX/inline-functions.cpp10
-rw-r--r--test/CodeGenCXX/instantiate-temporaries.cpp4
-rw-r--r--test/CodeGenCXX/invalid.cpp11
-rw-r--r--test/CodeGenCXX/lambda-expressions-inside-auto-functions.cpp77
-rw-r--r--test/CodeGenCXX/lambda-expressions-nested-linkage.cpp50
-rw-r--r--test/CodeGenCXX/lambda-expressions.cpp28
-rw-r--r--test/CodeGenCXX/linetable-cleanup.cpp36
-rw-r--r--test/CodeGenCXX/linkage.cpp222
-rw-r--r--test/CodeGenCXX/lpad-linetable.cpp69
-rw-r--r--test/CodeGenCXX/lvalue-bitcasts.cpp6
-rw-r--r--test/CodeGenCXX/mangle-98.cpp6
-rw-r--r--test/CodeGenCXX/mangle-address-space.cpp6
-rw-r--r--test/CodeGenCXX/mangle-alias-template.cpp2
-rw-r--r--test/CodeGenCXX/mangle-exprs.cpp22
-rw-r--r--test/CodeGenCXX/mangle-extreme.cpp2
-rw-r--r--test/CodeGenCXX/mangle-lambdas.cpp83
-rw-r--r--test/CodeGenCXX/mangle-local-class-names.cpp30
-rw-r--r--test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp117
-rw-r--r--test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp30
-rw-r--r--test/CodeGenCXX/mangle-ms-back-references.cpp5
-rw-r--r--test/CodeGenCXX/mangle-ms-templates.cpp155
-rw-r--r--test/CodeGenCXX/mangle-ms.cpp273
-rw-r--r--test/CodeGenCXX/mangle-neon-vectors.cpp17
-rw-r--r--test/CodeGenCXX/mangle-nullptr-arg.cpp6
-rw-r--r--test/CodeGenCXX/mangle-ref-qualifiers.cpp10
-rw-r--r--test/CodeGenCXX/mangle-subst-std.cpp12
-rw-r--r--test/CodeGenCXX/mangle-subst.cpp12
-rw-r--r--test/CodeGenCXX/mangle-system-header.cpp4
-rw-r--r--test/CodeGenCXX/mangle-template.cpp12
-rw-r--r--test/CodeGenCXX/mangle-unnamed.cpp4
-rw-r--r--test/CodeGenCXX/mangle-valist.cpp10
-rw-r--r--test/CodeGenCXX/mangle-variadic-templates.cpp30
-rw-r--r--test/CodeGenCXX/mangle-windows.cpp42
-rw-r--r--test/CodeGenCXX/mangle.cpp252
-rw-r--r--test/CodeGenCXX/member-expressions.cpp2
-rw-r--r--test/CodeGenCXX/member-function-pointer-calls.cpp4
-rw-r--r--test/CodeGenCXX/member-function-pointers.cpp5
-rw-r--r--test/CodeGenCXX/member-functions.cpp14
-rw-r--r--test/CodeGenCXX/member-init-anon-union.cpp2
-rw-r--r--test/CodeGenCXX/member-initializers.cpp2
-rw-r--r--test/CodeGenCXX/member-templates.cpp4
-rw-r--r--test/CodeGenCXX/microsoft-abi-alignment-fail.cpp10
-rw-r--r--test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp23
-rw-r--r--test/CodeGenCXX/microsoft-abi-default-cc.cpp12
-rw-r--r--test/CodeGenCXX/microsoft-abi-exceptions.cpp157
-rwxr-xr-xtest/CodeGenCXX/microsoft-abi-member-pointers.cpp210
-rw-r--r--test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp201
-rw-r--r--test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp90
-rw-r--r--test/CodeGenCXX/microsoft-abi-static-initializers.cpp124
-rw-r--r--test/CodeGenCXX/microsoft-abi-structors-alias.cpp9
-rw-r--r--test/CodeGenCXX/microsoft-abi-structors.cpp168
-rw-r--r--test/CodeGenCXX/microsoft-abi-thunks.cpp154
-rw-r--r--test/CodeGenCXX/microsoft-abi-vbtables.cpp479
-rw-r--r--test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp83
-rw-r--r--test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp314
-rw-r--r--test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp108
-rw-r--r--test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp579
-rw-r--r--test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp191
-rw-r--r--test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp324
-rw-r--r--test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp575
-rw-r--r--test/CodeGenCXX/microsoft-interface.cpp16
-rw-r--r--test/CodeGenCXX/microsoft-new.cpp39
-rw-r--r--test/CodeGenCXX/microsoft-uuidof-unsupported-target.cpp13
-rw-r--r--test/CodeGenCXX/microsoft-uuidof.cpp94
-rw-r--r--test/CodeGenCXX/move-assignment.cpp26
-rw-r--r--test/CodeGenCXX/ms-integer-static-data-members.cpp35
-rw-r--r--test/CodeGenCXX/new-alias.cpp13
-rw-r--r--test/CodeGenCXX/new-array-init-exceptions.cpp4
-rw-r--r--test/CodeGenCXX/new-array-init.cpp8
-rw-r--r--test/CodeGenCXX/new.cpp106
-rw-r--r--test/CodeGenCXX/no-opt-volatile-memcpy.cpp8
-rw-r--r--test/CodeGenCXX/noexcept.cpp49
-rw-r--r--test/CodeGenCXX/nrvo.cpp18
-rw-r--r--test/CodeGenCXX/override-layout.cpp6
-rw-r--r--test/CodeGenCXX/partial-destruction.cpp6
-rw-r--r--test/CodeGenCXX/pod-member-memcpys.cpp152
-rw-r--r--test/CodeGenCXX/pointers-to-data-members.cpp6
-rw-r--r--test/CodeGenCXX/pr11676.cpp17
-rw-r--r--test/CodeGenCXX/pr11797.cpp2
-rw-r--r--test/CodeGenCXX/pr12251.cpp78
-rw-r--r--test/CodeGenCXX/pr13396.cpp12
-rw-r--r--test/CodeGenCXX/pr9130.cpp2
-rw-r--r--test/CodeGenCXX/pr9965.cpp2
-rw-r--r--test/CodeGenCXX/pragma-visibility.cpp14
-rw-r--r--test/CodeGenCXX/pragma-weak.cpp10
-rw-r--r--test/CodeGenCXX/predefined-expr.cpp22
-rw-r--r--test/CodeGenCXX/ptr-to-member-function.cpp4
-rw-r--r--test/CodeGenCXX/reference-cast.cpp20
-rw-r--r--test/CodeGenCXX/references.cpp18
-rw-r--r--test/CodeGenCXX/return.cpp2
-rw-r--r--test/CodeGenCXX/rtti-layout.cpp2
-rw-r--r--test/CodeGenCXX/runtimecc.cpp6
-rw-r--r--test/CodeGenCXX/rvalue-references.cpp14
-rw-r--r--test/CodeGenCXX/scoped-enums.cpp9
-rw-r--r--test/CodeGenCXX/skip-vtable-pointer-initialization.cpp16
-rw-r--r--test/CodeGenCXX/static-data-member.cpp6
-rw-r--r--test/CodeGenCXX/static-init-1.cpp8
-rw-r--r--test/CodeGenCXX/static-init-4.cpp7
-rw-r--r--test/CodeGenCXX/static-init-pnacl.cpp14
-rw-r--r--test/CodeGenCXX/static-init.cpp16
-rw-r--r--test/CodeGenCXX/static-member-variable-explicit-specialization.cpp89
-rw-r--r--test/CodeGenCXX/stmtexpr.cpp7
-rw-r--r--test/CodeGenCXX/template-anonymous-types.cpp12
-rw-r--r--test/CodeGenCXX/template-dependent-bind-temporary.cpp2
-rw-r--r--test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp4
-rw-r--r--test/CodeGenCXX/template-instantiation.cpp20
-rw-r--r--test/CodeGenCXX/template-linkage.cpp12
-rw-r--r--test/CodeGenCXX/temporaries.cpp243
-rw-r--r--test/CodeGenCXX/thiscall-struct-return.cpp4
-rw-r--r--test/CodeGenCXX/threadsafe-statics-exceptions.cpp2
-rw-r--r--test/CodeGenCXX/throw-expression-cleanup.cpp2
-rw-r--r--test/CodeGenCXX/throw-expressions.cpp26
-rw-r--r--test/CodeGenCXX/thunks-available-externally.cpp11
-rw-r--r--test/CodeGenCXX/thunks.cpp44
-rw-r--r--test/CodeGenCXX/type_visibility.cpp36
-rw-r--r--test/CodeGenCXX/typeid.cpp5
-rw-r--r--test/CodeGenCXX/unknown-anytype.cpp62
-rw-r--r--test/CodeGenCXX/value-init.cpp20
-rw-r--r--test/CodeGenCXX/vararg-conversion-ctor.cpp2
-rw-r--r--test/CodeGenCXX/vararg-non-pod.cpp2
-rw-r--r--test/CodeGenCXX/varargs.cpp4
-rw-r--r--test/CodeGenCXX/variadic-templates.cpp4
-rw-r--r--test/CodeGenCXX/virt-dtor-gen.cpp2
-rw-r--r--test/CodeGenCXX/virtual-base-cast.cpp54
-rw-r--r--test/CodeGenCXX/virtual-base-destructor-call.cpp22
-rw-r--r--test/CodeGenCXX/virtual-bases.cpp12
-rw-r--r--test/CodeGenCXX/virtual-destructor-calls.cpp8
-rw-r--r--test/CodeGenCXX/virtual-functions-incomplete-types.cpp2
-rw-r--r--test/CodeGenCXX/visibility-hidden-extern-templates.cpp6
-rw-r--r--test/CodeGenCXX/visibility-inlines-hidden.cpp38
-rw-r--r--test/CodeGenCXX/visibility-ms-compat.cpp12
-rw-r--r--test/CodeGenCXX/visibility.cpp258
-rw-r--r--test/CodeGenCXX/vla.cpp2
-rw-r--r--test/CodeGenCXX/volatile.cpp4
-rw-r--r--test/CodeGenCXX/vtable-available-externally.cpp26
-rw-r--r--test/CodeGenCXX/vtable-layout.cpp188
-rw-r--r--test/CodeGenCXX/vtable-linkage.cpp139
-rw-r--r--test/CodeGenCXX/vtable-pointer-initialization.cpp10
-rw-r--r--test/CodeGenCXX/x86_32-arguments.cpp30
-rw-r--r--test/CodeGenCXX/x86_64-arguments.cpp18
-rw-r--r--test/CodeGenObjC/2010-02-09-DbgSelf.m4
-rw-r--r--test/CodeGenObjC/arc-block-copy-escape.m4
-rw-r--r--test/CodeGenObjC/arc-blocks.m72
-rw-r--r--test/CodeGenObjC/arc-bridged-cast.m8
-rw-r--r--test/CodeGenObjC/arc-captured-32bit-block-var-layout-2.m2
-rw-r--r--test/CodeGenObjC/arc-captured-32bit-block-var-layout.m2
-rw-r--r--test/CodeGenObjC/arc-captured-block-var-inlined-layout.m4
-rw-r--r--test/CodeGenObjC/arc-captured-block-var-layout.m4
-rw-r--r--test/CodeGenObjC/arc-exceptions.m4
-rw-r--r--test/CodeGenObjC/arc-foreach.m14
-rw-r--r--test/CodeGenObjC/arc-ivar-layout.m4
-rw-r--r--test/CodeGenObjC/arc-linetable-autorelease.m40
-rw-r--r--test/CodeGenObjC/arc-literals.m8
-rw-r--r--test/CodeGenObjC/arc-loadweakretained-release.m2
-rw-r--r--test/CodeGenObjC/arc-no-arc-exceptions.m22
-rw-r--r--test/CodeGenObjC/arc-precise-lifetime.m55
-rw-r--r--test/CodeGenObjC/arc-property.m2
-rw-r--r--test/CodeGenObjC/arc-related-result-type.m2
-rw-r--r--test/CodeGenObjC/arc-ternary-op.m6
-rw-r--r--test/CodeGenObjC/arc-unopt.m2
-rw-r--r--test/CodeGenObjC/arc-unoptimized-byref-var.m2
-rw-r--r--test/CodeGenObjC/arc-with-atthrow.m2
-rw-r--r--test/CodeGenObjC/arc.m76
-rw-r--r--test/CodeGenObjC/assign.m2
-rw-r--r--test/CodeGenObjC/atomic-aggregate-property.m4
-rw-r--r--test/CodeGenObjC/auto-property-synthesize-protocol.m2
-rw-r--r--test/CodeGenObjC/autorelease.m2
-rw-r--r--test/CodeGenObjC/bitfield-access.m4
-rw-r--r--test/CodeGenObjC/bitfield-ivar-offsets.m2
-rw-r--r--test/CodeGenObjC/block-6.m2
-rw-r--r--test/CodeGenObjC/block-byref-debuginfo.m14
-rw-r--r--test/CodeGenObjC/block-byref-variable-layout.m2
-rw-r--r--test/CodeGenObjC/block-var-layout.m4
-rw-r--r--test/CodeGenObjC/blocks-1.m4
-rw-r--r--test/CodeGenObjC/blocks.m10
-rw-r--r--test/CodeGenObjC/builtins.m2
-rw-r--r--test/CodeGenObjC/complex-property.m2
-rw-r--r--test/CodeGenObjC/debug-info-block-line.m2
-rw-r--r--test/CodeGenObjC/debug-info-blocks.m23
-rw-r--r--test/CodeGenObjC/debug-info-default-synth-ivar.m2
-rw-r--r--test/CodeGenObjC/debug-info-fwddecl.m2
-rw-r--r--test/CodeGenObjC/debug-info-id-with-protocol.m6
-rw-r--r--test/CodeGenObjC/debug-info-instancetype.m28
-rw-r--r--test/CodeGenObjC/debug-info-lifetime-crash.m23
-rw-r--r--test/CodeGenObjC/debug-info-property-accessors.m56
-rw-r--r--test/CodeGenObjC/debug-info-property4.m2
-rw-r--r--test/CodeGenObjC/debug-info-property5.m2
-rw-r--r--test/CodeGenObjC/debug-info-self.m8
-rw-r--r--test/CodeGenObjC/debuginfo-properties.m35
-rw-r--r--test/CodeGenObjC/designated-initializers.m8
-rw-r--r--test/CodeGenObjC/encode-cstyle-method.m2
-rw-r--r--test/CodeGenObjC/encode-test-6.m18
-rw-r--r--test/CodeGenObjC/encode-test.m2
-rw-r--r--test/CodeGenObjC/exceptions-nonfragile.m2
-rw-r--r--test/CodeGenObjC/exceptions.m8
-rw-r--r--test/CodeGenObjC/extended-block-signature-encode.m2
-rw-r--r--test/CodeGenObjC/fp2ret.m6
-rw-r--r--test/CodeGenObjC/fpret.m6
-rw-r--r--test/CodeGenObjC/gc.m2
-rw-r--r--test/CodeGenObjC/id-isa-codegen.m4
-rw-r--r--test/CodeGenObjC/ivar-base-as-invariant-load.m6
-rw-r--r--test/CodeGenObjC/ivar-invariant.m4
-rw-r--r--test/CodeGenObjC/ivar-layout-array0-struct.m4
-rw-r--r--test/CodeGenObjC/ivar-layout-no-optimize.m8
-rw-r--r--test/CodeGenObjC/local-static-block.m2
-rw-r--r--test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m4
-rw-r--r--test/CodeGenObjC/ns_consume_null_check.m4
-rw-r--r--test/CodeGenObjC/null-objc-empty-vtable.m10
-rw-r--r--test/CodeGenObjC/objc-gc-aggr-assign.m4
-rw-r--r--test/CodeGenObjC/objc-read-weak-byref.m4
-rw-r--r--test/CodeGenObjC/objc2-legacy-dispatch.m8
-rw-r--r--test/CodeGenObjC/objc2-no-write-barrier.m4
-rw-r--r--test/CodeGenObjC/objc2-weak-block-call.m4
-rw-r--r--test/CodeGenObjC/objc2-write-barrier-5.m4
-rw-r--r--test/CodeGenObjC/objfw.m2
-rw-r--r--test/CodeGenObjC/property.m4
-rw-r--r--test/CodeGenObjC/protocol-in-extended-class.m4
-rw-r--r--test/CodeGenObjC/protocols-lazy.m6
-rw-r--r--test/CodeGenObjC/related-result-type.m4
-rw-r--r--test/CodeGenObjC/reorder-synthesized-ivars.m2
-rw-r--r--test/CodeGenObjC/stret_lookup.m29
-rw-r--r--test/CodeGenObjC/synchronized.m6
-rw-r--r--test/CodeGenObjC/tentative-cfconstantstring.m2
-rw-r--r--test/CodeGenObjC/terminate.m4
-rw-r--r--test/CodeGenObjC/x86_64-struct-return-gc.m4
-rw-r--r--test/CodeGenObjCXX/arc-attrs.mm6
-rw-r--r--test/CodeGenObjCXX/arc-blocks.mm2
-rw-r--r--test/CodeGenObjCXX/arc-exceptions.mm10
-rw-r--r--test/CodeGenObjCXX/arc-globals.mm6
-rw-r--r--test/CodeGenObjCXX/arc-mangle.mm18
-rw-r--r--test/CodeGenObjCXX/arc-move.mm6
-rw-r--r--test/CodeGenObjCXX/arc-new-delete.mm8
-rw-r--r--test/CodeGenObjCXX/arc-pseudo-destructors.mm2
-rw-r--r--test/CodeGenObjCXX/arc-references.mm10
-rw-r--r--test/CodeGenObjCXX/arc-special-member-functions.mm34
-rw-r--r--test/CodeGenObjCXX/arc.mm20
-rw-r--r--test/CodeGenObjCXX/block-var-layout.mm2
-rw-r--r--test/CodeGenObjCXX/catch-id-type.mm2
-rw-r--r--test/CodeGenObjCXX/encode.mm23
-rw-r--r--test/CodeGenObjCXX/exceptions-legacy.mm4
-rw-r--r--test/CodeGenObjCXX/exceptions.mm2
-rw-r--r--test/CodeGenObjCXX/gc.mm2
-rw-r--r--test/CodeGenObjCXX/implicit-copy-assign-operator.mm2
-rw-r--r--test/CodeGenObjCXX/implicit-copy-constructor.mm2
-rw-r--r--test/CodeGenObjCXX/lambda-expressions.mm39
-rw-r--r--test/CodeGenObjCXX/literals.mm4
-rw-r--r--test/CodeGenObjCXX/mangle-blocks.mm49
-rw-r--r--test/CodeGenObjCXX/mangle.mm20
-rw-r--r--test/CodeGenObjCXX/message.mm2
-rw-r--r--test/CodeGenObjCXX/nrvo.mm2
-rw-r--r--test/CodeGenObjCXX/objc-container-subscripting-1.mm4
-rw-r--r--test/CodeGenObjCXX/objc-container-subscripting.mm6
-rw-r--r--test/CodeGenObjCXX/property-dot-reference.mm2
-rw-r--r--test/CodeGenObjCXX/property-object-reference-2.mm4
-rw-r--r--test/CodeGenObjCXX/property-objects.mm4
-rw-r--r--test/CodeGenObjCXX/property-reference.mm4
-rw-r--r--test/CodeGenObjCXX/references.mm2
-rw-r--r--test/CodeGenObjCXX/rtti.mm8
-rw-r--r--test/CodeGenObjCXX/unknown-anytype.mm4
-rw-r--r--test/CodeGenOpenCL/address-spaces-mangling.cl30
-rw-r--r--test/CodeGenOpenCL/kernel-attributes.cl2
-rw-r--r--test/CodeGenOpenCL/local.cl4
-rw-r--r--test/CodeGenOpenCL/opencl_types.cl2
-rw-r--r--test/CodeGenOpenCL/ptx-calls.cl4
-rw-r--r--test/CodeGenOpenCL/ptx-kernels.cl4
-rw-r--r--test/CodeGenOpenCL/str_literals.cl9
-rw-r--r--test/CodeGenOpenCL/vector_odd.cl17
-rw-r--r--test/Coverage/codegen-next.m12
-rw-r--r--test/Coverage/html-diagnostics.c3
-rw-r--r--test/Driver/B-opt.c8
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-as1
l---------test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld1
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld.bfd1
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld.gold1
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-as1
l---------test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld1
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld.bfd1
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld.gold1
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/as1
l---------test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld1
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld.bfd1
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld.gold1
-rw-r--r--test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/lib/.keep0
-rw-r--r--test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/crtbegin.o0
-rw-r--r--test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbegin.o0
-rw-r--r--test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbeginT.o0
-rw-r--r--test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtfastmath.o0
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/as1
l---------test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld1
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.bfd1
-rwxr-xr-xtest/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.gold1
-rw-r--r--test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/lib/.keep0
-rw-r--r--test/Driver/Inputs/basic_netbsd_tree/usr/lib/crt0.o0
-rw-r--r--test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtbegin.o0
-rw-r--r--test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtbeginS.o0
-rw-r--r--test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtend.o0
-rw-r--r--test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtendS.o0
-rw-r--r--test/Driver/Inputs/basic_netbsd_tree/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/libtest.so0
-rw-r--r--test/Driver/Inputs/file.prof0
-rw-r--r--test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtbegin.o0
-rw-r--r--test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/.keep0
-rw-r--r--test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/x86_64-pc-linux-gnu/lib/.keep0
-rw-r--r--test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/crtbegin.o0
-rw-r--r--test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6/.keep0
-rw-r--r--test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/x86_64-pc-linux-gnu/lib/.keep0
-rw-r--r--test/Driver/Inputs/lit.local.cfg1
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/bin/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/include-fixed/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/include/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/nan2008/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/nan2008/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/sof/crtbegin.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/sof/crtend.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/backward/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/fp64/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/nan2008/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/sof/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/fp64/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/nan2008/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/sof/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/inclide/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/inclide/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/inclide/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/usr/include/bits/.keep0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crti.o0
-rw-r--r--test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crtn.o0
l---------test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/as1
-rwxr-xr-xtest/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/i386-unknown-linux-gnu-as1
-rwxr-xr-xtest/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/i386-unknown-linux-gnu-ld1
l---------test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/ld1
l---------test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/as1
l---------test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/ld1
l---------test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/as1
l---------test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/ld1
-rwxr-xr-xtest/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/x86_64-unknown-linux-gnu-as1
-rwxr-xr-xtest/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld1
l---------test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/as1
l---------test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/ld1
-rw-r--r--test/Driver/Inputs/ubuntu_13.04_multiarch_tree/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/crtbegin.o1
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/lib/.keep0
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crti.o0
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crt1.o0
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crti.o0
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crtn.o0
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/crtbegin.o0
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/crtend.o0
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/crtbegin.o0
-rw-r--r--test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/crtend.o0
-rw-r--r--test/Driver/O.c10
-rw-r--r--test/Driver/Wp-args.c4
-rw-r--r--test/Driver/Xarch.c2
-rw-r--r--test/Driver/Xlinker-args.c8
-rw-r--r--test/Driver/aarch64-cpus.c10
-rw-r--r--test/Driver/aarch64-mfpu.c26
-rw-r--r--test/Driver/altivec-asm.S3
-rw-r--r--test/Driver/arc.c12
-rw-r--r--test/Driver/arch.c6
-rw-r--r--test/Driver/arm-alignment.c25
-rw-r--r--test/Driver/arm-cortex-cpus.c37
-rw-r--r--test/Driver/arm-fixed-r9.c4
-rw-r--r--test/Driver/arm-hwdiv.c39
-rw-r--r--test/Driver/arm-mfpmath.c29
-rw-r--r--test/Driver/arm-mfpu.c38
-rw-r--r--test/Driver/arm-restrict-it.c15
-rw-r--r--test/Driver/armv8-crc.c8
-rw-r--r--test/Driver/at_file.c6
-rw-r--r--test/Driver/at_file.c.args2
-rw-r--r--test/Driver/at_file.c.args.utf16lebin0 -> 568 bytes
-rw-r--r--test/Driver/bounds-checking.c6
-rw-r--r--test/Driver/ccc-add-args.c5
-rw-r--r--test/Driver/ccc-as-cpp.c5
-rw-r--r--test/Driver/cl-fallback.c41
-rw-r--r--test/Driver/cl-inputs.c35
-rw-r--r--test/Driver/cl-link.c33
-rw-r--r--test/Driver/cl-options.c238
-rw-r--r--test/Driver/cl-outputs.c107
-rw-r--r--test/Driver/cl-runtime-flags.c89
-rw-r--r--test/Driver/cl.c35
-rw-r--r--test/Driver/clang-g-opts.c11
-rw-r--r--test/Driver/clang-translation.c8
-rw-r--r--test/Driver/clang_f_opts.c78
-rw-r--r--test/Driver/color-diagnostics.c30
-rw-r--r--test/Driver/coverage-ld.c19
-rw-r--r--test/Driver/crash-report.c14
-rw-r--r--test/Driver/cross-linux.c95
-rw-r--r--test/Driver/darwin-as.c12
-rw-r--r--test/Driver/darwin-dsymutil.c2
-rw-r--r--test/Driver/darwin-eabi.c12
-rw-r--r--test/Driver/darwin-ld.c14
-rw-r--r--test/Driver/darwin-objc-defaults.m21
-rw-r--r--test/Driver/darwin-objc-options.m6
-rw-r--r--test/Driver/darwin-sanitizer-ld.c15
-rw-r--r--test/Driver/darwin-verify-debug.c2
-rw-r--r--test/Driver/debug-main-file.S1
-rw-r--r--test/Driver/debug-options-as.c3
-rw-r--r--test/Driver/debug-options.c60
-rw-r--r--test/Driver/debug-unsupported.c22
-rw-r--r--test/Driver/dyld-prefix.c9
-rw-r--r--test/Driver/emit-llvm.c10
-rw-r--r--test/Driver/fast-math.c38
-rw-r--r--test/Driver/fpack-struct.c2
-rw-r--r--test/Driver/frame-pointer.c14
-rw-r--r--test/Driver/freebsd.c4
-rw-r--r--test/Driver/freebsd.cc6
-rw-r--r--test/Driver/fsanitize-blacklist.c18
-rw-r--r--test/Driver/fsanitize.c72
-rw-r--r--test/Driver/gcc-toolchain.cpp10
-rw-r--r--test/Driver/gcc-version-debug.c6
-rw-r--r--test/Driver/gcc_forward.c37
-rw-r--r--test/Driver/gfortran.f90244
-rw-r--r--test/Driver/hexagon-toolchain-elf.c136
-rw-r--r--test/Driver/hexagon-toolchain.c136
-rw-r--r--test/Driver/ident_md.c6
-rw-r--r--test/Driver/immediate-options.c20
-rw-r--r--test/Driver/inhibit-downstream-commands.c2
-rw-r--r--test/Driver/integrated-as.c5
-rw-r--r--test/Driver/integrated-as.s33
-rw-r--r--test/Driver/invalid-o-level.c4
-rw-r--r--test/Driver/le32-toolchain.c4
-rw-r--r--test/Driver/le32-unknown-nacl.cpp4
-rw-r--r--test/Driver/linux-as.c38
-rw-r--r--test/Driver/linux-header-search.cpp55
-rw-r--r--test/Driver/linux-ld.c306
-rw-r--r--test/Driver/lit.local.cfg6
-rw-r--r--test/Driver/lto.c13
-rw-r--r--test/Driver/m_and_mm.c2
-rw-r--r--test/Driver/mips-as.c32
-rw-r--r--test/Driver/mips-cs-header-search.cpp64
-rw-r--r--test/Driver/mips-cs-ld.c298
-rw-r--r--test/Driver/mips-features.c48
-rw-r--r--test/Driver/mips-float.c16
-rw-r--r--test/Driver/mips-fsf.cpp2341
-rw-r--r--test/Driver/mipsel-nacl-defines.cpp45
-rw-r--r--test/Driver/montavista-gcc-toolchain.c6
-rw-r--r--test/Driver/netbsd.c57
-rw-r--r--test/Driver/netbsd.cpp57
-rw-r--r--test/Driver/no-integrated-as-win.c10
-rw-r--r--test/Driver/no-objc-default-synthesize-properties.m6
-rw-r--r--test/Driver/noexecstack.c4
-rw-r--r--test/Driver/nostdincxx.cpp2
-rw-r--r--test/Driver/objc_default_synth.m6
-rw-r--r--test/Driver/openbsd.c28
-rw-r--r--test/Driver/option-aliases.c23
-rw-r--r--test/Driver/parsing.c22
-rw-r--r--test/Driver/pic.c12
-rw-r--r--test/Driver/ppc-features.cpp22
-rw-r--r--test/Driver/pth.c4
-rw-r--r--test/Driver/qa_override.c22
-rw-r--r--test/Driver/r600-mcpu.cl8
-rw-r--r--test/Driver/rewrite-legacy-objc.m8
-rw-r--r--test/Driver/rewrite-objc.m2
-rw-r--r--test/Driver/sanitizer-ld.c35
-rw-r--r--test/Driver/split-debug.c10
-rw-r--r--test/Driver/stack-protector.c6
-rw-r--r--test/Driver/std.cpp18
-rw-r--r--test/Driver/systemz-march.c13
-rw-r--r--test/Driver/target-as.s2
-rw-r--r--test/Driver/target.c6
-rw-r--r--test/Driver/tsan.c10
-rw-r--r--test/Driver/unknown-arg.c19
-rw-r--r--test/Driver/working-directory.c8
-rw-r--r--test/Driver/x86_64-nacl-defines.cpp4
-rw-r--r--test/Driver/x86_features.c8
-rw-r--r--test/Driver/xcore-opts.c13
-rw-r--r--test/FixIt/bridge-cast-in-arc.mm2
-rw-r--r--test/FixIt/fixit-autoreleasepool.m2
-rw-r--r--test/FixIt/fixit-cxx0x.cpp5
-rw-r--r--test/FixIt/fixit-cxx11-attributes.cpp2
-rw-r--r--test/FixIt/fixit-errors-1.c2
-rw-r--r--test/FixIt/fixit-include.c2
-rw-r--r--test/FixIt/fixit-interface-as-param.m2
-rw-r--r--test/FixIt/fixit-objc-message-comma-separator.m2
-rw-r--r--test/FixIt/fixit-objc.m8
-rw-r--r--test/FixIt/fixit-static-object-decl.m12
-rw-r--r--test/FixIt/fixit-unicode-with-utf8-output.c24
-rw-r--r--test/FixIt/fixit-unicode.c39
-rw-r--r--test/FixIt/fixit-uninit.c25
-rw-r--r--test/FixIt/fixit-vexing-parse.cpp2
-rw-r--r--test/FixIt/fixit.c2
-rw-r--r--test/FixIt/fixit.cpp33
-rw-r--r--test/FixIt/format.m10
-rw-r--r--test/FixIt/format.mm4
-rw-r--r--test/FixIt/lit.local.cfg2
-rw-r--r--test/FixIt/messages.cpp2
-rw-r--r--test/FixIt/no-fixit.cpp2
-rw-r--r--test/FixIt/selector-fixit.m41
-rw-r--r--test/FixIt/typo-crash.cpp5
-rw-r--r--test/FixIt/typo-location-bugs.cpp21
-rw-r--r--test/FixIt/typo-using.cpp56
-rw-r--r--test/FixIt/typo.c2
-rw-r--r--test/FixIt/typo.cpp17
-rw-r--r--test/Format/cursor.cpp6
-rw-r--r--test/Format/diagnostic.cpp4
-rw-r--r--test/Format/line-ranges.cpp11
-rw-r--r--test/Format/multiple-inputs-error.cpp6
-rw-r--r--test/Format/style-on-command-line.cpp29
-rw-r--r--test/Frontend/Inputs/lit.local.cfg1
-rw-r--r--test/Frontend/Inputs/rewrite-includes-bom.h1
-rw-r--r--test/Frontend/cc1-return-codes.c4
-rw-r--r--test/Frontend/darwin-eabi.c7
-rw-r--r--test/Frontend/darwin-version.c10
-rw-r--r--test/Frontend/invalid-o-level.c4
-rw-r--r--test/Frontend/ir-support-errors.ll2
-rw-r--r--test/Frontend/mfpmath.c43
-rw-r--r--test/Frontend/mips-long-double.c (renamed from test/Driver/mips-long-double.c)0
-rw-r--r--test/Frontend/print-header-includes.c7
-rw-r--r--test/Frontend/rewrite-includes-bom.c4
-rw-r--r--test/Frontend/rewrite-includes-header-cmd-line.c7
-rw-r--r--test/Frontend/rewrite-includes-invalid-hasinclude.c2
-rw-r--r--test/Frontend/rewrite-includes-warnings.c4
-rw-r--r--test/Frontend/rewrite-includes.c45
-rw-r--r--test/Frontend/verify-fatal.c2
-rw-r--r--test/Frontend/verify.c18
-rw-r--r--test/Frontend/verify2.c2
-rw-r--r--test/Frontend/verify3.c8
-rw-r--r--test/Frontend/x86_64-nacl-types.cpp (renamed from test/Driver/x86_64-nacl-types.cpp)0
-rw-r--r--test/Headers/Inputs/include/complex.h3
-rw-r--r--test/Headers/Inputs/include/math.h1
-rw-r--r--test/Headers/Inputs/include/stdint.h1
-rw-r--r--test/Headers/altivec-header.c6
-rw-r--r--test/Headers/c11.c6
-rw-r--r--test/Headers/c89.c2
-rw-r--r--test/Headers/cxx11.cpp4
-rw-r--r--test/Headers/limits.cpp42
-rw-r--r--test/Headers/ms-intrin.cpp24
-rw-r--r--test/Headers/ms-null-ms-header-vs-stddef.cpp4
-rw-r--r--test/Headers/ms-wchar.c2
-rw-r--r--test/Headers/tgmath.c38
-rw-r--r--test/Headers/x86-intrinsics-headers.c6
-rw-r--r--test/Headers/x86intrin.c91
-rw-r--r--test/Index/Inputs/CommentXML/invalid-function-13.xml13
-rw-r--r--test/Index/Inputs/CommentXML/valid-function-07.xml19
-rw-r--r--test/Index/Inputs/empty.h0
-rw-r--r--test/Index/Inputs/lit.local.cfg1
-rw-r--r--test/Index/Inputs/preamble-with-error.h3
-rw-r--r--test/Index/TestClassDecl.m4
-rw-r--r--test/Index/TestClassForwardDecl.m4
-rw-r--r--test/Index/annotate-comments-objc.m78
-rw-r--r--test/Index/annotate-comments-unterminated.c2
-rw-r--r--test/Index/annotate-comments.cpp10
-rw-r--r--test/Index/annotate-tokens-cxx0x.cpp44
-rw-r--r--test/Index/annotate-tokens.m22
-rw-r--r--test/Index/annotate-toplevel-in-objccontainer.m6
-rw-r--r--test/Index/asm-attribute.c3
-rw-r--r--test/Index/attributes.c10
-rw-r--r--test/Index/availability.c10
-rw-r--r--test/Index/c-index-api-loadTU-test.m14
-rw-r--r--test/Index/c-index-unsupported-warning-test.c3
-rw-r--r--test/Index/cindex-from-source.m2
-rw-r--r--test/Index/comment-custom-block-command.cpp2
-rw-r--r--test/Index/comment-misc-tags.m3
-rw-r--r--test/Index/comment-to-html-xml-conversion.cpp292
-rw-r--r--test/Index/comment-unqualified-objc-pointer.m2
-rw-r--r--test/Index/comment-xml-schema.c31
-rw-r--r--test/Index/complete-documentation-properties.m14
-rw-r--r--test/Index/complete-documentation-templates.cpp14
-rw-r--r--test/Index/complete-documentation.cpp6
-rw-r--r--test/Index/complete-modules.m8
-rw-r--r--test/Index/complete-pch.m2
-rw-r--r--test/Index/complete-preamble.cpp2
-rw-r--r--test/Index/complete-qualified.cpp2
-rw-r--r--test/Index/crash-recovery-modules.m15
-rw-r--r--test/Index/create-tu-fail.c2
-rw-r--r--test/Index/error-on-deserialized.c2
-rw-r--r--test/Index/file-includes.c3
-rw-r--r--test/Index/get-cursor.m24
-rw-r--r--test/Index/index-decls.m19
-rw-r--r--test/Index/index-file.cpp13
-rw-r--r--test/Index/index-module.m2
-rw-r--r--test/Index/overrides.cpp7
-rw-r--r--test/Index/overriding-method-comments.mm10
-rw-r--r--test/Index/pch-with-errors.c4
-rw-r--r--test/Index/pch-with-errors.m6
-rw-r--r--test/Index/pch-with-module.m23
-rw-r--r--test/Index/preamble-reparse-with-BOM.m6
-rw-r--r--test/Index/preamble.c8
-rw-r--r--test/Index/print-type-cxx11.cpp8
-rw-r--r--test/Index/print-type-size.cpp50
-rw-r--r--test/Index/print-type.c5
-rw-r--r--test/Index/print-type.cpp15
-rw-r--r--test/Index/recover-bad-code-rdar_7487294.c2
-rw-r--r--test/Index/retain-comments-from-system-headers.c2
-rw-r--r--test/Index/subclass-comment.mm66
-rw-r--r--test/Index/usrs.m2
-rw-r--r--test/Layout/ms-x86-aligned-tail-padding.cpp502
-rw-r--r--test/Layout/ms-x86-basic-layout.cpp775
-rw-r--r--test/Layout/ms-x86-bitfields-vbases.cpp84
-rw-r--r--test/Layout/ms-x86-empty-base-after-base-with-vbptr.cpp216
-rw-r--r--test/Layout/ms-x86-empty-nonvirtual-bases.cpp174
-rw-r--r--test/Layout/ms-x86-empty-virtual-base.cpp704
-rw-r--r--test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp735
-rw-r--r--test/Layout/ms-x86-misalignedarray.cpp23
-rw-r--r--test/Layout/ms-x86-primary-bases.cpp317
-rw-r--r--test/Layout/ms-x86-size-alignment-fail.cpp123
-rw-r--r--test/Layout/ms-x86-vfvb-alignment.cpp376
-rw-r--r--test/Layout/ms-x86-vfvb-sharing.cpp140
-rw-r--r--test/Layout/ms-x86-vtordisp.cpp170
-rw-r--r--test/Lexer/Inputs/bad-header-guard-defined.h4
-rw-r--r--test/Lexer/Inputs/bad-header-guard.h4
-rw-r--r--test/Lexer/Inputs/different-define.h4
-rw-r--r--test/Lexer/Inputs/good-header-guard.h4
-rw-r--r--test/Lexer/Inputs/multiple.h4
-rw-r--r--test/Lexer/Inputs/no-define.h3
-rw-r--r--test/Lexer/Inputs/out-of-order-define.h7
-rw-r--r--test/Lexer/Inputs/tokens-between-ifndef-and-define.h7
-rw-r--r--test/Lexer/Inputs/unlikely-to-be-header-guard.h5
-rw-r--r--test/Lexer/builtin_redef.c2
-rw-r--r--test/Lexer/char-literal.cpp4
-rw-r--r--test/Lexer/constants.c7
-rw-r--r--test/Lexer/cxx-features.cpp89
-rw-r--r--test/Lexer/cxx0x_raw_string_unterminated.cpp2
-rw-r--r--test/Lexer/cxx1y_binary_literal.cpp1
-rw-r--r--test/Lexer/cxx1y_digit_separators.cpp43
-rw-r--r--test/Lexer/dollar-idents.c2
-rw-r--r--test/Lexer/gnu-flags.c56
-rw-r--r--test/Lexer/has_extension_cxx.cpp20
-rw-r--r--test/Lexer/has_feature_cxx0x.cpp50
-rw-r--r--test/Lexer/header.cpp44
-rw-r--r--test/Lexer/newline-eof-c++11.cpp5
-rw-r--r--test/Lexer/newline-eof-c++98-compat.cpp1
-rw-r--r--test/Lexer/newline-eof.c8
-rw-r--r--test/Lexer/pragma-operators.cpp22
-rw-r--r--test/Lexer/string-literal-errors.cpp2
-rw-r--r--test/Lexer/wchar-signedness.c4
-rw-r--r--test/Makefile3
-rw-r--r--test/Misc/ast-dump-attr.cpp16
-rw-r--r--test/Misc/ast-dump-color.cpp8
-rw-r--r--test/Misc/ast-dump-decl.cpp16
-rw-r--r--test/Misc/ast-dump-stmt.cpp28
-rw-r--r--test/Misc/ast-dump-templates.cpp12
-rw-r--r--test/Misc/caret-diags-scratch-buffer.c2
-rw-r--r--test/Misc/dev-fd-fs.c3
-rw-r--r--test/Misc/diag-format.c3
-rw-r--r--test/Misc/diag-line-wrapping.cpp4
-rw-r--r--test/Misc/diag-macro-backtrace.c2
-rw-r--r--test/Misc/diag-mapping.c6
-rw-r--r--test/Misc/diag-mapping2.c4
-rw-r--r--test/Misc/diag-presumed.c4
-rw-r--r--test/Misc/diag-template-diffing-color.cpp4
-rw-r--r--test/Misc/diag-template-diffing-cxx98.cpp2
-rw-r--r--test/Misc/diag-template-diffing.cpp79
-rw-r--r--test/Misc/diag-trailing-null-bytes.cpp2
-rw-r--r--test/Misc/diag-verify.cpp2
-rw-r--r--test/Misc/error-limit-multiple-notes.cpp2
-rw-r--r--test/Misc/error-limit.c2
-rw-r--r--test/Misc/include-stack-for-note-flag.cpp10
-rw-r--r--test/Misc/languageOptsOpenCL.cl19
-rw-r--r--test/Misc/permissions.cpp15
-rw-r--r--test/Misc/show-diag-options.c4
-rw-r--r--test/Misc/tabstop.c6
-rw-r--r--test/Misc/unprintable.c2
-rw-r--r--test/Misc/warning-flags-tree.c5
-rw-r--r--test/Misc/warning-flags.c21
-rw-r--r--test/Modules/Inputs/DependsOnModule.framework/Headers/not_cxx.h1
-rw-r--r--test/Modules/Inputs/DependsOnModule.framework/Headers/not_objc.h1
-rw-r--r--test/Modules/Inputs/DependsOnModule.framework/module.map8
-rw-r--r--test/Modules/Inputs/MethodPoolBSub.h1
-rw-r--r--test/Modules/Inputs/MethodPoolBSub2.h3
-rw-r--r--test/Modules/Inputs/System/usr/include/stdio.h2
-rw-r--r--test/Modules/Inputs/cxx-decls-imported.h5
-rw-r--r--test/Modules/Inputs/cxx-decls-unimported.h1
-rw-r--r--test/Modules/Inputs/cxx-templates-a.h50
-rw-r--r--test/Modules/Inputs/cxx-templates-b-impl.h5
-rw-r--r--test/Modules/Inputs/cxx-templates-b.h69
-rw-r--r--test/Modules/Inputs/cxx-templates-c.h7
-rw-r--r--test/Modules/Inputs/cxx-templates-common.h11
-rw-r--r--test/Modules/Inputs/declare-use/a.h4
-rw-r--r--test/Modules/Inputs/declare-use/b.h4
-rw-r--r--test/Modules/Inputs/declare-use/c.h6
-rw-r--r--test/Modules/Inputs/declare-use/d.h6
-rw-r--r--test/Modules/Inputs/declare-use/e.h6
-rw-r--r--test/Modules/Inputs/declare-use/f.h6
-rw-r--r--test/Modules/Inputs/declare-use/g.h6
-rw-r--r--test/Modules/Inputs/declare-use/g1.h1
-rw-r--r--test/Modules/Inputs/declare-use/h.h7
-rw-r--r--test/Modules/Inputs/declare-use/h1.h1
-rw-r--r--test/Modules/Inputs/declare-use/module.map43
-rw-r--r--test/Modules/Inputs/def.h7
-rw-r--r--test/Modules/Inputs/dummy.h3
-rw-r--r--test/Modules/Inputs/incomplete_mod.h1
-rw-r--r--test/Modules/Inputs/incomplete_mod_missing.h2
-rw-r--r--test/Modules/Inputs/initializer_list9
-rw-r--r--test/Modules/Inputs/modular_maps/a.h4
-rw-r--r--test/Modules/Inputs/modular_maps/b.h4
-rw-r--r--test/Modules/Inputs/modular_maps/common.h4
-rw-r--r--test/Modules/Inputs/modular_maps/modulea.map7
-rw-r--r--test/Modules/Inputs/modular_maps/moduleb.map4
-rw-r--r--test/Modules/Inputs/module.map72
-rw-r--r--test/Modules/Inputs/namespaces-top.h5
-rw-r--r--test/Modules/Inputs/odr/a.h13
-rw-r--r--test/Modules/Inputs/odr/b.h9
-rw-r--r--test/Modules/Inputs/odr/module.map6
-rw-r--r--test/Modules/Inputs/pch-used.h2
-rw-r--r--test/Modules/Inputs/private/common.h6
-rw-r--r--test/Modules/Inputs/private/module.map9
-rw-r--r--test/Modules/Inputs/private/private1.h9
-rw-r--r--test/Modules/Inputs/private/private2.h9
-rw-r--r--test/Modules/Inputs/private/public1.h9
-rw-r--r--test/Modules/Inputs/private/public2.h9
-rw-r--r--test/Modules/Inputs/private0/common.h6
-rw-r--r--test/Modules/Inputs/private1/module.map4
-rw-r--r--test/Modules/Inputs/private1/private1.h9
-rw-r--r--test/Modules/Inputs/private1/public1.h9
-rw-r--r--test/Modules/Inputs/private2/module.map4
-rw-r--r--test/Modules/Inputs/private2/private2.h9
-rw-r--r--test/Modules/Inputs/private2/public2.h9
-rw-r--r--test/Modules/Inputs/recursive_visibility_a1_inner.h4
-rw-r--r--test/Modules/Inputs/recursive_visibility_a2_more_inner.h4
-rw-r--r--test/Modules/Inputs/recursive_visibility_b.h2
-rw-r--r--test/Modules/Inputs/recursive_visibility_c.h5
-rw-r--r--test/Modules/Inputs/separate_map_tree/maps/modulea.map12
-rw-r--r--test/Modules/Inputs/separate_map_tree/maps/moduleb.map4
-rw-r--r--test/Modules/Inputs/separate_map_tree/maps/modulec.map5
-rw-r--r--test/Modules/Inputs/separate_map_tree/src/common.h4
-rw-r--r--test/Modules/Inputs/separate_map_tree/src/private-in-c.h4
-rw-r--r--test/Modules/Inputs/separate_map_tree/src/public-in-b.h4
-rw-r--r--test/Modules/Inputs/separate_map_tree/src/public-in-c.h4
-rw-r--r--test/Modules/Inputs/submodules/import-self-a.h1
-rw-r--r--test/Modules/Inputs/submodules/import-self-b.h10
-rw-r--r--test/Modules/Inputs/submodules/import-self-c.h1
-rw-r--r--test/Modules/Inputs/submodules/import-self-d.h1
-rw-r--r--test/Modules/Inputs/submodules/module.map7
-rw-r--r--test/Modules/Inputs/templates-left.h6
-rw-r--r--test/Modules/Inputs/templates-right.h6
-rw-r--r--test/Modules/Inputs/templates-top.h8
-rw-r--r--test/Modules/Inputs/using-decl-a.h10
-rw-r--r--test/Modules/Inputs/using-decl-b.h11
-rw-r--r--test/Modules/Inputs/warning.h1
-rw-r--r--test/Modules/auto-module-import.m27
-rw-r--r--test/Modules/autolink.m2
-rw-r--r--test/Modules/build-fail-notes.m6
-rw-r--r--test/Modules/compiler_builtins_arm.m6
-rw-r--r--test/Modules/cxx-decls.cpp21
-rw-r--r--test/Modules/cxx-templates.cpp125
-rw-r--r--test/Modules/cycles.c2
-rw-r--r--test/Modules/declare-use1.cpp7
-rw-r--r--test/Modules/declare-use2.cpp7
-rw-r--r--test/Modules/decldef.m12
-rw-r--r--test/Modules/decldef.mm24
-rw-r--r--test/Modules/driver.c4
-rw-r--r--test/Modules/epic-fail.m2
-rw-r--r--test/Modules/fatal-module-loader-error.m26
-rw-r--r--test/Modules/import-decl.cpp9
-rw-r--r--test/Modules/incomplete-module.m5
-rw-r--r--test/Modules/initializer_list.cpp7
-rw-r--r--test/Modules/load_failure.c2
-rw-r--r--test/Modules/macros.c2
-rw-r--r--test/Modules/method_pool.m4
-rw-r--r--test/Modules/modular_maps.cpp8
-rw-r--r--test/Modules/namespaces.cpp7
-rw-r--r--test/Modules/normal-module-map.cpp4
-rw-r--r--test/Modules/objc-categories.m1
-rw-r--r--test/Modules/odr.cpp20
-rw-r--r--test/Modules/pch-used.m8
-rw-r--r--test/Modules/private.cpp13
-rw-r--r--test/Modules/private1.cpp13
-rw-r--r--test/Modules/recursive_visibility.mm9
-rw-r--r--test/Modules/requires.m3
-rw-r--r--test/Modules/requires.mm6
-rw-r--r--test/Modules/self-import-header/af.framework/Headers/a1.h4
-rw-r--r--test/Modules/self-import-header/af.framework/Headers/a2.h1
-rw-r--r--test/Modules/self-import-header/af.framework/module.map4
-rw-r--r--test/Modules/self-import-header/depend_builtin/h1.h1
-rw-r--r--test/Modules/self-import-header/depend_builtin/module.map5
-rw-r--r--test/Modules/self-import-header/test.m8
-rw-r--r--test/Modules/separate_map_tree.cpp8
-rw-r--r--test/Modules/subframeworks.m3
-rw-r--r--test/Modules/submodules.cpp15
-rw-r--r--test/Modules/system_headers.m8
-rw-r--r--test/Modules/templates.mm37
-rw-r--r--test/Modules/using-decl.cpp8
-rw-r--r--test/OpenMP/openmp_common.c2
-rw-r--r--test/OpenMP/parallel_ast_print.cpp60
-rw-r--r--test/OpenMP/parallel_default_messages.cpp21
-rw-r--r--test/OpenMP/parallel_firstprivate_messages.cpp82
-rw-r--r--test/OpenMP/parallel_messages.cpp53
-rw-r--r--test/OpenMP/parallel_private_messages.cpp81
-rw-r--r--test/OpenMP/parallel_shared_messages.cpp83
-rw-r--r--test/OpenMP/predefined_macro.c1
-rw-r--r--test/OpenMP/threadprivate_ast_print.cpp20
-rw-r--r--test/OpenMP/threadprivate_messages.cpp46
-rw-r--r--test/PCH/Inputs/chain-selectors2.h2
-rw-r--r--test/PCH/arc.m4
-rw-r--r--test/PCH/badpch.c4
-rw-r--r--test/PCH/chain-categories2.m1
-rw-r--r--test/PCH/chain-cxx.cpp3
-rw-r--r--test/PCH/chain-friend-instantiation.cpp1
-rw-r--r--test/PCH/chain-selectors.m6
-rw-r--r--test/PCH/check-deserializations.cpp28
-rw-r--r--test/PCH/cxx-friends.cpp8
-rw-r--r--test/PCH/cxx-friends.h25
-rw-r--r--test/PCH/cxx-member-init.cpp14
-rw-r--r--test/PCH/cxx-namespaces.cpp15
-rw-r--r--test/PCH/cxx-namespaces.h3
-rw-r--r--test/PCH/cxx-templates.cpp29
-rw-r--r--test/PCH/cxx-templates.h42
-rw-r--r--test/PCH/cxx-traits.cpp4
-rw-r--r--test/PCH/cxx-traits.h4
-rw-r--r--test/PCH/cxx-typeid.cpp6
-rw-r--r--test/PCH/cxx11-lambdas.mm13
-rw-r--r--test/PCH/cxx1y-deduced-return-type.cpp34
-rw-r--r--test/PCH/cxx1y-init-captures.cpp28
-rw-r--r--test/PCH/cxx1y-lambdas.mm58
-rw-r--r--test/PCH/cxx1y-variable-templates.cpp171
-rw-r--r--test/PCH/debug-info-limited-struct.c4
-rw-r--r--test/PCH/debug-info-limited-struct.h8
-rw-r--r--test/PCH/exprs.h4
-rw-r--r--test/PCH/external-defs.c2
-rw-r--r--test/PCH/floating-literal.c4
-rw-r--r--test/PCH/irgen-rdar13114142.mm2
-rw-r--r--test/PCH/line-directive.c4
-rw-r--r--test/PCH/modified-header-error.c2
-rw-r--r--test/PCH/objc_container.m4
-rw-r--r--test/PCH/objc_import.h11
-rw-r--r--test/PCH/objc_import.m15
-rw-r--r--test/PCH/objc_literals.m10
-rw-r--r--test/PCH/objc_literals.mm4
-rw-r--r--test/PCH/objcxx-ivar-class.mm4
-rw-r--r--test/PCH/pch-dir.c8
-rw-r--r--test/PCH/pragma-diag-section.cpp16
-rw-r--r--test/PCH/pragma-weak.c4
-rw-r--r--test/PCH/preamble.c2
-rw-r--r--test/PCH/pth.c4
-rw-r--r--test/PCH/rdar10830559.cpp2
-rw-r--r--test/PCH/remap-file-from-pch.cpp2
-rw-r--r--test/Parser/DelayedTemplateParsing.cpp24
-rw-r--r--test/Parser/MicrosoftExtensions.c25
-rw-r--r--test/Parser/MicrosoftExtensions.cpp83
-rw-r--r--test/Parser/PR11000.cpp2
-rw-r--r--test/Parser/altivec-csk-bool.c14
-rw-r--r--test/Parser/attr-availability.c2
-rw-r--r--test/Parser/attributes.c2
-rw-r--r--test/Parser/crash-report.c2
-rw-r--r--test/Parser/cxx-altivec.cpp6
-rw-r--r--test/Parser/cxx-ambig-init-templ.cpp171
-rw-r--r--test/Parser/cxx-attributes.cpp14
-rw-r--r--test/Parser/cxx-class-template-specialization.cpp8
-rw-r--r--test/Parser/cxx-decl.cpp49
-rw-r--r--test/Parser/cxx-default-args.cpp17
-rw-r--r--test/Parser/cxx-friend.cpp4
-rw-r--r--test/Parser/cxx-member-crash.cpp4
-rw-r--r--test/Parser/cxx-member-initializers.cpp72
-rw-r--r--test/Parser/cxx-template-argument.cpp65
-rw-r--r--test/Parser/cxx-template-decl.cpp14
-rw-r--r--test/Parser/cxx-using-directive.cpp9
-rw-r--r--test/Parser/cxx0x-attributes.cpp38
-rw-r--r--test/Parser/cxx0x-decl.cpp31
-rw-r--r--test/Parser/cxx0x-in-cxx98.cpp7
-rw-r--r--test/Parser/cxx0x-lambda-expressions.cpp16
-rw-r--r--test/Parser/cxx0x-member-initializers.cpp10
-rw-r--r--test/Parser/cxx11-stmt-attributes.cpp5
-rw-r--r--test/Parser/declarators.c3
-rw-r--r--test/Parser/expressions.c10
-rw-r--r--test/Parser/objc-diag-width.mm2
-rw-r--r--test/Parser/objc-error-qualified-implementation.m8
-rw-r--r--test/Parser/objcxx0x-lambda-expressions.mm24
-rw-r--r--test/Parser/parser_overflow.c8
-rw-r--r--test/Parser/pragma-fp-contract.c2
-rw-r--r--test/Parser/pragma-weak.c27
-rw-r--r--test/Parser/recovery.cpp73
-rw-r--r--test/Parser/switch-recovery.cpp6
-rw-r--r--test/Preprocessor/_Pragma.c3
-rw-r--r--test/Preprocessor/aarch64-target-features.c32
-rw-r--r--test/Preprocessor/arm-target-features.c157
-rw-r--r--test/Preprocessor/assembler-with-cpp.c7
-rw-r--r--test/Preprocessor/feature_tests.c1
-rw-r--r--test/Preprocessor/has_attribute.c4
-rw-r--r--test/Preprocessor/hash_line.c13
-rw-r--r--test/Preprocessor/ifdef-recover.c2
-rw-r--r--test/Preprocessor/init.c568
-rw-r--r--test/Preprocessor/iwithprefix.c7
-rw-r--r--test/Preprocessor/line-directive-output.c3
-rw-r--r--test/Preprocessor/line-directive.c4
-rw-r--r--test/Preprocessor/macro_backslash.c3
-rw-r--r--test/Preprocessor/macro_expand_empty.c14
-rw-r--r--test/Preprocessor/macro_fn.c5
-rw-r--r--test/Preprocessor/macro_paste_bad.c2
-rw-r--r--test/Preprocessor/macro_paste_bcpl_comment.c2
-rw-r--r--test/Preprocessor/macro_paste_empty.c10
-rw-r--r--test/Preprocessor/macro_paste_msextensions.c2
-rw-r--r--test/Preprocessor/macro_with_initializer_list.cpp182
-rw-r--r--test/Preprocessor/microsoft-ext.c12
-rw-r--r--test/Preprocessor/optimize.c2
-rw-r--r--test/Preprocessor/pragma_microsoft.c33
-rw-r--r--test/Preprocessor/pragma_microsoft.cpp3
-rw-r--r--test/Preprocessor/predefined-arch-macros.c246
-rw-r--r--test/Preprocessor/predefined-macros.c18
-rw-r--r--test/Preprocessor/stdint.c332
-rw-r--r--test/Preprocessor/traditional-cpp.c23
-rw-r--r--test/Preprocessor/ucn-pp-identifier.c2
-rw-r--r--test/Preprocessor/warn-macro-unused.c4
-rw-r--r--test/Preprocessor/x86_target_features.c264
-rw-r--r--test/Rewriter/blockcast3.mm4
-rw-r--r--test/Rewriter/dllimport-typedef.c4
-rw-r--r--test/Rewriter/inner-block-helper-funcs.mm2
-rw-r--r--test/Rewriter/line-generation-test.m4
-rw-r--r--test/Rewriter/lit.local.cfg2
-rw-r--r--test/Rewriter/missing-dllimport.c4
-rw-r--r--test/Rewriter/objc-modern-StretAPI-3.mm58
-rw-r--r--test/Rewriter/objc-modern-boxing.mm4
-rw-r--r--test/Rewriter/objc-modern-fast-enumeration.mm25
-rw-r--r--test/Rewriter/objc-modern-numeric-literal.mm4
-rw-r--r--test/Rewriter/objc-modern-property-attributes.mm12
-rw-r--r--test/Rewriter/rewrite-cast-ivar-access.mm2
-rw-r--r--test/Rewriter/rewrite-category-property.mm2
-rw-r--r--test/Rewriter/rewrite-foreach-5.m2
-rw-r--r--test/Rewriter/rewrite-foreach-6.m2
-rw-r--r--test/Rewriter/rewrite-foreach-in-block.mm4
-rw-r--r--test/Rewriter/rewrite-foreach-protocol-id.m2
-rw-r--r--test/Rewriter/rewrite-forward-class.mm13
-rw-r--r--test/Rewriter/rewrite-interface-locals.mm20
-rw-r--r--test/Rewriter/rewrite-line-directive.m4
-rw-r--r--test/Rewriter/rewrite-message-expr.mm2
-rw-r--r--test/Rewriter/rewrite-modern-default-property-synthesis.mm2
-rw-r--r--test/Rewriter/rewrite-modern-synchronized.m15
-rw-r--r--test/Rewriter/rewrite-modern-typeof.mm2
-rw-r--r--test/Rewriter/rewrite-typeof.mm2
-rw-r--r--test/Sema/128bitfloat.cc24
-rw-r--r--test/Sema/128bitint.c4
-rw-r--r--test/Sema/Inputs/ms-keyword-system-header.h9
-rw-r--r--test/Sema/MicrosoftCompatibility.cpp6
-rw-r--r--test/Sema/MicrosoftExtensions.c34
-rw-r--r--test/Sema/aarch64-neon-vector-types.c33
-rw-r--r--test/Sema/address_spaces.c2
-rw-r--r--test/Sema/alias-redefinition.c44
-rw-r--r--test/Sema/align-x86-64.c10
-rw-r--r--test/Sema/alloc_size.c6
-rw-r--r--test/Sema/annotate.c6
-rw-r--r--test/Sema/arm-asm.c5
-rw-r--r--test/Sema/arm-darwin-aapcs.cpp12
-rw-r--r--test/Sema/arm-interrupt-attr.c16
-rw-r--r--test/Sema/array-init.c3
-rw-r--r--test/Sema/array-size-64.c9
-rw-r--r--test/Sema/atomic-expr.c13
-rw-r--r--test/Sema/atomic-ops.c16
-rw-r--r--test/Sema/atomic-requires-library-error.c31
-rw-r--r--test/Sema/attr-alias-elf.c54
-rw-r--r--test/Sema/attr-args.c50
-rw-r--r--test/Sema/attr-bounded.c15
-rw-r--r--test/Sema/attr-cleanup.c22
-rw-r--r--test/Sema/attr-deprecated.c4
-rw-r--r--test/Sema/attr-endian.c3
-rw-r--r--test/Sema/attr-format.c2
-rw-r--r--test/Sema/attr-mode.c18
-rw-r--r--test/Sema/attr-naked.c4
-rw-r--r--test/Sema/attr-nodebug.c4
-rw-r--r--test/Sema/attr-noinline.c2
-rw-r--r--test/Sema/attr-noreturn.c6
-rw-r--r--test/Sema/attr-ownership.c19
-rw-r--r--test/Sema/attr-print.c19
-rw-r--r--test/Sema/attr-regparm.c4
-rw-r--r--test/Sema/attr-returns-twice.c2
-rw-r--r--test/Sema/attr-section.c2
-rw-r--r--test/Sema/attr-tls_model.c4
-rw-r--r--test/Sema/attr-unavailable-message.c9
-rw-r--r--test/Sema/attr-unused.c2
-rw-r--r--test/Sema/attr-visibility.c2
-rw-r--r--test/Sema/block-args.c11
-rw-r--r--test/Sema/builtin-clear_cache.c5
-rw-r--r--test/Sema/builtins-aarch64.c5
-rw-r--r--test/Sema/builtins-arm-exclusive.c61
-rw-r--r--test/Sema/builtins-arm-strex-rettype.c8
-rw-r--r--test/Sema/builtins-arm.c16
-rw-r--r--test/Sema/builtins-gnu-mode.c27
-rw-r--r--test/Sema/builtins.c8
-rw-r--r--test/Sema/c89.c11
-rw-r--r--test/Sema/callingconv-ms_abi.c9
-rw-r--r--test/Sema/callingconv-sysv_abi.c9
-rw-r--r--test/Sema/callingconv.c28
-rw-r--r--test/Sema/captured-statements.c12
-rw-r--r--test/Sema/carbon.c3
-rw-r--r--test/Sema/cast.c8
-rw-r--r--test/Sema/constant-builtins-2.c118
-rw-r--r--test/Sema/convertvector.c17
-rw-r--r--test/Sema/declspec.c13
-rw-r--r--test/Sema/designated-initializers.c66
-rw-r--r--test/Sema/dllimport-dllexport.c5
-rw-r--r--test/Sema/empty1.c85
-rw-r--r--test/Sema/empty2.c43
-rw-r--r--test/Sema/enum-increment.c13
-rw-r--r--test/Sema/ext_vector_casts.c26
-rw-r--r--test/Sema/extern-redecl.c24
-rw-r--r--test/Sema/format-strings-ms.c25
-rw-r--r--test/Sema/format-strings.c10
-rw-r--r--test/Sema/freemain.c2
-rw-r--r--test/Sema/function.c10
-rw-r--r--test/Sema/gnu-flags.c171
-rw-r--r--test/Sema/init.c3
-rw-r--r--test/Sema/inline.c13
-rw-r--r--test/Sema/member-reference.c5
-rw-r--r--test/Sema/mips16_attr_allowed.c20
-rw-r--r--test/Sema/mrtd.c38
-rw-r--r--test/Sema/ms-inline-asm.c12
-rw-r--r--test/Sema/ms-keyword-system-header.c17
-rw-r--r--test/Sema/ms-wchar.c18
-rw-r--r--test/Sema/ms_abi-sysv_abi.c14
-rw-r--r--test/Sema/ms_bitfield_layout.c243
-rw-r--r--test/Sema/ms_class_layout.cpp88
-rw-r--r--test/Sema/neon-vector-types-support.c4
-rw-r--r--test/Sema/neon-vector-types.c7
-rw-r--r--test/Sema/nonnull.c3
-rw-r--r--test/Sema/offsetof-64.c22
-rw-r--r--test/Sema/offsetof.c1
-rw-r--r--test/Sema/overloadable.c18
-rw-r--r--test/Sema/parentheses.c2
-rw-r--r--test/Sema/pragma-weak.c11
-rw-r--r--test/Sema/string-init.c51
-rw-r--r--test/Sema/string-plus-char.c15
-rw-r--r--test/Sema/struct-decl.c9
-rw-r--r--test/Sema/thread-specifier.c4
-rw-r--r--test/Sema/types.c8
-rw-r--r--test/Sema/varargs.c7
-rw-r--r--test/Sema/varargs.cpp7
-rw-r--r--test/Sema/vfprintf-valid-redecl.c11
-rw-r--r--test/Sema/warn-documentation-fixits.cpp26
-rw-r--r--test/Sema/warn-documentation.cpp91
-rw-r--r--test/Sema/warn-documentation.m57
-rw-r--r--test/Sema/warn-main-return-type.c4
-rw-r--r--test/Sema/warn-main.c12
-rw-r--r--test/Sema/warn-null.c11
-rw-r--r--test/Sema/warn-outof-range-assign-enum.c12
-rw-r--r--test/Sema/warn-shadow-intrinsics.c11
-rw-r--r--test/Sema/warn-thread-safety-analysis.c123
-rw-r--r--test/Sema/warn-type-safety.c4
-rw-r--r--test/Sema/warn-unsequenced.c88
-rw-r--r--test/Sema/warn-unused-function.c6
-rw-r--r--test/Sema/warn-unused-label.c4
-rw-r--r--test/Sema/warn-unused-parameters.c2
-rw-r--r--test/Sema/warn-variable-not-needed.c9
-rw-r--r--test/Sema/wchar.c4
-rw-r--r--test/SemaCXX/Inputs/lit.local.cfg1
-rw-r--r--test/SemaCXX/Inputs/register.h5
-rw-r--r--test/SemaCXX/Inputs/warn-unused-variables.h2
-rw-r--r--test/SemaCXX/MicrosoftCompatibility.cpp16
-rw-r--r--test/SemaCXX/MicrosoftExtensions.cpp79
-rw-r--r--test/SemaCXX/PR10447.cpp4
-rw-r--r--test/SemaCXX/PR12778.cpp7
-rw-r--r--test/SemaCXX/PR9572.cpp2
-rw-r--r--test/SemaCXX/__try.cpp20
-rw-r--r--test/SemaCXX/abstract.cpp36
-rw-r--r--test/SemaCXX/access.cpp34
-rw-r--r--test/SemaCXX/addr-of-overloaded-function-casting.cpp8
-rw-r--r--test/SemaCXX/addr-of-overloaded-function.cpp37
-rw-r--r--test/SemaCXX/alignment-of-derived-class.cpp41
-rw-r--r--test/SemaCXX/alignof-sizeof-reference.cpp4
-rw-r--r--test/SemaCXX/alignof.cpp14
-rw-r--r--test/SemaCXX/ambiguous-conversion-show-overload.cpp2
-rw-r--r--test/SemaCXX/anonymous-union.cpp9
-rw-r--r--test/SemaCXX/ast-print.cpp16
-rw-r--r--test/SemaCXX/attr-aligned.cpp16
-rw-r--r--test/SemaCXX/attr-cleanup-gcc.cpp16
-rw-r--r--test/SemaCXX/attr-cleanup.cpp29
-rw-r--r--test/SemaCXX/attr-common.cpp3
-rw-r--r--test/SemaCXX/attr-cxx0x.cpp4
-rw-r--r--test/SemaCXX/attr-deprecated.cpp6
-rw-r--r--test/SemaCXX/attr-no-sanitize-address.cpp2
-rw-r--r--test/SemaCXX/attr-no-sanitize-memory.cpp2
-rw-r--r--test/SemaCXX/attr-no-sanitize-thread.cpp2
-rw-r--r--test/SemaCXX/attr-print.cpp6
-rw-r--r--test/SemaCXX/attr-selectany.cpp33
-rw-r--r--test/SemaCXX/attr-used.cpp5
-rw-r--r--test/SemaCXX/attr-weakref.cpp2
-rw-r--r--test/SemaCXX/blocks-1.cpp18
-rw-r--r--test/SemaCXX/bool.cpp2
-rw-r--r--test/SemaCXX/builtins.cpp22
-rw-r--r--test/SemaCXX/c99.cpp2
-rw-r--r--test/SemaCXX/calling-conv-compat.cpp387
-rw-r--r--test/SemaCXX/captured-statements.cpp7
-rw-r--r--test/SemaCXX/cast-conversion.cpp18
-rw-r--r--test/SemaCXX/class-base-member-init.cpp10
-rw-r--r--test/SemaCXX/class-layout.cpp469
-rw-r--r--test/SemaCXX/class.cpp6
-rw-r--r--test/SemaCXX/compare.cpp67
-rw-r--r--test/SemaCXX/complex-overload.cpp12
-rw-r--r--test/SemaCXX/compound-literal.cpp10
-rw-r--r--test/SemaCXX/conditional-expr.cpp2
-rw-r--r--test/SemaCXX/const-cast.cpp2
-rw-r--r--test/SemaCXX/constant-expression-cxx11.cpp388
-rw-r--r--test/SemaCXX/constant-expression-cxx1y.cpp468
-rw-r--r--test/SemaCXX/constexpr-backtrace-limit.cpp8
-rw-r--r--test/SemaCXX/constexpr-duffs-device.cpp32
-rw-r--r--test/SemaCXX/constexpr-steps.cpp17
-rw-r--r--test/SemaCXX/constexpr-turing.cpp16
-rw-r--r--test/SemaCXX/constexpr-value-init.cpp2
-rw-r--r--test/SemaCXX/conversion-delete-expr.cpp24
-rw-r--r--test/SemaCXX/conversion-function.cpp4
-rw-r--r--test/SemaCXX/conversion-incomplete-type.cpp23
-rw-r--r--test/SemaCXX/crashes.cpp47
-rw-r--r--test/SemaCXX/cxx0x-class.cpp2
-rw-r--r--test/SemaCXX/cxx0x-compat.cpp9
-rw-r--r--test/SemaCXX/cxx0x-initializer-aggregates.cpp27
-rw-r--r--test/SemaCXX/cxx0x-initializer-references.cpp25
-rw-r--r--test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp24
-rw-r--r--test/SemaCXX/cxx0x-nontrivial-union.cpp22
-rw-r--r--test/SemaCXX/cxx11-attr-print.cpp5
-rw-r--r--test/SemaCXX/cxx11-crashes.cpp4
-rw-r--r--test/SemaCXX/cxx11-gnu-attrs.cpp5
-rw-r--r--test/SemaCXX/cxx11-thread-local-print.cpp6
-rw-r--r--test/SemaCXX/cxx1y-array-runtime-bound.cpp68
-rw-r--r--test/SemaCXX/cxx1y-contextual-conversion-tweaks.cpp177
-rw-r--r--test/SemaCXX/cxx1y-deduced-return-type.cpp152
-rw-r--r--test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp1363
-rw-r--r--test/SemaCXX/cxx1y-generic-lambdas.cpp908
-rw-r--r--test/SemaCXX/cxx1y-init-captures.cpp169
-rw-r--r--test/SemaCXX/cxx1y-sized-deallocation.cpp17
-rw-r--r--test/SemaCXX/cxx1y-user-defined-literals.cpp44
-rw-r--r--test/SemaCXX/cxx1y-variable-templates_in_class.cpp299
-rw-r--r--test/SemaCXX/cxx1y-variable-templates_top_level.cpp434
-rw-r--r--test/SemaCXX/cxx98-compat-pedantic.cpp18
-rw-r--r--test/SemaCXX/cxx98-compat.cpp86
-rw-r--r--test/SemaCXX/dcl_ambig_res.cpp4
-rw-r--r--test/SemaCXX/decl-expr-ambiguity.cpp1
-rw-r--r--test/SemaCXX/decl-init-ref.cpp11
-rw-r--r--test/SemaCXX/decl-microsoft-call-conv.cpp143
-rw-r--r--test/SemaCXX/decltype.cpp8
-rw-r--r--test/SemaCXX/default-assignment-operator.cpp8
-rw-r--r--test/SemaCXX/default1.cpp11
-rw-r--r--test/SemaCXX/deprecated.cpp67
-rw-r--r--test/SemaCXX/destructor.cpp4
-rw-r--r--test/SemaCXX/dynamic-cast.cpp2
-rw-r--r--test/SemaCXX/enum-increment.cpp16
-rw-r--r--test/SemaCXX/enum-scoped.cpp30
-rw-r--r--test/SemaCXX/enum-unscoped-nonexistent.cpp4
-rw-r--r--test/SemaCXX/err_init_conversion_failed.cpp45
-rw-r--r--test/SemaCXX/explicit.cpp91
-rw-r--r--test/SemaCXX/expression-traits.cpp4
-rw-r--r--test/SemaCXX/extern-c.cpp174
-rw-r--r--test/SemaCXX/flexible-array-test.cpp4
-rw-r--r--test/SemaCXX/for-range-examples.cpp31
-rw-r--r--test/SemaCXX/format-strings-0x.cpp4
-rw-r--r--test/SemaCXX/friend.cpp138
-rw-r--r--test/SemaCXX/function-pointer-arguments.cpp52
-rw-r--r--test/SemaCXX/function-redecl.cpp18
-rw-r--r--test/SemaCXX/function-type-qual.cpp8
-rw-r--r--test/SemaCXX/gnu-flags.cpp76
-rw-r--r--test/SemaCXX/i-c-e-cxx.cpp2
-rw-r--r--test/SemaCXX/implicit-virtual-member-functions.cpp6
-rw-r--r--test/SemaCXX/inherit.cpp3
-rw-r--r--test/SemaCXX/init-priority-attr.cpp4
-rw-r--r--test/SemaCXX/lambda-expressions.cpp65
-rw-r--r--test/SemaCXX/libstdcxx_pointer_return_false_hack.cpp34
-rw-r--r--test/SemaCXX/linkage-spec.cpp61
-rw-r--r--test/SemaCXX/linkage2.cpp55
-rw-r--r--test/SemaCXX/member-expr.cpp54
-rw-r--r--test/SemaCXX/member-init.cpp11
-rw-r--r--test/SemaCXX/member-pointer-ms.cpp5
-rw-r--r--test/SemaCXX/microsoft-dtor-lookup.cpp87
-rw-r--r--test/SemaCXX/microsoft-new-delete.cpp12
-rw-r--r--test/SemaCXX/missing-members.cpp10
-rw-r--r--test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp8
-rw-r--r--test/SemaCXX/ms-overload-entry-point.cpp21
-rw-r--r--test/SemaCXX/ms-wchar.cpp12
-rw-r--r--test/SemaCXX/ms_struct.cpp18
-rw-r--r--test/SemaCXX/ms_wide_bitfield.cpp9
-rw-r--r--test/SemaCXX/neon-vector-types.cpp2
-rw-r--r--test/SemaCXX/nested-name-spec.cpp22
-rw-r--r--test/SemaCXX/new-delete-0x.cpp4
-rw-r--r--test/SemaCXX/new-delete.cpp15
-rw-r--r--test/SemaCXX/no-rtti.cpp19
-rw-r--r--test/SemaCXX/no-warn-unused-const-variables.cpp6
-rw-r--r--test/SemaCXX/nullptr.cpp3
-rw-r--r--test/SemaCXX/offsetof.cpp10
-rw-r--r--test/SemaCXX/operator-arrow-depth.cpp26
-rw-r--r--test/SemaCXX/overload-decl.cpp8
-rw-r--r--test/SemaCXX/overloaded-operator.cpp20
-rw-r--r--test/SemaCXX/parentheses.cpp8
-rw-r--r--test/SemaCXX/pr13394-crash-on-invalid.cpp17
-rw-r--r--test/SemaCXX/predefined-expr.cpp103
-rw-r--r--test/SemaCXX/qualified-id-lookup.cpp6
-rw-r--r--test/SemaCXX/references.cpp7
-rw-r--r--test/SemaCXX/scope-check.cpp21
-rw-r--r--test/SemaCXX/self-comparison.cpp23
-rw-r--r--test/SemaCXX/static-data-member.cpp17
-rw-r--r--test/SemaCXX/storage-class.cpp2
-rw-r--r--test/SemaCXX/string-init.cpp40
-rw-r--r--test/SemaCXX/string-plus-char.cpp32
-rw-r--r--test/SemaCXX/struct-class-redecl.cpp2
-rw-r--r--test/SemaCXX/switch.cpp15
-rw-r--r--test/SemaCXX/trailing-return-0x.cpp8
-rw-r--r--test/SemaCXX/type-traits.cpp65
-rw-r--r--test/SemaCXX/typo-correction-pt2.cpp201
-rw-r--r--test/SemaCXX/typo-correction.cpp96
-rw-r--r--test/SemaCXX/uninitialized.cpp211
-rw-r--r--test/SemaCXX/unknown-type-name.cpp4
-rw-r--r--test/SemaCXX/using-decl-1.cpp42
-rw-r--r--test/SemaCXX/using-decl-templates.cpp14
-rw-r--r--test/SemaCXX/vararg-non-pod.cpp50
-rw-r--r--test/SemaCXX/vector.cpp19
-rw-r--r--test/SemaCXX/virtual-base-used.cpp8
-rw-r--r--test/SemaCXX/virtual-member-functions-key-function.cpp4
-rw-r--r--test/SemaCXX/virtual-override-x86.cpp4
-rw-r--r--test/SemaCXX/virtuals.cpp6
-rw-r--r--test/SemaCXX/warn-consumed-analysis.cpp795
-rw-r--r--test/SemaCXX/warn-consumed-parsing.cpp55
-rw-r--r--test/SemaCXX/warn-dangling-field.cpp16
-rw-r--r--test/SemaCXX/warn-div-or-rem-by-zero.cpp21
-rw-r--r--test/SemaCXX/warn-empty-body.cpp5
-rw-r--r--test/SemaCXX/warn-func-not-needed.cpp9
-rw-r--r--test/SemaCXX/warn-global-constructors.cpp6
-rw-r--r--test/SemaCXX/warn-logical-not-compare.cpp194
-rw-r--r--test/SemaCXX/warn-loop-analysis.cpp108
-rw-r--r--test/SemaCXX/warn-member-not-needed.cpp11
-rw-r--r--test/SemaCXX/warn-missing-variable-declarations.cpp6
-rw-r--r--test/SemaCXX/warn-reinterpret-base-class.cpp2
-rw-r--r--test/SemaCXX/warn-thread-safety-analysis.cpp413
-rw-r--r--test/SemaCXX/warn-thread-safety-parsing.cpp60
-rw-r--r--test/SemaCXX/warn-unreachable.cpp4
-rw-r--r--test/SemaCXX/warn-unsequenced.cpp14
-rw-r--r--test/SemaCXX/warn-unused-attribute.cpp20
-rw-r--r--test/SemaCXX/warn-unused-filescoped.cpp81
-rw-r--r--test/SemaCXX/warn-unused-private-field.cpp2
-rw-r--r--test/SemaCXX/warn-unused-result.cpp16
-rw-r--r--test/SemaCXX/warn-unused-value.cpp20
-rw-r--r--test/SemaCXX/warn-unused-variables.cpp25
-rw-r--r--test/SemaCXX/warn-using-namespace-in-header.cpp9
-rw-r--r--test/SemaCXX/writable-strings-deprecated.cpp4
-rw-r--r--test/SemaObjC/arc-bridged-cast.m2
-rw-r--r--test/SemaObjC/arc-cf.m12
-rw-r--r--test/SemaObjC/arc-decls.m24
-rw-r--r--test/SemaObjC/arc-dict-bridged-cast.m2
-rw-r--r--test/SemaObjC/arc-property-lifetime.m32
-rw-r--r--test/SemaObjC/arc-readonly-property-ivar-1.m4
-rw-r--r--test/SemaObjC/arc-repeated-weak.mm15
-rw-r--r--test/SemaObjC/arc-unavailable-for-weakref.m4
-rw-r--r--test/SemaObjC/arc.m19
-rw-r--r--test/SemaObjC/attr-objc-exception.m4
-rw-r--r--test/SemaObjC/attr-objc-gc.m6
-rw-r--r--test/SemaObjC/attr-print.m9
-rw-r--r--test/SemaObjC/attr-root-class.m6
-rw-r--r--test/SemaObjC/bad-property-synthesis-crash.m2
-rw-r--r--test/SemaObjC/blocks.m15
-rw-r--r--test/SemaObjC/call-super-2.m6
-rw-r--r--test/SemaObjC/class-def-test-1.m5
-rw-r--r--test/SemaObjC/compare-qualified-id.m2
-rw-r--r--test/SemaObjC/conditional-expr.m3
-rw-r--r--test/SemaObjC/conversion.m17
-rw-r--r--test/SemaObjC/dealloc.m2
-rw-r--r--test/SemaObjC/default-synthesize-1.m2
-rw-r--r--test/SemaObjC/default-synthesize-2.m4
-rw-r--r--test/SemaObjC/default-synthesize-3.m74
-rw-r--r--test/SemaObjC/default-synthesize.m2
-rw-r--r--test/SemaObjC/deprecated-objc-introspection.m7
-rw-r--r--test/SemaObjC/direct-synthesized-ivar-access.m2
-rw-r--r--test/SemaObjC/error-outof-scope-property-use.m8
-rw-r--r--test/SemaObjC/foreach.m6
-rw-r--r--test/SemaObjC/format-arg-attribute.m34
-rw-r--r--test/SemaObjC/format-strings-objc.m7
-rw-r--r--test/SemaObjC/forward-protocol-incomplete-impl-warn.m2
-rw-r--r--test/SemaObjC/iboutlet.m4
-rw-r--r--test/SemaObjC/iboutletcollection-attr.m17
-rw-r--r--test/SemaObjC/idiomatic-parentheses.m7
-rw-r--r--test/SemaObjC/instancetype.m2
-rw-r--r--test/SemaObjC/ivar-lookup.m74
-rw-r--r--test/SemaObjC/ivar-ref-misuse.m5
-rw-r--r--test/SemaObjC/message.m2
-rw-r--r--test/SemaObjC/method-bad-param.m14
-rw-r--r--test/SemaObjC/method-conflict-2.m49
-rw-r--r--test/SemaObjC/method-not-defined.m2
-rw-r--r--test/SemaObjC/method-sentinel-attr.m2
-rw-r--r--test/SemaObjC/missing-atend-metadata.m2
-rw-r--r--test/SemaObjC/nsobject-attribute.m2
-rw-r--r--test/SemaObjC/objc-array-literal.m16
-rw-r--r--test/SemaObjC/objc-dictionary-literal.m2
-rw-r--r--test/SemaObjC/objcbridge-attribute.m66
-rw-r--r--test/SemaObjC/overriding-property-in-class-extension.m3
-rw-r--r--test/SemaObjC/property-5.m2
-rw-r--r--test/SemaObjC/property-ambiguous-synthesis.m48
-rw-r--r--test/SemaObjC/property-category-1.m2
-rw-r--r--test/SemaObjC/property-choose-expr.m14
-rw-r--r--test/SemaObjC/property-in-class-extension-1.m9
-rw-r--r--test/SemaObjC/property-ownership-attr.m19
-rw-r--r--test/SemaObjC/protocol-id-test-1.m4
-rw-r--r--test/SemaObjC/protocol-id-test-2.m2
-rw-r--r--test/SemaObjC/provisional-ivar-lookup.m2
-rw-r--r--test/SemaObjC/related-result-type-inference.m18
-rw-r--r--test/SemaObjC/selector-3.m35
-rw-r--r--test/SemaObjC/self-comparison.m12
-rw-r--r--test/SemaObjC/sign-conversion.m39
-rw-r--r--test/SemaObjC/super-class-protocol-conformance.m2
-rw-r--r--test/SemaObjC/super-dealloc-attribute.m49
-rw-r--r--test/SemaObjC/super-property-notation.m2
-rw-r--r--test/SemaObjC/synth-provisional-ivars-1.m2
-rw-r--r--test/SemaObjC/synth-provisional-ivars.m2
-rw-r--r--test/SemaObjC/synthesized-ivar.m2
-rw-r--r--test/SemaObjC/tentative-property-decl.m4
-rw-r--r--test/SemaObjC/unimplemented-protocol-prop.m2
-rw-r--r--test/SemaObjC/unsued-backing-ivar-warning.m76
-rw-r--r--test/SemaObjC/warn-direct-ivar-access.m2
-rw-r--r--test/SemaObjC/warn-implicit-atomic-property.m2
-rw-r--r--test/SemaObjC/warn-missing-super.m2
-rw-r--r--test/SemaObjC/warn-retain-block-property.m4
-rw-r--r--test/SemaObjCXX/abstract-class-type-ivar.mm4
-rw-r--r--test/SemaObjCXX/arc-nsconsumed-errors.mm5
-rw-r--r--test/SemaObjCXX/arc-templates.mm10
-rw-r--r--test/SemaObjCXX/contextual-convert-to-id.mm33
-rw-r--r--test/SemaObjCXX/exceptions.mm11
-rw-r--r--test/SemaObjCXX/instancetype.mm2
-rw-r--r--test/SemaObjCXX/ivar-construct.mm2
-rw-r--r--test/SemaObjCXX/microsoft-abi-byval.mm14
-rw-r--r--test/SemaObjCXX/missing-lhs-gun-extension.mm23
-rw-r--r--test/SemaObjCXX/overload-1.mm25
-rw-r--r--test/SemaObjCXX/overload.mm17
-rw-r--r--test/SemaObjCXX/properties.mm39
-rw-r--r--test/SemaObjCXX/property-synthesis-error.mm2
-rw-r--r--test/SemaOpenCL/endian-attr.cl8
-rw-r--r--test/SemaOpenCL/event_t.cl3
-rw-r--r--test/SemaOpenCL/invalid-kernel-attrs.cl4
-rw-r--r--test/SemaOpenCL/invalid-kernel-parameters.cl132
-rw-r--r--test/SemaOpenCL/invalid-kernel.cl10
-rw-r--r--test/SemaOpenCL/str_literals.cl13
-rw-r--r--test/SemaOpenCL/vector_inc_dec_ops.cl19
-rw-r--r--test/SemaTemplate/alias-nested-nontag.cpp3
-rw-r--r--test/SemaTemplate/alias-templates.cpp35
-rw-r--r--test/SemaTemplate/array-to-pointer-decay.cpp12
-rw-r--r--test/SemaTemplate/canonical-expr-type.cpp6
-rw-r--r--test/SemaTemplate/class-template-decl.cpp4
-rw-r--r--test/SemaTemplate/constexpr-instantiate.cpp4
-rw-r--r--test/SemaTemplate/deduction-crash.cpp36
-rw-r--r--test/SemaTemplate/default-arguments-cxx0x.cpp31
-rw-r--r--test/SemaTemplate/default-arguments.cpp39
-rw-r--r--test/SemaTemplate/dependent-expr.cpp21
-rw-r--r--test/SemaTemplate/dependent-names.cpp13
-rw-r--r--test/SemaTemplate/derived.cpp24
-rw-r--r--test/SemaTemplate/destructor-template.cpp8
-rw-r--r--test/SemaTemplate/exception-spec-crash.cpp30
-rw-r--r--test/SemaTemplate/explicit-instantiation.cpp58
-rw-r--r--test/SemaTemplate/explicit-specialization-member.cpp28
-rw-r--r--test/SemaTemplate/extension-sfinae.cpp12
-rw-r--r--test/SemaTemplate/friend-template.cpp17
-rw-r--r--test/SemaTemplate/function-template-specialization-noreturn.cpp8
-rw-r--r--test/SemaTemplate/function-template-specialization.cpp12
-rw-r--r--test/SemaTemplate/instantiate-exception-spec-cxx11.cpp13
-rw-r--r--test/SemaTemplate/instantiate-expr-5.cpp10
-rw-r--r--test/SemaTemplate/instantiate-function-params.cpp17
-rw-r--r--test/SemaTemplate/instantiate-init.cpp15
-rw-r--r--test/SemaTemplate/instantiate-local-class.cpp117
-rw-r--r--test/SemaTemplate/instantiate-member-class.cpp2
-rw-r--r--test/SemaTemplate/instantiate-member-pointers.cpp9
-rw-r--r--test/SemaTemplate/instantiate-overload-candidates.cpp2
-rw-r--r--test/SemaTemplate/instantiate-partial-spec.cpp23
-rw-r--r--test/SemaTemplate/instantiate-using-decl.cpp24
-rw-r--r--test/SemaTemplate/local-member-templates.cpp76
-rw-r--r--test/SemaTemplate/lookup-dependent-bases.cpp2
-rw-r--r--test/SemaTemplate/ms-class-specialization-class-scope.cpp49
-rw-r--r--test/SemaTemplate/ms-lookup-template-base-classes.cpp40
-rw-r--r--test/SemaTemplate/nested-template.cpp1
-rw-r--r--test/SemaTemplate/overload-candidates.cpp45
-rw-r--r--test/SemaTemplate/recovery-crash.cpp19
-rw-r--r--test/SemaTemplate/resolve-single-template-id.cpp4
-rw-r--r--test/SemaTemplate/temp_arg_nontype.cpp34
-rw-r--r--test/SemaTemplate/temp_arg_template.cpp11
-rw-r--r--test/SemaTemplate/virtual-member-functions.cpp14
-rw-r--r--test/Tooling/Inputs/lit.local.cfg1
-rw-r--r--test/Tooling/auto-detect-from-source-parent-of-cwd.cpp6
-rw-r--r--test/Tooling/auto-detect-from-source-parent.cpp2
-rw-r--r--test/Tooling/auto-detect-from-source.cpp2
-rw-r--r--test/Tooling/clang-check-analyzer.cpp4
-rw-r--r--test/Tooling/clang-check-args.cpp2
-rw-r--r--test/Tooling/clang-check-autodetect-dir.cpp2
-rw-r--r--test/Tooling/clang-check-builtin-headers.cpp2
-rw-r--r--test/Tooling/clang-check-chdir.cpp2
-rw-r--r--test/Tooling/clang-check-extra-arg.cpp5
-rw-r--r--test/Tooling/clang-check-pwd.cpp6
-rw-r--r--test/Tooling/clang-check-rel-path.cpp10
-rw-r--r--test/Tooling/clang-check-strip-o.cpp11
-rw-r--r--test/Tooling/clang-check.cpp2
-rw-r--r--test/Tooling/ms-asm-no-target.cpp13
-rw-r--r--test/Tooling/multi-jobs.cpp5
-rw-r--r--test/Unit/lit.cfg17
-rw-r--r--test/Unit/lit.site.cfg.in15
-rw-r--r--test/lit.cfg119
-rw-r--r--test/lit.site.cfg.in17
2612 files changed, 126843 insertions, 7978 deletions
diff --git a/test/.clang-format b/test/.clang-format
new file mode 100644
index 000000000000..4799b66f3e9a
--- /dev/null
+++ b/test/.clang-format
@@ -0,0 +1,2 @@
+BasedOnStyle: LLVM
+ColumnLimit: 0
diff --git a/test/ARCMT/Inputs/test1.m.in b/test/ARCMT/Inputs/test1.m.in
index 8416a8896569..44a3c4cf3d93 100644
--- a/test/ARCMT/Inputs/test1.m.in
+++ b/test/ARCMT/Inputs/test1.m.in
@@ -4,3 +4,13 @@
void test1(id p) {
[p release];
}
+
+@interface Test2
+@property (strong) id prop;
+@end
+
+@implementation Test2
+-(id)init {
+ _prop = 0;
+}
+@end
diff --git a/test/ARCMT/Inputs/test1.m.in.result b/test/ARCMT/Inputs/test1.m.in.result
index f351fe6c8355..1db9bf7ad65c 100644
--- a/test/ARCMT/Inputs/test1.m.in.result
+++ b/test/ARCMT/Inputs/test1.m.in.result
@@ -3,3 +3,13 @@
void test1(id p) {
}
+
+@interface Test2
+@property (strong) id prop;
+@end
+
+@implementation Test2
+-(id)init {
+ _prop = 0;
+}
+@end
diff --git a/test/ARCMT/checking-in-arc.m b/test/ARCMT/checking-in-arc.m
new file mode 100644
index 000000000000..40d9b1684576
--- /dev/null
+++ b/test/ARCMT/checking-in-arc.m
@@ -0,0 +1,51 @@
+// RUN: %clang_cc1 -arcmt-check -fobjc-arc -fobjc-runtime=macosx-10.8.0 -triple x86_64-apple-darwin12 -fblocks -Werror %s
+// DISABLE: mingw32
+
+#if __has_feature(objc_arc)
+#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
+#else
+#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE
+#endif
+
+typedef const void * CFTypeRef;
+CFTypeRef CFBridgingRetain(id X);
+id CFBridgingRelease(CFTypeRef);
+
+typedef int BOOL;
+typedef unsigned NSUInteger;
+
+@protocol NSObject
+- (id)retain NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
+- (NSUInteger)retainCount NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
+- (oneway void)release NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
+- (id)autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
+@end
+
+@interface NSObject <NSObject> {}
+- (id)init;
+
++ (id)new;
++ (id)alloc;
+- (void)dealloc;
+
+- (void)finalize;
+
+- (id)copy;
+- (id)mutableCopy;
+@end
+
+typedef const struct __CFString * CFStringRef;
+extern const CFStringRef kUTTypePlainText;
+extern const CFStringRef kUTTypeRTF;
+@class NSString;
+
+@interface Test : NSObject
+@property (weak) NSString *weakProperty;
+@end
+
+@implementation Test
+@end
+
+#if ! __has_feature(objc_arc)
+#error This file must be compiled with ARC (set -fobjc_arc flag on file)
+#endif
diff --git a/test/ARCMT/checking.m b/test/ARCMT/checking.m
index b06f4a731dc7..a550633171d1 100644
--- a/test/ARCMT/checking.m
+++ b/test/ARCMT/checking.m
@@ -333,7 +333,9 @@ void rdar9504750(id p) {
}
@end
-@interface Test10 : NSObject
+@interface Test10 : NSObject {
+ CFStringRef cfstr;
+}
@property (retain) id prop;
-(void)foo;
@end
@@ -342,3 +344,13 @@ void test(Test10 *x) {
x.prop = ^{ [x foo]; }; // expected-warning {{likely to lead to a retain cycle}} \
// expected-note {{retained by the captured object}}
}
+
+@implementation Test10
+-(void)foo {
+ ^{
+ NSString *str = (NSString *)cfstr; // expected-error {{cast of C pointer type 'CFStringRef' (aka 'const struct __CFString *') to Objective-C pointer type 'NSString *' requires a bridged cast}} \
+ // expected-note {{use __bridge to convert directly (no change in ownership)}} \
+ // expected-note {{use CFBridgingRelease call to transfer ownership of a +1 'CFStringRef' (aka 'const struct __CFString *') into ARC}}
+ };
+}
+@end
diff --git a/test/ARCMT/driver-migrate.m b/test/ARCMT/driver-migrate.m
index a912ad95b156..b1e419ae6fb3 100644
--- a/test/ARCMT/driver-migrate.m
+++ b/test/ARCMT/driver-migrate.m
@@ -10,3 +10,6 @@
// LINK-NOT: {{ld(.exe)?"}}
// LINK: {{touch(.exe)?"}}
+
+// RUN: %clang -### -ccc-arcmt-migrate /foo/bar -fsyntax-only -fno-objc-arc %s 2>&1 | FileCheck -check-prefix=CHECK-NOARC %s
+// CHECK-NOARC-NOT: argument unused during compilation
diff --git a/test/ARCMT/lit.local.cfg b/test/ARCMT/lit.local.cfg
new file mode 100644
index 000000000000..4b28d6dff8a3
--- /dev/null
+++ b/test/ARCMT/lit.local.cfg
@@ -0,0 +1,2 @@
+if config.root.clang_arcmt == 0:
+ config.unsupported = True
diff --git a/test/ARCMT/objcmt-arc-cf-annotations.m b/test/ARCMT/objcmt-arc-cf-annotations.m
new file mode 100644
index 000000000000..9772825b2934
--- /dev/null
+++ b/test/ARCMT/objcmt-arc-cf-annotations.m
@@ -0,0 +1,2047 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fblocks -objcmt-migrate-annotation -objcmt-migrate-instancetype -objcmt-migrate-readwrite-property -mt-migrate-directory %t %s -x objective-c -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s.result
+
+#ifndef CF_IMPLICIT_BRIDGING_ENABLED
+#if __has_feature(arc_cf_code_audited)
+#define CF_IMPLICIT_BRIDGING_ENABLED _Pragma("clang arc_cf_code_audited begin")
+#else
+#define CF_IMPLICIT_BRIDGING_ENABLED
+#endif
+#endif
+
+#ifndef CF_IMPLICIT_BRIDGING_DISABLED
+#if __has_feature(arc_cf_code_audited)
+#define CF_IMPLICIT_BRIDGING_DISABLED _Pragma("clang arc_cf_code_audited end")
+#else
+#define CF_IMPLICIT_BRIDGING_DISABLED
+#endif
+#endif
+
+#if __has_feature(attribute_ns_returns_retained)
+#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
+#endif
+#if __has_feature(attribute_cf_returns_retained)
+#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
+#endif
+#if __has_feature(attribute_ns_returns_not_retained)
+#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
+#endif
+#if __has_feature(attribute_cf_returns_not_retained)
+#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
+#endif
+#if __has_feature(attribute_ns_consumes_self)
+#define NS_CONSUMES_SELF __attribute__((ns_consumes_self))
+#endif
+#if __has_feature(attribute_ns_consumed)
+#define NS_CONSUMED __attribute__((ns_consumed))
+#endif
+#if __has_feature(attribute_cf_consumed)
+#define CF_CONSUMED __attribute__((cf_consumed))
+#endif
+#if __has_attribute(ns_returns_autoreleased)
+#define NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
+#endif
+
+//===----------------------------------------------------------------------===//
+// The following code is reduced using delta-debugging from Mac OS X headers:
+//
+// #include <Cocoa/Cocoa.h>
+// #include <CoreFoundation/CoreFoundation.h>
+// #include <DiskArbitration/DiskArbitration.h>
+// #include <QuartzCore/QuartzCore.h>
+// #include <Quartz/Quartz.h>
+// #include <IOKit/IOKitLib.h>
+//
+// It includes the basic definitions for the test cases below.
+//===----------------------------------------------------------------------===//
+
+typedef unsigned int __darwin_natural_t;
+typedef unsigned long uintptr_t;
+typedef unsigned int uint32_t;
+typedef unsigned long long uint64_t;
+typedef unsigned int UInt32;
+typedef signed long CFIndex;
+typedef CFIndex CFByteOrder;
+typedef struct {
+ CFIndex location;
+ CFIndex length;
+} CFRange;
+static __inline__ __attribute__((always_inline)) CFRange CFRangeMake(CFIndex loc, CFIndex len) {
+ CFRange range;
+ range.location = loc;
+ range.length = len;
+ return range;
+}
+typedef const void * CFTypeRef;
+typedef const struct __CFString * CFStringRef;
+typedef const struct __CFAllocator * CFAllocatorRef;
+extern const CFAllocatorRef kCFAllocatorDefault;
+extern CFTypeRef CFRetain(CFTypeRef cf);
+extern void CFRelease(CFTypeRef cf);
+extern CFTypeRef CFMakeCollectable(CFTypeRef cf);
+typedef struct {
+}
+CFArrayCallBacks;
+extern const CFArrayCallBacks kCFTypeArrayCallBacks;
+typedef const struct __CFArray * CFArrayRef;
+typedef struct __CFArray * CFMutableArrayRef;
+extern CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFArrayCallBacks *callBacks);
+extern const void *CFArrayGetValueAtIndex(CFArrayRef theArray, CFIndex idx);
+extern void CFArrayAppendValue(CFMutableArrayRef theArray, const void *value);
+typedef struct {
+}
+CFDictionaryKeyCallBacks;
+extern const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
+typedef struct {
+}
+CFDictionaryValueCallBacks;
+extern const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
+typedef const struct __CFDictionary * CFDictionaryRef;
+typedef struct __CFDictionary * CFMutableDictionaryRef;
+extern CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks);
+typedef UInt32 CFStringEncoding;
+enum {
+kCFStringEncodingMacRoman = 0, kCFStringEncodingWindowsLatin1 = 0x0500, kCFStringEncodingISOLatin1 = 0x0201, kCFStringEncodingNextStepLatin = 0x0B01, kCFStringEncodingASCII = 0x0600, kCFStringEncodingUnicode = 0x0100, kCFStringEncodingUTF8 = 0x08000100, kCFStringEncodingNonLossyASCII = 0x0BFF , kCFStringEncodingUTF16 = 0x0100, kCFStringEncodingUTF16BE = 0x10000100, kCFStringEncodingUTF16LE = 0x14000100, kCFStringEncodingUTF32 = 0x0c000100, kCFStringEncodingUTF32BE = 0x18000100, kCFStringEncodingUTF32LE = 0x1c000100 };
+extern CFStringRef CFStringCreateWithCString(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding);
+typedef double CFTimeInterval;
+typedef CFTimeInterval CFAbsoluteTime;
+extern CFAbsoluteTime CFAbsoluteTimeGetCurrent(void);
+typedef const struct __CFDate * CFDateRef;
+extern CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at);
+extern CFAbsoluteTime CFDateGetAbsoluteTime(CFDateRef theDate);
+typedef __darwin_natural_t natural_t;
+typedef natural_t mach_port_name_t;
+typedef mach_port_name_t mach_port_t;
+typedef int kern_return_t;
+typedef kern_return_t mach_error_t;
+enum {
+kCFNumberSInt8Type = 1, kCFNumberSInt16Type = 2, kCFNumberSInt32Type = 3, kCFNumberSInt64Type = 4, kCFNumberFloat32Type = 5, kCFNumberFloat64Type = 6, kCFNumberCharType = 7, kCFNumberShortType = 8, kCFNumberIntType = 9, kCFNumberLongType = 10, kCFNumberLongLongType = 11, kCFNumberFloatType = 12, kCFNumberDoubleType = 13, kCFNumberCFIndexType = 14, kCFNumberNSIntegerType = 15, kCFNumberCGFloatType = 16, kCFNumberMaxType = 16 };
+typedef CFIndex CFNumberType;
+typedef const struct __CFNumber * CFNumberRef;
+extern CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr);
+typedef const struct __CFAttributedString *CFAttributedStringRef;
+typedef struct __CFAttributedString *CFMutableAttributedStringRef;
+extern CFAttributedStringRef CFAttributedStringCreate(CFAllocatorRef alloc, CFStringRef str, CFDictionaryRef attributes) ;
+extern CFMutableAttributedStringRef CFAttributedStringCreateMutableCopy(CFAllocatorRef alloc, CFIndex maxLength, CFAttributedStringRef aStr) ;
+extern void CFAttributedStringSetAttribute(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef attrName, CFTypeRef value) ;
+typedef signed char BOOL;
+typedef unsigned long NSUInteger;
+@class NSString, Protocol;
+extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
+typedef struct _NSZone NSZone;
+@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
+@protocol NSObject
+- (BOOL)isEqual:(id)object;
+- (id)retain;
+- (oneway void)release;
+- (id)autorelease;
+- (NSString *)description;
+- (id)init;
+@end
+@protocol NSCopying
+- (id)copyWithZone:(NSZone *)zone;
+@end
+@protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone;
+@end
+@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
+@end
+@interface NSObject <NSObject> {}
++ (id)allocWithZone:(NSZone *)zone;
++ (id)alloc;
++ (id)new;
+- (void)dealloc;
+@end
+@interface NSObject (NSCoderMethods)
+- (id)awakeAfterUsingCoder:(NSCoder *)aDecoder;
+@end
+extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
+typedef struct {
+}
+NSFastEnumerationState;
+@protocol NSFastEnumeration
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;
+@end
+@class NSString, NSDictionary;
+@interface NSValue : NSObject <NSCopying, NSCoding> - (void)getValue:(void *)value;
+@end
+@interface NSNumber : NSValue
+- (char)charValue;
+- (id)initWithInt:(int)value;
++ (NSNumber *)numberWithInt:(int)value;
+@end
+@class NSString;
+@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>
+- (NSUInteger)count;
+- (id)initWithObjects:(const id [])objects count:(NSUInteger)cnt;
++ (id)arrayWithObject:(id)anObject;
++ (id)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt;
++ (id)arrayWithObjects:(id)firstObj, ... __attribute__((sentinel(0,1)));
+- (id)initWithObjects:(id)firstObj, ... __attribute__((sentinel(0,1)));
+- (id)initWithArray:(NSArray *)array;
+@end @interface NSArray (NSArrayCreation) + (id)array;
+@end @interface NSAutoreleasePool : NSObject {
+}
+- (void)drain;
+@end extern NSString * const NSBundleDidLoadNotification;
+typedef double NSTimeInterval;
+@interface NSDate : NSObject <NSCopying, NSCoding> - (NSTimeInterval)timeIntervalSinceReferenceDate;
+@end typedef unsigned short unichar;
+@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding>
+- (NSUInteger)length;
+- (NSString *)stringByAppendingString:(NSString *)aString;
+- ( const char *)UTF8String;
+- (id)initWithUTF8String:(const char *)nullTerminatedCString;
++ (id)stringWithUTF8String:(const char *)nullTerminatedCString;
+@end @class NSString, NSURL, NSError;
+@interface NSData : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length;
++ (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length;
++ (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
+@end @class NSLocale, NSDate, NSCalendar, NSTimeZone, NSError, NSArray, NSMutableDictionary;
+@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>
+- (NSUInteger)count;
++ (id)dictionaryWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
++ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;
+@end
+@interface NSMutableDictionary : NSDictionary - (void)removeObjectForKey:(id)aKey;
+- (void)setObject:(id)anObject forKey:(id)aKey;
+@end @interface NSMutableDictionary (NSMutableDictionaryCreation) + (id)dictionaryWithCapacity:(NSUInteger)numItems;
+@end typedef double CGFloat;
+struct CGSize {
+};
+typedef struct CGSize CGSize;
+struct CGRect {
+};
+typedef struct CGRect CGRect;
+typedef mach_port_t io_object_t;
+typedef char io_name_t[128];
+typedef io_object_t io_iterator_t;
+typedef io_object_t io_service_t;
+typedef struct IONotificationPort * IONotificationPortRef;
+typedef void (*IOServiceMatchingCallback)( void * refcon, io_iterator_t iterator );
+io_service_t IOServiceGetMatchingService( mach_port_t masterPort, CFDictionaryRef matching );
+kern_return_t IOServiceGetMatchingServices( mach_port_t masterPort, CFDictionaryRef matching, io_iterator_t * existing );
+kern_return_t IOServiceAddNotification( mach_port_t masterPort, const io_name_t notificationType, CFDictionaryRef matching, mach_port_t wakePort, uintptr_t reference, io_iterator_t * notification ) __attribute__((deprecated)); // expected-note {{'IOServiceAddNotification' declared here}}
+kern_return_t IOServiceAddMatchingNotification( IONotificationPortRef notifyPort, const io_name_t notificationType, CFDictionaryRef matching, IOServiceMatchingCallback callback, void * refCon, io_iterator_t * notification );
+CFMutableDictionaryRef IOServiceMatching( const char * name );
+CFMutableDictionaryRef IOServiceNameMatching( const char * name );
+CFMutableDictionaryRef IOBSDNameMatching( mach_port_t masterPort, uint32_t options, const char * bsdName );
+CFMutableDictionaryRef IOOpenFirmwarePathMatching( mach_port_t masterPort, uint32_t options, const char * path );
+CFMutableDictionaryRef IORegistryEntryIDMatching( uint64_t entryID );
+typedef struct __DASession * DASessionRef;
+extern DASessionRef DASessionCreate( CFAllocatorRef allocator );
+typedef struct __DADisk * DADiskRef;
+extern DADiskRef DADiskCreateFromBSDName( CFAllocatorRef allocator, DASessionRef session, const char * name );
+extern DADiskRef DADiskCreateFromIOMedia( CFAllocatorRef allocator, DASessionRef session, io_service_t media );
+extern CFDictionaryRef DADiskCopyDescription( DADiskRef disk );
+extern DADiskRef DADiskCopyWholeDisk( DADiskRef disk );
+@interface NSTask : NSObject - (id)init;
+@end typedef struct CGColorSpace *CGColorSpaceRef;
+typedef struct CGImage *CGImageRef;
+typedef struct CGLayer *CGLayerRef;
+@interface NSResponder : NSObject <NSCoding> {
+}
+@end @protocol NSAnimatablePropertyContainer - (id)animator;
+@end extern NSString *NSAnimationTriggerOrderIn ;
+@interface NSView : NSResponder <NSAnimatablePropertyContainer> {
+}
+@end @protocol NSValidatedUserInterfaceItem - (SEL)action;
+@end @protocol NSUserInterfaceValidations - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem;
+@end @class NSDate, NSDictionary, NSError, NSException, NSNotification;
+@class NSTextField, NSPanel, NSArray, NSWindow, NSImage, NSButton, NSError;
+@interface NSApplication : NSResponder <NSUserInterfaceValidations> {
+}
+- (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)docWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
+@end enum {
+NSTerminateCancel = 0, NSTerminateNow = 1, NSTerminateLater = 2 };
+typedef NSUInteger NSApplicationTerminateReply;
+@protocol NSApplicationDelegate <NSObject> @optional - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
+@end @class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView, NSTextView;
+@interface NSCell : NSObject <NSCopying, NSCoding> {
+}
+@end
+typedef struct {
+}
+CVTimeStamp;
+@interface CIImage : NSObject <NSCoding, NSCopying> {
+}
+typedef int CIFormat;
+@end enum {
+kDAReturnSuccess = 0, kDAReturnError = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x01, kDAReturnBusy = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x02, kDAReturnBadArgument = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x03, kDAReturnExclusiveAccess = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x04, kDAReturnNoResources = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x05, kDAReturnNotFound = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x06, kDAReturnNotMounted = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x07, kDAReturnNotPermitted = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x08, kDAReturnNotPrivileged = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x09, kDAReturnNotReady = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0A, kDAReturnNotWritable = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0B, kDAReturnUnsupported = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0C };
+typedef mach_error_t DAReturn;
+typedef const struct __DADissenter * DADissenterRef;
+extern DADissenterRef DADissenterCreate( CFAllocatorRef allocator, DAReturn status, CFStringRef string );
+@interface CIContext: NSObject {
+}
+- (CGImageRef)createCGImage:(CIImage *)im fromRect:(CGRect)r;
+- (CGImageRef)createCGImage:(CIImage *)im fromRect:(CGRect)r format:(CIFormat)f colorSpace:(CGColorSpaceRef)cs;
+- (CGLayerRef)createCGLayerWithSize:(CGSize)size info:(CFDictionaryRef)d;
+@end extern NSString* const QCRendererEventKey;
+@protocol QCCompositionRenderer - (NSDictionary*) attributes;
+@end @interface QCRenderer : NSObject <QCCompositionRenderer> {
+}
+- (id) createSnapshotImageOfType:(NSString*)type;
+@end extern NSString* const QCViewDidStartRenderingNotification;
+@interface QCView : NSView <QCCompositionRenderer> {
+}
+- (id) createSnapshotImageOfType:(NSString*)type;
+@end enum {
+ICEXIFOrientation1 = 1, ICEXIFOrientation2 = 2, ICEXIFOrientation3 = 3, ICEXIFOrientation4 = 4, ICEXIFOrientation5 = 5, ICEXIFOrientation6 = 6, ICEXIFOrientation7 = 7, ICEXIFOrientation8 = 8, };
+@class ICDevice;
+@protocol ICDeviceDelegate <NSObject> @required - (void)didRemoveDevice:(ICDevice*)device;
+@end extern NSString *const ICScannerStatusWarmingUp;
+@class ICScannerDevice;
+@protocol ICScannerDeviceDelegate <ICDeviceDelegate> @optional - (void)scannerDeviceDidBecomeAvailable:(ICScannerDevice*)scanner;
+@end
+
+typedef long unsigned int __darwin_size_t;
+typedef __darwin_size_t size_t;
+typedef unsigned long CFTypeID;
+struct CGPoint {
+ CGFloat x;
+ CGFloat y;
+};
+typedef struct CGPoint CGPoint;
+typedef struct CGGradient *CGGradientRef;
+typedef uint32_t CGGradientDrawingOptions;
+extern CFTypeID CGGradientGetTypeID(void);
+extern CGGradientRef CGGradientCreateWithColorComponents(CGColorSpaceRef
+ space, const CGFloat components[], const CGFloat locations[], size_t count);
+extern CGGradientRef CGGradientCreateWithColors(CGColorSpaceRef space,
+ CFArrayRef colors, const CGFloat locations[]);
+extern CGGradientRef CGGradientRetain(CGGradientRef gradient);
+extern void CGGradientRelease(CGGradientRef gradient);
+typedef struct CGContext *CGContextRef;
+extern void CGContextDrawLinearGradient(CGContextRef context,
+ CGGradientRef gradient, CGPoint startPoint, CGPoint endPoint,
+ CGGradientDrawingOptions options);
+extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
+
+@interface NSMutableArray : NSObject
+- (void)addObject:(id)object;
++ (id)array;
+@end
+
+// This is how NSMakeCollectable is declared in the OS X 10.8 headers.
+id NSMakeCollectable(CFTypeRef __attribute__((cf_consumed))) __attribute__((ns_returns_retained));
+
+typedef const struct __CFUUID * CFUUIDRef;
+
+extern
+void *CFPlugInInstanceCreate(CFAllocatorRef allocator, CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
+
+//===----------------------------------------------------------------------===//
+// Test cases.
+//===----------------------------------------------------------------------===//
+
+CFAbsoluteTime f1() {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ CFDateRef date = CFDateCreate(0, t);
+ CFRetain(date);
+ CFRelease(date);
+ CFDateGetAbsoluteTime(date); // no-warning
+ CFRelease(date);
+ t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}}
+ return t;
+}
+
+CFAbsoluteTime f2() {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ CFDateRef date = CFDateCreate(0, t);
+ [((NSDate*) date) retain];
+ CFRelease(date);
+ CFDateGetAbsoluteTime(date); // no-warning
+ [((NSDate*) date) release];
+ t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}}
+ return t;
+}
+
+
+NSDate* global_x;
+
+// Test to see if we supresss an error when we store the pointer
+// to a global.
+
+CFAbsoluteTime f3() {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ CFDateRef date = CFDateCreate(0, t);
+ [((NSDate*) date) retain];
+ CFRelease(date);
+ CFDateGetAbsoluteTime(date); // no-warning
+ global_x = (NSDate*) date;
+ [((NSDate*) date) release];
+ t = CFDateGetAbsoluteTime(date); // no-warning
+ return t;
+}
+
+//---------------------------------------------------------------------------
+// Test case 'f4' differs for region store and basic store. See
+// retain-release-region-store.m and retain-release-basic-store.m.
+//---------------------------------------------------------------------------
+
+// Test a leak.
+
+CFAbsoluteTime f5(int x) {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ CFDateRef date = CFDateCreate(0, t); // expected-warning{{leak}}
+
+ if (x)
+ CFRelease(date);
+
+ return t;
+}
+
+// Test a leak involving the return.
+
+CFDateRef f6(int x) {
+ CFDateRef date = CFDateCreate(0, CFAbsoluteTimeGetCurrent()); // expected-warning{{leak}}
+ CFRetain(date);
+ return date;
+}
+
+// Test a leak involving an overwrite.
+
+CFDateRef f7() {
+ CFDateRef date = CFDateCreate(0, CFAbsoluteTimeGetCurrent()); //expected-warning{{leak}}
+ CFRetain(date);
+ date = CFDateCreate(0, CFAbsoluteTimeGetCurrent()); // expected-warning {{leak}}
+ return date;
+}
+
+// Generalization of Create rule. MyDateCreate returns a CFXXXTypeRef, and
+// has the word create.
+CFDateRef MyDateCreate();
+
+CFDateRef f8() {
+ CFDateRef date = MyDateCreate(); // expected-warning{{leak}}
+ CFRetain(date);
+ return date;
+}
+
+__attribute__((cf_returns_retained)) CFDateRef f9() {
+ CFDateRef date = CFDateCreate(0, CFAbsoluteTimeGetCurrent()); // no-warning
+ int *p = 0;
+ // When allocations fail, CFDateCreate can return null.
+ if (!date) *p = 1; // expected-warning{{null}}
+ return date;
+}
+
+// Handle DiskArbitration API:
+//
+// http://developer.apple.com/DOCUMENTATION/DARWIN/Reference/DiscArbitrationFramework/
+//
+void f10(io_service_t media, DADiskRef d, CFStringRef s) {
+ DADiskRef disk = DADiskCreateFromBSDName(kCFAllocatorDefault, 0, "hello"); // expected-warning{{leak}}
+ if (disk) NSLog(@"ok");
+
+ disk = DADiskCreateFromIOMedia(kCFAllocatorDefault, 0, media); // expected-warning{{leak}}
+ if (disk) NSLog(@"ok");
+
+ CFDictionaryRef dict = DADiskCopyDescription(d); // expected-warning{{leak}}
+ if (dict) NSLog(@"ok");
+
+ disk = DADiskCopyWholeDisk(d); // expected-warning{{leak}}
+ if (disk) NSLog(@"ok");
+
+ DADissenterRef dissenter = DADissenterCreate(kCFAllocatorDefault, // expected-warning{{leak}}
+ kDAReturnSuccess, s);
+ if (dissenter) NSLog(@"ok");
+
+ DASessionRef session = DASessionCreate(kCFAllocatorDefault); // expected-warning{{leak}}
+ if (session) NSLog(@"ok");
+}
+
+// Test retain/release checker with CFString and CFMutableArray.
+void f11() {
+ // Create the array.
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+
+ // Create a string.
+ CFStringRef s1 = CFStringCreateWithCString(0, "hello world",
+ kCFStringEncodingUTF8);
+
+ // Add the string to the array.
+ CFArrayAppendValue(A, s1);
+
+ // Decrement the reference count.
+ CFRelease(s1); // no-warning
+
+ // Get the string. We don't own it.
+ s1 = (CFStringRef) CFArrayGetValueAtIndex(A, 0);
+
+ // Release the array.
+ CFRelease(A); // no-warning
+
+ // Release the string. This is a bug.
+ CFRelease(s1); // expected-warning{{Incorrect decrement of the reference count}}
+}
+
+// PR 3337: Handle functions declared using typedefs.
+typedef CFTypeRef CREATEFUN();
+CFTypeRef MyCreateFun();
+
+void f12() {
+ CFTypeRef o = MyCreateFun(); // expected-warning {{leak}}
+}
+
+void f13_autorelease() {
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+ [(id) A autorelease]; // no-warning
+}
+
+void f13_autorelease_b() {
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ [(id) A autorelease];
+ [(id) A autorelease];
+} // expected-warning{{Object autoreleased too many times}}
+
+CFMutableArrayRef f13_autorelease_c() {
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ [(id) A autorelease];
+ [(id) A autorelease];
+ return A; // expected-warning{{Object autoreleased too many times}}
+}
+
+CFMutableArrayRef f13_autorelease_d() {
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ [(id) A autorelease];
+ [(id) A autorelease];
+ CFMutableArrayRef B = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning{{Object autoreleased too many times}}
+ CFRelease(B); // no-warning
+ while (1) {}
+}
+
+
+// This case exercises the logic where the leak site is the same as the allocation site.
+void f14_leakimmediately() {
+ CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning{{leak}}
+}
+
+// Test that we track an allocated object beyond the point where the *name*
+// of the variable storing the reference is no longer live.
+void f15() {
+ // Create the array.
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ CFMutableArrayRef *B = &A;
+ // At this point, the name 'A' is no longer live.
+ CFRelease(*B); // no-warning
+}
+
+// Test when we pass NULL to CFRetain/CFRelease/CFMakeCollectable.
+void f16(int x, CFTypeRef p) {
+ if (p)
+ return;
+
+ if (x > 0) {
+ CFRelease(p); // expected-warning{{Null pointer argument in call to CFRelease}}
+ }
+ else if (x < 0) {
+ CFRetain(p); // expected-warning{{Null pointer argument in call to CFRetain}}
+ }
+ else {
+ CFMakeCollectable(p); // expected-warning{{Null pointer argument in call to CFMakeCollectable}}
+ }
+}
+
+// Test that an object is non-null after being CFRetained/CFReleased.
+void f17(int x, CFTypeRef p) {
+ if (x > 0) {
+ CFRelease(p);
+ if (!p)
+ CFRelease(0); // no-warning
+ }
+ else if (x < 0) {
+ CFRetain(p);
+ if (!p)
+ CFRetain(0); // no-warning
+ }
+ else {
+ CFMakeCollectable(p);
+ if (!p)
+ CFMakeCollectable(0); // no-warning
+ }
+}
+
+// Test basic tracking of ivars associated with 'self'. For the retain/release
+// checker we currently do not want to flag leaks associated with stores
+// of tracked objects to ivars.
+@interface SelfIvarTest : NSObject {
+ id myObj;
+}
+- (void)test_self_tracking;
+@end
+
+@implementation SelfIvarTest
+- (void)test_self_tracking {
+ myObj = (id) CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+@end
+
+// Test return of non-owned objects in contexts where an owned object
+// is expected.
+@interface TestReturnNotOwnedWhenExpectedOwned
+- (NSString*)newString;
+@end
+
+@implementation TestReturnNotOwnedWhenExpectedOwned
+- (NSString*)newString {
+ NSString *s = [NSString stringWithUTF8String:"hello"];
+ return s; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
+}
+@end
+
+// <rdar://problem/6659160>
+int isFoo(char c);
+
+static void rdar_6659160(char *inkind, char *inname)
+{
+ // We currently expect that [NSObject alloc] cannot fail. This
+ // will be a toggled flag in the future. It can indeed return null, but
+ // Cocoa programmers generally aren't expected to reason about out-of-memory
+ // conditions.
+ NSString *kind = [[NSString alloc] initWithUTF8String:inkind]; // expected-warning{{leak}}
+
+ // We do allow stringWithUTF8String to fail. This isn't really correct, as
+ // far as returning 0. In most error conditions it will throw an exception.
+ // If allocation fails it could return 0, but again this
+ // isn't expected.
+ NSString *name = [NSString stringWithUTF8String:inname];
+ if(!name)
+ return;
+
+ const char *kindC = 0;
+ const char *nameC = 0;
+
+ // In both cases, we cannot reach a point down below where we
+ // dereference kindC or nameC with either being null. This is because
+ // we assume that [NSObject alloc] doesn't fail and that we have the guard
+ // up above.
+
+ if(kind)
+ kindC = [kind UTF8String];
+ if(name)
+ nameC = [name UTF8String];
+ if(!isFoo(kindC[0])) // expected-warning{{null}}
+ return;
+ if(!isFoo(nameC[0])) // no-warning
+ return;
+
+ [kind release];
+ [name release]; // expected-warning{{Incorrect decrement of the reference count}}
+}
+
+// PR 3677 - 'allocWithZone' should be treated as following the Cocoa naming
+// conventions with respect to 'return'ing ownership.
+@interface PR3677: NSObject @end
+@implementation PR3677
++ (id)allocWithZone:(NSZone *)inZone {
+ return [super allocWithZone:inZone]; // no-warning
+}
+@end
+
+// PR 3820 - Reason about calls to -dealloc
+void pr3820_DeallocInsteadOfRelease(void)
+{
+ id foo = [[NSString alloc] init]; // no-warning
+ [foo dealloc];
+ // foo is not leaked, since it has been deallocated.
+}
+
+void pr3820_ReleaseAfterDealloc(void)
+{
+ id foo = [[NSString alloc] init];
+ [foo dealloc];
+ [foo release]; // expected-warning{{used after it is release}}
+ // NSInternalInconsistencyException: message sent to deallocated object
+}
+
+void pr3820_DeallocAfterRelease(void)
+{
+ NSLog(@"\n\n[%s]", __FUNCTION__);
+ id foo = [[NSString alloc] init];
+ [foo release];
+ [foo dealloc]; // expected-warning{{used after it is released}}
+ // message sent to released object
+}
+
+// From <rdar://problem/6704930>. The problem here is that 'length' binds to
+// '($0 - 1)' after '--length', but SimpleConstraintManager doesn't know how to
+// reason about '($0 - 1) > constant'. As a temporary hack, we drop the value
+// of '($0 - 1)' and conjure a new symbol.
+void rdar6704930(unsigned char *s, unsigned int length) {
+ NSString* name = 0;
+ if (s != 0) {
+ if (length > 0) {
+ while (length > 0) {
+ if (*s == ':') {
+ ++s;
+ --length;
+ name = [[NSString alloc] init]; // no-warning
+ break;
+ }
+ ++s;
+ --length;
+ }
+ if ((length == 0) && (name != 0)) {
+ [name release];
+ name = 0;
+ }
+ if (length == 0) { // no ':' found -> use it all as name
+ name = [[NSString alloc] init]; // no-warning
+ }
+ }
+ }
+
+ if (name != 0) {
+ [name release];
+ }
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6833332>
+// One build of the analyzer accidentally stopped tracking the allocated
+// object after the 'retain'.
+//===----------------------------------------------------------------------===//
+
+@interface rdar_6833332 : NSObject <NSApplicationDelegate> {
+ NSWindow *window;
+}
+@property (nonatomic, retain) NSWindow *window;
+@end
+
+@implementation rdar_6833332
+@synthesize window;
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
+ NSMutableDictionary *dict = [[NSMutableDictionary dictionaryWithCapacity:4] retain]; // expected-warning{{leak}}
+
+ [dict setObject:@"foo" forKey:@"bar"];
+
+ NSLog(@"%@", dict);
+}
+- (void)dealloc {
+ [window release];
+ [super dealloc];
+}
+
+- (void)radar10102244 {
+ NSMutableDictionary *dict = [[NSMutableDictionary dictionaryWithCapacity:4] retain]; // expected-warning{{leak}}
+ if (window)
+ NSLog(@"%@", window);
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6257780> clang checker fails to catch use-after-release
+//===----------------------------------------------------------------------===//
+
+int rdar_6257780_Case1() {
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ NSArray *array = [NSArray array];
+ [array release]; // expected-warning{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+ [pool drain];
+ return 0;
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/10640253> Analyzer is confused about NSAutoreleasePool -allocWithZone:.
+//===----------------------------------------------------------------------===//
+
+void rdar_10640253_autorelease_allocWithZone() {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool allocWithZone:(NSZone*)0] init];
+ (void) pool;
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6866843> Checker should understand new/setObject:/release constructs
+//===----------------------------------------------------------------------===//
+
+void rdar_6866843() {
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ NSMutableDictionary* dictionary = [[NSMutableDictionary alloc] init];
+ NSArray* array = [[NSArray alloc] init];
+ [dictionary setObject:array forKey:@"key"];
+ [array release];
+ // Using 'array' here should be fine
+ NSLog(@"array = %@\n", array); // no-warning
+ // Now the array is released
+ [dictionary release];
+ [pool drain];
+}
+
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6877235> Classes typedef-ed to CF objects should get the same treatment as CF objects
+//===----------------------------------------------------------------------===//
+
+typedef CFTypeRef OtherRef;
+
+@interface RDar6877235 : NSObject {}
+- (CFTypeRef)_copyCFTypeRef;
+- (OtherRef)_copyOtherRef;
+@end
+
+@implementation RDar6877235
+- (CFTypeRef)_copyCFTypeRef {
+ return [[NSString alloc] init]; // no-warning
+}
+- (OtherRef)_copyOtherRef {
+ return [[NSString alloc] init]; // no-warning
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6320065> false positive - init method returns an object
+// owned by caller
+//===----------------------------------------------------------------------===//
+
+@interface RDar6320065 : NSObject {
+ NSString *_foo;
+}
+- (id)initReturningNewClass;
+- (id)_initReturningNewClassBad;
+- (id)initReturningNewClassBad2;
+@end
+
+@interface RDar6320065Subclass : RDar6320065
+@end
+
+@implementation RDar6320065
+- (id)initReturningNewClass {
+ [self release];
+ self = [[RDar6320065Subclass alloc] init]; // no-warning
+ return self;
+}
+- (id)_initReturningNewClassBad {
+ [self release];
+ [[RDar6320065Subclass alloc] init]; // expected-warning {{leak}}
+ return self;
+}
+- (id)initReturningNewClassBad2 {
+ [self release];
+ self = [[RDar6320065Subclass alloc] init];
+ return [self autorelease]; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
+}
+
+@end
+
+@implementation RDar6320065Subclass
+@end
+
+int RDar6320065_test() {
+ RDar6320065 *test = [[RDar6320065 alloc] init]; // no-warning
+ [test release];
+ return 0;
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7129086> -awakeAfterUsingCoder: returns an owned object
+// and claims the receiver
+//===----------------------------------------------------------------------===//
+
+@interface RDar7129086 : NSObject {} @end
+@implementation RDar7129086
+- (id)awakeAfterUsingCoder:(NSCoder *)aDecoder {
+ [self release]; // no-warning
+ return [NSString alloc]; // no-warning
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6859457> [NSData dataWithBytesNoCopy] does not return a
+// retained object
+//===----------------------------------------------------------------------===//
+
+@interface RDar6859457 : NSObject {}
+- (NSString*) NoCopyString;
+- (NSString*) noCopyString;
+@end
+
+@implementation RDar6859457
+- (NSString*) NoCopyString { return [[NSString alloc] init]; } // expected-warning{{leak}}
+- (NSString*) noCopyString { return [[NSString alloc] init]; } // expected-warning{{leak}}
+@end
+
+void test_RDar6859457(RDar6859457 *x, void *bytes, NSUInteger dataLength) {
+ [x NoCopyString]; // expected-warning{{leak}}
+ [x noCopyString]; // expected-warning{{leak}}
+ [NSData dataWithBytesNoCopy:bytes length:dataLength]; // no-warning
+ [NSData dataWithBytesNoCopy:bytes length:dataLength freeWhenDone:1]; // no-warning
+}
+
+//===----------------------------------------------------------------------===//
+// PR 4230 - an autorelease pool is not necessarily leaked during a premature
+// return
+//===----------------------------------------------------------------------===//
+
+static void PR4230(void)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // no-warning
+ NSString *object = [[[NSString alloc] init] autorelease]; // no-warning
+ return;
+}
+
+static void PR4230_new(void)
+{
+ NSAutoreleasePool *pool = [NSAutoreleasePool new]; // no-warning
+ NSString *object = [[[NSString alloc] init] autorelease]; // no-warning
+ return;
+}
+
+//===----------------------------------------------------------------------===//
+// Method name that has a null IdentifierInfo* for its first selector slot.
+// This test just makes sure that we handle it.
+//===----------------------------------------------------------------------===//
+
+@interface TestNullIdentifier
+@end
+
+@implementation TestNullIdentifier
++ (id):(int)x, ... {
+ return [[NSString alloc] init]; // expected-warning{{leak}}
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6893565> don't flag leaks for return types that cannot be
+// determined to be CF types
+//===----------------------------------------------------------------------===//
+
+// We don't know if 'struct s6893565' represents a Core Foundation type, so
+// we shouldn't emit an error here.
+typedef struct s6893565* TD6893565;
+
+@interface RDar6893565 {}
+-(TD6893565)newThing;
+@end
+
+@implementation RDar6893565
+-(TD6893565)newThing {
+ return (TD6893565) [[NSString alloc] init]; // no-warning
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6902710> clang: false positives w/QC and CoreImage methods
+//===----------------------------------------------------------------------===//
+
+void rdar6902710(QCView *view, QCRenderer *renderer, CIContext *context,
+ NSString *str, CIImage *img, CGRect rect,
+ CIFormat form, CGColorSpaceRef cs) {
+ [view createSnapshotImageOfType:str]; // expected-warning{{leak}}
+ [renderer createSnapshotImageOfType:str]; // expected-warning{{leak}}
+ [context createCGImage:img fromRect:rect]; // expected-warning{{leak}}
+ [context createCGImage:img fromRect:rect format:form colorSpace:cs]; // expected-warning{{leak}}
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6945561> -[CIContext createCGLayerWithSize:info:]
+// misinterpreted by clang scan-build
+//===----------------------------------------------------------------------===//
+
+void rdar6945561(CIContext *context, CGSize size, CFDictionaryRef d) {
+ [context createCGLayerWithSize:size info:d]; // expected-warning{{leak}}
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6961230> add knowledge of IOKit functions to retain/release
+// checker
+//===----------------------------------------------------------------------===//
+
+void IOBSDNameMatching_wrapper(mach_port_t masterPort, uint32_t options, const char * bsdName) {
+ IOBSDNameMatching(masterPort, options, bsdName); // expected-warning{{leak}}
+}
+
+void IOServiceMatching_wrapper(const char * name) {
+ IOServiceMatching(name); // expected-warning{{leak}}
+}
+
+void IOServiceNameMatching_wrapper(const char * name) {
+ IOServiceNameMatching(name); // expected-warning{{leak}}
+}
+
+CF_RETURNS_RETAINED CFDictionaryRef CreateDict();
+
+void IOServiceAddNotification_wrapper(mach_port_t masterPort, const io_name_t notificationType,
+ mach_port_t wakePort, uintptr_t reference, io_iterator_t * notification ) {
+
+ CFDictionaryRef matching = CreateDict();
+ CFRelease(matching);
+ IOServiceAddNotification(masterPort, notificationType, matching, // expected-warning{{used after it is released}} expected-warning{{deprecated}}
+ wakePort, reference, notification);
+}
+
+void IORegistryEntryIDMatching_wrapper(uint64_t entryID ) {
+ IORegistryEntryIDMatching(entryID); // expected-warning{{leak}}
+}
+
+void IOOpenFirmwarePathMatching_wrapper(mach_port_t masterPort, uint32_t options,
+ const char * path) {
+ IOOpenFirmwarePathMatching(masterPort, options, path); // expected-warning{{leak}}
+}
+
+void IOServiceGetMatchingService_wrapper(mach_port_t masterPort) {
+ CFDictionaryRef matching = CreateDict();
+ IOServiceGetMatchingService(masterPort, matching);
+ CFRelease(matching); // expected-warning{{used after it is released}}
+}
+
+void IOServiceGetMatchingServices_wrapper(mach_port_t masterPort, io_iterator_t *existing) {
+ CFDictionaryRef matching = CreateDict();
+ IOServiceGetMatchingServices(masterPort, matching, existing);
+ CFRelease(matching); // expected-warning{{used after it is released}}
+}
+
+void IOServiceAddMatchingNotification_wrapper(IONotificationPortRef notifyPort, const io_name_t notificationType,
+ IOServiceMatchingCallback callback, void * refCon, io_iterator_t * notification) {
+
+ CFDictionaryRef matching = CreateDict();
+ IOServiceAddMatchingNotification(notifyPort, notificationType, matching, callback, refCon, notification);
+ CFRelease(matching); // expected-warning{{used after it is released}}
+}
+
+//===----------------------------------------------------------------------===//
+// Test of handling objects whose references "escape" to containers.
+//===----------------------------------------------------------------------===//
+
+void CFDictionaryAddValue(CFMutableDictionaryRef, void *, void *);
+
+// <rdar://problem/6539791>
+void rdar_6539791(CFMutableDictionaryRef y, void* key, void* val_key) {
+ CFMutableDictionaryRef x = CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ CFDictionaryAddValue(y, key, x);
+ CFRelease(x); // the dictionary keeps a reference, so the object isn't deallocated yet
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z);
+ if (value) {
+ CFDictionaryAddValue(x, val_key, (void*)value); // no-warning
+ CFRelease(value);
+ CFDictionaryAddValue(y, val_key, (void*)value); // no-warning
+ }
+}
+
+// <rdar://problem/6560661>
+// Same issue, except with "AppendValue" functions.
+void rdar_6560661(CFMutableArrayRef x) {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z);
+ // CFArrayAppendValue keeps a reference to value.
+ CFArrayAppendValue(x, value);
+ CFRelease(value);
+ CFRetain(value);
+ CFRelease(value); // no-warning
+}
+
+// <rdar://problem/7152619>
+// Same issue, excwept with "CFAttributeStringSetAttribute".
+void rdar_7152619(CFStringRef str) {
+ CFAttributedStringRef string = CFAttributedStringCreate(kCFAllocatorDefault, str, 0);
+ CFMutableAttributedStringRef attrString = CFAttributedStringCreateMutableCopy(kCFAllocatorDefault, 100, string);
+ CFRelease(string);
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // expected-warning{{leak}}
+ CFAttributedStringSetAttribute(attrString, CFRangeMake(0, 1), str, number);
+ [number release];
+ [number retain];
+ CFRelease(attrString);
+}
+
+//===----------------------------------------------------------------------===//
+// Test of handling CGGradientXXX functions.
+//===----------------------------------------------------------------------===//
+
+void rdar_7184450(CGContextRef myContext, CGFloat x, CGPoint myStartPoint,
+ CGPoint myEndPoint) {
+ size_t num_locations = 6;
+ CGFloat locations[6] = { 0.0, 0.265, 0.28, 0.31, 0.36, 1.0 };
+ CGFloat components[28] = { 239.0/256.0, 167.0/256.0, 170.0/256.0,
+ x, // Start color
+ 207.0/255.0, 39.0/255.0, 39.0/255.0, x,
+ 147.0/255.0, 21.0/255.0, 22.0/255.0, x,
+ 175.0/255.0, 175.0/255.0, 175.0/255.0, x,
+ 255.0/255.0,255.0/255.0, 255.0/255.0, x,
+ 255.0/255.0,255.0/255.0, 255.0/255.0, x
+ }; // End color
+
+ CGGradientRef myGradient =
+ CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), // expected-warning{{leak}}
+ components, locations, num_locations);
+
+ CGContextDrawLinearGradient(myContext, myGradient, myStartPoint, myEndPoint,
+ 0);
+ CGGradientRelease(myGradient);
+}
+
+void rdar_7184450_pos(CGContextRef myContext, CGFloat x, CGPoint myStartPoint,
+ CGPoint myEndPoint) {
+ size_t num_locations = 6;
+ CGFloat locations[6] = { 0.0, 0.265, 0.28, 0.31, 0.36, 1.0 };
+ CGFloat components[28] = { 239.0/256.0, 167.0/256.0, 170.0/256.0,
+ x, // Start color
+ 207.0/255.0, 39.0/255.0, 39.0/255.0, x,
+ 147.0/255.0, 21.0/255.0, 22.0/255.0, x,
+ 175.0/255.0, 175.0/255.0, 175.0/255.0, x,
+ 255.0/255.0,255.0/255.0, 255.0/255.0, x,
+ 255.0/255.0,255.0/255.0, 255.0/255.0, x
+ }; // End color
+
+ CGGradientRef myGradient =
+ CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), components, locations, num_locations); // expected-warning 2 {{leak}}
+
+ CGContextDrawLinearGradient(myContext, myGradient, myStartPoint, myEndPoint,
+ 0);
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7299394> clang false positive: retained instance passed to
+// thread in pthread_create marked as leak
+//
+// Until we have full IPA, the analyzer should stop tracking the reference
+// count of objects passed to pthread_create.
+//
+//===----------------------------------------------------------------------===//
+
+struct _opaque_pthread_t {};
+struct _opaque_pthread_attr_t {};
+typedef struct _opaque_pthread_t *__darwin_pthread_t;
+typedef struct _opaque_pthread_attr_t __darwin_pthread_attr_t;
+typedef __darwin_pthread_t pthread_t;
+typedef __darwin_pthread_attr_t pthread_attr_t;
+typedef unsigned long __darwin_pthread_key_t;
+typedef __darwin_pthread_key_t pthread_key_t;
+
+int pthread_create(pthread_t *, const pthread_attr_t *,
+ void *(*)(void *), void *);
+
+int pthread_setspecific(pthread_key_t key, const void *value);
+
+void *rdar_7299394_start_routine(void *p) {
+ [((id) p) release];
+ return 0;
+}
+void rdar_7299394(pthread_attr_t *attr, pthread_t *thread, void *args) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+ pthread_create(thread, attr, rdar_7299394_start_routine, number);
+}
+void rdar_7299394_positive(pthread_attr_t *attr, pthread_t *thread) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // expected-warning{{leak}}
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/11282706> false positive with not understanding thread
+// local storage
+//===----------------------------------------------------------------------===//
+
+void rdar11282706(pthread_key_t key) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+ pthread_setspecific(key, (void*) number);
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7283567> False leak associated with call to
+// CVPixelBufferCreateWithBytes ()
+//
+// According to the Core Video Reference (ADC), CVPixelBufferCreateWithBytes and
+// CVPixelBufferCreateWithPlanarBytes can release (via a callback) the
+// pixel buffer object. These test cases show how the analyzer stops tracking
+// the reference count for the objects passed for this argument. This
+// could be made smarter.
+//===----------------------------------------------------------------------===//
+
+typedef int int32_t;
+typedef UInt32 FourCharCode;
+typedef FourCharCode OSType;
+typedef uint64_t CVOptionFlags;
+typedef int32_t CVReturn;
+typedef struct __CVBuffer *CVBufferRef;
+typedef CVBufferRef CVImageBufferRef;
+typedef CVImageBufferRef CVPixelBufferRef;
+typedef void (*CVPixelBufferReleaseBytesCallback)( void *releaseRefCon, const void *baseAddress );
+
+extern CVReturn CVPixelBufferCreateWithBytes(CFAllocatorRef allocator,
+ size_t width,
+ size_t height,
+ OSType pixelFormatType,
+ void *baseAddress,
+ size_t bytesPerRow,
+ CVPixelBufferReleaseBytesCallback releaseCallback,
+ void *releaseRefCon,
+ CFDictionaryRef pixelBufferAttributes,
+ CVPixelBufferRef *pixelBufferOut) ;
+
+typedef void (*CVPixelBufferReleasePlanarBytesCallback)( void *releaseRefCon, const void *dataPtr, size_t dataSize, size_t numberOfPlanes, const void *planeAddresses[] );
+
+extern CVReturn CVPixelBufferCreateWithPlanarBytes(CFAllocatorRef allocator,
+ size_t width,
+ size_t height,
+ OSType pixelFormatType,
+ void *dataPtr,
+ size_t dataSize,
+ size_t numberOfPlanes,
+ void *planeBaseAddress[],
+ size_t planeWidth[],
+ size_t planeHeight[],
+ size_t planeBytesPerRow[],
+ CVPixelBufferReleasePlanarBytesCallback releaseCallback,
+ void *releaseRefCon,
+ CFDictionaryRef pixelBufferAttributes,
+ CVPixelBufferRef *pixelBufferOut) ;
+
+extern CVReturn CVPixelBufferCreateWithBytes(CFAllocatorRef allocator,
+ size_t width,
+ size_t height,
+ OSType pixelFormatType,
+ void *baseAddress,
+ size_t bytesPerRow,
+ CVPixelBufferReleaseBytesCallback releaseCallback,
+ void *releaseRefCon,
+ CFDictionaryRef pixelBufferAttributes,
+ CVPixelBufferRef *pixelBufferOut) ;
+
+CVReturn rdar_7283567(CFAllocatorRef allocator, size_t width, size_t height,
+ OSType pixelFormatType, void *baseAddress,
+ size_t bytesPerRow,
+ CVPixelBufferReleaseBytesCallback releaseCallback,
+ CFDictionaryRef pixelBufferAttributes,
+ CVPixelBufferRef *pixelBufferOut) {
+
+ // For the allocated object, it doesn't really matter what type it is
+ // for the purpose of this test. All we want to show is that
+ // this is freed later by the callback.
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+
+ return CVPixelBufferCreateWithBytes(allocator, width, height, pixelFormatType,
+ baseAddress, bytesPerRow, releaseCallback,
+ number, // potentially released by callback
+ pixelBufferAttributes, pixelBufferOut) ;
+}
+
+CVReturn rdar_7283567_2(CFAllocatorRef allocator, size_t width, size_t height,
+ OSType pixelFormatType, void *dataPtr, size_t dataSize,
+ size_t numberOfPlanes, void *planeBaseAddress[],
+ size_t planeWidth[], size_t planeHeight[], size_t planeBytesPerRow[],
+ CVPixelBufferReleasePlanarBytesCallback releaseCallback,
+ CFDictionaryRef pixelBufferAttributes,
+ CVPixelBufferRef *pixelBufferOut) {
+
+ // For the allocated object, it doesn't really matter what type it is
+ // for the purpose of this test. All we want to show is that
+ // this is freed later by the callback.
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+
+ return CVPixelBufferCreateWithPlanarBytes(allocator,
+ width, height, pixelFormatType, dataPtr, dataSize,
+ numberOfPlanes, planeBaseAddress, planeWidth,
+ planeHeight, planeBytesPerRow, releaseCallback,
+ number, // potentially released by callback
+ pixelBufferAttributes, pixelBufferOut) ;
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7358899> False leak associated with
+// CGBitmapContextCreateWithData
+//===----------------------------------------------------------------------===//
+typedef uint32_t CGBitmapInfo;
+typedef void (*CGBitmapContextReleaseDataCallback)(void *releaseInfo, void *data);
+
+CGContextRef CGBitmapContextCreateWithData(void *data,
+ size_t width, size_t height, size_t bitsPerComponent,
+ size_t bytesPerRow, CGColorSpaceRef space, CGBitmapInfo bitmapInfo,
+ CGBitmapContextReleaseDataCallback releaseCallback, void *releaseInfo);
+
+void rdar_7358899(void *data,
+ size_t width, size_t height, size_t bitsPerComponent,
+ size_t bytesPerRow, CGColorSpaceRef space, CGBitmapInfo bitmapInfo,
+ CGBitmapContextReleaseDataCallback releaseCallback) {
+
+ // For the allocated object, it doesn't really matter what type it is
+ // for the purpose of this test. All we want to show is that
+ // this is freed later by the callback.
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+
+ CGBitmapContextCreateWithData(data, width, height, bitsPerComponent, // expected-warning{{leak}}
+ bytesPerRow, space, bitmapInfo, releaseCallback, number);
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7265711> allow 'new', 'copy', 'alloc', 'init' prefix to
+// start before '_' when determining Cocoa fundamental rule
+//
+// Previously the retain/release checker just skipped prefixes before the
+// first '_' entirely. Now the checker honors the prefix if it results in a
+// recognizable naming convention (e.g., 'new', 'init').
+//===----------------------------------------------------------------------===//
+
+@interface RDar7265711 {}
+- (id) new_stuff;
+@end
+
+void rdar7265711_a(RDar7265711 *x) {
+ id y = [x new_stuff]; // expected-warning{{leak}}
+}
+
+void rdar7265711_b(RDar7265711 *x) {
+ id y = [x new_stuff]; // no-warning
+ [y release];
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7306898> clang thinks [NSCursor dragCopyCursor] returns a
+// retained reference
+//===----------------------------------------------------------------------===//
+
+@interface NSCursor : NSObject
++ (NSCursor *)dragCopyCursor;
+@end
+
+void rdar7306898(void) {
+ // 'dragCopyCursor' does not follow Cocoa's fundamental rule. It is a noun, not an sentence
+ // implying a 'copy' of something.
+ NSCursor *c = [NSCursor dragCopyCursor]; // no-warning
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // expected-warning{{leak}}
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7252064> sending 'release', 'retain', etc. to a Class
+// directly is not likely what the user intended
+//===----------------------------------------------------------------------===//
+
+@interface RDar7252064 : NSObject @end
+void rdar7252064(void) {
+ [RDar7252064 release]; // expected-warning{{The 'release' message should be sent to instances of class 'RDar7252064' and not the class directly}}
+ [RDar7252064 retain]; // expected-warning{{The 'retain' message should be sent to instances of class 'RDar7252064' and not the class directly}}
+ [RDar7252064 autorelease]; // expected-warning{{The 'autorelease' message should be sent to instances of class 'RDar7252064' and not the class directly}}
+ [NSAutoreleasePool drain]; // expected-warning{{method '+drain' not found}} expected-warning{{The 'drain' message should be sent to instances of class 'NSAutoreleasePool' and not the class directly}}
+}
+
+//===----------------------------------------------------------------------===//
+// Tests of ownership attributes.
+//===----------------------------------------------------------------------===//
+
+typedef NSString* MyStringTy;
+
+@protocol FooP;
+
+@interface TestOwnershipAttr : NSObject
+- (NSString*) returnsAnOwnedString NS_RETURNS_RETAINED; // no-warning
+- (NSString*) returnsAnOwnedCFString CF_RETURNS_RETAINED; // no-warning
+- (MyStringTy) returnsAnOwnedTypedString NS_RETURNS_RETAINED; // no-warning
+- (NSString*) newString NS_RETURNS_NOT_RETAINED; // no-warning
+- (NSString*) newString_auto NS_RETURNS_AUTORELEASED; // no-warning
+- (NSString*) newStringNoAttr;
+- (int) returnsAnOwnedInt NS_RETURNS_RETAINED; // expected-warning{{'ns_returns_retained' attribute only applies to methods that return an Objective-C object}}
+- (id) pseudoInit NS_CONSUMES_SELF NS_RETURNS_RETAINED;
++ (void) consume:(id) NS_CONSUMED x;
++ (void) consume2:(id) CF_CONSUMED x;
+@end
+
+static int ownership_attribute_doesnt_go_here NS_RETURNS_RETAINED; // expected-warning{{'ns_returns_retained' attribute only applies to functions and methods}}
+
+void test_attr_1(TestOwnershipAttr *X) {
+ NSString *str = [X returnsAnOwnedString]; // expected-warning{{leak}}
+}
+
+void test_attr_1b(TestOwnershipAttr *X) {
+ NSString *str = [X returnsAnOwnedCFString]; // expected-warning{{leak}}
+}
+
+void test_attr1c(TestOwnershipAttr *X) {
+ NSString *str = [X newString]; // no-warning
+ NSString *str2 = [X newStringNoAttr]; // expected-warning{{leak}}
+ NSString *str3 = [X newString_auto]; // no-warning
+ NSString *str4 = [[X newString_auto] retain]; // expected-warning {{leak}}
+}
+
+void testattr2_a() {
+ TestOwnershipAttr *x = [TestOwnershipAttr alloc]; // expected-warning{{leak}}
+}
+
+void testattr2_b() {
+ TestOwnershipAttr *x = [[TestOwnershipAttr alloc] pseudoInit]; // expected-warning{{leak}}
+}
+
+void testattr2_b_11358224_self_assign_looses_the_leak() {
+ TestOwnershipAttr *x = [[TestOwnershipAttr alloc] pseudoInit];// expected-warning{{leak}}
+ x = x;
+}
+
+void testattr2_c() {
+ TestOwnershipAttr *x = [[TestOwnershipAttr alloc] pseudoInit]; // no-warning
+ [x release];
+}
+
+void testattr3() {
+ TestOwnershipAttr *x = [TestOwnershipAttr alloc]; // no-warning
+ [TestOwnershipAttr consume:x];
+ TestOwnershipAttr *y = [TestOwnershipAttr alloc]; // no-warning
+ [TestOwnershipAttr consume2:y];
+}
+
+void consume_ns(id NS_CONSUMED x);
+void consume_cf(id CF_CONSUMED x);
+
+void testattr4() {
+ TestOwnershipAttr *x = [TestOwnershipAttr alloc]; // no-warning
+ consume_ns(x);
+ TestOwnershipAttr *y = [TestOwnershipAttr alloc]; // no-warning
+ consume_cf(y);
+}
+
+@interface TestOwnershipAttr2 : NSObject
+- (NSString*) newString NS_RETURNS_NOT_RETAINED; // no-warning
+@end
+
+@implementation TestOwnershipAttr2
+- (NSString*) newString {
+ return [NSString alloc]; // expected-warning {{Potential leak of an object}}
+}
+@end
+
+@interface MyClassTestCFAttr : NSObject {}
+- (NSDate*) returnsCFRetained CF_RETURNS_RETAINED;
+- (CFDateRef) returnsCFRetainedAsCF CF_RETURNS_RETAINED;
+- (CFDateRef) newCFRetainedAsCF CF_RETURNS_NOT_RETAINED;
+- (CFDateRef) newCFRetainedAsCFNoAttr;
+- (NSDate*) alsoReturnsRetained;
+- (CFDateRef) alsoReturnsRetainedAsCF;
+- (NSDate*) returnsNSRetained NS_RETURNS_RETAINED;
+@end
+
+CF_RETURNS_RETAINED
+CFDateRef returnsRetainedCFDate() {
+ return CFDateCreate(0, CFAbsoluteTimeGetCurrent());
+}
+
+@implementation MyClassTestCFAttr
+- (NSDate*) returnsCFRetained {
+ return (NSDate*) returnsRetainedCFDate(); // No leak.
+}
+
+- (CFDateRef) returnsCFRetainedAsCF {
+ return returnsRetainedCFDate(); // No leak.
+}
+
+- (CFDateRef) newCFRetainedAsCF {
+ return (CFDateRef)[(id)[self returnsCFRetainedAsCF] autorelease];
+}
+
+- (CFDateRef) newCFRetainedAsCFNoAttr {
+ return (CFDateRef)[(id)[self returnsCFRetainedAsCF] autorelease]; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
+}
+
+- (NSDate*) alsoReturnsRetained {
+ return (NSDate*) returnsRetainedCFDate(); // expected-warning{{leak}}
+}
+
+- (CFDateRef) alsoReturnsRetainedAsCF {
+ return returnsRetainedCFDate(); // expected-warning{{leak}}
+}
+
+
+- (NSDate*) returnsNSRetained {
+ return (NSDate*) returnsRetainedCFDate(); // no-warning
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// Test that leaks post-dominated by "panic" functions are not reported.
+//
+// <rdar://problem/5905851> do not report a leak when post-dominated by a call
+// to a noreturn or panic function
+//===----------------------------------------------------------------------===//
+
+void panic() __attribute__((noreturn));
+void panic_not_in_hardcoded_list() __attribute__((noreturn));
+
+void test_panic_negative() {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // expected-warning{{leak}}
+}
+
+void test_panic_positive() {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // no-warning
+ panic();
+}
+
+void test_panic_neg_2(int x) {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // expected-warning{{leak}}
+ if (x)
+ panic();
+}
+
+void test_panic_pos_2(int x) {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // no-warning
+ if (x)
+ panic();
+ if (!x) {
+ // This showed up in <rdar://problem/7796563>, where we silently missed checking
+ // the function type for noreturn. "panic()" is a hard-coded known panic function
+ // that isn't always noreturn.
+ panic_not_in_hardcoded_list();
+ }
+}
+
+//===----------------------------------------------------------------------===//
+// Test uses of blocks (closures)
+//===----------------------------------------------------------------------===//
+
+void test_blocks_1_pos(void) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // expected-warning{{leak}}
+ ^{}();
+}
+
+void test_blocks_1_indirect_release(void) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+ ^{ [number release]; }();
+}
+
+void test_blocks_1_indirect_retain(void) {
+ // Eventually this should be reported as a leak.
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+ ^{ [number retain]; }();
+}
+
+void test_blocks_1_indirect_release_via_call(void) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+ ^(NSObject *o){ [o release]; }(number);
+}
+
+void test_blocks_1_indirect_retain_via_call(void) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // expected-warning {{leak}}
+ ^(NSObject *o){ [o retain]; }(number);
+}
+
+//===--------------------------------------------------------------------===//
+// Test sending message to super that returns an object alias. Previously
+// this caused a crash in the analyzer.
+//===--------------------------------------------------------------------===//
+
+@interface Rdar8015556 : NSObject {} @end
+@implementation Rdar8015556
+- (id)retain {
+ return [super retain];
+}
+@end
+
+// <rdar://problem/8272168> - Correcly handle Class<...> in Cocoa Conventions
+// detector.
+
+@protocol Prot_R8272168 @end
+Class <Prot_R8272168> GetAClassThatImplementsProt_R8272168();
+void r8272168() {
+ GetAClassThatImplementsProt_R8272168();
+}
+
+// Test case for <rdar://problem/8356342>, which in the past triggered
+// a false positive.
+@interface RDar8356342
+- (NSDate*) rdar8356342:(NSDate *)inValue;
+@end
+
+@implementation RDar8356342
+- (NSDate*) rdar8356342:(NSDate*)inValue {
+ NSDate *outValue = inValue;
+ if (outValue == 0)
+ outValue = [[NSDate alloc] init]; // no-warning
+
+ if (outValue != inValue)
+ [outValue autorelease];
+
+ return outValue;
+}
+@end
+
+// <rdar://problem/8724287> - This test case previously crashed because
+// of a bug in BugReporter.
+extern const void *CFDictionaryGetValue(CFDictionaryRef theDict, const void *key);
+typedef struct __CFError * CFErrorRef;
+extern const CFStringRef kCFErrorUnderlyingErrorKey;
+extern CFDictionaryRef CFErrorCopyUserInfo(CFErrorRef err);
+static void rdar_8724287(CFErrorRef error)
+{
+ CFErrorRef error_to_dump;
+
+ error_to_dump = error;
+ while (error_to_dump != ((void*)0)) {
+ CFDictionaryRef info;
+
+ info = CFErrorCopyUserInfo(error_to_dump); // expected-warning{{Potential leak of an object}}
+
+ if (info != ((void*)0)) {
+ }
+
+ error_to_dump = (CFErrorRef) CFDictionaryGetValue(info, kCFErrorUnderlyingErrorKey);
+ }
+}
+
+// <rdar://problem/9234108> - Make sure the model applies cf_consumed
+// correctly in argument positions besides the first.
+extern void *CFStringCreate(void);
+extern void rdar_9234108_helper(void *key, void * CF_CONSUMED value);
+void rdar_9234108() {
+ rdar_9234108_helper(0, CFStringCreate());
+}
+
+// <rdar://problem/9726279> - Make sure that objc_method_family works
+// to override naming conventions.
+struct TwoDoubles {
+ double one;
+ double two;
+};
+typedef struct TwoDoubles TwoDoubles;
+
+@interface NSValue (Mine)
+- (id)_prefix_initWithTwoDoubles:(TwoDoubles)twoDoubles __attribute__((objc_method_family(init)));
+@end
+
+@implementation NSValue (Mine)
+- (id)_prefix_initWithTwoDoubles:(TwoDoubles)twoDoubles
+{
+ return [self init];
+}
+@end
+
+void rdar9726279() {
+ TwoDoubles twoDoubles = { 0.0, 0.0 };
+ NSValue *value = [[NSValue alloc] _prefix_initWithTwoDoubles:twoDoubles];
+ [value release];
+}
+
+// <rdar://problem/9732321>
+// Test camelcase support for CF conventions. While Core Foundation APIs
+// don't use camel casing, other code is allowed to use it.
+CFArrayRef camelcase_create_1() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef camelcase_createno() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning {{leak}}
+}
+
+CFArrayRef camelcase_copy() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef camelcase_copying() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning {{leak}}
+}
+
+CFArrayRef copyCamelCase() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef __copyCamelCase() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef __createCamelCase() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef camel_create() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+
+CFArrayRef camel_creat() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning {{leak}}
+}
+
+CFArrayRef camel_copy() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef camel_copyMachine() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef camel_copymachine() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning {{leak}}
+}
+
+// rdar://problem/8024350
+@protocol F18P
+- (id) clone;
+@end
+@interface F18 : NSObject<F18P> @end
+@interface F18(Cat)
+- (id) clone NS_RETURNS_RETAINED;
+@end
+
+@implementation F18
+- (id) clone {
+ return [F18 alloc];
+}
+@end
+
+// Radar 6582778.
+void rdar6582778(void) {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ CFTypeRef vals[] = { CFDateCreate(0, t) }; // expected-warning {{leak}}
+}
+
+CFTypeRef global;
+
+void rdar6582778_2(void) {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ global = CFDateCreate(0, t); // no-warning
+}
+
+// <rdar://problem/10232019> - Test that objects passed to containers
+// are marked "escaped".
+
+void rdar10232019() {
+ NSMutableArray *array = [NSMutableArray array];
+
+ NSString *string = [[NSString alloc] initWithUTF8String:"foo"];
+ [array addObject:string];
+ [string release];
+
+ NSString *otherString = [string stringByAppendingString:@"bar"]; // no-warning
+ NSLog(@"%@", otherString);
+}
+
+void rdar10232019_positive() {
+ NSMutableArray *array = [NSMutableArray array];
+
+ NSString *string = [[NSString alloc] initWithUTF8String:"foo"];
+ [string release];
+
+ NSString *otherString = [string stringByAppendingString:@"bar"]; // expected-warning {{Reference-counted object is used after it is release}}
+ NSLog(@"%@", otherString);
+}
+
+// RetainCountChecker support for XPC.
+// <rdar://problem/9658496>
+typedef void * xpc_object_t;
+xpc_object_t _CFXPCCreateXPCObjectFromCFObject(CFTypeRef cf);
+void xpc_release(xpc_object_t object);
+
+void rdar9658496() {
+ CFStringRef cf;
+ xpc_object_t xpc;
+ cf = CFStringCreateWithCString( ((CFAllocatorRef)0), "test", kCFStringEncodingUTF8 ); // no-warning
+ xpc = _CFXPCCreateXPCObjectFromCFObject( cf );
+ CFRelease(cf);
+ xpc_release(xpc);
+}
+
+// Support annotations with method families.
+@interface RDar10824732 : NSObject
+- (id)initWithObj:(id CF_CONSUMED)obj;
+@end
+
+@implementation RDar10824732
+- (id)initWithObj:(id)obj {
+ [obj release];
+ return [super init];
+}
+@end
+
+void rdar_10824732() {
+ @autoreleasepool {
+ NSString *obj = @"test";
+ RDar10824732 *foo = [[RDar10824732 alloc] initWithObj:obj]; // no-warning
+ [foo release];
+ }
+}
+
+// Stop tracking objects passed to functions, which take callbacks as parameters.
+// radar://10973977
+typedef int (*CloseCallback) (void *);
+void ReaderForIO(CloseCallback ioclose, void *ioctx);
+int IOClose(void *context);
+
+@protocol SInS <NSObject>
+@end
+
+@interface radar10973977 : NSObject
+- (id<SInS>)inputS;
+- (void)reader;
+@end
+
+@implementation radar10973977
+- (void)reader
+{
+ id<SInS> inputS = [[self inputS] retain];
+ ReaderForIO(IOClose, inputS);
+}
+- (id<SInS>)inputS
+{
+ return 0;
+}
+@end
+
+// Object escapes through a selector callback: radar://11398514
+extern id NSApp;
+@interface MySheetController
+- (id<SInS>)inputS;
+- (void)showDoSomethingSheetAction:(id)action;
+- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;
+@end
+
+@implementation MySheetController
+- (id<SInS>)inputS {
+ return 0;
+}
+- (void)showDoSomethingSheetAction:(id)action {
+ id<SInS> inputS = [[self inputS] retain];
+ [NSApp beginSheet:0
+ modalForWindow:0
+ modalDelegate:0
+ didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
+ contextInfo:(void *)inputS]; // no - warning
+}
+- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
+
+ id contextObject = (id)contextInfo;
+ [contextObject release];
+}
+
+- (id)copyAutoreleaseRadar13081402 {
+ id x = [[[NSString alloc] initWithUTF8String:"foo"] autorelease];
+ [x retain];
+ return x; // no warning
+}
+
+@end
+//===----------------------------------------------------------------------===//
+// Test returning allocated memory in a struct.
+//
+// We currently don't have a general way to track pointers that "escape".
+// Here we test that RetainCountChecker doesn't get excited about returning
+// allocated CF objects in struct fields.
+//===----------------------------------------------------------------------===//
+void *malloc(size_t);
+struct rdar11104566 { CFStringRef myStr; };
+struct rdar11104566 test_rdar11104566() {
+ CFStringRef cf = CFStringCreateWithCString( ((CFAllocatorRef)0), "test", kCFStringEncodingUTF8 ); // no-warning
+ struct rdar11104566 V;
+ V.myStr = cf;
+ return V; // no-warning
+}
+
+struct rdar11104566 *test_2_rdar11104566() {
+ CFStringRef cf = CFStringCreateWithCString( ((CFAllocatorRef)0), "test", kCFStringEncodingUTF8 ); // no-warning
+ struct rdar11104566 *V = (struct rdar11104566 *) malloc(sizeof(*V));
+ V->myStr = cf;
+ return V; // no-warning
+}
+
+//===----------------------------------------------------------------------===//
+// ObjC literals support.
+//===----------------------------------------------------------------------===//
+
+void test_objc_arrays() {
+ { // CASE ONE -- OBJECT IN ARRAY CREATED DIRECTLY
+ NSObject *o = [[NSObject alloc] init];
+ NSArray *a = [[NSArray alloc] initWithObjects:o, (void*)0]; // expected-warning {{leak}}
+ [o release];
+ [a description];
+ [o description];
+ }
+
+ { // CASE TWO -- OBJECT IN ARRAY CREATED BY DUPING AUTORELEASED ARRAY
+ NSObject *o = [[NSObject alloc] init];
+ NSArray *a1 = [NSArray arrayWithObjects:o, (void*)0];
+ NSArray *a2 = [[NSArray alloc] initWithArray:a1]; // expected-warning {{leak}}
+ [o release];
+ [a2 description];
+ [o description];
+ }
+
+ { // CASE THREE -- OBJECT IN RETAINED @[]
+ NSObject *o = [[NSObject alloc] init];
+ NSArray *a3 = [@[o] retain]; // expected-warning {{leak}}
+ [o release];
+ [a3 description];
+ [o description];
+ }
+
+ { // CASE FOUR -- OBJECT IN ARRAY CREATED BY DUPING @[]
+ NSObject *o = [[NSObject alloc] init];
+ NSArray *a = [[NSArray alloc] initWithArray:@[o]]; // expected-warning {{leak}}
+ [o release];
+
+ [a description];
+ [o description];
+ }
+
+ { // CASE FIVE -- OBJECT IN RETAINED @{}
+ NSValue *o = [[NSValue alloc] init];
+ NSDictionary *a = [@{o : o} retain]; // expected-warning {{leak}}
+ [o release];
+
+ [a description];
+ [o description];
+ }
+}
+
+void test_objc_integer_literals() {
+ id value = [@1 retain]; // expected-warning {{leak}}
+ [value description];
+}
+
+void test_objc_boxed_expressions(int x, const char *y) {
+ id value = [@(x) retain]; // expected-warning {{leak}}
+ [value description];
+
+ value = [@(y) retain]; // expected-warning {{leak}}
+ [value description];
+}
+
+// Test NSLog doesn't escape tracked objects.
+void rdar11400885(int y)
+{
+ @autoreleasepool {
+ NSString *printString;
+ if(y > 2)
+ printString = [[NSString alloc] init];
+ else
+ printString = [[NSString alloc] init];
+ NSLog(@"Once %@", printString);
+ [printString release];
+ NSLog(@"Again: %@", printString); // expected-warning {{Reference-counted object is used after it is released}}
+ }
+}
+
+id makeCollectableNonLeak() {
+ extern CFTypeRef CFCreateSomething();
+
+ CFTypeRef object = CFCreateSomething(); // +1
+ CFRetain(object); // +2
+ id objCObject = NSMakeCollectable(object); // +2
+ [objCObject release]; // +1
+ return [objCObject autorelease]; // +0
+}
+
+
+void consumeAndStopTracking(id NS_CONSUMED obj, void (^callback)(void));
+void CFConsumeAndStopTracking(CFTypeRef CF_CONSUMED obj, void (^callback)(void));
+
+void testConsumeAndStopTracking() {
+ id retained = [@[] retain]; // +1
+ consumeAndStopTracking(retained, ^{}); // no-warning
+
+ id doubleRetained = [[@[] retain] retain]; // +2
+ consumeAndStopTracking(doubleRetained, ^{
+ [doubleRetained release];
+ }); // no-warning
+
+ id unretained = @[]; // +0
+ consumeAndStopTracking(unretained, ^{}); // expected-warning {{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
+
+void testCFConsumeAndStopTracking() {
+ id retained = [@[] retain]; // +1
+ CFConsumeAndStopTracking((CFTypeRef)retained, ^{}); // no-warning
+
+ id doubleRetained = [[@[] retain] retain]; // +2
+ CFConsumeAndStopTracking((CFTypeRef)doubleRetained, ^{
+ [doubleRetained release];
+ }); // no-warning
+
+ id unretained = @[]; // +0
+ CFConsumeAndStopTracking((CFTypeRef)unretained, ^{}); // expected-warning {{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
+//===----------------------------------------------------------------------===//
+// Test 'pragma clang arc_cf_code_audited' support.
+//===----------------------------------------------------------------------===//
+
+typedef void *MyCFType;
+#pragma clang arc_cf_code_audited begin
+MyCFType CreateMyCFType();
+#pragma clang arc_cf_code_audited end
+
+void test_custom_cf() {
+ MyCFType x = CreateMyCFType(); // expected-warning {{leak of an object stored into 'x'}}
+}
+
+//===----------------------------------------------------------------------===//
+// Test calling CFPlugInInstanceCreate, which appears in CF but doesn't
+// return a CF object.
+//===----------------------------------------------------------------------===//
+
+void test_CFPlugInInstanceCreate(CFUUIDRef factoryUUID, CFUUIDRef typeUUID) {
+ CFPlugInInstanceCreate(kCFAllocatorDefault, factoryUUID, typeUUID); // no-warning
+}
+
+//===----------------------------------------------------------------------===//
+// PR14927: -drain only has retain-count semantics on NSAutoreleasePool.
+//===----------------------------------------------------------------------===//
+
+@interface PR14927 : NSObject
+- (void)drain;
+@end
+
+void test_drain() {
+ PR14927 *obj = [[PR14927 alloc] init];
+ [obj drain];
+ [obj release]; // no-warning
+}
+
+//===----------------------------------------------------------------------===//
+// Allow cf_returns_retained and cf_returns_not_retained to mark a return
+// value as tracked, even if the object isn't a known CF type.
+//===----------------------------------------------------------------------===//
+
+MyCFType getCustom() __attribute__((cf_returns_not_retained));
+MyCFType makeCustom() __attribute__((cf_returns_retained));
+
+void testCustomReturnsRetained() {
+ MyCFType obj = makeCustom(); // expected-warning {{leak of an object stored into 'obj'}}
+}
+
+void testCustomReturnsNotRetained() {
+ CFRelease(getCustom()); // expected-warning {{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
+
+//===----------------------------------------------------------------------===//
+// Don't print variables which are out of the current scope.
+//===----------------------------------------------------------------------===//
+@interface MyObj12706177 : NSObject
+-(id)initX;
++(void)test12706177;
+@end
+static int Cond;
+@implementation MyObj12706177
+-(id)initX {
+ if (Cond)
+ return 0;
+ self = [super init];
+ return self;
+}
++(void)test12706177 {
+ id x = [[MyObj12706177 alloc] initX]; //expected-warning {{Potential leak of an object}}
+ [x release];
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/13783514> xpc_connection_set_finalizer_f
+//===----------------------------------------------------------------------===//
+
+typedef xpc_object_t xpc_connection_t;
+typedef void (*xpc_finalizer_t)(void *value);
+void xpc_connection_set_context(xpc_connection_t connection, void *ctx);
+void xpc_connection_set_finalizer_f(xpc_connection_t connection,
+ xpc_finalizer_t finalizer);
+void releaseAfterXPC(void *context) {
+ [(NSArray *)context release];
+}
+
+void rdar13783514(xpc_connection_t connection) {
+ xpc_connection_set_context(connection, [[NSMutableArray alloc] init]);
+ xpc_connection_set_finalizer_f(connection, releaseAfterXPC);
+} // no-warning
+
+CFAttributedStringRef CFAttributedCreate(void *CFObj CF_CONSUMED) CF_RETURNS_RETAINED;
+
+@interface Action
+- (SEL)action;
+- (void)setAction:(SEL)aSelector;
+- (id) target;
+- (void)setTarget:(id)aTarget;
+@end
diff --git a/test/ARCMT/objcmt-arc-cf-annotations.m.result b/test/ARCMT/objcmt-arc-cf-annotations.m.result
new file mode 100644
index 000000000000..7e0a9042f5e6
--- /dev/null
+++ b/test/ARCMT/objcmt-arc-cf-annotations.m.result
@@ -0,0 +1,2093 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fblocks -objcmt-migrate-annotation -objcmt-migrate-instancetype -objcmt-migrate-readwrite-property -mt-migrate-directory %t %s -x objective-c -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s.result
+
+#ifndef CF_IMPLICIT_BRIDGING_ENABLED
+#if __has_feature(arc_cf_code_audited)
+#define CF_IMPLICIT_BRIDGING_ENABLED _Pragma("clang arc_cf_code_audited begin")
+#else
+#define CF_IMPLICIT_BRIDGING_ENABLED
+#endif
+#endif
+
+#ifndef CF_IMPLICIT_BRIDGING_DISABLED
+#if __has_feature(arc_cf_code_audited)
+#define CF_IMPLICIT_BRIDGING_DISABLED _Pragma("clang arc_cf_code_audited end")
+#else
+#define CF_IMPLICIT_BRIDGING_DISABLED
+#endif
+#endif
+
+#if __has_feature(attribute_ns_returns_retained)
+#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
+#endif
+#if __has_feature(attribute_cf_returns_retained)
+#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
+#endif
+#if __has_feature(attribute_ns_returns_not_retained)
+#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
+#endif
+#if __has_feature(attribute_cf_returns_not_retained)
+#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
+#endif
+#if __has_feature(attribute_ns_consumes_self)
+#define NS_CONSUMES_SELF __attribute__((ns_consumes_self))
+#endif
+#if __has_feature(attribute_ns_consumed)
+#define NS_CONSUMED __attribute__((ns_consumed))
+#endif
+#if __has_feature(attribute_cf_consumed)
+#define CF_CONSUMED __attribute__((cf_consumed))
+#endif
+#if __has_attribute(ns_returns_autoreleased)
+#define NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
+#endif
+
+//===----------------------------------------------------------------------===//
+// The following code is reduced using delta-debugging from Mac OS X headers:
+//
+// #include <Cocoa/Cocoa.h>
+// #include <CoreFoundation/CoreFoundation.h>
+// #include <DiskArbitration/DiskArbitration.h>
+// #include <QuartzCore/QuartzCore.h>
+// #include <Quartz/Quartz.h>
+// #include <IOKit/IOKitLib.h>
+//
+// It includes the basic definitions for the test cases below.
+//===----------------------------------------------------------------------===//
+
+typedef unsigned int __darwin_natural_t;
+typedef unsigned long uintptr_t;
+typedef unsigned int uint32_t;
+typedef unsigned long long uint64_t;
+typedef unsigned int UInt32;
+typedef signed long CFIndex;
+typedef CFIndex CFByteOrder;
+typedef struct {
+ CFIndex location;
+ CFIndex length;
+} CFRange;
+static __inline__ __attribute__((always_inline)) CFRange CFRangeMake(CFIndex loc, CFIndex len) {
+ CFRange range;
+ range.location = loc;
+ range.length = len;
+ return range;
+}
+typedef const void * CFTypeRef;
+typedef const struct __CFString * CFStringRef;
+typedef const struct __CFAllocator * CFAllocatorRef;
+extern const CFAllocatorRef kCFAllocatorDefault;
+extern CFTypeRef CFRetain(CFTypeRef cf);
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+extern void CFRelease(CFTypeRef cf);
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+extern CFTypeRef CFMakeCollectable(CFTypeRef cf);
+typedef struct {
+}
+CFArrayCallBacks;
+extern const CFArrayCallBacks kCFTypeArrayCallBacks;
+typedef const struct __CFArray * CFArrayRef;
+typedef struct __CFArray * CFMutableArrayRef;
+extern CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFArrayCallBacks *callBacks) CF_RETURNS_RETAINED;
+extern const void *CFArrayGetValueAtIndex(CFArrayRef theArray, CFIndex idx) CF_RETURNS_NOT_RETAINED;
+extern void CFArrayAppendValue(CFMutableArrayRef theArray, const void *value);
+typedef struct {
+}
+CFDictionaryKeyCallBacks;
+extern const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
+typedef struct {
+}
+CFDictionaryValueCallBacks;
+extern const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
+typedef const struct __CFDictionary * CFDictionaryRef;
+typedef struct __CFDictionary * CFMutableDictionaryRef;
+extern CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks) CF_RETURNS_RETAINED;
+typedef UInt32 CFStringEncoding;
+enum {
+kCFStringEncodingMacRoman = 0, kCFStringEncodingWindowsLatin1 = 0x0500, kCFStringEncodingISOLatin1 = 0x0201, kCFStringEncodingNextStepLatin = 0x0B01, kCFStringEncodingASCII = 0x0600, kCFStringEncodingUnicode = 0x0100, kCFStringEncodingUTF8 = 0x08000100, kCFStringEncodingNonLossyASCII = 0x0BFF , kCFStringEncodingUTF16 = 0x0100, kCFStringEncodingUTF16BE = 0x10000100, kCFStringEncodingUTF16LE = 0x14000100, kCFStringEncodingUTF32 = 0x0c000100, kCFStringEncodingUTF32BE = 0x18000100, kCFStringEncodingUTF32LE = 0x1c000100 };
+extern CFStringRef CFStringCreateWithCString(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding) CF_RETURNS_RETAINED;
+typedef double CFTimeInterval;
+typedef CFTimeInterval CFAbsoluteTime;
+extern CFAbsoluteTime CFAbsoluteTimeGetCurrent(void);
+typedef const struct __CFDate * CFDateRef;
+extern CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at) CF_RETURNS_RETAINED;
+extern CFAbsoluteTime CFDateGetAbsoluteTime(CFDateRef theDate);
+typedef __darwin_natural_t natural_t;
+typedef natural_t mach_port_name_t;
+typedef mach_port_name_t mach_port_t;
+typedef int kern_return_t;
+typedef kern_return_t mach_error_t;
+enum {
+kCFNumberSInt8Type = 1, kCFNumberSInt16Type = 2, kCFNumberSInt32Type = 3, kCFNumberSInt64Type = 4, kCFNumberFloat32Type = 5, kCFNumberFloat64Type = 6, kCFNumberCharType = 7, kCFNumberShortType = 8, kCFNumberIntType = 9, kCFNumberLongType = 10, kCFNumberLongLongType = 11, kCFNumberFloatType = 12, kCFNumberDoubleType = 13, kCFNumberCFIndexType = 14, kCFNumberNSIntegerType = 15, kCFNumberCGFloatType = 16, kCFNumberMaxType = 16 };
+typedef CFIndex CFNumberType;
+typedef const struct __CFNumber * CFNumberRef;
+extern CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr) CF_RETURNS_RETAINED;
+typedef const struct __CFAttributedString *CFAttributedStringRef;
+typedef struct __CFAttributedString *CFMutableAttributedStringRef;
+extern CFAttributedStringRef CFAttributedStringCreate(CFAllocatorRef alloc, CFStringRef str, CFDictionaryRef attributes) CF_RETURNS_RETAINED ;
+extern CFMutableAttributedStringRef CFAttributedStringCreateMutableCopy(CFAllocatorRef alloc, CFIndex maxLength, CFAttributedStringRef aStr) CF_RETURNS_RETAINED ;
+extern void CFAttributedStringSetAttribute(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef attrName, CFTypeRef value) ;
+typedef signed char BOOL;
+typedef unsigned long NSUInteger;
+@class NSString, Protocol;
+extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
+typedef struct _NSZone NSZone;
+@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
+@protocol NSObject
+- (BOOL)isEqual:(id)object;
+- (id)retain;
+- (oneway void)release;
+- (id)autorelease;
+- (NSString *)description;
+- (instancetype)init;
+@end
+@protocol NSCopying
+- (id)copyWithZone:(NSZone *)zone;
+@end
+@protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone;
+@end
+@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
+@end
+@interface NSObject <NSObject> {}
++ (id)allocWithZone:(NSZone *)zone;
++ (id)alloc;
++ (id)new;
+- (void)dealloc;
+@end
+@interface NSObject (NSCoderMethods)
+- (id)awakeAfterUsingCoder:(NSCoder *)aDecoder;
+@end
+extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
+typedef struct {
+}
+NSFastEnumerationState;
+@protocol NSFastEnumeration
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;
+@end
+@class NSString, NSDictionary;
+@interface NSValue : NSObject <NSCopying, NSCoding> - (void)getValue:(void *)value;
+@end
+@interface NSNumber : NSValue
+- (char)charValue;
+- (instancetype)initWithInt:(int)value;
++ (NSNumber *)numberWithInt:(int)value;
+@end
+@class NSString;
+@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>
+- (NSUInteger)count;
+- (instancetype)initWithObjects:(const id [])objects count:(NSUInteger)cnt;
++ (instancetype)arrayWithObject:(id)anObject;
++ (instancetype)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt;
++ (instancetype)arrayWithObjects:(id)firstObj, ... __attribute__((sentinel(0,1)));
+- (instancetype)initWithObjects:(id)firstObj, ... __attribute__((sentinel(0,1)));
+- (instancetype)initWithArray:(NSArray *)array;
+@end @interface NSArray (NSArrayCreation) + (instancetype)array;
+@end @interface NSAutoreleasePool : NSObject {
+}
+- (void)drain;
+@end extern NSString * const NSBundleDidLoadNotification;
+typedef double NSTimeInterval;
+@interface NSDate : NSObject <NSCopying, NSCoding> - (NSTimeInterval)timeIntervalSinceReferenceDate;
+@end typedef unsigned short unichar;
+@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding>
+- (NSUInteger)length;
+- (NSString *)stringByAppendingString:(NSString *)aString;
+- ( const char *)UTF8String;
+- (instancetype)initWithUTF8String:(const char *)nullTerminatedCString;
++ (instancetype)stringWithUTF8String:(const char *)nullTerminatedCString;
+@end @class NSString, NSURL, NSError;
+@interface NSData : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length;
++ (instancetype)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length;
++ (instancetype)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
+@end @class NSLocale, NSDate, NSCalendar, NSTimeZone, NSError, NSArray, NSMutableDictionary;
+@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>
+- (NSUInteger)count;
++ (instancetype)dictionaryWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
++ (instancetype)dictionaryWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;
+@end
+@interface NSMutableDictionary : NSDictionary - (void)removeObjectForKey:(id)aKey;
+- (void)setObject:(id)anObject forKey:(id)aKey;
+@end @interface NSMutableDictionary (NSMutableDictionaryCreation) + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
+@end typedef double CGFloat;
+struct CGSize {
+};
+typedef struct CGSize CGSize;
+struct CGRect {
+};
+typedef struct CGRect CGRect;
+typedef mach_port_t io_object_t;
+typedef char io_name_t[128];
+typedef io_object_t io_iterator_t;
+typedef io_object_t io_service_t;
+typedef struct IONotificationPort * IONotificationPortRef;
+typedef void (*IOServiceMatchingCallback)( void * refcon, io_iterator_t iterator );
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+io_service_t IOServiceGetMatchingService( mach_port_t masterPort, CFDictionaryRef matching );
+kern_return_t IOServiceGetMatchingServices( mach_port_t masterPort, CFDictionaryRef matching, io_iterator_t * existing );
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+kern_return_t IOServiceAddNotification( mach_port_t masterPort, const io_name_t notificationType, CFDictionaryRef matching, mach_port_t wakePort, uintptr_t reference, io_iterator_t * notification ) __attribute__((deprecated)); // expected-note {{'IOServiceAddNotification' declared here}}
+kern_return_t IOServiceAddMatchingNotification( IONotificationPortRef notifyPort, const io_name_t notificationType, CFDictionaryRef CF_CONSUMED matching, IOServiceMatchingCallback callback, void * refCon, io_iterator_t * notification );
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+CFMutableDictionaryRef IOServiceMatching( const char * name );
+CFMutableDictionaryRef IOServiceNameMatching( const char * name );
+CFMutableDictionaryRef IOBSDNameMatching( mach_port_t masterPort, uint32_t options, const char * bsdName );
+CFMutableDictionaryRef IOOpenFirmwarePathMatching( mach_port_t masterPort, uint32_t options, const char * path );
+CFMutableDictionaryRef IORegistryEntryIDMatching( uint64_t entryID );
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+typedef struct __DASession * DASessionRef;
+extern DASessionRef DASessionCreate( CFAllocatorRef allocator ) CF_RETURNS_RETAINED;
+typedef struct __DADisk * DADiskRef;
+extern DADiskRef DADiskCreateFromBSDName( CFAllocatorRef allocator, DASessionRef session, const char * name ) CF_RETURNS_RETAINED;
+extern DADiskRef DADiskCreateFromIOMedia( CFAllocatorRef allocator, DASessionRef session, io_service_t media ) CF_RETURNS_RETAINED;
+extern CFDictionaryRef DADiskCopyDescription( DADiskRef disk ) CF_RETURNS_RETAINED;
+extern DADiskRef DADiskCopyWholeDisk( DADiskRef disk ) CF_RETURNS_RETAINED;
+@interface NSTask : NSObject - (instancetype)init;
+@end typedef struct CGColorSpace *CGColorSpaceRef;
+typedef struct CGImage *CGImageRef;
+typedef struct CGLayer *CGLayerRef;
+@interface NSResponder : NSObject <NSCoding> {
+}
+@end @protocol NSAnimatablePropertyContainer - (id)animator;
+@end extern NSString *NSAnimationTriggerOrderIn ;
+@interface NSView : NSResponder <NSAnimatablePropertyContainer> {
+}
+@end @protocol NSValidatedUserInterfaceItem - (SEL)action;
+@end @protocol NSUserInterfaceValidations - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem;
+@end @class NSDate, NSDictionary, NSError, NSException, NSNotification;
+@class NSTextField, NSPanel, NSArray, NSWindow, NSImage, NSButton, NSError;
+@interface NSApplication : NSResponder <NSUserInterfaceValidations> {
+}
+- (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)docWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
+@end enum {
+NSTerminateCancel = 0, NSTerminateNow = 1, NSTerminateLater = 2 };
+typedef NSUInteger NSApplicationTerminateReply;
+@protocol NSApplicationDelegate <NSObject> @optional - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
+@end @class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView, NSTextView;
+@interface NSCell : NSObject <NSCopying, NSCoding> {
+}
+@end
+typedef struct {
+}
+CVTimeStamp;
+@interface CIImage : NSObject <NSCoding, NSCopying> {
+}
+typedef int CIFormat;
+@end enum {
+kDAReturnSuccess = 0, kDAReturnError = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x01, kDAReturnBusy = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x02, kDAReturnBadArgument = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x03, kDAReturnExclusiveAccess = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x04, kDAReturnNoResources = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x05, kDAReturnNotFound = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x06, kDAReturnNotMounted = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x07, kDAReturnNotPermitted = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x08, kDAReturnNotPrivileged = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x09, kDAReturnNotReady = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0A, kDAReturnNotWritable = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0B, kDAReturnUnsupported = (((0x3eU)&0x3f)<<26) | (((0x368)&0xfff)<<14) | 0x0C };
+typedef mach_error_t DAReturn;
+typedef const struct __DADissenter * DADissenterRef;
+extern DADissenterRef DADissenterCreate( CFAllocatorRef allocator, DAReturn status, CFStringRef string ) CF_RETURNS_RETAINED;
+@interface CIContext: NSObject {
+}
+- (CGImageRef)createCGImage:(CIImage *)im fromRect:(CGRect)r CF_RETURNS_RETAINED;
+- (CGImageRef)createCGImage:(CIImage *)im fromRect:(CGRect)r format:(CIFormat)f colorSpace:(CGColorSpaceRef)cs CF_RETURNS_RETAINED;
+- (CGLayerRef)createCGLayerWithSize:(CGSize)size info:(CFDictionaryRef)d CF_RETURNS_RETAINED;
+@end extern NSString* const QCRendererEventKey;
+@protocol QCCompositionRenderer - (NSDictionary*) attributes;
+@end @interface QCRenderer : NSObject <QCCompositionRenderer> {
+}
+- (id) createSnapshotImageOfType:(NSString*)type;
+@end extern NSString* const QCViewDidStartRenderingNotification;
+@interface QCView : NSView <QCCompositionRenderer> {
+}
+- (id) createSnapshotImageOfType:(NSString*)type;
+@end enum {
+ICEXIFOrientation1 = 1, ICEXIFOrientation2 = 2, ICEXIFOrientation3 = 3, ICEXIFOrientation4 = 4, ICEXIFOrientation5 = 5, ICEXIFOrientation6 = 6, ICEXIFOrientation7 = 7, ICEXIFOrientation8 = 8, };
+@class ICDevice;
+@protocol ICDeviceDelegate <NSObject> @required - (void)didRemoveDevice:(ICDevice*)device;
+@end extern NSString *const ICScannerStatusWarmingUp;
+@class ICScannerDevice;
+@protocol ICScannerDeviceDelegate <ICDeviceDelegate> @optional - (void)scannerDeviceDidBecomeAvailable:(ICScannerDevice*)scanner;
+@end
+
+typedef long unsigned int __darwin_size_t;
+typedef __darwin_size_t size_t;
+typedef unsigned long CFTypeID;
+struct CGPoint {
+ CGFloat x;
+ CGFloat y;
+};
+typedef struct CGPoint CGPoint;
+typedef struct CGGradient *CGGradientRef;
+typedef uint32_t CGGradientDrawingOptions;
+extern CFTypeID CGGradientGetTypeID(void);
+extern CGGradientRef CGGradientCreateWithColorComponents(CGColorSpaceRef
+ space, const CGFloat components[], const CGFloat locations[], size_t count) CF_RETURNS_RETAINED;
+extern CGGradientRef CGGradientCreateWithColors(CGColorSpaceRef space,
+ CFArrayRef colors, const CGFloat locations[]) CF_RETURNS_RETAINED;
+extern CGGradientRef CGGradientRetain(CGGradientRef gradient);
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+extern void CGGradientRelease(CGGradientRef gradient);
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+typedef struct CGContext *CGContextRef;
+extern void CGContextDrawLinearGradient(CGContextRef context,
+ CGGradientRef gradient, CGPoint startPoint, CGPoint endPoint,
+ CGGradientDrawingOptions options);
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+
+@interface NSMutableArray : NSObject
+- (void)addObject:(id)object;
++ (instancetype)array;
+@end
+
+// This is how NSMakeCollectable is declared in the OS X 10.8 headers.
+id NSMakeCollectable(CFTypeRef __attribute__((cf_consumed))) __attribute__((ns_returns_retained));
+
+typedef const struct __CFUUID * CFUUIDRef;
+
+extern
+void *CFPlugInInstanceCreate(CFAllocatorRef allocator, CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
+
+//===----------------------------------------------------------------------===//
+// Test cases.
+//===----------------------------------------------------------------------===//
+
+CFAbsoluteTime f1() {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ CFDateRef date = CFDateCreate(0, t);
+ CFRetain(date);
+ CFRelease(date);
+ CFDateGetAbsoluteTime(date); // no-warning
+ CFRelease(date);
+ t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}}
+ return t;
+}
+
+CFAbsoluteTime f2() {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ CFDateRef date = CFDateCreate(0, t);
+ [((NSDate*) date) retain];
+ CFRelease(date);
+ CFDateGetAbsoluteTime(date); // no-warning
+ [((NSDate*) date) release];
+ t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}}
+ return t;
+}
+
+
+NSDate* global_x;
+
+// Test to see if we supresss an error when we store the pointer
+// to a global.
+
+CFAbsoluteTime f3() {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ CFDateRef date = CFDateCreate(0, t);
+ [((NSDate*) date) retain];
+ CFRelease(date);
+ CFDateGetAbsoluteTime(date); // no-warning
+ global_x = (NSDate*) date;
+ [((NSDate*) date) release];
+ t = CFDateGetAbsoluteTime(date); // no-warning
+ return t;
+}
+
+//---------------------------------------------------------------------------
+// Test case 'f4' differs for region store and basic store. See
+// retain-release-region-store.m and retain-release-basic-store.m.
+//---------------------------------------------------------------------------
+
+// Test a leak.
+
+CFAbsoluteTime f5(int x) {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ CFDateRef date = CFDateCreate(0, t); // expected-warning{{leak}}
+
+ if (x)
+ CFRelease(date);
+
+ return t;
+}
+
+// Test a leak involving the return.
+
+CFDateRef f6(int x) {
+ CFDateRef date = CFDateCreate(0, CFAbsoluteTimeGetCurrent()); // expected-warning{{leak}}
+ CFRetain(date);
+ return date;
+}
+
+// Test a leak involving an overwrite.
+
+CFDateRef f7() {
+ CFDateRef date = CFDateCreate(0, CFAbsoluteTimeGetCurrent()); //expected-warning{{leak}}
+ CFRetain(date);
+ date = CFDateCreate(0, CFAbsoluteTimeGetCurrent()); // expected-warning {{leak}}
+ return date;
+}
+
+// Generalization of Create rule. MyDateCreate returns a CFXXXTypeRef, and
+// has the word create.
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+CFDateRef MyDateCreate();
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+
+CFDateRef f8() {
+ CFDateRef date = MyDateCreate(); // expected-warning{{leak}}
+ CFRetain(date);
+ return date;
+}
+
+__attribute__((cf_returns_retained)) CFDateRef f9() {
+ CFDateRef date = CFDateCreate(0, CFAbsoluteTimeGetCurrent()); // no-warning
+ int *p = 0;
+ // When allocations fail, CFDateCreate can return null.
+ if (!date) *p = 1; // expected-warning{{null}}
+ return date;
+}
+
+// Handle DiskArbitration API:
+//
+// http://developer.apple.com/DOCUMENTATION/DARWIN/Reference/DiscArbitrationFramework/
+//
+void f10(io_service_t media, DADiskRef d, CFStringRef s) {
+ DADiskRef disk = DADiskCreateFromBSDName(kCFAllocatorDefault, 0, "hello"); // expected-warning{{leak}}
+ if (disk) NSLog(@"ok");
+
+ disk = DADiskCreateFromIOMedia(kCFAllocatorDefault, 0, media); // expected-warning{{leak}}
+ if (disk) NSLog(@"ok");
+
+ CFDictionaryRef dict = DADiskCopyDescription(d); // expected-warning{{leak}}
+ if (dict) NSLog(@"ok");
+
+ disk = DADiskCopyWholeDisk(d); // expected-warning{{leak}}
+ if (disk) NSLog(@"ok");
+
+ DADissenterRef dissenter = DADissenterCreate(kCFAllocatorDefault, // expected-warning{{leak}}
+ kDAReturnSuccess, s);
+ if (dissenter) NSLog(@"ok");
+
+ DASessionRef session = DASessionCreate(kCFAllocatorDefault); // expected-warning{{leak}}
+ if (session) NSLog(@"ok");
+}
+
+// Test retain/release checker with CFString and CFMutableArray.
+void f11() {
+ // Create the array.
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+
+ // Create a string.
+ CFStringRef s1 = CFStringCreateWithCString(0, "hello world",
+ kCFStringEncodingUTF8);
+
+ // Add the string to the array.
+ CFArrayAppendValue(A, s1);
+
+ // Decrement the reference count.
+ CFRelease(s1); // no-warning
+
+ // Get the string. We don't own it.
+ s1 = (CFStringRef) CFArrayGetValueAtIndex(A, 0);
+
+ // Release the array.
+ CFRelease(A); // no-warning
+
+ // Release the string. This is a bug.
+ CFRelease(s1); // expected-warning{{Incorrect decrement of the reference count}}
+}
+
+// PR 3337: Handle functions declared using typedefs.
+typedef CFTypeRef CREATEFUN();
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+CFTypeRef MyCreateFun();
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+
+void f12() {
+ CFTypeRef o = MyCreateFun(); // expected-warning {{leak}}
+}
+
+void f13_autorelease() {
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+ [(id) A autorelease]; // no-warning
+}
+
+void f13_autorelease_b() {
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ [(id) A autorelease];
+ [(id) A autorelease];
+} // expected-warning{{Object autoreleased too many times}}
+
+CFMutableArrayRef f13_autorelease_c() {
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ [(id) A autorelease];
+ [(id) A autorelease];
+ return A; // expected-warning{{Object autoreleased too many times}}
+}
+
+CFMutableArrayRef f13_autorelease_d() {
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ [(id) A autorelease];
+ [(id) A autorelease];
+ CFMutableArrayRef B = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning{{Object autoreleased too many times}}
+ CFRelease(B); // no-warning
+ while (1) {}
+}
+
+
+// This case exercises the logic where the leak site is the same as the allocation site.
+void f14_leakimmediately() {
+ CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning{{leak}}
+}
+
+// Test that we track an allocated object beyond the point where the *name*
+// of the variable storing the reference is no longer live.
+void f15() {
+ // Create the array.
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ CFMutableArrayRef *B = &A;
+ // At this point, the name 'A' is no longer live.
+ CFRelease(*B); // no-warning
+}
+
+// Test when we pass NULL to CFRetain/CFRelease/CFMakeCollectable.
+void f16(int x, CFTypeRef p) {
+ if (p)
+ return;
+
+ if (x > 0) {
+ CFRelease(p); // expected-warning{{Null pointer argument in call to CFRelease}}
+ }
+ else if (x < 0) {
+ CFRetain(p); // expected-warning{{Null pointer argument in call to CFRetain}}
+ }
+ else {
+ CFMakeCollectable(p); // expected-warning{{Null pointer argument in call to CFMakeCollectable}}
+ }
+}
+
+// Test that an object is non-null after being CFRetained/CFReleased.
+void f17(int x, CFTypeRef p) {
+ if (x > 0) {
+ CFRelease(p);
+ if (!p)
+ CFRelease(0); // no-warning
+ }
+ else if (x < 0) {
+ CFRetain(p);
+ if (!p)
+ CFRetain(0); // no-warning
+ }
+ else {
+ CFMakeCollectable(p);
+ if (!p)
+ CFMakeCollectable(0); // no-warning
+ }
+}
+
+// Test basic tracking of ivars associated with 'self'. For the retain/release
+// checker we currently do not want to flag leaks associated with stores
+// of tracked objects to ivars.
+@interface SelfIvarTest : NSObject {
+ id myObj;
+}
+- (void)test_self_tracking;
+@end
+
+@implementation SelfIvarTest
+- (void)test_self_tracking {
+ myObj = (id) CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+@end
+
+// Test return of non-owned objects in contexts where an owned object
+// is expected.
+@interface TestReturnNotOwnedWhenExpectedOwned
+- (NSString*)newString;
+@end
+
+@implementation TestReturnNotOwnedWhenExpectedOwned
+- (NSString*)newString {
+ NSString *s = [NSString stringWithUTF8String:"hello"];
+ return s; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
+}
+@end
+
+// <rdar://problem/6659160>
+int isFoo(char c);
+
+static void rdar_6659160(char *inkind, char *inname)
+{
+ // We currently expect that [NSObject alloc] cannot fail. This
+ // will be a toggled flag in the future. It can indeed return null, but
+ // Cocoa programmers generally aren't expected to reason about out-of-memory
+ // conditions.
+ NSString *kind = [[NSString alloc] initWithUTF8String:inkind]; // expected-warning{{leak}}
+
+ // We do allow stringWithUTF8String to fail. This isn't really correct, as
+ // far as returning 0. In most error conditions it will throw an exception.
+ // If allocation fails it could return 0, but again this
+ // isn't expected.
+ NSString *name = [NSString stringWithUTF8String:inname];
+ if(!name)
+ return;
+
+ const char *kindC = 0;
+ const char *nameC = 0;
+
+ // In both cases, we cannot reach a point down below where we
+ // dereference kindC or nameC with either being null. This is because
+ // we assume that [NSObject alloc] doesn't fail and that we have the guard
+ // up above.
+
+ if(kind)
+ kindC = [kind UTF8String];
+ if(name)
+ nameC = [name UTF8String];
+ if(!isFoo(kindC[0])) // expected-warning{{null}}
+ return;
+ if(!isFoo(nameC[0])) // no-warning
+ return;
+
+ [kind release];
+ [name release]; // expected-warning{{Incorrect decrement of the reference count}}
+}
+
+// PR 3677 - 'allocWithZone' should be treated as following the Cocoa naming
+// conventions with respect to 'return'ing ownership.
+@interface PR3677: NSObject @end
+@implementation PR3677
++ (id)allocWithZone:(NSZone *)inZone {
+ return [super allocWithZone:inZone]; // no-warning
+}
+@end
+
+// PR 3820 - Reason about calls to -dealloc
+void pr3820_DeallocInsteadOfRelease(void)
+{
+ id foo = [[NSString alloc] init]; // no-warning
+ [foo dealloc];
+ // foo is not leaked, since it has been deallocated.
+}
+
+void pr3820_ReleaseAfterDealloc(void)
+{
+ id foo = [[NSString alloc] init];
+ [foo dealloc];
+ [foo release]; // expected-warning{{used after it is release}}
+ // NSInternalInconsistencyException: message sent to deallocated object
+}
+
+void pr3820_DeallocAfterRelease(void)
+{
+ NSLog(@"\n\n[%s]", __FUNCTION__);
+ id foo = [[NSString alloc] init];
+ [foo release];
+ [foo dealloc]; // expected-warning{{used after it is released}}
+ // message sent to released object
+}
+
+// From <rdar://problem/6704930>. The problem here is that 'length' binds to
+// '($0 - 1)' after '--length', but SimpleConstraintManager doesn't know how to
+// reason about '($0 - 1) > constant'. As a temporary hack, we drop the value
+// of '($0 - 1)' and conjure a new symbol.
+void rdar6704930(unsigned char *s, unsigned int length) {
+ NSString* name = 0;
+ if (s != 0) {
+ if (length > 0) {
+ while (length > 0) {
+ if (*s == ':') {
+ ++s;
+ --length;
+ name = [[NSString alloc] init]; // no-warning
+ break;
+ }
+ ++s;
+ --length;
+ }
+ if ((length == 0) && (name != 0)) {
+ [name release];
+ name = 0;
+ }
+ if (length == 0) { // no ':' found -> use it all as name
+ name = [[NSString alloc] init]; // no-warning
+ }
+ }
+ }
+
+ if (name != 0) {
+ [name release];
+ }
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6833332>
+// One build of the analyzer accidentally stopped tracking the allocated
+// object after the 'retain'.
+//===----------------------------------------------------------------------===//
+
+@interface rdar_6833332 : NSObject <NSApplicationDelegate> {
+ NSWindow *window;
+}
+@property (nonatomic, retain) NSWindow *window;
+@end
+
+@implementation rdar_6833332
+@synthesize window;
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
+ NSMutableDictionary *dict = [[NSMutableDictionary dictionaryWithCapacity:4] retain]; // expected-warning{{leak}}
+
+ [dict setObject:@"foo" forKey:@"bar"];
+
+ NSLog(@"%@", dict);
+}
+- (void)dealloc {
+ [window release];
+ [super dealloc];
+}
+
+- (void)radar10102244 {
+ NSMutableDictionary *dict = [[NSMutableDictionary dictionaryWithCapacity:4] retain]; // expected-warning{{leak}}
+ if (window)
+ NSLog(@"%@", window);
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6257780> clang checker fails to catch use-after-release
+//===----------------------------------------------------------------------===//
+
+int rdar_6257780_Case1() {
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ NSArray *array = [NSArray array];
+ [array release]; // expected-warning{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+ [pool drain];
+ return 0;
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/10640253> Analyzer is confused about NSAutoreleasePool -allocWithZone:.
+//===----------------------------------------------------------------------===//
+
+void rdar_10640253_autorelease_allocWithZone() {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool allocWithZone:(NSZone*)0] init];
+ (void) pool;
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6866843> Checker should understand new/setObject:/release constructs
+//===----------------------------------------------------------------------===//
+
+void rdar_6866843() {
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ NSMutableDictionary* dictionary = [[NSMutableDictionary alloc] init];
+ NSArray* array = [[NSArray alloc] init];
+ [dictionary setObject:array forKey:@"key"];
+ [array release];
+ // Using 'array' here should be fine
+ NSLog(@"array = %@\n", array); // no-warning
+ // Now the array is released
+ [dictionary release];
+ [pool drain];
+}
+
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6877235> Classes typedef-ed to CF objects should get the same treatment as CF objects
+//===----------------------------------------------------------------------===//
+
+typedef CFTypeRef OtherRef;
+
+@interface RDar6877235 : NSObject {}
+- (CFTypeRef)_copyCFTypeRef CF_RETURNS_RETAINED;
+- (OtherRef)_copyOtherRef CF_RETURNS_RETAINED;
+@end
+
+@implementation RDar6877235
+- (CFTypeRef)_copyCFTypeRef {
+ return [[NSString alloc] init]; // no-warning
+}
+- (OtherRef)_copyOtherRef {
+ return [[NSString alloc] init]; // no-warning
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6320065> false positive - init method returns an object
+// owned by caller
+//===----------------------------------------------------------------------===//
+
+@interface RDar6320065 : NSObject {
+ NSString *_foo;
+}
+- (instancetype)initReturningNewClass;
+- (id)_initReturningNewClassBad;
+- (instancetype)initReturningNewClassBad2;
+@end
+
+@interface RDar6320065Subclass : RDar6320065
+@end
+
+@implementation RDar6320065
+- (instancetype)initReturningNewClass {
+ [self release];
+ self = [[RDar6320065Subclass alloc] init]; // no-warning
+ return self;
+}
+- (id)_initReturningNewClassBad {
+ [self release];
+ [[RDar6320065Subclass alloc] init]; // expected-warning {{leak}}
+ return self;
+}
+- (instancetype)initReturningNewClassBad2 {
+ [self release];
+ self = [[RDar6320065Subclass alloc] init];
+ return [self autorelease]; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
+}
+
+@end
+
+@implementation RDar6320065Subclass
+@end
+
+int RDar6320065_test() {
+ RDar6320065 *test = [[RDar6320065 alloc] init]; // no-warning
+ [test release];
+ return 0;
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7129086> -awakeAfterUsingCoder: returns an owned object
+// and claims the receiver
+//===----------------------------------------------------------------------===//
+
+@interface RDar7129086 : NSObject {} @end
+@implementation RDar7129086
+- (id)awakeAfterUsingCoder:(NSCoder *)aDecoder {
+ [self release]; // no-warning
+ return [NSString alloc]; // no-warning
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6859457> [NSData dataWithBytesNoCopy] does not return a
+// retained object
+//===----------------------------------------------------------------------===//
+
+@interface RDar6859457 : NSObject {}
+- (NSString*) NoCopyString;
+- (NSString*) noCopyString;
+@end
+
+@implementation RDar6859457
+- (NSString*) NoCopyString { return [[NSString alloc] init]; } // expected-warning{{leak}}
+- (NSString*) noCopyString { return [[NSString alloc] init]; } // expected-warning{{leak}}
+@end
+
+void test_RDar6859457(RDar6859457 *x, void *bytes, NSUInteger dataLength) {
+ [x NoCopyString]; // expected-warning{{leak}}
+ [x noCopyString]; // expected-warning{{leak}}
+ [NSData dataWithBytesNoCopy:bytes length:dataLength]; // no-warning
+ [NSData dataWithBytesNoCopy:bytes length:dataLength freeWhenDone:1]; // no-warning
+}
+
+//===----------------------------------------------------------------------===//
+// PR 4230 - an autorelease pool is not necessarily leaked during a premature
+// return
+//===----------------------------------------------------------------------===//
+
+static void PR4230(void)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // no-warning
+ NSString *object = [[[NSString alloc] init] autorelease]; // no-warning
+ return;
+}
+
+static void PR4230_new(void)
+{
+ NSAutoreleasePool *pool = [NSAutoreleasePool new]; // no-warning
+ NSString *object = [[[NSString alloc] init] autorelease]; // no-warning
+ return;
+}
+
+//===----------------------------------------------------------------------===//
+// Method name that has a null IdentifierInfo* for its first selector slot.
+// This test just makes sure that we handle it.
+//===----------------------------------------------------------------------===//
+
+@interface TestNullIdentifier
+@end
+
+@implementation TestNullIdentifier
++ (id):(int)x, ... {
+ return [[NSString alloc] init]; // expected-warning{{leak}}
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6893565> don't flag leaks for return types that cannot be
+// determined to be CF types
+//===----------------------------------------------------------------------===//
+
+// We don't know if 'struct s6893565' represents a Core Foundation type, so
+// we shouldn't emit an error here.
+typedef struct s6893565* TD6893565;
+
+@interface RDar6893565 {}
+-(TD6893565)newThing;
+@end
+
+@implementation RDar6893565
+-(TD6893565)newThing {
+ return (TD6893565) [[NSString alloc] init]; // no-warning
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6902710> clang: false positives w/QC and CoreImage methods
+//===----------------------------------------------------------------------===//
+
+void rdar6902710(QCView *view, QCRenderer *renderer, CIContext *context,
+ NSString *str, CIImage *img, CGRect rect,
+ CIFormat form, CGColorSpaceRef cs) {
+ [view createSnapshotImageOfType:str]; // expected-warning{{leak}}
+ [renderer createSnapshotImageOfType:str]; // expected-warning{{leak}}
+ [context createCGImage:img fromRect:rect]; // expected-warning{{leak}}
+ [context createCGImage:img fromRect:rect format:form colorSpace:cs]; // expected-warning{{leak}}
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6945561> -[CIContext createCGLayerWithSize:info:]
+// misinterpreted by clang scan-build
+//===----------------------------------------------------------------------===//
+
+void rdar6945561(CIContext *context, CGSize size, CFDictionaryRef d) {
+ [context createCGLayerWithSize:size info:d]; // expected-warning{{leak}}
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/6961230> add knowledge of IOKit functions to retain/release
+// checker
+//===----------------------------------------------------------------------===//
+
+void IOBSDNameMatching_wrapper(mach_port_t masterPort, uint32_t options, const char * bsdName) {
+ IOBSDNameMatching(masterPort, options, bsdName); // expected-warning{{leak}}
+}
+
+void IOServiceMatching_wrapper(const char * name) {
+ IOServiceMatching(name); // expected-warning{{leak}}
+}
+
+void IOServiceNameMatching_wrapper(const char * name) {
+ IOServiceNameMatching(name); // expected-warning{{leak}}
+}
+
+CF_RETURNS_RETAINED CFDictionaryRef CreateDict();
+
+void IOServiceAddNotification_wrapper(mach_port_t masterPort, const io_name_t notificationType,
+ mach_port_t wakePort, uintptr_t reference, io_iterator_t * notification ) {
+
+ CFDictionaryRef matching = CreateDict();
+ CFRelease(matching);
+ IOServiceAddNotification(masterPort, notificationType, matching, // expected-warning{{used after it is released}} expected-warning{{deprecated}}
+ wakePort, reference, notification);
+}
+
+void IORegistryEntryIDMatching_wrapper(uint64_t entryID ) {
+ IORegistryEntryIDMatching(entryID); // expected-warning{{leak}}
+}
+
+void IOOpenFirmwarePathMatching_wrapper(mach_port_t masterPort, uint32_t options,
+ const char * path) {
+ IOOpenFirmwarePathMatching(masterPort, options, path); // expected-warning{{leak}}
+}
+
+void IOServiceGetMatchingService_wrapper(mach_port_t masterPort) {
+ CFDictionaryRef matching = CreateDict();
+ IOServiceGetMatchingService(masterPort, matching);
+ CFRelease(matching); // expected-warning{{used after it is released}}
+}
+
+void IOServiceGetMatchingServices_wrapper(mach_port_t masterPort, io_iterator_t *existing) {
+ CFDictionaryRef matching = CreateDict();
+ IOServiceGetMatchingServices(masterPort, matching, existing);
+ CFRelease(matching); // expected-warning{{used after it is released}}
+}
+
+void IOServiceAddMatchingNotification_wrapper(IONotificationPortRef notifyPort, const io_name_t notificationType,
+ IOServiceMatchingCallback callback, void * refCon, io_iterator_t * notification) {
+
+ CFDictionaryRef matching = CreateDict();
+ IOServiceAddMatchingNotification(notifyPort, notificationType, matching, callback, refCon, notification);
+ CFRelease(matching); // expected-warning{{used after it is released}}
+}
+
+//===----------------------------------------------------------------------===//
+// Test of handling objects whose references "escape" to containers.
+//===----------------------------------------------------------------------===//
+
+void CFDictionaryAddValue(CFMutableDictionaryRef, void *, void *);
+
+// <rdar://problem/6539791>
+void rdar_6539791(CFMutableDictionaryRef y, void* key, void* val_key) {
+ CFMutableDictionaryRef x = CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ CFDictionaryAddValue(y, key, x);
+ CFRelease(x); // the dictionary keeps a reference, so the object isn't deallocated yet
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z);
+ if (value) {
+ CFDictionaryAddValue(x, val_key, (void*)value); // no-warning
+ CFRelease(value);
+ CFDictionaryAddValue(y, val_key, (void*)value); // no-warning
+ }
+}
+
+// <rdar://problem/6560661>
+// Same issue, except with "AppendValue" functions.
+void rdar_6560661(CFMutableArrayRef x) {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z);
+ // CFArrayAppendValue keeps a reference to value.
+ CFArrayAppendValue(x, value);
+ CFRelease(value);
+ CFRetain(value);
+ CFRelease(value); // no-warning
+}
+
+// <rdar://problem/7152619>
+// Same issue, excwept with "CFAttributeStringSetAttribute".
+void rdar_7152619(CFStringRef str) {
+ CFAttributedStringRef string = CFAttributedStringCreate(kCFAllocatorDefault, str, 0);
+ CFMutableAttributedStringRef attrString = CFAttributedStringCreateMutableCopy(kCFAllocatorDefault, 100, string);
+ CFRelease(string);
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // expected-warning{{leak}}
+ CFAttributedStringSetAttribute(attrString, CFRangeMake(0, 1), str, number);
+ [number release];
+ [number retain];
+ CFRelease(attrString);
+}
+
+//===----------------------------------------------------------------------===//
+// Test of handling CGGradientXXX functions.
+//===----------------------------------------------------------------------===//
+
+void rdar_7184450(CGContextRef myContext, CGFloat x, CGPoint myStartPoint,
+ CGPoint myEndPoint) {
+ size_t num_locations = 6;
+ CGFloat locations[6] = { 0.0, 0.265, 0.28, 0.31, 0.36, 1.0 };
+ CGFloat components[28] = { 239.0/256.0, 167.0/256.0, 170.0/256.0,
+ x, // Start color
+ 207.0/255.0, 39.0/255.0, 39.0/255.0, x,
+ 147.0/255.0, 21.0/255.0, 22.0/255.0, x,
+ 175.0/255.0, 175.0/255.0, 175.0/255.0, x,
+ 255.0/255.0,255.0/255.0, 255.0/255.0, x,
+ 255.0/255.0,255.0/255.0, 255.0/255.0, x
+ }; // End color
+
+ CGGradientRef myGradient =
+ CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), // expected-warning{{leak}}
+ components, locations, num_locations);
+
+ CGContextDrawLinearGradient(myContext, myGradient, myStartPoint, myEndPoint,
+ 0);
+ CGGradientRelease(myGradient);
+}
+
+void rdar_7184450_pos(CGContextRef myContext, CGFloat x, CGPoint myStartPoint,
+ CGPoint myEndPoint) {
+ size_t num_locations = 6;
+ CGFloat locations[6] = { 0.0, 0.265, 0.28, 0.31, 0.36, 1.0 };
+ CGFloat components[28] = { 239.0/256.0, 167.0/256.0, 170.0/256.0,
+ x, // Start color
+ 207.0/255.0, 39.0/255.0, 39.0/255.0, x,
+ 147.0/255.0, 21.0/255.0, 22.0/255.0, x,
+ 175.0/255.0, 175.0/255.0, 175.0/255.0, x,
+ 255.0/255.0,255.0/255.0, 255.0/255.0, x,
+ 255.0/255.0,255.0/255.0, 255.0/255.0, x
+ }; // End color
+
+ CGGradientRef myGradient =
+ CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), components, locations, num_locations); // expected-warning 2 {{leak}}
+
+ CGContextDrawLinearGradient(myContext, myGradient, myStartPoint, myEndPoint,
+ 0);
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7299394> clang false positive: retained instance passed to
+// thread in pthread_create marked as leak
+//
+// Until we have full IPA, the analyzer should stop tracking the reference
+// count of objects passed to pthread_create.
+//
+//===----------------------------------------------------------------------===//
+
+struct _opaque_pthread_t {};
+struct _opaque_pthread_attr_t {};
+typedef struct _opaque_pthread_t *__darwin_pthread_t;
+typedef struct _opaque_pthread_attr_t __darwin_pthread_attr_t;
+typedef __darwin_pthread_t pthread_t;
+typedef __darwin_pthread_attr_t pthread_attr_t;
+typedef unsigned long __darwin_pthread_key_t;
+typedef __darwin_pthread_key_t pthread_key_t;
+
+int pthread_create(pthread_t *, const pthread_attr_t *,
+ void *(*)(void *), void *);
+
+int pthread_setspecific(pthread_key_t key, const void *value);
+
+void *rdar_7299394_start_routine(void *p) {
+ [((id) p) release];
+ return 0;
+}
+void rdar_7299394(pthread_attr_t *attr, pthread_t *thread, void *args) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+ pthread_create(thread, attr, rdar_7299394_start_routine, number);
+}
+void rdar_7299394_positive(pthread_attr_t *attr, pthread_t *thread) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // expected-warning{{leak}}
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/11282706> false positive with not understanding thread
+// local storage
+//===----------------------------------------------------------------------===//
+
+void rdar11282706(pthread_key_t key) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+ pthread_setspecific(key, (void*) number);
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7283567> False leak associated with call to
+// CVPixelBufferCreateWithBytes ()
+//
+// According to the Core Video Reference (ADC), CVPixelBufferCreateWithBytes and
+// CVPixelBufferCreateWithPlanarBytes can release (via a callback) the
+// pixel buffer object. These test cases show how the analyzer stops tracking
+// the reference count for the objects passed for this argument. This
+// could be made smarter.
+//===----------------------------------------------------------------------===//
+
+typedef int int32_t;
+typedef UInt32 FourCharCode;
+typedef FourCharCode OSType;
+typedef uint64_t CVOptionFlags;
+typedef int32_t CVReturn;
+typedef struct __CVBuffer *CVBufferRef;
+typedef CVBufferRef CVImageBufferRef;
+typedef CVImageBufferRef CVPixelBufferRef;
+typedef void (*CVPixelBufferReleaseBytesCallback)( void *releaseRefCon, const void *baseAddress );
+
+extern CVReturn CVPixelBufferCreateWithBytes(CFAllocatorRef allocator,
+ size_t width,
+ size_t height,
+ OSType pixelFormatType,
+ void *baseAddress,
+ size_t bytesPerRow,
+ CVPixelBufferReleaseBytesCallback releaseCallback,
+ void *releaseRefCon,
+ CFDictionaryRef pixelBufferAttributes,
+ CVPixelBufferRef *pixelBufferOut) ;
+
+typedef void (*CVPixelBufferReleasePlanarBytesCallback)( void *releaseRefCon, const void *dataPtr, size_t dataSize, size_t numberOfPlanes, const void *planeAddresses[] );
+
+extern CVReturn CVPixelBufferCreateWithPlanarBytes(CFAllocatorRef allocator,
+ size_t width,
+ size_t height,
+ OSType pixelFormatType,
+ void *dataPtr,
+ size_t dataSize,
+ size_t numberOfPlanes,
+ void *planeBaseAddress[],
+ size_t planeWidth[],
+ size_t planeHeight[],
+ size_t planeBytesPerRow[],
+ CVPixelBufferReleasePlanarBytesCallback releaseCallback,
+ void *releaseRefCon,
+ CFDictionaryRef pixelBufferAttributes,
+ CVPixelBufferRef *pixelBufferOut) ;
+
+extern CVReturn CVPixelBufferCreateWithBytes(CFAllocatorRef allocator,
+ size_t width,
+ size_t height,
+ OSType pixelFormatType,
+ void *baseAddress,
+ size_t bytesPerRow,
+ CVPixelBufferReleaseBytesCallback releaseCallback,
+ void *releaseRefCon,
+ CFDictionaryRef pixelBufferAttributes,
+ CVPixelBufferRef *pixelBufferOut) ;
+
+CVReturn rdar_7283567(CFAllocatorRef allocator, size_t width, size_t height,
+ OSType pixelFormatType, void *baseAddress,
+ size_t bytesPerRow,
+ CVPixelBufferReleaseBytesCallback releaseCallback,
+ CFDictionaryRef pixelBufferAttributes,
+ CVPixelBufferRef *pixelBufferOut) {
+
+ // For the allocated object, it doesn't really matter what type it is
+ // for the purpose of this test. All we want to show is that
+ // this is freed later by the callback.
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+
+ return CVPixelBufferCreateWithBytes(allocator, width, height, pixelFormatType,
+ baseAddress, bytesPerRow, releaseCallback,
+ number, // potentially released by callback
+ pixelBufferAttributes, pixelBufferOut) ;
+}
+
+CVReturn rdar_7283567_2(CFAllocatorRef allocator, size_t width, size_t height,
+ OSType pixelFormatType, void *dataPtr, size_t dataSize,
+ size_t numberOfPlanes, void *planeBaseAddress[],
+ size_t planeWidth[], size_t planeHeight[], size_t planeBytesPerRow[],
+ CVPixelBufferReleasePlanarBytesCallback releaseCallback,
+ CFDictionaryRef pixelBufferAttributes,
+ CVPixelBufferRef *pixelBufferOut) {
+
+ // For the allocated object, it doesn't really matter what type it is
+ // for the purpose of this test. All we want to show is that
+ // this is freed later by the callback.
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+
+ return CVPixelBufferCreateWithPlanarBytes(allocator,
+ width, height, pixelFormatType, dataPtr, dataSize,
+ numberOfPlanes, planeBaseAddress, planeWidth,
+ planeHeight, planeBytesPerRow, releaseCallback,
+ number, // potentially released by callback
+ pixelBufferAttributes, pixelBufferOut) ;
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7358899> False leak associated with
+// CGBitmapContextCreateWithData
+//===----------------------------------------------------------------------===//
+typedef uint32_t CGBitmapInfo;
+typedef void (*CGBitmapContextReleaseDataCallback)(void *releaseInfo, void *data);
+
+CGContextRef CGBitmapContextCreateWithData(void *data,
+ size_t width, size_t height, size_t bitsPerComponent,
+ size_t bytesPerRow, CGColorSpaceRef space, CGBitmapInfo bitmapInfo,
+ CGBitmapContextReleaseDataCallback releaseCallback, void *releaseInfo) CF_RETURNS_RETAINED;
+
+void rdar_7358899(void *data,
+ size_t width, size_t height, size_t bitsPerComponent,
+ size_t bytesPerRow, CGColorSpaceRef space, CGBitmapInfo bitmapInfo,
+ CGBitmapContextReleaseDataCallback releaseCallback) {
+
+ // For the allocated object, it doesn't really matter what type it is
+ // for the purpose of this test. All we want to show is that
+ // this is freed later by the callback.
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+
+ CGBitmapContextCreateWithData(data, width, height, bitsPerComponent, // expected-warning{{leak}}
+ bytesPerRow, space, bitmapInfo, releaseCallback, number);
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7265711> allow 'new', 'copy', 'alloc', 'init' prefix to
+// start before '_' when determining Cocoa fundamental rule
+//
+// Previously the retain/release checker just skipped prefixes before the
+// first '_' entirely. Now the checker honors the prefix if it results in a
+// recognizable naming convention (e.g., 'new', 'init').
+//===----------------------------------------------------------------------===//
+
+@interface RDar7265711 {}
+- (id) new_stuff;
+@end
+
+void rdar7265711_a(RDar7265711 *x) {
+ id y = [x new_stuff]; // expected-warning{{leak}}
+}
+
+void rdar7265711_b(RDar7265711 *x) {
+ id y = [x new_stuff]; // no-warning
+ [y release];
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7306898> clang thinks [NSCursor dragCopyCursor] returns a
+// retained reference
+//===----------------------------------------------------------------------===//
+
+@interface NSCursor : NSObject
++ (NSCursor *)dragCopyCursor;
+@end
+
+void rdar7306898(void) {
+ // 'dragCopyCursor' does not follow Cocoa's fundamental rule. It is a noun, not an sentence
+ // implying a 'copy' of something.
+ NSCursor *c = [NSCursor dragCopyCursor]; // no-warning
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // expected-warning{{leak}}
+}
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/7252064> sending 'release', 'retain', etc. to a Class
+// directly is not likely what the user intended
+//===----------------------------------------------------------------------===//
+
+@interface RDar7252064 : NSObject @end
+void rdar7252064(void) {
+ [RDar7252064 release]; // expected-warning{{The 'release' message should be sent to instances of class 'RDar7252064' and not the class directly}}
+ [RDar7252064 retain]; // expected-warning{{The 'retain' message should be sent to instances of class 'RDar7252064' and not the class directly}}
+ [RDar7252064 autorelease]; // expected-warning{{The 'autorelease' message should be sent to instances of class 'RDar7252064' and not the class directly}}
+ [NSAutoreleasePool drain]; // expected-warning{{method '+drain' not found}} expected-warning{{The 'drain' message should be sent to instances of class 'NSAutoreleasePool' and not the class directly}}
+}
+
+//===----------------------------------------------------------------------===//
+// Tests of ownership attributes.
+//===----------------------------------------------------------------------===//
+
+typedef NSString* MyStringTy;
+
+@protocol FooP;
+
+@interface TestOwnershipAttr : NSObject
+- (NSString*) returnsAnOwnedString NS_RETURNS_RETAINED; // no-warning
+- (NSString*) returnsAnOwnedCFString CF_RETURNS_RETAINED; // no-warning
+- (MyStringTy) returnsAnOwnedTypedString NS_RETURNS_RETAINED; // no-warning
+- (NSString*) newString NS_RETURNS_NOT_RETAINED; // no-warning
+- (NSString*) newString_auto NS_RETURNS_AUTORELEASED; // no-warning
+- (NSString*) newStringNoAttr;
+- (int) returnsAnOwnedInt NS_RETURNS_RETAINED; // expected-warning{{'ns_returns_retained' attribute only applies to methods that return an Objective-C object}}
+- (id) pseudoInit NS_CONSUMES_SELF NS_RETURNS_RETAINED;
++ (void) consume:(id) NS_CONSUMED x;
++ (void) consume2:(id) CF_CONSUMED x;
+@end
+
+static int ownership_attribute_doesnt_go_here NS_RETURNS_RETAINED; // expected-warning{{'ns_returns_retained' attribute only applies to functions and methods}}
+
+void test_attr_1(TestOwnershipAttr *X) {
+ NSString *str = [X returnsAnOwnedString]; // expected-warning{{leak}}
+}
+
+void test_attr_1b(TestOwnershipAttr *X) {
+ NSString *str = [X returnsAnOwnedCFString]; // expected-warning{{leak}}
+}
+
+void test_attr1c(TestOwnershipAttr *X) {
+ NSString *str = [X newString]; // no-warning
+ NSString *str2 = [X newStringNoAttr]; // expected-warning{{leak}}
+ NSString *str3 = [X newString_auto]; // no-warning
+ NSString *str4 = [[X newString_auto] retain]; // expected-warning {{leak}}
+}
+
+void testattr2_a() {
+ TestOwnershipAttr *x = [TestOwnershipAttr alloc]; // expected-warning{{leak}}
+}
+
+void testattr2_b() {
+ TestOwnershipAttr *x = [[TestOwnershipAttr alloc] pseudoInit]; // expected-warning{{leak}}
+}
+
+void testattr2_b_11358224_self_assign_looses_the_leak() {
+ TestOwnershipAttr *x = [[TestOwnershipAttr alloc] pseudoInit];// expected-warning{{leak}}
+ x = x;
+}
+
+void testattr2_c() {
+ TestOwnershipAttr *x = [[TestOwnershipAttr alloc] pseudoInit]; // no-warning
+ [x release];
+}
+
+void testattr3() {
+ TestOwnershipAttr *x = [TestOwnershipAttr alloc]; // no-warning
+ [TestOwnershipAttr consume:x];
+ TestOwnershipAttr *y = [TestOwnershipAttr alloc]; // no-warning
+ [TestOwnershipAttr consume2:y];
+}
+
+void consume_ns(id NS_CONSUMED x);
+void consume_cf(id CF_CONSUMED x);
+
+void testattr4() {
+ TestOwnershipAttr *x = [TestOwnershipAttr alloc]; // no-warning
+ consume_ns(x);
+ TestOwnershipAttr *y = [TestOwnershipAttr alloc]; // no-warning
+ consume_cf(y);
+}
+
+@interface TestOwnershipAttr2 : NSObject
+- (NSString*) newString NS_RETURNS_NOT_RETAINED; // no-warning
+@end
+
+@implementation TestOwnershipAttr2
+- (NSString*) newString {
+ return [NSString alloc]; // expected-warning {{Potential leak of an object}}
+}
+@end
+
+@interface MyClassTestCFAttr : NSObject {}
+- (NSDate*) returnsCFRetained CF_RETURNS_RETAINED;
+- (CFDateRef) returnsCFRetainedAsCF CF_RETURNS_RETAINED;
+- (CFDateRef) newCFRetainedAsCF CF_RETURNS_NOT_RETAINED;
+- (CFDateRef) newCFRetainedAsCFNoAttr CF_RETURNS_RETAINED;
+- (NSDate*) alsoReturnsRetained;
+- (CFDateRef) alsoReturnsRetainedAsCF CF_RETURNS_NOT_RETAINED;
+- (NSDate*) returnsNSRetained NS_RETURNS_RETAINED;
+@end
+
+CF_RETURNS_RETAINED
+CFDateRef returnsRetainedCFDate() {
+ return CFDateCreate(0, CFAbsoluteTimeGetCurrent());
+}
+
+@implementation MyClassTestCFAttr
+- (NSDate*) returnsCFRetained {
+ return (NSDate*) returnsRetainedCFDate(); // No leak.
+}
+
+- (CFDateRef) returnsCFRetainedAsCF {
+ return returnsRetainedCFDate(); // No leak.
+}
+
+- (CFDateRef) newCFRetainedAsCF {
+ return (CFDateRef)[(id)[self returnsCFRetainedAsCF] autorelease];
+}
+
+- (CFDateRef) newCFRetainedAsCFNoAttr {
+ return (CFDateRef)[(id)[self returnsCFRetainedAsCF] autorelease]; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
+}
+
+- (NSDate*) alsoReturnsRetained {
+ return (NSDate*) returnsRetainedCFDate(); // expected-warning{{leak}}
+}
+
+- (CFDateRef) alsoReturnsRetainedAsCF {
+ return returnsRetainedCFDate(); // expected-warning{{leak}}
+}
+
+
+- (NSDate*) returnsNSRetained {
+ return (NSDate*) returnsRetainedCFDate(); // no-warning
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// Test that leaks post-dominated by "panic" functions are not reported.
+//
+// <rdar://problem/5905851> do not report a leak when post-dominated by a call
+// to a noreturn or panic function
+//===----------------------------------------------------------------------===//
+
+void panic() __attribute__((noreturn));
+void panic_not_in_hardcoded_list() __attribute__((noreturn));
+
+void test_panic_negative() {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // expected-warning{{leak}}
+}
+
+void test_panic_positive() {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // no-warning
+ panic();
+}
+
+void test_panic_neg_2(int x) {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // expected-warning{{leak}}
+ if (x)
+ panic();
+}
+
+void test_panic_pos_2(int x) {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // no-warning
+ if (x)
+ panic();
+ if (!x) {
+ // This showed up in <rdar://problem/7796563>, where we silently missed checking
+ // the function type for noreturn. "panic()" is a hard-coded known panic function
+ // that isn't always noreturn.
+ panic_not_in_hardcoded_list();
+ }
+}
+
+//===----------------------------------------------------------------------===//
+// Test uses of blocks (closures)
+//===----------------------------------------------------------------------===//
+
+void test_blocks_1_pos(void) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // expected-warning{{leak}}
+ ^{}();
+}
+
+void test_blocks_1_indirect_release(void) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+ ^{ [number release]; }();
+}
+
+void test_blocks_1_indirect_retain(void) {
+ // Eventually this should be reported as a leak.
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+ ^{ [number retain]; }();
+}
+
+void test_blocks_1_indirect_release_via_call(void) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning
+ ^(NSObject *o){ [o release]; }(number);
+}
+
+void test_blocks_1_indirect_retain_via_call(void) {
+ NSNumber *number = [[NSNumber alloc] initWithInt:5]; // expected-warning {{leak}}
+ ^(NSObject *o){ [o retain]; }(number);
+}
+
+//===--------------------------------------------------------------------===//
+// Test sending message to super that returns an object alias. Previously
+// this caused a crash in the analyzer.
+//===--------------------------------------------------------------------===//
+
+@interface Rdar8015556 : NSObject {} @end
+@implementation Rdar8015556
+- (id)retain {
+ return [super retain];
+}
+@end
+
+// <rdar://problem/8272168> - Correcly handle Class<...> in Cocoa Conventions
+// detector.
+
+@protocol Prot_R8272168 @end
+Class <Prot_R8272168> GetAClassThatImplementsProt_R8272168();
+void r8272168() {
+ GetAClassThatImplementsProt_R8272168();
+}
+
+// Test case for <rdar://problem/8356342>, which in the past triggered
+// a false positive.
+@interface RDar8356342
+- (NSDate*) rdar8356342:(NSDate *)inValue;
+@end
+
+@implementation RDar8356342
+- (NSDate*) rdar8356342:(NSDate*)inValue {
+ NSDate *outValue = inValue;
+ if (outValue == 0)
+ outValue = [[NSDate alloc] init]; // no-warning
+
+ if (outValue != inValue)
+ [outValue autorelease];
+
+ return outValue;
+}
+@end
+
+// <rdar://problem/8724287> - This test case previously crashed because
+// of a bug in BugReporter.
+extern const void *CFDictionaryGetValue(CFDictionaryRef theDict, const void *key) CF_RETURNS_NOT_RETAINED;
+typedef struct __CFError * CFErrorRef;
+extern const CFStringRef kCFErrorUnderlyingErrorKey;
+extern CFDictionaryRef CFErrorCopyUserInfo(CFErrorRef err) CF_RETURNS_RETAINED;
+static void rdar_8724287(CFErrorRef error)
+{
+ CFErrorRef error_to_dump;
+
+ error_to_dump = error;
+ while (error_to_dump != ((void*)0)) {
+ CFDictionaryRef info;
+
+ info = CFErrorCopyUserInfo(error_to_dump); // expected-warning{{Potential leak of an object}}
+
+ if (info != ((void*)0)) {
+ }
+
+ error_to_dump = (CFErrorRef) CFDictionaryGetValue(info, kCFErrorUnderlyingErrorKey);
+ }
+}
+
+// <rdar://problem/9234108> - Make sure the model applies cf_consumed
+// correctly in argument positions besides the first.
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+extern void *CFStringCreate(void);
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+extern void rdar_9234108_helper(void *key, void * CF_CONSUMED value);
+void rdar_9234108() {
+ rdar_9234108_helper(0, CFStringCreate());
+}
+
+// <rdar://problem/9726279> - Make sure that objc_method_family works
+// to override naming conventions.
+struct TwoDoubles {
+ double one;
+ double two;
+};
+typedef struct TwoDoubles TwoDoubles;
+
+@interface NSValue (Mine)
+- (id)_prefix_initWithTwoDoubles:(TwoDoubles)twoDoubles __attribute__((objc_method_family(init)));
+@end
+
+@implementation NSValue (Mine)
+- (id)_prefix_initWithTwoDoubles:(TwoDoubles)twoDoubles
+{
+ return [self init];
+}
+@end
+
+void rdar9726279() {
+ TwoDoubles twoDoubles = { 0.0, 0.0 };
+ NSValue *value = [[NSValue alloc] _prefix_initWithTwoDoubles:twoDoubles];
+ [value release];
+}
+
+// <rdar://problem/9732321>
+// Test camelcase support for CF conventions. While Core Foundation APIs
+// don't use camel casing, other code is allowed to use it.
+CFArrayRef camelcase_create_1() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef camelcase_createno() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning {{leak}}
+}
+
+CFArrayRef camelcase_copy() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef camelcase_copying() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning {{leak}}
+}
+
+CFArrayRef copyCamelCase() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef __copyCamelCase() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef __createCamelCase() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef camel_create() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+
+CFArrayRef camel_creat() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning {{leak}}
+}
+
+CFArrayRef camel_copy() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef camel_copyMachine() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // no-warning
+}
+
+CFArrayRef camel_copymachine() {
+ return CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning {{leak}}
+}
+
+// rdar://problem/8024350
+@protocol F18P
+- (id) clone;
+@end
+@interface F18 : NSObject<F18P> @end
+@interface F18(Cat)
+- (id) clone NS_RETURNS_RETAINED;
+@end
+
+@implementation F18
+- (id) clone {
+ return [F18 alloc];
+}
+@end
+
+// Radar 6582778.
+void rdar6582778(void) {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ CFTypeRef vals[] = { CFDateCreate(0, t) }; // expected-warning {{leak}}
+}
+
+CFTypeRef global;
+
+void rdar6582778_2(void) {
+ CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+ global = CFDateCreate(0, t); // no-warning
+}
+
+// <rdar://problem/10232019> - Test that objects passed to containers
+// are marked "escaped".
+
+void rdar10232019() {
+ NSMutableArray *array = [NSMutableArray array];
+
+ NSString *string = [[NSString alloc] initWithUTF8String:"foo"];
+ [array addObject:string];
+ [string release];
+
+ NSString *otherString = [string stringByAppendingString:@"bar"]; // no-warning
+ NSLog(@"%@", otherString);
+}
+
+void rdar10232019_positive() {
+ NSMutableArray *array = [NSMutableArray array];
+
+ NSString *string = [[NSString alloc] initWithUTF8String:"foo"];
+ [string release];
+
+ NSString *otherString = [string stringByAppendingString:@"bar"]; // expected-warning {{Reference-counted object is used after it is release}}
+ NSLog(@"%@", otherString);
+}
+
+// RetainCountChecker support for XPC.
+// <rdar://problem/9658496>
+typedef void * xpc_object_t;
+xpc_object_t _CFXPCCreateXPCObjectFromCFObject(CFTypeRef cf);
+void xpc_release(xpc_object_t object);
+
+void rdar9658496() {
+ CFStringRef cf;
+ xpc_object_t xpc;
+ cf = CFStringCreateWithCString( ((CFAllocatorRef)0), "test", kCFStringEncodingUTF8 ); // no-warning
+ xpc = _CFXPCCreateXPCObjectFromCFObject( cf );
+ CFRelease(cf);
+ xpc_release(xpc);
+}
+
+// Support annotations with method families.
+@interface RDar10824732 : NSObject
+- (instancetype)initWithObj:(id CF_CONSUMED)obj;
+@end
+
+@implementation RDar10824732
+- (instancetype)initWithObj:(id)obj {
+ [obj release];
+ return [super init];
+}
+@end
+
+void rdar_10824732() {
+ @autoreleasepool {
+ NSString *obj = @"test";
+ RDar10824732 *foo = [[RDar10824732 alloc] initWithObj:obj]; // no-warning
+ [foo release];
+ }
+}
+
+// Stop tracking objects passed to functions, which take callbacks as parameters.
+// radar://10973977
+typedef int (*CloseCallback) (void *);
+void ReaderForIO(CloseCallback ioclose, void *ioctx);
+int IOClose(void *context);
+
+@protocol SInS <NSObject>
+@end
+
+@interface radar10973977 : NSObject
+- (id<SInS>)inputS;
+- (void)reader;
+@end
+
+@implementation radar10973977
+- (void)reader
+{
+ id<SInS> inputS = [[self inputS] retain];
+ ReaderForIO(IOClose, inputS);
+}
+- (id<SInS>)inputS
+{
+ return 0;
+}
+@end
+
+// Object escapes through a selector callback: radar://11398514
+extern id NSApp;
+@interface MySheetController
+- (id<SInS>)inputS;
+- (void)showDoSomethingSheetAction:(id)action;
+- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;
+@end
+
+@implementation MySheetController
+- (id<SInS>)inputS {
+ return 0;
+}
+- (void)showDoSomethingSheetAction:(id)action {
+ id<SInS> inputS = [[self inputS] retain];
+ [NSApp beginSheet:0
+ modalForWindow:0
+ modalDelegate:0
+ didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
+ contextInfo:(void *)inputS]; // no - warning
+}
+- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
+
+ id contextObject = (id)contextInfo;
+ [contextObject release];
+}
+
+- (id)copyAutoreleaseRadar13081402 {
+ id x = [[[NSString alloc] initWithUTF8String:"foo"] autorelease];
+ [x retain];
+ return x; // no warning
+}
+
+@end
+//===----------------------------------------------------------------------===//
+// Test returning allocated memory in a struct.
+//
+// We currently don't have a general way to track pointers that "escape".
+// Here we test that RetainCountChecker doesn't get excited about returning
+// allocated CF objects in struct fields.
+//===----------------------------------------------------------------------===//
+void *malloc(size_t);
+struct rdar11104566 { CFStringRef myStr; };
+struct rdar11104566 test_rdar11104566() {
+ CFStringRef cf = CFStringCreateWithCString( ((CFAllocatorRef)0), "test", kCFStringEncodingUTF8 ); // no-warning
+ struct rdar11104566 V;
+ V.myStr = cf;
+ return V; // no-warning
+}
+
+struct rdar11104566 *test_2_rdar11104566() {
+ CFStringRef cf = CFStringCreateWithCString( ((CFAllocatorRef)0), "test", kCFStringEncodingUTF8 ); // no-warning
+ struct rdar11104566 *V = (struct rdar11104566 *) malloc(sizeof(*V));
+ V->myStr = cf;
+ return V; // no-warning
+}
+
+//===----------------------------------------------------------------------===//
+// ObjC literals support.
+//===----------------------------------------------------------------------===//
+
+void test_objc_arrays() {
+ { // CASE ONE -- OBJECT IN ARRAY CREATED DIRECTLY
+ NSObject *o = [[NSObject alloc] init];
+ NSArray *a = [[NSArray alloc] initWithObjects:o, (void*)0]; // expected-warning {{leak}}
+ [o release];
+ [a description];
+ [o description];
+ }
+
+ { // CASE TWO -- OBJECT IN ARRAY CREATED BY DUPING AUTORELEASED ARRAY
+ NSObject *o = [[NSObject alloc] init];
+ NSArray *a1 = [NSArray arrayWithObjects:o, (void*)0];
+ NSArray *a2 = [[NSArray alloc] initWithArray:a1]; // expected-warning {{leak}}
+ [o release];
+ [a2 description];
+ [o description];
+ }
+
+ { // CASE THREE -- OBJECT IN RETAINED @[]
+ NSObject *o = [[NSObject alloc] init];
+ NSArray *a3 = [@[o] retain]; // expected-warning {{leak}}
+ [o release];
+ [a3 description];
+ [o description];
+ }
+
+ { // CASE FOUR -- OBJECT IN ARRAY CREATED BY DUPING @[]
+ NSObject *o = [[NSObject alloc] init];
+ NSArray *a = [[NSArray alloc] initWithArray:@[o]]; // expected-warning {{leak}}
+ [o release];
+
+ [a description];
+ [o description];
+ }
+
+ { // CASE FIVE -- OBJECT IN RETAINED @{}
+ NSValue *o = [[NSValue alloc] init];
+ NSDictionary *a = [@{o : o} retain]; // expected-warning {{leak}}
+ [o release];
+
+ [a description];
+ [o description];
+ }
+}
+
+void test_objc_integer_literals() {
+ id value = [@1 retain]; // expected-warning {{leak}}
+ [value description];
+}
+
+void test_objc_boxed_expressions(int x, const char *y) {
+ id value = [@(x) retain]; // expected-warning {{leak}}
+ [value description];
+
+ value = [@(y) retain]; // expected-warning {{leak}}
+ [value description];
+}
+
+// Test NSLog doesn't escape tracked objects.
+void rdar11400885(int y)
+{
+ @autoreleasepool {
+ NSString *printString;
+ if(y > 2)
+ printString = [[NSString alloc] init];
+ else
+ printString = [[NSString alloc] init];
+ NSLog(@"Once %@", printString);
+ [printString release];
+ NSLog(@"Again: %@", printString); // expected-warning {{Reference-counted object is used after it is released}}
+ }
+}
+
+id makeCollectableNonLeak() {
+ extern CFTypeRef CFCreateSomething();
+
+ CFTypeRef object = CFCreateSomething(); // +1
+ CFRetain(object); // +2
+ id objCObject = NSMakeCollectable(object); // +2
+ [objCObject release]; // +1
+ return [objCObject autorelease]; // +0
+}
+
+
+void consumeAndStopTracking(id NS_CONSUMED obj, void (^callback)(void));
+void CFConsumeAndStopTracking(CFTypeRef CF_CONSUMED obj, void (^callback)(void));
+
+void testConsumeAndStopTracking() {
+ id retained = [@[] retain]; // +1
+ consumeAndStopTracking(retained, ^{}); // no-warning
+
+ id doubleRetained = [[@[] retain] retain]; // +2
+ consumeAndStopTracking(doubleRetained, ^{
+ [doubleRetained release];
+ }); // no-warning
+
+ id unretained = @[]; // +0
+ consumeAndStopTracking(unretained, ^{}); // expected-warning {{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
+
+void testCFConsumeAndStopTracking() {
+ id retained = [@[] retain]; // +1
+ CFConsumeAndStopTracking((CFTypeRef)retained, ^{}); // no-warning
+
+ id doubleRetained = [[@[] retain] retain]; // +2
+ CFConsumeAndStopTracking((CFTypeRef)doubleRetained, ^{
+ [doubleRetained release];
+ }); // no-warning
+
+ id unretained = @[]; // +0
+ CFConsumeAndStopTracking((CFTypeRef)unretained, ^{}); // expected-warning {{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
+//===----------------------------------------------------------------------===//
+// Test 'pragma clang arc_cf_code_audited' support.
+//===----------------------------------------------------------------------===//
+
+typedef void *MyCFType;
+#pragma clang arc_cf_code_audited begin
+MyCFType CreateMyCFType();
+#pragma clang arc_cf_code_audited end
+
+void test_custom_cf() {
+ MyCFType x = CreateMyCFType(); // expected-warning {{leak of an object stored into 'x'}}
+}
+
+//===----------------------------------------------------------------------===//
+// Test calling CFPlugInInstanceCreate, which appears in CF but doesn't
+// return a CF object.
+//===----------------------------------------------------------------------===//
+
+void test_CFPlugInInstanceCreate(CFUUIDRef factoryUUID, CFUUIDRef typeUUID) {
+ CFPlugInInstanceCreate(kCFAllocatorDefault, factoryUUID, typeUUID); // no-warning
+}
+
+//===----------------------------------------------------------------------===//
+// PR14927: -drain only has retain-count semantics on NSAutoreleasePool.
+//===----------------------------------------------------------------------===//
+
+@interface PR14927 : NSObject
+- (void)drain;
+@end
+
+void test_drain() {
+ PR14927 *obj = [[PR14927 alloc] init];
+ [obj drain];
+ [obj release]; // no-warning
+}
+
+//===----------------------------------------------------------------------===//
+// Allow cf_returns_retained and cf_returns_not_retained to mark a return
+// value as tracked, even if the object isn't a known CF type.
+//===----------------------------------------------------------------------===//
+
+MyCFType getCustom() __attribute__((cf_returns_not_retained));
+MyCFType makeCustom() __attribute__((cf_returns_retained));
+
+void testCustomReturnsRetained() {
+ MyCFType obj = makeCustom(); // expected-warning {{leak of an object stored into 'obj'}}
+}
+
+void testCustomReturnsNotRetained() {
+ CFRelease(getCustom()); // expected-warning {{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
+
+//===----------------------------------------------------------------------===//
+// Don't print variables which are out of the current scope.
+//===----------------------------------------------------------------------===//
+@interface MyObj12706177 : NSObject
+-(instancetype)initX;
++(void)test12706177;
+@end
+static int Cond;
+@implementation MyObj12706177
+-(instancetype)initX {
+ if (Cond)
+ return 0;
+ self = [super init];
+ return self;
+}
++(void)test12706177 {
+ id x = [[MyObj12706177 alloc] initX]; //expected-warning {{Potential leak of an object}}
+ [x release];
+}
+@end
+
+//===----------------------------------------------------------------------===//
+// <rdar://problem/13783514> xpc_connection_set_finalizer_f
+//===----------------------------------------------------------------------===//
+
+typedef xpc_object_t xpc_connection_t;
+typedef void (*xpc_finalizer_t)(void *value);
+void xpc_connection_set_context(xpc_connection_t connection, void *ctx);
+void xpc_connection_set_finalizer_f(xpc_connection_t connection,
+ xpc_finalizer_t finalizer);
+void releaseAfterXPC(void *context) {
+ [(NSArray *)context release];
+}
+
+void rdar13783514(xpc_connection_t connection) {
+ xpc_connection_set_context(connection, [[NSMutableArray alloc] init]);
+ xpc_connection_set_finalizer_f(connection, releaseAfterXPC);
+} // no-warning
+
+CFAttributedStringRef CFAttributedCreate(void *CFObj CF_CONSUMED) CF_RETURNS_RETAINED;
+
+@interface Action
+@property (nonatomic) SEL action;
+@property (nonatomic, assign) id target;
+@end
diff --git a/test/ARCMT/objcmt-atomic-property.m b/test/ARCMT/objcmt-atomic-property.m
new file mode 100644
index 000000000000..78ab3ec71596
--- /dev/null
+++ b/test/ARCMT/objcmt-atomic-property.m
@@ -0,0 +1,229 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fblocks -objcmt-migrate-readwrite-property -objcmt-migrate-readonly-property -objcmt-atomic-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+#define WEBKIT_OBJC_METHOD_ANNOTATION(ANNOTATION) ANNOTATION
+#define WEAK_IMPORT_ATTRIBUTE __attribute__((objc_arc_weak_reference_unavailable))
+#define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER
+#define DEPRECATED __attribute__((deprecated))
+
+typedef char BOOL;
+@class NSString;
+@protocol NSCopying @end
+
+@interface NSObject <NSCopying>
+@end
+
+@interface NSDictionary : NSObject
+@end
+
+@interface I : NSObject {
+ int ivarVal;
+}
+- (void) setWeakProp : (NSString *__weak)Val;
+- (NSString *__weak) WeakProp;
+
+- (NSString *) StrongProp;
+- (void) setStrongProp : (NSString *)Val;
+
+- (NSString *) UnavailProp __attribute__((unavailable));
+- (void) setUnavailProp : (NSString *)Val;
+
+- (NSString *) UnavailProp1 __attribute__((unavailable));
+- (void) setUnavailProp1 : (NSString *)Val __attribute__((unavailable));
+
+- (NSString *) UnavailProp2;
+- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
+
+- (NSDictionary*) undoAction;
+- (void) setUndoAction: (NSDictionary*)Arg;
+@end
+
+@implementation I
+@end
+
+@class NSArray;
+
+@interface MyClass2 {
+@private
+ NSArray *_names1;
+ NSArray *_names2;
+ NSArray *_names3;
+ NSArray *_names4;
+}
+- (void)setNames1:(NSArray *)names;
+- (void)setNames4:(__strong NSArray *)names;
+- (void)setNames3:(__strong NSArray *)names;
+- (void)setNames2:(NSArray *)names;
+- (NSArray *) names2;
+- (NSArray *)names3;
+- (__strong NSArray *)names4;
+- (NSArray *) names1;
+@end
+
+// Properties that contain the name "delegate" or "dataSource",
+// or have exact name "target" have unsafe_unretained attribute.
+@interface NSInvocation
+- (id)target;
+- (void)setTarget:(id)target;
+
+- (id) dataSource;
+
+- (id)xxxdelegateYYY;
+- (void)setXxxdelegateYYY:(id)delegate;
+
+- (void)setDataSource:(id)source;
+
+- (id)MYtarget;
+- (void)setMYtarget: (id)target;
+
+- (id)targetX;
+- (void)setTargetX: (id)t;
+
+- (int)value;
+- (void)setValue: (int)val;
+
+-(BOOL) isContinuous;
+-(void) setContinuous:(BOOL)value;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+- (int) Length;
+- (id) object;
++ (double) D;
+- (void *)JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
+- (BOOL)isIgnoringInteractionEvents;
+
+- (NSString *)getStringValue;
+- (BOOL)getCounterValue;
+- (void)setStringValue:(NSString *)stringValue AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (NSDictionary *)getns_dixtionary;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+- (BOOL) getM;
+- (BOOL) getMA;
+- (BOOL) getALL;
+- (BOOL) getMANY;
+- (BOOL) getSome;
+@end
+
+
+@interface NSInvocation(CAT)
+- (id)target;
+- (void)setTarget:(id)target;
+
+- (id) dataSource;
+
+- (id)xxxdelegateYYY;
+- (void)setXxxdelegateYYY:(id)delegate;
+
+- (void)setDataSource:(id)source;
+
+- (id)MYtarget;
+- (void)setMYtarget: (id)target;
+
+- (id)targetX;
+- (void)setTargetX: (id)t;
+
+- (int)value;
+- (void)setValue: (int)val;
+
+-(BOOL) isContinuous;
+-(void) setContinuous:(BOOL)value;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+- (int) Length;
+- (id) object;
++ (double) D;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+- (BOOL) getM;
+- (BOOL) getMA;
+- (BOOL) getALL;
+- (BOOL) getMANY;
+- (BOOL) getSome;
+@end
+
+DEPRECATED
+@interface I_DEP
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+@end
+
+@interface AnotherOne
+- (BOOL) isinValid DEPRECATED;
+- (void) setInValid : (BOOL) arg;
+- (id)MYtarget;
+- (void)setMYtarget: (id)target DEPRECATED;
+- (BOOL) getM DEPRECATED;
+
+- (id)xxxdelegateYYY DEPRECATED;
+- (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
+@end
+
+// rdar://14987909
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+#define NORETURN __attribute__((noreturn))
+#define ALIGNED __attribute__((aligned(16)))
+
+@interface NSURL
+// Do not infer a property.
+- (NSURL *)appStoreReceiptURL NS_AVAILABLE;
+- (void) setAppStoreReceiptURL : (NSURL *)object;
+
+- (NSURL *)appStoreReceiptURLX NS_AVAILABLE;
+- (void) setAppStoreReceiptURLX : (NSURL *)object NS_AVAILABLE;
+
+// Do not infer a property.
+- (NSURL *)appStoreReceiptURLY ;
+- (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
+
+- (id)OkToInfer NS_AVAILABLE;
+
+// Do not infer a property.
+- (NSURL *)appStoreReceiptURLZ ;
+- (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
+
+// Do not infer a property.
+- (id) t1 NORETURN NS_AVAILABLE;
+- (void) setT1 : (id) arg NS_AVAILABLE;
+
+- (id)method1 ALIGNED NS_AVAILABLE;
+- (void) setMethod1 : (id) object NS_AVAILABLE ALIGNED;
+
+- (NSURL *)init; // No Change
++ (id)alloc; // No Change
+
+- (BOOL)is1stClass; // Not a valid property
+- (BOOL)isClass; // This is a valid property 'class' is not a keyword in ObjC
+- (BOOL)isDouble; // Not a valid property
+
+@end
+
+// rdar://15082818
+@class NSMutableDictionary;
+
+@interface NSArray
+- (id (^)(id, NSArray *, NSMutableDictionary *)) expressionBlock;
+- (id (^)(id, NSArray *, NSMutableDictionary *)) MyBlock;
+- (void) setMyBlock : (id (^)(id, NSArray *, NSMutableDictionary *)) bl;
+- (id (*)(id, NSArray *, NSMutableDictionary *)) expressionFuncptr;
+- (id (*)(id, NSArray *, NSMutableDictionary *)) MyFuncptr;
+- (void) setMyFuncptr : (id (*)(id, NSArray *, NSMutableDictionary *)) bl;
+@end
diff --git a/test/ARCMT/objcmt-atomic-property.m.result b/test/ARCMT/objcmt-atomic-property.m.result
new file mode 100644
index 000000000000..1650cd23e3bd
--- /dev/null
+++ b/test/ARCMT/objcmt-atomic-property.m.result
@@ -0,0 +1,202 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fblocks -objcmt-migrate-readwrite-property -objcmt-migrate-readonly-property -objcmt-atomic-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+#define WEBKIT_OBJC_METHOD_ANNOTATION(ANNOTATION) ANNOTATION
+#define WEAK_IMPORT_ATTRIBUTE __attribute__((objc_arc_weak_reference_unavailable))
+#define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER
+#define DEPRECATED __attribute__((deprecated))
+
+typedef char BOOL;
+@class NSString;
+@protocol NSCopying @end
+
+@interface NSObject <NSCopying>
+@end
+
+@interface NSDictionary : NSObject
+@end
+
+@interface I : NSObject {
+ int ivarVal;
+}
+@property (weak) NSString *WeakProp;
+
+@property (retain) NSString *StrongProp;
+
+@property (retain) NSString *UnavailProp __attribute__((unavailable));
+- (void) setUnavailProp : (NSString *)Val;
+
+@property (retain) NSString *UnavailProp1 __attribute__((unavailable));
+
+@property (retain) NSString *UnavailProp2;
+- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
+
+@property (copy) NSDictionary *undoAction;
+@end
+
+@implementation I
+@end
+
+@class NSArray;
+
+@interface MyClass2 {
+@private
+ NSArray *_names1;
+ NSArray *_names2;
+ NSArray *_names3;
+ NSArray *_names4;
+}
+@property (retain) NSArray *names2;
+@property (retain) NSArray *names3;
+@property (retain) NSArray *names4;
+@property (retain) NSArray *names1;
+@end
+
+// Properties that contain the name "delegate" or "dataSource",
+// or have exact name "target" have unsafe_unretained attribute.
+@interface NSInvocation
+@property (assign) id target;
+
+@property (assign) id dataSource;
+
+@property (assign) id xxxdelegateYYY;
+
+
+@property (retain) id MYtarget;
+
+@property (retain) id targetX;
+
+@property int value;
+
+@property (getter=isContinuous) BOOL continuous;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+@property (getter=isinValid, readonly) BOOL inValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+@property (readonly) int Length;
+@property (readonly, retain) id object;
++ (double) D;
+@property (readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
+@property (getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents;
+
+@property (getter=getStringValue, retain) NSString *stringValue;
+@property (getter=getCounterValue, readonly) BOOL counterValue;
+@property (getter=getns_dixtionary, readonly, retain) NSDictionary *ns_dixtionary;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+@property (getter=getM, readonly) BOOL m;
+@property (getter=getMA, readonly) BOOL MA;
+@property (getter=getALL, readonly) BOOL ALL;
+@property (getter=getMANY, readonly) BOOL MANY;
+@property (getter=getSome, readonly) BOOL some;
+@end
+
+
+@interface NSInvocation(CAT)
+@property (assign) id target;
+
+@property (assign) id dataSource;
+
+@property (assign) id xxxdelegateYYY;
+
+
+@property (retain) id MYtarget;
+
+@property (retain) id targetX;
+
+@property int value;
+
+@property (getter=isContinuous) BOOL continuous;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+@property (getter=isinValid, readonly) BOOL inValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+@property (readonly) int Length;
+@property (readonly, retain) id object;
++ (double) D;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+@property (getter=getM, readonly) BOOL m;
+@property (getter=getMA, readonly) BOOL MA;
+@property (getter=getALL, readonly) BOOL ALL;
+@property (getter=getMANY, readonly) BOOL MANY;
+@property (getter=getSome, readonly) BOOL some;
+@end
+
+DEPRECATED
+@interface I_DEP
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+@end
+
+@interface AnotherOne
+- (BOOL) isinValid DEPRECATED;
+- (void) setInValid : (BOOL) arg;
+- (id)MYtarget;
+- (void)setMYtarget: (id)target DEPRECATED;
+- (BOOL) getM DEPRECATED;
+
+- (id)xxxdelegateYYY DEPRECATED;
+- (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
+@end
+
+// rdar://14987909
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+#define NORETURN __attribute__((noreturn))
+#define ALIGNED __attribute__((aligned(16)))
+
+@interface NSURL
+// Do not infer a property.
+@property (retain) NSURL *appStoreReceiptURL NS_AVAILABLE;
+- (void) setAppStoreReceiptURL : (NSURL *)object;
+
+@property (retain) NSURL *appStoreReceiptURLX NS_AVAILABLE;
+
+// Do not infer a property.
+@property (retain) NSURL *appStoreReceiptURLY ;
+- (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
+
+@property (readonly, retain) id OkToInfer NS_AVAILABLE;
+
+// Do not infer a property.
+@property (retain) NSURL *appStoreReceiptURLZ ;
+- (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
+
+// Do not infer a property.
+- (id) t1 NORETURN NS_AVAILABLE;
+- (void) setT1 : (id) arg NS_AVAILABLE;
+
+@property (retain) id method1 ALIGNED NS_AVAILABLE;
+
+- (NSURL *)init; // No Change
++ (id)alloc; // No Change
+
+- (BOOL)is1stClass; // Not a valid property
+@property (getter=isClass, readonly) BOOL class; // This is a valid property 'class' is not a keyword in ObjC
+- (BOOL)isDouble; // Not a valid property
+
+@end
+
+// rdar://15082818
+@class NSMutableDictionary;
+
+@interface NSArray
+@property (readonly, copy) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *);
+@property (copy) id (^MyBlock)(id, NSArray *, NSMutableDictionary *);
+@property (readonly) id (*expressionFuncptr)(id, NSArray *, NSMutableDictionary *);
+@property id (*MyFuncptr)(id, NSArray *, NSMutableDictionary *);
+@end
diff --git a/test/ARCMT/objcmt-deprecated-category.m b/test/ARCMT/objcmt-deprecated-category.m
new file mode 100644
index 000000000000..5939e5a50ada
--- /dev/null
+++ b/test/ARCMT/objcmt-deprecated-category.m
@@ -0,0 +1,48 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-annotation -mt-migrate-directory %t %s -x objective-c -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s.result
+// rdar://15337661
+
+#define DEPRECATED __attribute__((deprecated))
+
+@interface NSArray
+- (int)one;
+@end
+
+@interface NSArray (NSDraggingSourceDeprecated)
+
+/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead.
+*/
+- (void)getObjects:(id __unsafe_unretained [])objects;
+- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
+
+@end
+
+@interface NSArray (NSDeprecated)
+
+/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead.
+*/
+- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
+- (void)getObjects:(id __unsafe_unretained [])objects;
+@property int P1;
+@property int P2 DEPRECATED;
+@end
+
+@interface NSArray (DraggingSourceDeprecated)
+
+/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead.
+*/
+- (void)getObjects:(id __unsafe_unretained [])objects;
+- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
+@property int P1;
+@property int P2 DEPRECATED;
+
+@end
+
+@interface NSArray (Deprecated)
+- (void)getObjects:(id __unsafe_unretained [])objects;
+- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
+@property int P1;
+@property int P2 DEPRECATED;
+@end
diff --git a/test/ARCMT/objcmt-deprecated-category.m.result b/test/ARCMT/objcmt-deprecated-category.m.result
new file mode 100644
index 000000000000..3cb100044e46
--- /dev/null
+++ b/test/ARCMT/objcmt-deprecated-category.m.result
@@ -0,0 +1,48 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-annotation -mt-migrate-directory %t %s -x objective-c -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s.result
+// rdar://15337661
+
+#define DEPRECATED __attribute__((deprecated))
+
+@interface NSArray
+- (int)one;
+@end
+
+@interface NSArray (NSDraggingSourceDeprecated)
+
+/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead.
+*/
+- (void)getObjects:(id __unsafe_unretained [])objects DEPRECATED;
+- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
+
+@end
+
+@interface NSArray (NSDeprecated)
+
+/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead.
+*/
+- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
+- (void)getObjects:(id __unsafe_unretained [])objects DEPRECATED;
+@property int P1 DEPRECATED;
+@property int P2 DEPRECATED;
+@end
+
+@interface NSArray (DraggingSourceDeprecated)
+
+/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead.
+*/
+- (void)getObjects:(id __unsafe_unretained [])objects DEPRECATED;
+- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
+@property int P1 DEPRECATED;
+@property int P2 DEPRECATED;
+
+@end
+
+@interface NSArray (Deprecated)
+- (void)getObjects:(id __unsafe_unretained [])objects DEPRECATED;
+- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
+@property int P1 DEPRECATED;
+@property int P2 DEPRECATED;
+@end
diff --git a/test/ARCMT/objcmt-instancetype-2.m b/test/ARCMT/objcmt-instancetype-2.m
new file mode 100644
index 000000000000..fb59265c4be3
--- /dev/null
+++ b/test/ARCMT/objcmt-instancetype-2.m
@@ -0,0 +1,103 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-instancetype -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+typedef unsigned int NSUInteger;
+typedef int NSInteger;
+typedef char BOOL;
+@class NSData, NSError, NSProtocolChecker, NSObject;
+@class NSPortNameServer, NSTimeZone;
+
+@interface NSMutableString
+@end
+
+@interface NSString @end
+
+@class NSString, NSURL;
+@interface NSString (NSStringDeprecated)
++ (id)stringWithContentsOfFile:(NSString *)path __attribute__((availability(macosx,introduced=10.0 ,message="" )));
++ (id)stringWithContentsOfURL:(NSURL *)url __attribute__((availability(macosx,introduced=10.0 ,message="" )));
++ (id)stringWithCString:(const char *)bytes length:(NSUInteger)length __attribute__((availability(macosx,introduced=10.0 ,message="" )));
++ (id)stringWithCString:(const char *)bytes __attribute__((availability(macosx,introduced=10.0 ,message="" )));
+@end
+
+
+typedef enum NSURLBookmarkResolutionOptions {
+ Bookmark
+} NSURLBookmarkResolutionOptions;
+
+@interface NSURL
++ (id)URLWithString:(NSString *)URLString;
++ (id)URLWithString:(NSString *)URLString relativeToURL:(NSURL *)baseURL;
++ (id)URLByResolvingBookmarkData:(NSData *)bookmarkData options:(NSURLBookmarkResolutionOptions)options relativeToURL:(NSURL *)relativeURL bookmarkDataIsStale:(BOOL *)isStale error:(NSError **)error __attribute__((availability(macosx,introduced=10.6)));
+@end
+
+@class NSDictionary;
+@interface NSError
++ (id)errorWithDomain:(NSString *)domain code:(NSInteger)code userInfo:(NSDictionary *)dict;
+@end
+
+
+@interface NSMutableString (NSMutableStringExtensionMethods)
++ (id)stringWithCapacity:(NSUInteger)capacity;
+@end
+
+@interface NSMutableData
++ (id)dataWithCapacity:(NSUInteger)aNumItems;
++ (id)dataWithLength:(NSUInteger)length;
+@end
+
+@interface NSMutableDictionary @end
+
+@interface NSMutableDictionary (NSSharedKeySetDictionary)
++ (id )dictionaryWithSharedKeySet:(id)keyset __attribute__((availability(macosx,introduced=10.8)));
+@end
+
+@interface NSProtocolChecker
++ (id)protocolCheckerWithTarget:(NSObject *)anObject protocol:(Protocol *)aProtocol;
+@end
+
+@interface NSConnection
++ (id)connectionWithRegisteredName:(NSString *)name host:(NSString *)hostName;
++ (id)connectionWithRegisteredName:(NSString *)name host:(NSString *)hostName usingNameServer:(NSPortNameServer *)server;
+@end
+
+@interface NSDate
++ (id)dateWithString:(NSString *)aString __attribute__((availability(macosx,introduced=10.4)));
+@end
+
+@interface NSCalendarDate : NSDate
++ (id)calendarDate __attribute__((availability(macosx,introduced=10.4)));
++ (id)dateWithString:(NSString *)description calendarFormat:(NSString *)format locale:(id)locale __attribute__((availability(macosx,introduced=10.4)));
++ (id)dateWithString:(NSString *)description calendarFormat:(NSString *)format __attribute__((availability(macosx,introduced=10.4)));
++ (id)dateWithYear:(NSInteger)year month:(NSUInteger)month day:(NSUInteger)day hour:(NSUInteger)hour minute:(NSUInteger)minute second:(NSUInteger)second timeZone:(NSTimeZone *)aTimeZone __attribute__((availability(macosx,introduced=10.4)));
+@end
+
+@interface NSUserDefaults
++ (id) standardUserDefaults;
+@end
+
+@interface NSNotificationCenter
++ (id) defaultCenter;
++ sharedCenter;
+@end
+
+@interface UIApplication
++ (id)sharedApplication;
++ defaultApplication;
+@end
+
+//===----------------------------------------------------------------------===//
+// Method name that has a null IdentifierInfo* for its first selector slot.
+// This test just makes sure that we handle it.
+//===----------------------------------------------------------------------===//
+@interface TestNullIdentifier
+@end
+
+@implementation TestNullIdentifier
++ (id):(int)x, ... {
+ return 0;
+}
+@end
+
diff --git a/test/ARCMT/objcmt-instancetype-2.m.result b/test/ARCMT/objcmt-instancetype-2.m.result
new file mode 100644
index 000000000000..8837e971ad27
--- /dev/null
+++ b/test/ARCMT/objcmt-instancetype-2.m.result
@@ -0,0 +1,103 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-instancetype -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+typedef unsigned int NSUInteger;
+typedef int NSInteger;
+typedef char BOOL;
+@class NSData, NSError, NSProtocolChecker, NSObject;
+@class NSPortNameServer, NSTimeZone;
+
+@interface NSMutableString
+@end
+
+@interface NSString @end
+
+@class NSString, NSURL;
+@interface NSString (NSStringDeprecated)
++ (instancetype)stringWithContentsOfFile:(NSString *)path __attribute__((availability(macosx,introduced=10.0 ,message="" )));
++ (instancetype)stringWithContentsOfURL:(NSURL *)url __attribute__((availability(macosx,introduced=10.0 ,message="" )));
++ (instancetype)stringWithCString:(const char *)bytes length:(NSUInteger)length __attribute__((availability(macosx,introduced=10.0 ,message="" )));
++ (instancetype)stringWithCString:(const char *)bytes __attribute__((availability(macosx,introduced=10.0 ,message="" )));
+@end
+
+
+typedef enum NSURLBookmarkResolutionOptions {
+ Bookmark
+} NSURLBookmarkResolutionOptions;
+
+@interface NSURL
++ (instancetype)URLWithString:(NSString *)URLString;
++ (instancetype)URLWithString:(NSString *)URLString relativeToURL:(NSURL *)baseURL;
++ (instancetype)URLByResolvingBookmarkData:(NSData *)bookmarkData options:(NSURLBookmarkResolutionOptions)options relativeToURL:(NSURL *)relativeURL bookmarkDataIsStale:(BOOL *)isStale error:(NSError **)error __attribute__((availability(macosx,introduced=10.6)));
+@end
+
+@class NSDictionary;
+@interface NSError
++ (instancetype)errorWithDomain:(NSString *)domain code:(NSInteger)code userInfo:(NSDictionary *)dict;
+@end
+
+
+@interface NSMutableString (NSMutableStringExtensionMethods)
++ (instancetype)stringWithCapacity:(NSUInteger)capacity;
+@end
+
+@interface NSMutableData
++ (instancetype)dataWithCapacity:(NSUInteger)aNumItems;
++ (instancetype)dataWithLength:(NSUInteger)length;
+@end
+
+@interface NSMutableDictionary @end
+
+@interface NSMutableDictionary (NSSharedKeySetDictionary)
++ (instancetype )dictionaryWithSharedKeySet:(id)keyset __attribute__((availability(macosx,introduced=10.8)));
+@end
+
+@interface NSProtocolChecker
++ (instancetype)protocolCheckerWithTarget:(NSObject *)anObject protocol:(Protocol *)aProtocol;
+@end
+
+@interface NSConnection
++ (instancetype)connectionWithRegisteredName:(NSString *)name host:(NSString *)hostName;
++ (instancetype)connectionWithRegisteredName:(NSString *)name host:(NSString *)hostName usingNameServer:(NSPortNameServer *)server;
+@end
+
+@interface NSDate
++ (instancetype)dateWithString:(NSString *)aString __attribute__((availability(macosx,introduced=10.4)));
+@end
+
+@interface NSCalendarDate : NSDate
++ (instancetype)calendarDate __attribute__((availability(macosx,introduced=10.4)));
++ (instancetype)dateWithString:(NSString *)description calendarFormat:(NSString *)format locale:(id)locale __attribute__((availability(macosx,introduced=10.4)));
++ (instancetype)dateWithString:(NSString *)description calendarFormat:(NSString *)format __attribute__((availability(macosx,introduced=10.4)));
++ (instancetype)dateWithYear:(NSInteger)year month:(NSUInteger)month day:(NSUInteger)day hour:(NSUInteger)hour minute:(NSUInteger)minute second:(NSUInteger)second timeZone:(NSTimeZone *)aTimeZone __attribute__((availability(macosx,introduced=10.4)));
+@end
+
+@interface NSUserDefaults
++ (instancetype) standardUserDefaults;
+@end
+
+@interface NSNotificationCenter
++ (NSNotificationCenter*) defaultCenter;
++ (NSNotificationCenter*) sharedCenter;
+@end
+
+@interface UIApplication
++ (UIApplication*)sharedApplication;
++ (UIApplication*) defaultApplication;
+@end
+
+//===----------------------------------------------------------------------===//
+// Method name that has a null IdentifierInfo* for its first selector slot.
+// This test just makes sure that we handle it.
+//===----------------------------------------------------------------------===//
+@interface TestNullIdentifier
+@end
+
+@implementation TestNullIdentifier
++ (id):(int)x, ... {
+ return 0;
+}
+@end
+
diff --git a/test/ARCMT/objcmt-instancetype.m b/test/ARCMT/objcmt-instancetype.m
new file mode 100644
index 000000000000..47dbd7aeed5a
--- /dev/null
+++ b/test/ARCMT/objcmt-instancetype.m
@@ -0,0 +1,111 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-instancetype -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+typedef signed char BOOL;
+#define nil ((void*) 0)
+
+@interface NSObject
++ (id)alloc;
+@end
+
+@interface NSString : NSObject
++ (id)stringWithString:(NSString *)string;
+- (id)initWithString:(NSString *)aString;
+@end
+
+@implementation NSString : NSObject
++ (id)stringWithString:(NSString *)string { return 0; };
+- (instancetype)initWithString:(NSString *)aString { return 0; };
+@end
+
+@interface NSArray : NSObject
+- (id)objectAtIndex:(unsigned long)index;
+- (id)objectAtIndexedSubscript:(int)index;
+@end
+
+@interface NSArray (NSArrayCreation)
++ (id)array;
++ (id)arrayWithObject:(id)anObject;
++ (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt;
++ (id)arrayWithObjects:(id)firstObj, ...;
++ arrayWithArray:(NSArray *)array;
+
+- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;
+- (id)initWithObjects:(id)firstObj, ...;
+- (id)initWithArray:(NSArray *)array;
+
+- (id)objectAtIndex:(unsigned long)index;
+@end
+
+@implementation NSArray (NSArrayCreation)
++ (id)array { return 0; }
++ (id)arrayWithObject:(id)anObject {
+ return anObject;
+}
++ (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt { return 0; }
++ (id)arrayWithObjects:(id)firstObj, ... {
+ return 0; }
++ arrayWithArray:(NSArray *)array {
+ return 0;
+}
+
+- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt { return 0; }
+- (id)initWithObjects:(id)firstObj, ... { return 0; }
+- (id)initWithArray:(NSArray *)array { return 0; }
+
+- (id)objectAtIndex:(unsigned long)index { return 0; }
+@end
+
+@interface NSMutableArray : NSArray
+- (void)replaceObjectAtIndex:(unsigned long)index withObject:(id)anObject;
+- (void)setObject:(id)object atIndexedSubscript:(int)index;
+@end
+
+@interface NSDictionary : NSObject
+- (id)objectForKeyedSubscript:(id)key;
+@end
+
+@interface NSDictionary (NSDictionaryCreation)
++ (id)dictionary;
++ (id)dictionaryWithObject:(id)object forKey:(id)key;
++ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;
++ dictionaryWithObjectsAndKeys:(id)firstObject, ...;
++ (id)dictionaryWithDictionary:(NSDictionary *)dict;
++ (id)dictionaryWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
+
+- (id)initWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;
+- (id)initWithObjectsAndKeys:(id)firstObject, ...;
+- (id)initWithDictionary:(NSDictionary *)otherDictionary;
+- (id)initWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
+
+- (id)objectForKey:(id)aKey;
+@end
+
+@interface NSMutableDictionary : NSDictionary
+- (void)setObject:(id)anObject forKey:(id)aKey;
+- (void)setObject:(id)object forKeyedSubscript:(id)key;
+@end
+
+@interface NSNumber : NSObject
+@end
+
+@interface NSNumber (NSNumberCreation)
++ (NSNumber *)numberWithInt:(int)value;
+@end
+
+@implementation NSNumber (NSNumberCreation)
++ (NSNumber *)numberWithInt:(int)value { return 0; }
+@end
+
+#define M(x) (x)
+#define PAIR(x) @#x, [NSNumber numberWithInt:(x)]
+#define TWO(x) ((x), (x))
+
+void foo() {
+ NSString *str = M([NSString stringWithString:@"foo"]); // expected-warning {{redundant}}
+ str = [[NSString alloc] initWithString:@"foo"]; // expected-warning {{redundant}}
+ NSArray *arr = [NSArray arrayWithArray:@[str]]; // expected-warning {{redundant}}
+ NSDictionary *dict = [NSDictionary dictionaryWithDictionary:@{str: arr}]; // expected-warning {{redundant}}
+}
diff --git a/test/ARCMT/objcmt-instancetype.m.result b/test/ARCMT/objcmt-instancetype.m.result
new file mode 100644
index 000000000000..ce51678708dd
--- /dev/null
+++ b/test/ARCMT/objcmt-instancetype.m.result
@@ -0,0 +1,111 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-instancetype -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+typedef signed char BOOL;
+#define nil ((void*) 0)
+
+@interface NSObject
++ (id)alloc;
+@end
+
+@interface NSString : NSObject
++ (instancetype)stringWithString:(NSString *)string;
+- (instancetype)initWithString:(NSString *)aString;
+@end
+
+@implementation NSString : NSObject
++ (instancetype)stringWithString:(NSString *)string { return 0; };
+- (instancetype)initWithString:(NSString *)aString { return 0; };
+@end
+
+@interface NSArray : NSObject
+- (id)objectAtIndex:(unsigned long)index;
+- (id)objectAtIndexedSubscript:(int)index;
+@end
+
+@interface NSArray (NSArrayCreation)
++ (instancetype)array;
++ (instancetype)arrayWithObject:(id)anObject;
++ (instancetype)arrayWithObjects:(const id [])objects count:(unsigned long)cnt;
++ (instancetype)arrayWithObjects:(id)firstObj, ...;
++ (instancetype) arrayWithArray:(NSArray *)array;
+
+- (instancetype)initWithObjects:(const id [])objects count:(unsigned long)cnt;
+- (instancetype)initWithObjects:(id)firstObj, ...;
+- (instancetype)initWithArray:(NSArray *)array;
+
+- (id)objectAtIndex:(unsigned long)index;
+@end
+
+@implementation NSArray (NSArrayCreation)
++ (instancetype)array { return 0; }
++ (instancetype)arrayWithObject:(id)anObject {
+ return anObject;
+}
++ (instancetype)arrayWithObjects:(const id [])objects count:(unsigned long)cnt { return 0; }
++ (instancetype)arrayWithObjects:(id)firstObj, ... {
+ return 0; }
++ (instancetype) arrayWithArray:(NSArray *)array {
+ return 0;
+}
+
+- (instancetype)initWithObjects:(const id [])objects count:(unsigned long)cnt { return 0; }
+- (instancetype)initWithObjects:(id)firstObj, ... { return 0; }
+- (instancetype)initWithArray:(NSArray *)array { return 0; }
+
+- (id)objectAtIndex:(unsigned long)index { return 0; }
+@end
+
+@interface NSMutableArray : NSArray
+- (void)replaceObjectAtIndex:(unsigned long)index withObject:(id)anObject;
+- (void)setObject:(id)object atIndexedSubscript:(int)index;
+@end
+
+@interface NSDictionary : NSObject
+- (id)objectForKeyedSubscript:(id)key;
+@end
+
+@interface NSDictionary (NSDictionaryCreation)
++ (instancetype)dictionary;
++ (instancetype)dictionaryWithObject:(id)object forKey:(id)key;
++ (instancetype)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;
++ (instancetype) dictionaryWithObjectsAndKeys:(id)firstObject, ...;
++ (instancetype)dictionaryWithDictionary:(NSDictionary *)dict;
++ (instancetype)dictionaryWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
+
+- (instancetype)initWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;
+- (instancetype)initWithObjectsAndKeys:(id)firstObject, ...;
+- (instancetype)initWithDictionary:(NSDictionary *)otherDictionary;
+- (instancetype)initWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
+
+- (id)objectForKey:(id)aKey;
+@end
+
+@interface NSMutableDictionary : NSDictionary
+- (void)setObject:(id)anObject forKey:(id)aKey;
+- (void)setObject:(id)object forKeyedSubscript:(id)key;
+@end
+
+@interface NSNumber : NSObject
+@end
+
+@interface NSNumber (NSNumberCreation)
++ (NSNumber *)numberWithInt:(int)value;
+@end
+
+@implementation NSNumber (NSNumberCreation)
++ (NSNumber *)numberWithInt:(int)value { return 0; }
+@end
+
+#define M(x) (x)
+#define PAIR(x) @#x, [NSNumber numberWithInt:(x)]
+#define TWO(x) ((x), (x))
+
+void foo() {
+ NSString *str = M([NSString stringWithString:@"foo"]); // expected-warning {{redundant}}
+ str = [[NSString alloc] initWithString:@"foo"]; // expected-warning {{redundant}}
+ NSArray *arr = [NSArray arrayWithArray:@[str]]; // expected-warning {{redundant}}
+ NSDictionary *dict = [NSDictionary dictionaryWithDictionary:@{str: arr}]; // expected-warning {{redundant}}
+}
diff --git a/test/ARCMT/objcmt-migrate-all.m b/test/ARCMT/objcmt-migrate-all.m
new file mode 100644
index 000000000000..7ae898cf9cba
--- /dev/null
+++ b/test/ARCMT/objcmt-migrate-all.m
@@ -0,0 +1,135 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-all -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+// rdar://15396636
+
+#ifndef NS_RETURNS_INNER_POINTER // defined in iOS 6 for sure
+#define NS_RETURNS_INNER_POINTER __attribute__((objc_returns_inner_pointer))
+#endif
+
+#define CF_IMPLICIT_BRIDGING_ENABLED _Pragma("clang arc_cf_code_audited begin")
+
+#define CF_IMPLICIT_BRIDGING_DISABLED _Pragma("clang arc_cf_code_audited end")
+
+#if __has_feature(attribute_ns_returns_retained)
+#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
+#endif
+#if __has_feature(attribute_cf_returns_retained)
+#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
+#endif
+#if __has_feature(attribute_ns_returns_not_retained)
+#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
+#endif
+#if __has_feature(attribute_cf_returns_not_retained)
+#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
+#endif
+#if __has_feature(attribute_ns_consumes_self)
+#define NS_CONSUMES_SELF __attribute__((ns_consumes_self))
+#endif
+#if __has_feature(attribute_ns_consumed)
+#define NS_CONSUMED __attribute__((ns_consumed))
+#endif
+#if __has_feature(attribute_cf_consumed)
+#define CF_CONSUMED __attribute__((cf_consumed))
+#endif
+#if __has_attribute(ns_returns_autoreleased)
+#define NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
+#endif
+
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+typedef unsigned long CFTypeID;
+typedef unsigned long CFOptionFlags;
+typedef unsigned long CFHashCode;
+
+typedef signed long CFIndex; /*AnyObj*/
+typedef const struct __CFArray * CFArrayRef;
+typedef struct {
+ CFIndex location;
+ CFIndex length;
+} CFRange;
+
+typedef void (*CFArrayApplierFunction)(const void *value, void *context);
+
+typedef enum CFComparisonResult : CFIndex CFComparisonResult; enum CFComparisonResult : CFIndex {
+ kCFCompareLessThan = -1L,
+ kCFCompareEqualTo = 0,
+ kCFCompareGreaterThan = 1
+};
+
+
+typedef CFComparisonResult (*CFComparatorFunction)(const void *val1, const void *val2, void *context);
+
+typedef struct __CFArray * CFMutableArrayRef;
+
+typedef const struct __CFAttributedString *CFAttributedStringRef;
+typedef struct __CFAttributedString *CFMutableAttributedStringRef;
+
+typedef const struct __CFAllocator * CFAllocatorRef;
+
+typedef const struct __CFString * CFStringRef;
+typedef struct __CFString * CFMutableStringRef;
+
+typedef const struct __CFDictionary * CFDictionaryRef;
+typedef struct __CFDictionary * CFMutableDictionaryRef;
+
+typedef struct CGImage *CGImageRef;
+
+typedef struct OpaqueJSValue* JSObjectRef;
+
+typedef JSObjectRef TTJSObjectRef;
+typedef unsigned int NSUInteger;
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+@interface I
+- (void*) ReturnsInnerPointer;
+- (int*) AlreadyReturnsInnerPointer NS_RETURNS_INNER_POINTER;
+@end
+
+@interface UIImage
+- (CGImageRef)CGImage;
+@end
+
+@interface NSData
+- (void *)bytes;
+- (void **) ptr_bytes __attribute__((availability(macosx,unavailable)));
+@end
+
+@interface NSMutableData
+- (void *)mutableBytes __attribute__((deprecated)) __attribute__((unavailable));
+@end
+
+@interface JS
+- (JSObjectRef)JSObject;
+- (TTJSObjectRef)JSObject1;
+- (JSObjectRef*)JSObject2;
+@end
+
+// rdar://15044991
+typedef void *SecTrustRef;
+
+@interface NSURLProtectionSpace
+@property (readonly) SecTrustRef serverTrust NS_AVAILABLE;
+- (void *) FOO NS_AVAILABLE;
+@property (readonly) void * mitTrust NS_AVAILABLE;
+
+@property (readonly) void * mittiTrust;
+
+@property (readonly) SecTrustRef XserverTrust;
+
+- (SecTrustRef) FOO1 NS_AVAILABLE;
+
++ (const NSURLProtectionSpace *)ProtectionSpace;
+
+// pointer personality functions
+@property NSUInteger (*hashFunction)(const void *item, NSUInteger (*size)(const void *item));
+@end
+
+@interface MustNotMigrateToInnerPointer
+- (void*) nono;
+- (void) setNono : (void*) val;
+@end
diff --git a/test/ARCMT/objcmt-migrate-all.m.result b/test/ARCMT/objcmt-migrate-all.m.result
new file mode 100644
index 000000000000..d2ee4090b28c
--- /dev/null
+++ b/test/ARCMT/objcmt-migrate-all.m.result
@@ -0,0 +1,134 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-all -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+// rdar://15396636
+
+#ifndef NS_RETURNS_INNER_POINTER // defined in iOS 6 for sure
+#define NS_RETURNS_INNER_POINTER __attribute__((objc_returns_inner_pointer))
+#endif
+
+#define CF_IMPLICIT_BRIDGING_ENABLED _Pragma("clang arc_cf_code_audited begin")
+
+#define CF_IMPLICIT_BRIDGING_DISABLED _Pragma("clang arc_cf_code_audited end")
+
+#if __has_feature(attribute_ns_returns_retained)
+#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
+#endif
+#if __has_feature(attribute_cf_returns_retained)
+#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
+#endif
+#if __has_feature(attribute_ns_returns_not_retained)
+#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
+#endif
+#if __has_feature(attribute_cf_returns_not_retained)
+#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
+#endif
+#if __has_feature(attribute_ns_consumes_self)
+#define NS_CONSUMES_SELF __attribute__((ns_consumes_self))
+#endif
+#if __has_feature(attribute_ns_consumed)
+#define NS_CONSUMED __attribute__((ns_consumed))
+#endif
+#if __has_feature(attribute_cf_consumed)
+#define CF_CONSUMED __attribute__((cf_consumed))
+#endif
+#if __has_attribute(ns_returns_autoreleased)
+#define NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
+#endif
+
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+typedef unsigned long CFTypeID;
+typedef unsigned long CFOptionFlags;
+typedef unsigned long CFHashCode;
+
+typedef signed long CFIndex; /*AnyObj*/
+typedef const struct __CFArray * CFArrayRef;
+typedef struct {
+ CFIndex location;
+ CFIndex length;
+} CFRange;
+
+typedef void (*CFArrayApplierFunction)(const void *value, void *context);
+
+typedef enum CFComparisonResult : CFIndex CFComparisonResult; enum CFComparisonResult : CFIndex {
+ kCFCompareLessThan = -1L,
+ kCFCompareEqualTo = 0,
+ kCFCompareGreaterThan = 1
+};
+
+
+typedef CFComparisonResult (*CFComparatorFunction)(const void *val1, const void *val2, void *context);
+
+typedef struct __CFArray * CFMutableArrayRef;
+
+typedef const struct __CFAttributedString *CFAttributedStringRef;
+typedef struct __CFAttributedString *CFMutableAttributedStringRef;
+
+typedef const struct __CFAllocator * CFAllocatorRef;
+
+typedef const struct __CFString * CFStringRef;
+typedef struct __CFString * CFMutableStringRef;
+
+typedef const struct __CFDictionary * CFDictionaryRef;
+typedef struct __CFDictionary * CFMutableDictionaryRef;
+
+typedef struct CGImage *CGImageRef;
+
+typedef struct OpaqueJSValue* JSObjectRef;
+
+typedef JSObjectRef TTJSObjectRef;
+typedef unsigned int NSUInteger;
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+@interface I
+@property (nonatomic, readonly) void *ReturnsInnerPointer;
+@property (nonatomic, readonly) int *AlreadyReturnsInnerPointer NS_RETURNS_INNER_POINTER;
+@end
+
+@interface UIImage
+@property (nonatomic, readonly) CGImageRef CGImage CF_RETURNS_NOT_RETAINED;
+@end
+
+@interface NSData
+@property (nonatomic, readonly) void *bytes;
+@property (nonatomic, readonly) void **ptr_bytes __attribute__((availability(macosx,unavailable)));
+@end
+
+@interface NSMutableData
+@property (nonatomic, readonly) void *mutableBytes __attribute__((deprecated)) __attribute__((unavailable));
+@end
+
+@interface JS
+@property (nonatomic, readonly) JSObjectRef JSObject;
+@property (nonatomic, readonly) TTJSObjectRef JSObject1;
+@property (nonatomic, readonly) JSObjectRef *JSObject2;
+@end
+
+// rdar://15044991
+typedef void *SecTrustRef;
+
+@interface NSURLProtectionSpace
+@property (readonly) SecTrustRef serverTrust NS_AVAILABLE;
+@property (nonatomic, readonly) void *FOO NS_AVAILABLE;
+@property (readonly) void * mitTrust NS_AVAILABLE;
+
+@property (readonly) void * mittiTrust;
+
+@property (readonly) SecTrustRef XserverTrust;
+
+@property (nonatomic, readonly) SecTrustRef FOO1 NS_AVAILABLE;
+
++ (const NSURLProtectionSpace *)ProtectionSpace;
+
+// pointer personality functions
+@property NSUInteger (*hashFunction)(const void *item, NSUInteger (*size)(const void *item));
+@end
+
+@interface MustNotMigrateToInnerPointer
+@property (nonatomic) void *nono;
+@end
diff --git a/test/ARCMT/objcmt-ns-macros.m b/test/ARCMT/objcmt-ns-macros.m
new file mode 100644
index 000000000000..1bf55d8ed46b
--- /dev/null
+++ b/test/ARCMT/objcmt-ns-macros.m
@@ -0,0 +1,296 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-ns-macros -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+typedef long NSInteger;
+typedef unsigned long NSUInteger;
+
+#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
+#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
+#define DEPRECATED __attribute__((deprecated))
+
+enum {
+ blah,
+ blarg
+};
+typedef NSInteger wibble;
+
+enum {
+ UIViewAutoresizingNone = 0,
+ UIViewAutoresizingFlexibleLeftMargin,
+ UIViewAutoresizingFlexibleWidth,
+ UIViewAutoresizingFlexibleRightMargin,
+ UIViewAutoresizingFlexibleTopMargin,
+ UIViewAutoresizingFlexibleHeight,
+ UIViewAutoresizingFlexibleBottomMargin
+};
+typedef NSUInteger UITableViewCellStyle;
+
+typedef enum {
+ UIViewAnimationTransitionNone,
+ UIViewAnimationTransitionFlipFromLeft,
+ UIViewAnimationTransitionFlipFromRight,
+ UIViewAnimationTransitionCurlUp,
+ UIViewAnimationTransitionCurlDown,
+} UIViewAnimationTransition;
+
+typedef enum {
+ UIViewOne = 0,
+ UIViewTwo = 1 << 0,
+ UIViewThree = 1 << 1,
+ UIViewFour = 1 << 2,
+ UIViewFive = 1 << 3,
+ UIViewSix = 1 << 4,
+ UIViewSeven = 1 << 5
+} UITableView;
+
+enum {
+ UIOne = 0,
+ UITwo = 0x1,
+ UIthree = 0x8,
+ UIFour = 0x100
+};
+typedef NSInteger UI;
+
+typedef enum {
+ UIP2One = 0,
+ UIP2Two = 0x1,
+ UIP2three = 0x8,
+ UIP2Four = 0x100
+} UIPOWER2;
+
+enum {
+ UNOne,
+ UNTwo
+};
+
+// Should use NS_ENUM even though it is all power of 2.
+enum {
+ UIKOne = 1,
+ UIKTwo = 2,
+};
+typedef NSInteger UIK;
+
+typedef enum {
+ NSTickMarkBelow = 0,
+ NSTickMarkAbove = 1,
+ NSTickMarkLeft = NSTickMarkAbove,
+ NSTickMarkRight = NSTickMarkBelow
+} NSTickMarkPosition;
+
+enum {
+ UIViewNone = 0x0,
+ UIViewMargin = 0x1,
+ UIViewWidth = 0x2,
+ UIViewRightMargin = 0x3,
+ UIViewBottomMargin = 0xbadbeef
+};
+typedef NSInteger UITableStyle;
+
+enum {
+ UIView0 = 0,
+ UIView1 = 0XBADBEEF
+};
+typedef NSInteger UIStyle;
+
+enum {
+ NSTIFFFileType,
+ NSBMPFileType,
+ NSGIFFileType,
+ NSJPEGFileType,
+ NSPNGFileType,
+ NSJPEG2000FileType
+};
+typedef NSUInteger NSBitmapImageFileType;
+
+enum {
+ NSWarningAlertStyle = 0,
+ NSInformationalAlertStyle = 1,
+ NSCriticalAlertStyle = 2
+};
+typedef NSUInteger NSAlertStyle;
+
+enum {
+ D_NSTIFFFileType,
+ D_NSBMPFileType,
+ D_NSGIFFileType,
+ D_NSJPEGFileType,
+ D_NSPNGFileType,
+ D_NSJPEG2000FileType
+};
+typedef NSUInteger D_NSBitmapImageFileType DEPRECATED;
+
+typedef enum {
+ D_NSTickMarkBelow = 0,
+ D_NSTickMarkAbove = 1
+} D_NSTickMarkPosition DEPRECATED;
+
+
+#define NS_ENUM_AVAILABLE(X,Y)
+
+enum {
+ NSFStrongMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 0),
+ NSFOpaqueMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 0),
+ NSFMallocMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 0),
+ NSFMachVirtualMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 0),
+ NSFWeakMemory NS_ENUM_AVAILABLE(10_8, 6_0) = (5UL << 0),
+
+ NSFObjectPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 8),
+ NSFOpaquePersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 8),
+ NSFObjectPointerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 8),
+ NSFCStringPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 8),
+ NSFStructPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 8),
+ NSFIntegerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (5UL << 8),
+ NSFCopyIn NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 16),
+};
+
+typedef NSUInteger NSFOptions;
+
+typedef enum {
+ UIP0One = 0,
+ UIP0Two = 1,
+ UIP0Three = 2,
+ UIP0Four = 10,
+ UIP0Last = 0x100
+} UIP;
+
+typedef enum {
+ UIPZero = 0x0,
+ UIPOne = 0x1,
+ UIPTwo = 0x2,
+ UIP10 = 0x10,
+ UIPHundred = 0x100
+} UIP_3;
+
+typedef enum {
+ UIP4Zero = 0x0,
+ UIP4One = 0x1,
+ UIP4Two = 0x2,
+ UIP410 = 0x10,
+ UIP4Hundred = 100
+} UIP4_3;
+
+typedef enum {
+ UIP5Zero = 0x0,
+ UIP5Two = 0x2,
+ UIP510 = 0x3,
+ UIP5Hundred = 0x4
+} UIP5_3;
+
+typedef enum {
+ UIP6Zero = 0x0,
+ UIP6One = 0x1,
+ UIP6Two = 0x2,
+ UIP610 = 10,
+ UIP6Hundred = 0x100
+} UIP6_3;
+
+typedef enum {
+ UIP7Zero = 0x0,
+ UIP7One = 1,
+ UIP7Two = 0x2,
+ UIP710 = 10,
+ UIP7Hundred = 100
+} UIP7_3;
+
+
+typedef enum {
+ Random = 0,
+ Random1 = 2,
+ Random2 = 4,
+ Random3 = 0x12345,
+ Random4 = 0x3444444,
+ Random5 = 0xbadbeef,
+ Random6
+} UIP8_3;
+
+// rdar://15200602
+#define NS_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
+#define NS_ENUM_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
+
+enum {
+ NSModalResponseStop = (-1000), // Also used as the default response for sheets
+ NSModalResponseAbort = (-1001),
+ NSModalResponseContinue = (-1002),
+} NS_ENUM_AVAILABLE_MAC(10.9);
+typedef NSInteger NSModalResponse NS_AVAILABLE_MAC(10.9);
+
+// rdar://15201056
+typedef NSUInteger FarFarAwayOptions;
+
+// rdar://15200915
+typedef NSUInteger FarAwayOptions;
+enum {
+ NSWorkspaceLaunchAndPrint = 0x00000002,
+ NSWorkspaceLaunchWithErrorPresentation = 0x00000040,
+ NSWorkspaceLaunchInhibitingBackgroundOnly = 0x00000080,
+ NSWorkspaceLaunchWithoutAddingToRecents = 0x00000100,
+ NSWorkspaceLaunchWithoutActivation = 0x00000200,
+ NSWorkspaceLaunchAsync = 0x00010000,
+ NSWorkspaceLaunchAllowingClassicStartup = 0x00020000,
+ NSWorkspaceLaunchPreferringClassic = 0x00040000,
+ NSWorkspaceLaunchNewInstance = 0x00080000,
+ NSWorkspaceLaunchAndHide = 0x00100000,
+ NSWorkspaceLaunchAndHideOthers = 0x00200000,
+ NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync |
+ NSWorkspaceLaunchAllowingClassicStartup
+};
+typedef NSUInteger NSWorkspaceLaunchOptions;
+
+enum {
+ NSExcludeQuickDrawElementsIconCreationOption = 1 << 1,
+ NSExclude10_4ElementsIconCreationOption = 1 << 2
+};
+typedef NSUInteger NSExcludeOptions;
+
+enum {
+ NSExcludeQuickDrawElementsCreationOption = 1 << 1,
+ NSExclude10_4ElementsCreationOption = 1 << 2
+};
+typedef NSUInteger NSExcludeCreationOption;
+
+enum {
+ FarAway1 = 1 << 1,
+ FarAway2 = 1 << 2
+};
+
+enum {
+ NSExcludeQuickDrawElementsIconOption = 1 << 1,
+ NSExclude10_4ElementsIconOption = 1 << 2
+};
+typedef NSUInteger NSExcludeIconOptions;
+
+@interface INTF {
+ NSExcludeIconOptions I1;
+ NSExcludeIconOptions I2;
+}
+@end
+
+enum {
+ FarFarAway1 = 1 << 1,
+ FarFarAway2 = 1 << 2
+};
+
+// rdar://15200915
+typedef NS_OPTIONS(NSUInteger, NSWindowOcclusionState) {
+ NSWindowOcclusionStateVisible = 1UL << 1,
+};
+
+typedef NSUInteger NSWindowNumberListOptions;
+
+enum {
+ NSDirectSelection = 0,
+ NSSelectingNext,
+ NSSelectingPrevious
+};
+typedef NSUInteger NSSelectionDirection;
+
+// standard window buttons
+enum {
+ NSWindowCloseButton,
+ NSWindowMiniaturizeButton,
+ NSWindowZoomButton,
+ NSWindowToolbarButton,
+ NSWindowDocumentIconButton
+};
diff --git a/test/ARCMT/objcmt-ns-macros.m.result b/test/ARCMT/objcmt-ns-macros.m.result
new file mode 100644
index 000000000000..0b640ac35676
--- /dev/null
+++ b/test/ARCMT/objcmt-ns-macros.m.result
@@ -0,0 +1,279 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-ns-macros -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+typedef long NSInteger;
+typedef unsigned long NSUInteger;
+
+#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
+#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
+#define DEPRECATED __attribute__((deprecated))
+
+typedef NS_ENUM(NSInteger, wibble) {
+ blah,
+ blarg
+};
+
+typedef NS_ENUM(NSUInteger, UITableViewCellStyle) {
+ UIViewAutoresizingNone = 0,
+ UIViewAutoresizingFlexibleLeftMargin,
+ UIViewAutoresizingFlexibleWidth,
+ UIViewAutoresizingFlexibleRightMargin,
+ UIViewAutoresizingFlexibleTopMargin,
+ UIViewAutoresizingFlexibleHeight,
+ UIViewAutoresizingFlexibleBottomMargin
+};
+
+typedef NS_ENUM(NSInteger, UIViewAnimationTransition) {
+ UIViewAnimationTransitionNone,
+ UIViewAnimationTransitionFlipFromLeft,
+ UIViewAnimationTransitionFlipFromRight,
+ UIViewAnimationTransitionCurlUp,
+ UIViewAnimationTransitionCurlDown,
+} ;
+
+typedef NS_OPTIONS(NSUInteger, UITableView) {
+ UIViewOne = 0,
+ UIViewTwo = 1 << 0,
+ UIViewThree = 1 << 1,
+ UIViewFour = 1 << 2,
+ UIViewFive = 1 << 3,
+ UIViewSix = 1 << 4,
+ UIViewSeven = 1 << 5
+} ;
+
+typedef NS_OPTIONS(NSUInteger, UI) {
+ UIOne = 0,
+ UITwo = 0x1,
+ UIthree = 0x8,
+ UIFour = 0x100
+};
+
+typedef NS_OPTIONS(NSUInteger, UIPOWER2) {
+ UIP2One = 0,
+ UIP2Two = 0x1,
+ UIP2three = 0x8,
+ UIP2Four = 0x100
+} ;
+
+enum {
+ UNOne,
+ UNTwo
+};
+
+// Should use NS_ENUM even though it is all power of 2.
+typedef NS_ENUM(NSInteger, UIK) {
+ UIKOne = 1,
+ UIKTwo = 2,
+};
+
+typedef NS_ENUM(NSInteger, NSTickMarkPosition) {
+ NSTickMarkBelow = 0,
+ NSTickMarkAbove = 1,
+ NSTickMarkLeft = NSTickMarkAbove,
+ NSTickMarkRight = NSTickMarkBelow
+} ;
+
+typedef NS_OPTIONS(NSUInteger, UITableStyle) {
+ UIViewNone = 0x0,
+ UIViewMargin = 0x1,
+ UIViewWidth = 0x2,
+ UIViewRightMargin = 0x3,
+ UIViewBottomMargin = 0xbadbeef
+};
+
+typedef NS_OPTIONS(NSUInteger, UIStyle) {
+ UIView0 = 0,
+ UIView1 = 0XBADBEEF
+};
+
+typedef NS_ENUM(NSUInteger, NSBitmapImageFileType) {
+ NSTIFFFileType,
+ NSBMPFileType,
+ NSGIFFileType,
+ NSJPEGFileType,
+ NSPNGFileType,
+ NSJPEG2000FileType
+};
+
+typedef NS_ENUM(NSUInteger, NSAlertStyle) {
+ NSWarningAlertStyle = 0,
+ NSInformationalAlertStyle = 1,
+ NSCriticalAlertStyle = 2
+};
+
+enum {
+ D_NSTIFFFileType,
+ D_NSBMPFileType,
+ D_NSGIFFileType,
+ D_NSJPEGFileType,
+ D_NSPNGFileType,
+ D_NSJPEG2000FileType
+};
+typedef NSUInteger D_NSBitmapImageFileType DEPRECATED;
+
+typedef enum {
+ D_NSTickMarkBelow = 0,
+ D_NSTickMarkAbove = 1
+} D_NSTickMarkPosition DEPRECATED;
+
+
+#define NS_ENUM_AVAILABLE(X,Y)
+
+
+typedef NS_OPTIONS(NSUInteger, NSFOptions) {
+ NSFStrongMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 0),
+ NSFOpaqueMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 0),
+ NSFMallocMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 0),
+ NSFMachVirtualMemory NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 0),
+ NSFWeakMemory NS_ENUM_AVAILABLE(10_8, 6_0) = (5UL << 0),
+
+ NSFObjectPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (0UL << 8),
+ NSFOpaquePersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 8),
+ NSFObjectPointerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (2UL << 8),
+ NSFCStringPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (3UL << 8),
+ NSFStructPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (4UL << 8),
+ NSFIntegerPersonality NS_ENUM_AVAILABLE(10_5, 6_0) = (5UL << 8),
+ NSFCopyIn NS_ENUM_AVAILABLE(10_5, 6_0) = (1UL << 16),
+};
+
+typedef NS_ENUM(NSInteger, UIP) {
+ UIP0One = 0,
+ UIP0Two = 1,
+ UIP0Three = 2,
+ UIP0Four = 10,
+ UIP0Last = 0x100
+} ;
+
+typedef NS_OPTIONS(NSUInteger, UIP_3) {
+ UIPZero = 0x0,
+ UIPOne = 0x1,
+ UIPTwo = 0x2,
+ UIP10 = 0x10,
+ UIPHundred = 0x100
+} ;
+
+typedef NS_ENUM(NSInteger, UIP4_3) {
+ UIP4Zero = 0x0,
+ UIP4One = 0x1,
+ UIP4Two = 0x2,
+ UIP410 = 0x10,
+ UIP4Hundred = 100
+} ;
+
+typedef NS_OPTIONS(NSUInteger, UIP5_3) {
+ UIP5Zero = 0x0,
+ UIP5Two = 0x2,
+ UIP510 = 0x3,
+ UIP5Hundred = 0x4
+} ;
+
+typedef NS_ENUM(NSInteger, UIP6_3) {
+ UIP6Zero = 0x0,
+ UIP6One = 0x1,
+ UIP6Two = 0x2,
+ UIP610 = 10,
+ UIP6Hundred = 0x100
+} ;
+
+typedef NS_ENUM(NSInteger, UIP7_3) {
+ UIP7Zero = 0x0,
+ UIP7One = 1,
+ UIP7Two = 0x2,
+ UIP710 = 10,
+ UIP7Hundred = 100
+} ;
+
+
+typedef NS_ENUM(NSInteger, UIP8_3) {
+ Random = 0,
+ Random1 = 2,
+ Random2 = 4,
+ Random3 = 0x12345,
+ Random4 = 0x3444444,
+ Random5 = 0xbadbeef,
+ Random6
+} ;
+
+// rdar://15200602
+#define NS_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
+#define NS_ENUM_AVAILABLE_MAC(X) __attribute__((availability(macosx,introduced=X)))
+
+typedef NS_ENUM(NSInteger, NSModalResponse) {
+ NSModalResponseStop = (-1000), // Also used as the default response for sheets
+ NSModalResponseAbort = (-1001),
+ NSModalResponseContinue = (-1002),
+} NS_ENUM_AVAILABLE_MAC(10.9);
+
+// rdar://15201056
+typedef NSUInteger FarFarAwayOptions;
+
+// rdar://15200915
+typedef NS_OPTIONS(NSUInteger, FarAwayOptions) {
+ FarAway1 = 1 << 1,
+ FarAway2 = 1 << 2
+};
+typedef NS_OPTIONS(NSUInteger, NSWorkspaceLaunchOptions) {
+ NSWorkspaceLaunchAndPrint = 0x00000002,
+ NSWorkspaceLaunchWithErrorPresentation = 0x00000040,
+ NSWorkspaceLaunchInhibitingBackgroundOnly = 0x00000080,
+ NSWorkspaceLaunchWithoutAddingToRecents = 0x00000100,
+ NSWorkspaceLaunchWithoutActivation = 0x00000200,
+ NSWorkspaceLaunchAsync = 0x00010000,
+ NSWorkspaceLaunchAllowingClassicStartup = 0x00020000,
+ NSWorkspaceLaunchPreferringClassic = 0x00040000,
+ NSWorkspaceLaunchNewInstance = 0x00080000,
+ NSWorkspaceLaunchAndHide = 0x00100000,
+ NSWorkspaceLaunchAndHideOthers = 0x00200000,
+ NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync |
+ NSWorkspaceLaunchAllowingClassicStartup
+};
+
+typedef NS_OPTIONS(NSUInteger, NSExcludeOptions) {
+ NSExcludeQuickDrawElementsIconCreationOption = 1 << 1,
+ NSExclude10_4ElementsIconCreationOption = 1 << 2
+};
+
+typedef NS_OPTIONS(NSUInteger, NSExcludeCreationOption) {
+ NSExcludeQuickDrawElementsCreationOption = 1 << 1,
+ NSExclude10_4ElementsCreationOption = 1 << 2
+};
+
+
+typedef NS_OPTIONS(NSUInteger, NSExcludeIconOptions) {
+ NSExcludeQuickDrawElementsIconOption = 1 << 1,
+ NSExclude10_4ElementsIconOption = 1 << 2
+};
+
+@interface INTF {
+ NSExcludeIconOptions I1;
+ NSExcludeIconOptions I2;
+}
+@end
+
+enum {
+ FarFarAway1 = 1 << 1,
+ FarFarAway2 = 1 << 2
+};
+
+// rdar://15200915
+typedef NS_OPTIONS(NSUInteger, NSWindowOcclusionState) {
+ NSWindowOcclusionStateVisible = 1UL << 1,
+};
+
+typedef NS_ENUM(NSUInteger, NSWindowNumberListOptions) {
+ NSWindowCloseButton,
+ NSWindowMiniaturizeButton,
+ NSWindowZoomButton,
+ NSWindowToolbarButton,
+ NSWindowDocumentIconButton
+};
+
+typedef NS_ENUM(NSUInteger, NSSelectionDirection) {
+ NSDirectSelection = 0,
+ NSSelectingNext,
+ NSSelectingPrevious
+};
+
+// standard window buttons
diff --git a/test/ARCMT/objcmt-ns-nonatomic-iosonly.m b/test/ARCMT/objcmt-ns-nonatomic-iosonly.m
new file mode 100644
index 000000000000..57b20415f969
--- /dev/null
+++ b/test/ARCMT/objcmt-ns-nonatomic-iosonly.m
@@ -0,0 +1,236 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fblocks -objcmt-migrate-readwrite-property -objcmt-ns-nonatomic-iosonly -objcmt-migrate-readonly-property -objcmt-atomic-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+#define WEBKIT_OBJC_METHOD_ANNOTATION(ANNOTATION) ANNOTATION
+#define WEAK_IMPORT_ATTRIBUTE __attribute__((objc_arc_weak_reference_unavailable))
+#define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER
+#define DEPRECATED __attribute__((deprecated))
+
+// rdar://15442742
+#if TARGET_OS_IPHONE
+ #define NS_NONATOMIC_IOSONLY nonatomic
+#else
+ #define NS_NONATOMIC_IOSONLY atomic
+#endif
+
+typedef char BOOL;
+@class NSString;
+@protocol NSCopying @end
+
+@interface NSObject <NSCopying>
+@end
+
+@interface NSDictionary : NSObject
+@end
+
+@interface I : NSObject {
+ int ivarVal;
+}
+- (void) setWeakProp : (NSString *__weak)Val;
+- (NSString *__weak) WeakProp;
+
+- (NSString *) StrongProp;
+- (void) setStrongProp : (NSString *)Val;
+
+- (NSString *) UnavailProp __attribute__((unavailable));
+- (void) setUnavailProp : (NSString *)Val;
+
+- (NSString *) UnavailProp1 __attribute__((unavailable));
+- (void) setUnavailProp1 : (NSString *)Val __attribute__((unavailable));
+
+- (NSString *) UnavailProp2;
+- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
+
+- (NSDictionary*) undoAction;
+- (void) setUndoAction: (NSDictionary*)Arg;
+@end
+
+@implementation I
+@end
+
+@class NSArray;
+
+@interface MyClass2 {
+@private
+ NSArray *_names1;
+ NSArray *_names2;
+ NSArray *_names3;
+ NSArray *_names4;
+}
+- (void)setNames1:(NSArray *)names;
+- (void)setNames4:(__strong NSArray *)names;
+- (void)setNames3:(__strong NSArray *)names;
+- (void)setNames2:(NSArray *)names;
+- (NSArray *) names2;
+- (NSArray *)names3;
+- (__strong NSArray *)names4;
+- (NSArray *) names1;
+@end
+
+// Properties that contain the name "delegate" or "dataSource",
+// or have exact name "target" have unsafe_unretained attribute.
+@interface NSInvocation
+- (id)target;
+- (void)setTarget:(id)target;
+
+- (id) dataSource;
+
+- (id)xxxdelegateYYY;
+- (void)setXxxdelegateYYY:(id)delegate;
+
+- (void)setDataSource:(id)source;
+
+- (id)MYtarget;
+- (void)setMYtarget: (id)target;
+
+- (id)targetX;
+- (void)setTargetX: (id)t;
+
+- (int)value;
+- (void)setValue: (int)val;
+
+-(BOOL) isContinuous;
+-(void) setContinuous:(BOOL)value;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+- (int) Length;
+- (id) object;
++ (double) D;
+- (void *)JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
+- (BOOL)isIgnoringInteractionEvents;
+
+- (NSString *)getStringValue;
+- (BOOL)getCounterValue;
+- (void)setStringValue:(NSString *)stringValue AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (NSDictionary *)getns_dixtionary;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+- (BOOL) getM;
+- (BOOL) getMA;
+- (BOOL) getALL;
+- (BOOL) getMANY;
+- (BOOL) getSome;
+@end
+
+
+@interface NSInvocation(CAT)
+- (id)target;
+- (void)setTarget:(id)target;
+
+- (id) dataSource;
+
+- (id)xxxdelegateYYY;
+- (void)setXxxdelegateYYY:(id)delegate;
+
+- (void)setDataSource:(id)source;
+
+- (id)MYtarget;
+- (void)setMYtarget: (id)target;
+
+- (id)targetX;
+- (void)setTargetX: (id)t;
+
+- (int)value;
+- (void)setValue: (int)val;
+
+-(BOOL) isContinuous;
+-(void) setContinuous:(BOOL)value;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+- (int) Length;
+- (id) object;
++ (double) D;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+- (BOOL) getM;
+- (BOOL) getMA;
+- (BOOL) getALL;
+- (BOOL) getMANY;
+- (BOOL) getSome;
+@end
+
+DEPRECATED
+@interface I_DEP
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+@end
+
+@interface AnotherOne
+- (BOOL) isinValid DEPRECATED;
+- (void) setInValid : (BOOL) arg;
+- (id)MYtarget;
+- (void)setMYtarget: (id)target DEPRECATED;
+- (BOOL) getM DEPRECATED;
+
+- (id)xxxdelegateYYY DEPRECATED;
+- (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
+@end
+
+// rdar://14987909
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+#define NORETURN __attribute__((noreturn))
+#define ALIGNED __attribute__((aligned(16)))
+
+@interface NSURL
+// Do not infer a property.
+- (NSURL *)appStoreReceiptURL NS_AVAILABLE;
+- (void) setAppStoreReceiptURL : (NSURL *)object;
+
+- (NSURL *)appStoreReceiptURLX NS_AVAILABLE;
+- (void) setAppStoreReceiptURLX : (NSURL *)object NS_AVAILABLE;
+
+// Do not infer a property.
+- (NSURL *)appStoreReceiptURLY ;
+- (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
+
+- (id)OkToInfer NS_AVAILABLE;
+
+// Do not infer a property.
+- (NSURL *)appStoreReceiptURLZ ;
+- (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
+
+// Do not infer a property.
+- (id) t1 NORETURN NS_AVAILABLE;
+- (void) setT1 : (id) arg NS_AVAILABLE;
+
+- (id)method1 ALIGNED NS_AVAILABLE;
+- (void) setMethod1 : (id) object NS_AVAILABLE ALIGNED;
+
+- (NSURL *)init; // No Change
++ (id)alloc; // No Change
+
+- (BOOL)is1stClass; // Not a valid property
+- (BOOL)isClass; // This is a valid property 'class' is not a keyword in ObjC
+- (BOOL)isDouble; // Not a valid property
+
+@end
+
+// rdar://15082818
+@class NSMutableDictionary;
+
+@interface NSArray
+- (id (^)(id, NSArray *, NSMutableDictionary *)) expressionBlock;
+- (id (^)(id, NSArray *, NSMutableDictionary *)) MyBlock;
+- (void) setMyBlock : (id (^)(id, NSArray *, NSMutableDictionary *)) bl;
+- (id (*)(id, NSArray *, NSMutableDictionary *)) expressionFuncptr;
+- (id (*)(id, NSArray *, NSMutableDictionary *)) MyFuncptr;
+- (void) setMyFuncptr : (id (*)(id, NSArray *, NSMutableDictionary *)) bl;
+@end
diff --git a/test/ARCMT/objcmt-ns-nonatomic-iosonly.m.result b/test/ARCMT/objcmt-ns-nonatomic-iosonly.m.result
new file mode 100644
index 000000000000..804142ee3280
--- /dev/null
+++ b/test/ARCMT/objcmt-ns-nonatomic-iosonly.m.result
@@ -0,0 +1,209 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fblocks -objcmt-migrate-readwrite-property -objcmt-ns-nonatomic-iosonly -objcmt-migrate-readonly-property -objcmt-atomic-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+#define WEBKIT_OBJC_METHOD_ANNOTATION(ANNOTATION) ANNOTATION
+#define WEAK_IMPORT_ATTRIBUTE __attribute__((objc_arc_weak_reference_unavailable))
+#define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER
+#define DEPRECATED __attribute__((deprecated))
+
+// rdar://15442742
+#if TARGET_OS_IPHONE
+ #define NS_NONATOMIC_IOSONLY nonatomic
+#else
+ #define NS_NONATOMIC_IOSONLY atomic
+#endif
+
+typedef char BOOL;
+@class NSString;
+@protocol NSCopying @end
+
+@interface NSObject <NSCopying>
+@end
+
+@interface NSDictionary : NSObject
+@end
+
+@interface I : NSObject {
+ int ivarVal;
+}
+@property (NS_NONATOMIC_IOSONLY, weak) NSString *WeakProp;
+
+@property (NS_NONATOMIC_IOSONLY, retain) NSString *StrongProp;
+
+@property (NS_NONATOMIC_IOSONLY, retain) NSString *UnavailProp __attribute__((unavailable));
+- (void) setUnavailProp : (NSString *)Val;
+
+@property (NS_NONATOMIC_IOSONLY, retain) NSString *UnavailProp1 __attribute__((unavailable));
+
+@property (NS_NONATOMIC_IOSONLY, retain) NSString *UnavailProp2;
+- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
+
+@property (NS_NONATOMIC_IOSONLY, copy) NSDictionary *undoAction;
+@end
+
+@implementation I
+@end
+
+@class NSArray;
+
+@interface MyClass2 {
+@private
+ NSArray *_names1;
+ NSArray *_names2;
+ NSArray *_names3;
+ NSArray *_names4;
+}
+@property (NS_NONATOMIC_IOSONLY, retain) NSArray *names2;
+@property (NS_NONATOMIC_IOSONLY, retain) NSArray *names3;
+@property (NS_NONATOMIC_IOSONLY, retain) NSArray *names4;
+@property (NS_NONATOMIC_IOSONLY, retain) NSArray *names1;
+@end
+
+// Properties that contain the name "delegate" or "dataSource",
+// or have exact name "target" have unsafe_unretained attribute.
+@interface NSInvocation
+@property (NS_NONATOMIC_IOSONLY, assign) id target;
+
+@property (NS_NONATOMIC_IOSONLY, assign) id dataSource;
+
+@property (NS_NONATOMIC_IOSONLY, assign) id xxxdelegateYYY;
+
+
+@property (NS_NONATOMIC_IOSONLY, retain) id MYtarget;
+
+@property (NS_NONATOMIC_IOSONLY, retain) id targetX;
+
+@property (NS_NONATOMIC_IOSONLY) int value;
+
+@property (NS_NONATOMIC_IOSONLY, getter=isContinuous) BOOL continuous;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+@property (NS_NONATOMIC_IOSONLY, getter=isinValid, readonly) BOOL inValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+@property (NS_NONATOMIC_IOSONLY, readonly) int Length;
+@property (NS_NONATOMIC_IOSONLY, readonly, retain) id object;
++ (double) D;
+@property (NS_NONATOMIC_IOSONLY, readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
+@property (NS_NONATOMIC_IOSONLY, getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents;
+
+@property (NS_NONATOMIC_IOSONLY, getter=getStringValue, retain) NSString *stringValue;
+@property (NS_NONATOMIC_IOSONLY, getter=getCounterValue, readonly) BOOL counterValue;
+@property (NS_NONATOMIC_IOSONLY, getter=getns_dixtionary, readonly, retain) NSDictionary *ns_dixtionary;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+@property (NS_NONATOMIC_IOSONLY, getter=getM, readonly) BOOL m;
+@property (NS_NONATOMIC_IOSONLY, getter=getMA, readonly) BOOL MA;
+@property (NS_NONATOMIC_IOSONLY, getter=getALL, readonly) BOOL ALL;
+@property (NS_NONATOMIC_IOSONLY, getter=getMANY, readonly) BOOL MANY;
+@property (NS_NONATOMIC_IOSONLY, getter=getSome, readonly) BOOL some;
+@end
+
+
+@interface NSInvocation(CAT)
+@property (NS_NONATOMIC_IOSONLY, assign) id target;
+
+@property (NS_NONATOMIC_IOSONLY, assign) id dataSource;
+
+@property (NS_NONATOMIC_IOSONLY, assign) id xxxdelegateYYY;
+
+
+@property (NS_NONATOMIC_IOSONLY, retain) id MYtarget;
+
+@property (NS_NONATOMIC_IOSONLY, retain) id targetX;
+
+@property (NS_NONATOMIC_IOSONLY) int value;
+
+@property (NS_NONATOMIC_IOSONLY, getter=isContinuous) BOOL continuous;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+@property (NS_NONATOMIC_IOSONLY, getter=isinValid, readonly) BOOL inValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+@property (NS_NONATOMIC_IOSONLY, readonly) int Length;
+@property (NS_NONATOMIC_IOSONLY, readonly, retain) id object;
++ (double) D;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+@property (NS_NONATOMIC_IOSONLY, getter=getM, readonly) BOOL m;
+@property (NS_NONATOMIC_IOSONLY, getter=getMA, readonly) BOOL MA;
+@property (NS_NONATOMIC_IOSONLY, getter=getALL, readonly) BOOL ALL;
+@property (NS_NONATOMIC_IOSONLY, getter=getMANY, readonly) BOOL MANY;
+@property (NS_NONATOMIC_IOSONLY, getter=getSome, readonly) BOOL some;
+@end
+
+DEPRECATED
+@interface I_DEP
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+@end
+
+@interface AnotherOne
+- (BOOL) isinValid DEPRECATED;
+- (void) setInValid : (BOOL) arg;
+- (id)MYtarget;
+- (void)setMYtarget: (id)target DEPRECATED;
+- (BOOL) getM DEPRECATED;
+
+- (id)xxxdelegateYYY DEPRECATED;
+- (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
+@end
+
+// rdar://14987909
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+#define NORETURN __attribute__((noreturn))
+#define ALIGNED __attribute__((aligned(16)))
+
+@interface NSURL
+// Do not infer a property.
+@property (NS_NONATOMIC_IOSONLY, retain) NSURL *appStoreReceiptURL NS_AVAILABLE;
+- (void) setAppStoreReceiptURL : (NSURL *)object;
+
+@property (NS_NONATOMIC_IOSONLY, retain) NSURL *appStoreReceiptURLX NS_AVAILABLE;
+
+// Do not infer a property.
+@property (NS_NONATOMIC_IOSONLY, retain) NSURL *appStoreReceiptURLY ;
+- (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
+
+@property (NS_NONATOMIC_IOSONLY, readonly, retain) id OkToInfer NS_AVAILABLE;
+
+// Do not infer a property.
+@property (NS_NONATOMIC_IOSONLY, retain) NSURL *appStoreReceiptURLZ ;
+- (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
+
+// Do not infer a property.
+- (id) t1 NORETURN NS_AVAILABLE;
+- (void) setT1 : (id) arg NS_AVAILABLE;
+
+@property (NS_NONATOMIC_IOSONLY, retain) id method1 ALIGNED NS_AVAILABLE;
+
+- (NSURL *)init; // No Change
++ (id)alloc; // No Change
+
+- (BOOL)is1stClass; // Not a valid property
+@property (NS_NONATOMIC_IOSONLY, getter=isClass, readonly) BOOL class; // This is a valid property 'class' is not a keyword in ObjC
+- (BOOL)isDouble; // Not a valid property
+
+@end
+
+// rdar://15082818
+@class NSMutableDictionary;
+
+@interface NSArray
+@property (NS_NONATOMIC_IOSONLY, readonly, copy) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *);
+@property (NS_NONATOMIC_IOSONLY, copy) id (^MyBlock)(id, NSArray *, NSMutableDictionary *);
+@property (NS_NONATOMIC_IOSONLY, readonly) id (*expressionFuncptr)(id, NSArray *, NSMutableDictionary *);
+@property (NS_NONATOMIC_IOSONLY) id (*MyFuncptr)(id, NSArray *, NSMutableDictionary *);
+@end
diff --git a/test/ARCMT/objcmt-ns-returns-inner-pointer.m b/test/ARCMT/objcmt-ns-returns-inner-pointer.m
new file mode 100644
index 000000000000..bff7d80b9414
--- /dev/null
+++ b/test/ARCMT/objcmt-ns-returns-inner-pointer.m
@@ -0,0 +1,129 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-returns-innerpointer-property -objcmt-migrate-annotation -objcmt-migrate-readwrite-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+#ifndef NS_RETURNS_INNER_POINTER // defined in iOS 6 for sure
+#define NS_RETURNS_INNER_POINTER __attribute__((objc_returns_inner_pointer))
+#endif
+
+#define CF_IMPLICIT_BRIDGING_ENABLED _Pragma("clang arc_cf_code_audited begin")
+
+#define CF_IMPLICIT_BRIDGING_DISABLED _Pragma("clang arc_cf_code_audited end")
+
+#if __has_feature(attribute_ns_returns_retained)
+#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
+#endif
+#if __has_feature(attribute_cf_returns_retained)
+#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
+#endif
+#if __has_feature(attribute_ns_returns_not_retained)
+#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
+#endif
+#if __has_feature(attribute_cf_returns_not_retained)
+#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
+#endif
+#if __has_feature(attribute_ns_consumes_self)
+#define NS_CONSUMES_SELF __attribute__((ns_consumes_self))
+#endif
+#if __has_feature(attribute_ns_consumed)
+#define NS_CONSUMED __attribute__((ns_consumed))
+#endif
+#if __has_feature(attribute_cf_consumed)
+#define CF_CONSUMED __attribute__((cf_consumed))
+#endif
+#if __has_attribute(ns_returns_autoreleased)
+#define NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
+#endif
+
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+typedef unsigned long CFTypeID;
+typedef unsigned long CFOptionFlags;
+typedef unsigned long CFHashCode;
+
+typedef signed long CFIndex; /*AnyObj*/
+typedef const struct __CFArray * CFArrayRef;
+typedef struct {
+ CFIndex location;
+ CFIndex length;
+} CFRange;
+
+typedef void (*CFArrayApplierFunction)(const void *value, void *context);
+
+typedef enum CFComparisonResult : CFIndex CFComparisonResult; enum CFComparisonResult : CFIndex {
+ kCFCompareLessThan = -1L,
+ kCFCompareEqualTo = 0,
+ kCFCompareGreaterThan = 1
+};
+
+
+typedef CFComparisonResult (*CFComparatorFunction)(const void *val1, const void *val2, void *context);
+
+typedef struct __CFArray * CFMutableArrayRef;
+
+typedef const struct __CFAttributedString *CFAttributedStringRef;
+typedef struct __CFAttributedString *CFMutableAttributedStringRef;
+
+typedef const struct __CFAllocator * CFAllocatorRef;
+
+typedef const struct __CFString * CFStringRef;
+typedef struct __CFString * CFMutableStringRef;
+
+typedef const struct __CFDictionary * CFDictionaryRef;
+typedef struct __CFDictionary * CFMutableDictionaryRef;
+
+typedef struct CGImage *CGImageRef;
+
+typedef struct OpaqueJSValue* JSObjectRef;
+
+typedef JSObjectRef TTJSObjectRef;
+typedef unsigned int NSUInteger;
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+@interface I
+- (void*) ReturnsInnerPointer;
+- (int*) AlreadyReturnsInnerPointer NS_RETURNS_INNER_POINTER;
+@end
+
+@interface UIImage
+- (CGImageRef)CGImage;
+@end
+
+@interface NSData
+- (void *)bytes;
+- (void **) ptr_bytes __attribute__((availability(macosx,unavailable)));
+@end
+
+@interface NSMutableData
+- (void *)mutableBytes __attribute__((deprecated)) __attribute__((unavailable));
+@end
+
+@interface JS
+- (JSObjectRef)JSObject;
+- (TTJSObjectRef)JSObject1;
+- (JSObjectRef*)JSObject2;
+@end
+
+// rdar://15044991
+typedef void *SecTrustRef;
+
+@interface NSURLProtectionSpace
+@property (readonly) SecTrustRef serverTrust NS_AVAILABLE;
+- (void *) FOO NS_AVAILABLE;
+@property (readonly) void * mitTrust NS_AVAILABLE;
+
+@property (readonly) void * mittiTrust;
+
+@property (readonly) SecTrustRef XserverTrust;
+
+- (SecTrustRef) FOO1 NS_AVAILABLE;
+
++ (const NSURLProtectionSpace *)ProtectionSpace;
+
+// pointer personality functions
+@property NSUInteger (*hashFunction)(const void *item, NSUInteger (*size)(const void *item));
+@end
diff --git a/test/ARCMT/objcmt-ns-returns-inner-pointer.m.result b/test/ARCMT/objcmt-ns-returns-inner-pointer.m.result
new file mode 100644
index 000000000000..8048e06748aa
--- /dev/null
+++ b/test/ARCMT/objcmt-ns-returns-inner-pointer.m.result
@@ -0,0 +1,129 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-returns-innerpointer-property -objcmt-migrate-annotation -objcmt-migrate-readwrite-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+#ifndef NS_RETURNS_INNER_POINTER // defined in iOS 6 for sure
+#define NS_RETURNS_INNER_POINTER __attribute__((objc_returns_inner_pointer))
+#endif
+
+#define CF_IMPLICIT_BRIDGING_ENABLED _Pragma("clang arc_cf_code_audited begin")
+
+#define CF_IMPLICIT_BRIDGING_DISABLED _Pragma("clang arc_cf_code_audited end")
+
+#if __has_feature(attribute_ns_returns_retained)
+#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
+#endif
+#if __has_feature(attribute_cf_returns_retained)
+#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
+#endif
+#if __has_feature(attribute_ns_returns_not_retained)
+#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
+#endif
+#if __has_feature(attribute_cf_returns_not_retained)
+#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
+#endif
+#if __has_feature(attribute_ns_consumes_self)
+#define NS_CONSUMES_SELF __attribute__((ns_consumes_self))
+#endif
+#if __has_feature(attribute_ns_consumed)
+#define NS_CONSUMED __attribute__((ns_consumed))
+#endif
+#if __has_feature(attribute_cf_consumed)
+#define CF_CONSUMED __attribute__((cf_consumed))
+#endif
+#if __has_attribute(ns_returns_autoreleased)
+#define NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
+#endif
+
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+
+CF_IMPLICIT_BRIDGING_ENABLED
+
+typedef unsigned long CFTypeID;
+typedef unsigned long CFOptionFlags;
+typedef unsigned long CFHashCode;
+
+typedef signed long CFIndex; /*AnyObj*/
+typedef const struct __CFArray * CFArrayRef;
+typedef struct {
+ CFIndex location;
+ CFIndex length;
+} CFRange;
+
+typedef void (*CFArrayApplierFunction)(const void *value, void *context);
+
+typedef enum CFComparisonResult : CFIndex CFComparisonResult; enum CFComparisonResult : CFIndex {
+ kCFCompareLessThan = -1L,
+ kCFCompareEqualTo = 0,
+ kCFCompareGreaterThan = 1
+};
+
+
+typedef CFComparisonResult (*CFComparatorFunction)(const void *val1, const void *val2, void *context);
+
+typedef struct __CFArray * CFMutableArrayRef;
+
+typedef const struct __CFAttributedString *CFAttributedStringRef;
+typedef struct __CFAttributedString *CFMutableAttributedStringRef;
+
+typedef const struct __CFAllocator * CFAllocatorRef;
+
+typedef const struct __CFString * CFStringRef;
+typedef struct __CFString * CFMutableStringRef;
+
+typedef const struct __CFDictionary * CFDictionaryRef;
+typedef struct __CFDictionary * CFMutableDictionaryRef;
+
+typedef struct CGImage *CGImageRef;
+
+typedef struct OpaqueJSValue* JSObjectRef;
+
+typedef JSObjectRef TTJSObjectRef;
+typedef unsigned int NSUInteger;
+
+CF_IMPLICIT_BRIDGING_DISABLED
+
+@interface I
+- (void*) ReturnsInnerPointer NS_RETURNS_INNER_POINTER;
+- (int*) AlreadyReturnsInnerPointer NS_RETURNS_INNER_POINTER;
+@end
+
+@interface UIImage
+- (CGImageRef)CGImage CF_RETURNS_NOT_RETAINED;
+@end
+
+@interface NSData
+- (void *)bytes NS_RETURNS_INNER_POINTER;
+- (void **) ptr_bytes __attribute__((availability(macosx,unavailable))) NS_RETURNS_INNER_POINTER;
+@end
+
+@interface NSMutableData
+- (void *)mutableBytes __attribute__((deprecated)) __attribute__((unavailable)) NS_RETURNS_INNER_POINTER;
+@end
+
+@interface JS
+- (JSObjectRef)JSObject;
+- (TTJSObjectRef)JSObject1;
+- (JSObjectRef*)JSObject2 NS_RETURNS_INNER_POINTER;
+@end
+
+// rdar://15044991
+typedef void *SecTrustRef;
+
+@interface NSURLProtectionSpace
+@property (readonly) SecTrustRef NS_RETURNS_INNER_POINTER serverTrust NS_AVAILABLE;
+- (void *) FOO NS_AVAILABLE NS_RETURNS_INNER_POINTER;
+@property (readonly) void * NS_RETURNS_INNER_POINTER mitTrust NS_AVAILABLE;
+
+@property (readonly) void * NS_RETURNS_INNER_POINTER mittiTrust;
+
+@property (readonly) SecTrustRef NS_RETURNS_INNER_POINTER XserverTrust;
+
+- (SecTrustRef) FOO1 NS_AVAILABLE NS_RETURNS_INNER_POINTER;
+
++ (const NSURLProtectionSpace *)ProtectionSpace;
+
+// pointer personality functions
+@property NSUInteger (*hashFunction)(const void *item, NSUInteger (*size)(const void *item));
+@end
diff --git a/test/ARCMT/objcmt-property-availability.m b/test/ARCMT/objcmt-property-availability.m
new file mode 100644
index 000000000000..d499221a74cd
--- /dev/null
+++ b/test/ARCMT/objcmt-property-availability.m
@@ -0,0 +1,46 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-readonly-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+// rdar://15300059
+
+
+#define __NSi_7_0 introduced=7.0
+#define __NSi_6_0 introduced=6.0
+
+#define CF_AVAILABLE(_mac, _ios) __attribute__((availability(ios,__NSi_##_ios)))
+#define CF_AVAILABLE_MAC(_mac) __attribute__((availability(macosx,__NSi_##_mac)))
+#define CF_AVAILABLE_IOS(_ios) __attribute__((availability(macosx,unavailable)))
+
+#define NS_AVAILABLE(_mac, _ios) CF_AVAILABLE(_mac, _ios)
+#define NS_AVAILABLE_MAC(_mac) CF_AVAILABLE_MAC(_mac)
+#define NS_AVAILABLE_IOS(_ios) CF_AVAILABLE_IOS(_ios)
+
+#define UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
+
+@interface MKMapItem
+- (MKMapItem *)source NS_AVAILABLE(10_9, 6_0);
+- (void)setSource:(MKMapItem *)source NS_AVAILABLE(10_9, 7_0);
+
+- (void)setDest:(MKMapItem *)source NS_AVAILABLE(10_9, 6_0);
+- (MKMapItem *)dest NS_AVAILABLE(10_9, 6_0);
+
+- (MKMapItem *)final;
+- (void)setFinal:(MKMapItem *)source;
+
+- (MKMapItem *)total NS_AVAILABLE(10_9, 6_0);
+- (void)setTotal:(MKMapItem *)source;
+
+- (MKMapItem *)comp NS_AVAILABLE(10_9, 6_0);
+- (void)setComp:(MKMapItem *)source UNAVAILABLE;
+
+- (MKMapItem *)tally UNAVAILABLE NS_AVAILABLE(10_9, 6_0);
+- (void)setTally:(MKMapItem *)source UNAVAILABLE NS_AVAILABLE(10_9, 6_0);
+
+- (MKMapItem *)itally NS_AVAILABLE(10_9, 6_0);
+- (void)setItally:(MKMapItem *)source UNAVAILABLE NS_AVAILABLE(10_9, 6_0);
+
+- (MKMapItem *)normal UNAVAILABLE;
+- (void)setNormal:(MKMapItem *)source UNAVAILABLE NS_AVAILABLE(10_9, 6_0);
+@end
+
diff --git a/test/ARCMT/objcmt-property-availability.m.result b/test/ARCMT/objcmt-property-availability.m.result
new file mode 100644
index 000000000000..681f9a99bf55
--- /dev/null
+++ b/test/ARCMT/objcmt-property-availability.m.result
@@ -0,0 +1,43 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-readonly-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+// rdar://15300059
+
+
+#define __NSi_7_0 introduced=7.0
+#define __NSi_6_0 introduced=6.0
+
+#define CF_AVAILABLE(_mac, _ios) __attribute__((availability(ios,__NSi_##_ios)))
+#define CF_AVAILABLE_MAC(_mac) __attribute__((availability(macosx,__NSi_##_mac)))
+#define CF_AVAILABLE_IOS(_ios) __attribute__((availability(macosx,unavailable)))
+
+#define NS_AVAILABLE(_mac, _ios) CF_AVAILABLE(_mac, _ios)
+#define NS_AVAILABLE_MAC(_mac) CF_AVAILABLE_MAC(_mac)
+#define NS_AVAILABLE_IOS(_ios) CF_AVAILABLE_IOS(_ios)
+
+#define UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
+
+@interface MKMapItem
+@property (nonatomic, retain) MKMapItem *source NS_AVAILABLE(10_9, 6_0);
+- (void)setSource:(MKMapItem *)source NS_AVAILABLE(10_9, 7_0);
+
+@property (nonatomic, retain) MKMapItem *dest NS_AVAILABLE(10_9, 6_0);
+
+@property (nonatomic, retain) MKMapItem *final;
+
+@property (nonatomic, retain) MKMapItem *total NS_AVAILABLE(10_9, 6_0);
+- (void)setTotal:(MKMapItem *)source;
+
+- (MKMapItem *)comp NS_AVAILABLE(10_9, 6_0);
+- (void)setComp:(MKMapItem *)source UNAVAILABLE;
+
+@property (nonatomic, retain) MKMapItem *tally UNAVAILABLE NS_AVAILABLE(10_9, 6_0);
+
+- (MKMapItem *)itally NS_AVAILABLE(10_9, 6_0);
+- (void)setItally:(MKMapItem *)source UNAVAILABLE NS_AVAILABLE(10_9, 6_0);
+
+- (MKMapItem *)normal UNAVAILABLE;
+- (void)setNormal:(MKMapItem *)source UNAVAILABLE NS_AVAILABLE(10_9, 6_0);
+@end
+
diff --git a/test/ARCMT/objcmt-property.m b/test/ARCMT/objcmt-property.m
new file mode 100644
index 000000000000..3b77aadb892b
--- /dev/null
+++ b/test/ARCMT/objcmt-property.m
@@ -0,0 +1,237 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fblocks -objcmt-migrate-readwrite-property -objcmt-migrate-readonly-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+#define WEBKIT_OBJC_METHOD_ANNOTATION(ANNOTATION) ANNOTATION
+#define WEAK_IMPORT_ATTRIBUTE __attribute__((objc_arc_weak_reference_unavailable))
+#define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER
+#define DEPRECATED __attribute__((deprecated))
+
+typedef char BOOL;
+@class NSString;
+@protocol NSCopying @end
+
+@interface NSObject <NSCopying>
+@end
+
+@interface NSDictionary : NSObject
+@end
+
+@interface I : NSObject {
+ int ivarVal;
+}
+- (void) setWeakProp : (NSString *__weak)Val;
+- (NSString *__weak) WeakProp;
+
+- (NSString *) StrongProp;
+- (void) setStrongProp : (NSString *)Val;
+
+- (NSString *) UnavailProp __attribute__((unavailable));
+- (void) setUnavailProp : (NSString *)Val;
+
+- (NSString *) UnavailProp1 __attribute__((unavailable));
+- (void) setUnavailProp1 : (NSString *)Val __attribute__((unavailable));
+
+- (NSString *) UnavailProp2;
+- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
+
+- (NSDictionary*) undoAction;
+- (void) setUndoAction: (NSDictionary*)Arg;
+@end
+
+@implementation I
+@end
+
+@class NSArray;
+
+@interface MyClass2 {
+@private
+ NSArray *_names1;
+ NSArray *_names2;
+ NSArray *_names3;
+ NSArray *_names4;
+}
+- (void)setNames1:(NSArray *)names;
+- (void)setNames4:(__strong NSArray *)names;
+- (void)setNames3:(__strong NSArray *)names;
+- (void)setNames2:(NSArray *)names;
+- (NSArray *) names2;
+- (NSArray *)names3;
+- (__strong NSArray *)names4;
+- (NSArray *) names1;
+@end
+
+// Properties that contain the name "delegate" or "dataSource",
+// or have exact name "target" have unsafe_unretained attribute.
+@interface NSInvocation
+- (id)target;
+- (void)setTarget:(id)target;
+
+- (id) dataSource;
+
+- (id)xxxdelegateYYY;
+- (void)setXxxdelegateYYY:(id)delegate;
+
+- (void)setDataSource:(id)source;
+
+- (id)MYtarget;
+- (void)setMYtarget: (id)target;
+
+- (id)targetX;
+- (void)setTargetX: (id)t;
+
+- (int)value;
+- (void)setValue: (int)val;
+
+-(BOOL) isContinuous;
+-(void) setContinuous:(BOOL)value;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+- (int) Length;
+- (id) object;
++ (double) D;
+- (void *)JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
+- (BOOL)isIgnoringInteractionEvents;
+
+- (NSString *)getStringValue;
+- (BOOL)getCounterValue;
+- (void)setStringValue:(NSString *)stringValue AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
+- (NSDictionary *)getns_dixtionary;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+- (BOOL) getM;
+- (BOOL) getMA;
+- (BOOL) getALL;
+- (BOOL) getMANY;
+- (BOOL) getSome;
+@end
+
+
+@interface NSInvocation(CAT)
+- (id)target;
+- (void)setTarget:(id)target;
+
+- (id) dataSource;
+
+- (id)xxxdelegateYYY;
+- (void)setXxxdelegateYYY:(id)delegate;
+
+- (void)setDataSource:(id)source;
+
+- (id)MYtarget;
+- (void)setMYtarget: (id)target;
+
+- (id)targetX;
+- (void)setTargetX: (id)t;
+
+- (int)value;
+- (void)setValue: (int)val;
+
+-(BOOL) isContinuous;
+-(void) setContinuous:(BOOL)value;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+- (int) Length;
+- (id) object;
++ (double) D;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+- (BOOL) getM;
+- (BOOL) getMA;
+- (BOOL) getALL;
+- (BOOL) getMANY;
+- (BOOL) getSome;
+@end
+
+DEPRECATED
+@interface I_DEP
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+@end
+
+@interface AnotherOne
+- (BOOL) isinValid DEPRECATED;
+- (void) setInValid : (BOOL) arg;
+- (id)MYtarget;
+- (void)setMYtarget: (id)target DEPRECATED;
+- (BOOL) getM DEPRECATED;
+
+- (id)xxxdelegateYYY DEPRECATED;
+- (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
+@end
+
+// rdar://14987909
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+#define NORETURN __attribute__((noreturn))
+#define ALIGNED __attribute__((aligned(16)))
+
+@interface NSURL
+// Do not infer a property.
+- (NSURL *)appStoreReceiptURL NS_AVAILABLE;
+- (void) setAppStoreReceiptURL : (NSURL *)object;
+
+- (NSURL *)appStoreReceiptURLX NS_AVAILABLE;
+- (void) setAppStoreReceiptURLX : (NSURL *)object NS_AVAILABLE;
+
+// Do not infer a property.
+- (NSURL *)appStoreReceiptURLY ;
+- (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
+
+- (id)OkToInfer NS_AVAILABLE;
+
+// Do not infer a property.
+- (NSURL *)appStoreReceiptURLZ ;
+- (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
+
+// Do not infer a property.
+- (id) t1 NORETURN NS_AVAILABLE;
+- (void) setT1 : (id) arg NS_AVAILABLE;
+
+- (id)method1 ALIGNED NS_AVAILABLE;
+- (void) setMethod1 : (id) object NS_AVAILABLE ALIGNED;
+
+- (NSURL *)init; // No Change
++ (id)alloc; // No Change
+
+- (BOOL)is1stClass; // Not a valid property
+- (BOOL)isClass; // This is a valid property 'class' is not a keyword in ObjC
+- (BOOL)isDouble; // Not a valid property
+
+@end
+
+// rdar://15082818
+@class NSMutableDictionary;
+
+@interface NSArray
+- (id (^)(id, NSArray *, NSMutableDictionary *)) expressionBlock;
+- (id (^)(id, NSArray *, NSMutableDictionary *)) MyBlock;
+- (void) setMyBlock : (id (^)(id, NSArray *, NSMutableDictionary *)) bl;
+- (id (*)(id, NSArray *, NSMutableDictionary *)) expressionFuncptr;
+- (id (*)(id, NSArray *, NSMutableDictionary *)) MyFuncptr;
+- (void) setMyFuncptr : (id (*)(id, NSArray *, NSMutableDictionary *)) bl;
+@end
+
+// rdar://15231241
+@interface rdar15231241
+@property (nonatomic, readonly) double Ddelegate;
+@property (nonatomic, readonly) float Fdelegate;
+@property (nonatomic, readonly) int Idelegate;
+@property (nonatomic, readonly) BOOL Bdelegate;
+@end
diff --git a/test/ARCMT/objcmt-property.m.result b/test/ARCMT/objcmt-property.m.result
new file mode 100644
index 000000000000..c6380c80523f
--- /dev/null
+++ b/test/ARCMT/objcmt-property.m.result
@@ -0,0 +1,210 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fblocks -objcmt-migrate-readwrite-property -objcmt-migrate-readonly-property -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+#define WEBKIT_OBJC_METHOD_ANNOTATION(ANNOTATION) ANNOTATION
+#define WEAK_IMPORT_ATTRIBUTE __attribute__((objc_arc_weak_reference_unavailable))
+#define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER
+#define DEPRECATED __attribute__((deprecated))
+
+typedef char BOOL;
+@class NSString;
+@protocol NSCopying @end
+
+@interface NSObject <NSCopying>
+@end
+
+@interface NSDictionary : NSObject
+@end
+
+@interface I : NSObject {
+ int ivarVal;
+}
+@property (nonatomic, weak) NSString *WeakProp;
+
+@property (nonatomic, retain) NSString *StrongProp;
+
+@property (nonatomic, retain) NSString *UnavailProp __attribute__((unavailable));
+- (void) setUnavailProp : (NSString *)Val;
+
+@property (nonatomic, retain) NSString *UnavailProp1 __attribute__((unavailable));
+
+@property (nonatomic, retain) NSString *UnavailProp2;
+- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
+
+@property (nonatomic, copy) NSDictionary *undoAction;
+@end
+
+@implementation I
+@end
+
+@class NSArray;
+
+@interface MyClass2 {
+@private
+ NSArray *_names1;
+ NSArray *_names2;
+ NSArray *_names3;
+ NSArray *_names4;
+}
+@property (nonatomic, retain) NSArray *names2;
+@property (nonatomic, retain) NSArray *names3;
+@property (nonatomic, retain) NSArray *names4;
+@property (nonatomic, retain) NSArray *names1;
+@end
+
+// Properties that contain the name "delegate" or "dataSource",
+// or have exact name "target" have unsafe_unretained attribute.
+@interface NSInvocation
+@property (nonatomic, assign) id target;
+
+@property (nonatomic, assign) id dataSource;
+
+@property (nonatomic, assign) id xxxdelegateYYY;
+
+
+@property (nonatomic, retain) id MYtarget;
+
+@property (nonatomic, retain) id targetX;
+
+@property (nonatomic) int value;
+
+@property (nonatomic, getter=isContinuous) BOOL continuous;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+@property (nonatomic, getter=isinValid, readonly) BOOL inValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+@property (nonatomic, readonly) int Length;
+@property (nonatomic, readonly, retain) id object;
++ (double) D;
+@property (nonatomic, readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
+@property (nonatomic, getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents;
+
+@property (nonatomic, getter=getStringValue, retain) NSString *stringValue;
+@property (nonatomic, getter=getCounterValue, readonly) BOOL counterValue;
+@property (nonatomic, getter=getns_dixtionary, readonly, retain) NSDictionary *ns_dixtionary;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+@property (nonatomic, getter=getM, readonly) BOOL m;
+@property (nonatomic, getter=getMA, readonly) BOOL MA;
+@property (nonatomic, getter=getALL, readonly) BOOL ALL;
+@property (nonatomic, getter=getMANY, readonly) BOOL MANY;
+@property (nonatomic, getter=getSome, readonly) BOOL some;
+@end
+
+
+@interface NSInvocation(CAT)
+@property (nonatomic, assign) id target;
+
+@property (nonatomic, assign) id dataSource;
+
+@property (nonatomic, assign) id xxxdelegateYYY;
+
+
+@property (nonatomic, retain) id MYtarget;
+
+@property (nonatomic, retain) id targetX;
+
+@property (nonatomic) int value;
+
+@property (nonatomic, getter=isContinuous) BOOL continuous;
+
+- (id) isAnObject;
+- (void)setAnObject : (id) object;
+
+@property (nonatomic, getter=isinValid, readonly) BOOL inValid;
+- (void) setInValid : (BOOL) arg;
+
+- (void) Nothing;
+@property (nonatomic, readonly) int Length;
+@property (nonatomic, readonly, retain) id object;
++ (double) D;
+
+- (BOOL)is3bar; // watch out
+- (NSString *)get3foo; // watch out
+
+@property (nonatomic, getter=getM, readonly) BOOL m;
+@property (nonatomic, getter=getMA, readonly) BOOL MA;
+@property (nonatomic, getter=getALL, readonly) BOOL ALL;
+@property (nonatomic, getter=getMANY, readonly) BOOL MANY;
+@property (nonatomic, getter=getSome, readonly) BOOL some;
+@end
+
+DEPRECATED
+@interface I_DEP
+- (BOOL) isinValid;
+- (void) setInValid : (BOOL) arg;
+@end
+
+@interface AnotherOne
+- (BOOL) isinValid DEPRECATED;
+- (void) setInValid : (BOOL) arg;
+- (id)MYtarget;
+- (void)setMYtarget: (id)target DEPRECATED;
+- (BOOL) getM DEPRECATED;
+
+- (id)xxxdelegateYYY DEPRECATED;
+- (void)setXxxdelegateYYY:(id)delegate DEPRECATED;
+@end
+
+// rdar://14987909
+#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0)))
+#define NORETURN __attribute__((noreturn))
+#define ALIGNED __attribute__((aligned(16)))
+
+@interface NSURL
+// Do not infer a property.
+@property (nonatomic, retain) NSURL *appStoreReceiptURL NS_AVAILABLE;
+- (void) setAppStoreReceiptURL : (NSURL *)object;
+
+@property (nonatomic, retain) NSURL *appStoreReceiptURLX NS_AVAILABLE;
+
+// Do not infer a property.
+@property (nonatomic, retain) NSURL *appStoreReceiptURLY ;
+- (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
+
+@property (nonatomic, readonly, retain) id OkToInfer NS_AVAILABLE;
+
+// Do not infer a property.
+@property (nonatomic, retain) NSURL *appStoreReceiptURLZ ;
+- (void) setAppStoreReceiptURLZ : (NSURL *)object NS_AVAILABLE;
+
+// Do not infer a property.
+- (id) t1 NORETURN NS_AVAILABLE;
+- (void) setT1 : (id) arg NS_AVAILABLE;
+
+@property (nonatomic, retain) id method1 ALIGNED NS_AVAILABLE;
+
+- (NSURL *)init; // No Change
++ (id)alloc; // No Change
+
+- (BOOL)is1stClass; // Not a valid property
+@property (nonatomic, getter=isClass, readonly) BOOL class; // This is a valid property 'class' is not a keyword in ObjC
+- (BOOL)isDouble; // Not a valid property
+
+@end
+
+// rdar://15082818
+@class NSMutableDictionary;
+
+@interface NSArray
+@property (nonatomic, readonly, copy) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *);
+@property (nonatomic, copy) id (^MyBlock)(id, NSArray *, NSMutableDictionary *);
+@property (nonatomic, readonly) id (*expressionFuncptr)(id, NSArray *, NSMutableDictionary *);
+@property (nonatomic) id (*MyFuncptr)(id, NSArray *, NSMutableDictionary *);
+@end
+
+// rdar://15231241
+@interface rdar15231241
+@property (nonatomic, readonly) double Ddelegate;
+@property (nonatomic, readonly) float Fdelegate;
+@property (nonatomic, readonly) int Idelegate;
+@property (nonatomic, readonly) BOOL Bdelegate;
+@end
diff --git a/test/ARCMT/objcmt-protocol-conformance.m b/test/ARCMT/objcmt-protocol-conformance.m
new file mode 100644
index 000000000000..7bc7d938177f
--- /dev/null
+++ b/test/ARCMT/objcmt-protocol-conformance.m
@@ -0,0 +1,114 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-protocol-conformance -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+@interface NSObject @end
+
+@protocol P
+- (id) Meth1: (double) arg;
+@end
+
+@interface Test1 // Test for no super class and no protocol list
+@end
+
+@implementation Test1
+- (id) Meth1: (double) arg { return 0; }
+@end
+
+@protocol P1 @end
+@protocol P2 @end
+
+@interface Test2 <P1, P2> // Test for no super class and with protocol list
+{
+ id IVAR1;
+ id IVAR2;
+}
+@end
+
+@implementation Test2
+- (id) Meth1: (double) arg { return 0; }
+@end
+
+@interface Test3 : NSObject { // Test for Super class and no protocol list
+ id IV1;
+}
+@end
+
+@implementation Test3
+- (id) Meth1: (double) arg { return 0; }
+@end
+
+@interface Test4 : NSObject <P1, P2> // Test for Super class and protocol list
+@end
+
+@implementation Test4
+- (id) Meth1: (double) arg { return 0; }
+@end
+
+// Test5 - conforms to P3 because it implement's P3's property.
+@protocol P3
+@property (copy) id Prop;
+@end
+
+@protocol P4
+@property (copy) id Prop;
+@end
+
+@interface Test5 : NSObject<P3>
+@end
+
+@implementation Test5
+@synthesize Prop=_XXX;
+@end
+
+@protocol P5 <P3, P4>
+@property (copy) id Prop;
+@end
+
+@protocol P6 <P3, P4, P5>
+@property (copy) id Prop;
+@end
+
+@interface Test6 : NSObject // Test for minimal listing of conforming protocols
+@property (copy) id Prop;
+@end
+
+@implementation Test6
+@end
+
+@class UIDynamicAnimator, UIWindow;
+@interface UIResponder : NSObject
+@end
+
+@protocol EmptyProtocol
+@end
+
+@protocol OptionalMethodsOnly
+@optional
+- (void)dynamicAnimatorWillResume:(UIDynamicAnimator*)animator;
+- (void)dynamicAnimatorDidPause:(UIDynamicAnimator*)animator;
+@end
+
+@protocol OptionalPropertiesOnly
+@optional
+@property (strong, nonatomic) id OptionalProperty;
+@end
+
+@protocol OptionalEvrything
+@optional
+- (void)dynamicAnimatorWillResume:(UIDynamicAnimator*)animator;
+@property (strong, nonatomic) id OptionalProperty;
+- (void)dynamicAnimatorDidPause:(UIDynamicAnimator*)animator;
+@end
+
+@protocol UIApplicationDelegate
+@end
+
+@interface Test7 : UIResponder <UIApplicationDelegate>
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+@implementation Test7
+@end
+
diff --git a/test/ARCMT/objcmt-protocol-conformance.m.result b/test/ARCMT/objcmt-protocol-conformance.m.result
new file mode 100644
index 000000000000..dc0874c88f22
--- /dev/null
+++ b/test/ARCMT/objcmt-protocol-conformance.m.result
@@ -0,0 +1,114 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-protocol-conformance -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
+// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
+
+@interface NSObject @end
+
+@protocol P
+- (id) Meth1: (double) arg;
+@end
+
+@interface Test1<P> // Test for no super class and no protocol list
+@end
+
+@implementation Test1
+- (id) Meth1: (double) arg { return 0; }
+@end
+
+@protocol P1 @end
+@protocol P2 @end
+
+@interface Test2 <P1, P2, P> // Test for no super class and with protocol list
+{
+ id IVAR1;
+ id IVAR2;
+}
+@end
+
+@implementation Test2
+- (id) Meth1: (double) arg { return 0; }
+@end
+
+@interface Test3 : NSObject<P> { // Test for Super class and no protocol list
+ id IV1;
+}
+@end
+
+@implementation Test3
+- (id) Meth1: (double) arg { return 0; }
+@end
+
+@interface Test4 : NSObject <P1, P2, P> // Test for Super class and protocol list
+@end
+
+@implementation Test4
+- (id) Meth1: (double) arg { return 0; }
+@end
+
+// Test5 - conforms to P3 because it implement's P3's property.
+@protocol P3
+@property (copy) id Prop;
+@end
+
+@protocol P4
+@property (copy) id Prop;
+@end
+
+@interface Test5 : NSObject<P3, P4>
+@end
+
+@implementation Test5
+@synthesize Prop=_XXX;
+@end
+
+@protocol P5 <P3, P4>
+@property (copy) id Prop;
+@end
+
+@protocol P6 <P3, P4, P5>
+@property (copy) id Prop;
+@end
+
+@interface Test6 : NSObject<P6> // Test for minimal listing of conforming protocols
+@property (copy) id Prop;
+@end
+
+@implementation Test6
+@end
+
+@class UIDynamicAnimator, UIWindow;
+@interface UIResponder : NSObject
+@end
+
+@protocol EmptyProtocol
+@end
+
+@protocol OptionalMethodsOnly
+@optional
+- (void)dynamicAnimatorWillResume:(UIDynamicAnimator*)animator;
+- (void)dynamicAnimatorDidPause:(UIDynamicAnimator*)animator;
+@end
+
+@protocol OptionalPropertiesOnly
+@optional
+@property (strong, nonatomic) id OptionalProperty;
+@end
+
+@protocol OptionalEvrything
+@optional
+- (void)dynamicAnimatorWillResume:(UIDynamicAnimator*)animator;
+@property (strong, nonatomic) id OptionalProperty;
+- (void)dynamicAnimatorDidPause:(UIDynamicAnimator*)animator;
+@end
+
+@protocol UIApplicationDelegate
+@end
+
+@interface Test7 : UIResponder <UIApplicationDelegate>
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+@implementation Test7
+@end
+
diff --git a/test/ARCMT/verify.m b/test/ARCMT/verify.m
index bfb3b4b8ab55..02f7fccc6899 100644
--- a/test/ARCMT/verify.m
+++ b/test/ARCMT/verify.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -arcmt-check -verify %s
-// RUN: %clang_cc1 -arcmt-check -verify %t.invalid 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -arcmt-check -verify %t.invalid 2>&1 | FileCheck %s
#if 0
// expected-error {{should be ignored}}
diff --git a/test/ARCMT/whitelisted/Inputs/header1.h b/test/ARCMT/whitelisted/Inputs/header1.h
new file mode 100644
index 000000000000..44430f3b77e3
--- /dev/null
+++ b/test/ARCMT/whitelisted/Inputs/header1.h
@@ -0,0 +1 @@
+// the contents are not important
diff --git a/test/ARCMT/whitelisted/header1.h b/test/ARCMT/whitelisted/header1.h
new file mode 100644
index 000000000000..a3014eb5b653
--- /dev/null
+++ b/test/ARCMT/whitelisted/header1.h
@@ -0,0 +1,5 @@
+
+@interface I1 : NSObject
+-(int)prop;
+-(void)setProp:(int)p;
+@end
diff --git a/test/ARCMT/whitelisted/header1.h.result b/test/ARCMT/whitelisted/header1.h.result
new file mode 100644
index 000000000000..7808fc8a6a3f
--- /dev/null
+++ b/test/ARCMT/whitelisted/header1.h.result
@@ -0,0 +1,4 @@
+
+@interface I1 : NSObject
+@property (nonatomic) int prop;
+@end
diff --git a/test/ARCMT/whitelisted/header2.h b/test/ARCMT/whitelisted/header2.h
new file mode 100644
index 000000000000..c7577ede4a49
--- /dev/null
+++ b/test/ARCMT/whitelisted/header2.h
@@ -0,0 +1,5 @@
+
+@interface I2 : NSObject
+-(int)prop;
+-(void)setProp:(int)p;
+@end
diff --git a/test/ARCMT/whitelisted/header2.h.result b/test/ARCMT/whitelisted/header2.h.result
new file mode 100644
index 000000000000..b1b52707118e
--- /dev/null
+++ b/test/ARCMT/whitelisted/header2.h.result
@@ -0,0 +1,4 @@
+
+@interface I2 : NSObject
+@property (nonatomic) int prop;
+@end
diff --git a/test/ARCMT/whitelisted/objcmt-with-whitelist.m b/test/ARCMT/whitelisted/objcmt-with-whitelist.m
new file mode 100644
index 000000000000..1b44c9a6d9fe
--- /dev/null
+++ b/test/ARCMT/whitelisted/objcmt-with-whitelist.m
@@ -0,0 +1,12 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-readwrite-property %s -triple x86_64-apple-darwin11 -migrate -o %t.remap
+// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result %S/header2.h.result
+// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap
+// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result
+
+@interface NSObject
++ (id)alloc;
+@end
+
+#include "header1.h"
+#include "header2.h"
diff --git a/test/ARCMT/with-arc-mode-check.m b/test/ARCMT/with-arc-mode-check.m
deleted file mode 100644
index 33f31f522a58..000000000000
--- a/test/ARCMT/with-arc-mode-check.m
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %clang_cc1 -arcmt-check -fsyntax-only -fobjc-arc -x objective-c %s
-
-@protocol NSObject
-- (oneway void)release;
-@end
-
-void test1(id p) {
- [p release];
-}
diff --git a/test/ARCMT/with-arc-mode-migrate.m b/test/ARCMT/with-arc-mode-migrate.m
deleted file mode 100644
index 468859478eb0..000000000000
--- a/test/ARCMT/with-arc-mode-migrate.m
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: rm -rf %t
-// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -x objective-c %s.result
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t -fsyntax-only -fobjc-arc %s
-// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
-// RUN: rm -rf %t
-
-@protocol NSObject
-- (oneway void)release;
-@end
-
-void test1(id p) {
- [p release];
-}
diff --git a/test/ARCMT/with-arc-mode-migrate.m.result b/test/ARCMT/with-arc-mode-migrate.m.result
deleted file mode 100644
index dd34b9990878..000000000000
--- a/test/ARCMT/with-arc-mode-migrate.m.result
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: rm -rf %t
-// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -x objective-c %s.result
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t -fsyntax-only -fobjc-arc %s
-// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
-// RUN: rm -rf %t
-
-@protocol NSObject
-- (oneway void)release;
-@end
-
-void test1(id p) {
-}
diff --git a/test/ASTMerge/Inputs/lit.local.cfg b/test/ASTMerge/Inputs/lit.local.cfg
deleted file mode 100644
index e6f55eef7af5..000000000000
--- a/test/ASTMerge/Inputs/lit.local.cfg
+++ /dev/null
@@ -1 +0,0 @@
-config.suffixes = []
diff --git a/test/ASTMerge/category.m b/test/ASTMerge/category.m
index 54a12408c480..c7d524816494 100644
--- a/test/ASTMerge/category.m
+++ b/test/ASTMerge/category.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/category1.m
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/category2.m
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
// CHECK: category2.m:18:1: error: instance method 'method2' has incompatible result types in different translation units ('float' vs. 'int')
// CHECK: category1.m:16:1: note: instance method 'method2' also declared here
diff --git a/test/ASTMerge/class-template.cpp b/test/ASTMerge/class-template.cpp
index eea31b1c2feb..0ab5443db7f6 100644
--- a/test/ASTMerge/class-template.cpp
+++ b/test/ASTMerge/class-template.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/class-template1.cpp
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/class-template2.cpp
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
// CHECK: class-template1.cpp:7:14: error: non-type template parameter declared with incompatible types in different translation units ('int' vs. 'long')
// CHECK: class-template2.cpp:7:15: note: declared here with type 'long'
diff --git a/test/ASTMerge/class.cpp b/test/ASTMerge/class.cpp
index 885b65e983a0..7b31187c469e 100644
--- a/test/ASTMerge/class.cpp
+++ b/test/ASTMerge/class.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/class1.cpp
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/class2.cpp
// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 -Wno-odr | count 0
+// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 -Wno-odr -Werror
// CHECK: class1.cpp:5:8: warning: type 'B' has incompatible definitions in different translation units
// CHECK: class1.cpp:6:9: note: field 'y' has type 'float' here
diff --git a/test/ASTMerge/enum.c b/test/ASTMerge/enum.c
index 4380d192f1bd..7240bcced99e 100644
--- a/test/ASTMerge/enum.c
+++ b/test/ASTMerge/enum.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/enum1.c
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/enum2.c
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
// CHECK: enum1.c:9:6: warning: type 'enum E2' has incompatible definitions in different translation units
// CHECK: enum1.c:11:3: note: enumerator 'E2Enumerator2' with value 3 here
diff --git a/test/ASTMerge/function.c b/test/ASTMerge/function.c
index 8a8a03051452..89e1c699c3aa 100644
--- a/test/ASTMerge/function.c
+++ b/test/ASTMerge/function.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/function1.c
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/function2.c
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only -verify %s
// CHECK: function2.c:3:6: error: external function 'f1' declared with incompatible types in different translation units ('void (Int, double)' vs. 'void (int, float)')
diff --git a/test/ASTMerge/interface.m b/test/ASTMerge/interface.m
index 747ef38223ec..8ba5d73753a3 100644
--- a/test/ASTMerge/interface.m
+++ b/test/ASTMerge/interface.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/interface1.m
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/interface2.m
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
// CHECK: interface2.m:16:9: error: instance variable 'ivar2' declared with incompatible types in different translation units ('float' vs. 'int')
// CHECK: interface1.m:16:7: note: declared here with type 'int'
diff --git a/test/ASTMerge/namespace.cpp b/test/ASTMerge/namespace.cpp
index 6c46f0aa1d98..8cc0fa2a6d97 100644
--- a/test/ASTMerge/namespace.cpp
+++ b/test/ASTMerge/namespace.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/namespace1.cpp
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/namespace2.cpp
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
// CHECK: namespace2.cpp:16:17: error: external variable 'z' declared with incompatible types in different translation units ('double' vs. 'float')
// CHECK: namespace1.cpp:16:16: note: declared here with type 'float'
diff --git a/test/ASTMerge/property.m b/test/ASTMerge/property.m
index a8dd7c420c89..494802347696 100644
--- a/test/ASTMerge/property.m
+++ b/test/ASTMerge/property.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/property1.m
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/property2.m
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
// CHECK: property2.m:12:26: error: property 'Prop1' declared with incompatible types in different translation units ('int' vs. 'float')
// CHECK: property1.m:10:28: note: declared here with type 'float'
diff --git a/test/ASTMerge/struct.c b/test/ASTMerge/struct.c
index 7217222ae5c1..4f41cea26b18 100644
--- a/test/ASTMerge/struct.c
+++ b/test/ASTMerge/struct.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/struct1.c
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/struct2.c
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
// CHECK: struct1.c:13:8: warning: type 'struct S1' has incompatible definitions in different translation units
// CHECK: struct1.c:15:7: note: field 'field2' has type 'int' here
diff --git a/test/ASTMerge/typedef.c b/test/ASTMerge/typedef.c
index 6f911295b96c..79e472311874 100644
--- a/test/ASTMerge/typedef.c
+++ b/test/ASTMerge/typedef.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/typedef1.c
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/typedef2.c
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
// CHECK: typedef2.c:4:10: error: external variable 'x2' declared with incompatible types in different translation units ('Typedef2' (aka 'double') vs. 'Typedef2' (aka 'int'))
// CHECK: typedef1.c:4:10: note: declared here with type 'Typedef2' (aka 'int')
diff --git a/test/ASTMerge/var.c b/test/ASTMerge/var.c
index e1dde6abd2ac..e14dc37edac7 100644
--- a/test/ASTMerge/var.c
+++ b/test/ASTMerge/var.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/var1.c
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/var2.c
-// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s
// CHECK: var2.c:2:9: error: external variable 'x1' declared with incompatible types in different translation units ('double *' vs. 'float **')
// CHECK: var1.c:2:9: note: declared here with type 'float **'
diff --git a/test/Analysis/Inputs/system-header-simulator-cxx.h b/test/Analysis/Inputs/system-header-simulator-cxx.h
index 6e434a04b23d..9bb8ec48923d 100644
--- a/test/Analysis/Inputs/system-header-simulator-cxx.h
+++ b/test/Analysis/Inputs/system-header-simulator-cxx.h
@@ -5,6 +5,8 @@
// suppressed.
#pragma clang system_header
+typedef unsigned char uint8_t;
+
namespace std {
template <class T1, class T2>
struct pair {
@@ -74,6 +76,34 @@ namespace std {
extern const nothrow_t nothrow;
+ // libc++'s implementation
+ template <class _E>
+ class initializer_list
+ {
+ const _E* __begin_;
+ size_t __size_;
+
+ initializer_list(const _E* __b, size_t __s)
+ : __begin_(__b),
+ __size_(__s)
+ {}
+
+ public:
+ typedef _E value_type;
+ typedef const _E& reference;
+ typedef const _E& const_reference;
+ typedef size_t size_type;
+
+ typedef const _E* iterator;
+ typedef const _E* const_iterator;
+
+ initializer_list() : __begin_(0), __size_(0) {}
+
+ size_t size() const {return __size_;}
+ const _E* begin() const {return __begin_;}
+ const _E* end() const {return __begin_ + __size_;}
+ };
+
template<class InputIter, class OutputIter>
OutputIter copy(InputIter II, InputIter IE, OutputIter OI) {
while (II != IE)
@@ -86,6 +116,65 @@ namespace std {
struct forward_iterator_tag : public input_iterator_tag { };
struct bidirectional_iterator_tag : public forward_iterator_tag { };
struct random_access_iterator_tag : public bidirectional_iterator_tag { };
+
+ template <class _Tp>
+ class allocator {
+ public:
+ void deallocate(void *p) {
+ ::delete p;
+ }
+ };
+
+ template <class _Alloc>
+ class allocator_traits {
+ public:
+ static void deallocate(void *p) {
+ _Alloc().deallocate(p);
+ }
+ };
+
+ template <class _Tp, class _Alloc>
+ class __list_imp
+ {};
+
+ template <class _Tp, class _Alloc = allocator<_Tp> >
+ class list
+ : private __list_imp<_Tp, _Alloc>
+ {
+ public:
+ void pop_front() {
+ // Fake use-after-free.
+ // No warning is expected as we are suppressing warning comming
+ // out of std::list.
+ int z = 0;
+ z = 5/z;
+ }
+ bool empty() const;
+ };
+
+ // basic_string
+ template<class _CharT, class _Alloc = allocator<_CharT> >
+ class __attribute__ ((__type_visibility__("default"))) basic_string {
+ _CharT localStorage[4];
+
+ typedef allocator_traits<_Alloc> __alloc_traits;
+
+ public:
+ void push_back(int c) {
+ // Fake error trigger.
+ // No warning is expected as we are suppressing warning comming
+ // out of std::basic_string.
+ int z = 0;
+ z = 5/z;
+ }
+
+ basic_string &operator +=(int c) {
+ // Fake deallocate stack-based storage.
+ // No warning is expected as we are suppressing warnings within
+ // allocators being used by std::basic_string.
+ __alloc_traits::deallocate(&localStorage);
+ }
+ };
}
void* operator new(std::size_t, const std::nothrow_t&) throw();
diff --git a/test/Analysis/Inputs/system-header-simulator-objc.h b/test/Analysis/Inputs/system-header-simulator-objc.h
index ecc99e17c495..3e1d9555bbde 100644
--- a/test/Analysis/Inputs/system-header-simulator-objc.h
+++ b/test/Analysis/Inputs/system-header-simulator-objc.h
@@ -102,6 +102,7 @@ typedef double NSTimeInterval;
+ (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length;
- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
+- (id)initWithBytes:(void *)bytes length:(NSUInteger) length;
@end
typedef struct {
diff --git a/test/Analysis/Inputs/system-header-simulator.h b/test/Analysis/Inputs/system-header-simulator.h
index dd1cd4942f85..8b8c9c4fe17b 100644
--- a/test/Analysis/Inputs/system-header-simulator.h
+++ b/test/Analysis/Inputs/system-header-simulator.h
@@ -32,6 +32,7 @@ typedef __typeof(sizeof(int)) size_t;
size_t strlen(const char *);
char *strcpy(char *restrict, const char *restrict);
+void *memcpy(void *dst, const void *src, size_t n);
typedef unsigned long __darwin_pthread_key_t;
typedef __darwin_pthread_key_t pthread_key_t;
@@ -77,8 +78,9 @@ void xpc_connection_set_context(xpc_connection_t connection, void *context);
void xpc_connection_set_finalizer_f(xpc_connection_t connection, xpc_finalizer_t finalizer);
void xpc_connection_resume(xpc_connection_t connection);
-//The following is a fake system header function
+//The following are fake system header functions for generic testing.
void fakeSystemHeaderCallInt(int *);
+void fakeSystemHeaderCallIntPtr(int **);
typedef struct __SomeStruct {
char * p;
diff --git a/test/Analysis/MismatchedDeallocator-checker-test.mm b/test/Analysis/MismatchedDeallocator-checker-test.mm
index 56d46d99b0b9..0df5db5191f5 100644
--- a/test/Analysis/MismatchedDeallocator-checker-test.mm
+++ b/test/Analysis/MismatchedDeallocator-checker-test.mm
@@ -112,8 +112,7 @@ void testNew10() {
void testNew11(NSUInteger dataLength) {
int *p = new int;
- NSData *d = [NSData dataWithBytesNoCopy:p length:sizeof(int) freeWhenDone:1]; // expected-warning{{Memory allocated by 'new' should be deallocated by 'delete', not +dataWithBytesNoCopy:length:freeWhenDone:}}
- // FIXME: should be "+dataWithBytesNoCopy:length:freeWhenDone: cannot take ownership of memory allocated by 'new'."
+ NSData *d = [NSData dataWithBytesNoCopy:p length:sizeof(int) freeWhenDone:1]; // expected-warning{{+dataWithBytesNoCopy:length:freeWhenDone: cannot take ownership of memory allocated by 'new'}}
}
//-------------------------------------------------------
diff --git a/test/Analysis/MismatchedDeallocator-path-notes.cpp b/test/Analysis/MismatchedDeallocator-path-notes.cpp
index 369d8f69756a..61ab4f1eeb5a 100644
--- a/test/Analysis/MismatchedDeallocator-path-notes.cpp
+++ b/test/Analysis/MismatchedDeallocator-path-notes.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=text -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=plist %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
void changePointee(int *p);
diff --git a/test/Analysis/NSContainers.m b/test/Analysis/NSContainers.m
index 540c7a4eabdd..a9e76fbbcaba 100644
--- a/test/Analysis/NSContainers.m
+++ b/test/Analysis/NSContainers.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NilArg -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NonNilReturnValue,osx.cocoa.NilArg,osx.cocoa.Loops -verify -Wno-objc-root-class %s
typedef unsigned long NSUInteger;
typedef signed char BOOL;
typedef struct _NSZone NSZone;
@@ -14,8 +14,6 @@ typedef struct _NSZone NSZone;
@protocol NSCoding
- (void)encodeWithCoder:(NSCoder *)aCoder;
@end
-@protocol NSFastEnumeration
-@end
@protocol NSSecureCoding <NSCoding>
@required
+ (BOOL)supportsSecureCoding;
@@ -24,11 +22,20 @@ typedef struct _NSZone NSZone;
- (id)init;
+ (id)alloc;
@end
-@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
+typedef struct {
+ unsigned long state;
+ id *itemsPtr;
+ unsigned long *mutationsPtr;
+ unsigned long extra[5];
+} NSFastEnumerationState;
+@protocol NSFastEnumeration
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id [])buffer count:(NSUInteger)len;
+@end
+
+@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
- (NSUInteger)count;
- (id)objectAtIndex:(NSUInteger)index;
-
@end
@interface NSArray (NSExtendedArray)
@@ -36,6 +43,10 @@ typedef struct _NSZone NSZone;
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx __attribute__((availability(macosx,introduced=10.8)));
@end
+@interface NSArray (NSArrayCreation)
++ (instancetype)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt;
+@end
+
@interface NSMutableArray : NSArray
- (void)addObject:(id)anObject;
@@ -58,6 +69,8 @@ typedef struct _NSZone NSZone;
+ (id)dictionary;
+ (id)dictionaryWithObject:(id)object forKey:(id <NSCopying>)key;
++ (instancetype)dictionaryWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;
+
@end
@interface NSMutableDictionary : NSDictionary
@@ -77,10 +90,20 @@ typedef struct _NSZone NSZone;
@end
+@interface NSOrderedSet : NSObject <NSFastEnumeration>
+@end
+@interface NSOrderedSet (NSOrderedSetCreation)
+- (NSUInteger)count;
+@end
+
@interface NSString : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
@end
+@interface NSNull : NSObject <NSCopying, NSSecureCoding>
++ (NSNull *)null;
+@end
+
// NSMutableArray API
void testNilArgNSMutableArray1() {
NSMutableArray *marray = [[NSMutableArray alloc] init];
@@ -143,6 +166,33 @@ NSDictionary *testNilArgNSDictionary2(NSObject *obj) {
return [NSDictionary dictionaryWithObject:obj forKey:0]; // expected-warning {{Key argument to 'dictionaryWithObject:forKey:' cannot be nil}}
}
+id testCreateDictionaryLiteralKey(id value, id nilKey) {
+ if (nilKey)
+ ;
+ return @{@"abc":value, nilKey:@"abc"}; // expected-warning {{Dictionary key cannot be nil}}
+}
+
+id testCreateDictionaryLiteralValue(id nilValue) {
+ if (nilValue)
+ ;
+ return @{@"abc":nilValue}; // expected-warning {{Dictionary value cannot be nil}}
+}
+
+id testCreateDictionaryLiteral(id nilValue, id nilKey) {
+ if (nilValue)
+ ;
+ if (nilKey)
+ ;
+ return @{@"abc":nilValue, nilKey:@"abc"}; // expected-warning {{Dictionary key cannot be nil}}
+ // expected-warning@-1 {{Dictionary value cannot be nil}}
+}
+
+id testCreateArrayLiteral(id myNil) {
+ if (myNil)
+ ;
+ return @[ @"a", myNil, @"c" ]; // expected-warning {{Array element cannot be nil}}
+}
+
// Test inline defensive checks suppression.
void idc(id x) {
if (x)
@@ -197,4 +247,32 @@ void testNilReceiverRetNil2(NSMutableDictionary *D, Foo *FooPtrIn, id value) {
[D setObject: value forKey: key]; // no-warning
}
+void testAssumeNSNullNullReturnsNonNil(NSMutableDictionary *Table, id Object,
+ id InValue) {
+ id Value = Object ? [Table objectForKey:Object] : [NSNull null];
+ if (!Value) {
+ Value = InValue;
+ [Table setObject:Value forKey:Object]; // no warning
+ }
+}
+
+void testCollectionIsNotEmptyWhenCountIsGreaterThanZero(NSMutableDictionary *D){
+ if ([D count] > 0) { // Count is greater than zero.
+ NSString *s = 0;
+ for (NSString *key in D) {
+ s = key; // Loop is always entered.
+ }
+ [D removeObjectForKey:s]; // no warning
+ }
+}
+
+void testCountAwareNSOrderedSet(NSOrderedSet *containers, int *validptr) {
+ int *x = 0;
+ NSUInteger containerCount = [containers count];
+ if (containerCount > 0)
+ x = validptr;
+ for (id c in containers) {
+ *x = 1; // no warning
+ }
+}
diff --git a/test/Analysis/NewDelete-checker-test.cpp b/test/Analysis/NewDelete-checker-test.cpp
index 5d134bc36e23..cc9725128bc8 100644
--- a/test/Analysis/NewDelete-checker-test.cpp
+++ b/test/Analysis/NewDelete-checker-test.cpp
@@ -4,6 +4,7 @@
typedef __typeof__(sizeof(int)) size_t;
extern "C" void *malloc(size_t);
+extern "C" void free (void* ptr);
int *global;
//------------------
@@ -206,3 +207,154 @@ void testConstEscapePlacementNew() {
void *y = new (x) int;
escapeVoidPtr(y);
} // no-warning
+
+//============== Test Uninitialized delete delete[]========================
+void testUninitDelete() {
+ int *x;
+ int * y = new int;
+ delete y;
+ delete x; // expected-warning{{Argument to 'delete' is uninitialized}}
+}
+
+void testUninitDeleteArray() {
+ int *x;
+ int * y = new int[5];
+ delete[] y;
+ delete[] x; // expected-warning{{Argument to 'delete[]' is uninitialized}}
+}
+
+void testUninitFree() {
+ int *x;
+ free(x); // expected-warning{{Function call argument is an uninitialized value}}
+}
+
+void testUninitDeleteSink() {
+ int *x;
+ delete x; // expected-warning{{Argument to 'delete' is uninitialized}}
+ (*(volatile int *)0 = 1); // no warn
+}
+
+void testUninitDeleteArraySink() {
+ int *x;
+ delete[] x; // expected-warning{{Argument to 'delete[]' is uninitialized}}
+ (*(volatile int *)0 = 1); // no warn
+}
+
+namespace reference_count {
+ class control_block {
+ unsigned count;
+ public:
+ control_block() : count(0) {}
+ void retain() { ++count; }
+ int release() { return --count; }
+ };
+
+ template <typename T>
+ class shared_ptr {
+ T *p;
+ control_block *control;
+
+ public:
+ shared_ptr() : p(0), control(0) {}
+ explicit shared_ptr(T *p) : p(p), control(new control_block) {
+ control->retain();
+ }
+ shared_ptr(shared_ptr &other) : p(other.p), control(other.control) {
+ if (control)
+ control->retain();
+ }
+ ~shared_ptr() {
+ if (control && control->release() == 0) {
+ delete p;
+ delete control;
+ }
+ };
+
+ T &operator *() {
+ return *p;
+ };
+
+ void swap(shared_ptr &other) {
+ T *tmp = p;
+ p = other.p;
+ other.p = tmp;
+
+ control_block *ctrlTmp = control;
+ control = other.control;
+ other.control = ctrlTmp;
+ }
+ };
+
+ void testSingle() {
+ shared_ptr<int> a(new int);
+ *a = 1;
+ }
+
+ void testDouble() {
+ shared_ptr<int> a(new int);
+ shared_ptr<int> b = a;
+ *a = 1;
+ }
+
+ void testInvalidated() {
+ shared_ptr<int> a(new int);
+ shared_ptr<int> b = a;
+ *a = 1;
+
+ extern void use(shared_ptr<int> &);
+ use(b);
+ }
+
+ void testNestedScope() {
+ shared_ptr<int> a(new int);
+ {
+ shared_ptr<int> b = a;
+ }
+ *a = 1;
+ }
+
+ void testSwap() {
+ shared_ptr<int> a(new int);
+ shared_ptr<int> b;
+ shared_ptr<int> c = a;
+ shared_ptr<int>(c).swap(b);
+ }
+
+ void testUseAfterFree() {
+ int *p = new int;
+ {
+ shared_ptr<int> a(p);
+ shared_ptr<int> b = a;
+ }
+
+ // FIXME: We should get a warning here, but we don't because we've
+ // conservatively modeled ~shared_ptr.
+ *p = 1;
+ }
+}
+
+// Test double delete
+class DerefClass{
+public:
+ int *x;
+ DerefClass() {}
+ ~DerefClass() {*x = 1;} //expected-warning {{Use of memory after it is freed}}
+};
+
+void testDoubleDeleteClassInstance() {
+ DerefClass *foo = new DerefClass();
+ delete foo;
+ delete foo; // FIXME: We should ideally report warning here instead of inside the destructor.
+}
+
+class EmptyClass{
+public:
+ EmptyClass() {}
+ ~EmptyClass() {}
+};
+
+void testDoubleDeleteEmptyClass() {
+ EmptyClass *foo = new EmptyClass();
+ delete foo;
+ delete foo; //expected-warning {{Attempt to free released memory}}
+}
diff --git a/test/Analysis/NewDelete-path-notes.cpp b/test/Analysis/NewDelete-path-notes.cpp
index 85b71be68ce2..b420551c3e9a 100644
--- a/test/Analysis/NewDelete-path-notes.cpp
+++ b/test/Analysis/NewDelete-path-notes.cpp
@@ -1,13 +1,12 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=text -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=plist %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
void test() {
int *p = new int;
// expected-note@-1 {{Memory is allocated}}
if (p)
- // expected-note@-1 {{Assuming 'p' is non-null}}
- // expected-note@-2 {{Taking true branch}}
+ // expected-note@-1 {{Taking true branch}}
delete p;
// expected-note@-1 {{Memory is released}}
@@ -151,75 +150,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>8</integer>
-// CHECK-NEXT: <key>col</key><integer>7</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>8</integer>
-// CHECK-NEXT: <key>col</key><integer>7</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: </array>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: </array>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>kind</key><string>event</string>
-// CHECK-NEXT: <key>location</key>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>8</integer>
-// CHECK-NEXT: <key>col</key><integer>7</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <key>ranges</key>
-// CHECK-NEXT: <array>
-// CHECK-NEXT: <array>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>8</integer>
-// CHECK-NEXT: <key>col</key><integer>7</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>8</integer>
-// CHECK-NEXT: <key>col</key><integer>7</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: </array>
-// CHECK-NEXT: </array>
-// CHECK-NEXT: <key>depth</key><integer>0</integer>
-// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Assuming &apos;p&apos; is non-null</string>
-// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Assuming &apos;p&apos; is non-null</string>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>kind</key><string>control</string>
-// CHECK-NEXT: <key>edges</key>
-// CHECK-NEXT: <array>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>start</key>
-// CHECK-NEXT: <array>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>8</integer>
-// CHECK-NEXT: <key>col</key><integer>7</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>8</integer>
-// CHECK-NEXT: <key>col</key><integer>7</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: </array>
-// CHECK-NEXT: <key>end</key>
-// CHECK-NEXT: <array>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -231,7 +167,7 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -239,12 +175,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -264,12 +200,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -277,12 +213,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>14</integer>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>14</integer>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -294,7 +230,7 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>14</integer>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -302,12 +238,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>14</integer>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>14</integer>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -325,10 +261,10 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>type</key><string>Double free</string>
// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
// CHECK-NEXT: <key>issue_context</key><string>test</string>
-// CHECK-NEXT: <key>issue_hash</key><string>9</string>
+// CHECK-NEXT: <key>issue_hash</key><string>8</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>14</integer>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -340,7 +276,7 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>25</integer>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -348,12 +284,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>25</integer>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>25</integer>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -369,7 +305,7 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>19</integer>
+// CHECK-NEXT: <key>line</key><integer>18</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -387,12 +323,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>19</integer>
+// CHECK-NEXT: <key>line</key><integer>18</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>19</integer>
+// CHECK-NEXT: <key>line</key><integer>18</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -400,12 +336,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>20</integer>
+// CHECK-NEXT: <key>line</key><integer>19</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>20</integer>
+// CHECK-NEXT: <key>line</key><integer>19</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -417,7 +353,7 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>20</integer>
+// CHECK-NEXT: <key>line</key><integer>19</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -425,12 +361,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>20</integer>
+// CHECK-NEXT: <key>line</key><integer>19</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>20</integer>
+// CHECK-NEXT: <key>line</key><integer>19</integer>
// CHECK-NEXT: <key>col</key><integer>13</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -446,7 +382,7 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>25</integer>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -454,12 +390,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>25</integer>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>25</integer>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -479,12 +415,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>25</integer>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>25</integer>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -492,12 +428,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>27</integer>
+// CHECK-NEXT: <key>line</key><integer>26</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>27</integer>
+// CHECK-NEXT: <key>line</key><integer>26</integer>
// CHECK-NEXT: <key>col</key><integer>7</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -509,7 +445,7 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>27</integer>
+// CHECK-NEXT: <key>line</key><integer>26</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -517,12 +453,12 @@ void test(Odd *odd) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>27</integer>
+// CHECK-NEXT: <key>line</key><integer>26</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>27</integer>
+// CHECK-NEXT: <key>line</key><integer>26</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -543,7 +479,7 @@ void test(Odd *odd) {
// CHECK-NEXT: <key>issue_hash</key><string>3</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>27</integer>
+// CHECK-NEXT: <key>line</key><integer>26</integer>
// CHECK-NEXT: <key>col</key><integer>2</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
diff --git a/test/Analysis/NoReturn.m b/test/Analysis/NoReturn.m
index a58efdd02948..c74d54eae528 100644
--- a/test/Analysis/NoReturn.m
+++ b/test/Analysis/NoReturn.m
@@ -123,3 +123,11 @@ void PR11959(int *p) {
*p = 0xDEADBEEF; // no-warning
}
+// Test that hard-coded Microsoft _wassert name is recognized as a noreturn
+#define assert(_Expression) (void)( (!!(_Expression)) || (_wassert(#_Expression, __FILE__, __LINE__), 0) )
+extern void _wassert(const char * _Message, const char *_File, unsigned _Line);
+void test_wassert() {
+ assert(0);
+ int *p = 0;
+ *p = 0xDEADBEEF; // no-warning
+}
diff --git a/test/Analysis/analyzer-config.cpp b/test/Analysis/analyzer-config.cpp
index bf18a5eb3e71..521344a5119a 100644
--- a/test/Analysis/analyzer-config.cpp
+++ b/test/Analysis/analyzer-config.cpp
@@ -13,6 +13,7 @@ public:
// CHECK: [config]
// CHECK-NEXT: c++-container-inlining = false
// CHECK-NEXT: c++-inlining = destructors
+// CHECK-NEXT: c++-shared_ptr-inlining = false
// CHECK-NEXT: c++-stdlib-inlining = true
// CHECK-NEXT: c++-template-inlining = true
// CHECK-NEXT: cfg-conditional-static-initializers = true
@@ -28,4 +29,4 @@ public:
// CHECK-NEXT: mode = deep
// CHECK-NEXT: region-store-small-struct-limit = 2
// CHECK-NEXT: [stats]
-// CHECK-NEXT: num-entries = 16
+// CHECK-NEXT: num-entries = 17
diff --git a/test/Analysis/array-struct-region.cpp b/test/Analysis/array-struct-region.cpp
index 12ae5d3eba6e..47776863d6a2 100644
--- a/test/Analysis/array-struct-region.cpp
+++ b/test/Analysis/array-struct-region.cpp
@@ -21,7 +21,7 @@ struct S {
#if __cplusplus
const struct S *operator -(const struct S &s) { return &s; }
-bool operator ~(const struct S &s) { return &s != &s; }
+bool operator ~(const struct S &s) { return (&s) != &s; }
#endif
@@ -173,4 +173,27 @@ void testImmediateUseOp() {
clang_analyzer_eval(getConstrainedFieldRefOp(getS()) == 42); // expected-warning{{TRUE}}
}
+namespace EmptyClass {
+ struct Base {
+ int& x;
+
+ Base(int& x) : x(x) {}
+ };
+
+ struct Derived : public Base {
+ Derived(int& x) : Base(x) {}
+
+ void operator=(int a) { x = a; }
+ };
+
+ Derived ref(int& a) { return Derived(a); }
+
+ // There used to be a warning here, because analyzer treated Derived as empty.
+ int test() {
+ int a;
+ ref(a) = 42;
+ return a; // no warning
+ }
+}
+
#endif
diff --git a/test/Analysis/auto-obj-dtors-cfg-output.cpp b/test/Analysis/auto-obj-dtors-cfg-output.cpp
index 0fc651739119..0dbbfb592f71 100644
--- a/test/Analysis/auto-obj-dtors-cfg-output.cpp
+++ b/test/Analysis/auto-obj-dtors-cfg-output.cpp
@@ -3,24 +3,93 @@
class A {
public:
+// CHECK: [B1 (ENTRY)]
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
A() {}
+
+// CHECK: [B1 (ENTRY)]
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
~A() {}
+
+// CHECK: [B2 (ENTRY)]
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B1]
+// CHECK-NEXT: 1: 1
+// CHECK-NEXT: 2: return [B1.1];
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
operator int() const { return 1; }
};
extern const bool UV;
+// CHECK: [B2 (ENTRY)]
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B1]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: 3: a
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 5: const A &b = a;
+// CHECK-NEXT: 6: A() (CXXConstructExpr, class A)
+// CHECK-NEXT: 7: [B1.6] (BindTemporary)
+// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 9: [B1.8]
+// CHECK: 10: const A &c = A();
+// CHECK: 11: [B1.10].~A() (Implicit destructor)
+// CHECK: 12: [B1.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
void test_const_ref() {
A a;
const A& b = a;
const A& c = A();
}
+// CHECK: [B2 (ENTRY)]
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B1]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A [2])
+// CHECK-NEXT: 2: A a[2];
+// CHECK-NEXT: 3: (CXXConstructExpr, class A [0])
+// CHECK-NEXT: 4: A b[0];
+// CHECK-NEXT: 5: [B1.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
void test_array() {
A a[2];
A b[0];
}
+// CHECK: [B2 (ENTRY)]
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B1]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: 3: (CXXConstructExpr, class A)
+// CHECK-NEXT: 4: A c;
+// CHECK-NEXT: 5: (CXXConstructExpr, class A)
+// CHECK-NEXT: 6: A d;
+// CHECK-NEXT: 7: [B1.6].~A() (Implicit destructor)
+// CHECK-NEXT: 8: [B1.4].~A() (Implicit destructor)
+// CHECK-NEXT: 9: (CXXConstructExpr, class A)
+// CHECK: 10: A b;
+// CHECK: 11: [B1.10].~A() (Implicit destructor)
+// CHECK: 12: [B1.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
void test_scope() {
A a;
{ A c;
@@ -29,6 +98,34 @@ void test_scope() {
A b;
}
+// CHECK: [B4 (ENTRY)]
+// CHECK-NEXT: Succs (1): B3
+// CHECK: [B1]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B3.4].~A() (Implicit destructor)
+// CHECK-NEXT: 5: [B3.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B3
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: 1: return;
+// CHECK-NEXT: 2: [B3.4].~A() (Implicit destructor)
+// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B3
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B3]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: 3: (CXXConstructExpr, class A)
+// CHECK-NEXT: 4: A b;
+// CHECK-NEXT: 5: UV
+// CHECK-NEXT: 6: [B3.5] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B3.6]
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (2): B2 B1
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (2): B1 B2
void test_return() {
A a;
A b;
@@ -36,6 +133,59 @@ void test_return() {
A c;
}
+// CHECK: [B8 (ENTRY)]
+// CHECK-NEXT: Succs (1): B7
+// CHECK: [B1]
+// CHECK: l1:
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B6.2].~A() (Implicit destructor)
+// CHECK-NEXT: 5: [B7.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (2): B2 B3
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A b;
+// CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B6.4].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B3]
+// CHECK-NEXT: 1: [B6.4].~A() (Implicit destructor)
+// CHECK-NEXT: T: goto l1;
+// CHECK: Preds (1): B4
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B4]
+// CHECK-NEXT: 1: UV
+// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B4.2]
+// CHECK-NEXT: Preds (1): B6
+// CHECK-NEXT: Succs (2): B3 B2
+// CHECK: [B5]
+// CHECK-NEXT: 1: [B6.4].~A() (Implicit destructor)
+// CHECK-NEXT: 2: [B6.2].~A() (Implicit destructor)
+// CHECK-NEXT: T: goto l0;
+// CHECK: Preds (1): B6
+// CHECK-NEXT: Succs (1): B6
+// CHECK: [B6]
+// CHECK: l0:
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A b;
+// CHECK-NEXT: 3: (CXXConstructExpr, class A)
+// CHECK-NEXT: 4: A a;
+// CHECK-NEXT: 5: UV
+// CHECK-NEXT: 6: [B6.5] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B6.6]
+// CHECK-NEXT: Preds (2): B7 B5
+// CHECK-NEXT: Succs (2): B5 B4
+// CHECK: [B7]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: Preds (1): B8
+// CHECK-NEXT: Succs (1): B6
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
void test_goto() {
A a;
l0:
@@ -49,6 +199,43 @@ l1:
A c;
}
+// CHECK: [B5 (ENTRY)]
+// CHECK-NEXT: Succs (1): B4
+// CHECK: [B1]
+// CHECK-NEXT: 1: [B4.6].~A() (Implicit destructor)
+// CHECK-NEXT: 2: [B4.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (2): B2 B3
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B3]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B4]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: 3: a
+// CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 5: [B4.4] (CXXConstructExpr, class A)
+// CHECK-NEXT: 6: A b = a;
+// CHECK-NEXT: 7: b
+// CHECK-NEXT: 8: [B4.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 9: [B4.8].operator int
+// CHECK: 10: [B4.9]()
+// CHECK: 11: [B4.10] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK: 12: [B4.11] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT: T: if [B4.12]
+// CHECK-NEXT: Preds (1): B5
+// CHECK-NEXT: Succs (2): B3 B2
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
void test_if_implicit_scope() {
A a;
if (A b = a)
@@ -56,6 +243,78 @@ void test_if_implicit_scope() {
else A c;
}
+// CHECK: [B9 (ENTRY)]
+// CHECK-NEXT: Succs (1): B8
+// CHECK: [B1]
+// CHECK-NEXT: 1: [B8.6].~A() (Implicit destructor)
+// CHECK-NEXT: 2: (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: A e;
+// CHECK-NEXT: 4: [B1.3].~A() (Implicit destructor)
+// CHECK-NEXT: 5: [B8.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (2): B2 B5
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A d;
+// CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B4.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B3]
+// CHECK-NEXT: 1: return;
+// CHECK-NEXT: 2: [B4.2].~A() (Implicit destructor)
+// CHECK-NEXT: 3: [B8.6].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B8.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B4]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: UV
+// CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B4.4]
+// CHECK-NEXT: Preds (1): B8
+// CHECK-NEXT: Succs (2): B3 B2
+// CHECK: [B5]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A d;
+// CHECK-NEXT: 3: [B5.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B7.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B7
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B6]
+// CHECK-NEXT: 1: return;
+// CHECK-NEXT: 2: [B7.2].~A() (Implicit destructor)
+// CHECK-NEXT: 3: [B8.6].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B8.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B7
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B7]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: UV
+// CHECK-NEXT: 4: [B7.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B7.4]
+// CHECK-NEXT: Preds (1): B8
+// CHECK-NEXT: Succs (2): B6 B5
+// CHECK: [B8]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: 3: a
+// CHECK-NEXT: 4: [B8.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 5: [B8.4] (CXXConstructExpr, class A)
+// CHECK-NEXT: 6: A b = a;
+// CHECK-NEXT: 7: b
+// CHECK-NEXT: 8: [B8.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 9: [B8.8].operator int
+// CHECK: 10: [B8.9]()
+// CHECK: 11: [B8.10] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK: 12: [B8.11] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT: T: if [B8.12]
+// CHECK-NEXT: Preds (1): B9
+// CHECK-NEXT: Succs (2): B7 B4
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (3): B1 B3 B6
void test_if_jumps() {
A a;
if (A b = a) {
@@ -70,12 +329,130 @@ void test_if_jumps() {
A e;
}
+// CHECK: [B6 (ENTRY)]
+// CHECK-NEXT: Succs (1): B5
+// CHECK: [B1]
+// CHECK-NEXT: 1: [B4.4].~A() (Implicit destructor)
+// CHECK-NEXT: 2: [B5.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: Preds (1): B3
+// CHECK-NEXT: Succs (1): B4
+// CHECK: [B3]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B4.4].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B4]
+// CHECK-NEXT: 1: a
+// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 3: [B4.2] (CXXConstructExpr, class A)
+// CHECK-NEXT: 4: A b = a;
+// CHECK-NEXT: 5: b
+// CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 7: [B4.6].operator int
+// CHECK-NEXT: 8: [B4.7]()
+// CHECK-NEXT: 9: [B4.8] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK: 10: [B4.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT: T: while [B4.10]
+// CHECK-NEXT: Preds (2): B2 B5
+// CHECK-NEXT: Succs (2): B3 B1
+// CHECK: [B5]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: Preds (1): B6
+// CHECK-NEXT: Succs (1): B4
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
void test_while_implicit_scope() {
A a;
while (A b = a)
A c;
}
+// CHECK: [B12 (ENTRY)]
+// CHECK-NEXT: Succs (1): B11
+// CHECK: [B1]
+// CHECK-NEXT: 1: [B10.4].~A() (Implicit destructor)
+// CHECK-NEXT: 2: (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: A e;
+// CHECK-NEXT: 4: [B1.3].~A() (Implicit destructor)
+// CHECK-NEXT: 5: [B11.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (2): B8 B10
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: Preds (2): B3 B6
+// CHECK-NEXT: Succs (1): B10
+// CHECK: [B3]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A d;
+// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: 5: [B10.4].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B5
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B4]
+// CHECK-NEXT: 1: return;
+// CHECK-NEXT: 2: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: 3: [B10.4].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B11.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B5
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B5]
+// CHECK-NEXT: 1: UV
+// CHECK-NEXT: 2: [B5.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B5.2]
+// CHECK-NEXT: Preds (1): B7
+// CHECK-NEXT: Succs (2): B4 B3
+// CHECK: [B6]
+// CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: 2: [B10.4].~A() (Implicit destructor)
+// CHECK-NEXT: T: continue;
+// CHECK: Preds (1): B7
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B7]
+// CHECK-NEXT: 1: UV
+// CHECK-NEXT: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B7.2]
+// CHECK-NEXT: Preds (1): B9
+// CHECK-NEXT: Succs (2): B6 B5
+// CHECK: [B8]
+// CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: T: break;
+// CHECK: Preds (1): B9
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B9]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: UV
+// CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B9.4]
+// CHECK-NEXT: Preds (1): B10
+// CHECK-NEXT: Succs (2): B8 B7
+// CHECK: [B10]
+// CHECK-NEXT: 1: a
+// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 3: [B10.2] (CXXConstructExpr, class A)
+// CHECK-NEXT: 4: A b = a;
+// CHECK-NEXT: 5: b
+// CHECK-NEXT: 6: [B10.5] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 7: [B10.6].operator int
+// CHECK-NEXT: 8: [B10.7]()
+// CHECK-NEXT: 9: [B10.8] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK: 10: [B10.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT: T: while [B10.10]
+// CHECK-NEXT: Preds (2): B2 B11
+// CHECK-NEXT: Succs (2): B9 B1
+// CHECK: [B11]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: Preds (1): B12
+// CHECK-NEXT: Succs (1): B10
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (2): B1 B4
void test_while_jumps() {
A a;
while (A b = a) {
@@ -88,11 +465,98 @@ void test_while_jumps() {
A e;
}
+// CHECK: [B4 (ENTRY)]
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B1]
+// CHECK-NEXT: 1: UV
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: do ... while [B1.2]
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (2): B3 B0
+// CHECK: [B2]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: 3: [B2.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (2): B3 B4
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B3]
+// CHECK-NEXT: Preds (1): B1
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
void test_do_implicit_scope() {
do A a;
while (UV);
}
+// CHECK: [B12 (ENTRY)]
+// CHECK-NEXT: Succs (1): B11
+// CHECK: [B1]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A d;
+// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B11.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (2): B8 B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: 1: UV
+// CHECK-NEXT: 2: [B2.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: do ... while [B2.2]
+// CHECK-NEXT: Preds (2): B3 B6
+// CHECK-NEXT: Succs (2): B10 B1
+// CHECK: [B3]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B5
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B4]
+// CHECK-NEXT: 1: return;
+// CHECK-NEXT: 2: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: 3: [B11.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B5
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B5]
+// CHECK-NEXT: 1: UV
+// CHECK-NEXT: 2: [B5.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B5.2]
+// CHECK-NEXT: Preds (1): B7
+// CHECK-NEXT: Succs (2): B4 B3
+// CHECK: [B6]
+// CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: T: continue;
+// CHECK: Preds (1): B7
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B7]
+// CHECK-NEXT: 1: UV
+// CHECK-NEXT: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B7.2]
+// CHECK-NEXT: Preds (1): B9
+// CHECK-NEXT: Succs (2): B6 B5
+// CHECK: [B8]
+// CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: T: break;
+// CHECK: Preds (1): B9
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B9]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A b;
+// CHECK-NEXT: 3: UV
+// CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B9.4]
+// CHECK-NEXT: Preds (2): B10 B11
+// CHECK-NEXT: Succs (2): B8 B7
+// CHECK: [B10]
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B9
+// CHECK: [B11]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: Preds (1): B12
+// CHECK-NEXT: Succs (1): B9
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (2): B1 B4
void test_do_jumps() {
A a;
do {
@@ -105,12 +569,107 @@ void test_do_jumps() {
A d;
}
+// CHECK: [B4 (ENTRY)]
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B1]
+// CHECK-NEXT: 1: [B2.6].~A() (Implicit destructor)
+// CHECK-NEXT: 2: [B2.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (2): B3 B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: 3: a
+// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 5: [B2.4] (CXXConstructExpr, class A)
+// CHECK-NEXT: 6: A b = a;
+// CHECK-NEXT: 7: b
+// CHECK-NEXT: 8: [B2.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 9: [B2.8].operator int
+// CHECK: 10: [B2.9]()
+// CHECK: 11: [B2.10] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK-NEXT: T: switch [B2.11]
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B3]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
void test_switch_implicit_scope() {
A a;
switch (A b = a)
A c;
}
+// CHECK: [B9 (ENTRY)]
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B1]
+// CHECK-NEXT: 1: [B2.6].~A() (Implicit destructor)
+// CHECK-NEXT: 2: (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: A g;
+// CHECK-NEXT: 4: [B1.3].~A() (Implicit destructor)
+// CHECK-NEXT: 5: [B2.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (3): B3 B7 B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: 3: a
+// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 5: [B2.4] (CXXConstructExpr, class A)
+// CHECK-NEXT: 6: A b = a;
+// CHECK-NEXT: 7: b
+// CHECK-NEXT: 8: [B2.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 9: [B2.8].operator int
+// CHECK: 10: [B2.9]()
+// CHECK: 11: [B2.10] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK-NEXT: T: switch [B2.11]
+// CHECK-NEXT: Preds (1): B9
+// CHECK-NEXT: Succs (3): B3 B8 B1
+// CHECK: [B3]
+// CHECK: case 1:
+// CHECK-NEXT: T: break;
+// CHECK: Preds (2): B2 B4
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B4]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A f;
+// CHECK-NEXT: 3: [B4.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B8.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B6
+// CHECK-NEXT: Succs (1): B3
+// CHECK: [B5]
+// CHECK-NEXT: 1: return;
+// CHECK-NEXT: 2: [B8.2].~A() (Implicit destructor)
+// CHECK-NEXT: 3: [B2.6].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B2.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B6
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B6]
+// CHECK-NEXT: 1: UV
+// CHECK-NEXT: 2: [B6.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B6.2]
+// CHECK-NEXT: Preds (1): B8
+// CHECK-NEXT: Succs (2): B5 B4
+// CHECK: [B7]
+// CHECK-NEXT: 1: [B8.2].~A() (Implicit destructor)
+// CHECK-NEXT: T: break;
+// CHECK: Preds (1): B8
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B8]
+// CHECK: case 0:
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: UV
+// CHECK-NEXT: 4: [B8.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B8.4]
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (2): B7 B6
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (2): B1 B5
void test_switch_jumps() {
A a;
switch (A b = a) {
@@ -126,11 +685,132 @@ void test_switch_jumps() {
A g;
}
+// CHECK: [B6 (ENTRY)]
+// CHECK-NEXT: Succs (1): B5
+// CHECK: [B1]
+// CHECK-NEXT: 1: [B4.4].~A() (Implicit destructor)
+// CHECK-NEXT: 2: [B5.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: Preds (1): B3
+// CHECK-NEXT: Succs (1): B4
+// CHECK: [B3]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A c;
+// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B4.4].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B4]
+// CHECK-NEXT: 1: a
+// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 3: [B4.2] (CXXConstructExpr, class A)
+// CHECK-NEXT: 4: A b = a;
+// CHECK-NEXT: 5: b
+// CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 7: [B4.6].operator int
+// CHECK-NEXT: 8: [B4.7]()
+// CHECK-NEXT: 9: [B4.8] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK: 10: [B4.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT: T: for (...; [B4.10]; )
+// CHECK-NEXT: Preds (2): B2 B5
+// CHECK-NEXT: Succs (2): B3 B1
+// CHECK: [B5]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: Preds (1): B6
+// CHECK-NEXT: Succs (1): B4
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
void test_for_implicit_scope() {
for (A a; A b = a; )
A c;
}
+// CHECK: [B12 (ENTRY)]
+// CHECK-NEXT: Succs (1): B11
+// CHECK: [B1]
+// CHECK-NEXT: 1: [B10.4].~A() (Implicit destructor)
+// CHECK-NEXT: 2: [B11.4].~A() (Implicit destructor)
+// CHECK-NEXT: 3: (CXXConstructExpr, class A)
+// CHECK-NEXT: 4: A f;
+// CHECK-NEXT: 5: [B1.4].~A() (Implicit destructor)
+// CHECK-NEXT: 6: [B11.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (2): B8 B10
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: Preds (2): B3 B6
+// CHECK-NEXT: Succs (1): B10
+// CHECK: [B3]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A e;
+// CHECK-NEXT: 3: [B3.2].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: 5: [B10.4].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B5
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B4]
+// CHECK-NEXT: 1: return;
+// CHECK-NEXT: 2: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: 3: [B10.4].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B11.4].~A() (Implicit destructor)
+// CHECK-NEXT: 5: [B11.2].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B5
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B5]
+// CHECK-NEXT: 1: UV
+// CHECK-NEXT: 2: [B5.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B5.2]
+// CHECK-NEXT: Preds (1): B7
+// CHECK-NEXT: Succs (2): B4 B3
+// CHECK: [B6]
+// CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: T: continue;
+// CHECK: Preds (1): B7
+// CHECK-NEXT: Succs (1): B2
+// CHECK: [B7]
+// CHECK-NEXT: 1: UV
+// CHECK-NEXT: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B7.2]
+// CHECK-NEXT: Preds (1): B9
+// CHECK-NEXT: Succs (2): B6 B5
+// CHECK: [B8]
+// CHECK-NEXT: 1: [B9.2].~A() (Implicit destructor)
+// CHECK-NEXT: T: break;
+// CHECK: Preds (1): B9
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B9]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A d;
+// CHECK-NEXT: 3: UV
+// CHECK-NEXT: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK-NEXT: T: if [B9.4]
+// CHECK-NEXT: Preds (1): B10
+// CHECK-NEXT: Succs (2): B8 B7
+// CHECK: [B10]
+// CHECK-NEXT: 1: b
+// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 3: [B10.2] (CXXConstructExpr, class A)
+// CHECK-NEXT: 4: A c = b;
+// CHECK-NEXT: 5: c
+// CHECK-NEXT: 6: [B10.5] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 7: [B10.6].operator int
+// CHECK-NEXT: 8: [B10.7]()
+// CHECK-NEXT: 9: [B10.8] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK: 10: [B10.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT: T: for (...; [B10.10]; )
+// CHECK-NEXT: Preds (2): B2 B11
+// CHECK-NEXT: Succs (2): B9 B1
+// CHECK: [B11]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: A a;
+// CHECK-NEXT: 3: (CXXConstructExpr, class A)
+// CHECK-NEXT: 4: A b;
+// CHECK-NEXT: Preds (1): B12
+// CHECK-NEXT: Succs (1): B10
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (2): B1 B4
void test_for_jumps() {
A a;
for (A b; A c = b; ) {
@@ -143,722 +823,41 @@ void test_for_jumps() {
A f;
}
+// CHECK: [B3 (ENTRY)]
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B1]
+// CHECK-NEXT: T: try ...
+// CHECK-NEXT: Succs (2): B2 B0
+// CHECK: [B2]
+// CHECK-NEXT: catch (const A &e):
+// CHECK-NEXT: 1: catch (const A &e) {
+// CHECK-NEXT: }
+// CHECK-NEXT: Preds (1): B1
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (3): B2 B1 B3
void test_catch_const_ref() {
try {
} catch (const A& e) {
}
}
+// CHECK: [B3 (ENTRY)]
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B1]
+// CHECK-NEXT: T: try ...
+// CHECK-NEXT: Succs (2): B2 B0
+// CHECK: [B2]
+// CHECK-NEXT: catch (A e):
+// CHECK-NEXT: 1: catch (A e) {
+// CHECK-NEXT: }
+// CHECK-NEXT: 2: [B2.1].~A() (Implicit destructor)
+// CHECK-NEXT: Preds (1): B1
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (3): B2 B1 B3
void test_catch_copy() {
try {
} catch (A e) {
}
}
-
-// CHECK: [B1 (ENTRY)]
-// CHECK: Succs (1): B0
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B1 (ENTRY)]
-// CHECK: Succs (1): B0
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B2 (ENTRY)]
-// CHECK: Succs (1): B1
-// CHECK: [B1]
-// CHECK: 1: 1
-// CHECK: 2: return [B1.1];
-// CHECK: Preds (1): B2
-// CHECK: Succs (1): B0
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B2 (ENTRY)]
-// CHECK: Succs (1): B1
-// CHECK: [B1]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: 3: a
-// CHECK: 4: [B1.3] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 5: const A &b = a;
-// CHECK: 6: A() (CXXConstructExpr, class A)
-// CHECK: 7: [B1.6] (BindTemporary)
-// CHECK: 8: [B1.7] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 9: [B1.8]
-// CHECK: 10: const A &c = A();
-// CHECK: 11: [B1.10].~A() (Implicit destructor)
-// CHECK: 12: [B1.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B2
-// CHECK: Succs (1): B0
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B2 (ENTRY)]
-// CHECK: Succs (1): B1
-// CHECK: [B1]
-// CHECK: 1: (CXXConstructExpr, class A [2])
-// CHECK: 2: A a[2];
-// CHECK: 3: (CXXConstructExpr, class A [0])
-// CHECK: 4: A b[0];
-// CHECK: 5: [B1.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B2
-// CHECK: Succs (1): B0
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B2 (ENTRY)]
-// CHECK: Succs (1): B1
-// CHECK: [B1]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: 3: (CXXConstructExpr, class A)
-// CHECK: 4: A c;
-// CHECK: 5: (CXXConstructExpr, class A)
-// CHECK: 6: A d;
-// CHECK: 7: [B1.6].~A() (Implicit destructor)
-// CHECK: 8: [B1.4].~A() (Implicit destructor)
-// CHECK: 9: (CXXConstructExpr, class A)
-// CHECK: 10: A b;
-// CHECK: 11: [B1.10].~A() (Implicit destructor)
-// CHECK: 12: [B1.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B2
-// CHECK: Succs (1): B0
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B4 (ENTRY)]
-// CHECK: Succs (1): B3
-// CHECK: [B1]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: [B1.2].~A() (Implicit destructor)
-// CHECK: 4: [B3.4].~A() (Implicit destructor)
-// CHECK: 5: [B3.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B3
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: 1: return;
-// CHECK: 2: [B3.4].~A() (Implicit destructor)
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B3
-// CHECK: Succs (1): B0
-// CHECK: [B3]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: 3: (CXXConstructExpr, class A)
-// CHECK: 4: A b;
-// CHECK: 5: UV
-// CHECK: 6: [B3.5] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B3.6]
-// CHECK: Preds (1): B4
-// CHECK: Succs (2): B2 B1
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (2): B1 B2
-// CHECK: [B8 (ENTRY)]
-// CHECK: Succs (1): B7
-// CHECK: [B1]
-// CHECK: l1:
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: [B1.2].~A() (Implicit destructor)
-// CHECK: 4: [B6.2].~A() (Implicit destructor)
-// CHECK: 5: [B7.2].~A() (Implicit destructor)
-// CHECK: Preds (2): B2 B3
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A b;
-// CHECK: 3: [B2.2].~A() (Implicit destructor)
-// CHECK: 4: [B6.4].~A() (Implicit destructor)
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B1
-// CHECK: [B3]
-// CHECK: 1: [B6.4].~A() (Implicit destructor)
-// CHECK: T: goto l1;
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B1
-// CHECK: [B4]
-// CHECK: 1: UV
-// CHECK: 2: [B4.1] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B4.2]
-// CHECK: Preds (1): B6
-// CHECK: Succs (2): B3 B2
-// CHECK: [B5]
-// CHECK: 1: [B6.4].~A() (Implicit destructor)
-// CHECK: 2: [B6.2].~A() (Implicit destructor)
-// CHECK: T: goto l0;
-// CHECK: Preds (1): B6
-// CHECK: Succs (1): B6
-// CHECK: [B6]
-// CHECK: l0:
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A b;
-// CHECK: 3: (CXXConstructExpr, class A)
-// CHECK: 4: A a;
-// CHECK: 5: UV
-// CHECK: 6: [B6.5] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B6.6]
-// CHECK: Preds (2): B7 B5
-// CHECK: Succs (2): B5 B4
-// CHECK: [B7]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: Preds (1): B8
-// CHECK: Succs (1): B6
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B5 (ENTRY)]
-// CHECK: Succs (1): B4
-// CHECK: [B1]
-// CHECK: 1: [B4.6].~A() (Implicit destructor)
-// CHECK: 2: [B4.2].~A() (Implicit destructor)
-// CHECK: Preds (2): B2 B3
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: [B2.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B1
-// CHECK: [B3]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B1
-// CHECK: [B4]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: 3: a
-// CHECK: 4: [B4.3] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 5: [B4.4] (CXXConstructExpr, class A)
-// CHECK: 6: A b = a;
-// CHECK: 7: b
-// CHECK: 8: [B4.7] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 9: [B4.8].operator int
-// CHECK: 10: [B4.9]()
-// CHECK: 11: [B4.10] (ImplicitCastExpr, UserDefinedConversion, int)
-// CHECK: 12: [B4.11] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK: T: if [B4.12]
-// CHECK: Preds (1): B5
-// CHECK: Succs (2): B3 B2
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B9 (ENTRY)]
-// CHECK: Succs (1): B8
-// CHECK: [B1]
-// CHECK: 1: [B8.6].~A() (Implicit destructor)
-// CHECK: 2: (CXXConstructExpr, class A)
-// CHECK: 3: A e;
-// CHECK: 4: [B1.3].~A() (Implicit destructor)
-// CHECK: 5: [B8.2].~A() (Implicit destructor)
-// CHECK: Preds (2): B2 B5
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A d;
-// CHECK: 3: [B2.2].~A() (Implicit destructor)
-// CHECK: 4: [B4.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B1
-// CHECK: [B3]
-// CHECK: 1: return;
-// CHECK: 2: [B4.2].~A() (Implicit destructor)
-// CHECK: 3: [B8.6].~A() (Implicit destructor)
-// CHECK: 4: [B8.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B0
-// CHECK: [B4]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: UV
-// CHECK: 4: [B4.3] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B4.4]
-// CHECK: Preds (1): B8
-// CHECK: Succs (2): B3 B2
-// CHECK: [B5]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A d;
-// CHECK: 3: [B5.2].~A() (Implicit destructor)
-// CHECK: 4: [B7.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B7
-// CHECK: Succs (1): B1
-// CHECK: [B6]
-// CHECK: 1: return;
-// CHECK: 2: [B7.2].~A() (Implicit destructor)
-// CHECK: 3: [B8.6].~A() (Implicit destructor)
-// CHECK: 4: [B8.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B7
-// CHECK: Succs (1): B0
-// CHECK: [B7]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: UV
-// CHECK: 4: [B7.3] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B7.4]
-// CHECK: Preds (1): B8
-// CHECK: Succs (2): B6 B5
-// CHECK: [B8]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: 3: a
-// CHECK: 4: [B8.3] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 5: [B8.4] (CXXConstructExpr, class A)
-// CHECK: 6: A b = a;
-// CHECK: 7: b
-// CHECK: 8: [B8.7] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 9: [B8.8].operator int
-// CHECK: 10: [B8.9]()
-// CHECK: 11: [B8.10] (ImplicitCastExpr, UserDefinedConversion, int)
-// CHECK: 12: [B8.11] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK: T: if [B8.12]
-// CHECK: Preds (1): B9
-// CHECK: Succs (2): B7 B4
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (3): B1 B3 B6
-// CHECK: [B6 (ENTRY)]
-// CHECK: Succs (1): B5
-// CHECK: [B1]
-// CHECK: 1: [B4.4].~A() (Implicit destructor)
-// CHECK: 2: [B5.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: Preds (1): B3
-// CHECK: Succs (1): B4
-// CHECK: [B3]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: 4: [B4.4].~A() (Implicit destructor)
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B2
-// CHECK: [B4]
-// CHECK: 1: a
-// CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 3: [B4.2] (CXXConstructExpr, class A)
-// CHECK: 4: A b = a;
-// CHECK: 5: b
-// CHECK: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 7: [B4.6].operator int
-// CHECK: 8: [B4.7]()
-// CHECK: 9: [B4.8] (ImplicitCastExpr, UserDefinedConversion, int)
-// CHECK: 10: [B4.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK: T: while [B4.10]
-// CHECK: Preds (2): B2 B5
-// CHECK: Succs (2): B3 B1
-// CHECK: [B5]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: Preds (1): B6
-// CHECK: Succs (1): B4
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B12 (ENTRY)]
-// CHECK: Succs (1): B11
-// CHECK: [B1]
-// CHECK: 1: [B10.4].~A() (Implicit destructor)
-// CHECK: 2: (CXXConstructExpr, class A)
-// CHECK: 3: A e;
-// CHECK: 4: [B1.3].~A() (Implicit destructor)
-// CHECK: 5: [B11.2].~A() (Implicit destructor)
-// CHECK: Preds (2): B8 B10
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: Preds (2): B3 B6
-// CHECK: Succs (1): B10
-// CHECK: [B3]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A d;
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: 4: [B9.2].~A() (Implicit destructor)
-// CHECK: 5: [B10.4].~A() (Implicit destructor)
-// CHECK: Preds (1): B5
-// CHECK: Succs (1): B2
-// CHECK: [B4]
-// CHECK: 1: return;
-// CHECK: 2: [B9.2].~A() (Implicit destructor)
-// CHECK: 3: [B10.4].~A() (Implicit destructor)
-// CHECK: 4: [B11.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B5
-// CHECK: Succs (1): B0
-// CHECK: [B5]
-// CHECK: 1: UV
-// CHECK: 2: [B5.1] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B5.2]
-// CHECK: Preds (1): B7
-// CHECK: Succs (2): B4 B3
-// CHECK: [B6]
-// CHECK: 1: [B9.2].~A() (Implicit destructor)
-// CHECK: 2: [B10.4].~A() (Implicit destructor)
-// CHECK: T: continue;
-// CHECK: Preds (1): B7
-// CHECK: Succs (1): B2
-// CHECK: [B7]
-// CHECK: 1: UV
-// CHECK: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B7.2]
-// CHECK: Preds (1): B9
-// CHECK: Succs (2): B6 B5
-// CHECK: [B8]
-// CHECK: 1: [B9.2].~A() (Implicit destructor)
-// CHECK: T: break;
-// CHECK: Preds (1): B9
-// CHECK: Succs (1): B1
-// CHECK: [B9]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: UV
-// CHECK: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B9.4]
-// CHECK: Preds (1): B10
-// CHECK: Succs (2): B8 B7
-// CHECK: [B10]
-// CHECK: 1: a
-// CHECK: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 3: [B10.2] (CXXConstructExpr, class A)
-// CHECK: 4: A b = a;
-// CHECK: 5: b
-// CHECK: 6: [B10.5] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 7: [B10.6].operator int
-// CHECK: 8: [B10.7]()
-// CHECK: 9: [B10.8] (ImplicitCastExpr, UserDefinedConversion, int)
-// CHECK: 10: [B10.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK: T: while [B10.10]
-// CHECK: Preds (2): B2 B11
-// CHECK: Succs (2): B9 B1
-// CHECK: [B11]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: Preds (1): B12
-// CHECK: Succs (1): B10
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (2): B1 B4
-// CHECK: [B4 (ENTRY)]
-// CHECK: Succs (1): B2
-// CHECK: [B1]
-// CHECK: 1: UV
-// CHECK: 2: [B1.1] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: do ... while [B1.2]
-// CHECK: Preds (1): B2
-// CHECK: Succs (2): B3 B0
-// CHECK: [B2]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: 3: [B2.2].~A() (Implicit destructor)
-// CHECK: Preds (2): B3 B4
-// CHECK: Succs (1): B1
-// CHECK: [B3]
-// CHECK: Preds (1): B1
-// CHECK: Succs (1): B2
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B12 (ENTRY)]
-// CHECK: Succs (1): B11
-// CHECK: [B1]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A d;
-// CHECK: 3: [B1.2].~A() (Implicit destructor)
-// CHECK: 4: [B11.2].~A() (Implicit destructor)
-// CHECK: Preds (2): B8 B2
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: 1: UV
-// CHECK: 2: [B2.1] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: do ... while [B2.2]
-// CHECK: Preds (2): B3 B6
-// CHECK: Succs (2): B10 B1
-// CHECK: [B3]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: 4: [B9.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B5
-// CHECK: Succs (1): B2
-// CHECK: [B4]
-// CHECK: 1: return;
-// CHECK: 2: [B9.2].~A() (Implicit destructor)
-// CHECK: 3: [B11.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B5
-// CHECK: Succs (1): B0
-// CHECK: [B5]
-// CHECK: 1: UV
-// CHECK: 2: [B5.1] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B5.2]
-// CHECK: Preds (1): B7
-// CHECK: Succs (2): B4 B3
-// CHECK: [B6]
-// CHECK: 1: [B9.2].~A() (Implicit destructor)
-// CHECK: T: continue;
-// CHECK: Preds (1): B7
-// CHECK: Succs (1): B2
-// CHECK: [B7]
-// CHECK: 1: UV
-// CHECK: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B7.2]
-// CHECK: Preds (1): B9
-// CHECK: Succs (2): B6 B5
-// CHECK: [B8]
-// CHECK: 1: [B9.2].~A() (Implicit destructor)
-// CHECK: T: break;
-// CHECK: Preds (1): B9
-// CHECK: Succs (1): B1
-// CHECK: [B9]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A b;
-// CHECK: 3: UV
-// CHECK: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B9.4]
-// CHECK: Preds (2): B10 B11
-// CHECK: Succs (2): B8 B7
-// CHECK: [B10]
-// CHECK: Preds (1): B2
-// CHECK: Succs (1): B9
-// CHECK: [B11]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: Preds (1): B12
-// CHECK: Succs (1): B9
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (2): B1 B4
-// CHECK: [B4 (ENTRY)]
-// CHECK: Succs (1): B2
-// CHECK: [B1]
-// CHECK: 1: [B2.6].~A() (Implicit destructor)
-// CHECK: 2: [B2.2].~A() (Implicit destructor)
-// CHECK: Preds (2): B3 B2
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: 3: a
-// CHECK: 4: [B2.3] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 5: [B2.4] (CXXConstructExpr, class A)
-// CHECK: 6: A b = a;
-// CHECK: 7: b
-// CHECK: 8: [B2.7] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 9: [B2.8].operator int
-// CHECK: 10: [B2.9]()
-// CHECK: 11: [B2.10] (ImplicitCastExpr, UserDefinedConversion, int)
-// CHECK: T: switch [B2.11]
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B1
-// CHECK: [B3]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: Succs (1): B1
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B9 (ENTRY)]
-// CHECK: Succs (1): B2
-// CHECK: [B1]
-// CHECK: 1: [B2.6].~A() (Implicit destructor)
-// CHECK: 2: (CXXConstructExpr, class A)
-// CHECK: 3: A g;
-// CHECK: 4: [B1.3].~A() (Implicit destructor)
-// CHECK: 5: [B2.2].~A() (Implicit destructor)
-// CHECK: Preds (3): B3 B7 B2
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: 3: a
-// CHECK: 4: [B2.3] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 5: [B2.4] (CXXConstructExpr, class A)
-// CHECK: 6: A b = a;
-// CHECK: 7: b
-// CHECK: 8: [B2.7] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 9: [B2.8].operator int
-// CHECK: 10: [B2.9]()
-// CHECK: 11: [B2.10] (ImplicitCastExpr, UserDefinedConversion, int)
-// CHECK: T: switch [B2.11]
-// CHECK: Preds (1): B9
-// CHECK: Succs (3): B3 B8
-// CHECK: B1
-// CHECK: [B3]
-// CHECK: case 1:
-// CHECK: T: break;
-// CHECK: Preds (2): B2 B4
-// CHECK: Succs (1): B1
-// CHECK: [B4]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A f;
-// CHECK: 3: [B4.2].~A() (Implicit destructor)
-// CHECK: 4: [B8.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B6
-// CHECK: Succs (1): B3
-// CHECK: [B5]
-// CHECK: 1: return;
-// CHECK: 2: [B8.2].~A() (Implicit destructor)
-// CHECK: 3: [B2.6].~A() (Implicit destructor)
-// CHECK: 4: [B2.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B6
-// CHECK: Succs (1): B0
-// CHECK: [B6]
-// CHECK: 1: UV
-// CHECK: 2: [B6.1] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B6.2]
-// CHECK: Preds (1): B8
-// CHECK: Succs (2): B5 B4
-// CHECK: [B7]
-// CHECK: 1: [B8.2].~A() (Implicit destructor)
-// CHECK: T: break;
-// CHECK: Preds (1): B8
-// CHECK: Succs (1): B1
-// CHECK: [B8]
-// CHECK: case 0:
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: UV
-// CHECK: 4: [B8.3] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B8.4]
-// CHECK: Preds (1): B2
-// CHECK: Succs (2): B7 B6
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (2): B1 B5
-// CHECK: [B6 (ENTRY)]
-// CHECK: Succs (1): B5
-// CHECK: [B1]
-// CHECK: 1: [B4.4].~A() (Implicit destructor)
-// CHECK: 2: [B5.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: Preds (1): B3
-// CHECK: Succs (1): B4
-// CHECK: [B3]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A c;
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: 4: [B4.4].~A() (Implicit destructor)
-// CHECK: Preds (1): B4
-// CHECK: Succs (1): B2
-// CHECK: [B4]
-// CHECK: 1: a
-// CHECK: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 3: [B4.2] (CXXConstructExpr, class A)
-// CHECK: 4: A b = a;
-// CHECK: 5: b
-// CHECK: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 7: [B4.6].operator int
-// CHECK: 8: [B4.7]()
-// CHECK: 9: [B4.8] (ImplicitCastExpr, UserDefinedConversion, int)
-// CHECK: 10: [B4.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK: T: for (...; [B4.10]; )
-// CHECK: Preds (2): B2 B5
-// CHECK: Succs (2): B3 B1
-// CHECK: [B5]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: Preds (1): B6
-// CHECK: Succs (1): B4
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (1): B1
-// CHECK: [B12 (ENTRY)]
-// CHECK: Succs (1): B11
-// CHECK: [B1]
-// CHECK: 1: [B10.4].~A() (Implicit destructor)
-// CHECK: 2: [B11.4].~A() (Implicit destructor)
-// CHECK: 3: (CXXConstructExpr, class A)
-// CHECK: 4: A f;
-// CHECK: 5: [B1.4].~A() (Implicit destructor)
-// CHECK: 6: [B11.2].~A() (Implicit destructor)
-// CHECK: Preds (2): B8 B10
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: Preds (2): B3 B6
-// CHECK: Succs (1): B10
-// CHECK: [B3]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A e;
-// CHECK: 3: [B3.2].~A() (Implicit destructor)
-// CHECK: 4: [B9.2].~A() (Implicit destructor)
-// CHECK: 5: [B10.4].~A() (Implicit destructor)
-// CHECK: Preds (1): B5
-// CHECK: Succs (1): B2
-// CHECK: [B4]
-// CHECK: 1: return;
-// CHECK: 2: [B9.2].~A() (Implicit destructor)
-// CHECK: 3: [B10.4].~A() (Implicit destructor)
-// CHECK: 4: [B11.4].~A() (Implicit destructor)
-// CHECK: 5: [B11.2].~A() (Implicit destructor)
-// CHECK: Preds (1): B5
-// CHECK: Succs (1): B0
-// CHECK: [B5]
-// CHECK: 1: UV
-// CHECK: 2: [B5.1] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B5.2]
-// CHECK: Preds (1): B7
-// CHECK: Succs (2): B4 B3
-// CHECK: [B6]
-// CHECK: 1: [B9.2].~A() (Implicit destructor)
-// CHECK: T: continue;
-// CHECK: Preds (1): B7
-// CHECK: Succs (1): B2
-// CHECK: [B7]
-// CHECK: 1: UV
-// CHECK: 2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B7.2]
-// CHECK: Preds (1): B9
-// CHECK: Succs (2): B6 B5
-// CHECK: [B8]
-// CHECK: 1: [B9.2].~A() (Implicit destructor)
-// CHECK: T: break;
-// CHECK: Preds (1): B9
-// CHECK: Succs (1): B1
-// CHECK: [B9]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A d;
-// CHECK: 3: UV
-// CHECK: 4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
-// CHECK: T: if [B9.4]
-// CHECK: Preds (1): B10
-// CHECK: Succs (2): B8 B7
-// CHECK: [B10]
-// CHECK: 1: b
-// CHECK: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 3: [B10.2] (CXXConstructExpr, class A)
-// CHECK: 4: A c = b;
-// CHECK: 5: c
-// CHECK: 6: [B10.5] (ImplicitCastExpr, NoOp, const class A)
-// CHECK: 7: [B10.6].operator int
-// CHECK: 8: [B10.7]()
-// CHECK: 9: [B10.8] (ImplicitCastExpr, UserDefinedConversion, int)
-// CHECK: 10: [B10.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK: T: for (...; [B10.10]; )
-// CHECK: Preds (2): B2 B11
-// CHECK: Succs (2): B9 B1
-// CHECK: [B11]
-// CHECK: 1: (CXXConstructExpr, class A)
-// CHECK: 2: A a;
-// CHECK: 3: (CXXConstructExpr, class A)
-// CHECK: 4: A b;
-// CHECK: Preds (1): B12
-// CHECK: Succs (1): B10
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (2): B1 B4
-// CHECK: [B3 (ENTRY)]
-// CHECK: Succs (1): B0
-// CHECK: [B1]
-// CHECK: T: try ...
-// CHECK: Succs (2): B2 B0
-// CHECK: [B2]
-// CHECK: catch (const A &e):
-// CHECK: 1: catch (const A &e) {
-// CHECK: }
-// CHECK: Preds (1): B1
-// CHECK: Succs (1): B0
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (3): B2 B1 B3
-// CHECK: [B3 (ENTRY)]
-// CHECK: Succs (1): B0
-// CHECK: [B1]
-// CHECK: T: try ...
-// CHECK: Succs (2): B2 B0
-// CHECK: [B2]
-// CHECK: catch (A e):
-// CHECK: 1: catch (A e) {
-// CHECK: }
-// CHECK: 2: [B2.1].~A() (Implicit destructor)
-// CHECK: Preds (1): B1
-// CHECK: Succs (1): B0
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (3): B2 B1 B3
-
diff --git a/test/Analysis/blocks.m b/test/Analysis/blocks.m
index 2fa5a8e1a8a9..62d53607b533 100644
--- a/test/Analysis/blocks.m
+++ b/test/Analysis/blocks.m
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify -x objective-c++ %s
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from Mac OS X headers:
@@ -13,6 +14,10 @@ void dispatch_async(dispatch_queue_t queue, dispatch_block_t block);
__attribute__((visibility("default"))) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) dispatch_queue_t dispatch_queue_create(const char *label, dispatch_queue_attr_t attr);
typedef long dispatch_once_t;
void dispatch_once(dispatch_once_t *predicate, dispatch_block_t block);
+dispatch_queue_t
+dispatch_queue_create(const char *label, dispatch_queue_attr_t attr);
+
+
typedef signed char BOOL;
typedef unsigned long NSUInteger;
typedef struct _NSZone NSZone;
@@ -56,8 +61,8 @@ void test1(NSString *format, ...) {
do {
if (__builtin_expect(*(&pred), ~0l) != ~0l)
dispatch_once(&pred, ^{
- logQueue = dispatch_queue_create("com.mycompany.myproduct.asl", ((void*)0));
- client = asl_open(((void*)0), "com.mycompany.myproduct", 0);
+ logQueue = dispatch_queue_create("com.mycompany.myproduct.asl", 0);
+ client = asl_open(((char*)0), "com.mycompany.myproduct", 0);
});
} while (0);
@@ -65,7 +70,7 @@ void test1(NSString *format, ...) {
__builtin_va_start(args, format);
NSString *str = [[NSString alloc] initWithFormat:format arguments:args];
- dispatch_async(logQueue, ^{ asl_log(client, ((void*)0), 4, "%s", [str UTF8String]); });
+ dispatch_async(logQueue, ^{ asl_log(client, ((aslmsg)0), 4, "%s", [str UTF8String]); });
[str release];
__builtin_va_end(args);
@@ -123,3 +128,37 @@ void testMessaging() {
});
}
@end
+
+void testReturnVariousSignatures() {
+ (void)^int(){
+ return 42;
+ }();
+
+ (void)^int{
+ return 42;
+ }();
+
+ (void)^(){
+ return 42;
+ }();
+
+ (void)^{
+ return 42;
+ }();
+}
+
+// This test used to cause infinite loop in the region invalidation.
+void blockCapturesItselfInTheLoop(int x, int m) {
+ void (^assignData)(int) = ^(int x){
+ x++;
+ };
+ while (m < 0) {
+ void (^loop)(int);
+ loop = ^(int x) {
+ assignData(x);
+ };
+ assignData = loop;
+ m++;
+ }
+ assignData(x);
+}
diff --git a/test/Analysis/builtin-functions.cpp b/test/Analysis/builtin-functions.cpp
new file mode 100644
index 000000000000..72d5ad23b16e
--- /dev/null
+++ b/test/Analysis/builtin-functions.cpp
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection %s -std=c++11 -verify
+
+void clang_analyzer_eval(bool);
+
+void testAddressof(int x) {
+ clang_analyzer_eval(&x == __builtin_addressof(x)); // expected-warning{{TRUE}}
+}
+
+void testSize() {
+ struct {
+ int x;
+ int y;
+ char z;
+ } object;
+ clang_analyzer_eval(__builtin_object_size(&object.y, 0) == sizeof(object) - sizeof(int)); // expected-warning{{TRUE}}
+
+ // Clang can't actually evaluate these builtin "calls", but importantly they don't actually evaluate the argument expression either.
+ int i = 0;
+ char buf[10];
+ clang_analyzer_eval(__builtin_object_size(&buf[i++], 0) == sizeof(buf)); // expected-warning{{FALSE}}
+ clang_analyzer_eval(__builtin_object_size(&buf[++i], 0) == sizeof(buf) - 1); // expected-warning{{FALSE}}
+
+ clang_analyzer_eval(i == 0); // expected-warning{{TRUE}}
+}
diff --git a/test/Analysis/casts.cpp b/test/Analysis/casts.cpp
new file mode 100644
index 000000000000..339539189ed7
--- /dev/null
+++ b/test/Analysis/casts.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
+// expected-no-diagnostics
+
+bool PR14634(int x) {
+ double y = (double)x;
+ return !y;
+}
+
+bool PR14634_implicit(int x) {
+ double y = (double)x;
+ return y;
+}
diff --git a/test/Analysis/casts.m b/test/Analysis/casts.m
index 1a78940eee25..895c8119c180 100644
--- a/test/Analysis/casts.m
+++ b/test/Analysis/casts.m
@@ -1,9 +1,7 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
// expected-no-diagnostics
-// Test function pointer casts. Currently we track function addresses using
-// loc::FunctionVal. Because casts can be arbitrary, do we need to model
-// functions with regions?
+// Test function pointer casts.
typedef void* (*MyFuncTest1)(void);
MyFuncTest1 test1_aux(void);
@@ -14,8 +12,7 @@ void test1(void) {
if (p != ((void*) 0)) x = (*p)();
}
-// Test casts from void* to function pointers. Same issue as above:
-// should we eventually model function pointers using regions?
+// Test casts from void* to function pointers.
void* test2(void *p) {
MyFuncTest1 fp = (MyFuncTest1) p;
return (*fp)();
@@ -41,3 +38,9 @@ adium_media_ready_cb(RDR10087620 *InObj)
{
InObj.elem |= EEOne;
}
+
+
+// PR16690
+_Bool testLocAsIntegerToBool() {
+ return (long long)&testLocAsIntegerToBool;
+}
diff --git a/test/Analysis/cfg.cpp b/test/Analysis/cfg.cpp
index 8c1c7653db13..660d1f264694 100644
--- a/test/Analysis/cfg.cpp
+++ b/test/Analysis/cfg.cpp
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -analyze -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
-// Check the wrapping behavior when dumping the CFG.
+// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++11 %s 2>&1 | FileCheck %s
// CHECK: ENTRY
// CHECK-NEXT: Succs (1): B1
@@ -11,7 +10,7 @@
// CHECK-NEXT: Preds (21): B2 B3 B4 B5 B6 B7 B8 B9
// CHECK-NEXT: B10 B11 B12 B13 B14 B15 B16 B17 B18 B19
// CHECK-NEXT: B20 B21 B1
-void test(int i) {
+void checkWrap(int i) {
switch(i) {
case 0: break;
case 1: break;
@@ -35,3 +34,150 @@ void test(int i) {
case 19: break;
}
}
+
+// CHECK: ENTRY
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B1]
+// CHECK-NEXT: 1: int i;
+// CHECK-NEXT: 2: int j;
+// CHECK-NEXT: 3: 1
+// CHECK-NEXT: 4: int k = 1;
+// CHECK-NEXT: 5: int l;
+// CHECK-NEXT: 6: 2
+// CHECK-NEXT: 7: int m = 2;
+// CHECK-NEXT: CXXConstructExpr
+// CHECK-NEXT: 9: struct standalone myStandalone;
+// CHECK-NEXT: CXXConstructExpr
+// CHECK-NEXT: 11: struct <anonymous struct at {{.*}}> myAnon;
+// CHECK-NEXT: CXXConstructExpr
+// CHECK-NEXT: 13: struct named myNamed;
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B0
+void checkDeclStmts() {
+ int i, j;
+ int k = 1, l, m = 2;
+
+ struct standalone { int x, y; };
+ struct standalone myStandalone;
+
+ struct { int x, y; } myAnon;
+
+ struct named { int x, y; } myNamed;
+
+ static_assert(1, "abc");
+}
+
+// CHECK: ENTRY
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B1]
+// CHECK-NEXT: 1: e
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, LValueToRValue, enum EmptyE)
+// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, IntegralCast, int)
+// CHECK-NEXT: T: switch [B1.3]
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
+enum EmptyE {};
+void F(EmptyE e) {
+ switch (e) {}
+}
+
+// CHECK: ENTRY
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B1]
+// CHECK-NEXT: 1: __builtin_object_size
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, BuiltinFnToFnPtr, unsigned long (*)(const void *, int))
+// CHECK-NEXT: 3: [B1.2](dummy(), 0)
+// CHECK-NEXT: 4: (void)[B1.3] (CStyleCastExpr, ToVoid, void)
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
+void testBuiltinSize() {
+ extern int *dummy();
+ (void)__builtin_object_size(dummy(), 0);
+}
+
+
+class A {
+public:
+ A() {}
+ ~A() {}
+};
+
+// CHECK: [B2 (ENTRY)]
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B1]
+// CHECK-NEXT: 1: (CXXConstructExpr, class A)
+// CHECK-NEXT: 2: new A([B1.1])
+// CHECK-NEXT: 3: A *a = new A();
+// CHECK-NEXT: 4: a
+// CHECK-NEXT: 5: [B1.4] (ImplicitCastExpr, LValueToRValue, class A *)
+// CHECK-NEXT: 6: [B1.5]->~A() (Implicit destructor)
+// CHECK-NEXT: 7: delete [B1.5]
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
+void test_deletedtor() {
+ A *a = new A();
+ delete a;
+}
+
+// CHECK: [B2 (ENTRY)]
+// CHECK-NEXT: Succs (1): B1
+// CHECK: [B1]
+// CHECK-NEXT: 1: 5
+// CHECK-NEXT: 2: (CXXConstructExpr, class A)
+// CHECK-NEXT: 3: new A {{\[\[}}B1.1]]
+// CHECK-NEXT: 4: A *a = new A [5];
+// CHECK-NEXT: 5: a
+// CHECK-NEXT: 6: [B1.5] (ImplicitCastExpr, LValueToRValue, class A *)
+// CHECK-NEXT: 7: [B1.6]->~A() (Implicit destructor)
+// CHECK-NEXT: 8: delete [] [B1.6]
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (1): B1
+void test_deleteArraydtor() {
+ A *a = new A[5];
+ delete[] a;
+}
+
+
+namespace NoReturnSingleSuccessor {
+ struct A {
+ A();
+ ~A();
+ };
+
+ struct B : public A {
+ B();
+ ~B() __attribute__((noreturn));
+ };
+
+// CHECK: ENTRY
+// CHECK: 1: 1
+// CHECK-NEXT: 2: return
+// CHECK-NEXT: ~B() (Implicit destructor)
+// CHECK-NEXT: Preds (1)
+// CHECK-NEXT: Succs (1): B0
+ int test1(int *x) {
+ B b;
+ if (x)
+ return 1;
+ }
+
+// CHECK: ENTRY
+// CHECK: 1: 1
+// CHECK-NEXT: 2: return
+// CHECK-NEXT: destructor
+// CHECK-NEXT: Preds (1)
+// CHECK-NEXT: Succs (1): B0
+ int test2(int *x) {
+ const A& a = B();
+ if (x)
+ return 1;
+ }
+}
diff --git a/test/Analysis/conditional-operator.cpp b/test/Analysis/conditional-operator.cpp
index 5a3c325b91d4..137dc3987755 100644
--- a/test/Analysis/conditional-operator.cpp
+++ b/test/Analysis/conditional-operator.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang -cc1 -analyze -analyzer-checker=core,debug.ExprInspection %s -analyzer-output=text -verify
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection %s -analyzer-output=text -verify
void clang_analyzer_eval(bool);
diff --git a/test/Analysis/conditional-operator-path-notes.c b/test/Analysis/conditional-path-notes.c
index a8af394a26d4..23784970e1f4 100644
--- a/test/Analysis/conditional-operator-path-notes.c
+++ b/test/Analysis/conditional-path-notes.c
@@ -1,5 +1,5 @@
// RUN: %clang --analyze %s -Xanalyzer -analyzer-output=text -Xclang -verify
-// RUN: %clang --analyze %s -o %t
+// RUN: %clang --analyze %s -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t
// RUN: FileCheck --input-file=%t %s
void testCondOp(int *p) {
@@ -55,6 +55,32 @@ void testBinaryLHSProblem(int *p) {
(void)x;
}
+void testDiagnosableBranch(int a) {
+ if (a) {
+ // expected-note@-1 {{Assuming 'a' is not equal to 0}}
+ // expected-note@-2 {{Taking true branch}}
+ *(volatile int *)0 = 1; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1 {{Dereference of null pointer}}
+ }
+}
+
+void testNonDiagnosableBranchLogical(int a, int b) {
+ if (a && b) {
+ // expected-note@-1 {{Left side of '&&' is true}}
+ // expected-note@-2 {{Taking true branch}}
+ *(volatile int *)0 = 1; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1 {{Dereference of null pointer}}
+ }
+}
+
+void testNonDiagnosableBranchArithmetic(int a, int b) {
+ if (a - b) {
+ // expected-note@-1 {{Taking true branch}}
+ *(volatile int *)0 = 1; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1 {{Dereference of null pointer}}
+ }
+}
+
// CHECK: <key>diagnostics</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
@@ -1080,4 +1106,477 @@ void testBinaryLHSProblem(int *p) {
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;a&apos; is not equal to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;a&apos; is not equal to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testDiagnosableBranch</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testNonDiagnosableBranchLogical</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testNonDiagnosableBranchArithmetic</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
diff --git a/test/Analysis/crash-trace.c b/test/Analysis/crash-trace.c
new file mode 100644
index 000000000000..a2f318d86579
--- /dev/null
+++ b/test/Analysis/crash-trace.c
@@ -0,0 +1,19 @@
+// RUN: not --crash %clang_cc1 -analyze -analyzer-checker=debug.ExprInspection %s 2>&1 | FileCheck %s
+// REQUIRES: crash-recovery
+
+void clang_analyzer_crash(void);
+
+void inlined() {
+ clang_analyzer_crash();
+}
+
+void test() {
+ inlined();
+}
+
+// CHECK: 0. Program arguments: {{.*}}clang
+// CHECK-NEXT: 1. <eof> parser at end of file
+// CHECK-NEXT: 2. While analyzing stack:
+// CHECK-NEXT: #0 void inlined()
+// CHECK-NEXT: #1 void test()
+// CHECK-NEXT: 3. {{.*}}crash-trace.c:{{[0-9]+}}:3: Error evaluating statement
diff --git a/test/Analysis/ctor-inlining.mm b/test/Analysis/ctor.mm
index 8cdb005968c3..77c87905e1f7 100644
--- a/test/Analysis/ctor-inlining.mm
+++ b/test/Analysis/ctor.mm
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -fobjc-arc -analyzer-config c++-inlining=constructors -Wno-null-dereference -std=c++11 -verify %s
+#include "Inputs/system-header-simulator-cxx.h"
+
void clang_analyzer_eval(bool);
void clang_analyzer_checkInlined(bool);
@@ -500,3 +502,175 @@ namespace ArrayMembers {
clang_analyzer_eval(c.values[2].x == 3); // expected-warning{{UNKNOWN}}
}
};
+
+namespace VirtualInheritance {
+ int counter;
+
+ struct base {
+ base() {
+ ++counter;
+ }
+ };
+
+ struct virtual_subclass : public virtual base {
+ virtual_subclass() {}
+ };
+
+ struct double_subclass : public virtual_subclass {
+ double_subclass() {}
+ };
+
+ void test() {
+ counter = 0;
+ double_subclass obj;
+ clang_analyzer_eval(counter == 1); // expected-warning{{TRUE}}
+ }
+
+ struct double_virtual_subclass : public virtual virtual_subclass {
+ double_virtual_subclass() {}
+ };
+
+ void testVirtual() {
+ counter = 0;
+ double_virtual_subclass obj;
+ clang_analyzer_eval(counter == 1); // expected-warning{{TRUE}}
+ }
+}
+
+namespace ZeroInitialization {
+ struct raw_pair {
+ int p1;
+ int p2;
+ };
+
+ void testVarDecl() {
+ raw_pair p{};
+ clang_analyzer_eval(p.p1 == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(p.p2 == 0); // expected-warning{{TRUE}}
+ }
+
+ void testTemporary() {
+ clang_analyzer_eval(raw_pair().p1 == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(raw_pair().p2 == 0); // expected-warning{{TRUE}}
+ }
+
+ void testArray() {
+ raw_pair p[2] = {};
+ clang_analyzer_eval(p[0].p1 == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(p[0].p2 == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(p[1].p1 == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(p[1].p2 == 0); // expected-warning{{TRUE}}
+ }
+
+ void testNew() {
+ // FIXME: Pending proper implementation of constructors for 'new'.
+ raw_pair *pp = new raw_pair();
+ clang_analyzer_eval(pp->p1 == 0); // expected-warning{{UNKNOWN}}
+ clang_analyzer_eval(pp->p2 == 0); // expected-warning{{UNKNOWN}}
+ }
+
+ void testArrayNew() {
+ // FIXME: Pending proper implementation of constructors for 'new[]'.
+ raw_pair *p = new raw_pair[2]();
+ clang_analyzer_eval(p[0].p1 == 0); // expected-warning{{UNKNOWN}}
+ clang_analyzer_eval(p[0].p2 == 0); // expected-warning{{UNKNOWN}}
+ clang_analyzer_eval(p[1].p1 == 0); // expected-warning{{UNKNOWN}}
+ clang_analyzer_eval(p[1].p2 == 0); // expected-warning{{UNKNOWN}}
+ }
+
+ struct initializing_pair {
+ public:
+ int x;
+ raw_pair y;
+ initializing_pair() : x(), y() {}
+ };
+
+ void testFieldInitializers() {
+ initializing_pair p;
+ clang_analyzer_eval(p.x == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(p.y.p1 == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(p.y.p2 == 0); // expected-warning{{TRUE}}
+ }
+
+ struct subclass : public raw_pair {
+ subclass() = default;
+ };
+
+ void testSubclass() {
+ subclass p;
+ clang_analyzer_eval(p.p1 == 0); // expected-warning{{garbage}}
+ }
+
+ struct initializing_subclass : public raw_pair {
+ initializing_subclass() : raw_pair() {}
+ };
+
+ void testInitializingSubclass() {
+ initializing_subclass p;
+ clang_analyzer_eval(p.p1 == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(p.p2 == 0); // expected-warning{{TRUE}}
+ }
+
+ struct pair_wrapper {
+ pair_wrapper() : p() {}
+ raw_pair p;
+ };
+
+ struct virtual_subclass : public virtual pair_wrapper {
+ virtual_subclass() {}
+ };
+
+ struct double_virtual_subclass : public virtual_subclass {
+ double_virtual_subclass() {
+ // This previously caused a crash because the pair_wrapper subobject was
+ // initialized twice.
+ }
+ };
+
+ class Empty {
+ public:
+ Empty();
+ };
+
+ class PairContainer : public Empty {
+ raw_pair p;
+ public:
+ PairContainer() : Empty(), p() {
+ // This previously caused a crash because the empty base class looked
+ // like an initialization of 'p'.
+ }
+ PairContainer(int) : Empty(), p() {
+ // Test inlining something else here.
+ }
+ };
+
+ class PairContainerContainer {
+ int padding;
+ PairContainer pc;
+ public:
+ PairContainerContainer() : pc(1) {}
+ };
+}
+
+namespace InitializerList {
+ struct List {
+ bool usedInitializerList;
+
+ List() : usedInitializerList(false) {}
+ List(std::initializer_list<int>) : usedInitializerList(true) {}
+ };
+
+ void testStatic() {
+ List defaultCtor;
+ clang_analyzer_eval(!defaultCtor.usedInitializerList); // expected-warning{{TRUE}}
+
+ List list{1, 2};
+ clang_analyzer_eval(list.usedInitializerList); // expected-warning{{TRUE}}
+ }
+
+ void testDynamic() {
+ List *list = new List{1, 2};
+ // FIXME: When we handle constructors with 'new', this will be TRUE.
+ clang_analyzer_eval(list->usedInitializerList); // expected-warning{{UNKNOWN}}
+ }
+}
diff --git a/test/Analysis/cxx-for-range.cpp b/test/Analysis/cxx-for-range.cpp
new file mode 100644
index 000000000000..fe73e51410a8
--- /dev/null
+++ b/test/Analysis/cxx-for-range.cpp
@@ -0,0 +1,1668 @@
+// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=core -analyzer-config path-diagnostics-alternate=true -analyzer-output=plist-multi-file -o %t.plist -verify %s
+// RUN: FileCheck --input-file=%t.plist %s
+
+extern void work();
+
+void testLoop() {
+ int z[] = {1,2};
+ for (int y : z) {
+ work();
+ work();
+ if (y == 2)
+ *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
+ work();
+ work();
+ (void)y;
+ }
+
+ *(volatile int *)0 = 1; // no-warning
+}
+
+class MagicVector {
+public:
+ MagicVector();
+
+ using iterator = int *;
+
+ iterator begin() const;
+ iterator end() const;
+};
+
+MagicVector get(bool fail = false) {
+ if (fail)
+ *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
+ return MagicVector{};
+}
+
+void testLoopOpaqueCollection() {
+ for (int y : get()) {
+ work();
+ work();
+ if (y == 2)
+ *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
+ work();
+ work();
+ (void)y;
+ }
+
+ *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
+}
+
+
+class MagicVector2 {
+public:
+ MagicVector2();
+
+ class iterator {
+ public:
+ int operator*() const;
+ iterator &operator++();
+ bool operator==(const iterator &);
+ bool operator!=(const iterator &);
+ };
+
+ iterator begin() const;
+ iterator end() const;
+};
+
+MagicVector2 get2() {
+ return MagicVector2{};
+}
+
+void testLoopOpaqueIterator() {
+ for (int y : get2()) {
+ work();
+ work();
+ if (y == 2)
+ *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
+ work();
+ work();
+ (void)y;
+ }
+
+ *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
+}
+
+
+void testLoopErrorInRange() {
+ for (int y : get(true)) { // error inside get()
+ work();
+ work();
+ if (y == 2)
+ *(volatile int *)0 = 1; // no-warning
+ work();
+ work();
+ (void)y;
+ }
+
+ *(volatile int *)0 = 1; // no-warning
+}
+// CHECK: <key>diagnostics</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>8</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testLoop</string>
+// CHECK-NEXT: <key>issue_hash</key><string>6</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;get&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;get&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>31</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;testLoopErrorInRange&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;testLoopErrorInRange&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>31</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>31</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>32</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>32</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>32</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>32</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>33</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>33</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>33</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>33</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>33</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>33</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>33</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>33</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>33</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>get</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>33</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;y&apos; is equal to 2</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;y&apos; is equal to 2</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>42</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>42</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>42</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>42</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>42</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>42</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>42</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>42</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>42</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testLoopOpaqueCollection</string>
+// CHECK-NEXT: <key>issue_hash</key><string>5</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>42</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testLoopOpaqueCollection</string>
+// CHECK-NEXT: <key>issue_hash</key><string>11</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>74</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>74</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>74</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>74</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;y&apos; is equal to 2</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;y&apos; is equal to 2</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testLoopOpaqueIterator</string>
+// CHECK-NEXT: <key>issue_hash</key><string>5</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testLoopOpaqueIterator</string>
+// CHECK-NEXT: <key>issue_hash</key><string>11</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
diff --git a/test/Analysis/cxx11-crashes.cpp b/test/Analysis/cxx11-crashes.cpp
index d0b9222b6a66..3c33de33558f 100644
--- a/test/Analysis/cxx11-crashes.cpp
+++ b/test/Analysis/cxx11-crashes.cpp
@@ -65,3 +65,32 @@ bool begin(double *it) {
bool *a = reinterpret_cast<type &>(*( reinterpret_cast<char *>( it )));
return *a;
}
+
+// radar://14164698 Don't crash on "assuming" a ComoundVal.
+class JSONWireProtocolInputStream {
+public:
+ virtual ~JSONWireProtocolInputStream();
+};
+class JSONWireProtocolReader {
+public:
+ JSONWireProtocolReader(JSONWireProtocolInputStream& istream)
+ : _istream{istream} {} // On evaluating a bind here,
+ // the dereference checker issues an assume on a CompoundVal.
+~JSONWireProtocolReader();
+private:
+JSONWireProtocolInputStream& _istream;
+};
+class SocketWireProtocolStream : public JSONWireProtocolInputStream {
+};
+void test() {
+ SocketWireProtocolStream stream{};
+ JSONWireProtocolReader reader{stream};
+}
+
+// This crashed because the analyzer did not understand AttributedStmts.
+void fallthrough() {
+ switch (1) {
+ case 1:
+ [[clang::fallthrough]];
+ }
+}
diff --git a/test/Analysis/derived-to-base.cpp b/test/Analysis/derived-to-base.cpp
index 0664189a9564..e9c7ca8f731f 100644
--- a/test/Analysis/derived-to-base.cpp
+++ b/test/Analysis/derived-to-base.cpp
@@ -450,3 +450,28 @@ namespace PR15394 {
}
};
+namespace Bug16309 {
+ struct Incomplete;
+
+ struct Base { virtual ~Base(); };
+
+ struct Derived : public Base { int x; };
+
+ void* f(Incomplete *i) {
+ Base *b = reinterpret_cast<Base *>(i);
+ // This used to crash because of the reinterpret_cast above.
+ Derived *d = dynamic_cast<Derived *>(b);
+ return d;
+ }
+
+ // And check that reinterpret+dynamic casts work correctly after the fix.
+ void g() {
+ Derived d;
+ d.x = 47;
+ Base *b = &d;
+ Incomplete *i = reinterpret_cast<Incomplete *>(b);
+ Base *b2 = reinterpret_cast<Base *>(i);
+ Derived *d2 = dynamic_cast<Derived *>(b2);
+ clang_analyzer_eval(d2->x == 47); // expected-warning{{TRUE}}
+ }
+}
diff --git a/test/Analysis/diagnostics/Inputs/include/report-issues-within-main-file.h b/test/Analysis/diagnostics/Inputs/include/report-issues-within-main-file.h
new file mode 100644
index 000000000000..9ecef343f5ee
--- /dev/null
+++ b/test/Analysis/diagnostics/Inputs/include/report-issues-within-main-file.h
@@ -0,0 +1,43 @@
+template<typename _Tp>
+class auto_ptr {
+private:
+ _Tp* _M_ptr;
+public:
+ auto_ptr(_Tp* __p = 0) throw() : _M_ptr(__p) { }
+ ~auto_ptr() { delete _M_ptr; }
+};
+
+void cause_div_by_zero_in_header(int in) {
+ int h = 0;
+ h = in/h;
+ h++;
+}
+
+void do_something (int in) {
+ in++;
+ in++;
+}
+
+void cause_div_by_zero_in_header2(int in) {
+ int h2 = 0;
+ h2 = in/h2;
+ h2++;
+}
+
+# define CALLS_BUGGY_FUNCTION2 cause_div_by_zero_in_header2(5);
+
+void cause_div_by_zero_in_header3(int in) {
+ int h3 = 0;
+ h3 = in/h3;
+ h3++;
+}
+
+# define CALLS_BUGGY_FUNCTION3 cause_div_by_zero_in_header3(5);
+
+void cause_div_by_zero_in_header4(int in) {
+ int h4 = 0;
+ h4 = in/h4;
+ h4++;
+}
+
+# define TAKE_CALL_AS_ARG(c) c;
diff --git a/test/Analysis/diagnostics/Inputs/include/sys/queue.h b/test/Analysis/diagnostics/Inputs/include/sys/queue.h
index e5698ed443b7..2740e174f257 100644
--- a/test/Analysis/diagnostics/Inputs/include/sys/queue.h
+++ b/test/Analysis/diagnostics/Inputs/include/sys/queue.h
@@ -1,4 +1,3 @@
-#pragma clang system_header
void free(void *);
#define FREE_POINTER(x) free(x)
diff --git a/test/Analysis/diagnostics/deref-track-symbolic-region.c b/test/Analysis/diagnostics/deref-track-symbolic-region.c
index 03716de9ffec..36d56f1f144f 100644
--- a/test/Analysis/diagnostics/deref-track-symbolic-region.c
+++ b/test/Analysis/diagnostics/deref-track-symbolic-region.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
struct S {
diff --git a/test/Analysis/diagnostics/explicit-suppression.cpp b/test/Analysis/diagnostics/explicit-suppression.cpp
index 57d2d16f89cc..78067573e322 100644
--- a/test/Analysis/diagnostics/explicit-suppression.cpp
+++ b/test/Analysis/diagnostics/explicit-suppression.cpp
@@ -12,6 +12,6 @@ void clang_analyzer_eval(bool);
void testCopyNull(int *I, int *E) {
std::copy(I, E, (int *)0);
#ifndef SUPPRESSED
- // expected-warning@../Inputs/system-header-simulator-cxx.h:80 {{Dereference of null pointer}}
+ // expected-warning@../Inputs/system-header-simulator-cxx.h:110 {{Dereference of null pointer}}
#endif
}
diff --git a/test/Analysis/diagnostics/report-issues-within-main-file.cpp b/test/Analysis/diagnostics/report-issues-within-main-file.cpp
new file mode 100644
index 000000000000..ec8106f6000a
--- /dev/null
+++ b/test/Analysis/diagnostics/report-issues-within-main-file.cpp
@@ -0,0 +1,1756 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -analyzer-output=plist-multi-file -analyzer-config report-in-main-source-file=true -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
+// RUN: FileCheck --input-file=%t.plist %s
+#include "Inputs/include/report-issues-within-main-file.h"
+
+void mainPlusHeader() {
+ auto_ptr<int> B (new int[5]);
+}
+
+void auxInMain() {
+ int j = 0;
+ j++;
+ cause_div_by_zero_in_header(j);
+ j--;
+}
+void mainPlusMainPlusHeader() {
+ int i = 0;
+ i++;
+ auxInMain();
+ i++;
+}
+
+void causeDivByZeroInMain(int in) {
+ int m = 0;
+ m = in/m;
+ m++;
+}
+void mainPlusMain() {
+ int i = 0;
+ i++;
+ causeDivByZeroInMain(i);
+ i++;
+}
+
+void causeDivByZeroInMain2(int in) {
+ int m2 = 0;
+ m2 = in/m2;
+ m2++;
+}
+
+void mainPlustHeaderCallAndReturnPlusMain() {
+ int i = 0;
+ i++;
+ do_something(i);
+ causeDivByZeroInMain2(i);
+ i++;
+}
+
+void callInMacro() {
+ int j = 0;
+ j++;
+ CALLS_BUGGY_FUNCTION2;
+ j--;
+}
+
+void callInMacro3() {
+ int j = 0;
+ j++;
+ CALLS_BUGGY_FUNCTION3;
+ j--;
+}
+
+void callCallInMacro3() {
+ callInMacro3();
+}
+
+void callInMacroArg() {
+ int j = 0;
+ j++;
+ TAKE_CALL_AS_ARG(cause_div_by_zero_in_header4(5));
+ j--;
+}
+
+// CHECK: <key>diagnostics</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;cause_div_by_zero_in_header2&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;cause_div_by_zero_in_header2&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;callInMacro&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;callInMacro&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>22</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>22</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>22</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>22</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>22</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;h2&apos; initialized to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;h2&apos; initialized to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>22</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>22</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Division by zero</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Division by zero</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>cause_div_by_zero_in_header2</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>63</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>63</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>63</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;callInMacro3&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;callInMacro3&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>55</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;callCallInMacro3&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;callCallInMacro3&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>55</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>55</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;cause_div_by_zero_in_header3&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;cause_div_by_zero_in_header3&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>29</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>2</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;callInMacro3&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;callInMacro3&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>29</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>29</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>2</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;h3&apos; initialized to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;h3&apos; initialized to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>31</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>31</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>31</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>31</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>31</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>2</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Division by zero</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Division by zero</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>cause_div_by_zero_in_header3</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>31</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>69</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>69</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>69</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;cause_div_by_zero_in_header4&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;cause_div_by_zero_in_header4&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;callInMacroArg&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;callInMacroArg&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;h4&apos; initialized to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;h4&apos; initialized to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Division by zero</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Division by zero</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>cause_div_by_zero_in_header4</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>29</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Memory is allocated</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Memory is allocated</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>6</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>key_event</key><true/>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;~auto_ptr&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;~auto_ptr&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;mainPlusHeader&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;mainPlusHeader&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>29</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Memory allocated by &apos;new[]&apos; should be deallocated by &apos;delete[]&apos;, not &apos;delete&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Memory allocated by &apos;new[]&apos; should be deallocated by &apos;delete[]&apos;, not &apos;delete&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Memory allocated by &apos;new[]&apos; should be deallocated by &apos;delete[]&apos;, not &apos;delete&apos; (within a call to &apos;~auto_ptr&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Memory Error</string>
+// CHECK-NEXT: <key>type</key><string>Bad deallocator</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>mainPlusHeader</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>7</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>18</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>18</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>18</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>18</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>18</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;auxInMain&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;auxInMain&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;mainPlusMainPlusHeader&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;mainPlusMainPlusHeader&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>29</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>key_event</key><true/>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>32</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;cause_div_by_zero_in_header&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;cause_div_by_zero_in_header&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>2</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;auxInMain&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;auxInMain&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>2</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;h&apos; initialized to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;h&apos; initialized to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>1</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>2</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Division by zero (within a call to &apos;cause_div_by_zero_in_header&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Division by zero</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>auxInMain</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>12</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>25</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;causeDivByZeroInMain&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;causeDivByZeroInMain&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>22</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;mainPlusMain&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;mainPlusMain&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>22</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>22</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;m&apos; initialized to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;m&apos; initialized to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>23</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Division by zero</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Division by zero</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>causeDivByZeroInMain</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>24</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>43</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>43</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>43</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>43</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>44</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>44</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>44</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>44</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>44</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;causeDivByZeroInMain2&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;causeDivByZeroInMain2&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>34</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;mainPlustHeaderCallAndReturnPlusMain&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;mainPlustHeaderCallAndReturnPlusMain&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>34</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>34</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>35</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>35</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>35</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>35</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>35</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;m2&apos; initialized to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;m2&apos; initialized to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>35</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>35</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Division by zero</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Division by zero</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>causeDivByZeroInMain2</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
diff --git a/test/Analysis/diagnostics/text-diagnostics.c b/test/Analysis/diagnostics/text-diagnostics.c
new file mode 100644
index 000000000000..592521672ff4
--- /dev/null
+++ b/test/Analysis/diagnostics/text-diagnostics.c
@@ -0,0 +1,21 @@
+// RUN: %clang --analyze -Xanalyzer -analyzer-output=text -fno-caret-diagnostics %s 2>&1 | FileCheck %s
+
+void testA() {
+ int *p = 0;
+ *p = 1;
+
+ // CHECK-LABEL: text-diagnostics.c:{{.*}}:6: warning: Dereference of null pointer (loaded from variable 'p')
+ // CHECK-NEXT: text-diagnostics.c:[[@LINE-4]]:3: note: 'p' initialized to a null pointer value
+ // CHECK-NEXT: text-diagnostics.c:[[@LINE-4]]:6: note: Dereference of null pointer (loaded from variable 'p')
+}
+
+void testB(int *q) {
+ if (q)
+ return;
+ *q = 1;
+
+ // CHECK-LABEL: text-diagnostics.c:{{.*}}:6: warning: Dereference of null pointer (loaded from variable 'q')
+ // CHECK-NEXT: text-diagnostics.c:[[@LINE-5]]:7: note: Assuming 'q' is null
+ // CHECK-NEXT: text-diagnostics.c:[[@LINE-6]]:3: note: Taking false branch
+ // CHECK-NEXT: text-diagnostics.c:[[@LINE-5]]:6: note: Dereference of null pointer (loaded from variable 'q')
+}
diff --git a/test/Analysis/diagnostics/undef-value-caller.c b/test/Analysis/diagnostics/undef-value-caller.c
index adfdd4362568..da3a13c2b121 100644
--- a/test/Analysis/diagnostics/undef-value-caller.c
+++ b/test/Analysis/diagnostics/undef-value-caller.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist -o %t %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false -o %t %s
// RUN: FileCheck --input-file %t %s
#include "undef-value-callee.h"
diff --git a/test/Analysis/diagnostics/undef-value-param.c b/test/Analysis/diagnostics/undef-value-param.c
index 5855f507f9f6..dec0a5ada776 100644
--- a/test/Analysis/diagnostics/undef-value-param.c
+++ b/test/Analysis/diagnostics/undef-value-param.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
void foo_irrelevant(int c) {
diff --git a/test/Analysis/diagnostics/undef-value-param.m b/test/Analysis/diagnostics/undef-value-param.m
index 4de83bfb9c82..e977acb70fd9 100644
--- a/test/Analysis/diagnostics/undef-value-param.m
+++ b/test/Analysis/diagnostics/undef-value-param.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx -analyzer-output=text -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx -analyzer-output=plist-multi-file %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
typedef signed char BOOL;
diff --git a/test/Analysis/dtor.cpp b/test/Analysis/dtor.cpp
index 18cd9853f661..11ce0d57ef4f 100644
--- a/test/Analysis/dtor.cpp
+++ b/test/Analysis/dtor.cpp
@@ -401,3 +401,38 @@ namespace LifetimeExtension {
clang_analyzer_eval(SaveOnVirtualDestruct::lastOutput == 42); // expected-warning{{TRUE}}
}
}
+
+namespace NoReturn {
+ struct NR {
+ ~NR() __attribute__((noreturn));
+ };
+
+ void f(int **x) {
+ NR nr;
+ }
+
+ void g() {
+ int *x;
+ f(&x);
+ *x = 47; // no warning
+ }
+}
+
+namespace PseudoDtor {
+ template <typename T>
+ void destroy(T &obj) {
+ clang_analyzer_checkInlined(true); // expected-warning{{TRUE}}
+ obj.~T();
+ }
+
+ void test() {
+ int i;
+ destroy(i);
+ clang_analyzer_eval(true); // expected-warning{{TRUE}}
+ }
+}
+
+namespace Incomplete {
+ class Foo; // expected-note{{forward declaration}}
+ void f(Foo *foo) { delete foo; } // expected-warning{{deleting pointer to incomplete type}}
+}
diff --git a/test/Analysis/edges-new.mm b/test/Analysis/edges-new.mm
new file mode 100644
index 000000000000..8019c15c1b26
--- /dev/null
+++ b/test/Analysis/edges-new.mm
@@ -0,0 +1,19628 @@
+// RUN: %clang -target x86_64-apple-darwin10 --analyze -Xclang -analyzer-config -Xclang path-diagnostics-alternate=true -Xclang -analyzer-output=plist -o %t %s
+// RUN: FileCheck --input-file %t %s
+
+//===----------------------------------------------------------------------===//
+// Forward declarations (from headers).
+//===----------------------------------------------------------------------===//
+
+typedef const struct __CFNumber * CFNumberRef;
+typedef const struct __CFAllocator * CFAllocatorRef;
+extern const CFAllocatorRef kCFAllocatorDefault;
+typedef signed long CFIndex;
+enum {
+ kCFNumberSInt8Type = 1,
+ kCFNumberSInt16Type = 2,
+ kCFNumberSInt32Type = 3,
+ kCFNumberSInt64Type = 4,
+ kCFNumberFloat32Type = 5,
+ kCFNumberFloat64Type = 6,
+ kCFNumberCharType = 7,
+ kCFNumberShortType = 8,
+ kCFNumberIntType = 9,
+ kCFNumberLongType = 10,
+ kCFNumberLongLongType = 11,
+ kCFNumberFloatType = 12,
+ kCFNumberDoubleType = 13,
+ kCFNumberCFIndexType = 14,
+ kCFNumberNSIntegerType = 15,
+ kCFNumberCGFloatType = 16,
+ kCFNumberMaxType = 16
+};
+typedef CFIndex CFNumberType;
+CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr);
+
+#define nil ((id)0)
+
+__attribute__((objc_root_class))
+@interface NSObject
++ (instancetype) alloc;
+- (instancetype) init;
+- (instancetype)retain;
+- (void)release;
+@end
+
+@interface NSArray : NSObject
+@end
+
+//===----------------------------------------------------------------------===//
+// Basic tracking of null and tests for null.
+//===----------------------------------------------------------------------===//
+
+void test_null_init(void) {
+ int *p = 0;
+ *p = 0xDEADBEEF;
+}
+
+void test_null_assign(void) {
+ int *p;
+ p = 0;
+ *p = 0xDEADBEEF;
+}
+
+void test_null_assign_transitive(void) {
+ int *p;
+ p = 0;
+ int *q = p;
+ *q = 0xDEADBEEF;
+}
+
+void test_null_cond(int *p) {
+ if (!p) {
+ *p = 0xDEADBEEF;
+ }
+}
+
+void test_null_cond_transitive(int *q) {
+ if (!q) {
+ int *p = q;
+ *p = 0xDEADBEEF;
+ }
+}
+
+void test_null_field(void) {
+ struct s { int *p; } x;
+ x.p = 0;
+ *(x.p) = 0xDEADBEEF;
+}
+
+void test_assumptions(int a, int b)
+{
+ if (a == 0) {
+ return;
+ }
+ if (b != 0) {
+ return;
+ }
+ int *p = 0;
+ *p = 0xDEADBEEF;
+}
+
+int *bar_cond_assign();
+int test_cond_assign() {
+ int *p;
+ if ((p = bar_cond_assign()))
+ return 1;
+ return *p;
+}
+
+//===----------------------------------------------------------------------===//
+// Diagnostics for leaks and "noreturn" paths.
+//===----------------------------------------------------------------------===//
+
+
+// <rdar://problem/8331641> leak reports should not show paths that end with exit() (but ones that don't end with exit())
+
+void stop() __attribute__((noreturn));
+
+void rdar8331641(int x) {
+ signed z = 1;
+ CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // expected-warning{{leak}}
+ if (x)
+ stop();
+ (void) value;
+}
+
+//===----------------------------------------------------------------------===//
+// Test loops and control-flow.
+//===----------------------------------------------------------------------===//
+
+void test_objc_fast_enumeration(NSArray *x) {
+ id obj;
+ for (obj in x)
+ *(volatile int *)0 = 0;
+}
+
+void test_objc_fast_enumeration_2(id arr) {
+ int x;
+ for (id obj in arr) {
+ x = 1;
+ }
+ x += 1;
+}
+
+// Test that loops are documented in the path.
+void rdar12280665() {
+ for (unsigned i = 0; i < 2; ++i) {
+ if (i == 1) {
+ int *p = 0;
+ *p = 0xDEADBEEF; // expected-warning {{dereference}}
+ }
+ }
+}
+
+// Test for a "loop executed 0 times" diagnostic.
+int *radar12322528_bar();
+
+void radar12322528_for(int x) {
+ int z;
+ int *p = 0;
+ for (unsigned i = 0; i < x; ++i) {
+ p = radar12322528_bar();
+ }
+ *p = 0xDEADBEEF;
+}
+
+void radar12322528_while(int x) {
+ int *p = 0;
+ unsigned i = 0;
+ for ( ; i < x ; ) {
+ ++i;
+ p = radar12322528_bar();
+ }
+ *p = 0xDEADBEEF;
+}
+
+void radar12322528_foo_2() {
+ int *p = 0;
+ for (unsigned i = 0; i < 2; ++i) {
+ if (i == 0)
+ continue;
+
+ if (i == 1) {
+
+ break;
+ }
+ }
+ *p = 0xDEADBEEF;
+}
+
+void test_loop_diagnostics() {
+ int *p = 0;
+ for (int i = 0; i < 2; ++i) { p = 0; }
+ *p = 1;
+}
+
+void test_loop_diagnostics_2() {
+ int *p = 0;
+
+ for (int i = 0; i < 2; ) {
+
+ ++i;
+
+ p = 0;
+
+ }
+
+ *p = 1;
+}
+
+void test_loop_diagnostics_3() {
+ int z;
+ int y;
+ int k;
+ int *p = 0;
+ int i = 0;
+ while (i < 2) {
+ ++i;
+ p = 0;
+ }
+ * p = 1;
+}
+
+void test_do_while() {
+ unsigned i = 0;
+
+ int *p;
+
+ do {
+
+ ++i;
+ p = 0;
+
+ } while (i< 2);
+
+ *p = 0xDEADBEEF;
+}
+
+
+void test_logical_and() {
+ int *p = 0;
+ if (1 && 2) {
+ *p = 0xDEADBEEF;
+ }
+}
+
+void test_logical_or() {
+ int *p = 0;
+ if (0 || 2) {
+ *p = 0xDEADBEEF;
+ }
+}
+
+void test_logical_or_call() {
+ extern int call(int);
+ int *p = 0;
+ if (call(0 || 2)) {
+ *p = 0xDEADBEEF;
+ }
+}
+
+void test_nested_logicals(int coin) {
+ int *p = 0;
+
+ if ((0 || 0) || coin) {
+ *p = 0xDEADBEEF;
+ }
+
+ if (0 || (0 || !coin)) {
+ *p = 0xDEADBEEF;
+ }
+}
+
+void test_deeply_nested_logicals() {
+ extern int call(int);
+ int *p = 0;
+
+ if ((0 || (5 && 0)) ? 0 : ((0 || 4) ? call(1 && 5) : 0)) {
+
+ *p = 0xDEADBEEF;
+ }
+}
+
+void test_ternary(int x, int *y) {
+ int z = x ? 0 : 1;
+
+ int *p = z ? y : 0;
+
+ *p = 0xDEADBEEF;
+}
+
+void testUseless(int *y) {
+ if (y) {
+
+ }
+ if (y) {
+
+ }
+ int *p = 0;
+ *p = 0xDEADBEEF;
+}
+
+//===----------------------------------------------------------------------===//
+// Interprocedural tests.
+//===----------------------------------------------------------------------===//
+
+@interface IPA_Foo
+- (int *) returnsPointer;
+@end
+
+int testFoo(IPA_Foo *x) {
+ if (x)
+ return 1;
+ return *[x returnsPointer];
+}
+
+@interface IPA_X : NSObject
+- (int *)getPointer;
+@end
+
+void test1_IPA_X() {
+ IPA_X *x = nil;
+ *[x getPointer] = 1; // here
+}
+
+
+@interface IPA_Y : NSObject
+- (IPA_Y *)opaque;
+- (IPA_X *)getX;
+@end
+
+@implementation IPA_Y
+- (IPA_X *)getX {
+ return nil;
+}
+@end
+
+void test_IPA_Y(IPA_Y *y) {
+ if (y)
+ return;
+
+ IPA_X *x = [[y opaque] getX]; // here
+ *[x getPointer] = 1;
+}
+
+// From diagnostics/report-issues-within-main-file.cpp:
+void causeDivByZeroInMain(int in) {
+ int m = 0;
+ m = in/m;
+ m++;
+}
+
+void mainPlusMain() {
+ int i = 0;
+ i++;
+ causeDivByZeroInMain(i);
+ i++;
+}
+
+// From inlining/path-notes.c:
+int *getZero() {
+ int *p = 0;
+ return p;
+}
+
+void usePointer(int *p) {
+ *p = 1;
+}
+
+void testUseOfNullPointer() {
+ // Test the case where an argument expression is itself a call.
+ usePointer(getZero());
+}
+
+
+//===----------------------------------------------------------------------===//
+// Misc. tests.
+//===----------------------------------------------------------------------===//
+
+// Test for tracking null state of ivars.
+@interface RDar12114812 : NSObject { char *p; }
+@end
+@implementation RDar12114812
+- (void)test {
+ p = 0;
+ *p = 1;
+}
+@end
+
+// Test diagnostics for initialization of structs.
+void RDar13295437_f(void *i) __attribute__((__nonnull__));
+struct RDar13295437_S { int *i; };
+int RDar13295437() {
+ struct RDar13295437_S s = {0};
+ struct RDar13295437_S *sp = &s;
+ RDar13295437_f(sp->i);
+ return 0;
+}
+
+
+void testCast(int coin) {
+ if (coin) {
+ (void)(1+2);
+ (void)(2+3);
+ (void)(3+4);
+ *(volatile int *)0 = 1;
+ }
+}
+
+// The following previously crashed when generating extensive diagnostics.
+// <rdar://problem/10797980>
+@interface RDar10797980_help
+@property (readonly) int x;
+@end
+@interface RDar10797980 : NSObject {
+ RDar10797980_help *y;
+}
+- (void) test;
+@end
+@implementation RDar10797980
+- (void) test {
+ if (y.x == 1) {
+ int *p = 0;
+ *p = 0xDEADBEEF; // expected-warning {{deference}}
+ }
+}
+
+// The original source for the above Radar contains another problem:
+// if the end-of-path node is an implicit statement, it may not have a valid
+// source location. <rdar://problem/12446776>
+- (void)test2 {
+ if (bar_cond_assign()) {
+ id foo = [[RDar10797980 alloc] init]; // leak
+ }
+ (void)y; // first statement after the 'if' is an implicit 'self' DeclRefExpr
+}
+
+@end
+
+void variousLoops(id input) {
+ extern int a();
+ extern int b();
+ extern int c();
+
+ extern int work();
+
+ while (a()) {
+ work();
+ work();
+ work();
+ *(volatile int *)0 = 1;
+ }
+
+ int first = 1;
+ do {
+ work();
+ work();
+ work();
+ if (!first)
+ *(volatile int *)0 = 1;
+ first = 0;
+ } while (a());
+
+ for (int i = 0; i != b(); ++i) {
+ work();
+ *(volatile int *)0 = 1;
+ }
+
+ for (id x in input) {
+ work();
+ work();
+ work();
+ (void)x;
+ *(volatile int *)0 = 1;
+ }
+
+ int z[] = {1,2};
+ for (int y : z) {
+ work();
+ work();
+ work();
+ (void)y;
+ }
+
+ int empty[] = {};
+ for (int y : empty) {
+ work();
+ work();
+ work();
+ (void)y;
+ }
+
+ for (int i = 0; ; ++i) {
+ work();
+ if (i == b())
+ break;
+ }
+
+ int i;
+ for (i = 0; i != b(); ++i) {
+ work();
+ *(volatile int *)0 = 1;
+ }
+
+ for (; i != b(); ++i) {
+ work();
+ *(volatile int *)0 = 1;
+ }
+
+ for (; i != b(); ) {
+ work();
+ if (i == b())
+ break;
+ *(volatile int *)0 = 1;
+ }
+
+ for (;;) {
+ work();
+ if (i == b())
+ break;
+ }
+
+ *(volatile int *)0 = 1;
+}
+
+void *malloc(unsigned long);
+void *realloc(void *, unsigned long);
+void free(void *);
+
+void reallocDiagnostics() {
+ char * buf = (char*)malloc(100);
+ char * tmp;
+ tmp = (char*)realloc(buf, 0x1000000);
+ if (!tmp) {
+ return;// expected-warning {{leak}}
+ }
+ buf = tmp;
+ free(buf);
+}
+
+template <typename T>
+class unique_ptr {
+ T *ptr;
+public:
+ explicit unique_ptr(T *p) : ptr(p) {}
+ ~unique_ptr() { delete ptr; }
+};
+
+void test() {
+ int i = 0;
+ ++i;
+
+ unique_ptr<int> p(new int[4]);
+ {
+ ++i;
+ }
+}
+
+void longLines() {
+ id foo = [[NSObject alloc] init]; // leak
+ id bar =
+ [foo retain];
+ [bar release];
+ id baz = [foo
+ retain];
+ [baz release];
+ // This next line is intentionally longer than 80 characters.
+ id garply = [foo retain];
+ [garply release];
+}
+
+#define POINTER(T) T*
+POINTER(void) testMacroInFunctionDecl(void *q) {
+ int *p = 0;
+ *p = 1;
+ return q;
+}
+
+namespace rdar14960554 {
+ class Foo {
+ int a = 1;
+ int b = 2;
+ int c = 3;
+
+ Foo() :
+ a(0),
+ c(3) {
+ // Check that we don't have an edge to the in-class initializer for 'b'.
+ if (b == 2)
+ *(volatile int *)0 = 1;
+ }
+ };
+}
+
+// CHECK: <key>diagnostics</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_null_init</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_null_assign</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>63</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>63</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;q&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;q&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;q&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;q&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;q&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_null_assign_transitive</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_null_cond</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;q&apos; is null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;q&apos; is null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_null_cond_transitive</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;x.p&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;x.p&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from field &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from field &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from field &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_null_field</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;a&apos; is not equal to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;a&apos; is not equal to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;b&apos; is equal to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;b&apos; is equal to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_assumptions</string>
+// CHECK-NEXT: <key>issue_hash</key><string>8</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value assigned to &apos;p&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value assigned to &apos;p&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>29</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming pointer value is null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming pointer value is null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_cond_assign</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>118</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>118</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>82</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFNumberCreate&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFNumberCreate&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;x&apos; is 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;x&apos; is 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>122</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>122</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>122</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>122</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>123</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>123</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>123</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;value&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;value&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of an object stored into &apos;value&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>rdar8331641</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>123</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>132</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>132</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>132</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>132</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>132</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>132</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>132</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>132</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>132</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_objc_fast_enumeration</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>132</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;x&apos; is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;x&apos; is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;x&apos; is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead increment</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_objc_fast_enumeration_2</string>
+// CHECK-NEXT: <key>issue_hash</key><string>5</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;x&apos; declared without an initial value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;x&apos; declared without an initial value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>137</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>137</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>137</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>137</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>137</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when collection is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when collection is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>137</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>137</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Assigned value is garbage or undefined</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_objc_fast_enumeration_2</string>
+// CHECK-NEXT: <key>issue_hash</key><string>5</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>150</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>150</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>150</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>150</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>148</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>148</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>148</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>148</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>148</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>148</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>148</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>148</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>148</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>rdar12280665</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>148</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>157</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>157</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>158</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>158</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>158</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>158</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>158</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>158</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>158</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;i&apos; is &gt;= &apos;x&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;i&apos; is &gt;= &apos;x&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>radar12322528_for</string>
+// CHECK-NEXT: <key>issue_hash</key><string>6</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;i&apos; is &gt;= &apos;x&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;i&apos; is &gt;= &apos;x&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>168</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>172</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>172</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>172</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>172</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>172</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>172</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>172</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>172</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>172</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>radar12322528_while</string>
+// CHECK-NEXT: <key>issue_hash</key><string>7</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>172</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>178</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>178</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>178</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>178</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>178</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>178</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>178</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>178</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>183</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>183</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>183</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>183</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>radar12322528_foo_2</string>
+// CHECK-NEXT: <key>issue_hash</key><string>11</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>37</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>192</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>192</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>192</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>192</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>192</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>192</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>192</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>192</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>192</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_loop_diagnostics</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>192</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>196</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>196</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>204</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>204</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>204</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>204</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>204</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>204</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>204</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>204</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>198</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_loop_diagnostics_2</string>
+// CHECK-NEXT: <key>issue_hash</key><string>11</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>210</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>210</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>218</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>218</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>218</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>218</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>217</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>218</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>218</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>218</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>218</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>219</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>219</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>219</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>219</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>219</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>219</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>219</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>219</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>219</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_loop_diagnostics_3</string>
+// CHECK-NEXT: <key>issue_hash</key><string>10</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>219</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>223</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>223</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>229</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>229</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>229</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>229</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>227</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>227</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>227</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>227</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>227</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>227</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>227</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>229</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>229</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>229</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>229</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>234</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>234</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>234</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>234</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>234</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>234</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>234</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>234</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>234</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_do_while</string>
+// CHECK-NEXT: <key>issue_hash</key><string>12</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>234</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>239</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>239</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>239</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>239</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>239</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>240</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>241</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>241</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>241</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>241</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>241</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>241</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>241</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>241</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>241</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_logical_and</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>241</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>246</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>246</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>246</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>246</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>246</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_logical_or</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_logical_or_call</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>264</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>264</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>264</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>264</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>264</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>264</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>264</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>264</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>264</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_nested_logicals</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>264</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>267</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_nested_logicals</string>
+// CHECK-NEXT: <key>issue_hash</key><string>8</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>274</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>274</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>274</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>274</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>274</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>30</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>30</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>31</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>31</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>36</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>36</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>36</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>36</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>46</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>46</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>46</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>46</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>51</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>51</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>51</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>51</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>41</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>44</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>41</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>44</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>276</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>278</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>278</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>278</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>278</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>278</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>278</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>278</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>278</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>278</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_deeply_nested_logicals</string>
+// CHECK-NEXT: <key>issue_hash</key><string>6</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>278</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;x&apos; is not equal to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;x&apos; is not equal to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>283</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>285</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>287</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>287</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>287</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>287</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>287</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>287</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>287</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>287</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>287</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_ternary</string>
+// CHECK-NEXT: <key>issue_hash</key><string>5</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>287</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>291</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>291</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>291</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>291</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>291</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>291</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>291</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;y&apos; is null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;y&apos; is null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>291</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>291</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>294</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>294</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>294</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>294</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>297</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>297</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>297</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>297</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>297</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>297</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>297</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>298</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>298</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>298</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>298</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>298</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>298</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>298</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>298</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>298</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testUseless</string>
+// CHECK-NEXT: <key>issue_hash</key><string>8</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>298</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>310</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>310</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>310</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>310</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>310</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>310</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>310</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;x&apos; is nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;x&apos; is nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>310</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>310</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;returnsPointer&apos; not called because the receiver is nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;returnsPointer&apos; not called because the receiver is nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testFoo</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>312</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>320</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>320</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>320</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;x&apos; initialized to nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;x&apos; initialized to nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>320</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>320</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;getPointer&apos; not called because the receiver is nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;getPointer&apos; not called because the receiver is nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>21</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test1_IPA_X</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>321</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>337</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>337</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>337</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>337</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>337</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>337</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>337</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;y&apos; is nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;y&apos; is nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>337</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>337</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;opaque&apos; not called because the receiver is nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;opaque&apos; not called because the receiver is nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;getX&apos; not called because the receiver is nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;getX&apos; not called because the receiver is nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;x&apos; initialized to nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;x&apos; initialized to nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>340</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;getPointer&apos; not called because the receiver is nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;getPointer&apos; not called because the receiver is nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>21</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_IPA_Y</string>
+// CHECK-NEXT: <key>issue_hash</key><string>5</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>341</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>352</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>352</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>354</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>354</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>354</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>354</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>354</integer>
+// CHECK-NEXT: <key>col</key><integer>25</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;causeDivByZeroInMain&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;causeDivByZeroInMain&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>345</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;mainPlusMain&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;mainPlusMain&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>345</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>345</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>346</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>346</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>346</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>346</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>346</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;m&apos; initialized to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;m&apos; initialized to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>346</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>346</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>347</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>347</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>347</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>347</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>347</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Division by zero</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Division by zero</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>causeDivByZeroInMain</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>347</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>383</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>383</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>383</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Null pointer value stored to &apos;p&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>383</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>383</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>384</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>384</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>384</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>384</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>384</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>384</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>384</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>384</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>384</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from ivar &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from ivar &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from ivar &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>Objective-C method</string>
+// CHECK-NEXT: <key>issue_context</key><string>test</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>384</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>392</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>392</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>392</integer>
+// CHECK-NEXT: <key>col</key><integer>25</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;s.i&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;s.i&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>392</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>392</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>394</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>394</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>394</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>394</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>394</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Null pointer passed as an argument to a &apos;nonnull&apos; parameter</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Null pointer passed as an argument to a &apos;nonnull&apos; parameter</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Null pointer passed as an argument to a &apos;nonnull&apos; parameter</string>
+// CHECK-NEXT: <key>category</key><string>API</string>
+// CHECK-NEXT: <key>type</key><string>Argument with &apos;nonnull&apos; attribute passed null</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>RDar13295437</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>394</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>400</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>400</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>400</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>400</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>400</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>400</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>400</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;coin&apos; is not equal to 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;coin&apos; is not equal to 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>400</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>400</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>401</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>401</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>401</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>401</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>404</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>404</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>404</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>404</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>404</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>404</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>404</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>404</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>404</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testCast</string>
+// CHECK-NEXT: <key>issue_hash</key><string>5</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>404</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>420</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>420</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>421</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>421</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>421</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>421</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>421</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>421</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>421</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>422</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>422</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>422</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>422</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>422</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>422</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>422</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>422</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>422</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>Objective-C method</string>
+// CHECK-NEXT: <key>issue_context</key><string>test</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>422</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;foo&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;foo&apos; during its initialization is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;foo&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead initialization</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>Objective-C method</string>
+// CHECK-NEXT: <key>issue_context</key><string>test2</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>430</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>430</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>431</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>433</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>433</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>433</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;foo&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;foo&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of an object stored into &apos;foo&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>Objective-C method</string>
+// CHECK-NEXT: <key>issue_context</key><string>test2</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>433</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>446</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>446</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>446</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>446</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>449</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>449</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>449</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>449</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>449</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>449</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>449</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>449</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>449</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>variousLoops</string>
+// CHECK-NEXT: <key>issue_hash</key><string>11</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>449</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>453</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>453</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>453</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>453</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>453</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>453</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>453</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>458</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>458</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>458</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>458</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>458</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>458</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>458</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>458</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>458</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>variousLoops</string>
+// CHECK-NEXT: <key>issue_hash</key><string>20</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>458</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>463</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>463</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>463</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>463</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>464</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>464</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>464</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>464</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>464</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>464</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>464</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>464</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>464</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>variousLoops</string>
+// CHECK-NEXT: <key>issue_hash</key><string>26</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>464</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>468</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>468</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>468</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>468</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>472</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>472</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>472</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>472</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>472</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>472</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>472</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>472</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>472</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>variousLoops</string>
+// CHECK-NEXT: <key>issue_hash</key><string>34</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>472</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when collection is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when collection is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>499</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>499</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>499</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>499</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>500</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>500</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>500</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>500</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>500</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>500</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>500</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>500</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>500</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>variousLoops</string>
+// CHECK-NEXT: <key>issue_hash</key><string>62</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>500</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when collection is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when collection is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>504</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>504</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>504</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>504</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>505</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>505</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>505</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>505</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>505</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>505</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>505</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>505</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>505</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>variousLoops</string>
+// CHECK-NEXT: <key>issue_hash</key><string>67</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>505</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when collection is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when collection is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>509</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>509</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>509</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>509</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>510</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>510</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>510</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>510</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>512</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>512</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>512</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>512</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>512</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>512</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>512</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>512</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>512</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>variousLoops</string>
+// CHECK-NEXT: <key>issue_hash</key><string>74</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>512</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>445</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>452</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>454</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>457</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>459</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>460</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>462</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when collection is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when collection is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>467</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>475</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>477</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>480</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>481</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Looping back to the head of the loop</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>476</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>484</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>491</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>492</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>493</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>494</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>497</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>498</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>503</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Loop body executed 0 times</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>508</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>515</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>515</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>515</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>515</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>515</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entering loop body</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>515</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>515</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>516</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>516</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>516</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>516</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>517</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>517</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>517</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>517</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>518</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>518</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>518</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>518</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>521</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>521</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>521</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>521</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>521</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>521</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>521</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>521</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>521</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>variousLoops</string>
+// CHECK-NEXT: <key>issue_hash</key><string>83</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>521</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>529</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>529</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>529</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Memory is allocated</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Memory is allocated</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>529</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>529</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>531</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>531</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>531</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>531</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>531</integer>
+// CHECK-NEXT: <key>col</key><integer>38</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Attempt to reallocate memory</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Attempt to reallocate memory</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>531</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>531</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;tmp&apos; is null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;tmp&apos; is null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Reallocation failed</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Reallocation failed</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>532</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>533</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>533</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>533</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Potential leak of memory pointed to by &apos;buf&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Potential leak of memory pointed to by &apos;buf&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of memory pointed to by &apos;buf&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory Error</string>
+// CHECK-NEXT: <key>type</key><string>Memory leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>reallocDiagnostics</string>
+// CHECK-NEXT: <key>issue_hash</key><string>1</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>533</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>548</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>548</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>551</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>551</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>551</integer>
+// CHECK-NEXT: <key>col</key><integer>21</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>551</integer>
+// CHECK-NEXT: <key>col</key><integer>21</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>551</integer>
+// CHECK-NEXT: <key>col</key><integer>30</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Memory is allocated</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Memory is allocated</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>551</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>551</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>553</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>553</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>553</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>553</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>555</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>555</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>555</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;~unique_ptr&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;~unique_ptr&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>544</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;test&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;test&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>544</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>544</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>544</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>544</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>544</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>544</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>544</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Memory allocated by &apos;new[]&apos; should be deallocated by &apos;delete[]&apos;, not &apos;delete&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Memory allocated by &apos;new[]&apos; should be deallocated by &apos;delete[]&apos;, not &apos;delete&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Memory allocated by &apos;new[]&apos; should be deallocated by &apos;delete[]&apos;, not &apos;delete&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory Error</string>
+// CHECK-NEXT: <key>type</key><string>Bad deallocator</string>
+// CHECK-NEXT: <key>issue_hash</key><string>0</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>544</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>558</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>558</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>558</integer>
+// CHECK-NEXT: <key>col</key><integer>34</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>558</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>558</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>559</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>559</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>559</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>559</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>560</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>560</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>560</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>560</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>560</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>560</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>560</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Reference count incremented. The object now has a +2 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Reference count incremented. The object now has a +2 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>560</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>560</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>561</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>561</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>561</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>561</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>561</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>561</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>561</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Reference count decremented. The object now has a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Reference count decremented. The object now has a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>561</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>561</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>563</integer>
+// CHECK-NEXT: <key>col</key><integer>21</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Reference count incremented. The object now has a +2 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Reference count incremented. The object now has a +2 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>562</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>564</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>564</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>564</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>564</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>564</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>564</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>564</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Reference count decremented. The object now has a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Reference count decremented. The object now has a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>564</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>564</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>87</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Reference count incremented. The object now has a +2 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Reference count incremented. The object now has a +2 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>566</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>567</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>567</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>567</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>567</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>567</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>567</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>567</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Reference count decremented. The object now has a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Reference count decremented. The object now has a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>567</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>567</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>568</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>568</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>568</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;foo&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;foo&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of an object stored into &apos;foo&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>longLines</string>
+// CHECK-NEXT: <key>issue_hash</key><string>1</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>568</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>572</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>572</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>572</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>572</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>572</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>573</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>573</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>573</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>573</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>573</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>573</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>573</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>573</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>573</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testMacroInFunctionDecl</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>573</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>584</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>584</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>585</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>585</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>585</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>585</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>587</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>587</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>587</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>587</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>588</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>588</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>588</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>588</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>588</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>588</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>588</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>588</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>588</integer>
+// CHECK-NEXT: <key>col</key><integer>30</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>588</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
diff --git a/test/Analysis/func.c b/test/Analysis/func.c
index 9abb560e7583..78afb45da696 100644
--- a/test/Analysis/func.c
+++ b/test/Analysis/func.c
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify %s
void clang_analyzer_eval(int);
+void clang_analyzer_warnIfReached();
void f(void) {
void (*p)(void);
@@ -25,3 +26,16 @@ void f3(void (*f)(void), void (*g)(void)) {
(*g)();
clang_analyzer_eval(!g); // expected-warning{{FALSE}}
}
+
+void nullFunctionPointerConstant() {
+ void (*f)(void) = 0;
+ f(); // expected-warning{{Called function pointer is null}}
+ clang_analyzer_warnIfReached(); // no-warning
+}
+
+void nullFunctionPointerConstraint(void (*f)(void)) {
+ if (f)
+ return;
+ f(); // expected-warning{{Called function pointer is null}}
+ clang_analyzer_warnIfReached(); // no-warning
+}
diff --git a/test/Analysis/html-diags-multifile.c b/test/Analysis/html-diags-multifile.c
index 6e89faefc5bd..bb769283bba9 100644
--- a/test/Analysis/html-diags-multifile.c
+++ b/test/Analysis/html-diags-multifile.c
@@ -1,6 +1,6 @@
// RUN: mkdir -p %t.dir
-// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t.dir
-// RUN: ls %t.dir | grep report | count 0
+// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t.dir %s
+// RUN: ls %t.dir | not grep report
// RUN: rm -fR %t.dir
// This tests that we do not currently emit HTML diagnostics for reports that
diff --git a/test/Analysis/html-diags.c b/test/Analysis/html-diags.c
index 1ec4d18884ad..1b01783d5d24 100644
--- a/test/Analysis/html-diags.c
+++ b/test/Analysis/html-diags.c
@@ -1,6 +1,14 @@
// RUN: rm -fR %T/dir
// RUN: mkdir %T/dir
// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %T/dir %s
+// RUN: ls %T/dir | grep report
+
+// PR16547: Test relative paths
+// RUN: cd %T/dir
+// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o testrelative %s
+// RUN: ls %T/dir/testrelative | grep report
+
+// REQUIRES: shell
// Currently this test mainly checks that the HTML diagnostics doesn't crash
// when handling macros will calls with macros. We should actually validate
diff --git a/test/Analysis/identical-expressions.cpp b/test/Analysis/identical-expressions.cpp
new file mode 100644
index 000000000000..50f341d39335
--- /dev/null
+++ b/test/Analysis/identical-expressions.cpp
@@ -0,0 +1,942 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core.IdenticalExpr -verify %s
+
+/* Only one expected warning per function allowed at the very end. */
+
+/* '!=' operator*/
+
+/* '!=' with float */
+int checkNotEqualFloatLiteralCompare1(void) {
+ return (5.14F != 5.14F); // no warning
+}
+
+int checkNotEqualFloatLiteralCompare2(void) {
+ return (6.14F != 7.14F); // no warning
+}
+
+int checkNotEqualFloatDeclCompare1(void) {
+ float f = 7.1F;
+ float g = 7.1F;
+ return (f != g); // no warning
+}
+
+int checkNotEqualFloatDeclCompare12(void) {
+ float f = 7.1F;
+ return (f != f); // no warning
+}
+
+int checkNotEqualFloatDeclCompare3(void) {
+ float f = 7.1F;
+ return (f != 7.1F); // no warning
+}
+
+int checkNotEqualFloatDeclCompare4(void) {
+ float f = 7.1F;
+ return (7.1F != f); // no warning
+}
+
+int checkNotEqualFloatDeclCompare5(void) {
+ float f = 7.1F;
+ int t = 7;
+ return (t != f); // no warning
+}
+
+int checkNotEqualFloatDeclCompare6(void) {
+ float f = 7.1F;
+ int t = 7;
+ return (f != t); // no warning
+}
+
+
+
+int checkNotEqualCastFloatDeclCompare11(void) {
+ float f = 7.1F;
+ return ((int)f != (int)f); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+int checkNotEqualCastFloatDeclCompare12(void) {
+ float f = 7.1F;
+ return ((char)f != (int)f); // no warning
+}
+int checkNotEqualBinaryOpFloatCompare1(void) {
+ int res;
+ float f= 3.14F;
+ res = (f + 3.14F != f + 3.14F); // no warning
+ return (0);
+}
+int checkNotEqualBinaryOpFloatCompare2(void) {
+ float f = 7.1F;
+ float g = 7.1F;
+ return (f + 3.14F != g + 3.14F); // no warning
+}
+int checkNotEqualBinaryOpFloatCompare3(void) {
+ int res;
+ float f= 3.14F;
+ res = ((int)f + 3.14F != (int)f + 3.14F); // no warning
+ return (0);
+}
+int checkNotEqualBinaryOpFloatCompare4(void) {
+ int res;
+ float f= 3.14F;
+ res = ((int)f + 3.14F != (char)f + 3.14F); // no warning
+ return (0);
+}
+
+int checkNotEqualNestedBinaryOpFloatCompare1(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (3.14F - u)*t) != ((int)f + (3.14F - u)*t)); // no warning
+ return (0);
+}
+
+int checkNotEqualNestedBinaryOpFloatCompare2(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (u - 3.14F)*t) != ((int)f + (3.14F - u)*t)); // no warning
+ return (0);
+}
+
+int checkNotEqualNestedBinaryOpFloatCompare3(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (u - 3.14F)*t) != ((int)f + (3.14F - u)*(f + t != f + t))); // no warning
+ return (0);
+}
+
+
+
+
+/* end '!=' with float*/
+
+/* '!=' with int*/
+
+int checkNotEqualIntLiteralCompare1(void) {
+ return (5 != 5); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+
+int checkNotEqualIntLiteralCompare2(void) {
+ return (6 != 7); // no warning
+}
+
+int checkNotEqualIntDeclCompare1(void) {
+ int f = 7;
+ int g = 7;
+ return (f != g); // no warning
+}
+
+int checkNotEqualIntDeclCompare3(void) {
+ int f = 7;
+ return (f != 7); // no warning
+}
+
+int checkNotEqualIntDeclCompare4(void) {
+ int f = 7;
+ return (7 != f); // no warning
+}
+
+int checkNotEqualCastIntDeclCompare11(void) {
+ int f = 7;
+ return ((int)f != (int)f); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+int checkNotEqualCastIntDeclCompare12(void) {
+ int f = 7;
+ return ((char)f != (int)f); // no warning
+}
+int checkNotEqualBinaryOpIntCompare1(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 4;
+ res = (f + 4 != f + 4); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+int checkNotEqualBinaryOpIntCompare2(void) {
+ int f = 7;
+ int g = 7;
+ return (f + 4 != g + 4); // no warning
+}
+
+
+int checkNotEqualBinaryOpIntCompare3(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 4;
+ res = ((int)f + 4 != (int)f + 4); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+int checkNotEqualBinaryOpIntCompare4(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 4;
+ res = ((int)f + 4 != (char)f + 4); // no warning
+ return (0);
+}
+int checkNotEqualBinaryOpIntCompare5(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ res = (u + t != u + t); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+
+int checkNotEqualNestedBinaryOpIntCompare1(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (3 - u)*t) != ((int)f + (3 - u)*t)); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+
+int checkNotEqualNestedBinaryOpIntCompare2(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (u - 3)*t) != ((int)f + (3 - u)*t)); // no warning
+ return (0);
+}
+
+int checkNotEqualNestedBinaryOpIntCompare3(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (u - 3)*t) != ((int)f + (3 - u)*(t + 1 != t + 1))); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+
+/* end '!=' int */
+
+
+
+/* '!=' with int pointer */
+
+int checkNotEqualIntPointerLiteralCompare1(void) {
+ int* p = 0;
+ return (p != 0); // no warning
+}
+
+int checkNotEqualIntPointerLiteralCompare2(void) {
+ return (6 != 7); // no warning
+}
+
+int checkNotEqualIntPointerDeclCompare1(void) {
+ int k = 3;
+ int* f = &k;
+ int* g = &k;
+ return (f != g); // no warning
+}
+
+int checkNotEqualCastIntPointerDeclCompare11(void) {
+ int k = 7;
+ int* f = &k;
+ return ((int*)f != (int*)f); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+int checkNotEqualCastIntPointerDeclCompare12(void) {
+ int k = 7;
+ int* f = &k;
+ return ((int*)((char*)f) != (int*)f); // no warning
+}
+int checkNotEqualBinaryOpIntPointerCompare1(void) {
+ int k = 7;
+ int res;
+ int* f= &k;
+ res = (f + 4 != f + 4); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+int checkNotEqualBinaryOpIntPointerCompare2(void) {
+ int k = 7;
+ int* f = &k;
+ int* g = &k;
+ return (f + 4 != g + 4); // no warning
+}
+
+
+int checkNotEqualBinaryOpIntPointerCompare3(void) {
+ int k = 7;
+ int res;
+ int* f= &k;
+ res = ((int*)f + 4 != (int*)f + 4); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+int checkNotEqualBinaryOpIntPointerCompare4(void) {
+ int k = 7;
+ int res;
+ int* f= &k;
+ res = ((int*)f + 4 != (int*)((char*)f) + 4); // no warning
+ return (0);
+}
+
+int checkNotEqualNestedBinaryOpIntPointerCompare1(void) {
+ int res;
+ int k = 7;
+ int t= 1;
+ int* u= &k+2;
+ int* f= &k+3;
+ res = ((f + (3)*t) != (f + (3)*t)); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+
+int checkNotEqualNestedBinaryOpIntPointerCompare2(void) {
+ int res;
+ int k = 7;
+ int t= 1;
+ int* u= &k+2;
+ int* f= &k+3;
+ res = (((3)*t + f) != (f + (3)*t)); // no warning
+ return (0);
+}
+/* end '!=' int* */
+
+/* end '!=' */
+
+
+
+/* EQ operator */
+
+int checkEqualIntPointerDeclCompare(void) {
+ int k = 3;
+ int* f = &k;
+ int* g = &k;
+ return (f == g); // no warning
+}
+
+int checkEqualIntPointerDeclCompare0(void) {
+ int k = 3;
+ int* f = &k;
+ return (f+1 == f+1); // expected-warning {{comparison of identical expressions always evaluates to true}}
+}
+
+/* EQ with float*/
+
+int checkEqualFloatLiteralCompare1(void) {
+ return (5.14F == 5.14F); // no warning
+}
+
+int checkEqualFloatLiteralCompare2(void) {
+ return (6.14F == 7.14F); // no warning
+}
+
+int checkEqualFloatDeclCompare1(void) {
+ float f = 7.1F;
+ float g = 7.1F;
+ return (f == g); // no warning
+}
+
+int checkEqualFloatDeclCompare12(void) {
+ float f = 7.1F;
+ return (f == f); // no warning
+}
+
+
+int checkEqualFloatDeclCompare3(void) {
+ float f = 7.1F;
+ return (f == 7.1F); // no warning
+}
+
+int checkEqualFloatDeclCompare4(void) {
+ float f = 7.1F;
+ return (7.1F == f); // no warning
+}
+
+int checkEqualFloatDeclCompare5(void) {
+ float f = 7.1F;
+ int t = 7;
+ return (t == f); // no warning
+}
+
+int checkEqualFloatDeclCompare6(void) {
+ float f = 7.1F;
+ int t = 7;
+ return (f == t); // no warning
+}
+
+
+
+
+int checkEqualCastFloatDeclCompare11(void) {
+ float f = 7.1F;
+ return ((int)f == (int)f); // expected-warning {{comparison of identical expressions always evaluates to true}}
+}
+int checkEqualCastFloatDeclCompare12(void) {
+ float f = 7.1F;
+ return ((char)f == (int)f); // no warning
+}
+int checkEqualBinaryOpFloatCompare1(void) {
+ int res;
+ float f= 3.14F;
+ res = (f + 3.14F == f + 3.14F); // no warning
+ return (0);
+}
+int checkEqualBinaryOpFloatCompare2(void) {
+ float f = 7.1F;
+ float g = 7.1F;
+ return (f + 3.14F == g + 3.14F); // no warning
+}
+int checkEqualBinaryOpFloatCompare3(void) {
+ int res;
+ float f= 3.14F;
+ res = ((int)f + 3.14F == (int)f + 3.14F); // no warning
+ return (0);
+}
+int checkEqualBinaryOpFloatCompare4(void) {
+ int res;
+ float f= 3.14F;
+ res = ((int)f + 3.14F == (char)f + 3.14F); // no warning
+ return (0);
+}
+
+int checkEqualNestedBinaryOpFloatCompare1(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (3.14F - u)*t) == ((int)f + (3.14F - u)*t)); // no warning
+ return (0);
+}
+
+int checkEqualNestedBinaryOpFloatCompare2(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (u - 3.14F)*t) == ((int)f + (3.14F - u)*t)); // no warning
+ return (0);
+}
+
+int checkEqualNestedBinaryOpFloatCompare3(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (u - 3.14F)*t) == ((int)f + (3.14F - u)*(f + t == f + t))); // no warning
+ return (0);
+}
+
+
+
+
+
+/* Equal with int*/
+
+int checkEqualIntLiteralCompare1(void) {
+ return (5 == 5); // expected-warning {{comparison of identical expressions always evaluates to true}}
+}
+
+int checkEqualIntLiteralCompare2(void) {
+ return (6 == 7); // no warning
+}
+
+int checkEqualIntDeclCompare1(void) {
+ int f = 7;
+ int g = 7;
+ return (f == g); // no warning
+}
+
+int checkEqualCastIntDeclCompare11(void) {
+ int f = 7;
+ return ((int)f == (int)f); // expected-warning {{comparison of identical expressions always evaluates to true}}
+}
+int checkEqualCastIntDeclCompare12(void) {
+ int f = 7;
+ return ((char)f == (int)f); // no warning
+}
+
+int checkEqualIntDeclCompare3(void) {
+ int f = 7;
+ return (f == 7); // no warning
+}
+
+int checkEqualIntDeclCompare4(void) {
+ int f = 7;
+ return (7 == f); // no warning
+}
+
+int checkEqualBinaryOpIntCompare1(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 4;
+ res = (f + 4 == f + 4); // expected-warning {{comparison of identical expressions always evaluates to true}}
+ return (0);
+}
+int checkEqualBinaryOpIntCompare2(void) {
+ int f = 7;
+ int g = 7;
+ return (f + 4 == g + 4); // no warning
+}
+
+
+int checkEqualBinaryOpIntCompare3(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 4;
+ res = ((int)f + 4 == (int)f + 4); // expected-warning {{comparison of identical expressions always evaluates to true}}
+ return (0);
+
+}
+int checkEqualBinaryOpIntCompare4(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 4;
+ res = ((int)f + 4 == (char)f + 4); // no warning
+ return (0);
+}
+int checkEqualBinaryOpIntCompare5(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ res = (u + t == u + t); // expected-warning {{comparison of identical expressions always evaluates to true}}
+ return (0);
+}
+
+int checkEqualNestedBinaryOpIntCompare1(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (3 - u)*t) == ((int)f + (3 - u)*t)); // expected-warning {{comparison of identical expressions always evaluates to true}}
+ return (0);
+}
+
+int checkEqualNestedBinaryOpIntCompare2(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (u - 3)*t) == ((int)f + (3 - u)*t)); // no warning
+ return (0);
+}
+
+int checkEqualNestedBinaryOpIntCompare3(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (u - 3)*t) == ((int)f + (3 - u)*(t + 1 == t + 1))); // expected-warning {{comparison of identical expressions always evaluates to true}}
+ return (0);
+}
+
+
+/* end EQ int */
+
+/* end EQ */
+
+
+/* LT */
+
+/* LT with float */
+
+int checkLessThanFloatLiteralCompare1(void) {
+ return (5.14F < 5.14F); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+
+int checkLessThanFloatLiteralCompare2(void) {
+ return (6.14F < 7.14F); // no warning
+}
+
+int checkLessThanFloatDeclCompare1(void) {
+ float f = 7.1F;
+ float g = 7.1F;
+ return (f < g); // no warning
+}
+
+int checkLessThanFloatDeclCompare12(void) {
+ float f = 7.1F;
+ return (f < f); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+
+int checkLessThanFloatDeclCompare3(void) {
+ float f = 7.1F;
+ return (f < 7.1F); // no warning
+}
+
+int checkLessThanFloatDeclCompare4(void) {
+ float f = 7.1F;
+ return (7.1F < f); // no warning
+}
+
+int checkLessThanFloatDeclCompare5(void) {
+ float f = 7.1F;
+ int t = 7;
+ return (t < f); // no warning
+}
+
+int checkLessThanFloatDeclCompare6(void) {
+ float f = 7.1F;
+ int t = 7;
+ return (f < t); // no warning
+}
+
+
+int checkLessThanCastFloatDeclCompare11(void) {
+ float f = 7.1F;
+ return ((int)f < (int)f); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+int checkLessThanCastFloatDeclCompare12(void) {
+ float f = 7.1F;
+ return ((char)f < (int)f); // no warning
+}
+int checkLessThanBinaryOpFloatCompare1(void) {
+ int res;
+ float f= 3.14F;
+ res = (f + 3.14F < f + 3.14F); // no warning
+ return (0);
+}
+int checkLessThanBinaryOpFloatCompare2(void) {
+ float f = 7.1F;
+ float g = 7.1F;
+ return (f + 3.14F < g + 3.14F); // no warning
+}
+int checkLessThanBinaryOpFloatCompare3(void) {
+ int res;
+ float f= 3.14F;
+ res = ((int)f + 3.14F < (int)f + 3.14F); // no warning
+ return (0);
+}
+int checkLessThanBinaryOpFloatCompare4(void) {
+ int res;
+ float f= 3.14F;
+ res = ((int)f + 3.14F < (char)f + 3.14F); // no warning
+ return (0);
+}
+
+int checkLessThanNestedBinaryOpFloatCompare1(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (3.14F - u)*t) < ((int)f + (3.14F - u)*t)); // no warning
+ return (0);
+}
+
+int checkLessThanNestedBinaryOpFloatCompare2(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (u - 3.14F)*t) < ((int)f + (3.14F - u)*t)); // no warning
+ return (0);
+}
+
+int checkLessThanNestedBinaryOpFloatCompare3(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (u - 3.14F)*t) < ((int)f + (3.14F - u)*(f + t < f + t))); // no warning
+ return (0);
+}
+
+/* end LT with float */
+
+/* LT with int */
+
+
+int checkLessThanIntLiteralCompare1(void) {
+ return (5 < 5); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+
+int checkLessThanIntLiteralCompare2(void) {
+ return (6 < 7); // no warning
+}
+
+int checkLessThanIntDeclCompare1(void) {
+ int f = 7;
+ int g = 7;
+ return (f < g); // no warning
+}
+
+int checkLessThanIntDeclCompare3(void) {
+ int f = 7;
+ return (f < 7); // no warning
+}
+
+int checkLessThanIntDeclCompare4(void) {
+ int f = 7;
+ return (7 < f); // no warning
+}
+
+int checkLessThanIntDeclCompare5(void) {
+ int f = 7;
+ int t = 7;
+ return (t < f); // no warning
+}
+
+int checkLessThanIntDeclCompare6(void) {
+ int f = 7;
+ int t = 7;
+ return (f < t); // no warning
+}
+
+int checkLessThanCastIntDeclCompare11(void) {
+ int f = 7;
+ return ((int)f < (int)f); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+int checkLessThanCastIntDeclCompare12(void) {
+ int f = 7;
+ return ((char)f < (int)f); // no warning
+}
+int checkLessThanBinaryOpIntCompare1(void) {
+ int res;
+ int f= 3;
+ res = (f + 3 < f + 3); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+int checkLessThanBinaryOpIntCompare2(void) {
+ int f = 7;
+ int g = 7;
+ return (f + 3 < g + 3); // no warning
+}
+int checkLessThanBinaryOpIntCompare3(void) {
+ int res;
+ int f= 3;
+ res = ((int)f + 3 < (int)f + 3); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+int checkLessThanBinaryOpIntCompare4(void) {
+ int res;
+ int f= 3;
+ res = ((int)f + 3 < (char)f + 3); // no warning
+ return (0);
+}
+
+int checkLessThanNestedBinaryOpIntCompare1(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (3 - u)*t) < ((int)f + (3 - u)*t)); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+
+int checkLessThanNestedBinaryOpIntCompare2(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (u - 3)*t) < ((int)f + (3 - u)*t)); // no warning
+ return (0);
+}
+
+int checkLessThanNestedBinaryOpIntCompare3(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (u - 3)*t) < ((int)f + (3 - u)*(t + u < t + u))); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+
+/* end LT with int */
+
+/* end LT */
+
+
+/* GT */
+
+/* GT with float */
+
+int checkGreaterThanFloatLiteralCompare1(void) {
+ return (5.14F > 5.14F); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+
+int checkGreaterThanFloatLiteralCompare2(void) {
+ return (6.14F > 7.14F); // no warning
+}
+
+int checkGreaterThanFloatDeclCompare1(void) {
+ float f = 7.1F;
+ float g = 7.1F;
+
+ return (f > g); // no warning
+}
+
+int checkGreaterThanFloatDeclCompare12(void) {
+ float f = 7.1F;
+ return (f > f); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+
+
+int checkGreaterThanFloatDeclCompare3(void) {
+ float f = 7.1F;
+ return (f > 7.1F); // no warning
+}
+
+int checkGreaterThanFloatDeclCompare4(void) {
+ float f = 7.1F;
+ return (7.1F > f); // no warning
+}
+
+int checkGreaterThanFloatDeclCompare5(void) {
+ float f = 7.1F;
+ int t = 7;
+ return (t > f); // no warning
+}
+
+int checkGreaterThanFloatDeclCompare6(void) {
+ float f = 7.1F;
+ int t = 7;
+ return (f > t); // no warning
+}
+
+int checkGreaterThanCastFloatDeclCompare11(void) {
+ float f = 7.1F;
+ return ((int)f > (int)f); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+int checkGreaterThanCastFloatDeclCompare12(void) {
+ float f = 7.1F;
+ return ((char)f > (int)f); // no warning
+}
+int checkGreaterThanBinaryOpFloatCompare1(void) {
+ int res;
+ float f= 3.14F;
+ res = (f + 3.14F > f + 3.14F); // no warning
+ return (0);
+}
+int checkGreaterThanBinaryOpFloatCompare2(void) {
+ float f = 7.1F;
+ float g = 7.1F;
+ return (f + 3.14F > g + 3.14F); // no warning
+}
+int checkGreaterThanBinaryOpFloatCompare3(void) {
+ int res;
+ float f= 3.14F;
+ res = ((int)f + 3.14F > (int)f + 3.14F); // no warning
+ return (0);
+}
+int checkGreaterThanBinaryOpFloatCompare4(void) {
+ int res;
+ float f= 3.14F;
+ res = ((int)f + 3.14F > (char)f + 3.14F); // no warning
+ return (0);
+}
+
+int checkGreaterThanNestedBinaryOpFloatCompare1(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (3.14F - u)*t) > ((int)f + (3.14F - u)*t)); // no warning
+ return (0);
+}
+
+int checkGreaterThanNestedBinaryOpFloatCompare2(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (u - 3.14F)*t) > ((int)f + (3.14F - u)*t)); // no warning
+ return (0);
+}
+
+int checkGreaterThanNestedBinaryOpFloatCompare3(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ float f= 3.14F;
+ res = (((int)f + (u - 3.14F)*t) > ((int)f + (3.14F - u)*(f + t > f + t))); // no warning
+ return (0);
+}
+
+/* end GT with float */
+
+/* GT with int */
+
+
+int checkGreaterThanIntLiteralCompare1(void) {
+ return (5 > 5); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+
+int checkGreaterThanIntLiteralCompare2(void) {
+ return (6 > 7); // no warning
+}
+
+int checkGreaterThanIntDeclCompare1(void) {
+ int f = 7;
+ int g = 7;
+
+ return (f > g); // no warning
+}
+
+int checkGreaterThanIntDeclCompare3(void) {
+ int f = 7;
+ return (f > 7); // no warning
+}
+
+int checkGreaterThanIntDeclCompare4(void) {
+ int f = 7;
+ return (7 > f); // no warning
+}
+
+int checkGreaterThanCastIntDeclCompare11(void) {
+ int f = 7;
+ return ((int)f > (int)f); // expected-warning {{comparison of identical expressions always evaluates to false}}
+}
+int checkGreaterThanCastIntDeclCompare12(void) {
+ int f = 7;
+ return ((char)f > (int)f); // no warning
+}
+int checkGreaterThanBinaryOpIntCompare1(void) {
+ int res;
+ int f= 3;
+ res = (f + 3 > f + 3); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+int checkGreaterThanBinaryOpIntCompare2(void) {
+ int f = 7;
+ int g = 7;
+ return (f + 3 > g + 3); // no warning
+}
+int checkGreaterThanBinaryOpIntCompare3(void) {
+ int res;
+ int f= 3;
+ res = ((int)f + 3 > (int)f + 3); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+int checkGreaterThanBinaryOpIntCompare4(void) {
+ int res;
+ int f= 3;
+ res = ((int)f + 3 > (char)f + 3); // no warning
+ return (0);
+}
+
+int checkGreaterThanNestedBinaryOpIntCompare1(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (3 - u)*t) > ((int)f + (3 - u)*t)); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+
+int checkGreaterThanNestedBinaryOpIntCompare2(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (u - 3)*t) > ((int)f + (3 - u)*t)); // no warning
+ return (0);
+}
+
+int checkGreaterThanNestedBinaryOpIntCompare3(void) {
+ int res;
+ int t= 1;
+ int u= 2;
+ int f= 3;
+ res = (((int)f + (u - 3)*t) > ((int)f + (3 - u)*(t + u > t + u))); // expected-warning {{comparison of identical expressions always evaluates to false}}
+ return (0);
+}
+
+/* end GT with int */
+
+/* end GT */
diff --git a/test/Analysis/initializer.cpp b/test/Analysis/initializer.cpp
index 3f7802c56d29..a71e35dc63c6 100644
--- a/test/Analysis/initializer.cpp
+++ b/test/Analysis/initializer.cpp
@@ -109,3 +109,37 @@ namespace DefaultConstructorWithCleanups {
return w.arr[0].value; // no-warning
}
}
+
+namespace DefaultMemberInitializers {
+ struct Wrapper {
+ int value = 42;
+
+ Wrapper() {}
+ Wrapper(int x) : value(x) {}
+ Wrapper(bool) {}
+ };
+
+ void test() {
+ Wrapper w1;
+ clang_analyzer_eval(w1.value == 42); // expected-warning{{TRUE}}
+
+ Wrapper w2(50);
+ clang_analyzer_eval(w2.value == 50); // expected-warning{{TRUE}}
+
+ Wrapper w3(false);
+ clang_analyzer_eval(w3.value == 42); // expected-warning{{TRUE}}
+ }
+
+ struct StringWrapper {
+ const char s[4] = "abc";
+ const char *p = "xyz";
+
+ StringWrapper(bool) {}
+ };
+
+ void testString() {
+ StringWrapper w(true);
+ clang_analyzer_eval(w.s[1] == 'b'); // expected-warning{{TRUE}}
+ clang_analyzer_eval(w.p[1] == 'y'); // expected-warning{{TRUE}}
+ }
+}
diff --git a/test/Analysis/initializers-cfg-output.cpp b/test/Analysis/initializers-cfg-output.cpp
index b62d979d5bf0..db3c0fb99000 100644
--- a/test/Analysis/initializers-cfg-output.cpp
+++ b/test/Analysis/initializers-cfg-output.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
class A {
public:
@@ -43,6 +43,13 @@ TestControlFlow::TestControlFlow(bool b)
int v;
}
+class TestDelegating {
+ int x, z;
+ public:
+ TestDelegating() : TestDelegating(2, 3) {}
+ TestDelegating(int x, int z) : x(x), z(z) {}
+};
+
// CHECK: [B2 (ENTRY)]
// CHECK: Succs (1): B1
// CHECK: [B1]
@@ -95,3 +102,14 @@ TestControlFlow::TestControlFlow(bool b)
// CHECK: Succs (2): B2 B3
// CHECK: [B0 (EXIT)]
// CHECK: Preds (1): B1
+// CHECK: [B2 (ENTRY)]
+// CHECK: Succs (1): B1
+// CHECK: [B1]
+// CHECK: 1: 2
+// CHECK: 2: 3
+// CHECK: 3: [B1.1], [B1.2] (CXXConstructExpr, class TestDelegating)
+// CHECK: 4: TestDelegating([B1.3]) (Delegating initializer)
+// CHECK: Preds (1): B2
+// CHECK: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK: Preds (1): B1
diff --git a/test/Analysis/inline-plist.c b/test/Analysis/inline-plist.c
index dcdd23f74bb3..bcf15b343ae1 100644
--- a/test/Analysis/inline-plist.c
+++ b/test/Analysis/inline-plist.c
@@ -1,5 +1,5 @@
// RUN: %clang --analyze %s -fblocks -Xanalyzer -analyzer-output=text -Xanalyzer -analyzer-config -Xanalyzer suppress-null-return-paths=false -Xclang -verify %s
-// RUN: %clang --analyze %s -fblocks -Xanalyzer -analyzer-config -Xanalyzer suppress-null-return-paths=false -o %t
+// RUN: %clang --analyze %s -fblocks -Xanalyzer -analyzer-config -Xanalyzer suppress-null-return-paths=false -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t
// RUN: FileCheck -input-file %t %s
// <rdar://problem/10967815>
diff --git a/test/Analysis/inline-unique-reports.c b/test/Analysis/inline-unique-reports.c
index 5c42135b0490..9f33bd4652f7 100644
--- a/test/Analysis/inline-unique-reports.c
+++ b/test/Analysis/inline-unique-reports.c
@@ -1,4 +1,4 @@
-// RUN: %clang --analyze %s -o %t > /dev/null 2>&1
+// RUN: %clang --analyze %s -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t > /dev/null 2>&1
// RUN: FileCheck -input-file %t %s
static inline bug(int *p) {
diff --git a/test/Analysis/inline.c b/test/Analysis/inline.c
index 8cba63f17e0d..9ecdce33a36d 100644
--- a/test/Analysis/inline.c
+++ b/test/Analysis/inline.c
@@ -110,3 +110,9 @@ void never_called_by_anyone() {
clang_analyzer_checkInlined(0); // no-warning
}
+
+void knr_one_argument(a) int a; { }
+
+void call_with_less_arguments() {
+ knr_one_argument(); // expected-warning{{too few arguments}} expected-warning{{Function taking 1 argument}}
+}
diff --git a/test/Analysis/inline.cpp b/test/Analysis/inline.cpp
index 909e18017b34..ca126ddf7f38 100644
--- a/test/Analysis/inline.cpp
+++ b/test/Analysis/inline.cpp
@@ -290,6 +290,15 @@ namespace DefaultArgs {
clang_analyzer_eval(defaultFloatReferenceZero(1) == -1); // expected-warning{{UNKNOWN}}
clang_analyzer_eval(defaultFloatReferenceZero() == 0); // expected-warning{{UNKNOWN}}
}
+
+ char defaultString(const char *s = "abc") {
+ return s[1];
+ }
+
+ void testString() {
+ clang_analyzer_eval(defaultString("xyz") == 'y'); // expected-warning{{TRUE}}
+ clang_analyzer_eval(defaultString() == 'b'); // expected-warning{{TRUE}}
+ }
}
namespace OperatorNew {
@@ -420,3 +429,10 @@ namespace rdar12409977 {
clang_analyzer_eval(obj.getThis()->x == 42); // expected-warning{{TRUE}}
}
}
+
+namespace bug16307 {
+ void one_argument(int a) { }
+ void call_with_less() {
+ reinterpret_cast<void (*)()>(one_argument)(); // expected-warning{{Function taking 1 argument}}
+ }
+}
diff --git a/test/Analysis/inlining/DynDispatchBifurcate.m b/test/Analysis/inlining/DynDispatchBifurcate.m
index ab1dfc5ec14b..0ce079654e98 100644
--- a/test/Analysis/inlining/DynDispatchBifurcate.m
+++ b/test/Analysis/inlining/DynDispatchBifurcate.m
@@ -181,11 +181,11 @@ int testPropertySynthesized(PublicClass *p) {
}
// Test definition not available edge case.
-@interface DefNotAvailClass : NSObject
+@interface DefNotAvailClass : NSObject // expected-note {{receiver is instance of class declared here}}
@end
id testDefNotAvailableInlined(DefNotAvailClass *C) {
return [C mem]; // expected-warning {{instance method '-mem' not found}}
}
id testDefNotAvailable(DefNotAvailClass *C) {
return testDefNotAvailableInlined(C);
-} \ No newline at end of file
+}
diff --git a/test/Analysis/inlining/InlineObjCClassMethod.m b/test/Analysis/inlining/InlineObjCClassMethod.m
index 90ce3c051bab..6efcb894fecd 100644
--- a/test/Analysis/inlining/InlineObjCClassMethod.m
+++ b/test/Analysis/inlining/InlineObjCClassMethod.m
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config ipa=dynamic-bifurcate -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify %s
+
+void clang_analyzer_checkInlined(int);
// Test inlining of ObjC class methods.
@@ -209,3 +211,26 @@ int checkSelfUsedInparentClassMethod() {
return 5/[SelfUsedInParentChild fooA];
}
+
+@interface Rdar15037033 : NSObject
+@end
+
+void rdar15037033() {
+ [Rdar15037033 forwardDeclaredMethod]; // expected-warning {{class method '+forwardDeclaredMethod' not found}}
+ [Rdar15037033 forwardDeclaredVariadicMethod:1, 2, 3, 0]; // expected-warning {{class method '+forwardDeclaredVariadicMethod:' not found}}
+}
+
+@implementation Rdar15037033
+
++ (void)forwardDeclaredMethod {
+ clang_analyzer_checkInlined(1); // expected-warning{{TRUE}}
+}
+
++ (void)forwardDeclaredVariadicMethod:(int)x, ... {
+ clang_analyzer_checkInlined(0); // no-warning
+}
+
+@end
+
+
+
diff --git a/test/Analysis/inlining/eager-reclamation-path-notes.c b/test/Analysis/inlining/eager-reclamation-path-notes.c
index 65613658fcb8..d14aba3d989e 100644
--- a/test/Analysis/inlining/eager-reclamation-path-notes.c
+++ b/test/Analysis/inlining/eager-reclamation-path-notes.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config graph-trim-interval=5 -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
void use(int *ptr, int val) {
diff --git a/test/Analysis/inlining/eager-reclamation-path-notes.cpp b/test/Analysis/inlining/eager-reclamation-path-notes.cpp
index 05411bbc7778..672b3b8b3efb 100644
--- a/test/Analysis/inlining/eager-reclamation-path-notes.cpp
+++ b/test/Analysis/inlining/eager-reclamation-path-notes.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
typedef struct {
diff --git a/test/Analysis/inlining/false-positive-suppression.c b/test/Analysis/inlining/false-positive-suppression.c
index c5c6bb875ea2..e1c8f67614e1 100644
--- a/test/Analysis/inlining/false-positive-suppression.c
+++ b/test/Analysis/inlining/false-positive-suppression.c
@@ -84,6 +84,14 @@ void testMultipleStore(void *p) {
#endif
}
+// Test that div by zero does not get suppressed. This is a policy choice.
+int retZero() {
+ return 0;
+}
+int triggerDivZero () {
+ int y = retZero();
+ return 5/y; // expected-warning {{Division by zero}}
+}
// --------------------------
// "Suppression suppression"
diff --git a/test/Analysis/inlining/inline-defensive-checks.c b/test/Analysis/inlining/inline-defensive-checks.c
index aa7f70030c06..4ce783c852fe 100644
--- a/test/Analysis/inlining/inline-defensive-checks.c
+++ b/test/Analysis/inlining/inline-defensive-checks.c
@@ -110,3 +110,32 @@ void testConstantOffset(char *value) {
cursor++;
}
}
+
+// Ensure idc works for integer zero values (ex: suppressed div by zero).
+void idcZero(int assume) {
+ if (assume)
+ ;
+}
+
+int idcTriggerZeroValue(int m) {
+ idcZero(m);
+ return 5/m; // no-warning
+}
+
+int idcTriggerZeroValueThroughCall(int i) {
+ return 5/i; // no-warning
+}
+void idcTrackZeroValueThroughCall(int x) {
+ idcZero(x);
+ idcTriggerZeroValueThroughCall(x);
+}
+
+int idcTriggerZeroThroughDoubleAssignemnt(int i) {
+ return 5/i; // no-warning
+}
+void idcTrackZeroThroughDoubleAssignemnt(int x) {
+ idcZero(x);
+ int y = x;
+ int z = y;
+ idcTriggerZeroValueThroughCall(z);
+}
diff --git a/test/Analysis/inlining/path-notes.c b/test/Analysis/inlining/path-notes.c
index 660988535b34..deb2efe1d803 100644
--- a/test/Analysis/inlining/path-notes.c
+++ b/test/Analysis/inlining/path-notes.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config suppress-null-return-paths=false -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
void zero(int **p) {
diff --git a/test/Analysis/inlining/path-notes.cpp b/test/Analysis/inlining/path-notes.cpp
index e0c83cbe3296..a354e14df9ed 100644
--- a/test/Analysis/inlining/path-notes.cpp
+++ b/test/Analysis/inlining/path-notes.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config c++-inlining=destructors -std=c++11 -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config c++-inlining=destructors -std=c++11 %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config c++-inlining=destructors -std=c++11 -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
class Foo {
@@ -264,6 +264,40 @@ const A& testDeclRefExprToReferenceInGetDerefExpr(const A *ptr) {
return val;
}
+
+int generateNoteOnDefaultArgument(int one, int two = 0) {
+ return one/two; // expected-warning {{Division by zero}}
+ // expected-note@-1 {{Division by zero}}
+}
+int callGenerateNoteOnDefaultArgument(int o) {
+ return generateNoteOnDefaultArgument(o); //expected-note{{Calling 'generateNoteOnDefaultArgument'}}
+ //expected-note@-1 {{Passing the value 0 via 2nd parameter 'two'}}
+}
+
+namespace PR17746 {
+ class Inner {
+ public:
+ ~Inner() {
+ *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
+ // expected-note@-1 {{Dereference of null pointer}}
+ }
+ };
+
+ class Outer {
+ public:
+ Inner *inner;
+ ~Outer() {
+ delete inner;
+ // expected-note@-1 {{Calling '~Inner'}}
+ }
+ };
+
+ void test(Outer *outer) {
+ delete outer;
+ // expected-note@-1 {{Calling '~Outer'}}
+ }
+}
+
// CHECK: <key>diagnostics</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
@@ -4743,4 +4777,456 @@ const A& testDeclRefExprToReferenceInGetDerefExpr(const A *ptr) {
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>273</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>273</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>273</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>273</integer>
+// CHECK-NEXT: <key>col</key><integer>38</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>273</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>273</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>273</integer>
+// CHECK-NEXT: <key>col</key><integer>41</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Passing the value 0 via 2nd parameter &apos;two&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Passing the value 0 via 2nd parameter &apos;two&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>273</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>273</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>273</integer>
+// CHECK-NEXT: <key>col</key><integer>41</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;generateNoteOnDefaultArgument&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;generateNoteOnDefaultArgument&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;callGenerateNoteOnDefaultArgument&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;callGenerateNoteOnDefaultArgument&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>268</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>269</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>269</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>269</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>269</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>269</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>269</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>269</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>269</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>269</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Division by zero</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Division by zero</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Division by zero</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>generateNoteOnDefaultArgument</string>
+// CHECK-NEXT: <key>issue_hash</key><string>1</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>269</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>296</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>296</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>296</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;~Outer&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;~Outer&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>289</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;test&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;test&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>289</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>289</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>290</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>290</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>290</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>290</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>290</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;~Inner&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;~Inner&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>280</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>2</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;~Outer&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;~Outer&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>280</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>280</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>281</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>281</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>281</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>281</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>281</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>281</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>281</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>281</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>281</integer>
+// CHECK-NEXT: <key>col</key><integer>28</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>2</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_hash</key><string>1</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>281</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
diff --git a/test/Analysis/inlining/path-notes.m b/test/Analysis/inlining/path-notes.m
index 74f088a382bd..23040386e4dd 100644
--- a/test/Analysis/inlining/path-notes.m
+++ b/test/Analysis/inlining/path-notes.m
@@ -1,16 +1,74 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config suppress-null-return-paths=false -fblocks -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false -fblocks %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=text -analyzer-config suppress-null-return-paths=false -fblocks -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false -analyzer-config path-diagnostics-alternate=false -fblocks %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
typedef struct dispatch_queue_s *dispatch_queue_t;
typedef void (^dispatch_block_t)(void);
void dispatch_sync(dispatch_queue_t, dispatch_block_t);
+typedef long dispatch_once_t;
+// Note: The real dispatch_once has all parameters marked nonnull.
+// We don't do that here so that we can trigger a null dereference inside
+// the synthesized body.
+void dispatch_once(dispatch_once_t *predicate, dispatch_block_t block);
+
@interface Test
@property int *p;
@end
+typedef unsigned long NSUInteger;
+typedef signed char BOOL;
+typedef struct _NSZone NSZone;
+@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
+@protocol NSObject
+@end
+@protocol NSCopying
+- (id)copyWithZone:(NSZone *)zone;
+@end
+@protocol NSMutableCopying
+- (id)mutableCopyWithZone:(NSZone *)zone;
+@end
+@protocol NSCoding
+- (void)encodeWithCoder:(NSCoder *)aCoder;
+@end
+@protocol NSFastEnumeration
+@end
+@protocol NSSecureCoding <NSCoding>
+@required
++ (BOOL)supportsSecureCoding;
+@end
+@interface NSObject <NSObject> {}
+- (id)init;
++ (id)alloc;
+- (id)autorelease;
+@end
+@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
+
+- (NSUInteger)count;
+- (id)objectAtIndex:(NSUInteger)index;
+
+@end
+
+@interface NSArray (NSExtendedArray)
+- (NSArray *)arrayByAddingObject:(id)anObject;
+- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx __attribute__((availability(macosx,introduced=10.8)));
+@end
+
+@interface NSArray (NSArrayCreation)
++ (instancetype)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt;
+@end
+
+@interface NSMutableArray : NSArray
+
+- (void)addObject:(id)anObject;
+- (void)insertObject:(id)anObject atIndex:(NSUInteger)index;
+- (void)removeLastObject;
+- (void)removeObjectAtIndex:(NSUInteger)index;
+- (void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject;
+
+@end
+
int *getZeroIfNil(Test *x) {
return x.p;
// expected-note@-1 {{'p' not called because the receiver is nil}}
@@ -34,10 +92,10 @@ int testDispatchSyncInlining() {
// expected-note@+2 {{Calling 'dispatch_sync'}}
// expected-note@+1 {{Returning from 'dispatch_sync'}}
dispatch_sync(globalQueue, ^{
- // expected-note@7 {{Calling anonymous block}}
+ // expected-note@-1 {{Calling anonymous block}}
+ // expected-note@-2 {{Returning to caller}}
x = 0;
// expected-note@-1 {{The value 0 is assigned to 'x'}}
- // expected-note@7 {{Returning to caller}}
});
return 1 / x; // expected-warning{{Division by zero}}
@@ -54,7 +112,7 @@ int testDispatchSyncInliningNoPruning(int coin) {
// expected-note@+1 {{Calling 'dispatch_sync'}}
dispatch_sync(globalQueue, ^{
- // expected-note@7 {{Calling anonymous block}}
+ // expected-note@-1 {{Calling anonymous block}}
int x;
// expected-note@-1 {{'x' declared without an initial value}}
^{ y = x; }(); // expected-warning{{Variable 'x' is uninitialized when captured by block}}
@@ -89,6 +147,32 @@ void testNilReceiver(id *x) {
// expected-note@-3 {{Calling 'testNilReceiverHelper'}}
}
+id testCreateArrayLiteral(id myNil) {
+ if (myNil) // expected-note {{Assuming 'myNil' is nil}}
+ ; // expected-note@-1 {{Taking false branch}}
+ return @[ @"a", myNil, @"c" ]; // expected-warning {{Array element cannot be nil}}
+ //expected-note@-1 {{Array element cannot be nil}}
+}
+
+// <rdar://problem/14611722>
+id testAutoreleaseTakesEffectInDispatch() {
+ static dispatch_once_t token = 0;
+ dispatch_once(&token, ^{});
+
+ id x = [[[[NSObject alloc] init] autorelease] autorelease];
+ // expected-note@-1 {{Method returns an Objective-C object with a +1 retain count}}
+ // expected-note@-2 {{Object autoreleased}}
+ // expected-note@-3 {{Object autoreleased}}
+
+ dispatch_once(&token, ^{}); // don't crash, don't warn here
+
+ return x; // expected-warning{{Object autoreleased too many times}}
+ // expected-note@-1 {{Object was autoreleased 2 times but the object has a +0 retain count}}
+}
+
+void testNullDereferenceInDispatch() {
+ dispatch_once(0, ^{}); // no-warning, don't crash
+}
// CHECK: <key>diagnostics</key>
// CHECK-NEXT: <array>
@@ -103,12 +187,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -116,12 +200,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -133,7 +217,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -141,12 +225,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -166,12 +250,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -179,12 +263,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -196,7 +280,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -204,12 +288,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -225,7 +309,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>14</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>1</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -243,12 +327,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>14</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>1</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>14</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -256,12 +340,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -277,12 +361,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -290,12 +374,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -307,7 +391,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -315,12 +399,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -340,12 +424,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -353,12 +437,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -370,7 +454,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -378,12 +462,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>15</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -399,7 +483,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -407,12 +491,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -432,12 +516,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -445,12 +529,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>20</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>20</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -462,7 +546,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>20</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -470,12 +554,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -496,7 +580,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>issue_hash</key><string>1</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>20</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -512,12 +596,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>line</key><integer>88</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>line</key><integer>88</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -525,12 +609,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -542,7 +626,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -550,12 +634,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>line</key><integer>99</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -571,24 +655,25 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>7</integer>
-// CHECK-NEXT: <key>col</key><integer>1</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <key>depth</key><integer>1</integer>
-// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Entered call from &apos;testDispatchSyncInlining&apos;</string>
-// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Entered call from &apos;testDispatchSyncInlining&apos;</string>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>kind</key><string>event</string>
-// CHECK-NEXT: <key>location</key>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>7</integer>
-// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>99</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>1</integer>
// CHECK-NEXT: <key>extended_message</key>
// CHECK-NEXT: <string>Calling anonymous block</string>
@@ -599,7 +684,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>30</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -617,12 +702,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>30</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>30</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -630,12 +715,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -647,7 +732,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -655,12 +740,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>38</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -676,10 +761,25 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>7</integer>
-// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>99</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>1</integer>
// CHECK-NEXT: <key>extended_message</key>
// CHECK-NEXT: <string>Returning to caller</string>
@@ -690,7 +790,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -698,12 +798,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>41</integer>
+// CHECK-NEXT: <key>line</key><integer>99</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -723,12 +823,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -736,12 +836,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>43</integer>
+// CHECK-NEXT: <key>line</key><integer>101</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>43</integer>
+// CHECK-NEXT: <key>line</key><integer>101</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -753,7 +853,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>43</integer>
+// CHECK-NEXT: <key>line</key><integer>101</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -761,12 +861,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>43</integer>
+// CHECK-NEXT: <key>line</key><integer>101</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>43</integer>
+// CHECK-NEXT: <key>line</key><integer>101</integer>
// CHECK-NEXT: <key>col</key><integer>14</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -787,7 +887,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>issue_hash</key><string>14</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>43</integer>
+// CHECK-NEXT: <key>line</key><integer>101</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -803,12 +903,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -816,12 +916,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -833,7 +933,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -841,12 +941,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>62</integer>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -862,24 +962,25 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>7</integer>
-// CHECK-NEXT: <key>col</key><integer>1</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <key>depth</key><integer>1</integer>
-// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Entered call from &apos;testDispatchSyncInliningNoPruning&apos;</string>
-// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Entered call from &apos;testDispatchSyncInliningNoPruning&apos;</string>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>kind</key><string>event</string>
-// CHECK-NEXT: <key>location</key>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>7</integer>
-// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>1</integer>
// CHECK-NEXT: <key>extended_message</key>
// CHECK-NEXT: <string>Calling anonymous block</string>
@@ -890,7 +991,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>30</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -908,12 +1009,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>30</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>30</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -921,12 +1022,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>116</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>116</integer>
// CHECK-NEXT: <key>col</key><integer>7</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -938,7 +1039,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>116</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -946,12 +1047,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>116</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>116</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -971,12 +1072,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>116</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>116</integer>
// CHECK-NEXT: <key>col</key><integer>7</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -984,12 +1085,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>118</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>118</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1001,7 +1102,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>118</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1009,12 +1110,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>118</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>118</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1032,7 +1133,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>type</key><string>uninitialized variable captured by block</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>118</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1048,12 +1149,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1061,12 +1162,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>23</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1082,12 +1183,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>23</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1095,12 +1196,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>26</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>26</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1112,7 +1213,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>26</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1120,12 +1221,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>26</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>27</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1145,12 +1246,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>26</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>26</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1158,12 +1259,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>25</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>25</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1175,7 +1276,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>25</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1183,12 +1284,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>25</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>35</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1204,7 +1305,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1212,12 +1313,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>86</integer>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
// CHECK-NEXT: <key>col</key><integer>36</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1233,7 +1334,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>134</integer>
// CHECK-NEXT: <key>col</key><integer>1</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1251,12 +1352,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>134</integer>
// CHECK-NEXT: <key>col</key><integer>1</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>134</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1264,12 +1365,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1285,12 +1386,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1298,12 +1399,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>6</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>6</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1315,7 +1416,7 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>6</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1323,12 +1424,12 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1349,9 +1450,581 @@ void testNilReceiver(id *x) {
// CHECK-NEXT: <key>issue_hash</key><string>1</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>6</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;myNil&apos; is nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;myNil&apos; is nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Array element cannot be nil</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Array element cannot be nil</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Array element cannot be nil</string>
+// CHECK-NEXT: <key>category</key><string>API Misuse (Apple)</string>
+// CHECK-NEXT: <key>type</key><string>nil argument</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testCreateArrayLiteral</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>159</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>160</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>160</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>160</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>160</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>34</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>47</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>12</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>34</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>60</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>47</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>162</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>167</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>167</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>167</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>167</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object was autoreleased 2 times but the object has a +0 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object was autoreleased 2 times but the object has a +0 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Object autoreleased too many times</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Object autoreleased too many times</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>testAutoreleaseTakesEffectInDispatch</string>
+// CHECK-NEXT: <key>issue_hash</key><string>11</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
diff --git a/test/Analysis/inlining/stl.cpp b/test/Analysis/inlining/stl.cpp
index 6053daaf3a21..c153174d27ad 100644
--- a/test/Analysis/inlining/stl.cpp
+++ b/test/Analysis/inlining/stl.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=false -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=true -DINLINE=1 -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=false -std=c++11 -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=true -std=c++11 -DINLINE=1 -verify %s
#include "../Inputs/system-header-simulator-cxx.h"
@@ -27,3 +27,18 @@ void testException(std::exception e) {
// expected-warning@-4 {{UNKNOWN}}
#endif
}
+
+void testList_pop_front(std::list<int> list) {
+ while(!list.empty())
+ list.pop_front(); // no-warning
+}
+
+void testBasicStringSuppression() {
+ std::basic_string<uint8_t> v;
+ v.push_back(1); // no-warning
+}
+
+void testBasicStringSuppression_append() {
+ std::basic_string<char32_t> v;
+ v += 'c'; // no-warning
+}
diff --git a/test/Analysis/lambdas.cpp b/test/Analysis/lambdas.cpp
index 77b36c42cfa8..33e216b57ecc 100644
--- a/test/Analysis/lambdas.cpp
+++ b/test/Analysis/lambdas.cpp
@@ -10,7 +10,7 @@ void f(X x) { (void) [x]{}; }
// CHECK: 1: x
// CHECK: 2: [B1.1] (ImplicitCastExpr, NoOp, const struct X)
// CHECK: 3: [B1.2] (CXXConstructExpr, struct X)
-// CHECK: 4: [=x] {
+// CHECK: 4: [x] {
// CHECK: }
// CHECK: 5: (void)[B1.4] (CStyleCastExpr, ToVoid, void)
// CHECK: Preds (1): B2
diff --git a/test/Analysis/lit.local.cfg b/test/Analysis/lit.local.cfg
new file mode 100644
index 000000000000..da2a68b378cc
--- /dev/null
+++ b/test/Analysis/lit.local.cfg
@@ -0,0 +1,2 @@
+if config.root.clang_staticanalyzer == 0:
+ config.unsupported = True
diff --git a/test/Analysis/live-variables.cpp b/test/Analysis/live-variables.cpp
new file mode 100644
index 000000000000..0cfaa1b41f52
--- /dev/null
+++ b/test/Analysis/live-variables.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s
+// expected-no-diagnostics
+class B {
+public:
+ bool m;
+ ~B() {} // The destructor ensures that the binary logical operator below is wrapped in the ExprWithCleanups.
+};
+B foo();
+int getBool();
+int *getPtr();
+int test() {
+ int r = 0;
+ for (int x = 0; x< 10; x++) {
+ int *p = getPtr();
+ // Liveness info is not computed correctly due to the following expression.
+ // This happens due to CFG being special cased for short circuit operators.
+ // PR18159
+ if (p != 0 && getBool() && foo().m && getBool()) {
+ r = *p; // no warning
+ }
+ }
+ return r;
+}
diff --git a/test/Analysis/live-variables.m b/test/Analysis/live-variables.m
new file mode 100644
index 000000000000..eefd292bf79b
--- /dev/null
+++ b/test/Analysis/live-variables.m
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -fobjc-arc -verify %s
+// expected-no-diagnostics
+@interface NSObject
+@end
+@interface NSString : NSObject
+- (id)lastPathComponent;
+@end
+int getBool();
+int *getPtr();
+int foo() {
+ int r = 0;
+ NSString *filename = @"filename";
+ for (int x = 0; x< 10; x++) {
+ int *p = getPtr();
+ // Liveness info is not computed correctly due to the following expression.
+ // This happens due to CFG being special cased for short circuit operators.
+ // Note, due to ObjC method call, the outermost logical operator is wrapped in ExprWithCleanups.
+ // PR18159
+ if ((p != 0) && (getBool()) && ([filename lastPathComponent]) && (getBool())) {
+ r = *p; // no-warning
+ }
+ }
+ return r;
+} \ No newline at end of file
diff --git a/test/Analysis/logical-ops.c b/test/Analysis/logical-ops.c
index a1223b39fa89..afaa2f107780 100644
--- a/test/Analysis/logical-ops.c
+++ b/test/Analysis/logical-ops.c
@@ -25,3 +25,15 @@ int testTypeIsInt(int i, void *p) {
return 1;
return 0;
}
+
+// These crashed the analyzer at some point.
+int between(char *x) {
+ extern char start[];
+ extern char end[];
+ return x >= start && x < end;
+}
+
+int undef(void) {} // expected-warning{{control reaches end of non-void function}}
+void useUndef(void) { 0 || undef(); }
+
+void testPointer(void) { (void) (1 && testPointer && 0); }
diff --git a/test/Analysis/malloc-plist.c b/test/Analysis/malloc-plist.c
index 41bb8b5793ce..0cbf9725b683 100644
--- a/test/Analysis/malloc-plist.c
+++ b/test/Analysis/malloc-plist.c
@@ -1,5 +1,5 @@
// RUN: rm -f %t
-// RUN: %clang_cc1 -analyze -analyzer-checker=unix.Malloc -analyzer-output=plist -o %t %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=unix.Malloc -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false -o %t %s
// RUN: FileCheck -input-file %t %s
typedef __typeof(sizeof(int)) size_t;
diff --git a/test/Analysis/malloc.c b/test/Analysis/malloc.c
index 6071d1d43582..58d40a31a835 100644
--- a/test/Analysis/malloc.c
+++ b/test/Analysis/malloc.c
@@ -627,8 +627,49 @@ void doNotInvalidateWhenPassedToSystemCalls(char *s) {
char *p = malloc(12);
strlen(p);
strcpy(p, s);
+ strcpy(s, p);
+ strcpy(p, p);
+ memcpy(p, s, 1);
+ memcpy(s, p, 1);
+ memcpy(p, p, 1);
} // expected-warning {{leak}}
+// Treat source buffer contents as escaped.
+void escapeSourceContents(char *s) {
+ char *p = malloc(12);
+ memcpy(s, &p, 12); // no warning
+
+ void *p1 = malloc(7);
+ char *a;
+ memcpy(&a, &p1, sizeof a);
+ // FIXME: No warning due to limitations imposed by current modelling of
+ // 'memcpy' (regions metadata is not copied).
+
+ int *ptrs[2];
+ int *allocated = (int *)malloc(4);
+ memcpy(&ptrs[0], &allocated, sizeof(int *));
+ // FIXME: No warning due to limitations imposed by current modelling of
+ // 'memcpy' (regions metadata is not copied).
+}
+
+void invalidateDestinationContents() {
+ int *null = 0;
+ int *p = (int *)malloc(4);
+ memcpy(&p, &null, sizeof(int *));
+
+ int *ptrs1[2]; // expected-warning {{Potential leak of memory pointed to by}}
+ ptrs1[0] = (int *)malloc(4);
+ memcpy(ptrs1, &null, sizeof(int *));
+
+ int *ptrs2[2]; // expected-warning {{Potential memory leak}}
+ ptrs2[0] = (int *)malloc(4);
+ memcpy(&ptrs2[1], &null, sizeof(int *));
+
+ int *ptrs3[2]; // expected-warning {{Potential memory leak}}
+ ptrs3[0] = (int *)malloc(4);
+ memcpy(&ptrs3[0], &null, sizeof(int *));
+} // expected-warning {{Potential memory leak}}
+
// Rely on the CString checker evaluation of the strcpy API to convey that the result of strcpy is equal to p.
void symbolLostWithStrcpy(char *s) {
char *p = malloc(12);
@@ -1057,12 +1098,6 @@ void testPassConstPointerIndirectly() {
return; // expected-warning {{leak}}
}
-void testPassToSystemHeaderFunctionIndirectly() {
- int *p = malloc(4);
- p++;
- fakeSystemHeaderCallInt(p);
-} // expected-warning {{leak}}
-
void testPassConstPointerIndirectlyStruct() {
struct HasPtr hp;
hp.p = malloc(10);
@@ -1073,8 +1108,32 @@ void testPassConstPointerIndirectlyStruct() {
void testPassToSystemHeaderFunctionIndirectlyStruct() {
SomeStruct ss;
ss.p = malloc(1);
- fakeSystemHeaderCall(&ss);
-} // expected-warning {{Potential leak of memory pointed to by 'ss.p'}}
+ fakeSystemHeaderCall(&ss); // invalidates ss, making ss.p unreachable
+ // Technically a false negative here -- we know the system function won't free
+ // ss.p, but nothing else will either!
+} // no-warning
+
+void testPassToSystemHeaderFunctionIndirectlyStructFree() {
+ SomeStruct ss;
+ ss.p = malloc(1);
+ fakeSystemHeaderCall(&ss); // invalidates ss, making ss.p unreachable
+ free(ss.p);
+} // no-warning
+
+void testPassToSystemHeaderFunctionIndirectlyArray() {
+ int *p[1];
+ p[0] = malloc(sizeof(int));
+ fakeSystemHeaderCallIntPtr(p); // invalidates p, making p[0] unreachable
+ // Technically a false negative here -- we know the system function won't free
+ // p[0], but nothing else will either!
+} // no-warning
+
+void testPassToSystemHeaderFunctionIndirectlyArrayFree() {
+ int *p[1];
+ p[0] = malloc(sizeof(int));
+ fakeSystemHeaderCallIntPtr(p); // invalidates p, making p[0] unreachable
+ free(p[0]);
+} // no-warning
int *testOffsetAllocate(size_t size) {
int *memoryBlock = (int *)malloc(size + sizeof(int));
@@ -1189,6 +1248,54 @@ void freeMemory() {
}
}
+// PR16730
+void testReallocEscaped(void **memory) {
+ *memory = malloc(47);
+ char *new_memory = realloc(*memory, 47);
+ if (new_memory != 0) {
+ *memory = new_memory;
+ }
+}
+
+// PR16558
+void *smallocNoWarn(size_t size) {
+ if (size == 0) {
+ return malloc(1); // this branch is never called
+ }
+ else {
+ return malloc(size);
+ }
+}
+
+char *dupstrNoWarn(const char *s) {
+ const int len = strlen(s);
+ char *p = (char*) smallocNoWarn(len + 1);
+ strcpy(p, s); // no-warning
+ return p;
+}
+
+void *smallocWarn(size_t size) {
+ if (size == 2) {
+ return malloc(1);
+ }
+ else {
+ return malloc(size);
+ }
+}
+
+char *dupstrWarn(const char *s) {
+ const int len = strlen(s);
+ char *p = (char*) smallocWarn(len + 1);
+ strcpy(p, s); // expected-warning{{String copy function overflows destination buffer}}
+ return p;
+}
+
+int *radar15580979() {
+ int *data = (int *)malloc(32);
+ int *p = data ?: (int*)malloc(32); // no warning
+ return p;
+}
+
// ----------------------------------------------------------------------------
// False negatives.
@@ -1200,3 +1307,11 @@ void testMallocWithParam(int **p) {
void testMallocWithParam_2(int **p) {
*p = (int*) malloc(sizeof(int)); // no-warning
}
+
+void testPassToSystemHeaderFunctionIndirectly() {
+ int *p = malloc(4);
+ p++;
+ fakeSystemHeaderCallInt(p);
+ // FIXME: This is a leak: if we think a system function won't free p, it
+ // won't free (p-1) either.
+}
diff --git a/test/Analysis/malloc.m b/test/Analysis/malloc.m
index 21d2dafa38b6..ad16db52dff9 100644
--- a/test/Analysis/malloc.m
+++ b/test/Analysis/malloc.m
@@ -35,3 +35,18 @@ void rdar10579586(char x);
}
@end
+@interface MyArray : NSObject {
+ id * objects;
+}
+@end
+
+void _ArrayCreate() {
+ MyArray *array = (MyArray *)malloc(12);
+ array = [array init];
+ free(array); // no-warning
+}
+
+void testNSDataTruePositiveLeak() {
+ char *b = (char *)malloc(12);
+ NSData *d = [[NSData alloc] initWithBytes: b length: 12]; // expected-warning {{Potential leak of memory pointed to by 'b'}}
+} \ No newline at end of file
diff --git a/test/Analysis/method-call-path-notes.cpp b/test/Analysis/method-call-path-notes.cpp
index f946b327d0c2..20348d588936 100644
--- a/test/Analysis/method-call-path-notes.cpp
+++ b/test/Analysis/method-call-path-notes.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file %s -o %t.plist
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
// Test warning about null or uninitialized pointer values used as instance member
diff --git a/test/Analysis/misc-ps-arm.m b/test/Analysis/misc-ps-arm.m
index 1ff0f17cea5f..a9ea3274ae4b 100644
--- a/test/Analysis/misc-ps-arm.m
+++ b/test/Analysis/misc-ps-arm.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple thumbv7-apple-ios0.0.0 -analyze -analyzer-checker=core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s
+// RUN: %clang_cc1 -triple thumbv7-apple-ios0.0.0 -target-feature +neon -analyze -analyzer-checker=core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s
// expected-no-diagnostics
// <rdar://problem/11405978> - Handle casts of vectors to structs, and loading
diff --git a/test/Analysis/misc-ps-region-store.cpp b/test/Analysis/misc-ps-region-store.cpp
index 902a5e527113..6a873f01b3d3 100644
--- a/test/Analysis/misc-ps-region-store.cpp
+++ b/test/Analysis/misc-ps-region-store.cpp
@@ -1,5 +1,7 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions
+
+void clang_analyzer_warnIfReached();
// Test basic handling of references.
char &test1_aux();
@@ -54,9 +56,7 @@ int test_init_in_condition_switch() {
if (x == 2)
return 0;
else {
- // Unreachable.
- int *p = 0;
- *p = 0xDEADBEEF; // no-warning
+ clang_analyzer_warnIfReached(); // unreachable
}
default:
break;
@@ -74,8 +74,7 @@ int test_init_in_condition_while() {
if (z == 2)
return 0;
- int *p = 0;
- *p = 0xDEADBEEF; // no-warning
+ clang_analyzer_warnIfReached(); // unreachable
return 0;
}
@@ -89,8 +88,7 @@ int test_init_in_condition_for() {
if (z == 1)
return 0;
- int *p = 0;
- *p = 0xDEADBEEF; // no-warning
+ clang_analyzer_warnIfReached(); // unreachable
return 0;
}
@@ -117,8 +115,7 @@ int TestHandleThis::null_deref_negative() {
if (x == 10) {
return 1;
}
- int *p = 0;
- *p = 0xDEADBEEF; // no-warning
+ clang_analyzer_warnIfReached(); // unreachable
return 0;
}
@@ -127,8 +124,7 @@ int TestHandleThis::null_deref_positive() {
if (x == 9) {
return 1;
}
- int *p = 0;
- *p = 0xDEADBEEF; // expected-warning{{null pointer}}
+ clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
return 0;
}
@@ -143,9 +139,9 @@ void pr7675_test() {
pr7675(10);
pr7675('c');
pr7675_i(4.0i);
- // Add null deref to ensure we are analyzing the code up to this point.
- int *p = 0;
- *p = 0xDEADBEEF; // expected-warning{{null pointer}}
+
+ // Add check to ensure we are analyzing the code up to this point.
+ clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
}
// <rdar://problem/8375510> - CFGBuilder should handle temporaries.
@@ -328,26 +324,23 @@ class RDar9267815 {
};
void RDar9267815::test_pos() {
- int *p = 0;
if (x == 42)
return;
- *p = 0xDEADBEEF; // expected-warning {{null}}
+ clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
}
void RDar9267815::test() {
- int *p = 0;
if (x == 42)
return;
if (x == 42)
- *p = 0xDEADBEEF; // no-warning
+ clang_analyzer_warnIfReached(); // no-warning
}
void RDar9267815::test2() {
- int *p = 0;
if (x == 42)
return;
invalidate();
if (x == 42)
- *p = 0xDEADBEEF; // expected-warning {{null}}
+ clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
}
// Test reference parameters.
@@ -440,8 +433,7 @@ int rdar9948787_negative() {
unsigned value = classWithStatic.value;
if (value == 1)
return 1;
- int *p = 0;
- *p = 0xDEADBEEF; // no-warning
+ clang_analyzer_warnIfReached(); // no-warning
return 0;
}
@@ -450,8 +442,7 @@ int rdar9948787_positive() {
unsigned value = classWithStatic.value;
if (value == 0)
return 1;
- int *p = 0;
- *p = 0xDEADBEEF; // expected-warning {{null}}
+ clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
return 0;
}
@@ -467,8 +458,7 @@ void rdar10202899_test1() {
void rdar10202899_test2() {
if (val == rdar10202899_ValTA)
return;
- int *p = 0;
- *p = 0xDEADBEEF;
+ clang_analyzer_warnIfReached(); // no-warning
}
void rdar10202899_test3() {
@@ -476,8 +466,7 @@ void rdar10202899_test3() {
case rdar10202899_ValTA: return;
default: ;
};
- int *p = 0;
- *p = 0xDEADBEEF;
+ clang_analyzer_warnIfReached(); // no-warning
}
// This used to crash the analyzer because of the unnamed bitfield.
@@ -489,13 +478,12 @@ void PR11249()
char f2[1];
char f3;
} V = { 1, {2}, 3 };
- int *p = 0;
if (V.f1 != 1)
- *p = 0xDEADBEEF; // no-warning
+ clang_analyzer_warnIfReached(); // no-warning
if (V.f2[0] != 2)
- *p = 0xDEADBEEF; // no-warning
+ clang_analyzer_warnIfReached(); // no-warning
if (V.f3 != 3)
- *p = 0xDEADBEEF; // no-warning
+ clang_analyzer_warnIfReached(); // no-warning
}
// Handle doing a load from the memory associated with the code for
@@ -599,12 +587,10 @@ void rdar10924675(unsigned short x[], int index, int index2) {
void rdar11401827() {
int x = int();
if (!x) {
- int *p = 0;
- *p = 0xDEADBEEF; // expected-warning {{null pointer}}
+ clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
}
else {
- int *p = 0;
- *p = 0xDEADBEEF;
+ clang_analyzer_warnIfReached(); // no-warning
}
}
@@ -701,8 +687,7 @@ const Rdar12755044_foo *radar12755044() {
void rdar12759044() {
int flag = 512;
if (!(flag & 512)) {
- int *p = 0;
- *p = 0xDEADBEEF; // no-warning
+ clang_analyzer_warnIfReached(); // no-warning
}
}
diff --git a/test/Analysis/misc-ps.c b/test/Analysis/misc-ps.c
index b302860a2f97..01cad1549cda 100644
--- a/test/Analysis/misc-ps.c
+++ b/test/Analysis/misc-ps.c
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -disable-free -analyzer-eagerly-assume -analyzer-checker=core -analyzer-checker=deadcode -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -disable-free -analyzer-eagerly-assume -analyzer-checker=core,deadcode,debug.ExprInspection -verify %s
+
+void clang_analyzer_eval(int);
int size_rdar9373039 = 1;
int foo_rdar9373039(const char *);
@@ -175,3 +177,17 @@ void sinkAfterRegularNode(struct PR15684 *context) {
context->callback(uninitialized); // expected-warning {{uninitialized}}
}
+
+// PR16131: C permits variables to be declared extern void.
+static void PR16131(int x) {
+ extern void v;
+
+ int *ip = (int *)&v;
+ char *cp = (char *)&v;
+ clang_analyzer_eval(ip == cp); // expected-warning{{TRUE}}
+ // expected-warning@-1 {{comparison of distinct pointer types}}
+
+ *ip = 42;
+ clang_analyzer_eval(*ip == 42); // expected-warning{{TRUE}}
+ clang_analyzer_eval(*(int *)&v == 42); // expected-warning{{TRUE}}
+}
diff --git a/test/Analysis/new-with-exceptions.cpp b/test/Analysis/new-with-exceptions.cpp
index d909f1fb8b6b..84d77c22302c 100644
--- a/test/Analysis/new-with-exceptions.cpp
+++ b/test/Analysis/new-with-exceptions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -std=c++11 -fexceptions -fcxx-exceptions -verify -DEXCEPTIONS %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -std=c++11 -fexceptions -fcxx-exceptions -verify %s
// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -std=c++11 -verify %s
void clang_analyzer_eval(bool);
@@ -32,33 +32,15 @@ void testNew() {
clang_analyzer_eval(new NoThrow); // expected-warning{{UNKNOWN}}
clang_analyzer_eval(new NoExcept); // expected-warning{{UNKNOWN}}
- clang_analyzer_eval(new DefaultThrow);
- clang_analyzer_eval(new ExplicitThrow);
-#ifdef EXCEPTIONS
- // expected-warning@-3 {{TRUE}}
- // expected-warning@-3 {{TRUE}}
-#else
- // expected-warning@-6 {{UNKNOWN}}
- // expected-warning@-6 {{UNKNOWN}}
-#endif
+ clang_analyzer_eval(new DefaultThrow); // expected-warning{{TRUE}}
+ clang_analyzer_eval(new ExplicitThrow); // expected-warning{{TRUE}}
}
void testNewArray() {
- clang_analyzer_eval(new NoThrow[2]);
- clang_analyzer_eval(new NoExcept[2]);
- clang_analyzer_eval(new DefaultThrow[2]);
- clang_analyzer_eval(new ExplicitThrow[2]);
-#ifdef EXCEPTIONS
- // expected-warning@-5 {{TRUE}}
- // expected-warning@-5 {{TRUE}}
- // expected-warning@-5 {{TRUE}}
- // expected-warning@-5 {{TRUE}}
-#else
- // expected-warning@-10 {{UNKNOWN}}
- // expected-warning@-10 {{UNKNOWN}}
- // expected-warning@-10 {{UNKNOWN}}
- // expected-warning@-10 {{UNKNOWN}}
-#endif
+ clang_analyzer_eval(new NoThrow[2]); // expected-warning{{TRUE}}
+ clang_analyzer_eval(new NoExcept[2]); // expected-warning{{TRUE}}
+ clang_analyzer_eval(new DefaultThrow[2]); // expected-warning{{TRUE}}
+ clang_analyzer_eval(new ExplicitThrow[2]); // expected-warning{{TRUE}}
}
extern void *operator new[](size_t, int) noexcept;
diff --git a/test/Analysis/new.cpp b/test/Analysis/new.cpp
index 8d3eee9baa6a..105a973ccc92 100644
--- a/test/Analysis/new.cpp
+++ b/test/Analysis/new.cpp
@@ -170,6 +170,16 @@ void testUsingThisAfterDelete() {
c->f(0); // no-warning
}
+void testAggregateNew() {
+ struct Point { int x, y; };
+ new Point{1, 2}; // no crash
+
+ Point p;
+ new (&p) Point{1, 2}; // no crash
+ clang_analyzer_eval(p.x == 1); // expected-warning{{TRUE}}
+ clang_analyzer_eval(p.y == 2); // expected-warning{{TRUE}}
+}
+
//--------------------------------
// Incorrectly-modelled behavior
//--------------------------------
@@ -196,3 +206,148 @@ int testNoInitializationPlacement() {
}
return 1;
}
+
+// Test modelling destructor call on call to delete
+class IntPair{
+public:
+ int x;
+ int y;
+ IntPair() {};
+ ~IntPair() {x = x/y;}; //expected-warning {{Division by zero}}
+};
+
+void testCallToDestructor() {
+ IntPair *b = new IntPair();
+ b->x = 1;
+ b->y = 0;
+ delete b; // This results in divide by zero in destructor
+}
+
+// Test Deleting a value that's passed as an argument.
+class DerefClass{
+public:
+ int *x;
+ DerefClass() {};
+ ~DerefClass() {*x = 1;}; //expected-warning {{Dereference of null pointer (loaded from field 'x')}}
+};
+
+void testDestCall(DerefClass *arg) {
+ delete arg;
+}
+
+void test_delete_dtor_Arg() {
+ DerefClass *pair = new DerefClass();
+ pair->x = 0;
+ testDestCall(pair);
+}
+
+//Deleting the address of a local variable, null pointer
+void abort(void) __attribute__((noreturn));
+
+class NoReturnDtor {
+public:
+ NoReturnDtor() {}
+ ~NoReturnDtor() {abort();}
+};
+
+void test_delete_dtor_LocalVar() {
+ NoReturnDtor test;
+ delete &test; // no warn or crash
+}
+
+class DerivedNoReturn:public NoReturnDtor {
+public:
+ DerivedNoReturn() {};
+ ~DerivedNoReturn() {};
+};
+
+void testNullDtorDerived() {
+ DerivedNoReturn *p = new DerivedNoReturn();
+ delete p; // Calls the base destructor which aborts, checked below
+ clang_analyzer_eval(true); // no warn
+}
+
+//Deleting a non class pointer should not crash/warn
+void test_var_delete() {
+ int *v = new int;
+ delete v; // no crash/warn
+ clang_analyzer_eval(true); // expected-warning{{TRUE}}
+}
+
+void testDeleteNull() {
+ NoReturnDtor *foo = 0;
+ delete foo; // should not call destructor, checked below
+ clang_analyzer_eval(true); // expected-warning{{TRUE}}
+}
+
+void testNullAssigneddtor() {
+ NoReturnDtor *p = 0;
+ NoReturnDtor *s = p;
+ delete s; // should not call destructor, checked below
+ clang_analyzer_eval(true); // expected-warning{{TRUE}}
+}
+
+void deleteArg(NoReturnDtor *test) {
+ delete test;
+}
+
+void testNulldtorArg() {
+ NoReturnDtor *p = 0;
+ deleteArg(p);
+ clang_analyzer_eval(true); // expected-warning{{TRUE}}
+}
+
+void testDeleteUnknown(NoReturnDtor *foo) {
+ delete foo; // should assume non-null and call noreturn destructor
+ clang_analyzer_eval(true); // no-warning
+}
+
+void testArrayNull() {
+ NoReturnDtor *fooArray = 0;
+ delete[] fooArray; // should not call destructor, checked below
+ clang_analyzer_eval(true); // expected-warning{{TRUE}}
+}
+
+void testArrayDestr() {
+ NoReturnDtor *p = new NoReturnDtor[2];
+ delete[] p; // Calls the base destructor which aborts, checked below
+ //TODO: clang_analyzer_eval should not be called
+ clang_analyzer_eval(true); // expected-warning{{TRUE}}
+}
+
+// Invalidate Region even in case of default destructor
+class InvalidateDestTest {
+public:
+ int x;
+ int *y;
+ ~InvalidateDestTest();
+};
+
+int test_member_invalidation() {
+
+ //test invalidation of member variable
+ InvalidateDestTest *test = new InvalidateDestTest();
+ test->x = 5;
+ int *k = &(test->x);
+ clang_analyzer_eval(*k == 5); // expected-warning{{TRUE}}
+ delete test;
+ clang_analyzer_eval(*k == 5); // expected-warning{{UNKNOWN}}
+
+ //test invalidation of member pointer
+ int localVar = 5;
+ test = new InvalidateDestTest();
+ test->y = &localVar;
+ delete test;
+ clang_analyzer_eval(localVar == 5); // expected-warning{{UNKNOWN}}
+
+ // Test aray elements are invalidated.
+ int Var1 = 5;
+ int Var2 = 5;
+ InvalidateDestTest *a = new InvalidateDestTest[2];
+ a[0].y = &Var1;
+ a[1].y = &Var2;
+ delete[] a;
+ clang_analyzer_eval(Var1 == 5); // expected-warning{{UNKNOWN}}
+ clang_analyzer_eval(Var2 == 5); // expected-warning{{UNKNOWN}}
+ return 0;
+}
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 86e8911f4659..43a527be1907 100644
--- a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
+++ b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,alpha.core -analyzer-constraints=range -analyzer-store=region -Wno-objc-root-class %s > %t.1 2>&1
-// RUN: FileCheck -input-file=%t.1 -check-prefix=darwin8 %s
+// RUN: FileCheck -input-file=%t.1 -check-prefix=CHECK-darwin8 %s
// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-constraints=range -analyzer-store=region -Wno-objc-root-class %s > %t.2 2>&1
-// RUN: FileCheck -input-file=%t.2 -check-prefix=darwin9 %s
+// RUN: FileCheck -input-file=%t.2 -check-prefix=CHECK-darwin9 %s
// RUN: %clang_cc1 -triple thumbv6-apple-ios4.0 -analyze -analyzer-checker=core,alpha.core -analyzer-constraints=range -analyzer-store=region -Wno-objc-root-class %s > %t.3 2>&1
-// RUN: FileCheck -input-file=%t.3 -check-prefix=darwin9 %s
+// RUN: FileCheck -input-file=%t.3 -check-prefix=CHECK-darwin9 %s
@interface MyClass {}
- (void *)voidPtrM;
diff --git a/test/Analysis/null-deref-path-notes.m b/test/Analysis/null-deref-path-notes.m
index e22d520f8884..605769483619 100644
--- a/test/Analysis/null-deref-path-notes.m
+++ b/test/Analysis/null-deref-path-notes.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=text -fblocks -verify -Wno-objc-root-class %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=plist-multi-file -fblocks -Wno-objc-root-class %s -o %t
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false -fblocks -Wno-objc-root-class %s -o %t
// RUN: FileCheck --input-file=%t %s
@interface Root {
diff --git a/test/Analysis/nullptr.cpp b/test/Analysis/nullptr.cpp
index 050c3f8dc56a..56151dc6b650 100644
--- a/test/Analysis/nullptr.cpp
+++ b/test/Analysis/nullptr.cpp
@@ -81,3 +81,9 @@ int materializeTempExpr() {
const S &s = S(*n); // expected-warning{{Dereference of null pointer}}
return s.a;
}
+
+typedef decltype(nullptr) nullptr_t;
+void testMaterializeTemporaryExprWithNullPtr() {
+ // Create MaterializeTemporaryExpr with a nullptr inside.
+ const nullptr_t &r = nullptr;
+}
diff --git a/test/Analysis/objc-arc.m b/test/Analysis/objc-arc.m
index e6c6ab546132..ba590d614e8d 100644
--- a/test/Analysis/objc-arc.m
+++ b/test/Analysis/objc-arc.m
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc -analyzer-config path-diagnostics-alternate=true -analyzer-output=plist-multi-file -o %t.plist %s
+// RUN: FileCheck --input-file=%t.plist %s
typedef signed char BOOL;
typedef struct _NSZone NSZone;
@@ -218,3 +219,1874 @@ void rdar11059275_negative() {
(void) o;
}
+__attribute__((ns_returns_retained)) id rdar14061675_helper() {
+ return [[NSObject alloc] init];
+}
+
+id rdar14061675() {
+ // ARC produces an implicit cast here. We need to make sure the combination
+ // of that and the inlined call don't produce a spurious edge cycle.
+ id result = rdar14061675_helper();
+ *(volatile int *)0 = 1; // expected-warning{{Dereference of null pointer}}
+ return result;
+}
+
+// CHECK: <key>diagnostics</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>&apos;p&apos; initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>54</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>54</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>54</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>54</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>54</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>54</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>54</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>54</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>54</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_working</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>54</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>93</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>37</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFDateCreate&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFDateCreate&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>94</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;date&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;date&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of an object stored into &apos;date&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_cf_leak</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>25</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;x&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;x&apos; during its initialization is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;x&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead initialization</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>rdar9424882</string>
+// CHECK-NEXT: <key>issue_hash</key><string>1</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>col</key><integer>53</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;obj1&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;obj1&apos; during its initialization is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;obj1&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead initialization</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>from_cf</string>
+// CHECK-NEXT: <key>issue_hash</key><string>1</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
+// CHECK-NEXT: <key>col</key><integer>45</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;obj4&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;obj4&apos; during its initialization is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;obj4&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead initialization</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>from_cf</string>
+// CHECK-NEXT: <key>issue_hash</key><string>6</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>144</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>44</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;obj5&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;obj5&apos; during its initialization is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;obj5&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead initialization</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>from_cf</string>
+// CHECK-NEXT: <key>issue_hash</key><string>7</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>48</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;obj6&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;obj6&apos; during its initialization is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;obj6&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead initialization</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>from_cf</string>
+// CHECK-NEXT: <key>issue_hash</key><string>8</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>44</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFCreateSomething&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFCreateSomething&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>145</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>46</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>48</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;obj5&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;obj5&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of an object stored into &apos;obj5&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>from_cf</string>
+// CHECK-NEXT: <key>issue_hash</key><string>7</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>48</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFCreateString&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFCreateString&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>146</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;obj6&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;obj6&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of an object stored into &apos;obj6&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>from_cf</string>
+// CHECK-NEXT: <key>issue_hash</key><string>8</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>147</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>150</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>150</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>150</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>150</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>150</integer>
+// CHECK-NEXT: <key>col</key><integer>64</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;cf1&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;cf1&apos; during its initialization is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;cf1&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead initialization</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>to_cf</string>
+// CHECK-NEXT: <key>issue_hash</key><string>1</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>150</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>21</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>67</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;cf2&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;cf2&apos; during its initialization is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;cf2&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead initialization</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>to_cf</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>151</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>152</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>152</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>152</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>152</integer>
+// CHECK-NEXT: <key>col</key><integer>19</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>152</integer>
+// CHECK-NEXT: <key>col</key><integer>55</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;cf3&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;cf3&apos; during its initialization is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;cf3&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead initialization</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>to_cf</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>152</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>21</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>58</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Value stored to &apos;cf4&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Value stored to &apos;cf4&apos; during its initialization is never read</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Value stored to &apos;cf4&apos; during its initialization is never read</string>
+// CHECK-NEXT: <key>category</key><string>Dead store</string>
+// CHECK-NEXT: <key>type</key><string>Dead initialization</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>to_cf</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>153</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>164</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>164</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>165</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>165</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>165</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>165</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>165</integer>
+// CHECK-NEXT: <key>col</key><integer>37</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFDateCreate&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFDateCreate&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>165</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>165</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;date&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;date&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of an object stored into &apos;date&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_objc_unretainedObject</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>166</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>178</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>178</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>193</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>193</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>193</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>193</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>196</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>196</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>196</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>196</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFCreateString&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFCreateString&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>200</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of an object</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_objc_arrays</string>
+// CHECK-NEXT: <key>issue_hash</key><string>24</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>202</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>col</key><integer>39</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Method returns an Objective-C object with a +0 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Method returns an Objective-C object with a +0 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>21</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>20</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Reference count incremented. The object now has a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Reference count incremented. The object now has a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;o&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;o&apos; is not referenced later in this execution path and has a retain count of +1</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of an object stored into &apos;o&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>rdar11059275_positive</string>
+// CHECK-NEXT: <key>issue_hash</key><string>1</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>216</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>229</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>229</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>rdar14061675</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>230</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
diff --git a/test/Analysis/objc-for.m b/test/Analysis/objc-for.m
index ef149c4b14aa..2f14b8ad1aae 100644
--- a/test/Analysis/objc-for.m
+++ b/test/Analysis/objc-for.m
@@ -4,8 +4,10 @@ void clang_analyzer_eval(int);
#define nil ((id)0)
+typedef unsigned long NSUInteger;
@protocol NSFastEnumeration
- (int)countByEnumeratingWithState:(void *)state objects:(id *)objects count:(unsigned)count;
+- (void)protocolMethod;
@end
@interface NSObject
@@ -16,21 +18,37 @@ void clang_analyzer_eval(int);
@end
@interface NSArray : NSObject <NSFastEnumeration>
+- (NSUInteger)count;
- (NSEnumerator *)objectEnumerator;
@end
@interface NSDictionary : NSObject <NSFastEnumeration>
+- (NSUInteger)count;
+- (id)objectForKey:(id)key;
+@end
+
+@interface NSDictionary (SomeCategory)
+- (void)categoryMethodOnNSDictionary;
@end
@interface NSMutableDictionary : NSDictionary
+- (void)setObject:(id)obj forKey:(id)key;
+@end
+
+@interface NSMutableArray : NSArray
+- (void)addObject:(id)obj;
@end
@interface NSSet : NSObject <NSFastEnumeration>
+- (NSUInteger)count;
@end
@interface NSPointerArray : NSObject <NSFastEnumeration>
@end
+@interface NSString : NSObject
+@end
+
void test() {
id x;
for (x in [NSArray testObject])
@@ -68,3 +86,241 @@ void testNonNil(id a, id b) {
clang_analyzer_eval(b != nil); // expected-warning{{FALSE}}
}
+void collectionIsEmpty(NSMutableDictionary *D){
+ if ([D count] == 0) { // Count is zero.
+ NSString *s = 0;
+ for (NSString *key in D) {
+ s = key; // Loop is never entered.
+ }
+ clang_analyzer_eval(s == 0); //expected-warning{{TRUE}}
+ }
+}
+
+void processCollection(NSMutableDictionary *D);
+void collectionIsEmptyCollectionIsModified(NSMutableDictionary *D){
+ if ([D count] == 0) { // Count is zero.
+ NSString *s = 0;
+ processCollection(D); // However, the collection has changed.
+ for (NSString *key in D) {
+ s = key; // Loop might be entered.
+ }
+ clang_analyzer_eval(s == 0); //expected-warning{{FALSE}} //expected-warning{{TRUE}}
+ }
+}
+
+int collectionIsEmptyNSSet(NSSet *S){
+ if ([S count] == 2) { // Count is non zero.
+ int tapCounts[2];
+ int i = 0;
+ for (NSString *elem in S) {
+ tapCounts[i]= 1; // Loop is entered.
+ i++;
+ }
+ return (tapCounts[0]); //no warning
+ }
+ return 0;
+}
+
+int collectionIsNotEmptyNSArray(NSArray *A) {
+ int count = [A count];
+ if (count > 0) {
+ int i;
+ int j;
+ for (NSString *a in A) {
+ i = 1;
+ j++;
+ }
+ clang_analyzer_eval(i == 1); // expected-warning {{TRUE}}
+ }
+ return 0;
+}
+
+void onlySuppressExitAfterZeroIterations(NSMutableDictionary *D) {
+ if (D.count > 0) {
+ int *x;
+ int i;
+ for (NSString *key in D) {
+ x = 0;
+ i++;
+ }
+ // Test that this is reachable.
+ int y = *x; // expected-warning {{Dereference of null pointer}}
+ y++;
+ }
+}
+
+void onlySuppressLoopExitAfterZeroIterations_WithContinue(NSMutableDictionary *D) {
+ if (D.count > 0) {
+ int *x;
+ int i;
+ for (NSString *key in D) {
+ x = 0;
+ i++;
+ continue;
+ }
+ // Test that this is reachable.
+ int y = *x; // expected-warning {{Dereference of null pointer}}
+ y++;
+ }
+}
+
+int* getPtr();
+void onlySuppressLoopExitAfterZeroIterations_WithBreak(NSMutableDictionary *D) {
+ if (D.count > 0) {
+ int *x;
+ int i;
+ for (NSString *key in D) {
+ x = 0;
+ break;
+ x = getPtr();
+ i++;
+ }
+ int y = *x; // expected-warning {{Dereference of null pointer}}
+ y++;
+ }
+}
+
+int consistencyBetweenLoopsWhenCountIsUnconstrained(NSMutableDictionary *D,
+ int shouldUseCount) {
+ // Test with or without an initial count.
+ int count;
+ if (shouldUseCount)
+ count = [D count];
+
+ int i;
+ int j = 0;
+ for (NSString *key in D) {
+ i = 5;
+ j++;
+ }
+ for (NSString *key in D) {
+ return i; // no-warning
+ }
+ return 0;
+}
+
+int consistencyBetweenLoopsWhenCountIsUnconstrained_dual(NSMutableDictionary *D,
+ int shouldUseCount) {
+ int count;
+ if (shouldUseCount)
+ count = [D count];
+
+ int i = 8;
+ int j = 1;
+ for (NSString *key in D) {
+ i = 0;
+ j++;
+ }
+ for (NSString *key in D) {
+ i = 5;
+ j++;
+ }
+ return 5/i;
+}
+
+int consistencyCountThenLoop(NSArray *array) {
+ if ([array count] == 0)
+ return 0;
+
+ int x;
+ for (id y in array)
+ x = 0;
+ return x; // no-warning
+}
+
+int consistencyLoopThenCount(NSArray *array) {
+ int x;
+ for (id y in array)
+ x = 0;
+
+ if ([array count] == 0)
+ return 0;
+
+ return x; // no-warning
+}
+
+void nonMutatingMethodsDoNotInvalidateCountDictionary(NSMutableDictionary *dict,
+ NSMutableArray *other) {
+ if ([dict count])
+ return;
+
+ for (id key in dict)
+ clang_analyzer_eval(0); // no-warning
+
+ (void)[dict objectForKey:@""];
+
+ for (id key in dict)
+ clang_analyzer_eval(0); // no-warning
+
+ [dict categoryMethodOnNSDictionary];
+
+ for (id key in dict)
+ clang_analyzer_eval(0); // no-warning
+
+ [dict setObject:@"" forKey:@""];
+
+ for (id key in dict)
+ clang_analyzer_eval(0); // expected-warning{{FALSE}}
+
+ // Reset.
+ if ([dict count])
+ return;
+
+ for (id key in dict)
+ clang_analyzer_eval(0); // no-warning
+
+ [other addObject:dict];
+
+ for (id key in dict)
+ clang_analyzer_eval(0); // expected-warning{{FALSE}}
+}
+
+void nonMutatingMethodsDoNotInvalidateCountArray(NSMutableArray *array,
+ NSMutableArray *other) {
+ if ([array count])
+ return;
+
+ for (id key in array)
+ clang_analyzer_eval(0); // no-warning
+
+ (void)[array objectEnumerator];
+
+ for (id key in array)
+ clang_analyzer_eval(0); // no-warning
+
+ [array addObject:@""];
+
+ for (id key in array)
+ clang_analyzer_eval(0); // expected-warning{{FALSE}}
+
+ // Reset.
+ if ([array count])
+ return;
+
+ for (id key in array)
+ clang_analyzer_eval(0); // no-warning
+
+ [other addObject:array];
+
+ for (id key in array)
+ clang_analyzer_eval(0); // expected-warning{{FALSE}}
+}
+
+void protocolMethods(NSMutableArray *array) {
+ if ([array count])
+ return;
+
+ for (id key in array)
+ clang_analyzer_eval(0); // no-warning
+
+ NSArray *immutableArray = array;
+ [immutableArray protocolMethod];
+
+ for (id key in array)
+ clang_analyzer_eval(0); // no-warning
+
+ [array protocolMethod];
+
+ for (id key in array)
+ clang_analyzer_eval(0); // expected-warning{{FALSE}}
+}
diff --git a/test/Analysis/objc-properties.m b/test/Analysis/objc-properties.m
index 87ab7f716395..323f41af54ce 100644
--- a/test/Analysis/objc-properties.m
+++ b/test/Analysis/objc-properties.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.DirectIvarAssignment -fobjc-default-synthesize-properties -verify -fblocks %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.DirectIvarAssignment -verify -fblocks %s
typedef signed char BOOL;
@protocol NSObject - (BOOL)isEqual:(id)object; @end
diff --git a/test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m b/test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m
index f44978656998..f1ecd548eb3e 100644
--- a/test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m
+++ b/test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.DirectIvarAssignmentForAnnotatedFunctions -fobjc-default-synthesize-properties -verify -fblocks %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.DirectIvarAssignmentForAnnotatedFunctions -verify -fblocks %s
typedef signed char BOOL;
@protocol NSObject - (BOOL)isEqual:(id)object; @end
diff --git a/test/Analysis/objc_invalidation.m b/test/Analysis/objc_invalidation.m
index 6919feaccfc7..cd66444f4010 100644
--- a/test/Analysis/objc_invalidation.m
+++ b/test/Analysis/objc_invalidation.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.InstanceVariableInvalidation -DRUN_IVAR_INVALIDATION -fobjc-default-synthesize-properties -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.MissingInvalidationMethod -DRUN_MISSING_INVALIDATION_METHOD -fobjc-default-synthesize-properties -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.InstanceVariableInvalidation -DRUN_IVAR_INVALIDATION -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.MissingInvalidationMethod -DRUN_MISSING_INVALIDATION_METHOD -verify %s
extern void __assert_fail (__const char *__assertion, __const char *__file,
unsigned int __line, __const char *__function)
__attribute__ ((__noreturn__));
diff --git a/test/Analysis/operator-calls.cpp b/test/Analysis/operator-calls.cpp
index 7461d75f673b..4bd7c12fad32 100644
--- a/test/Analysis/operator-calls.cpp
+++ b/test/Analysis/operator-calls.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -verify %s
+// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -verify %s
void clang_analyzer_eval(bool);
struct X0 { };
@@ -85,3 +85,48 @@ namespace RValues {
clang_analyzer_eval(+(coin ? getLargeOpaque() : getLargeOpaque())); // expected-warning{{UNKNOWN}}
}
}
+
+namespace SynthesizedAssignment {
+ struct A {
+ int a;
+ A& operator=(A& other) { a = -other.a; return *this; }
+ A& operator=(A&& other) { a = other.a+1; return *this; }
+ };
+
+ struct B {
+ int x;
+ A a[3];
+ B& operator=(B&) = default;
+ B& operator=(B&&) = default;
+ };
+
+ // This used to produce a warning about the iteration variable in the
+ // synthesized assignment operator being undefined.
+ void testNoWarning() {
+ B v, u;
+ u = v;
+ }
+
+ void testNoWarningMove() {
+ B v, u;
+ u = static_cast<B &&>(v);
+ }
+
+ void testConsistency() {
+ B v, u;
+ v.a[1].a = 47;
+ v.a[2].a = 42;
+ u = v;
+ clang_analyzer_eval(u.a[1].a == -47); // expected-warning{{TRUE}}
+ clang_analyzer_eval(u.a[2].a == -42); // expected-warning{{TRUE}}
+ }
+
+ void testConsistencyMove() {
+ B v, u;
+ v.a[1].a = 47;
+ v.a[2].a = 42;
+ u = static_cast<B &&>(v);
+ clang_analyzer_eval(u.a[1].a == 48); // expected-warning{{TRUE}}
+ clang_analyzer_eval(u.a[2].a == 43); // expected-warning{{TRUE}}
+ }
+}
diff --git a/test/Analysis/out-of-bounds.c b/test/Analysis/out-of-bounds.c
index dd593c5f26c0..d89a23961903 100644
--- a/test/Analysis/out-of-bounds.c
+++ b/test/Analysis/out-of-bounds.c
@@ -154,3 +154,15 @@ void test_index_below_symboloc() {
buf[-1] = 0; // no-warning;
}
+void test_incomplete_struct() {
+ extern struct incomplete incomplete;
+ int *p = (int *)&incomplete;
+ p[1] = 42; // no-warning
+}
+
+void test_extern_void() {
+ extern void v;
+ int *p = (int *)&v;
+ p[1] = 42; // no-warning
+}
+
diff --git a/test/Analysis/plist-macros.cpp b/test/Analysis/plist-macros.cpp
new file mode 100644
index 000000000000..0e8518a6f59c
--- /dev/null
+++ b/test/Analysis/plist-macros.cpp
@@ -0,0 +1,1597 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -analyzer-eagerly-assume -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -analyzer-eagerly-assume -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=ture %s -o %t.plist
+// RUN: FileCheck --input-file=%t.plist %s
+
+
+typedef __typeof(sizeof(int)) size_t;
+void *malloc(size_t);
+
+#define mallocmemory int *x = (int*)malloc(12);
+void noteOnMacro(int y) {
+ y++;
+ y--;
+ mallocmemory
+ y++;
+ y++;
+ delete x; // expected-warning {{Memory allocated by malloc() should be deallocated by free(), not 'delete'}}
+}
+
+void macroIsFirstInFunction(int y) {
+ mallocmemory
+ y++; // expected-warning {{Potential leak of memory pointed to by 'x'}}
+}
+
+#define checkmacro p==0
+void macroInExpressionAux(bool b);
+int macroInExpression(int *p, int y) {;
+ y++;
+ macroInExpressionAux(checkmacro);
+
+ return *p; // expected-warning {{Dereference of null pointer}}
+}
+
+#define noPathNoteMacro y+y
+int macroInExpressionNoNote(int *p, int y) {;
+ y++;
+ if (5 + noPathNoteMacro)
+ if (p)
+ ;
+ return *p; // expected-warning {{Dereference of null pointer}}
+}
+
+#define macroWithArg(mp) mp==0
+int macroWithArgInExpression(int *p, int y) {;
+ y++;
+ if (macroWithArg(p))
+ ;
+ return *p; // expected-warning {{Dereference of null pointer}}
+}
+
+#define multiNoteMacroWithError \
+ if (p) \
+ ;\
+ *p = 5;
+int useMultiNoteMacroWithError(int *p, int y) {;
+ y++;
+ multiNoteMacroWithError // expected-warning {{Dereference of null pointer}}
+
+ return *p;
+}
+
+#define multiNoteMacro \
+if (p) \
+ ;\
+if (y) \
+ ;
+int useMultiNote(int *p, int y) {;
+ y++;
+ multiNoteMacro
+
+ return *p; // expected-warning {{Dereference of null pointer}}
+}
+
+#define CALL_FN(a) null_deref(a)
+
+void null_deref(int *a) {
+ if (a)
+ return;
+ *a = 1; // expected-warning {{Dereference of null pointer}}
+}
+
+void test1() {
+ CALL_FN(0);
+}
+
+void test2(int *p) {
+ CALL_FN(p);
+}
+// CHECK: <key>diagnostics</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Memory is allocated</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Memory is allocated</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>13</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Memory allocated by malloc() should be deallocated by free(), not &apos;delete&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Memory allocated by malloc() should be deallocated by free(), not &apos;delete&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Memory allocated by malloc() should be deallocated by free(), not &apos;delete&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory Error</string>
+// CHECK-NEXT: <key>type</key><string>Bad deallocator</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>noteOnMacro</string>
+// CHECK-NEXT: <key>issue_hash</key><string>6</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>16</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>20</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>20</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>20</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Memory is allocated</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Memory is allocated</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>20</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>20</integer>
+// CHECK-NEXT: <key>col</key><integer>14</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Potential leak of memory pointed to by &apos;x&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Potential leak of memory pointed to by &apos;x&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Potential leak of memory pointed to by &apos;x&apos;</string>
+// CHECK-NEXT: <key>category</key><string>Memory Error</string>
+// CHECK-NEXT: <key>type</key><string>Memory leak</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>macroIsFirstInFunction</string>
+// CHECK-NEXT: <key>issue_hash</key><string>1</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>21</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>27</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>27</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is equal to null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is equal to null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>28</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>macroInExpression</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>30</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>35</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>35</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>36</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>37</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>macroInExpressionNoNote</string>
+// CHECK-NEXT: <key>issue_hash</key><string>5</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>39</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>44</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>44</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is equal to null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is equal to null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>45</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>macroWithArgInExpression</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>55</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>55</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>25</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>25</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>25</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>25</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>25</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>useMultiNoteMacroWithError</string>
+// CHECK-NEXT: <key>issue_hash</key><string>2</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>67</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>67</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is null</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;p&apos; is null</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Assuming &apos;y&apos; is 0</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Assuming &apos;y&apos; is 0</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>68</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;p&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>useMultiNote</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Passing null pointer value via 1st parameter &apos;a&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Passing null pointer value via 1st parameter &apos;a&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>col</key><integer>9</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Calling &apos;null_deref&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Calling &apos;null_deref&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>75</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Entered call from &apos;test1&apos;</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Entered call from &apos;test1&apos;</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>75</integer>
+// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>75</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>1</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;a&apos;)</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Dereference of null pointer (loaded from variable &apos;a&apos;)</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Dereference of null pointer (loaded from variable &apos;a&apos;)</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>null_deref</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>col</key><integer>6</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
diff --git a/test/Analysis/plist-output-alternate.m b/test/Analysis/plist-output-alternate.m
index 93d0421d665e..ea5ace636373 100644
--- a/test/Analysis/plist-output-alternate.m
+++ b/test/Analysis/plist-output-alternate.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-output=plist -o %t %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -fblocks -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false -o %t %s
// RUN: FileCheck --input-file %t %s
void test_null_init(void) {
@@ -925,12 +925,12 @@ void rdar8331641(int x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>line</key><integer>36</integer>
-// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>line</key><integer>36</integer>
-// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
@@ -946,12 +946,12 @@ void rdar8331641(int x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>line</key><integer>36</integer>
-// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>line</key><integer>36</integer>
-// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
diff --git a/test/Analysis/plist-output.m b/test/Analysis/plist-output.m
index 3dfd6be2e713..f2823a060560 100644
--- a/test/Analysis/plist-output.m
+++ b/test/Analysis/plist-output.m
@@ -1,4 +1,4 @@
-// RUN: %clang --analyze %s -Xanalyzer -analyzer-checker=osx.cocoa.RetainCount -o %t.plist
+// RUN: %clang --analyze %s -Xanalyzer -analyzer-checker=osx.cocoa.RetainCount -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
void test_null_init(void) {
@@ -1062,12 +1062,12 @@ int testFoo(Foo *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>line</key><integer>36</integer>
-// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>line</key><integer>36</integer>
-// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
@@ -1083,12 +1083,12 @@ int testFoo(Foo *x) {
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>line</key><integer>36</integer>
-// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>line</key><integer>36</integer>
-// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>24</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
diff --git a/test/Analysis/pointer-to-member.cpp b/test/Analysis/pointer-to-member.cpp
index c9150e8ca594..37d04399b7b7 100644
--- a/test/Analysis/pointer-to-member.cpp
+++ b/test/Analysis/pointer-to-member.cpp
@@ -33,6 +33,7 @@ void testConditionalUse() {
void testComparison() {
clang_analyzer_eval(&A::getPtr == &A::getPtr); // expected-warning{{TRUE}}
+ clang_analyzer_eval(&A::getPtr == 0); // expected-warning{{FALSE}}
// FIXME: Should be TRUE.
clang_analyzer_eval(&A::m_ptr == &A::m_ptr); // expected-warning{{UNKNOWN}}
diff --git a/test/Analysis/ptr-arith.c b/test/Analysis/ptr-arith.c
index 35faff4a1709..4a15bc24b906 100644
--- a/test/Analysis/ptr-arith.c
+++ b/test/Analysis/ptr-arith.c
@@ -280,3 +280,19 @@ void canonical_equal(int *lhs, int *rhs) {
// FIXME: Should be FALSE.
clang_analyzer_eval(rhs == lhs); // expected-warning{{UNKNOWN}}
}
+
+void compare_element_region_and_base(int *p) {
+ int *q = p - 1;
+ clang_analyzer_eval(p == q); // expected-warning{{FALSE}}
+}
+
+struct Point {
+ int x;
+ int y;
+};
+void symbolicFieldRegion(struct Point *points, int i, int j) {
+ clang_analyzer_eval(&points[i].x == &points[j].x);// expected-warning{{UNKNOWN}}
+ clang_analyzer_eval(&points[i].x == &points[i].y);// expected-warning{{FALSE}}
+ clang_analyzer_eval(&points[i].x < &points[i].y);// expected-warning{{TRUE}}
+}
+
diff --git a/test/Analysis/ptr-arith.cpp b/test/Analysis/ptr-arith.cpp
new file mode 100644
index 000000000000..5f0951857b13
--- /dev/null
+++ b/test/Analysis/ptr-arith.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s
+// expected-no-diagnostics
+struct X {
+ int *p;
+ int zero;
+ void foo () {
+ reset(p - 1);
+ }
+ void reset(int *in) {
+ while (in != p) // Loop must be entered.
+ zero = 1;
+ }
+};
+
+int test (int *in) {
+ X littleX;
+ littleX.zero = 0;
+ littleX.p = in;
+ littleX.foo();
+ return 5/littleX.zero; // no-warning
+}
+
diff --git a/test/Analysis/rdar-6540084.m b/test/Analysis/rdar-6540084.m
index 7070709e57dd..e928710b387d 100644
--- a/test/Analysis/rdar-6540084.m
+++ b/test/Analysis/rdar-6540084.m
@@ -9,13 +9,13 @@ typedef struct _NSZone NSZone;
@protocol NSObject - (BOOL)isEqual:(id)object; @end
@interface NSObject <NSObject> {} @end
extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
-@class NSArray;
+@class NSArray; // expected-note {{receiver is instance of class declared here}}
@class NSMutableArray, NSIndexSet, NSView, NSPredicate, NSString, NSViewAnimation, NSTimer; // expected-note{{forward declaration of class here}}
@interface FooBazController : NSObject {}
@end
typedef struct {} TazVersion;
@class TazNode;
-@interface TazGuttenberg : NSObject {} typedef NSUInteger BugsBunnyType; @end
+@interface TazGuttenberg : NSObject {} typedef NSUInteger BugsBunnyType; @end // expected-note {{receiver is instance of class declared here}}
@interface FooBaz : NSObject {}
@property (nonatomic) BugsBunnyType matchType;
@property (nonatomic, retain) NSArray *papyrus; @end
diff --git a/test/Analysis/reference.cpp b/test/Analysis/reference.cpp
index 1dabe7bc1a3d..bd5eaaa30909 100644
--- a/test/Analysis/reference.cpp
+++ b/test/Analysis/reference.cpp
@@ -75,6 +75,13 @@ namespace PR13440 {
int (&x)[1];
int *m() { return x; }
+
+ void testArrayToPointerDecayWithNonTypedValueRegion() {
+ int *p = x;
+ int *q = x;
+ clang_analyzer_eval(p[0] == q[0]); // expected-warning{{TRUE}}
+ }
+
};
void test() {
diff --git a/test/Analysis/reinterpret-cast.cpp b/test/Analysis/reinterpret-cast.cpp
index 59e6a539a11f..cb7cbfd325d8 100644
--- a/test/Analysis/reinterpret-cast.cpp
+++ b/test/Analysis/reinterpret-cast.cpp
@@ -86,3 +86,20 @@ namespace PR15345 {
clang_analyzer_eval(p->x == 42); // expected-warning{{TRUE}}
};
}
+
+int trackpointer_std_addressof() {
+ int x;
+ int *p = (int*)&reinterpret_cast<const volatile char&>(x);
+ *p = 6;
+ return x; // no warning
+}
+
+void set_x1(int *&);
+void set_x2(void *&);
+int radar_13146953(void) {
+ int *x = 0, *y = 0;
+
+ set_x1(x);
+ set_x2((void *&)y);
+ return *x + *y; // no warning
+} \ No newline at end of file
diff --git a/test/Analysis/retain-release-path-notes-gc.m b/test/Analysis/retain-release-path-notes-gc.m
index f74d61fa9adc..40592f008b4b 100644
--- a/test/Analysis/retain-release-path-notes-gc.m
+++ b/test/Analysis/retain-release-path-notes-gc.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fobjc-gc-only -analyzer-output=text -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fobjc-gc-only -analyzer-output=plist-multi-file %s -o %t.plist
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fobjc-gc-only -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
/***
@@ -40,17 +40,17 @@ CFTypeRef CFGetSomething();
void creationViaCFCreate () {
- CFTypeRef leaked = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
- return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
+ CFTypeRef leaked = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
+ return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
void makeCollectable () {
- CFTypeRef leaked = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
+ CFTypeRef leaked = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +2 retain count}}
CFMakeCollectable(leaked); // expected-note{{In GC mode a call to 'CFMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. An object must have a 0 retain count to be garbage collected. After this call its retain count is +1}}
NSMakeCollectable(leaked); // expected-note{{In GC mode a call to 'NSMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. Since it now has a 0 retain count the object can be automatically collected by the garbage collector}}
CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count. The object is not eligible for garbage collection until the retain count reaches 0 again}}
- return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
+ return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
void retainReleaseIgnored () {
@@ -63,13 +63,13 @@ void retainReleaseIgnored () {
@implementation Foo (FundamentalRuleUnderGC)
- (id)getViolation {
- id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
- return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' and returned from method 'getViolation' is potentially leaked when using garbage collection. Callers of this method do not expect a returned object with a +1 retain count since they expect the object to be managed by the garbage collector}}
+ id object = (id) CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
+ return object; // expected-warning{{leak}} expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' and returned from method 'getViolation' is potentially leaked when using garbage collection. Callers of this method do not expect a returned object with a +1 retain count since they expect the object to be managed by the garbage collector}}
}
- (id)copyViolation {
- id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
- return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' and returned from method 'copyViolation' is potentially leaked when using garbage collection. Callers of this method do not expect a returned object with a +1 retain count since they expect the object to be managed by the garbage collector}}
+ id object = (id) CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}}
+ return object; // expected-warning{{leak}} expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' and returned from method 'copyViolation' is potentially leaked when using garbage collection. Callers of this method do not expect a returned object with a +1 retain count since they expect the object to be managed by the garbage collector}}
}
@end
diff --git a/test/Analysis/retain-release-path-notes.m b/test/Analysis/retain-release-path-notes.m
index a3c681ae3750..4b16c714e902 100644
--- a/test/Analysis/retain-release-path-notes.m
+++ b/test/Analysis/retain-release-path-notes.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=text -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=plist-multi-file %s -o %t
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t
// RUN: FileCheck --input-file=%t %s
/***
@@ -34,6 +34,7 @@ GC-specific notes should go in retain-release-path-notes-gc.m.
typedef struct CFType *CFTypeRef;
CFTypeRef CFRetain(CFTypeRef);
void CFRelease(CFTypeRef);
+CFTypeRef CFAutorelease(CFTypeRef __attribute__((cf_consumed)));
id NSMakeCollectable(CFTypeRef);
CFTypeRef CFMakeCollectable(CFTypeRef);
@@ -43,33 +44,33 @@ CFTypeRef CFGetSomething();
void creationViaAlloc () {
- id leaked = [[NSObject alloc] init]; // expected-warning{{leak}} expected-note{{Method returns an Objective-C object with a +1 retain count}}
- return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
+ id leaked = [[NSObject alloc] init]; // expected-note{{Method returns an Objective-C object with a +1 retain count}}
+ return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
void creationViaCFCreate () {
- CFTypeRef leaked = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
- return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
+ CFTypeRef leaked = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
+ return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
void acquisitionViaMethod (Foo *foo) {
- id leaked = [foo methodWithValue]; // expected-warning{{leak}} expected-note{{Method returns an Objective-C object with a +0 retain count}}
+ id leaked = [foo methodWithValue]; // expected-note{{Method returns an Objective-C object with a +0 retain count}}
[leaked retain]; // expected-note{{Reference count incremented. The object now has a +1 retain count}}
[leaked retain]; // expected-note{{Reference count incremented. The object now has a +2 retain count}}
[leaked release]; // expected-note{{Reference count decremented. The object now has a +1 retain count}}
- return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
+ return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
void acquisitionViaProperty (Foo *foo) {
- id leaked = foo.propertyValue; // expected-warning{{leak}} expected-note{{Property returns an Objective-C object with a +0 retain count}}
+ id leaked = foo.propertyValue; // expected-note{{Property returns an Objective-C object with a +0 retain count}}
[leaked retain]; // expected-note{{Reference count incremented. The object now has a +1 retain count}}
- return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
+ return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
void acquisitionViaCFFunction () {
- CFTypeRef leaked = CFGetSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object with a +0 retain count}}
+ CFTypeRef leaked = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object with a +0 retain count}}
CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count}}
- return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
+ return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
void explicitDealloc () {
@@ -98,10 +99,10 @@ void autoreleaseUnowned (Foo *foo) {
}
void makeCollectableIgnored () {
- CFTypeRef leaked = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
+ CFTypeRef leaked = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
CFMakeCollectable(leaked); // expected-note{{When GC is not enabled a call to 'CFMakeCollectable' has no effect on its argument}}
NSMakeCollectable(leaked); // expected-note{{When GC is not enabled a call to 'NSMakeCollectable' has no effect on its argument}}
- return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
+ return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
CFTypeRef CFCopyRuleViolation () {
@@ -110,8 +111,8 @@ CFTypeRef CFCopyRuleViolation () {
}
CFTypeRef CFGetRuleViolation () {
- CFTypeRef object = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
- return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation}}
+ CFTypeRef object = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
+ return object; // expected-warning{{leak}} expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation}}
}
@implementation Foo (FundamentalMemoryManagementRules)
@@ -131,8 +132,8 @@ CFTypeRef CFGetRuleViolation () {
}
- (id)getViolation {
- id result = [[Foo alloc] init]; // expected-warning{{leak}} expected-note{{Method returns an Objective-C object with a +1 retain count}}
- return result; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa}}
+ id result = [[Foo alloc] init]; // expected-note{{Method returns an Objective-C object with a +1 retain count}}
+ return result; // expected-warning{{leak}} expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa}}
}
- (id)copyAutorelease {
@@ -228,12 +229,12 @@ static int Cond;
// expected-note@-3 {{Returning from 'initX'}}
// expected-note@-4 {{Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1}}
// initI is inlined because the allocation happens within initY
- id y = [[MyObj alloc] initY]; // expected-warning {{Potential leak of an object}}
+ id y = [[MyObj alloc] initY];
// expected-note@-1 {{Calling 'initY'}}
// expected-note@-2 {{Returning from 'initY'}}
// initZ is not inlined
- id z = [[MyObj alloc] initZ];
+ id z = [[MyObj alloc] initZ]; // expected-warning {{Potential leak of an object}}
// expected-note@-1 {{Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1}}
[x release];
@@ -241,6 +242,28 @@ static int Cond;
}
@end
+
+void CFOverAutorelease() {
+ CFTypeRef object = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
+ CFAutorelease(object); // expected-note{{Object autoreleased}}
+ CFAutorelease(object); // expected-note{{Object autoreleased}}
+ return; // expected-warning{{Object autoreleased too many times}} expected-note{{Object was autoreleased 2 times but the object has a +1 retain count}}
+}
+
+void CFAutoreleaseUnowned() {
+ CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object with a +0 retain count}}
+ CFAutorelease(object); // expected-note{{Object autoreleased}}
+ return; // expected-warning{{Object autoreleased too many times}} expected-note{{Object was autoreleased but has a +0 retain count}}
+}
+
+void CFAutoreleaseUnownedMixed() {
+ CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object with a +0 retain count}}
+ CFAutorelease(object); // expected-note{{Object autoreleased}}
+ [(id)object autorelease]; // expected-note{{Object autoreleased}}
+ return; // expected-warning{{Object autoreleased too many times}} expected-note{{Object was autoreleased 2 times but the object has a +0 retain count}}
+}
+
+
// CHECK: <key>diagnostics</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
@@ -254,12 +277,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>46</integer>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>46</integer>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -267,12 +290,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>46</integer>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>46</integer>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -284,7 +307,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>46</integer>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -292,12 +315,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>46</integer>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>46</integer>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
// CHECK-NEXT: <key>col</key><integer>37</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -317,12 +340,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>46</integer>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>46</integer>
+// CHECK-NEXT: <key>line</key><integer>47</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -330,12 +353,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -347,7 +370,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -355,12 +378,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -381,7 +404,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>1</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>47</integer>
+// CHECK-NEXT: <key>line</key><integer>48</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -397,12 +420,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -410,12 +433,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
// CHECK-NEXT: <key>col</key><integer>38</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -427,7 +450,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -435,12 +458,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
// CHECK-NEXT: <key>col</key><integer>40</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -460,12 +483,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>51</integer>
+// CHECK-NEXT: <key>line</key><integer>52</integer>
// CHECK-NEXT: <key>col</key><integer>38</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -473,12 +496,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -490,7 +513,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -498,12 +521,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -524,7 +547,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>1</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>52</integer>
+// CHECK-NEXT: <key>line</key><integer>53</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -540,12 +563,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -553,12 +576,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -570,7 +593,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -578,12 +601,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
// CHECK-NEXT: <key>col</key><integer>35</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -603,12 +626,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>56</integer>
+// CHECK-NEXT: <key>line</key><integer>57</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -616,12 +639,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -633,7 +656,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -641,24 +664,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -678,12 +701,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>57</integer>
+// CHECK-NEXT: <key>line</key><integer>58</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -691,12 +714,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -708,7 +731,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -716,24 +739,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -753,12 +776,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>58</integer>
+// CHECK-NEXT: <key>line</key><integer>59</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -766,12 +789,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>line</key><integer>60</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>line</key><integer>60</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -783,7 +806,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>line</key><integer>60</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -791,24 +814,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>line</key><integer>60</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>line</key><integer>60</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>line</key><integer>60</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>line</key><integer>60</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -828,12 +851,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>line</key><integer>60</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>59</integer>
+// CHECK-NEXT: <key>line</key><integer>60</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -841,12 +864,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>61</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>61</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -858,7 +881,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>61</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -866,12 +889,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>61</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>61</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -892,7 +915,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>1</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>60</integer>
+// CHECK-NEXT: <key>line</key><integer>61</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -908,12 +931,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -921,12 +944,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
// CHECK-NEXT: <key>col</key><integer>31</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -938,7 +961,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -946,12 +969,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
// CHECK-NEXT: <key>col</key><integer>31</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -971,12 +994,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>64</integer>
+// CHECK-NEXT: <key>line</key><integer>65</integer>
// CHECK-NEXT: <key>col</key><integer>31</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -984,12 +1007,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1001,7 +1024,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1009,24 +1032,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1046,12 +1069,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>65</integer>
+// CHECK-NEXT: <key>line</key><integer>66</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1059,12 +1082,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>line</key><integer>67</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>line</key><integer>67</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1076,7 +1099,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>line</key><integer>67</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1084,12 +1107,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>line</key><integer>67</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>line</key><integer>67</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1110,7 +1133,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>1</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>66</integer>
+// CHECK-NEXT: <key>line</key><integer>67</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1126,12 +1149,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1139,12 +1162,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
// CHECK-NEXT: <key>col</key><integer>35</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1156,7 +1179,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1164,12 +1187,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
// CHECK-NEXT: <key>col</key><integer>37</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1189,12 +1212,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>70</integer>
+// CHECK-NEXT: <key>line</key><integer>71</integer>
// CHECK-NEXT: <key>col</key><integer>35</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1202,12 +1225,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1219,7 +1242,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1227,24 +1250,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>12</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>17</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1264,12 +1287,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>71</integer>
+// CHECK-NEXT: <key>line</key><integer>72</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1277,12 +1300,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>72</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>72</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1294,7 +1317,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>72</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1302,12 +1325,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>72</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>72</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1328,7 +1351,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>1</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>72</integer>
+// CHECK-NEXT: <key>line</key><integer>73</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1344,12 +1367,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1357,12 +1380,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1374,7 +1397,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1382,12 +1405,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
// CHECK-NEXT: <key>col</key><integer>37</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1407,12 +1430,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>76</integer>
+// CHECK-NEXT: <key>line</key><integer>77</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1420,12 +1443,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1437,7 +1460,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1445,24 +1468,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1482,12 +1505,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>77</integer>
+// CHECK-NEXT: <key>line</key><integer>78</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1495,12 +1518,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1512,7 +1535,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1520,12 +1543,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1546,7 +1569,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>3</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>78</integer>
+// CHECK-NEXT: <key>line</key><integer>79</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1562,12 +1585,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1575,12 +1598,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1592,7 +1615,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1600,12 +1623,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
// CHECK-NEXT: <key>col</key><integer>37</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1625,12 +1648,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>82</integer>
+// CHECK-NEXT: <key>line</key><integer>83</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1638,12 +1661,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1655,7 +1678,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1663,24 +1686,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1700,12 +1723,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>83</integer>
+// CHECK-NEXT: <key>line</key><integer>84</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1713,12 +1736,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1730,7 +1753,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1738,12 +1761,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1764,7 +1787,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>3</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>84</integer>
+// CHECK-NEXT: <key>line</key><integer>85</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1780,12 +1803,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>line</key><integer>89</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>line</key><integer>89</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1793,12 +1816,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>line</key><integer>89</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>line</key><integer>89</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1810,7 +1833,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>line</key><integer>89</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1818,12 +1841,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>line</key><integer>89</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>line</key><integer>89</integer>
// CHECK-NEXT: <key>col</key><integer>37</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1843,12 +1866,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>line</key><integer>89</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>88</integer>
+// CHECK-NEXT: <key>line</key><integer>89</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1856,12 +1879,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>89</integer>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>89</integer>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1873,7 +1896,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>89</integer>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1881,24 +1904,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>89</integer>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>89</integer>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>89</integer>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>89</integer>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1918,12 +1941,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>89</integer>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>89</integer>
+// CHECK-NEXT: <key>line</key><integer>90</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1931,12 +1954,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>line</key><integer>91</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>line</key><integer>91</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1948,7 +1971,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>line</key><integer>91</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1956,24 +1979,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>line</key><integer>91</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>line</key><integer>91</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>line</key><integer>91</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>line</key><integer>91</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1993,12 +2016,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>line</key><integer>91</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>90</integer>
+// CHECK-NEXT: <key>line</key><integer>91</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2006,12 +2029,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>91</integer>
+// CHECK-NEXT: <key>line</key><integer>92</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>91</integer>
+// CHECK-NEXT: <key>line</key><integer>92</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2023,7 +2046,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>91</integer>
+// CHECK-NEXT: <key>line</key><integer>92</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2031,12 +2054,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>91</integer>
+// CHECK-NEXT: <key>line</key><integer>92</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>91</integer>
+// CHECK-NEXT: <key>line</key><integer>92</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2057,7 +2080,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>4</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>91</integer>
+// CHECK-NEXT: <key>line</key><integer>92</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2073,12 +2096,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2086,12 +2109,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
// CHECK-NEXT: <key>col</key><integer>31</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2103,7 +2126,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2111,12 +2134,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
// CHECK-NEXT: <key>col</key><integer>31</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2136,12 +2159,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>95</integer>
+// CHECK-NEXT: <key>line</key><integer>96</integer>
// CHECK-NEXT: <key>col</key><integer>31</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2149,12 +2172,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2166,7 +2189,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2174,24 +2197,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2211,12 +2234,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>96</integer>
+// CHECK-NEXT: <key>line</key><integer>97</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2224,12 +2247,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>line</key><integer>98</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>line</key><integer>98</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2241,7 +2264,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>line</key><integer>98</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2249,12 +2272,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>line</key><integer>98</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>line</key><integer>98</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2275,7 +2298,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>3</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>97</integer>
+// CHECK-NEXT: <key>line</key><integer>98</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2291,12 +2314,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>101</integer>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>101</integer>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2304,12 +2327,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>101</integer>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>101</integer>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
// CHECK-NEXT: <key>col</key><integer>38</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2321,7 +2344,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>101</integer>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2329,12 +2352,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>101</integer>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>101</integer>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
// CHECK-NEXT: <key>col</key><integer>40</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2354,12 +2377,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>101</integer>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>101</integer>
+// CHECK-NEXT: <key>line</key><integer>102</integer>
// CHECK-NEXT: <key>col</key><integer>38</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2367,12 +2390,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2384,7 +2407,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2392,24 +2415,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
// CHECK-NEXT: <key>col</key><integer>27</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
// CHECK-NEXT: <key>col</key><integer>21</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
// CHECK-NEXT: <key>col</key><integer>26</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2429,12 +2452,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>102</integer>
+// CHECK-NEXT: <key>line</key><integer>103</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2442,12 +2465,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>line</key><integer>104</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>line</key><integer>104</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2459,7 +2482,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>line</key><integer>104</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2467,24 +2490,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>line</key><integer>104</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>line</key><integer>104</integer>
// CHECK-NEXT: <key>col</key><integer>27</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>line</key><integer>104</integer>
// CHECK-NEXT: <key>col</key><integer>21</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>line</key><integer>104</integer>
// CHECK-NEXT: <key>col</key><integer>26</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2504,12 +2527,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>line</key><integer>104</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>103</integer>
+// CHECK-NEXT: <key>line</key><integer>104</integer>
// CHECK-NEXT: <key>col</key><integer>19</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2517,12 +2540,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>104</integer>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>104</integer>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2534,7 +2557,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>104</integer>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2542,12 +2565,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>104</integer>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>104</integer>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2568,7 +2591,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>1</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>104</integer>
+// CHECK-NEXT: <key>line</key><integer>105</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2584,12 +2607,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>108</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>108</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2597,12 +2620,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>108</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>108</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>35</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2614,7 +2637,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>108</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2622,12 +2645,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>108</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>108</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>37</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2647,12 +2670,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>108</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>108</integer>
+// CHECK-NEXT: <key>line</key><integer>109</integer>
// CHECK-NEXT: <key>col</key><integer>35</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2660,12 +2683,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2677,7 +2700,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2685,24 +2708,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2718,7 +2741,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2726,12 +2749,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2752,7 +2775,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>2</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>109</integer>
+// CHECK-NEXT: <key>line</key><integer>110</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2768,12 +2791,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>113</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>113</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2781,12 +2804,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>113</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>113</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>38</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2798,7 +2821,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>113</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2806,12 +2829,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>113</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>113</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>40</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2831,12 +2854,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>113</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>113</integer>
+// CHECK-NEXT: <key>line</key><integer>114</integer>
// CHECK-NEXT: <key>col</key><integer>38</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2844,12 +2867,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2861,7 +2884,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2869,24 +2892,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2902,7 +2925,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2910,12 +2933,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2936,7 +2959,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>1</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>114</integer>
+// CHECK-NEXT: <key>line</key><integer>115</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2952,12 +2975,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2965,12 +2988,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
// CHECK-NEXT: <key>col</key><integer>20</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
// CHECK-NEXT: <key>col</key><integer>32</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2982,7 +3005,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
// CHECK-NEXT: <key>col</key><integer>20</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -2990,12 +3013,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
// CHECK-NEXT: <key>col</key><integer>20</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
// CHECK-NEXT: <key>col</key><integer>32</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3015,12 +3038,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
// CHECK-NEXT: <key>col</key><integer>20</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>119</integer>
+// CHECK-NEXT: <key>line</key><integer>120</integer>
// CHECK-NEXT: <key>col</key><integer>32</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3028,12 +3051,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3045,7 +3068,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3053,24 +3076,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3086,7 +3109,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3094,12 +3117,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3120,7 +3143,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>2</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>120</integer>
+// CHECK-NEXT: <key>line</key><integer>121</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3136,12 +3159,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>124</integer>
+// CHECK-NEXT: <key>line</key><integer>125</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>124</integer>
+// CHECK-NEXT: <key>line</key><integer>125</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3149,12 +3172,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>124</integer>
+// CHECK-NEXT: <key>line</key><integer>125</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>124</integer>
+// CHECK-NEXT: <key>line</key><integer>125</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3166,7 +3189,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>124</integer>
+// CHECK-NEXT: <key>line</key><integer>125</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3174,12 +3197,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>124</integer>
+// CHECK-NEXT: <key>line</key><integer>125</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>124</integer>
+// CHECK-NEXT: <key>line</key><integer>125</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3199,12 +3222,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>124</integer>
+// CHECK-NEXT: <key>line</key><integer>125</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>124</integer>
+// CHECK-NEXT: <key>line</key><integer>125</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3212,12 +3235,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3229,7 +3252,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3237,24 +3260,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3270,7 +3293,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3278,12 +3301,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3304,7 +3327,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>2</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>125</integer>
+// CHECK-NEXT: <key>line</key><integer>126</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3320,12 +3343,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>129</integer>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>129</integer>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3333,12 +3356,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>129</integer>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>129</integer>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3350,7 +3373,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>129</integer>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3358,12 +3381,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>129</integer>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>129</integer>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3383,12 +3406,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>129</integer>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>129</integer>
+// CHECK-NEXT: <key>line</key><integer>130</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3396,12 +3419,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3413,7 +3436,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3421,24 +3444,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3454,7 +3477,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3462,12 +3485,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3488,7 +3511,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>2</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>130</integer>
+// CHECK-NEXT: <key>line</key><integer>131</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3504,12 +3527,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>134</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>134</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3517,12 +3540,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>134</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>134</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3534,7 +3557,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>134</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3542,12 +3565,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>134</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>134</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>32</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3567,12 +3590,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>134</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>134</integer>
+// CHECK-NEXT: <key>line</key><integer>135</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3580,12 +3603,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3597,7 +3620,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3605,24 +3628,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3638,7 +3661,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3646,12 +3669,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3672,7 +3695,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>1</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>135</integer>
+// CHECK-NEXT: <key>line</key><integer>136</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3688,12 +3711,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3701,12 +3724,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3718,7 +3741,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3726,12 +3749,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>32</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3751,12 +3774,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>139</integer>
+// CHECK-NEXT: <key>line</key><integer>140</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3764,12 +3787,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>line</key><integer>141</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>line</key><integer>141</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3781,7 +3804,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>line</key><integer>141</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3789,24 +3812,24 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>line</key><integer>141</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>line</key><integer>141</integer>
// CHECK-NEXT: <key>col</key><integer>22</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>line</key><integer>141</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>line</key><integer>141</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3826,12 +3849,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>line</key><integer>141</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>140</integer>
+// CHECK-NEXT: <key>line</key><integer>141</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3839,12 +3862,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>141</integer>
+// CHECK-NEXT: <key>line</key><integer>142</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>141</integer>
+// CHECK-NEXT: <key>line</key><integer>142</integer>
// CHECK-NEXT: <key>col</key><integer>8</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3856,7 +3879,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>141</integer>
+// CHECK-NEXT: <key>line</key><integer>142</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3864,12 +3887,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>141</integer>
+// CHECK-NEXT: <key>line</key><integer>142</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>141</integer>
+// CHECK-NEXT: <key>line</key><integer>142</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3890,7 +3913,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>3</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>141</integer>
+// CHECK-NEXT: <key>line</key><integer>142</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3906,12 +3929,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>line</key><integer>170</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>line</key><integer>170</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3919,12 +3942,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>line</key><integer>170</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>line</key><integer>170</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3936,7 +3959,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>line</key><integer>170</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3944,12 +3967,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>line</key><integer>170</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>line</key><integer>170</integer>
// CHECK-NEXT: <key>col</key><integer>16</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3969,12 +3992,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>line</key><integer>170</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>169</integer>
+// CHECK-NEXT: <key>line</key><integer>170</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3982,12 +4005,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>170</integer>
+// CHECK-NEXT: <key>line</key><integer>171</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>170</integer>
+// CHECK-NEXT: <key>line</key><integer>171</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -3999,7 +4022,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>170</integer>
+// CHECK-NEXT: <key>line</key><integer>171</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4007,12 +4030,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>170</integer>
+// CHECK-NEXT: <key>line</key><integer>171</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>170</integer>
+// CHECK-NEXT: <key>line</key><integer>171</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4033,7 +4056,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>2</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>170</integer>
+// CHECK-NEXT: <key>line</key><integer>171</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4049,12 +4072,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>line</key><integer>175</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>line</key><integer>175</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4062,12 +4085,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>line</key><integer>175</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>line</key><integer>175</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4079,7 +4102,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>line</key><integer>175</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4087,12 +4110,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>line</key><integer>175</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>line</key><integer>175</integer>
// CHECK-NEXT: <key>col</key><integer>18</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4112,12 +4135,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>line</key><integer>175</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>line</key><integer>175</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4125,12 +4148,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>175</integer>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>175</integer>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4142,7 +4165,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>175</integer>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4150,12 +4173,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>175</integer>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>175</integer>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4176,7 +4199,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>2</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>175</integer>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4192,12 +4215,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>line</key><integer>180</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>line</key><integer>180</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4205,12 +4228,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>line</key><integer>180</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>line</key><integer>180</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4222,7 +4245,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>line</key><integer>180</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4230,12 +4253,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>line</key><integer>180</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>line</key><integer>180</integer>
// CHECK-NEXT: <key>col</key><integer>20</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4255,12 +4278,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>line</key><integer>180</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>179</integer>
+// CHECK-NEXT: <key>line</key><integer>180</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4268,12 +4291,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>180</integer>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>180</integer>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4285,7 +4308,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>180</integer>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4293,12 +4316,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>180</integer>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>180</integer>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4319,7 +4342,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>2</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>180</integer>
+// CHECK-NEXT: <key>line</key><integer>181</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4335,12 +4358,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>184</integer>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>184</integer>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4348,12 +4371,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>184</integer>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>184</integer>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4365,7 +4388,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>184</integer>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4373,12 +4396,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>184</integer>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>184</integer>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
// CHECK-NEXT: <key>col</key><integer>20</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4398,12 +4421,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>184</integer>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>184</integer>
+// CHECK-NEXT: <key>line</key><integer>185</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4411,12 +4434,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4428,7 +4451,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4436,12 +4459,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4462,7 +4485,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>2</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>185</integer>
+// CHECK-NEXT: <key>line</key><integer>186</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4478,12 +4501,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4491,12 +4514,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4508,7 +4531,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4516,12 +4539,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
// CHECK-NEXT: <key>col</key><integer>27</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4541,12 +4564,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>189</integer>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
// CHECK-NEXT: <key>col</key><integer>15</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4554,12 +4577,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4571,7 +4594,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4579,12 +4602,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
// CHECK-NEXT: <key>col</key><integer>9</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4605,7 +4628,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>2</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>line</key><integer>191</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4621,12 +4644,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4634,12 +4657,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4651,7 +4674,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4659,12 +4682,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>23</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4684,12 +4707,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4697,12 +4720,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4714,7 +4737,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4722,12 +4745,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>30</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4743,7 +4766,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>205</integer>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
// CHECK-NEXT: <key>col</key><integer>1</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4761,12 +4784,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>205</integer>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
// CHECK-NEXT: <key>col</key><integer>1</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>205</integer>
+// CHECK-NEXT: <key>line</key><integer>206</integer>
// CHECK-NEXT: <key>col</key><integer>1</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4774,12 +4797,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4795,12 +4818,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4808,12 +4831,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>7</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4825,7 +4848,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>7</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4833,12 +4856,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>7</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4858,12 +4881,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>7</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>206</integer>
+// CHECK-NEXT: <key>line</key><integer>207</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4871,12 +4894,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>208</integer>
+// CHECK-NEXT: <key>line</key><integer>209</integer>
// CHECK-NEXT: <key>col</key><integer>5</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>208</integer>
+// CHECK-NEXT: <key>line</key><integer>209</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4888,7 +4911,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4896,12 +4919,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>30</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4921,12 +4944,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4934,12 +4957,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4951,7 +4974,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4959,12 +4982,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>6</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -4985,7 +5008,7 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>2</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5001,12 +5024,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5014,12 +5037,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5035,12 +5058,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>225</integer>
+// CHECK-NEXT: <key>line</key><integer>226</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5048,12 +5071,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>231</integer>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>231</integer>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5065,7 +5088,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>231</integer>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5073,12 +5096,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>231</integer>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>231</integer>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
// CHECK-NEXT: <key>col</key><integer>30</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5094,7 +5117,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>213</integer>
+// CHECK-NEXT: <key>line</key><integer>214</integer>
// CHECK-NEXT: <key>col</key><integer>1</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5112,12 +5135,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>213</integer>
+// CHECK-NEXT: <key>line</key><integer>214</integer>
// CHECK-NEXT: <key>col</key><integer>1</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>213</integer>
+// CHECK-NEXT: <key>line</key><integer>214</integer>
// CHECK-NEXT: <key>col</key><integer>1</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5125,12 +5148,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
// CHECK-NEXT: <key>col</key><integer>6</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5146,12 +5169,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
// CHECK-NEXT: <key>col</key><integer>6</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5159,12 +5182,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5176,7 +5199,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5184,12 +5207,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>214</integer>
+// CHECK-NEXT: <key>line</key><integer>215</integer>
// CHECK-NEXT: <key>col</key><integer>21</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5205,7 +5228,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>231</integer>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5213,12 +5236,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>231</integer>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>231</integer>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
// CHECK-NEXT: <key>col</key><integer>30</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5238,12 +5261,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>231</integer>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>231</integer>
+// CHECK-NEXT: <key>line</key><integer>232</integer>
// CHECK-NEXT: <key>col</key><integer>10</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5251,12 +5274,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>236</integer>
+// CHECK-NEXT: <key>line</key><integer>237</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>236</integer>
+// CHECK-NEXT: <key>line</key><integer>237</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5272,12 +5295,12 @@ static int Cond;
// CHECK-NEXT: <key>start</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>236</integer>
+// CHECK-NEXT: <key>line</key><integer>237</integer>
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>236</integer>
+// CHECK-NEXT: <key>line</key><integer>237</integer>
// CHECK-NEXT: <key>col</key><integer>4</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5285,12 +5308,12 @@ static int Cond;
// CHECK-NEXT: <key>end</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>236</integer>
+// CHECK-NEXT: <key>line</key><integer>237</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>236</integer>
+// CHECK-NEXT: <key>line</key><integer>237</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5302,7 +5325,7 @@ static int Cond;
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>236</integer>
+// CHECK-NEXT: <key>line</key><integer>237</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5310,12 +5333,12 @@ static int Cond;
// CHECK-NEXT: <array>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>236</integer>
+// CHECK-NEXT: <key>line</key><integer>237</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>236</integer>
+// CHECK-NEXT: <key>line</key><integer>237</integer>
// CHECK-NEXT: <key>col</key><integer>23</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -5336,9 +5359,813 @@ static int Cond;
// CHECK-NEXT: <key>issue_hash</key><string>8</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>236</integer>
+// CHECK-NEXT: <key>line</key><integer>237</integer>
// CHECK-NEXT: <key>col</key><integer>11</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>38</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>40</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFCreateSomething&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFCreateSomething&apos; returns a Core Foundation object with a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>247</integer>
+// CHECK-NEXT: <key>col</key><integer>38</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>248</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>249</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>249</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>249</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>249</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>249</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>249</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>249</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>249</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>249</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>250</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>250</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>250</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>250</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>250</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object was autoreleased 2 times but the object has a +1 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object was autoreleased 2 times but the object has a +1 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Object autoreleased too many times</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Object autoreleased too many times</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>CFOverAutorelease</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>250</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>35</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>37</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFGetSomething&apos; returns a Core Foundation object with a +0 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFGetSomething&apos; returns a Core Foundation object with a +0 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>254</integer>
+// CHECK-NEXT: <key>col</key><integer>35</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>255</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object was autoreleased but has a +0 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object was autoreleased but has a +0 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Object autoreleased too many times</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Object autoreleased too many times</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>CFAutoreleaseUnowned</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>256</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>260</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>260</integer>
+// CHECK-NEXT: <key>col</key><integer>11</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>260</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>260</integer>
+// CHECK-NEXT: <key>col</key><integer>35</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>260</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>260</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>260</integer>
+// CHECK-NEXT: <key>col</key><integer>37</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFGetSomething&apos; returns a Core Foundation object with a +0 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Call to function &apos;CFGetSomething&apos; returns a Core Foundation object with a +0 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>260</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>260</integer>
+// CHECK-NEXT: <key>col</key><integer>35</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>23</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>17</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>261</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>262</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>262</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>262</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>262</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>262</integer>
+// CHECK-NEXT: <key>col</key><integer>26</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>262</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>262</integer>
+// CHECK-NEXT: <key>col</key><integer>13</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object autoreleased</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>262</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>262</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Object was autoreleased 2 times but the object has a +0 retain count</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Object was autoreleased 2 times but the object has a +0 retain count</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Object autoreleased too many times</string>
+// CHECK-NEXT: <key>category</key><string>Memory (Core Foundation/Objective-C)</string>
+// CHECK-NEXT: <key>type</key><string>Object autoreleased too many times</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>CFAutoreleaseUnownedMixed</string>
+// CHECK-NEXT: <key>issue_hash</key><string>4</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>263</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
diff --git a/test/Analysis/retain-release.m b/test/Analysis/retain-release.m
index bb4a1d169d24..aafd94e97bdc 100644
--- a/test/Analysis/retain-release.m
+++ b/test/Analysis/retain-release.m
@@ -63,9 +63,12 @@ typedef const void * CFTypeRef;
typedef const struct __CFString * CFStringRef;
typedef const struct __CFAllocator * CFAllocatorRef;
extern const CFAllocatorRef kCFAllocatorDefault;
+
extern CFTypeRef CFRetain(CFTypeRef cf);
extern void CFRelease(CFTypeRef cf);
extern CFTypeRef CFMakeCollectable(CFTypeRef cf);
+extern CFTypeRef CFAutorelease(CFTypeRef CF_CONSUMED cf);
+
typedef struct {
}
CFArrayCallBacks;
@@ -2005,6 +2008,87 @@ static int Cond;
@end
//===----------------------------------------------------------------------===//
+// CFAutorelease
+//===----------------------------------------------------------------------===//
+
+CFTypeRef getAutoreleasedCFType() {
+ extern CFTypeRef CFCreateSomething();
+ return CFAutorelease(CFCreateSomething()); // no-warning
+}
+
+CFTypeRef getIncorrectlyAutoreleasedCFType() {
+ extern CFTypeRef CFGetSomething();
+ return CFAutorelease(CFGetSomething()); // expected-warning{{Object autoreleased too many times}}
+}
+
+CFTypeRef createIncorrectlyAutoreleasedCFType() {
+ extern CFTypeRef CFCreateSomething();
+ return CFAutorelease(CFCreateSomething()); // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
+}
+
+void useAfterAutorelease() {
+ extern CFTypeRef CFCreateSomething();
+ CFTypeRef obj = CFCreateSomething();
+ CFAutorelease(obj);
+
+ extern void useCF(CFTypeRef);
+ useCF(obj); // no-warning
+}
+
+void useAfterRelease() {
+ // Sanity check that the previous example would have warned with CFRelease.
+ extern CFTypeRef CFCreateSomething();
+ CFTypeRef obj = CFCreateSomething();
+ CFRelease(obj);
+
+ extern void useCF(CFTypeRef);
+ useCF(obj); // expected-warning{{Reference-counted object is used after it is released}}
+}
+
+void testAutoreleaseReturnsInput() {
+ extern CFTypeRef CFCreateSomething();
+ CFTypeRef obj = CFCreateSomething(); // expected-warning{{Potential leak of an object stored into 'obj'}}
+ CFTypeRef second = CFAutorelease(obj);
+ CFRetain(second);
+}
+
+CFTypeRef testAutoreleaseReturnsInputSilent() {
+ extern CFTypeRef CFCreateSomething();
+ CFTypeRef obj = CFCreateSomething();
+ CFTypeRef alias = CFAutorelease(obj);
+ CFRetain(alias);
+ CFRelease(obj);
+ return obj; // no-warning
+}
+
+void autoreleaseTypedObject() {
+ CFArrayRef arr = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ CFAutorelease((CFTypeRef)arr); // no-warning
+}
+
+void autoreleaseReturningTypedObject() {
+ CFArrayRef arr = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning{{Potential leak of an object stored into 'arr'}}
+ CFArrayRef alias = (CFArrayRef)CFAutorelease((CFTypeRef)arr);
+ CFRetain(alias);
+}
+
+CFArrayRef autoreleaseReturningTypedObjectSilent() {
+ CFArrayRef arr = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ CFArrayRef alias = (CFArrayRef)CFAutorelease((CFTypeRef)arr);
+ CFRetain(alias);
+ CFRelease(arr);
+ return alias; // no-warning
+}
+
+void autoreleaseObjC() {
+ id obj = [@1 retain];
+ CFAutorelease(obj); // no-warning
+
+ id anotherObj = @1;
+ CFAutorelease(anotherObj);
+} // expected-warning{{Object autoreleased too many times}}
+
+//===----------------------------------------------------------------------===//
// <rdar://problem/13783514> xpc_connection_set_finalizer_f
//===----------------------------------------------------------------------===//
@@ -2022,6 +2106,20 @@ void rdar13783514(xpc_connection_t connection) {
xpc_connection_set_finalizer_f(connection, releaseAfterXPC);
} // no-warning
+// Do not report leaks when object is cleaned up with __attribute__((cleanup ..)).
+inline static void cleanupFunction(void *tp) {
+ CFTypeRef x = *(CFTypeRef *)tp;
+ if (x) {
+ CFRelease(x);
+ }
+}
+#define ADDCLEANUP __attribute__((cleanup(cleanupFunction)))
+void foo() {
+ ADDCLEANUP CFStringRef myString;
+ myString = CFStringCreateWithCString(0, "hello world", kCFStringEncodingUTF8);
+ ADDCLEANUP CFStringRef myString2 =
+ CFStringCreateWithCString(0, "hello world", kCFStringEncodingUTF8);
+}
// CHECK: <key>diagnostics</key>
// CHECK-NEXT: <array>
diff --git a/test/Analysis/security-syntax-checks.m b/test/Analysis/security-syntax-checks.m
index 1df8a408a697..4ffd9a0b4907 100644
--- a/test/Analysis/security-syntax-checks.m
+++ b/test/Analysis/security-syntax-checks.m
@@ -82,10 +82,11 @@ void test_setuid()
}
// <rdar://problem/6337100> CWE-338: Use of cryptographically weak prng
+typedef unsigned short *ushort_ptr_t; // Test that sugar doesn't confuse the warning.
int rand(void);
double drand48(void);
double erand48(unsigned short[3]);
-long jrand48(unsigned short[3]);
+long jrand48(ushort_ptr_t);
void lcong48(unsigned short[7]);
long lrand48(void);
long mrand48(void);
diff --git a/test/Analysis/self-init.m b/test/Analysis/self-init.m
index 5a4354f49ad2..d1fb88de5410 100644
--- a/test/Analysis/self-init.m
+++ b/test/Analysis/self-init.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -fobjc-default-synthesize-properties -analyzer-config ipa=dynamic -fno-builtin %s -verify
-// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -fobjc-default-synthesize-properties -fno-builtin %s -verify
+// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -analyzer-config ipa=dynamic -fno-builtin %s -verify
+// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -fno-builtin %s -verify
@class NSZone, NSCoder;
@protocol NSObject
diff --git a/test/Analysis/simple-stream-checks.c b/test/Analysis/simple-stream-checks.c
index ce57fa7ac34e..2f725745a5ba 100644
--- a/test/Analysis/simple-stream-checks.c
+++ b/test/Analysis/simple-stream-checks.c
@@ -87,5 +87,5 @@ void testPassConstPointer() {
void testPassToSystemHeaderFunctionIndirectly() {
FileStruct fs;
fs.p = fopen("myfile.txt", "w");
- fakeSystemHeaderCall(&fs);
-} // expected-warning {{Opened file is never closed; potential resource leak}}
+ fakeSystemHeaderCall(&fs); // invalidates fs, making fs.p unreachable
+} // no-warning
diff --git a/test/Analysis/stack-addr-ps.cpp b/test/Analysis/stack-addr-ps.cpp
index 65d757154c87..a39f9c7dc726 100644
--- a/test/Analysis/stack-addr-ps.cpp
+++ b/test/Analysis/stack-addr-ps.cpp
@@ -20,6 +20,10 @@ const int& g3() {
return s3; // expected-warning{{Address of stack memory associated with local variable 's1' returned}} expected-warning {{reference to stack memory associated with local variable 's1' returned}}
}
+void g4() {
+ static const int &x = 3; // no warning
+}
+
int get_value();
const int &get_reference1() { return get_value(); } // expected-warning{{Address of stack memory associated with temporary object of type 'int' returned}} expected-warning {{returning reference to local temporary}}
diff --git a/test/Analysis/string.c b/test/Analysis/string.c
index 6cf52f7a557b..9fd3efb5c2d7 100644
--- a/test/Analysis/string.c
+++ b/test/Analysis/string.c
@@ -430,11 +430,12 @@ void strcat_unknown_src_length(char *src, int offset) {
// length for the "before" strlen, we won't be able to set one for "after".
void strcat_too_big(char *dst, char *src) {
+ // We assume this can never actually happen, so we don't get a warning.
if (strlen(dst) != (((size_t)0) - 2))
return;
if (strlen(src) != 2)
return;
- strcat(dst, src); // expected-warning{{This expression will create a string whose length is too big to be represented as a size_t}}
+ strcat(dst, src);
}
@@ -653,11 +654,12 @@ void strncat_unknown_limit(float limit) {
}
void strncat_too_big(char *dst, char *src) {
+ // We assume this will never actually happen, so we don't get a warning.
if (strlen(dst) != (((size_t)0) - 2))
return;
if (strlen(src) != 2)
return;
- strncat(dst, src, 2); // expected-warning{{This expression will create a string whose length is too big to be represented as a size_t}}
+ strncat(dst, src, 2);
}
void strncat_zero(char *src) {
diff --git a/test/Analysis/taint-tester.cpp b/test/Analysis/taint-tester.cpp
index f97eefb950e3..ca7b729f2691 100644
--- a/test/Analysis/taint-tester.cpp
+++ b/test/Analysis/taint-tester.cpp
@@ -6,7 +6,8 @@ typedef __typeof(sizeof(int)) size_t;
extern FILE *stdin;
typedef long ssize_t;
ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
-int printf(const char * __restrict, ...);
+int printf(const char * __restrict, ...);
+int snprintf(char *, size_t, const char *, ...);
void free(void *ptr);
struct GetLineTestStruct {
@@ -25,3 +26,10 @@ void getlineTest(void) {
}
free(line);
}
+
+class opaque;
+void testOpaqueClass(opaque *obj) {
+ char buf[20];
+ snprintf(buf, 20, "%p", obj); // don't crash trying to load *obj
+}
+
diff --git a/test/Analysis/temp-obj-dtors-cfg-output.cpp b/test/Analysis/temp-obj-dtors-cfg-output.cpp
index 1ddccb704b13..ff68a876e910 100644
--- a/test/Analysis/temp-obj-dtors-cfg-output.cpp
+++ b/test/Analysis/temp-obj-dtors-cfg-output.cpp
@@ -108,6 +108,24 @@ TestCtorInits::TestCtorInits()
: a(int(A()) + int(B()))
, b() {}
+class NoReturn {
+public:
+ ~NoReturn() __attribute__((noreturn));
+ void f();
+};
+
+void test_noreturn1() {
+ int a;
+ NoReturn().f();
+ int b;
+}
+
+void test_noreturn2() {
+ int a;
+ NoReturn(), 47;
+ int b;
+}
+
// CHECK: [B1 (ENTRY)]
// CHECK: Succs (1): B0
// CHECK: [B0 (EXIT)]
@@ -846,3 +864,36 @@ TestCtorInits::TestCtorInits()
// CHECK: [B0 (EXIT)]
// CHECK: Preds (1): B1
+// CHECK: [B3 (ENTRY)]
+// CHECK: Succs (1): B2
+// CHECK: [B1]
+// CHECK: 1: int b;
+// CHECK: Succs (1): B0
+// CHECK: [B2]
+// CHECK: 1: int a;
+// CHECK: 2: NoReturn() (CXXConstructExpr, class NoReturn)
+// CHECK: 3: [B2.2] (BindTemporary)
+// CHECK: 4: [B2.3].f
+// CHECK: 5: [B2.4]()
+// CHECK: 6: ~NoReturn() (Temporary object destructor)
+// CHECK: Preds (1): B3
+// CHECK: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK: Preds (2): B1 B2
+
+// CHECK: [B3 (ENTRY)]
+// CHECK: Succs (1): B2
+// CHECK: [B1]
+// CHECK: 1: int b;
+// CHECK: Succs (1): B0
+// CHECK: [B2]
+// CHECK: 1: int a;
+// CHECK: 2: NoReturn() (CXXConstructExpr, class NoReturn)
+// CHECK: 3: [B2.2] (BindTemporary)
+// CHECK: 4: 47
+// CHECK: 5: ... , [B2.4]
+// CHECK: 6: ~NoReturn() (Temporary object destructor)
+// CHECK: Preds (1): B3
+// CHECK: Succs (1): B0
+// CHECK: [B0 (EXIT)]
+// CHECK: Preds (2): B1 B2
diff --git a/test/Analysis/templates.cpp b/test/Analysis/templates.cpp
index faa5c1a76209..131794a7c931 100644
--- a/test/Analysis/templates.cpp
+++ b/test/Analysis/templates.cpp
@@ -48,3 +48,25 @@ void testNonTypeTemplateInstantiation() {
#endif
}
+namespace rdar13954714 {
+ template <bool VALUE>
+ bool blockInTemplate() {
+ return (^() {
+ return VALUE;
+ })();
+ }
+
+ // force instantiation
+ template bool blockInTemplate<true>();
+
+ template <bool VALUE>
+ void blockWithStatic() {
+ (void)^() {
+ static int x;
+ return ++x;
+ };
+ }
+
+ // force instantiation
+ template void blockWithStatic<true>();
+}
diff --git a/test/Analysis/temporaries.cpp b/test/Analysis/temporaries.cpp
index efc0825470cd..6b49fcbddd41 100644
--- a/test/Analysis/temporaries.cpp
+++ b/test/Analysis/temporaries.cpp
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify -w -std=c++03 %s
// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify -w -std=c++11 %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -DTEMPORARY_DTORS -verify -w -analyzer-config cfg-temporary-dtors=true %s
extern bool clang_analyzer_eval(bool);
@@ -109,3 +110,148 @@ namespace compound_literals {
}
}
+namespace destructors {
+ void testPR16664andPR18159Crash() {
+ struct Dtor {
+ ~Dtor();
+ };
+ extern bool coin();
+ extern bool check(const Dtor &);
+
+#ifndef TEMPORARY_DTORS
+ // FIXME: Don't crash here when tmp dtros are enabled.
+ // PR16664 and PR18159
+ if (coin() && (coin() || coin() || check(Dtor()))) {
+ Dtor();
+ }
+#endif
+ }
+
+#ifdef TEMPORARY_DTORS
+ struct NoReturnDtor {
+ ~NoReturnDtor() __attribute__((noreturn));
+ };
+
+ void noReturnTemp(int *x) {
+ if (! x) NoReturnDtor();
+ *x = 47; // no warning
+ }
+
+ void noReturnInline(int **x) {
+ NoReturnDtor();
+ }
+
+ void callNoReturn() {
+ int *x;
+ noReturnInline(&x);
+ *x = 47; // no warning
+ }
+
+ extern bool check(const NoReturnDtor &);
+
+ void testConsistencyIf(int i) {
+ if (i != 5)
+ return;
+ if (i == 5 && (i == 4 || check(NoReturnDtor()) || i == 5)) {
+ clang_analyzer_eval(true); // no warning, unreachable code
+ }
+ }
+
+ void testConsistencyTernary(int i) {
+ (i == 5 && (i == 4 || check(NoReturnDtor()) || i == 5)) ? 1 : 0;
+
+ clang_analyzer_eval(true); // expected-warning{{TRUE}}
+
+ if (i != 5)
+ return;
+
+ (i == 5 && (i == 4 || check(NoReturnDtor()) || i == 5)) ? 1 : 0;
+
+ clang_analyzer_eval(true); // no warning, unreachable code
+ }
+
+
+/*
+ // PR16664 and PR18159
+ FIXME: Don't crash here.
+ void testConsistencyNested(int i) {
+ extern bool compute(bool);
+
+ if (i == 5 && (i == 4 || i == 5 || check(NoReturnDtor())))
+ clang_analyzer_eval(true); // expected TRUE
+
+ if (i == 5 && (i == 4 || i == 5 || check(NoReturnDtor())))
+ clang_analyzer_eval(true); // expected TRUE
+
+ if (i != 5)
+ return;
+
+ if (compute(i == 5 &&
+ (i == 4 || compute(true) ||
+ compute(i == 5 && (i == 4 || check(NoReturnDtor()))))) ||
+ i != 4) {
+ clang_analyzer_eval(true); // expected TRUE
+ }
+
+ if (compute(i == 5 &&
+ (i == 4 || i == 4 ||
+ compute(i == 5 && (i == 4 || check(NoReturnDtor()))))) ||
+ i != 4) {
+ clang_analyzer_eval(true); // no warning, unreachable code
+ }
+ }*/
+
+#endif // TEMPORARY_DTORS
+}
+
+void testStaticMaterializeTemporaryExpr() {
+ static const Trivial &ref = getTrivial();
+ clang_analyzer_eval(ref.value == 42); // expected-warning{{TRUE}}
+
+ static const Trivial &directRef = Trivial(42);
+ clang_analyzer_eval(directRef.value == 42); // expected-warning{{TRUE}}
+
+#if __has_feature(cxx_thread_local)
+ thread_local static const Trivial &threadRef = getTrivial();
+ clang_analyzer_eval(threadRef.value == 42); // expected-warning{{TRUE}}
+
+ thread_local static const Trivial &threadDirectRef = Trivial(42);
+ clang_analyzer_eval(threadDirectRef.value == 42); // expected-warning{{TRUE}}
+#endif
+}
+
+namespace PR16629 {
+ struct A {
+ explicit A(int* p_) : p(p_) {}
+ int* p;
+ };
+
+ extern void escape(const A*[]);
+ extern void check(int);
+
+ void callEscape(const A& a) {
+ const A* args[] = { &a };
+ escape(args);
+ }
+
+ void testNoWarning() {
+ int x;
+ callEscape(A(&x));
+ check(x); // Analyzer used to give a "x is uninitialized warning" here
+ }
+
+ void set(const A*a[]) {
+ *a[0]->p = 47;
+ }
+
+ void callSet(const A& a) {
+ const A* args[] = { &a };
+ set(args);
+ }
+
+ void testConsistency() {
+ int x;
+ callSet(A(&x));
+ clang_analyzer_eval(x == 47); // expected-warning{{TRUE}}
+ }
+}
diff --git a/test/Analysis/uninit-sometimes.cpp b/test/Analysis/uninit-sometimes.cpp
index 015b675d9b86..425d3048c4e0 100644
--- a/test/Analysis/uninit-sometimes.cpp
+++ b/test/Analysis/uninit-sometimes.cpp
@@ -145,13 +145,13 @@ int test_for_range_false(int k) {
int test_for_range_true(int k) {
int arr[3] = { 1, 2, 3 };
- int x;
- for (int &a : arr) { // no-warning
+ int x; // expected-note {{variable}}
+ for (int &a : arr) { // expected-warning {{variable 'x' is used uninitialized whenever 'for' loop is entered}}
goto label;
}
x = 0;
label:
- return x;
+ return x; // expected-note {{uninitialized use}}
}
@@ -356,14 +356,14 @@ int test_no_false_positive_2() {
}
-// FIXME: In this case, the variable is used uninitialized whenever the
-// function's entry block is reached. Produce a diagnostic saying that
-// the variable is uninitialized the first time it is used.
+
+
+
void test_null_pred_succ() {
- int x;
+ int x; // expected-note {{variable}} expected-warning {{used uninitialized whenever function 'test_null_pred_succ' is called}}
if (0)
foo: x = 0;
- if (x)
+ if (x) // expected-note {{use}}
goto foo;
}
@@ -385,3 +385,45 @@ int PR13360(bool b) {
// CHECK: fix-it:"{{.*}}":{376:3-380:10}:""
// CHECK: fix-it:"{{.*}}":{375:8-375:8}:" = 0"
+
+void test_jump_init() {
+goto later;
+ int x; // expected-note {{variable}} expected-warning {{used uninitialized whenever function 'test_jump_init'}}
+later:
+ while (x) x = 0; // expected-note {{use}}
+}
+
+void PR16054() {
+ int x; // expected-note {{variable}} expected-warning {{used uninitialized whenever function 'PR16054}}
+ while (x != 0) { // expected-note {{use}}
+ (void)&x;
+ }
+}
+
+void test_loop_uninit() {
+ for (int n = 0; n < 10; ++n) {
+ int k; // expected-warning {{variable 'k' is used uninitialized whenever its declaration is reached}} expected-note {{variable}}
+ do {
+ k = k + 1; // expected-note {{use}}
+ } while (k != 5);
+ }
+}
+
+// FIXME: We should warn here, because the variable is used uninitialized
+// the first time we encounter the use.
+void test_loop_with_assignment() {
+ double d;
+ for (int n = 0; n < 10; ++n) {
+ d = d + n;
+ }
+}
+
+// FIXME: We should warn here, because the variable is used uninitialized
+// the first time we encounter the use.
+void test_loop_with_ref_bind() {
+ double d;
+ for (int n = 0; n < 10; ++n) {
+ d += n;
+ const double &r = d;
+ }
+}
diff --git a/test/Analysis/uninit-vals-ps-region.m b/test/Analysis/uninit-vals-ps-region.m
index 614ce2fc3354..a4aa5a114aeb 100644
--- a/test/Analysis/uninit-vals-ps-region.m
+++ b/test/Analysis/uninit-vals-ps-region.m
@@ -76,3 +76,18 @@ void PR10163 (void) {
test_PR10163(x[1]); // expected-warning{{uninitialized value}}
}
+struct MyStr {
+ int x;
+ int y;
+};
+void swap(struct MyStr *To, struct MyStr *From) {
+ // This is not really a swap but close enough for our test.
+ To->x = From->x;
+ To->y = From->y; // no warning
+}
+int test_undefined_member_assignment_in_swap(struct MyStr *s2) {
+ struct MyStr s1;
+ s1.x = 5;
+ swap(s2, &s1);
+ return s2->y; // expected-warning{{Undefined or garbage value returned to caller}}
+}
diff --git a/test/Analysis/unions.cpp b/test/Analysis/unions.cpp
index 2bffe78b41c2..f363ab81ae72 100644
--- a/test/Analysis/unions.cpp
+++ b/test/Analysis/unions.cpp
@@ -1,5 +1,7 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core %s -verify
-// expected-no-diagnostics
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection %s -verify
+
+extern void clang_analyzer_eval(bool);
+extern "C" char *strdup(const char *s);
namespace PR14054_reduced {
struct Definition;
@@ -49,3 +51,58 @@ namespace PR14054_original {
x = pn->pn_u.name.lexdef->pn_u.name.lexdef;
}
}
+
+namespace PR17596 {
+ union IntOrString {
+ int i;
+ char *s;
+ };
+
+ extern void process(IntOrString);
+
+ void test() {
+ IntOrString uu;
+ uu.s = strdup("");
+ process(uu);
+ }
+
+ void testPositive() {
+ IntOrString uu;
+ uu.s = strdup("");
+ } // expected-warning{{leak}}
+
+ void testCopy() {
+ IntOrString uu;
+ uu.i = 4;
+ clang_analyzer_eval(uu.i == 4); // expected-warning{{TRUE}}
+
+ IntOrString vv;
+ vv.i = 5;
+ uu = vv;
+ // FIXME: Should be true.
+ clang_analyzer_eval(uu.i == 5); // expected-warning{{UNKNOWN}}
+ }
+
+ void testInvalidation() {
+ IntOrString uu;
+ uu.s = strdup("");
+
+ IntOrString vv;
+ char str[] = "abc";
+ vv.s = str;
+
+ // FIXME: This is a leak of uu.s.
+ uu = vv;
+ }
+
+ void testIndirectInvalidation() {
+ IntOrString uu;
+ char str[] = "abc";
+ uu.s = str;
+
+ clang_analyzer_eval(uu.s[0] == 'a'); // expected-warning{{TRUE}}
+
+ process(uu);
+ clang_analyzer_eval(uu.s[0] == 'a'); // expected-warning{{UNKNOWN}}
+ }
+}
diff --git a/test/Analysis/unix-fns.c b/test/Analysis/unix-fns.c
index 46c10136ede2..dad03fac70b8 100644
--- a/test/Analysis/unix-fns.c
+++ b/test/Analysis/unix-fns.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,unix.API,osx.API %s -analyzer-store=region -analyzer-output=plist -analyzer-eagerly-assume -analyzer-config faux-bodies=true -fblocks -verify -o %t.plist
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,unix.API,osx.API %s -analyzer-store=region -analyzer-output=plist -analyzer-eagerly-assume -analyzer-config faux-bodies=true -analyzer-config path-diagnostics-alternate=false -fblocks -verify -o %t.plist
// RUN: FileCheck --input-file=%t.plist %s
-
+// RUN: mkdir -p %t.dir
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.API,osx.API -analyzer-output=html -analyzer-config faux-bodies=true -fblocks -o %t.dir %s
+// RUN: rm -fR %t.dir
struct _opaque_pthread_once_t {
long __sig;
char __opaque[8];
@@ -16,7 +18,6 @@ void *realloc(void *, size_t);
void *reallocf(void *, size_t);
void *alloca(size_t);
void *valloc(size_t);
-
typedef union {
struct _os_object_s *_os_obj;
struct dispatch_object_s *_do;
@@ -32,7 +33,6 @@ typedef union {
struct dispatch_operation_s *_doperation;
struct dispatch_disk_s *_ddisk;
} dispatch_object_t __attribute__((__transparent_union__));
-
typedef void (^dispatch_block_t)(void);
typedef long dispatch_once_t;
typedef struct dispatch_queue_s *dispatch_queue_t;
@@ -1418,6 +1418,40 @@ void test_inline_dispatch_once() {
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>col</key><integer>15</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
// CHECK-NEXT: <key>col</key><integer>24</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
@@ -1492,24 +1526,25 @@ void test_inline_dispatch_once() {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>40</integer>
-// CHECK-NEXT: <key>col</key><integer>1</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <key>depth</key><integer>1</integer>
-// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Entered call from &apos;test_dispatch_sync&apos;</string>
-// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Entered call from &apos;test_dispatch_sync&apos;</string>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>kind</key><string>event</string>
-// CHECK-NEXT: <key>location</key>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>40</integer>
-// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>190</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>194</integer>
+// CHECK-NEXT: <key>col</key><integer>4</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>1</integer>
// CHECK-NEXT: <key>extended_message</key>
// CHECK-NEXT: <string>Calling anonymous block</string>
@@ -1974,24 +2009,25 @@ void test_inline_dispatch_once() {
// CHECK-NEXT: <key>kind</key><string>event</string>
// CHECK-NEXT: <key>location</key>
// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>39</integer>
-// CHECK-NEXT: <key>col</key><integer>1</integer>
-// CHECK-NEXT: <key>file</key><integer>0</integer>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <key>depth</key><integer>2</integer>
-// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Entered call from &apos;_dispatch_once&apos;</string>
-// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Entered call from &apos;_dispatch_once&apos;</string>
-// CHECK-NEXT: </dict>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>kind</key><string>event</string>
-// CHECK-NEXT: <key>location</key>
-// CHECK-NEXT: <dict>
-// CHECK-NEXT: <key>line</key><integer>39</integer>
-// CHECK-NEXT: <key>col</key><integer>1</integer>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>177</integer>
+// CHECK-NEXT: <key>col</key><integer>33</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>2</integer>
// CHECK-NEXT: <key>extended_message</key>
// CHECK-NEXT: <string>Calling anonymous block</string>
diff --git a/test/Analysis/unreachable-code-path.c b/test/Analysis/unreachable-code-path.c
index 61a4fd490e94..08019d9cbe31 100644
--- a/test/Analysis/unreachable-code-path.c
+++ b/test/Analysis/unreachable-code-path.c
@@ -139,3 +139,22 @@ void test11(enum foobar fb) {
error(); // expected-warning {{never executed}}
}
}
+
+void inlined(int condition) {
+ if (condition) {
+ foo(5); // no-warning
+ } else {
+ foo(6);
+ }
+}
+
+void testInlined() {
+ extern int coin();
+ int cond = coin();
+ if (!cond) {
+ inlined(0);
+ if (cond) {
+ foo(5); // expected-warning {{never executed}}
+ }
+ }
+}
diff --git a/test/Analysis/weak-functions.c b/test/Analysis/weak-functions.c
new file mode 100644
index 000000000000..96e3b44d03b8
--- /dev/null
+++ b/test/Analysis/weak-functions.c
@@ -0,0 +1,117 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection,unix.Malloc,unix.cstring,alpha.unix.cstring,unix.API,osx.API,osx.cocoa.RetainCount -Wno-null-dereference -analyzer-store=region -fblocks -verify %s
+#define NULL 0
+void clang_analyzer_eval(int);
+void myFunc();
+void myWeakFunc() __attribute__((weak_import));
+
+void testWeakFuncIsNull()
+{
+ clang_analyzer_eval(myFunc == NULL); // expected-warning{{FALSE}}
+ clang_analyzer_eval(myWeakFunc == NULL); // expected-warning{{UNKNOWN}}
+ if (myWeakFunc == NULL) {
+ clang_analyzer_eval(myWeakFunc == NULL); // expected-warning{{TRUE}}
+ } else {
+ clang_analyzer_eval(myWeakFunc == NULL); // expected-warning{{FALSE}}
+ }
+}
+
+void testWeakFuncIsNot()
+{
+ clang_analyzer_eval(myWeakFunc == NULL); // expected-warning{{UNKNOWN}}
+ if (!myWeakFunc) {
+ clang_analyzer_eval(myWeakFunc == NULL); // expected-warning{{TRUE}}
+ } else {
+ clang_analyzer_eval(myWeakFunc == NULL); // expected-warning{{FALSE}}
+ }
+}
+
+void testWeakFuncIsTrue()
+{
+ clang_analyzer_eval(myWeakFunc == NULL); // expected-warning{{UNKNOWN}}
+ if (myWeakFunc) {
+ clang_analyzer_eval(myWeakFunc == NULL); // expected-warning{{FALSE}}
+ } else {
+ clang_analyzer_eval(myWeakFunc == NULL); // expected-warning{{TRUE}}
+ }
+}
+
+//===----------------------------------------------------------------------===
+// func.c
+//===----------------------------------------------------------------------===
+void f(void) __attribute__((weak_import));
+void g(void (*fp)(void)) __attribute__((weak_import));
+
+void f(void) {
+ void (*p)(void);
+ p = f;
+ p = &f;
+ p();
+ (*p)();
+}
+
+void g(void (*fp)(void));
+
+void f2() {
+ g(f);
+}
+
+void f3(void (*f)(void), void (*g)(void)) {
+ clang_analyzer_eval(!f); // expected-warning{{UNKNOWN}}
+ f();
+ clang_analyzer_eval(!f); // expected-warning{{FALSE}}
+
+ clang_analyzer_eval(!g); // expected-warning{{UNKNOWN}}
+ (*g)();
+ clang_analyzer_eval(!g); // expected-warning{{FALSE}}
+}
+
+//===----------------------------------------------------------------------===
+// free.c
+//===----------------------------------------------------------------------===
+void free(void *) __attribute__((weak_import));
+
+void t10 () {
+ free((void*)&t10); // expected-warning {{Argument to free() is the address of the function 't10', which is not memory allocated by malloc()}}
+}
+
+//===----------------------------------------------------------------------===
+// string.c : strnlen()
+//===----------------------------------------------------------------------===
+typedef typeof(sizeof(int)) size_t;
+size_t strlen(const char *s) __attribute__((weak_import));
+
+size_t strlen_fn() {
+ return strlen((char*)&strlen_fn); // expected-warning{{Argument to string length function is the address of the function 'strlen_fn', which is not a null-terminated string}}
+}
+
+//===----------------------------------------------------------------------===
+// unix-fns.c : dispatch_once
+//===----------------------------------------------------------------------===
+typedef void (^dispatch_block_t)(void);
+typedef long dispatch_once_t;
+void dispatch_once(dispatch_once_t *predicate, dispatch_block_t block) __attribute__((weak_import));
+
+void test_dispatch_once() {
+ dispatch_once_t pred = 0;
+ do { if (__builtin_expect(*(&pred), ~0l) != ~0l) dispatch_once((&pred), (^() {})); } while (0); // expected-warning{{Call to 'dispatch_once' uses the local variable 'pred' for the predicate value}}
+}
+void test_dispatch_once_neg() {
+ static dispatch_once_t pred = 0;
+ do { if (__builtin_expect(*(&pred), ~0l) != ~0l) dispatch_once((&pred), (^() {})); } while (0); // no-warning
+}
+
+//===----------------------------------------------------------------------===
+// retain-release-path-notes.m
+//===----------------------------------------------------------------------===
+typedef struct CFType *CFTypeRef;
+CFTypeRef CFCreateSomething() __attribute__((weak_import));
+CFTypeRef CFGetSomething() __attribute__((weak_import));
+
+CFTypeRef CFCopyRuleViolation () {
+ CFTypeRef object = CFGetSomething();
+ return object; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
+}
+
+CFTypeRef CFGetRuleViolation () {
+ CFTypeRef object = CFCreateSomething(); // expected-warning{{Potential leak of an object stored into 'object'}}
+ return object; }
diff --git a/test/CXX/basic/basic.link/p6.cpp b/test/CXX/basic/basic.link/p6.cpp
index 8faec76fb3f1..ac6dc2f1f1a3 100644
--- a/test/CXX/basic/basic.link/p6.cpp
+++ b/test/CXX/basic/basic.link/p6.cpp
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++1y %s
+
+// expected-no-diagnostics
// C++11 [basic.link]p6:
// The name of a function declared in block scope and the name
@@ -9,35 +11,34 @@
// block scope declaration declares that same entity and
// receives the linkage of the previous declaration.
-// rdar://13535367
-namespace test0 {
- extern "C" int test0_array[];
- void declare() { extern int test0_array[100]; }
- extern "C" int test0_array[];
- int value = sizeof(test0_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
-}
-
-namespace test1 {
- extern "C" int test1_array[];
- void test() {
- { extern int test1_array[100]; }
- extern int test1_array[];
- int x = sizeof(test1_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+extern int same_entity;
+constexpr int *get1() {
+ int same_entity = 0; // not the same entity
+ {
+ extern int same_entity;
+ return &same_entity;
}
}
+static_assert(get1() == &same_entity, "failed to find previous decl");
-namespace test2 {
- void declare() { extern int test2_array[100]; }
- extern int test2_array[];
- int value = sizeof(test2_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+static int same_entity_2[3];
+constexpr int *get2() {
+ // This is a redeclaration of the same entity, even though it doesn't
+ // inherit the type of the prior declaration.
+ extern int same_entity_2[];
+ return same_entity_2;
}
+static_assert(get2() == same_entity_2, "failed to find previous decl");
-namespace test3 {
- void test() {
- { extern int test3_array[100]; }
- extern int test3_array[];
- int x = sizeof(test3_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+static int different_entities;
+constexpr int *get3() {
+ int different_entities = 0;
+ {
+ // FIXME: This is not a redeclaration of the prior entity, because
+ // it is not visible here. Under DR426, this is ill-formed, and without
+ // it, the static_assert below should fail.
+ extern int different_entities;
+ return &different_entities;
}
}
-
-
+static_assert(get3() == &different_entities, "failed to find previous decl");
diff --git a/test/CXX/basic/basic.link/p7.cpp b/test/CXX/basic/basic.link/p7.cpp
new file mode 100644
index 000000000000..9a85eacdda4f
--- /dev/null
+++ b/test/CXX/basic/basic.link/p7.cpp
@@ -0,0 +1,73 @@
+// RUN: %clang_cc1 -verify -std=c++1y %s
+
+// Example from the standard.
+namespace X {
+ void p() {
+ q(); // expected-error {{undeclared}}
+ extern void q();
+ }
+ void middle() {
+ q(); // expected-error {{undeclared}}
+ }
+ void q() { /*...*/ }
+ void bottom() {
+ q();
+ }
+}
+int q();
+
+namespace Test1 {
+ void f() {
+ extern int a; // expected-note {{previous}}
+ int g(void); // expected-note {{previous}}
+ }
+ double a; // expected-error {{different type: 'double' vs 'int'}}
+ double g(); // expected-error {{differ only in their return type}}
+}
+
+namespace Test2 {
+ void f() {
+ extern int a; // expected-note {{previous}}
+ int g(void); // expected-note {{previous}}
+ }
+ void h() {
+ extern double a; // expected-error {{different type: 'double' vs 'int'}}
+ double g(void); // expected-error {{differ only in their return type}}
+ }
+}
+
+namespace Test3 {
+ constexpr void (*f())() {
+ void h();
+ return &h;
+ }
+ constexpr void (*g())() {
+ void h();
+ return &h;
+ }
+ static_assert(f() == g(), "");
+}
+
+namespace Test4 {
+ template<typename T>
+ constexpr void (*f())() {
+ void h();
+ return &h;
+ }
+ static_assert(f<int>() == f<char>(), "");
+ void h();
+ static_assert(f<int>() == &h, "");
+}
+
+namespace Test5 {
+ constexpr auto f() -> void (*)() {
+ void g();
+ struct X {
+ friend void g();
+ static constexpr auto h() -> void (*)() { return g; }
+ };
+ return X::h();
+ }
+ void g();
+ static_assert(f() == g, "");
+}
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp b/test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp
index df9a2cd14cd4..e352bbe83c6b 100644
--- a/test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp
+++ b/test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp
@@ -5,7 +5,7 @@ namespace N {
X operator+(X, X);
- void f(X);
+ void f(X); // expected-note 2 {{'N::f' declared here}}
void g(X); // expected-note{{candidate function}}
void test_multiadd(X x) {
@@ -17,7 +17,7 @@ namespace M {
struct Y : N::X { };
}
-void f(); // expected-note 2 {{'f' declared here}}
+void f();
void test_operator_adl(N::X x, M::Y y) {
(void)(x + x);
@@ -27,8 +27,8 @@ void test_operator_adl(N::X x, M::Y y) {
void test_func_adl(N::X x, M::Y y) {
f(x);
f(y);
- (f)(x); // expected-error{{too many arguments to function call}}
- ::f(x); // expected-error{{too many arguments to function call}}
+ (f)(x); // expected-error{{too many arguments to function call, expected 0, have 1; did you mean 'N::f'?}}
+ ::f(x); // expected-error{{too many arguments to function call, expected 0, have 1; did you mean 'N::f'?}}
}
namespace N {
@@ -72,7 +72,7 @@ namespace O {
}
extern "C" {
- struct L { };
+ struct L { int x; };
}
void h(L); // expected-note{{candidate function}}
diff --git a/test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp b/test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp
index 911df989530f..1d2b525da4c2 100644
--- a/test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp
+++ b/test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp
@@ -22,3 +22,48 @@ void f() {
Y(1); // okay
}
+namespace PR17731 {
+ void f() {
+ struct S { S() {} };
+ int S(void);
+ int a = S();
+ struct S b;
+ {
+ int S(void);
+ int a = S();
+ struct S c = b;
+ }
+ {
+ struct S { S() {} }; // expected-note {{candidate}}
+ int a = S(); // expected-error {{no viable conversion from 'S'}}
+ struct S c = b; // expected-error {{no viable conversion from 'struct S'}}
+ }
+ }
+ void g() {
+ int S(void);
+ struct S { S() {} };
+ int a = S();
+ struct S b;
+ {
+ int S(void);
+ int a = S();
+ struct S c = b;
+ }
+ {
+ struct S { S() {} }; // expected-note {{candidate}}
+ int a = S(); // expected-error {{no viable conversion from 'S'}}
+ struct S c = b; // expected-error {{no viable conversion from 'struct S'}}
+ }
+ }
+
+ struct A {
+ struct B;
+ void f();
+ int B;
+ };
+ struct A::B {};
+ void A::f() {
+ B = 123;
+ struct B b;
+ }
+}
diff --git a/test/CXX/basic/basic.start/basic.start.main/p2.cpp b/test/CXX/basic/basic.start/basic.start.main/p2.cpp
index a5386f1b9257..5c7d60c1df4c 100644
--- a/test/CXX/basic/basic.start/basic.start.main/p2.cpp
+++ b/test/CXX/basic/basic.start/basic.start.main/p2.cpp
@@ -15,6 +15,8 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST10
// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST11
// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST12
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST13
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST14
#if TEST1
@@ -94,6 +96,20 @@ int main(int, charT* const *) {}
typedef char charT;
int main(int, const charT* const *) {}
+#elif TEST13
+
+int main(void) {}
+
+template <typename T>
+int main(void); // expected-error{{'main' cannot be a template}}
+
+#elif TEST14
+
+template <typename T>
+int main(void); // expected-error{{'main' cannot be a template}}
+
+int main(void) {}
+
#else
#error Unknown test mode
diff --git a/test/CXX/class.access/class.friend/p1.cpp b/test/CXX/class.access/class.friend/p1.cpp
index 19d94cfdd5f6..4a681629eeae 100644
--- a/test/CXX/class.access/class.friend/p1.cpp
+++ b/test/CXX/class.access/class.friend/p1.cpp
@@ -7,8 +7,8 @@
// special access rights to the friends, but they do not make the nominated
// friends members of the befriending class.
-struct S { static void f(); };
-S* g() { return 0; }
+struct S { static void f(); }; // expected-note 2 {{'S' declared here}}
+S* g() { return 0; } // expected-note 2 {{'g' declared here}}
struct X {
friend struct S;
@@ -19,8 +19,8 @@ void test1() {
S s;
g()->f();
S::f();
- X::g(); // expected-error{{no member named 'g' in 'X'}}
- X::S x_s; // expected-error{{no type named 'S' in 'X'}}
+ X::g(); // expected-error{{no member named 'g' in 'X'; did you mean simply 'g'?}}
+ X::S x_s; // expected-error{{no type named 'S' in 'X'; did you mean simply 'S'?}}
X x;
x.g(); // expected-error{{no member named 'g' in 'X'}}
}
@@ -36,24 +36,24 @@ namespace N {
friend struct S2* g2();
};
- struct S2 { static void f2(); };
- S2* g2() { return 0; }
+ struct S2 { static void f2(); }; // expected-note 2 {{'S2' declared here}}
+ S2* g2() { return 0; } // expected-note 2 {{'g2' declared here}}
void test() {
g()->f();
S s;
S::f();
- X::g(); // expected-error{{no member named 'g' in 'N::X'}}
- X::S x_s; // expected-error{{no type named 'S' in 'N::X'}}
+ X::g(); // expected-error{{no member named 'g' in 'N::X'; did you mean simply 'g'?}}
+ X::S x_s; // expected-error{{no type named 'S' in 'N::X'; did you mean simply 'S'?}}
X x;
x.g(); // expected-error{{no member named 'g' in 'N::X'}}
g2();
S2 s2;
- ::g2(); // expected-error{{no member named 'g2' in the global namespace}}
- ::S2 g_s2; // expected-error{{no type named 'S2' in the global namespace}}
- X::g2(); // expected-error{{no member named 'g2' in 'N::X'}}
- X::S2 x_s2; // expected-error{{no type named 'S2' in 'N::X'}}
+ ::g2(); // expected-error{{no member named 'g2' in the global namespace; did you mean simply 'g2'?}}
+ ::S2 g_s2; // expected-error{{no type named 'S2' in the global namespace; did you mean simply 'S2'?}}
+ X::g2(); // expected-error{{no member named 'g2' in 'N::X'; did you mean simply 'g2'?}}
+ X::S2 x_s2; // expected-error{{no type named 'S2' in 'N::X'; did you mean simply 'S2'?}}
x.g2(); // expected-error{{no member named 'g2' in 'N::X'}}
}
}
@@ -287,22 +287,22 @@ namespace test9 {
// PR7230
namespace test10 {
- extern "C" void f(void);
- extern "C" void g(void);
+ extern "C" void test10_f(void);
+ extern "C" void test10_g(void);
namespace NS {
class C {
void foo(void); // expected-note {{declared private here}}
- friend void test10::f(void);
+ friend void test10::test10_f(void);
};
static C* bar;
}
- void f(void) {
+ void test10_f(void) {
NS::bar->foo();
}
- void g(void) {
+ void test10_g(void) {
NS::bar->foo(); // expected-error {{private member}}
}
}
diff --git a/test/CXX/class.access/class.friend/p11.cpp b/test/CXX/class.access/class.friend/p11.cpp
index a05b2d28751e..ba44a0d49245 100644
--- a/test/CXX/class.access/class.friend/p11.cpp
+++ b/test/CXX/class.access/class.friend/p11.cpp
@@ -17,3 +17,83 @@ namespace test1 {
};
}
}
+
+namespace test2 {
+ void bar(); // expected-note {{'::test2::bar' declared here}}
+
+ void foo() { // expected-note {{'::test2::foo' declared here}}
+ struct S1 {
+ friend void foo(); // expected-error {{no matching function 'foo' found in local scope; did you mean '::test2::foo'?}}
+ };
+
+ void foo(); // expected-note {{local declaration nearly matches}}
+ struct S2 {
+ friend void foo();
+ };
+
+ {
+ struct S2 {
+ friend void foo(); // expected-error {{no matching function found in local scope}}
+ };
+ }
+
+ {
+ int foo;
+ struct S3 {
+ friend void foo(); // expected-error {{no matching function found in local scope}}
+ };
+ }
+
+ struct S4 {
+ friend void bar(); // expected-error {{no matching function 'bar' found in local scope; did you mean '::test2::bar'?}}
+ };
+
+ { void bar(); }
+ struct S5 {
+ friend void bar(); // expected-error {{no matching function found in local scope}}
+ };
+
+ {
+ void bar();
+ struct S6 {
+ friend void bar();
+ };
+ }
+
+ struct S7 {
+ void bar() { Inner::f(); }
+ struct Inner {
+ friend void bar();
+ static void f() {}
+ };
+ };
+
+ void bar(); // expected-note {{'bar' declared here}}
+ struct S8 {
+ struct Inner {
+ friend void bar();
+ };
+ };
+
+ struct S9 {
+ struct Inner {
+ friend void baz(); // expected-error {{no matching function 'baz' found in local scope; did you mean 'bar'?}}
+ };
+ };
+
+ struct S10 {
+ void quux() {}
+ void foo() {
+ struct Inner1 {
+ friend void bar(); // expected-error {{no matching function found in local scope}}
+ friend void quux(); // expected-error {{no matching function found in local scope}}
+ };
+
+ void bar();
+ struct Inner2 {
+ friend void bar();
+ };
+ }
+ };
+ }
+}
diff --git a/test/CXX/class.access/class.friend/p3-cxx0x.cpp b/test/CXX/class.access/class.friend/p3-cxx0x.cpp
index ea9d2ce697c5..5a1ab49321d0 100644
--- a/test/CXX/class.access/class.friend/p3-cxx0x.cpp
+++ b/test/CXX/class.access/class.friend/p3-cxx0x.cpp
@@ -36,10 +36,17 @@ class A {
public:
class foo {};
static int y;
- template <typename S> friend class B<S>::ty;
+ template <typename S> friend class B<S>::ty; // expected-warning {{dependent nested name specifier 'B<S>::' for friend class declaration is not supported}}
};
-template <typename T> class B { typedef int ty; };
+template<typename T> class B { typedef int ty; };
+
+template<> class B<int> {
+ class ty {
+ static int f(A<int> &a) { return a.y; } // ok, befriended
+ };
+};
+int f(A<char> &a) { return a.y; } // FIXME: should be an error
struct {
// Ill-formed
@@ -56,7 +63,7 @@ struct {
friend
float;
- template<typename T> friend class A<T>::foo;
+ template<typename T> friend class A<T>::foo; // expected-warning {{not supported}}
} a;
void testA() { (void)sizeof(A<int>); }
diff --git a/test/CXX/class.access/class.friend/p6.cpp b/test/CXX/class.access/class.friend/p6.cpp
index 7f7d90990328..2fe20fe77fc8 100644
--- a/test/CXX/class.access/class.friend/p6.cpp
+++ b/test/CXX/class.access/class.friend/p6.cpp
@@ -11,6 +11,10 @@ struct Y {
friend void X::f2() { } // expected-error{{friend function definition cannot be qualified with 'X::'}}
};
+template <typename T> struct Z {
+ friend void T::f() {} // expected-error{{friend function definition cannot be qualified with 'T::'}}
+};
+
void local() {
void f();
diff --git a/test/CXX/class.access/p4.cpp b/test/CXX/class.access/p4.cpp
index 5ad738bebf9c..0564a52b6d0d 100644
--- a/test/CXX/class.access/p4.cpp
+++ b/test/CXX/class.access/p4.cpp
@@ -151,7 +151,7 @@ namespace test3 {
virtual Base3
{};
Derived3 d3; // expected-note {{implicit default constructor}}\
- // expected-note{{implicit default destructor}}}
+ // expected-note{{implicit destructor}}}
}
// Conversion functions.
@@ -207,13 +207,13 @@ namespace test5 {
class Test1 { A a; }; // expected-error {{private member}}
void test1() {
Test1 a;
- a = Test1(); // expected-note{{implicit default copy}}
+ a = Test1(); // expected-note{{implicit copy}}
}
class Test2 : A {}; // expected-error {{private member}}
void test2() {
Test2 a;
- a = Test2(); // expected-note{{implicit default copy}}
+ a = Test2(); // expected-note{{implicit copy}}
}
}
@@ -226,12 +226,12 @@ namespace test6 {
class Test1 { A a; }; // expected-error {{field of type 'test6::A' has private copy constructor}}
void test1(const Test1 &t) {
- Test1 a = t; // expected-note{{implicit default copy}}
+ Test1 a = t; // expected-note{{implicit copy}}
}
class Test2 : A {}; // expected-error {{base class 'test6::A' has private copy constructor}}
void test2(const Test2 &t) {
- Test2 a = t; // expected-note{{implicit default copy}}
+ Test2 a = t; // expected-note{{implicit copy}}
}
}
diff --git a/test/CXX/class.access/p6.cpp b/test/CXX/class.access/p6.cpp
index fbdc87b24e26..6a93658fc78d 100644
--- a/test/CXX/class.access/p6.cpp
+++ b/test/CXX/class.access/p6.cpp
@@ -92,7 +92,7 @@ namespace test3 {
template <class T> class Outer::A<T, typename T::nature> {
public:
- static void foo();
+ static void foo(); // expected-note {{'Outer::A<B, Green>::foo' declared here}}
};
class B {
@@ -102,7 +102,7 @@ namespace test3 {
void test() {
Outer::A<B, Green>::foo();
- Outer::A<B, Blue>::foo(); // expected-error {{no member named 'foo'}}
+ Outer::A<B, Blue>::foo(); // expected-error {{no member named 'foo' in 'test3::Outer::A<test3::B, test3::Blue>'; did you mean 'Outer::A<B, Green>::foo'?}}
}
}
diff --git a/test/CXX/class.derived/class.abstract/p16.cpp b/test/CXX/class.derived/class.abstract/p16.cpp
index c237ed90446f..2053218ca5b5 100644
--- a/test/CXX/class.derived/class.abstract/p16.cpp
+++ b/test/CXX/class.derived/class.abstract/p16.cpp
@@ -22,7 +22,7 @@ struct H;
struct D {
virtual E &operator=(const E &); // expected-note {{here}}
virtual F &operator=(const F &);
- virtual G &operator=(G&&);
+ virtual G &operator=(G&&); // expected-note {{here}}
virtual H &operator=(H&&); // expected-note {{here}}
friend struct F;
@@ -34,8 +34,8 @@ private:
struct E : D {}; // expected-error {{deleted function '~E' cannot override a non-deleted function}} \
// expected-error {{deleted function 'operator=' cannot override a non-deleted function}}
struct F : D {};
-// No move ctor here, because it would be deleted.
struct G : D {}; // expected-error {{deleted function '~G' cannot override a non-deleted function}}
+ // expected-error@-1 {{deleted function 'operator=' cannot override a non-deleted function}}
struct H : D {
H &operator=(H&&) = default; // expected-error {{deleted function 'operator=' cannot override a non-deleted function}}
~H();
diff --git a/test/CXX/class.derived/class.member.lookup/p7.cpp b/test/CXX/class.derived/class.member.lookup/p7.cpp
new file mode 100644
index 000000000000..a785e0f90e57
--- /dev/null
+++ b/test/CXX/class.derived/class.member.lookup/p7.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -verify %s
+
+// expected-no-diagnostics
+
+struct A { int n; };
+struct B { float n; };
+struct C : A, B {};
+struct D : virtual C {};
+struct E : virtual C { char n; };
+struct F : D, E {} f;
+char &k = f.n;
diff --git a/test/CXX/class.derived/class.virtual/p3-0x.cpp b/test/CXX/class.derived/class.virtual/p3-0x.cpp
index 6a02a8673186..41a5954bf863 100644
--- a/test/CXX/class.derived/class.virtual/p3-0x.cpp
+++ b/test/CXX/class.derived/class.virtual/p3-0x.cpp
@@ -130,3 +130,23 @@ namespace MemberOfUnknownSpecialization {
// expected-note@+1 {{in instantiation of}}
A<double>::C c3;
}
+
+namespace DiagnosticsQOI {
+ struct X {
+ virtual ~X();
+ virtual void foo(int x); // expected-note {{hidden overloaded virtual function}}
+ virtual void bar(int x); // expected-note 2 {{hidden overloaded virtual function}}
+ virtual void bar(float x); // expected-note 2 {{hidden overloaded virtual function}}
+ };
+
+ struct Y : X {
+ void foo(int x, int y) override; // expected-error {{non-virtual member function marked 'override' hides virtual member function}}
+ void bar(double) override; // expected-error {{non-virtual member function marked 'override' hides virtual member functions}}
+ void bar(long double) final; // expected-error {{non-virtual member function marked 'final' hides virtual member functions}}
+ };
+
+ template<typename T>
+ struct Z : T {
+ static void foo() override; // expected-error {{only virtual member functions can be marked 'override'}}
+ };
+}
diff --git a/test/CXX/class/class.friend/p6.cpp b/test/CXX/class/class.friend/p6.cpp
index 82ca50e485d6..e4c59f781e3d 100644
--- a/test/CXX/class/class.friend/p6.cpp
+++ b/test/CXX/class/class.friend/p6.cpp
@@ -4,7 +4,11 @@
class A {
friend static class B; // expected-error {{'static' is invalid in friend declarations}}
friend extern class C; // expected-error {{'extern' is invalid in friend declarations}}
+#if __cplusplus < 201103L
+ friend register class E; // expected-error {{'register' is invalid in friend declarations}}
+#else
friend register class E; // expected-error {{'register' is invalid in friend declarations}}
+#endif
friend mutable class F; // expected-error {{'mutable' is invalid in friend declarations}}
friend typedef class G; // expected-error {{'typedef' is invalid in friend declarations}}
friend __thread class G; // expected-error {{'__thread' is invalid in friend declarations}}
diff --git a/test/CXX/class/class.nested.type/p1.cpp b/test/CXX/class/class.nested.type/p1.cpp
index 4a04a448595c..929565441230 100644
--- a/test/CXX/class/class.nested.type/p1.cpp
+++ b/test/CXX/class/class.nested.type/p1.cpp
@@ -2,12 +2,12 @@
class X {
public:
- typedef int I;
- class Y { };
+ typedef int I; // expected-note{{'X::I' declared here}}
+ class Y { }; // expected-note{{'X::Y' declared here}}
I a;
};
-I b; // expected-error{{unknown type name 'I'}}
-Y c; // expected-error{{unknown type name 'Y'}}
+I b; // expected-error{{unknown type name 'I'; did you mean 'X::I'?}}
+Y c; // expected-error{{unknown type name 'Y'; did you mean 'X::Y'?}}
X::Y d;
X::I e;
diff --git a/test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp b/test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp
index 3bc485601ca5..96a0df4a03f0 100644
--- a/test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp
+++ b/test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp
@@ -3,7 +3,7 @@
// Fun things you can do with inline namespaces:
inline namespace X {
- void f1();
+ void f1(); // expected-note {{'f1' declared here}}
inline namespace Y {
void f2();
@@ -21,7 +21,7 @@ void foo1() {
f1();
::f1();
X::f1();
- Y::f1(); // expected-error {{no member named 'f1' in namespace 'X::Y'}}
+ Y::f1(); // expected-error {{no member named 'f1' in namespace 'X::Y'; did you mean simply 'f1'?}}
f2();
::f2();
diff --git a/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp b/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp
index 93b1c6461a43..81e2ca5f1e4d 100644
--- a/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp
+++ b/test/CXX/dcl.dcl/dcl.attr/dcl.align/p7.cpp
@@ -14,3 +14,7 @@ template<typename T, typename A, int N> struct Y {
static_assert(alignof(Y<char, int, sizeof(int)>) == alignof(int), "");
static_assert(alignof(Y<int, char, 1>) == alignof(int), ""); // expected-note {{in instantiation of}}
+
+void pr16992 () {
+ int x = alignof int; // expected-error {{expected parentheses around type name in alignof expression}}
+}
diff --git a/test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp b/test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp
new file mode 100644
index 000000000000..21119398b2f4
--- /dev/null
+++ b/test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -std=c++1y -verify %s
+
+class [[deprecated]] C {}; // expected-note {{declared here}}
+C c; // expected-warning {{'C' is deprecated}}
+
+typedef int t [[deprecated]]; // expected-note {{declared here}}
+t x = 42; // expected-warning {{'t' is deprecated}}
+
+[[deprecated]] int old = 42; // expected-note {{declared here}}
+int use = old; // expected-warning {{'old' is deprecated}}
+
+struct S { [[deprecated]] int member = 42; } s; // expected-note {{declared here}}
+int use2 = s.member; // expected-warning {{'member' is deprecated}}
+
+[[deprecated]] int f() { return 42; } // expected-note {{declared here}}
+int use3 = f(); // expected-warning {{'f' is deprecated}}
+
+enum [[deprecated]] e { E }; // expected-note {{declared here}}
+e my_enum; // expected-warning {{'e' is deprecated}}
+
+template <typename T> class X {};
+template <> class [[deprecated]] X<int> {}; // expected-note {{declared here}}
+X<char> x1;
+// FIXME: The diagnostic here could be much better by mentioning X<int>.
+X<int> x2; // expected-warning {{'X' is deprecated}}
+
+template <typename T> class [[deprecated]] X2 {};
+template <> class X2<int> {};
+X2<char> x3; // FIXME: no warning!
+X2<int> x4;
diff --git a/test/CXX/dcl.dcl/dcl.link/p7-2.cpp b/test/CXX/dcl.dcl/dcl.link/p7-2.cpp
index 40f61c6445ac..1e8f39338c24 100644
--- a/test/CXX/dcl.dcl/dcl.link/p7-2.cpp
+++ b/test/CXX/dcl.dcl/dcl.link/p7-2.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -ast-print -o - %s | FileCheck %s
-extern "C" void f(void);
-// CHECK: extern "C" void f()
+extern "C" int f(void);
+// CHECK: extern "C" int f()
-extern "C" void v;
-// CHECK: extern "C" void v
+extern "C" int v;
+// CHECK: extern "C" int v
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
index 122a400d9b4e..cf422972a280 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
@@ -72,7 +72,8 @@ template <typename T> constexpr T ft(T t) { return t; }
template <typename T> T gt(T t) { return t; }
struct S {
template<typename T> constexpr T f(); // expected-warning {{C++1y}}
- template<typename T> T g() const;
+ template <typename T>
+ T g() const; // expected-note {{candidate template ignored: could not match 'T () const' against 'char ()'}}
};
// explicit specialization can differ in constepxr
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp
index 4393727c193b..780a420959d6 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp
@@ -63,8 +63,20 @@ struct T : SS, NonLiteral { // expected-note {{base class 'NonLiteral' of non-li
#ifndef CXX1Y
// expected-error@-2 {{an explicitly-defaulted copy assignment operator may not have 'const', 'constexpr' or 'volatile' qualifiers}}
// expected-warning@-3 {{C++1y}}
+#else
+ // expected-error@-5 {{defaulted definition of copy assignment operator is not constexpr}}
#endif
};
+#ifdef CXX1Y
+struct T2 {
+ int n = 0;
+ constexpr T2 &operator=(const T2&) = default; // ok
+};
+struct T3 {
+ constexpr T3 &operator=(const T3&) const = default;
+ // expected-error@-1 {{an explicitly-defaulted copy assignment operator may not have 'const' or 'volatile' qualifiers}}
+};
+#endif
struct U {
constexpr U SelfReturn() const;
constexpr int SelfParam(U) const;
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
index 8a4fa42f0023..708c259d5b61 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
@@ -314,3 +314,23 @@ namespace CtorLookup {
constexpr C::C(const C&) = default;
constexpr C::C(C&) = default; // expected-error {{not constexpr}}
}
+
+namespace PR14503 {
+ template<typename> struct V {
+ union {
+ int n;
+ struct {
+ int x,
+ y;
+ };
+ };
+ constexpr V() : x(0) {}
+ };
+
+ // The constructor is still 'constexpr' here, but the result is not intended
+ // to be a constant expression. The standard is not clear on how this should
+ // work.
+ constexpr V<int> v; // expected-error {{constant expression}} expected-note {{subobject of type 'int' is not initialized}}
+
+ constexpr int k = V<int>().x; // FIXME: ok?
+}
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p12-1y.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p12-1y.cpp
new file mode 100644
index 000000000000..ff2abf9dfafc
--- /dev/null
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p12-1y.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -std=c++11 -verify %s
+// RUN: %clang_cc1 -std=c++1y -verify %s
+
+template<typename T> struct S { typedef int type; };
+
+template<typename T> void f() {
+ auto x = [] { return 0; } ();
+ // FIXME: We should be able to produce a 'missing typename' diagnostic here.
+ S<decltype(x)>::type n; // expected-error 2{{}}
+}
+
+#if __cplusplus > 201103L
+template<typename T> void g() {
+ auto x = [] () -> auto { return 0; } ();
+ S<decltype(x)>::type n; // expected-error 2{{}}
+}
+#endif
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3-generic-lambda-1y.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3-generic-lambda-1y.cpp
new file mode 100644
index 000000000000..65b085bcec13
--- /dev/null
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3-generic-lambda-1y.cpp
@@ -0,0 +1,74 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++1y -DCXX1Y
+
+//FIXME: These tests were written when return type deduction had not been implemented
+// for generic lambdas, hence
+template<class T> T id(T t);
+template<class ... Ts> int vfoo(Ts&& ... ts);
+auto GL1 = [](auto a, int i) -> int { return id(a); };
+
+auto GL2 = [](auto ... As) -> int { return vfoo(As...); };
+auto GL3 = [](int i, char c, auto* ... As) -> int { return vfoo(As...); };
+
+auto GL4 = [](int i, char c, auto* ... As) -> int { return vfoo(As...); };
+
+
+void foo() {
+ auto GL1 = [](auto a, int i) -> int { return id(a); };
+
+ auto GL2 = [](auto ... As) -> int { return vfoo(As...); };
+}
+
+int main()
+{
+ auto l1 = [](auto a) -> int { return a + 5; };
+ auto l2 = [](auto *p) -> int { return p + 5; };
+
+ struct A { int i; char f(int) { return 'c'; } };
+ auto l3 = [](auto &&ur,
+ auto &lr,
+ auto v,
+ int i,
+ auto* p,
+ auto A::*memvar,
+ auto (A::*memfun)(int),
+ char c,
+ decltype (v)* pv
+ , auto (&array)[5]
+ ) -> int { return v + i + c
+ + array[0];
+ };
+ int arr[5] = {0, 1, 2, 3, 4 };
+ int lval = 0;
+ double d = 3.14;
+ l3(3, lval, d, lval, &lval, &A::i, &A::f, 'c', &d, arr);
+ auto l4 = [](decltype(auto) a) -> int { return 0; }; //expected-error{{decltype(auto)}}
+ {
+ struct Local {
+ static int ifi(int i) { return i; }
+ static char cfi(int) { return 'a'; }
+ static double dfi(int i) { return i + 3.14; }
+ static Local localfi(int) { return Local{}; }
+ };
+ auto l4 = [](auto (*fp)(int)) -> int { return fp(3); }; //expected-error{{no viable conversion from 'Local' to 'int'}}
+ l4(&Local::ifi);
+ l4(&Local::cfi);
+ l4(&Local::dfi);
+ l4(&Local::localfi); //expected-note{{in instantiation of function template specialization}}
+ }
+ {
+ auto unnamed_parameter = [](auto, auto) -> void { };
+ unnamed_parameter(3, '4');
+ }
+ {
+ auto l = [](auto
+ (*)(auto)) { }; //expected-error{{'auto' not allowed}}
+ //FIXME: These diagnostics might need some work.
+ auto l2 = [](char auto::*pm) { }; //expected-error{{cannot combine with previous}}\
+ expected-error{{'pm' does not point into a class}}
+ auto l3 = [](char (auto::*pmf)()) { }; //expected-error{{'auto' not allowed}}\
+ expected-error{{'pmf' does not point into a class}}\
+ expected-error{{function cannot return function type 'char ()'}}
+ }
+}
+
+
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p4.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p4.cpp
index e566d2a8f1d2..84f9f9b82983 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p4.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p4.cpp
@@ -35,7 +35,7 @@ class X {
};
struct S {
- static const auto a; // expected-error {{declaration of variable 'a' with type 'auto const' requires an initializer}}
+ static const auto a; // expected-error {{declaration of variable 'a' with type 'const auto' requires an initializer}}
static const auto b = 0;
static const int c;
};
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp
index d327efcc20df..1711aaa8aef9 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp
@@ -55,7 +55,7 @@ void f() {
auto *fail1 = 0; // expected-error {{variable 'fail1' with type 'auto *' has incompatible initializer of type 'int'}}
int **p;
- const auto **fail2(p); // expected-error {{variable 'fail2' with type 'auto const **' has incompatible initializer of type 'int **'}}
+ const auto **fail2(p); // expected-error {{variable 'fail2' with type 'const auto **' has incompatible initializer of type 'int **'}}
}
struct S {
@@ -85,8 +85,8 @@ struct S {
namespace PR10939 {
struct X {
- int method(int);
- int method(float);
+ int method(int); // expected-note{{possible target for call}}
+ int method(float); // expected-note{{possible target for call}}
};
template<typename T> T g(T);
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6-1y.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp
index 66085eda3d73..f7b3e8e7be63 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6-1y.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp
@@ -8,9 +8,6 @@ namespace std {
};
}
-// FIXME: This may not be p6 in C++1y; N3638 isn't very clear whether paragraphs
-// were added. It might be p8?
-
int i;
int &&f();
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7.cpp
index 9c1d397a1fbc..8d789bdd5ad3 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7.cpp
@@ -29,4 +29,17 @@ void g() {
(*e)() -> void,
#endif
f = 0.0;
+
+#if __has_feature(cxx_decltype)
+ auto g = 0ull, h = decltype(g)(0);
+#endif
+}
+
+template<typename T> void h() {
+ auto a = T(), *b = &a;
+#if __has_feature(cxx_decltype)
+ auto c = T(), d = decltype(c)(0);
+#endif
}
+template void h<int>();
+template void h<unsigned long>();
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp
index 8d5849880232..40e754082b48 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp
@@ -14,7 +14,7 @@ class A1 {
friend union A; // expected-error {{use of 'A' with tag type that does not match previous declaration}}
friend enum A; // expected-error {{use of 'A' with tag type that does not match previous declaration}}
- friend enum E; // expected-warning {{cannot be a friend}}
+ friend enum E; // expected-warning {{befriending enumeration type 'enum E' is a C++11 extension}}
};
template <class T> struct B { // expected-note {{previous use is here}}
diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p7.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p7.cpp
index d1fbe766d527..22667ac14bb5 100644
--- a/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p7.cpp
+++ b/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p7.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++1y %s -verify
+// RUN: %clang_cc1 -Wno-uninitialized -std=c++1y %s -verify
// expected-no-diagnostics
diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp
index d61f6e3d1982..58d038366c81 100644
--- a/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp
+++ b/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp
@@ -4,7 +4,7 @@ namespace std {
typedef decltype(sizeof(int)) size_t;
template <typename E>
- struct initializer_list
+ struct initializer_list // expected-note 2{{candidate}}
{
const E *p;
size_t n;
@@ -113,10 +113,14 @@ namespace bullet8 {
namespace rdar13395022 {
struct MoveOnly {
- MoveOnly(MoveOnly&&); // expected-note{{copy constructor is implicitly deleted because 'MoveOnly' has a user-declared move constructor}}
+ MoveOnly(MoveOnly&&);
};
void test(MoveOnly mo) {
- auto &&list = {mo}; // expected-error{{call to implicitly-deleted copy constructor of 'rdar13395022::MoveOnly'}}
+ // FIXME: These diagnostics are poor.
+ auto &&list1 = {mo}; // expected-error{{no viable conversion}}
+ MoveOnly (&&list2)[1] = {mo}; // expected-error{{no viable conversion}}
+ std::initializer_list<MoveOnly> &&list3 = {};
+ MoveOnly (&&list4)[1] = {}; // expected-error{{uninitialized}}
}
}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.array/p3.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.array/p3.cpp
new file mode 100644
index 000000000000..e040d5b2642b
--- /dev/null
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.array/p3.cpp
@@ -0,0 +1,209 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++1y -triple x86_64-linux-gnu %s
+
+// If there is a preceding declaration of the entity *in the same scope* in
+// which the bound was specified, an omitted array bound is taken to be the
+// same as in that earlier declaration
+
+// rdar://13535367
+namespace test0 {
+ extern "C" int array[];
+ void declare() { extern int array[100]; }
+ int value1 = sizeof(array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+ extern "C" int array[];
+ int value2 = sizeof(array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+}
+
+namespace test1 {
+ extern "C" int array[];
+ void test() {
+ { extern int array[100]; }
+ extern int array[];
+ int x = sizeof(array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+ }
+}
+
+namespace test2 {
+ void declare() { extern int array[100]; }
+ extern int array[];
+ int value = sizeof(array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+}
+
+namespace test3 {
+ void test() {
+ { extern int array[100]; }
+ extern int array[];
+ int x = sizeof(array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+ }
+}
+
+namespace test4 {
+ extern int array[];
+ void test() {
+ extern int array[100];
+ int x = sizeof(array);
+ }
+ int y = sizeof(array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+}
+
+namespace test5 {
+ void test() {
+ extern int array[100];
+ extern int array[];
+ int x = sizeof(array);
+ }
+}
+
+namespace test6 {
+ void test() {
+ extern int array[100];
+ {
+ extern int array[];
+ int x = sizeof(array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+ }
+ int y = sizeof(array);
+ extern int array[];
+ int z = sizeof(array);
+ }
+}
+
+namespace test7 {
+ extern int array[100];
+ void test() {
+ extern int array[];
+ int x = sizeof(array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+ }
+ int y = sizeof(array);
+ extern int array[];
+ int z = sizeof(array);
+}
+
+namespace test8 {
+ extern int array[];
+ void test() {
+ extern int array[100];
+ int x = sizeof(array);
+ }
+ int y = sizeof(array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+ extern int array[];
+ int z = sizeof(array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+}
+
+namespace dependent {
+ template<typename T> void f() {
+ extern int arr1[];
+ extern T arr1;
+ extern T arr2;
+ extern int arr2[];
+ static_assert(sizeof(arr1) == 12, "");
+ static_assert(sizeof(arr2) == 12, "");
+
+ // Use a failing test to ensure the type isn't considered dependent.
+ static_assert(sizeof(arr2) == 13, ""); // expected-error {{failed}}
+ }
+
+ void g() { f<int[3]>(); } // expected-note {{in instantiation of}}
+
+ template<typename T> void h1() {
+ extern T arr3;
+ {
+ int arr3;
+ {
+ extern int arr3[];
+ // Detected in template definition.
+ (void)sizeof(arr3); // expected-error {{incomplete}}
+ }
+ }
+ }
+
+ template<typename T> void h2() {
+ extern int arr4[3];
+ {
+ int arr4;
+ {
+ extern T arr4;
+ // Detected in template instantiation.
+ (void)sizeof(arr4); // expected-error {{incomplete}}
+ }
+ }
+ }
+
+ void i() {
+ h1<int[3]>();
+ h2<int[]>(); // expected-note {{in instantiation of}}
+ }
+
+ int arr5[3];
+ template<typename T> void j() {
+ extern T arr5;
+ extern T arr6;
+ (void)sizeof(arr5); // expected-error {{incomplete}}
+ (void)sizeof(arr6); // expected-error {{incomplete}}
+ }
+ int arr6[3];
+
+ void k() { j<int[]>(); } // expected-note {{in instantiation of}}
+
+ template<typename T, typename U> void l() {
+ extern T arrX; // expected-note {{previous}}
+ extern U arrX; // expected-error {{different type: 'int [4]' vs 'int [3]'}}
+ (void)sizeof(arrX); // expected-error {{incomplete}}
+ }
+
+ void m() {
+ l<int[], int[3]>(); // ok
+ l<int[3], int[]>(); // ok
+ l<int[3], int[3]>(); // ok
+ l<int[3], int[4]>(); // expected-note {{in instantiation of}}
+ l<int[], int[]>(); // expected-note {{in instantiation of}}
+ }
+
+ template<typename T> void n() {
+ extern T n_var; // expected-error {{redefinition of 'n_var' with a different type: 'double' vs 'int'}} expected-note {{previous}}
+ extern T n_fn(); // expected-error {{functions that differ only in their return type cannot be overloaded}} expected-note {{previous}}
+ }
+ template void n<int>();
+ template void n<double>(); // expected-note {{in instantiation of}}
+
+ template<typename T> void o() {
+ extern T o_var; // expected-note {{previous}}
+ extern T o_fn(); // expected-note {{previous}}
+ }
+ template void o<int>();
+ float o_var; // expected-error {{redefinition of 'o_var' with a different type: 'float' vs 'int'}}
+ float o_fn(); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+
+ int p_var;
+ int p_fn();
+ template<typename T> void p() {
+ extern T p_var;
+ extern T p_fn();
+ }
+}
+
+namespace use_outside_ns {
+ namespace A {
+ extern int a[3];
+ extern int b[];
+ extern int c[3];
+ void f() {
+ extern int a[];
+ extern int b[3];
+ }
+ template<typename T> void x() {
+ extern T c;
+ extern T d;
+ }
+ extern int d[3];
+ template void x<int[]>();
+ }
+ int w = sizeof(A::a);
+ int x = sizeof(A::b); // expected-error {{incomplete}}
+ int y = sizeof(A::c);
+ int z = sizeof(A::d);
+ namespace A {
+ int g() { return sizeof(a); }
+ int h() { return sizeof(b); } // expected-error {{incomplete}}
+ int i() { return sizeof(c); }
+ int j() { return sizeof(d); }
+ }
+}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p10.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p10.cpp
index 385e45dadfae..27ebb8e036f0 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p10.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p10.cpp
@@ -1,16 +1,16 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
struct A {
- virtual void f(int a = 7);
+ virtual void f(int a = 7); // expected-note{{'A::f' declared here}}
};
struct B : public A {
- void f(int a); // expected-note{{'f' declared here}}
+ void f(int a);
};
void m() {
B* pb = new B;
A* pa = pb;
pa->f(); // OK, calls pa->B::f(7)
- pb->f(); // expected-error{{too few arguments}}
+ pb->f(); // expected-error{{too few arguments to function call, expected 1, have 0; did you mean 'A::f'?}}
}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p2-cxx0x.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p2-cxx0x.cpp
index 6b1f3e438d8f..ce9072886160 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p2-cxx0x.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p2-cxx0x.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
auto a() -> int; // ok
-const auto b() -> int; // expected-error {{function with trailing return type must specify return type 'auto', not 'auto const'}}
+const auto b() -> int; // expected-error {{function with trailing return type must specify return type 'auto', not 'const auto'}}
auto *c() -> int; // expected-error {{function with trailing return type must specify return type 'auto', not 'auto *'}}
auto (d() -> int); // expected-error {{trailing return type may not be nested within parentheses}}
auto e() -> auto (*)() -> auto (*)() -> void; // ok: same as void (*(*e())())();
diff --git a/test/CXX/drs/dr0xx.cpp b/test/CXX/drs/dr0xx.cpp
new file mode 100644
index 000000000000..265a52d9261a
--- /dev/null
+++ b/test/CXX/drs/dr0xx.cpp
@@ -0,0 +1,1040 @@
+// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -Wno-bind-to-temporary-copy
+// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++1y %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+
+namespace dr1 { // dr1: no
+ namespace X { extern "C" void dr1_f(int a = 1); }
+ namespace Y { extern "C" void dr1_f(int a = 2); }
+ using X::dr1_f; using Y::dr1_f;
+ void g() {
+ dr1_f(0);
+ // FIXME: This should be rejected, due to the ambiguous default argument.
+ dr1_f();
+ }
+ namespace X {
+ using Y::dr1_f;
+ void h() {
+ dr1_f(0);
+ // FIXME: This should be rejected, due to the ambiguous default argument.
+ dr1_f();
+ }
+ }
+
+ namespace X {
+ void z(int);
+ }
+ void X::z(int = 1) {} // expected-note {{previous}}
+ namespace X {
+ void z(int = 2); // expected-error {{redefinition of default argument}}
+ }
+}
+
+namespace dr3 { // dr3: yes
+ template<typename T> struct A {};
+ template<typename T> void f(T) { A<T> a; } // expected-note {{implicit instantiation}}
+ template void f(int);
+ template<> struct A<int> {}; // expected-error {{explicit specialization of 'dr3::A<int>' after instantiation}}
+}
+
+namespace dr4 { // dr4: yes
+ extern "C" {
+ static void dr4_f(int) {}
+ static void dr4_f(float) {}
+ void dr4_g(int) {} // expected-note {{previous}}
+ void dr4_g(float) {} // expected-error {{conflicting types}}
+ }
+}
+
+namespace dr5 { // dr5: yes
+ struct A {} a;
+ struct B {
+ B(const A&);
+ B(const B&);
+ };
+ const volatile B b = a;
+
+ struct C { C(C&); };
+ struct D : C {};
+ struct E { operator D&(); } e;
+ const C c = e;
+}
+
+namespace dr7 { // dr7: yes
+ class A { public: ~A(); };
+ class B : virtual private A {}; // expected-note 2 {{declared private here}}
+ class C : public B {} c; // expected-error 2 {{inherited virtual base class 'dr7::A' has private destructor}} \
+ // expected-note {{implicit default constructor for 'dr7::C' first required here}} \
+ // expected-note {{implicit destructor for 'dr7::C' first required here}}
+ class VeryDerivedC : public B, virtual public A {} vdc;
+
+ class X { ~X(); }; // expected-note {{here}}
+ class Y : X { ~Y() {} }; // expected-error {{private destructor}}
+
+ namespace PR16370 { // This regressed the first time DR7 was fixed.
+ struct S1 { virtual ~S1(); };
+ struct S2 : S1 {};
+ struct S3 : S2 {};
+ struct S4 : virtual S2 {};
+ struct S5 : S3, S4 {
+ S5();
+ ~S5();
+ };
+ S5::S5() {}
+ }
+}
+
+namespace dr8 { // dr8: dup 45
+ class A {
+ struct U;
+ static const int k = 5;
+ void f();
+ template<typename, int, void (A::*)()> struct T;
+
+ T<U, k, &A::f> *g();
+ };
+ A::T<A::U, A::k, &A::f> *A::g() { return 0; }
+}
+
+namespace dr9 { // dr9: yes
+ struct B {
+ protected:
+ int m; // expected-note {{here}}
+ friend int R1();
+ };
+ struct N : protected B { // expected-note 2{{protected}}
+ friend int R2();
+ } n;
+ int R1() { return n.m; } // expected-error {{protected base class}} expected-error {{protected member}}
+ int R2() { return n.m; }
+}
+
+namespace dr10 { // dr10: dup 45
+ class A {
+ struct B {
+ A::B *p;
+ };
+ };
+}
+
+namespace dr11 { // dr11: yes
+ template<typename T> struct A : T {
+ using typename T::U;
+ U u;
+ };
+ template<typename T> struct B : T {
+ using T::V;
+ V v; // expected-error {{unknown type name}}
+ };
+ struct X { typedef int U; };
+ A<X> ax;
+}
+
+namespace dr12 { // dr12: sup 239
+ enum E { e };
+ E &f(E, E = e);
+ void g() {
+ int &f(int, E = e);
+ // Under DR12, these call two different functions.
+ // Under DR239, they call the same function.
+ int &b = f(e);
+ int &c = f(1);
+ }
+}
+
+namespace dr14 { // dr14: yes
+ namespace X { extern "C" int dr14_f(); }
+ namespace Y { extern "C" int dr14_f(); }
+ using namespace X;
+ using namespace Y;
+ int k = dr14_f();
+
+ class C {
+ int k;
+ friend int Y::dr14_f();
+ } c;
+ namespace Z {
+ extern "C" int dr14_f() { return c.k; }
+ }
+
+ namespace X { typedef int T; typedef int U; } // expected-note {{candidate}}
+ namespace Y { typedef int T; typedef long U; } // expected-note {{candidate}}
+ T t; // ok, same type both times
+ U u; // expected-error {{ambiguous}}
+}
+
+namespace dr15 { // dr15: yes
+ template<typename T> void f(int); // expected-note {{previous}}
+ template<typename T> void f(int = 0); // expected-error {{default arguments cannot be added}}
+}
+
+namespace dr16 { // dr16: yes
+ class A { // expected-note {{here}}
+ void f(); // expected-note {{here}}
+ friend class C;
+ };
+ class B : A {}; // expected-note 4{{here}}
+ class C : B {
+ void g() {
+ f(); // expected-error {{private member}} expected-error {{private base}}
+ A::f(); // expected-error {{private member}} expected-error {{private base}}
+ }
+ };
+}
+
+namespace dr17 { // dr17: yes
+ class A {
+ int n;
+ int f();
+ struct C;
+ };
+ struct B : A {} b;
+ int A::f() { return b.n; }
+ struct A::C : A {
+ int g() { return n; }
+ };
+}
+
+namespace dr18 { // dr18: yes
+ typedef void Void;
+ void f(Void); // expected-error {{empty parameter list defined with a typedef of 'void'}}
+}
+
+namespace dr19 { // dr19: yes
+ struct A {
+ int n; // expected-note {{here}}
+ };
+ struct B : protected A { // expected-note {{here}}
+ };
+ struct C : B {} c;
+ struct D : B {
+ int get1() { return c.n; } // expected-error {{protected member}}
+ int get2() { return ((A&)c).n; } // ok, A is an accessible base of B from here
+ };
+}
+
+namespace dr20 { // dr20: yes
+ class X {
+ public:
+ X();
+ private:
+ X(const X&); // expected-note {{here}}
+ };
+ X f();
+ X x = f(); // expected-error {{private}}
+}
+
+namespace dr21 { // dr21: yes
+ template<typename T> struct A;
+ struct X {
+ template<typename T = int> friend struct A; // expected-error {{default template argument not permitted on a friend template}}
+ template<typename T = int> friend struct B; // expected-error {{default template argument not permitted on a friend template}}
+ };
+}
+
+namespace dr22 { // dr22: sup 481
+ template<typename dr22_T = dr22_T> struct X; // expected-error {{unknown type name 'dr22_T'}}
+ typedef int T;
+ template<typename T = T> struct Y;
+}
+
+namespace dr23 { // dr23: yes
+ template<typename T> void f(T, T); // expected-note {{candidate}}
+ template<typename T> void f(T, int); // expected-note {{candidate}}
+ void g() { f(0, 0); } // expected-error {{ambiguous}}
+}
+
+// dr24: na
+
+namespace dr25 { // dr25: yes
+ struct A {
+ void f() throw(int);
+ };
+ void (A::*f)() throw (int);
+ void (A::*g)() throw () = f; // expected-error {{is not superset of source}}
+ void (A::*g2)() throw () = 0;
+ void (A::*h)() throw (int, char) = f;
+ void (A::*i)() throw () = &A::f; // expected-error {{is not superset of source}}
+ void (A::*i2)() throw () = 0;
+ void (A::*j)() throw (int, char) = &A::f;
+ void x() {
+ // FIXME: Don't produce the second error here.
+ g2 = f; // expected-error {{is not superset}} expected-error {{incompatible}}
+ h = f;
+ i2 = &A::f; // expected-error {{is not superset}} expected-error {{incompatible}}
+ j = &A::f;
+ }
+}
+
+namespace dr26 { // dr26: yes
+ struct A { A(A, const A & = A()); }; // expected-error {{must pass its first argument by reference}}
+ struct B {
+ B(); // expected-note {{candidate}}
+ B(const B &, B = B()); // expected-error {{no matching constructor}} expected-note {{candidate}} expected-note {{here}}
+ };
+}
+
+namespace dr27 { // dr27: yes
+ enum E { e } n;
+ E &m = true ? n : n;
+}
+
+// dr28: na
+
+namespace dr29 { // dr29: 3.4
+ void dr29_f0(); // expected-note {{here}}
+ void g0() { void dr29_f0(); }
+ extern "C++" void g0_cxx() { void dr29_f0(); }
+ extern "C" void g0_c() { void dr29_f0(); } // expected-error {{different language linkage}}
+
+ extern "C" void dr29_f1(); // expected-note {{here}}
+ void g1() { void dr29_f1(); }
+ extern "C" void g1_c() { void dr29_f1(); }
+ extern "C++" void g1_cxx() { void dr29_f1(); } // expected-error {{different language linkage}}
+
+ void g2() { void dr29_f2(); } // expected-note {{here}}
+ extern "C" void dr29_f2(); // expected-error {{different language linkage}}
+
+ extern "C" void g3() { void dr29_f3(); } // expected-note {{here}}
+ extern "C++" void dr29_f3(); // expected-error {{different language linkage}}
+
+ extern "C++" void g4() { void dr29_f4(); } // expected-note {{here}}
+ extern "C" void dr29_f4(); // expected-error {{different language linkage}}
+
+ extern "C" void g5();
+ extern "C++" void dr29_f5();
+ void g5() {
+ void dr29_f5(); // ok, g5 is extern "C" but we're not inside the linkage-specification here.
+ }
+
+ extern "C++" void g6();
+ extern "C" void dr29_f6();
+ void g6() {
+ void dr29_f6(); // ok, g6 is extern "C" but we're not inside the linkage-specification here.
+ }
+
+ extern "C" void g7();
+ extern "C++" void dr29_f7(); // expected-note {{here}}
+ extern "C" void g7() {
+ void dr29_f7(); // expected-error {{different language linkage}}
+ }
+
+ extern "C++" void g8();
+ extern "C" void dr29_f8(); // expected-note {{here}}
+ extern "C++" void g8() {
+ void dr29_f8(); // expected-error {{different language linkage}}
+ }
+}
+
+namespace dr30 { // dr30: sup 468 c++11
+ struct A {
+ template<int> static int f();
+ } a, *p = &a;
+ int x = A::template f<0>();
+ int y = a.template f<0>();
+ int z = p->template f<0>();
+#if __cplusplus < 201103L
+ // FIXME: It's not clear whether DR468 applies to C++98 too.
+ // expected-error@-5 {{'template' keyword outside of a template}}
+ // expected-error@-5 {{'template' keyword outside of a template}}
+ // expected-error@-5 {{'template' keyword outside of a template}}
+#endif
+}
+
+namespace dr31 { // dr31: yes
+ class X {
+ private:
+ void operator delete(void*); // expected-note {{here}}
+ };
+ // We would call X::operator delete if X() threw (even though it can't,
+ // and even though we allocated the X using ::operator delete).
+ X *p = new X; // expected-error {{private}}
+}
+
+// dr32: na
+
+namespace dr33 { // dr33: yes
+ namespace X { struct S; void f(void (*)(S)); } // expected-note {{candidate}}
+ namespace Y { struct T; void f(void (*)(T)); } // expected-note {{candidate}}
+ void g(X::S);
+ template<typename Z> Z g(Y::T);
+ void h() { f(&g); } // expected-error {{ambiguous}}
+}
+
+// dr34: na
+// dr35: dup 178
+// dr37: sup 475
+
+namespace dr38 { // dr38: yes
+ template<typename T> struct X {};
+ template<typename T> X<T> operator+(X<T> a, X<T> b) { return a; }
+ template X<int> operator+<int>(X<int>, X<int>);
+}
+
+namespace dr39 { // dr39: no
+ namespace example1 {
+ struct A { int &f(int); };
+ struct B : A {
+ using A::f;
+ float &f(float);
+ } b;
+ int &r = b.f(0);
+ }
+
+ namespace example2 {
+ struct A {
+ int &x(int); // expected-note {{found}}
+ static int &y(int); // expected-note {{found}}
+ };
+ struct V {
+ int &z(int);
+ };
+ struct B : A, virtual V {
+ using A::x; // expected-note {{found}}
+ float &x(float);
+ using A::y; // expected-note {{found}}
+ static float &y(float);
+ using V::z;
+ float &z(float);
+ };
+ struct C : A, B, virtual V {} c;
+ int &x = c.x(0); // expected-error {{found in multiple base classes}}
+ // FIXME: This is valid, because we find the same static data member either way.
+ int &y = c.y(0); // expected-error {{found in multiple base classes}}
+ int &z = c.z(0);
+ }
+
+ namespace example3 {
+ struct A { static int f(); };
+ struct B : virtual A { using A::f; };
+ struct C : virtual A { using A::f; };
+ struct D : B, C {} d;
+ int k = d.f();
+ }
+
+ namespace example4 {
+ struct A { int n; }; // expected-note {{found}}
+ struct B : A {};
+ struct C : A {};
+ struct D : B, C { int f() { return n; } }; // expected-error {{found in multiple base-class}}
+ }
+
+ namespace PR5916 {
+ // FIXME: This is valid.
+ struct A { int n; }; // expected-note +{{found}}
+ struct B : A {};
+ struct C : A {};
+ struct D : B, C {};
+ int k = sizeof(D::n); // expected-error {{found in multiple base}} expected-error {{unknown type name}}
+#if __cplusplus >= 201103L
+ decltype(D::n) n; // expected-error {{found in multiple base}}
+#endif
+ }
+}
+
+// dr40: na
+
+namespace dr41 { // dr41: yes
+ struct S f(S);
+}
+
+namespace dr42 { // dr42: yes
+ struct A { static const int k = 0; };
+ struct B : A { static const int k = A::k; };
+}
+
+// dr43: na
+
+namespace dr44 { // dr44: yes
+ struct A {
+ template<int> void f();
+ template<> void f<0>(); // expected-error {{explicit specialization of 'f' in class scope}}
+ };
+}
+
+namespace dr45 { // dr45: yes
+ class A {
+ class B {};
+ class C : B {};
+ C c;
+ };
+}
+
+namespace dr46 { // dr46: yes
+ template<typename> struct A { template<typename> struct B {}; };
+ template template struct A<int>::B<int>; // expected-error {{expected unqualified-id}}
+}
+
+namespace dr47 { // dr47: no
+ template<typename T> struct A {
+ friend void f() { T t; }
+ };
+ A<int> a;
+ A<float> b;
+#if __cplusplus < 201103L
+ // expected-error@-5 {{redefinition}} expected-note@-5 {{previous}}
+ // expected-note@-3 {{instantiation of}}
+#else
+ void f();
+ // FIXME: We should produce some kind of error here. C++11 [temp.friend]p4
+ // says we instantiate 'f' when it's odr-used, but that doesn't imply that
+ // this is valid; we still have multiple definitions of 'f' even if we never
+ // instantiate any of them.
+ void g() { f(); }
+#endif
+}
+
+namespace dr48 { // dr48: yes
+ namespace {
+ struct S {
+ static const int m = 0;
+ static const int n = 0;
+ static const int o = 0;
+ };
+ }
+ int a = S::m;
+ // FIXME: We should produce a 'has internal linkage but is not defined'
+ // diagnostic for 'S::n'.
+ const int &b = S::n;
+ const int S::o;
+ const int &c = S::o;
+}
+
+namespace dr49 { // dr49: yes
+ template<int*> struct A {}; // expected-note {{here}}
+ int k;
+#if __has_feature(cxx_constexpr)
+ constexpr
+#endif
+ int *const p = &k;
+ A<&k> a;
+ A<p> b; // expected-error {{must have its address taken}}
+#if __cplusplus < 201103L
+ // expected-error@-2 {{internal linkage}}
+ // expected-note@-5 {{here}}
+#endif
+}
+
+namespace dr50 { // dr50: yes
+ struct X; // expected-note {{forward}}
+ extern X *p;
+ X *q = (X*)p;
+ X *r = static_cast<X*>(p);
+ X *s = const_cast<X*>(p);
+ X *t = reinterpret_cast<X*>(p);
+ X *u = dynamic_cast<X*>(p); // expected-error {{incomplete}}
+}
+
+namespace dr51 { // dr51: yes
+ struct A {};
+ struct B : A {};
+ struct S {
+ operator A&();
+ operator B&();
+ } s;
+ A &a = s;
+}
+
+namespace dr52 { // dr52: yes
+ struct A { int n; }; // expected-note {{here}}
+ struct B : private A {} b; // expected-note 2{{private}}
+ // FIXME: This first diagnostic is very strangely worded, and seems to be bogus.
+ int k = b.A::n; // expected-error {{'A' is a private member of 'dr52::A'}}
+ // expected-error@-1 {{cannot cast 'struct B' to its private base}}
+}
+
+namespace dr53 { // dr53: yes
+ int n = 0;
+ enum E { e } x = static_cast<E>(n);
+}
+
+namespace dr54 { // dr54: yes
+ struct A { int a; } a;
+ struct V { int v; } v;
+ struct B : private A, virtual V { int b; } b; // expected-note 6{{private here}}
+
+ A &sab = static_cast<A&>(b); // expected-error {{private base}}
+ A *spab = static_cast<A*>(&b); // expected-error {{private base}}
+ int A::*smab = static_cast<int A::*>(&B::b); // expected-error {{private base}}
+ B &sba = static_cast<B&>(a); // expected-error {{private base}}
+ B *spba = static_cast<B*>(&a); // expected-error {{private base}}
+ int B::*smba = static_cast<int B::*>(&A::a); // expected-error {{private base}}
+
+ V &svb = static_cast<V&>(b);
+ V *spvb = static_cast<V*>(&b);
+ int V::*smvb = static_cast<int V::*>(&B::b); // expected-error {{virtual base}}
+ B &sbv = static_cast<B&>(v); // expected-error {{virtual base}}
+ B *spbv = static_cast<B*>(&v); // expected-error {{virtual base}}
+ int B::*smbv = static_cast<int B::*>(&V::v); // expected-error {{virtual base}}
+
+ A &cab = (A&)(b);
+ A *cpab = (A*)(&b);
+ int A::*cmab = (int A::*)(&B::b);
+ B &cba = (B&)(a);
+ B *cpba = (B*)(&a);
+ int B::*cmba = (int B::*)(&A::a);
+
+ V &cvb = (V&)(b);
+ V *cpvb = (V*)(&b);
+ int V::*cmvb = (int V::*)(&B::b); // expected-error {{virtual base}}
+ B &cbv = (B&)(v); // expected-error {{virtual base}}
+ B *cpbv = (B*)(&v); // expected-error {{virtual base}}
+ int B::*cmbv = (int B::*)(&V::v); // expected-error {{virtual base}}
+}
+
+namespace dr55 { // dr55: yes
+ enum E { e = 5 };
+ int test[(e + 1 == 6) ? 1 : -1];
+}
+
+namespace dr56 { // dr56: yes
+ struct A {
+ typedef int T; // expected-note {{previous}}
+ typedef int T; // expected-error {{redefinition}}
+ };
+ struct B {
+ struct X;
+ typedef X X; // expected-note {{previous}}
+ typedef X X; // expected-error {{redefinition}}
+ };
+}
+
+namespace dr58 { // dr58: yes
+ // FIXME: Ideally, we should have a CodeGen test for this.
+#if __cplusplus >= 201103L
+ enum E1 { E1_0 = 0, E1_1 = 1 };
+ enum E2 { E2_0 = 0, E2_m1 = -1 };
+ struct X { E1 e1 : 1; E2 e2 : 1; };
+ static_assert(X{E1_1, E2_m1}.e1 == 1, "");
+ static_assert(X{E1_1, E2_m1}.e2 == -1, "");
+#endif
+}
+
+namespace dr59 { // dr59: yes
+ template<typename T> struct convert_to { operator T() const; };
+ struct A {}; // expected-note 2{{volatile qualifier}}
+ struct B : A {}; // expected-note 2{{volatile qualifier}}
+#if __cplusplus >= 201103L // move constructors
+ // expected-note@-3 2{{volatile qualifier}}
+ // expected-note@-3 2{{volatile qualifier}}
+#endif
+
+ A a1 = convert_to<A>();
+ A a2 = convert_to<A&>();
+ A a3 = convert_to<const A>();
+ A a4 = convert_to<const volatile A>(); // expected-error {{no viable}}
+ A a5 = convert_to<const volatile A&>(); // expected-error {{no viable}}
+
+ B b1 = convert_to<B>();
+ B b2 = convert_to<B&>();
+ B b3 = convert_to<const B>();
+ B b4 = convert_to<const volatile B>(); // expected-error {{no viable}}
+ B b5 = convert_to<const volatile B&>(); // expected-error {{no viable}}
+
+ int n1 = convert_to<int>();
+ int n2 = convert_to<int&>();
+ int n3 = convert_to<const int>();
+ int n4 = convert_to<const volatile int>();
+ int n5 = convert_to<const volatile int&>();
+}
+
+namespace dr60 { // dr60: yes
+ void f(int &);
+ int &f(...);
+ const int k = 0;
+ int &n = f(k);
+}
+
+namespace dr61 { // dr61: yes
+ struct X {
+ static void f();
+ } x;
+ struct Y {
+ static void f();
+ static void f(int);
+ } y;
+ // This is (presumably) valid, because x.f does not refer to an overloaded
+ // function name.
+ void (*p)() = &x.f;
+ void (*q)() = &y.f; // expected-error {{cannot create a non-constant pointer to member function}}
+ void (*r)() = y.f; // expected-error {{cannot create a non-constant pointer to member function}}
+}
+
+namespace dr62 { // dr62: yes
+ struct A {
+ struct { int n; } b;
+ };
+ template<typename T> struct X {};
+ template<typename T> T get() { return get<T>(); }
+ template<typename T> int take(T) { return 0; }
+
+ X<A> x1;
+ A a = get<A>();
+
+ typedef struct { } *NoNameForLinkagePtr;
+#if __cplusplus < 201103L
+ // expected-note@-2 5{{here}}
+#endif
+ NoNameForLinkagePtr noNameForLinkagePtr;
+
+ struct Danger {
+ NoNameForLinkagePtr p;
+ };
+
+ X<NoNameForLinkagePtr> x2;
+ X<const NoNameForLinkagePtr> x3;
+ NoNameForLinkagePtr p1 = get<NoNameForLinkagePtr>();
+ NoNameForLinkagePtr p2 = get<const NoNameForLinkagePtr>();
+ int n1 = take(noNameForLinkagePtr);
+#if __cplusplus < 201103L
+ // expected-error@-6 {{uses unnamed type}}
+ // expected-error@-6 {{uses unnamed type}}
+ // expected-error@-6 {{uses unnamed type}}
+ // expected-error@-6 {{uses unnamed type}}
+ // expected-error@-6 {{uses unnamed type}}
+#endif
+
+ X<Danger> x4;
+
+ void f() {
+ struct NoLinkage {};
+ X<NoLinkage> a;
+ X<const NoLinkage> b;
+ get<NoLinkage>();
+ get<const NoLinkage>();
+ X<void (*)(NoLinkage A::*)> c;
+ X<int NoLinkage::*> d;
+#if __cplusplus < 201103L
+ // expected-error@-7 {{uses local type}}
+ // expected-error@-7 {{uses local type}}
+ // expected-error@-7 {{uses local type}}
+ // expected-error@-7 {{uses local type}}
+ // expected-error@-7 {{uses local type}}
+ // expected-error@-7 {{uses local type}}
+#endif
+ }
+}
+
+namespace dr63 { // dr63: yes
+ template<typename T> struct S { typename T::error e; };
+ extern S<int> *p;
+ void *q = p;
+}
+
+namespace dr64 { // dr64: yes
+ template<class T> void f(T);
+ template<class T> void f(T*);
+ template<> void f(int*);
+ template<> void f<int>(int*);
+ template<> void f(int);
+}
+
+// dr65: na
+
+namespace dr66 { // dr66: no
+ namespace X {
+ int f(int n); // expected-note 2{{candidate}}
+ }
+ using X::f;
+ namespace X {
+ int f(int n = 0);
+ int f(int, int);
+ }
+ // FIXME: The first two calls here should be accepted.
+ int a = f(); // expected-error {{no matching function}}
+ int b = f(1);
+ int c = f(1, 2); // expected-error {{no matching function}}
+}
+
+// dr67: na
+
+namespace dr68 { // dr68: yes
+ template<typename T> struct X {};
+ struct ::dr68::X<int> x1;
+ struct ::dr68::template X<int> x2;
+#if __cplusplus < 201103L
+ // expected-error@-2 {{'template' keyword outside of a template}}
+#endif
+ struct Y {
+ friend struct X<int>;
+ friend struct ::dr68::X<char>;
+ friend struct ::dr68::template X<double>;
+#if __cplusplus < 201103L
+ // expected-error@-2 {{'template' keyword outside of a template}}
+#endif
+ };
+ template<typename>
+ struct Z {
+ friend struct ::dr68::template X<double>;
+ friend typename ::dr68::X<double>;
+#if __cplusplus < 201103L
+ // expected-error@-2 {{C++11 extension}}
+#endif
+ };
+}
+
+namespace dr69 { // dr69: yes
+ template<typename T> static void f() {}
+ // FIXME: Should we warn here?
+ inline void g() { f<int>(); }
+ // FIXME: This should be rejected, per [temp.explicit]p11.
+ extern template void f<char>();
+#if __cplusplus < 201103L
+ // expected-error@-2 {{C++11 extension}}
+#endif
+ template<void(*)()> struct Q {};
+ Q<&f<int> > q;
+#if __cplusplus < 201103L
+ // expected-error@-2 {{internal linkage}} expected-note@-11 {{here}}
+#endif
+}
+
+namespace dr70 { // dr70: yes
+ template<int> struct A {};
+ template<int I, int J> int f(int (&)[I + J], A<I>, A<J>);
+ int arr[7];
+ int k = f(arr, A<3>(), A<4>());
+}
+
+// dr71: na
+// dr72: dup 69
+
+#if __cplusplus >= 201103L
+namespace dr73 { // dr73: no
+ // The resolution to dr73 is unworkable. Consider:
+ int a, b;
+ static_assert(&a + 1 != &b, "");
+}
+#endif
+
+namespace dr74 { // dr74: yes
+ enum E { k = 5 };
+ int (*p)[k] = new int[k][k];
+}
+
+namespace dr75 { // dr75: yes
+ struct S {
+ static int n = 0; // expected-error {{non-const}}
+ };
+}
+
+namespace dr76 { // dr76: yes
+ const volatile int n = 1;
+ int arr[n]; // expected-error +{{variable length array}}
+}
+
+namespace dr77 { // dr77: yes
+ struct A {
+ struct B {};
+ friend struct B;
+ };
+}
+
+namespace dr78 { // dr78: sup ????
+ // Under DR78, this is valid, because 'k' has static storage duration, so is
+ // zero-initialized.
+ const int k; // expected-error {{default initialization of an object of const}}
+}
+
+// dr79: na
+
+namespace dr80 { // dr80: yes
+ struct A {
+ int A;
+ };
+ struct B {
+ static int B; // expected-error {{same name as its class}}
+ };
+ struct C {
+ int C; // expected-note {{hidden by}}
+ // FIXME: These diagnostics aren't very good.
+ C(); // expected-error {{must use 'struct' tag to refer to}} expected-error {{expected member name}}
+ };
+ struct D {
+ D();
+ int D; // expected-error {{same name as its class}}
+ };
+}
+
+// dr81: na
+// dr82: dup 48
+
+namespace dr83 { // dr83: yes
+ int &f(const char*);
+ char &f(char *);
+ int &k = f("foo");
+}
+
+namespace dr84 { // dr84: yes
+ struct B;
+ struct A { operator B() const; };
+ struct C {};
+ struct B {
+ B(B&); // expected-note {{candidate}}
+ B(C);
+ operator C() const;
+ };
+ A a;
+ // Cannot use B(C) / operator C() pair to construct the B from the B temporary
+ // here.
+ B b = a; // expected-error {{no viable}}
+}
+
+namespace dr85 { // dr85: yes
+ struct A {
+ struct B;
+ struct B {}; // expected-note{{previous declaration is here}}
+ struct B; // expected-error{{class member cannot be redeclared}}
+
+ union U;
+ union U {}; // expected-note{{previous declaration is here}}
+ union U; // expected-error{{class member cannot be redeclared}}
+
+#if __cplusplus >= 201103L
+ enum E1 : int;
+ enum E1 : int { e1 }; // expected-note{{previous declaration is here}}
+ enum E1 : int; // expected-error{{class member cannot be redeclared}}
+
+ enum class E2;
+ enum class E2 { e2 }; // expected-note{{previous declaration is here}}
+ enum class E2; // expected-error{{class member cannot be redeclared}}
+#endif
+ };
+
+ template <typename T>
+ struct C {
+ struct B {}; // expected-note{{previous declaration is here}}
+ struct B; // expected-error{{class member cannot be redeclared}}
+ };
+}
+
+// dr86: dup 446
+
+namespace dr87 { // dr87: no
+ template<typename T> struct X {};
+ // FIXME: This is invalid.
+ X<void() throw()> x;
+ // ... but this is valid.
+ X<void(void() throw())> y;
+}
+
+namespace dr88 { // dr88: yes
+ template<typename T> struct S {
+ static const int a = 1;
+ static const int b;
+ };
+ // FIXME: This diagnostic is pretty bad.
+ template<> const int S<int>::a = 4; // expected-error {{redefinition}} expected-note {{previous}}
+ template<> const int S<int>::b = 4;
+}
+
+// dr89: na
+
+namespace dr90 { // dr90: yes
+ struct A {
+ template<typename T> friend void dr90_f(T);
+ };
+ struct B : A {
+ template<typename T> friend void dr90_g(T);
+ struct C {};
+ union D {};
+ };
+ struct E : B {};
+ struct F : B::C {};
+
+ void test() {
+ dr90_f(A());
+ dr90_f(B());
+ dr90_f(B::C()); // expected-error {{undeclared identifier}}
+ dr90_f(B::D()); // expected-error {{undeclared identifier}}
+ dr90_f(E());
+ dr90_f(F()); // expected-error {{undeclared identifier}}
+
+ dr90_g(A()); // expected-error {{undeclared identifier}}
+ dr90_g(B());
+ dr90_g(B::C());
+ dr90_g(B::D());
+ dr90_g(E());
+ dr90_g(F()); // expected-error {{undeclared identifier}}
+ }
+}
+
+namespace dr91 { // dr91: yes
+ union U { friend int f(U); };
+ int k = f(U());
+}
+
+// dr93: na
+
+namespace dr94 { // dr94: yes
+ struct A { static const int n = 5; };
+ int arr[A::n];
+}
+
+namespace dr95 { // dr95: yes
+ struct A;
+ struct B;
+ namespace N {
+ class C {
+ friend struct A;
+ friend struct B;
+ static void f(); // expected-note {{here}}
+ };
+ struct A *p; // dr95::A, not dr95::N::A.
+ }
+ A *q = N::p; // ok, same type
+ struct B { void f() { N::C::f(); } }; // expected-error {{private}}
+}
+
+namespace dr96 { // dr96: no
+ struct A {
+ void f(int);
+ template<typename T> int f(T);
+ template<typename T> struct S {};
+ } a;
+ template<template<typename> class X> struct B {};
+
+ template<typename T>
+ void test() {
+ int k1 = a.template f<int>(0);
+ // FIXME: This is ill-formed, because 'f' is not a template-id and does not
+ // name a class template.
+ // FIXME: What about alias templates?
+ int k2 = a.template f(1);
+ A::template S<int> s;
+ B<A::template S> b;
+ }
+}
+
+namespace dr97 { // dr97: yes
+ struct A {
+ static const int a = false;
+ static const int b = !a;
+ };
+}
+
+namespace dr98 { // dr98: yes
+ void test(int n) {
+ switch (n) {
+ try { // expected-note 2{{bypasses}}
+ case 0: // expected-error {{protected}}
+ x:
+ throw n;
+ } catch (...) { // expected-note 2{{bypasses}}
+ case 1: // expected-error {{protected}}
+ y:
+ throw n;
+ }
+ case 2:
+ goto x; // expected-error {{protected}}
+ case 3:
+ goto y; // expected-error {{protected}}
+ }
+ }
+}
+
+namespace dr99 { // dr99: sup 214
+ template<typename T> void f(T&);
+ template<typename T> int &f(const T&);
+ const int n = 0;
+ int &r = f(n);
+}
diff --git a/test/CXX/drs/dr1xx.cpp b/test/CXX/drs/dr1xx.cpp
new file mode 100644
index 000000000000..7045148034fb
--- /dev/null
+++ b/test/CXX/drs/dr1xx.cpp
@@ -0,0 +1,1011 @@
+// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++1y -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+
+namespace dr100 { // dr100: yes
+ template<const char *> struct A {}; // expected-note {{declared here}}
+ template<const char (&)[4]> struct B {}; // expected-note {{declared here}}
+ A<"foo"> a; // expected-error {{does not refer to any declaration}}
+ B<"bar"> b; // expected-error {{does not refer to any declaration}}
+}
+
+namespace dr101 { // dr101: yes
+ extern "C" void dr101_f();
+ typedef unsigned size_t;
+ namespace X {
+ extern "C" void dr101_f();
+ typedef unsigned size_t;
+ }
+ using X::dr101_f;
+ using X::size_t;
+}
+
+namespace dr102 { // dr102: yes
+ namespace A {
+ template<typename T> T f(T a, T b) { return a + b; } // expected-error {{neither visible in the template definition nor found by argument-dependent lookup}}
+ }
+ namespace B {
+ struct S {};
+ }
+ B::S operator+(B::S, B::S); // expected-note {{should be declared prior to the call site or in namespace 'dr102::B'}}
+ template B::S A::f(B::S, B::S); // expected-note {{in instantiation of}}
+}
+
+// dr103: na
+// dr104 FIXME: add codegen test
+// dr105: na
+
+namespace dr106 { // dr106: sup 540
+ typedef int &r1;
+ typedef r1 &r1;
+ typedef const r1 r1;
+ typedef const r1 &r1;
+
+ typedef const int &r2;
+ typedef r2 &r2;
+ typedef const r2 r2;
+ typedef const r2 &r2;
+}
+
+namespace dr107 { // dr107: yes
+ struct S {};
+ extern "C" S operator+(S, S) { return S(); }
+}
+
+namespace dr108 { // dr108: yes
+ template<typename T> struct A {
+ struct B { typedef int X; };
+ B::X x; // expected-error {{missing 'typename'}}
+ struct C : B { X x; }; // expected-error {{unknown type name}}
+ };
+ template<> struct A<int>::B { int X; };
+}
+
+namespace dr109 { // dr109: yes
+ struct A { template<typename T> void f(T); };
+ template<typename T> struct B : T {
+ using T::template f; // expected-error {{using declaration can not refer to a template}}
+ void g() { this->f<int>(123); } // expected-error {{use 'template'}}
+ };
+}
+
+namespace dr111 { // dr111: dup 535
+ struct A { A(); A(volatile A&, int = 0); A(A&, const char * = "foo"); };
+ struct B : A { B(); }; // expected-note +{{would lose const qualifier}} expected-note {{requires 0 arguments}}
+ const B b1;
+ B b2(b1); // expected-error {{no matching constructor}}
+}
+
+namespace dr112 { // dr112: yes
+ struct T { int n; };
+ typedef T Arr[1];
+
+ const T a1[1] = {};
+ volatile T a2[1] = {};
+ const Arr a3 = {};
+ volatile Arr a4 = {};
+ template<const volatile T*> struct X {};
+ X<a1> x1;
+ X<a2> x2;
+ X<a3> x3;
+ X<a4> x4;
+#if __cplusplus < 201103L
+ // expected-error@-5 {{internal linkage}} expected-note@-10 {{here}}
+ // expected-error@-4 {{internal linkage}} expected-note@-9 {{here}}
+#else
+ // FIXME: Test this somehow.
+#endif
+}
+
+namespace dr113 { // dr113: yes
+ extern void (*p)();
+ void f() {
+ no_such_function(); // expected-error {{undeclared}}
+ p();
+ }
+ void g();
+ void (*p)() = &g;
+}
+
+namespace dr114 { // dr114: yes
+ struct A {
+ virtual void f(int) = 0; // expected-note {{unimplemented}}
+ };
+ struct B : A {
+ template<typename T> void f(T);
+ void g() { f(0); }
+ } b; // expected-error {{abstract}}
+}
+
+namespace dr115 { // dr115: yes
+ template<typename T> int f(T); // expected-note +{{}}
+ template<typename T> int g(T); // expected-note +{{}}
+ template<typename T> int g(T, int); // expected-note +{{}}
+
+ int k1 = f(&f); // expected-error {{no match}}
+ int k2 = f(&f<int>);
+ int k3 = f(&g<int>); // expected-error {{no match}}
+
+ void h() {
+ (void)&f; // expected-error {{address of overloaded function 'f' cannot be cast to type 'void'}}
+ (void)&f<int>;
+ (void)&g<int>; // expected-error {{address of overloaded function 'g' cannot be cast to type 'void'}}
+
+ &f; // expected-error {{reference to overloaded function could not be resolved}}
+ &f<int>; // expected-warning {{unused}}
+ &g<int>; // expected-error {{reference to overloaded function could not be resolved}}
+ }
+
+ struct S {
+ template<typename T> static int f(T);
+ template<typename T> static int g(T);
+ template<typename T> static int g(T, int);
+ } s;
+
+ int k4 = f(&s.f); // expected-error {{non-constant pointer to member}}
+ int k5 = f(&s.f<int>);
+ int k6 = f(&s.g<int>); // expected-error {{non-constant pointer to member}}
+
+ void i() {
+ (void)&s.f; // expected-error {{non-constant pointer to member}}
+ (void)&s.f<int>;
+ (void)&s.g<int>; // expected-error {{non-constant pointer to member}}
+
+ &s.f; // expected-error {{non-constant pointer to member}}
+ &s.f<int>; // expected-warning {{unused}}
+ &s.g<int>; // expected-error {{non-constant pointer to member}}
+ }
+
+ struct T {
+ template<typename T> int f(T);
+ template<typename T> int g(T);
+ template<typename T> int g(T, int);
+ } t;
+
+ int k7 = f(&s.f); // expected-error {{non-constant pointer to member}}
+ int k8 = f(&s.f<int>);
+ int k9 = f(&s.g<int>); // expected-error {{non-constant pointer to member}}
+
+ void j() {
+ (void)&s.f; // expected-error {{non-constant pointer to member}}
+ (void)&s.f<int>;
+ (void)&s.g<int>; // expected-error {{non-constant pointer to member}}
+
+ &s.f; // expected-error {{non-constant pointer to member}}
+ &s.f<int>; // expected-warning {{unused}}
+ &s.g<int>; // expected-error {{non-constant pointer to member}}
+ }
+
+#if __cplusplus >= 201103L
+ // Special case kicks in only if a template argument list is specified.
+ template<typename T=int> void with_default(); // expected-note +{{}}
+ int k10 = f(&with_default); // expected-error {{no matching function}}
+ int k11 = f(&with_default<>);
+ void k() {
+ (void)&with_default; // expected-error {{overloaded function}}
+ (void)&with_default<>;
+ &with_default; // expected-error {{overloaded function}}
+ &with_default<>; // expected-warning {{unused}}
+ }
+#endif
+}
+
+namespace dr116 { // dr116: yes
+ template<int> struct A {};
+ template<int N> void f(A<N>) {} // expected-note {{previous}}
+ template<int M> void f(A<M>) {} // expected-error {{redefinition}}
+ template<typename T> void f(A<sizeof(T)>) {} // expected-note {{previous}}
+ template<typename U> void f(A<sizeof(U)>) {} // expected-error {{redefinition}}
+}
+
+// dr117: na
+// dr118 FIXME: add codegen test
+// dr119: na
+// dr120: na
+
+namespace dr121 { // dr121: yes
+ struct X {
+ template<typename T> struct Y {};
+ };
+ template<typename T> struct Z {
+ X::Y<T> x;
+ T::Y<T> y; // expected-error +{{}}
+ };
+ Z<X> z;
+}
+
+namespace dr122 { // dr122: yes
+ template<typename T> void f();
+ void g() { f<int>(); }
+}
+
+// dr123: na
+// dr124: dup 201
+
+// dr125: yes
+struct dr125_A { struct dr125_B {}; }; // expected-note {{here}}
+dr125_A::dr125_B dr125_C();
+namespace dr125_B { dr125_A dr125_C(); }
+namespace dr125 {
+ struct X {
+ friend dr125_A::dr125_B (::dr125_C)(); // ok
+ friend dr125_A (::dr125_B::dr125_C)(); // ok
+ friend dr125_A::dr125_B::dr125_C(); // expected-error {{did you mean the constructor name 'dr125_B'?}}
+ // expected-warning@-1 {{missing exception specification}}
+#if __cplusplus >= 201103L
+ // expected-error@-3 {{follows constexpr declaration}} expected-note@-10 {{here}}
+#endif
+ };
+}
+
+namespace dr126 { // dr126: no
+ struct C {};
+ struct D : C {};
+ struct E : private C { friend class A; friend class B; };
+ struct F : protected C {};
+ struct G : C {};
+ struct H : D, G {};
+
+ struct A {
+ virtual void cp() throw(C*);
+ virtual void dp() throw(C*);
+ virtual void ep() throw(C*); // expected-note {{overridden}}
+ virtual void fp() throw(C*); // expected-note {{overridden}}
+ virtual void gp() throw(C*);
+ virtual void hp() throw(C*); // expected-note {{overridden}}
+
+ virtual void cr() throw(C&);
+ virtual void dr() throw(C&);
+ virtual void er() throw(C&); // expected-note {{overridden}}
+ virtual void fr() throw(C&); // expected-note {{overridden}}
+ virtual void gr() throw(C&);
+ virtual void hr() throw(C&); // expected-note {{overridden}}
+
+ virtual void pv() throw(void*); // expected-note {{overridden}}
+
+#if __cplusplus >= 201103L
+ virtual void np() throw(C*); // expected-note {{overridden}}
+ virtual void npm() throw(int C::*); // expected-note {{overridden}}
+ virtual void nr() throw(C&); // expected-note {{overridden}}
+#endif
+
+ virtual void ref1() throw(C *const&);
+ virtual void ref2() throw(C *);
+
+ virtual void v() throw(int);
+ virtual void w() throw(const int);
+ virtual void x() throw(int*);
+ virtual void y() throw(const int*);
+ virtual void z() throw(int); // expected-note {{overridden}}
+ };
+ struct B : A {
+ virtual void cp() throw(C*);
+ virtual void dp() throw(D*);
+ virtual void ep() throw(E*); // expected-error {{more lax}}
+ virtual void fp() throw(F*); // expected-error {{more lax}}
+ virtual void gp() throw(G*);
+ virtual void hp() throw(H*); // expected-error {{more lax}}
+
+ virtual void cr() throw(C&);
+ virtual void dr() throw(D&);
+ virtual void er() throw(E&); // expected-error {{more lax}}
+ virtual void fr() throw(F&); // expected-error {{more lax}}
+ virtual void gr() throw(G&);
+ virtual void hr() throw(H&); // expected-error {{more lax}}
+
+ virtual void pv() throw(C*); // expected-error {{more lax}} FIXME: This is valid.
+
+#if __cplusplus >= 201103L
+ using nullptr_t = decltype(nullptr);
+ virtual void np() throw(nullptr_t*); // expected-error {{more lax}} FIXME: This is valid.
+ virtual void npm() throw(nullptr_t*); // expected-error {{more lax}} FIXME: This is valid.
+ virtual void nr() throw(nullptr_t&); // expected-error {{more lax}} This is not.
+#endif
+
+ virtual void ref1() throw(D *const &);
+ virtual void ref2() throw(D *);
+
+ virtual void v() throw(const int);
+ virtual void w() throw(int);
+ virtual void x() throw(const int*); // FIXME: 'const int*' is not allowed by A::h.
+ virtual void y() throw(int*); // ok
+ virtual void z() throw(long); // expected-error {{more lax}}
+ };
+}
+
+namespace dr127 { // dr127: yes
+ __extension__ typedef __decltype(sizeof(0)) size_t;
+ template<typename T> struct A {
+ A() throw(int);
+ void *operator new(size_t, const char * = 0);
+ void operator delete(void *, const char *) { T::error; } // expected-error 2{{no members}}
+ void operator delete(void *) { T::error; }
+ };
+ A<void> *p = new A<void>; // expected-note {{instantiat}}
+ A<int> *q = new ("") A<int>; // expected-note {{instantiat}}
+}
+
+namespace dr128 { // dr128: yes
+ enum E1 { e1 } x = e1;
+ enum E2 { e2 } y = static_cast<E2>(x), z = static_cast<E2>(e1);
+}
+
+// dr129: dup 616
+// dr130: na
+
+namespace dr131 { // dr131: yes
+ const char *a_with_\u0e8c = "\u0e8c";
+ const char *b_with_\u0e8d = "\u0e8d";
+ const char *c_with_\u0e8e = "\u0e8e";
+#if __cplusplus < 201103L
+ // expected-error@-4 {{expected ';'}} expected-error@-2 {{expected ';'}}
+#endif
+}
+
+namespace dr132 { // dr132: no
+ void f() {
+ extern struct {} x; // ok
+ extern struct S {} y; // FIXME: This is invalid.
+ }
+ static enum { E } e;
+}
+
+// dr133: dup 87
+// dr134: na
+
+namespace dr135 { // dr135: yes
+ struct A {
+ A f(A a) { return a; }
+ friend A g(A a) { return a; }
+ static A h(A a) { return a; }
+ };
+}
+
+namespace dr136 { // dr136: 3.4
+ void f(int, int, int = 0); // expected-note {{previous declaration is here}}
+ void g(int, int, int); // expected-note {{previous declaration is here}}
+ struct A {
+ friend void f(int, int = 0, int); // expected-error {{friend declaration specifying a default argument must be the only declaration}}
+ friend void g(int, int, int = 0); // expected-error {{friend declaration specifying a default argument must be the only declaration}}
+ friend void h(int, int, int = 0); // expected-error {{friend declaration specifying a default argument must be a definition}}
+ friend void i(int, int, int = 0) {} // expected-note {{previous declaration is here}}
+ friend void j(int, int, int = 0) {}
+ operator int();
+ };
+ void i(int, int, int); // expected-error {{friend declaration specifying a default argument must be the only declaration}}
+ void q() {
+ j(A(), A()); // ok, has default argument
+ }
+ extern "C" void k(int, int, int, int); // expected-note {{previous declaration is here}}
+ namespace NSA {
+ struct A {
+ friend void dr136::k(int, int, int, int = 0); // expected-error {{friend declaration specifying a default argument must be the only declaration}} \
+ // expected-note {{previous declaration is here}}
+ };
+ }
+ namespace NSB {
+ struct A {
+ friend void dr136::k(int, int, int = 0, int); // expected-error {{friend declaration specifying a default argument must be the only declaration}}
+ };
+ }
+ struct B {
+ void f(int); // expected-note {{previous declaration is here}}
+ };
+ struct C {
+ friend void B::f(int = 0); // expected-error {{friend declaration specifying a default argument must be the only declaration}}
+ };
+}
+
+namespace dr137 { // dr137: yes
+ extern void *p;
+ extern const void *cp;
+ extern volatile void *vp;
+ extern const volatile void *cvp;
+ int *q = static_cast<int*>(p);
+ int *qc = static_cast<int*>(cp); // expected-error {{casts away qualifiers}}
+ int *qv = static_cast<int*>(vp); // expected-error {{casts away qualifiers}}
+ int *qcv = static_cast<int*>(cvp); // expected-error {{casts away qualifiers}}
+ const int *cq = static_cast<const int*>(p);
+ const int *cqc = static_cast<const int*>(cp);
+ const int *cqv = static_cast<const int*>(vp); // expected-error {{casts away qualifiers}}
+ const int *cqcv = static_cast<const int*>(cvp); // expected-error {{casts away qualifiers}}
+ const volatile int *cvq = static_cast<const volatile int*>(p);
+ const volatile int *cvqc = static_cast<const volatile int*>(cp);
+ const volatile int *cvqv = static_cast<const volatile int*>(vp);
+ const volatile int *cvqcv = static_cast<const volatile int*>(cvp);
+}
+
+namespace dr139 { // dr139: yes
+ namespace example1 {
+ typedef int f; // expected-note {{previous}}
+ struct A {
+ friend void f(A &); // expected-error {{different kind of symbol}}
+ };
+ }
+
+ namespace example2 {
+ typedef int f;
+ namespace N {
+ struct A {
+ friend void f(A &);
+ operator int();
+ void g(A a) { int i = f(a); } // ok, f is typedef not friend function
+ };
+ }
+ }
+}
+
+namespace dr140 { // dr140: yes
+ void f(int *const) {} // expected-note {{previous}}
+ void f(int[3]) {} // expected-error {{redefinition}}
+ void g(const int);
+ void g(int n) { n = 2; }
+}
+
+namespace dr141 { // dr141: yes
+ template<typename T> void f();
+ template<typename T> struct S { int n; };
+ struct A : S<int> {
+ template<typename T> void f();
+ template<typename T> struct S {};
+ } a;
+ struct B : S<int> {} b;
+ void g() {
+ a.f<int>();
+ (void)a.S<int>::n; // expected-error {{no member named 'n'}}
+#if __cplusplus < 201103L
+ // expected-error@-2 {{ambiguous}}
+ // expected-note@-11 {{lookup from the current scope}}
+ // expected-note@-9 {{lookup in the object type}}
+#endif
+ b.f<int>(); // expected-error {{no member}} expected-error +{{}}
+ (void)b.S<int>::n;
+ }
+ template<typename T> struct C {
+ T t;
+ void g() {
+ t.f<int>(); // expected-error {{use 'template'}}
+ }
+ void h() {
+ (void)t.S<int>::n; // ok
+ }
+ void i() {
+ (void)t.S<int>(); // ok!
+ }
+ };
+ void h() { C<B>().h(); } // ok
+ struct X {
+ template<typename T> void S();
+ };
+ void i() { C<X>().i(); } // ok!!
+}
+
+namespace dr142 { // dr142: yes
+ class B { // expected-note +{{here}}
+ public:
+ int mi; // expected-note +{{here}}
+ static int si; // expected-note +{{here}}
+ };
+ class D : private B { // expected-note +{{here}}
+ };
+ class DD : public D {
+ void f();
+ };
+ void DD::f() {
+ mi = 3; // expected-error {{private base class}} expected-error {{private member}}
+ si = 3; // expected-error {{private member}}
+ B b_old; // expected-error {{private member}}
+ dr142::B b;
+ b.mi = 3;
+ b.si = 3;
+ B::si = 3; // expected-error {{private member}}
+ dr142::B::si = 3;
+ B *bp1_old = this; // expected-error {{private member}} expected-error {{private base class}}
+ dr142::B *bp1 = this; // expected-error {{private base class}}
+ B *bp2_old = (B*)this; // expected-error 2{{private member}}
+ dr142::B *bp2 = (dr142::B*)this;
+ bp2->mi = 3;
+ }
+}
+
+namespace dr143 { // dr143: yes
+ namespace A { struct X; }
+ namespace B { void f(A::X); }
+ namespace A {
+ struct X { friend void B::f(X); };
+ }
+ void g(A::X x) {
+ f(x); // expected-error {{undeclared identifier 'f'}}
+ }
+}
+
+namespace dr145 { // dr145: yes
+ void f(bool b) {
+ ++b; // expected-warning {{deprecated}}
+ b++; // expected-warning {{deprecated}}
+ }
+}
+
+namespace dr147 { // dr147: no
+ namespace example1 {
+ template<typename> struct A {
+ template<typename T> A(T);
+ };
+ // FIXME: This appears to be valid, and EDG and G++ accept.
+ template<> template<> A<int>::A<int>(int) {} // expected-error {{out-of-line constructor for 'A' cannot have template arguments}}
+ }
+ namespace example2 {
+ struct A { A(); };
+ struct B : A { B(); };
+ A::A a1; // expected-error {{is a constructor}}
+ B::A a2;
+ }
+ namespace example3 {
+ template<typename> struct A {
+ template<typename T> A(T);
+ static A a;
+ };
+ template<> A<int>::A<int>(A<int>::a); // expected-error {{is a constructor}}
+ }
+}
+
+namespace dr148 { // dr148: yes
+ struct A { int A::*p; };
+ int check1[__is_pod(int(A::*)) ? 1 : -1];
+ int check2[__is_pod(A) ? 1 : -1];
+}
+
+// dr149: na
+
+namespace dr151 { // dr151: yes
+ struct X {};
+ typedef int X::*p;
+#if __cplusplus < 201103L
+#define fold(x) (__builtin_constant_p(0) ? (x) : (x))
+#else
+#define fold
+#endif
+ int check[fold(p() == 0) ? 1 : -1];
+#undef fold
+}
+
+namespace dr152 { // dr152: yes
+ struct A {
+ A(); // expected-note {{not viable}}
+ explicit A(const A&);
+ };
+ A a1 = A(); // expected-error {{no matching constructor}}
+ A a2((A()));
+}
+
+// dr153: na
+
+namespace dr154 { // dr154: yes
+ union { int a; }; // expected-error {{must be declared 'static'}}
+ namespace {
+ union { int b; };
+ }
+ static union { int c; };
+}
+
+namespace dr155 { // dr155: dup 632
+ struct S { int n; } s = { { 1 } }; // expected-warning {{braces around scalar initializer}}
+}
+
+namespace dr159 { // dr159: no
+ namespace X { void f(); }
+ void f();
+ // FIXME: This should be accepted.
+ void dr159::f() {} // expected-error {{extra qualification}}
+ void dr159::X::f() {}
+}
+
+// dr160: na
+
+namespace dr161 { // dr161: yes
+ class A {
+ protected:
+ struct B { int n; } b; // expected-note 2{{here}}
+ static B bs;
+ void f(); // expected-note {{here}}
+ static void sf();
+ };
+ struct C : A {};
+ struct D : A {
+ void g(C c) {
+ (void)b.n;
+ B b1;
+ C::B b2; // ok, accessible as a member of A
+ (void)&C::b; // expected-error {{protected}}
+ (void)&C::bs;
+ (void)c.b; // expected-error {{protected}}
+ (void)c.bs;
+ f();
+ sf();
+ c.f(); // expected-error {{protected}}
+ c.sf();
+ A::f();
+ D::f();
+ A::sf();
+ C::sf();
+ D::sf();
+ }
+ };
+}
+
+namespace dr162 { // dr162: no
+ struct A {
+ char &f(char);
+ static int &f(int);
+
+ void g() {
+ int &a = (&A::f)(0); // FIXME: expected-error {{could not be resolved}}
+ char &b = (&A::f)('0'); // expected-error {{could not be resolved}}
+ }
+ };
+
+ int &c = (&A::f)(0); // FIXME: expected-error {{could not be resolved}}
+ char &d = (&A::f)('0'); // expected-error {{could not be resolved}}
+}
+
+// dr163: na
+
+namespace dr164 { // dr164: yes
+ void f(int);
+ template <class T> int g(T t) { return f(t); }
+
+ enum E { e };
+ int f(E);
+
+ int k = g(e);
+}
+
+namespace dr165 { // dr165: no
+ namespace N {
+ struct A { friend struct B; };
+ void f() { void g(); }
+ }
+ // FIXME: dr1477 says this is ok, dr165 says it's ill-formed
+ struct N::B {};
+ // FIXME: dr165 says this is ill-formed, but the argument in dr1477 says it's ok
+ void N::g() {}
+}
+
+namespace dr166 { // dr166: yes
+ namespace A { class X; }
+
+ template<typename T> int f(T t) { return t.n; }
+ int g(A::X);
+ template<typename T> int h(T t) { return t.n; } // expected-error {{private}}
+ int i(A::X);
+
+ namespace A {
+ class X {
+ friend int f<X>(X);
+ friend int dr166::g(X);
+ friend int h(X);
+ friend int i(X);
+ int n; // expected-note 2{{here}}
+ };
+
+ int h(X x) { return x.n; }
+ int i(X x) { return x.n; }
+ }
+
+ template int f(A::X);
+ int g(A::X x) { return x.n; }
+ template int h(A::X); // expected-note {{instantiation}}
+ int i(A::X x) { return x.n; } // expected-error {{private}}
+}
+
+// dr167: sup 1012
+
+namespace dr168 { // dr168: no
+ extern "C" typedef int (*p)();
+ extern "C++" typedef int (*q)();
+ struct S {
+ static int f();
+ };
+ p a = &S::f; // FIXME: this should fail.
+ q b = &S::f;
+}
+
+namespace dr169 { // dr169: yes
+ template<typename> struct A { int n; };
+ struct B {
+ template<typename> struct C;
+ template<typename> void f();
+ template<typename> static int n; // expected-error 0-1{{extension}}
+ };
+ struct D : A<int>, B {
+ using A<int>::n;
+ using B::C<int>; // expected-error {{using declaration can not refer to a template specialization}}
+ using B::f<int>; // expected-error {{using declaration can not refer to a template specialization}}
+ using B::n<int>; // expected-error {{using declaration can not refer to a template specialization}}
+ };
+}
+
+namespace { // dr171: yes
+ int dr171a;
+}
+int dr171b; // expected-note {{here}}
+namespace dr171 {
+ extern "C" void dr171a();
+ extern "C" void dr171b(); // expected-error {{conflicts}}
+}
+
+namespace dr172 { // dr172: yes
+ enum { zero };
+ int check1[-1 < zero ? 1 : -1];
+
+ enum { x = -1, y = (unsigned int)-1 };
+ int check2[sizeof(x) > sizeof(int) ? 1 : -1];
+
+ enum { a = (unsigned int)-1 / 2 };
+ int check3a[sizeof(a) == sizeof(int) ? 1 : -1];
+ int check3b[-a < 0 ? 1 : -1];
+
+ enum { b = (unsigned int)-1 / 2 + 1 };
+ int check4a[sizeof(b) == sizeof(unsigned int) ? 1 : -1];
+ int check4b[-b > 0 ? 1 : -1];
+
+ enum { c = (unsigned long)-1 / 2 };
+ int check5a[sizeof(c) == sizeof(long) ? 1 : -1];
+ int check5b[-c < 0 ? 1 : -1];
+
+ enum { d = (unsigned long)-1 / 2 + 1 };
+ int check6a[sizeof(d) == sizeof(unsigned long) ? 1 : -1];
+ int check6b[-d > 0 ? 1 : -1];
+
+ enum { e = (unsigned long long)-1 / 2 }; // expected-error 0-1{{extension}}
+ int check7a[sizeof(e) == sizeof(long) ? 1 : -1]; // expected-error 0-1{{extension}}
+ int check7b[-e < 0 ? 1 : -1];
+
+ enum { f = (unsigned long long)-1 / 2 + 1 }; // expected-error 0-1{{extension}}
+ int check8a[sizeof(f) == sizeof(unsigned long) ? 1 : -1]; // expected-error 0-1{{extension}}
+ int check8b[-f > 0 ? 1 : -1];
+}
+
+namespace dr173 { // dr173: yes
+ int check[('0' + 1 == '1' && '0' + 2 == '2' && '0' + 3 == '3' &&
+ '0' + 4 == '4' && '0' + 5 == '5' && '0' + 6 == '6' &&
+ '0' + 7 == '7' && '0' + 8 == '8' && '0' + 9 == '9') ? 1 : -1];
+}
+
+// dr174: sup 1012
+
+namespace dr175 { // dr175: yes
+ struct A {}; // expected-note {{here}}
+ struct B : private A {}; // expected-note {{constrained by private inheritance}}
+ struct C : B {
+ A a; // expected-error {{private}}
+ dr175::A b;
+ };
+}
+
+namespace dr176 { // dr176: yes
+ template<typename T> class Y;
+ template<> class Y<int> {
+ void f() {
+ typedef Y A; // expected-note {{here}}
+ typedef Y<char> A; // expected-error {{different types ('Y<char>' vs 'Y<int>')}}
+ }
+ };
+
+ template<typename T> struct Base {}; // expected-note 2{{found}}
+ template<typename T> struct Derived : public Base<T> {
+ void f() {
+ typedef typename Derived::template Base<T> A;
+ typedef typename Derived::Base A;
+ }
+ };
+ template struct Derived<int>;
+
+ template<typename T> struct Derived2 : Base<int>, Base<char> {
+ typename Derived2::Base b; // expected-error {{found in multiple base classes}}
+ typename Derived2::Base<double> d;
+ };
+
+ template<typename T> class X { // expected-note {{here}}
+ X *p1;
+ X<T> *p2;
+ X<int> *p3;
+ dr176::X *p4; // expected-error {{requires template arguments}}
+ };
+}
+
+namespace dr177 { // dr177: yes
+ struct B {};
+ struct A {
+ A(A &); // expected-note {{not viable: expects an l-value}}
+ A(const B &);
+ };
+ B b;
+ A a = b; // expected-error {{no viable constructor copying variable}}
+}
+
+namespace dr178 { // dr178: yes
+ int check[int() == 0 ? 1 : -1];
+#if __cplusplus >= 201103L
+ static_assert(int{} == 0, "");
+ struct S { int a, b; };
+ static_assert(S{1}.b == 0, "");
+ struct T { constexpr T() : n() {} int n; };
+ static_assert(T().n == 0, "");
+ struct U : S { constexpr U() : S() {} };
+ static_assert(U().b == 0, "");
+#endif
+}
+
+namespace dr179 { // dr179: yes
+ void f();
+ int n = &f - &f; // expected-error {{arithmetic on pointers to the function type 'void ()'}}
+}
+
+namespace dr180 { // dr180: yes
+ template<typename T> struct X : T, T::some_base {
+ X() : T::some_type_that_might_be_T(), T::some_base() {}
+ friend class T::some_class;
+ void f() {
+ enum T::some_enum e;
+ }
+ };
+}
+
+namespace dr181 { // dr181: yes
+ namespace X {
+ template <template X<class T> > struct A { }; // expected-error +{{}}
+ template <template X<class T> > void f(A<X>) { } // expected-error +{{}}
+ }
+
+ namespace Y {
+ template <template <class T> class X> struct A { };
+ template <template <class T> class X> void f(A<X>) { }
+ }
+}
+
+namespace dr182 { // dr182: yes
+ template <class T> struct C {
+ void f();
+ void g();
+ };
+
+ template <class T> void C<T>::f() {}
+ template <class T> void C<T>::g() {}
+
+ class A {
+ class B {}; // expected-note {{here}}
+ void f();
+ };
+
+ template void C<A::B>::f();
+ template <> void C<A::B>::g(); // expected-error {{private}}
+
+ void A::f() {
+ C<B> cb;
+ cb.f();
+ }
+}
+
+namespace dr183 { // dr183: sup 382
+ template<typename T> struct A {};
+ template<typename T> struct B {
+ typedef int X;
+ };
+ template<> struct A<int> {
+ typename B<int>::X x;
+ };
+}
+
+namespace dr184 { // dr184: yes
+ template<typename T = float> struct B {};
+
+ template<template<typename TT = float> class T> struct A {
+ void f();
+ void g();
+ };
+
+ template<template<typename TT> class T> void A<T>::f() { // expected-note {{here}}
+ T<> t; // expected-error {{too few template arguments}}
+ }
+
+ template<template<typename TT = char> class T> void A<T>::g() {
+ T<> t;
+ typedef T<> X;
+ typedef T<char> X;
+ }
+
+ void h() { A<B>().g(); }
+}
+
+// dr185 FIXME: add codegen test
+
+namespace dr187 { // dr187: sup 481
+ const int Z = 1;
+ template<int X = Z, int Z = X> struct A;
+ typedef A<> T;
+ typedef A<1, 1> T;
+}
+
+namespace dr188 { // dr188: yes
+ char c[10];
+ int check[sizeof(0, c) == 10 ? 1 : -1];
+}
+
+// dr190 FIXME: add codegen test for tbaa
+
+// dr193 FIXME: add codegen test
+
+namespace dr194 { // dr194: yes
+ struct A {
+ A();
+ void A(); // expected-error {{has the same name as its class}} expected-error {{constructor cannot have a return type}}
+ };
+ struct B {
+ void B(); // expected-error {{has the same name as its class}} expected-error {{constructor cannot have a return type}}
+ B();
+ };
+ struct C {
+ inline explicit C(int) {}
+ };
+}
+
+namespace dr195 { // dr195: yes
+ void f();
+ int *p = (int*)&f; // expected-error 0-1{{extension}}
+ void (*q)() = (void(*)())&p; // expected-error 0-1{{extension}}
+}
+
+namespace dr197 { // dr197: yes
+ char &f(char);
+
+ template <class T> void g(T t) {
+ char &a = f(1);
+ char &b = f(T(1)); // expected-error {{unrelated type 'int'}}
+ char &c = f(t); // expected-error {{unrelated type 'int'}}
+ }
+
+ void f(int);
+
+ enum E { e };
+ int &f(E);
+
+ void h() {
+ g('a');
+ g(2);
+ g(e); // expected-note {{in instantiation of}}
+ }
+}
+
+namespace dr198 { // dr198: yes
+ struct A {
+ int n;
+ struct B {
+ int m[sizeof(n)];
+#if __cplusplus < 201103L
+ // expected-error@-2 {{invalid use of non-static data member}}
+#endif
+ int f() { return n; }
+ // expected-error@-1 {{use of non-static data member 'n' of 'A' from nested type 'B'}}
+ };
+ struct C;
+ struct D;
+ };
+ struct A::C {
+ int m[sizeof(n)];
+#if __cplusplus < 201103L
+ // expected-error@-2 {{invalid use of non-static data member}}
+#endif
+ int f() { return n; }
+ // expected-error@-1 {{use of non-static data member 'n' of 'A' from nested type 'C'}}
+ };
+ struct A::D : A {
+ int m[sizeof(n)];
+#if __cplusplus < 201103L
+ // expected-error@-2 {{invalid use of non-static data member}}
+#endif
+ int f() { return n; }
+ };
+}
+
+// dr199 FIXME: add codegen test
diff --git a/test/CXX/drs/dr2xx.cpp b/test/CXX/drs/dr2xx.cpp
new file mode 100644
index 000000000000..2c32a9e503f9
--- /dev/null
+++ b/test/CXX/drs/dr2xx.cpp
@@ -0,0 +1,726 @@
+// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++1y %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+
+// PR13819 -- __SIZE_TYPE__ is incompatible.
+// REQUIRES: LP64
+
+#if __cplusplus < 201103L
+#define fold(x) (__builtin_constant_p(x) ? (x) : (x))
+#else
+#define fold
+#endif
+
+namespace dr200 { // dr200: dup 214
+ template <class T> T f(int);
+ template <class T, class U> T f(U) = delete; // expected-error 0-1{{extension}}
+
+ void g() {
+ f<int>(1);
+ }
+}
+
+// dr201 FIXME: write codegen test
+
+namespace dr202 { // dr202: yes
+ template<typename T> T f();
+ template<int (*g)()> struct X {
+ int arr[fold(g == &f<int>) ? 1 : -1];
+ };
+ template struct X<f>;
+}
+
+// FIXME (export) dr204: no
+
+namespace dr206 { // dr206: yes
+ struct S; // expected-note 2{{declaration}}
+ template<typename T> struct Q { S s; }; // expected-error {{incomplete}}
+ template<typename T> void f() { S s; } // expected-error {{incomplete}}
+}
+
+namespace dr207 { // dr207: yes
+ class A {
+ protected:
+ static void f() {}
+ };
+ class B : A {
+ public:
+ using A::f;
+ void g() {
+ A::f();
+ f();
+ }
+ };
+}
+
+// dr208 FIXME: write codegen test
+
+namespace dr209 { // dr209: yes
+ class A {
+ void f(); // expected-note {{here}}
+ };
+ class B {
+ friend void A::f(); // expected-error {{private}}
+ };
+}
+
+// dr210 FIXME: write codegen test
+
+namespace dr211 { // dr211: yes
+ struct A {
+ A() try {
+ throw 0;
+ } catch (...) {
+ return; // expected-error {{return in the catch of a function try block of a constructor}}
+ }
+ };
+}
+
+namespace dr213 { // dr213: yes
+ template <class T> struct A : T {
+ void h(T t) {
+ char &r1 = f(t);
+ int &r2 = g(t); // expected-error {{undeclared}}
+ }
+ };
+ struct B {
+ int &f(B);
+ int &g(B); // expected-note {{in dependent base class}}
+ };
+ char &f(B);
+
+ template void A<B>::h(B); // expected-note {{instantiation}}
+}
+
+namespace dr214 { // dr214: yes
+ template<typename T, typename U> T checked_cast(U from) { U::error; }
+ template<typename T, typename U> T checked_cast(U *from);
+ class C {};
+ void foo(int *arg) { checked_cast<const C *>(arg); }
+
+ template<typename T> T f(int);
+ template<typename T, typename U> T f(U) { T::error; }
+ void g() {
+ f<int>(1);
+ }
+}
+
+namespace dr215 { // dr215: yes
+ template<typename T> class X {
+ friend void T::foo();
+ int n;
+ };
+ struct Y {
+ void foo() { (void)+X<Y>().n; }
+ };
+}
+
+namespace dr216 { // dr216: no
+ // FIXME: Should reject this: 'f' has linkage but its type does not,
+ // and 'f' is odr-used but not defined in this TU.
+ typedef enum { e } *E;
+ void f(E);
+ void g(E e) { f(e); }
+
+ struct S {
+ // FIXME: Should reject this: 'f' has linkage but its type does not,
+ // and 'f' is odr-used but not defined in this TU.
+ typedef enum { e } *E;
+ void f(E);
+ };
+ void g(S s, S::E e) { s.f(e); }
+}
+
+namespace dr217 { // dr217: yes
+ template<typename T> struct S {
+ void f(int);
+ };
+ template<typename T> void S<T>::f(int = 0) {} // expected-error {{default arguments cannot be added}}
+}
+
+namespace dr218 { // dr218: yes
+ namespace A {
+ struct S {};
+ void f(S);
+ }
+ namespace B {
+ struct S {};
+ void f(S);
+ }
+
+ struct C {
+ int f;
+ void test1(A::S as) { f(as); } // expected-error {{called object type 'int'}}
+ void test2(A::S as) { void f(); f(as); } // expected-error {{too many arguments}} expected-note {{}}
+ void test3(A::S as) { using A::f; f(as); } // ok
+ void test4(A::S as) { using B::f; f(as); } // ok
+ void test5(A::S as) { int f; f(as); } // expected-error {{called object type 'int'}}
+ void test6(A::S as) { struct f {}; (void) f(as); } // expected-error {{no matching conversion}} expected-note +{{}}
+ };
+
+ namespace D {
+ struct S {};
+ struct X { void operator()(S); } f;
+ }
+ void testD(D::S ds) { f(ds); } // expected-error {{undeclared identifier}}
+
+ namespace E {
+ struct S {};
+ struct f { f(S); };
+ }
+ void testE(E::S es) { f(es); } // expected-error {{undeclared identifier}}
+
+ namespace F {
+ struct S {
+ template<typename T> friend void f(S, T) {}
+ };
+ }
+ void testF(F::S fs) { f(fs, 0); }
+
+ namespace G {
+ namespace X {
+ int f;
+ struct A {};
+ }
+ namespace Y {
+ template<typename T> void f(T);
+ struct B {};
+ }
+ template<typename A, typename B> struct C {};
+ }
+ void testG(G::C<G::X::A, G::Y::B> gc) { f(gc); }
+}
+
+// dr219: na
+// dr220: na
+
+namespace dr221 { // dr221: yes
+ struct A {
+ A &operator=(int&);
+ A &operator+=(int&);
+ static A &operator=(A&, double&); // expected-error {{cannot be a static member}}
+ static A &operator+=(A&, double&); // expected-error {{cannot be a static member}}
+ friend A &operator=(A&, char&); // expected-error {{must be a non-static member function}}
+ friend A &operator+=(A&, char&);
+ };
+ A &operator=(A&, float&); // expected-error {{must be a non-static member function}}
+ A &operator+=(A&, float&);
+
+ void test(A a, int n, char c, float f) {
+ a = n;
+ a += n;
+ a = c;
+ a += c;
+ a = f;
+ a += f;
+ }
+}
+
+// dr222 is a mystery -- it lists no changes to the standard, and yet was
+// apparently both voted into the WP and acted upon by the editor.
+
+// dr223: na
+
+namespace dr224 { // dr224: no
+ namespace example1 {
+ template <class T> class A {
+ typedef int type;
+ A::type a;
+ A<T>::type b;
+ A<T*>::type c; // expected-error {{missing 'typename'}}
+ ::dr224::example1::A<T>::type d;
+
+ class B {
+ typedef int type;
+
+ A::type a;
+ A<T>::type b;
+ A<T*>::type c; // expected-error {{missing 'typename'}}
+ ::dr224::example1::A<T>::type d;
+
+ B::type e;
+ A<T>::B::type f;
+ A<T*>::B::type g; // expected-error {{missing 'typename'}}
+ typename A<T*>::B::type h;
+ };
+ };
+
+ template <class T> class A<T*> {
+ typedef int type;
+ A<T*>::type a;
+ A<T>::type b; // expected-error {{missing 'typename'}}
+ };
+
+ template <class T1, class T2, int I> struct B {
+ typedef int type;
+ B<T1, T2, I>::type b1;
+ B<T2, T1, I>::type b2; // expected-error {{missing 'typename'}}
+
+ typedef T1 my_T1;
+ static const int my_I = I;
+ static const int my_I2 = I+0;
+ static const int my_I3 = my_I;
+ B<my_T1, T2, my_I>::type b3; // FIXME: expected-error {{missing 'typename'}}
+ B<my_T1, T2, my_I2>::type b4; // expected-error {{missing 'typename'}}
+ B<my_T1, T2, my_I3>::type b5; // FIXME: expected-error {{missing 'typename'}}
+ };
+ }
+
+ namespace example2 {
+ template <int, typename T> struct X { typedef T type; };
+ template <class T> class A {
+ static const int i = 5;
+ X<i, int>::type w; // FIXME: expected-error {{missing 'typename'}}
+ X<A::i, char>::type x; // FIXME: expected-error {{missing 'typename'}}
+ X<A<T>::i, double>::type y; // FIXME: expected-error {{missing 'typename'}}
+ X<A<T*>::i, long>::type z; // expected-error {{missing 'typename'}}
+ int f();
+ };
+ template <class T> int A<T>::f() {
+ return i;
+ }
+ }
+}
+
+// dr225: yes
+template<typename T> void dr225_f(T t) { dr225_g(t); } // expected-error {{call to function 'dr225_g' that is neither visible in the template definition nor found by argument-dependent lookup}}
+void dr225_g(int); // expected-note {{should be declared prior to the call site}}
+template void dr225_f(int); // expected-note {{in instantiation of}}
+
+namespace dr226 { // dr226: no
+ template<typename T = void> void f() {}
+#if __cplusplus < 201103L
+ // expected-error@-2 {{extension}}
+ // FIXME: This appears to be wrong: default arguments for function templates
+ // are listed as a defect (in c++98) not an extension. EDG accepts them in
+ // strict c++98 mode.
+#endif
+ template<typename T> struct S {
+ template<typename U = void> void g();
+#if __cplusplus < 201103L
+ // expected-error@-2 {{extension}}
+#endif
+ template<typename U> struct X;
+ template<typename U> void h();
+ };
+ template<typename T> template<typename U> void S<T>::g() {}
+ template<typename T> template<typename U = void> struct S<T>::X {}; // expected-error {{cannot add a default template arg}}
+ template<typename T> template<typename U = void> void S<T>::h() {} // expected-error {{cannot add a default template arg}}
+
+ template<typename> void friend_h();
+ struct A {
+ // FIXME: This is ill-formed.
+ template<typename=void> struct friend_B;
+ // FIXME: f, h, and i are ill-formed.
+ // f is ill-formed because it is not a definition.
+ // h and i are ill-formed because they are not the only declarations of the
+ // function in the translation unit.
+ template<typename=void> void friend_f();
+ template<typename=void> void friend_g() {}
+ template<typename=void> void friend_h() {}
+ template<typename=void> void friend_i() {}
+#if __cplusplus < 201103L
+ // expected-error@-5 {{extension}} expected-error@-4 {{extension}}
+ // expected-error@-4 {{extension}} expected-error@-3 {{extension}}
+#endif
+ };
+ template<typename> void friend_i();
+
+ template<typename=void, typename X> void foo(X) {}
+ template<typename=void, typename X> struct Foo {}; // expected-error {{missing a default argument}} expected-note {{here}}
+#if __cplusplus < 201103L
+ // expected-error@-3 {{extension}}
+#endif
+
+ template<typename=void, typename X, typename, typename Y> int foo(X, Y);
+ template<typename, typename X, typename=void, typename Y> int foo(X, Y);
+ int x = foo(0, 0);
+#if __cplusplus < 201103L
+ // expected-error@-4 {{extension}}
+ // expected-error@-4 {{extension}}
+#endif
+}
+
+void dr227(bool b) { // dr227: yes
+ if (b)
+ int n;
+ else
+ int n;
+}
+
+namespace dr228 { // dr228: yes
+ template <class T> struct X {
+ void f();
+ };
+ template <class T> struct Y {
+ void g(X<T> x) { x.template X<T>::f(); }
+ };
+}
+
+namespace dr229 { // dr229: yes
+ template<typename T> void f();
+ template<typename T> void f<T*>() {} // expected-error {{function template partial specialization}}
+ template<> void f<int>() {}
+}
+
+namespace dr231 { // dr231: yes
+ namespace outer {
+ namespace inner {
+ int i; // expected-note {{here}}
+ }
+ void f() { using namespace inner; }
+ int j = i; // expected-error {{undeclared identifier 'i'; did you mean 'inner::i'?}}
+ }
+}
+
+// dr234: na
+// dr235: na
+
+namespace dr236 { // dr236: yes
+ void *p = int();
+#if __cplusplus < 201103L
+ // expected-warning@-2 {{null pointer}}
+#else
+ // expected-error@-4 {{cannot initialize}}
+#endif
+}
+
+namespace dr237 { // dr237: dup 470
+ template<typename T> struct A { void f() { T::error; } };
+ template<typename T> struct B : A<T> {};
+ template struct B<int>; // ok
+}
+
+namespace dr239 { // dr239: yes
+ namespace NS {
+ class T {};
+ void f(T);
+ float &g(T, int);
+ }
+ NS::T parm;
+ int &g(NS::T, float);
+ int main() {
+ f(parm);
+ float &r = g(parm, 1);
+ extern int &g(NS::T, float);
+ int &s = g(parm, 1);
+ }
+}
+
+// dr240: dup 616
+
+namespace dr241 { // dr241: yes
+ namespace A {
+ struct B {};
+ template <int X> void f(); // expected-note 2{{candidate}}
+ template <int X> void g(B);
+ }
+ namespace C {
+ template <class T> void f(T t); // expected-note 2{{candidate}}
+ template <class T> void g(T t); // expected-note {{candidate}}
+ }
+ void h(A::B b) {
+ f<3>(b); // expected-error {{undeclared identifier}}
+ g<3>(b); // expected-error {{undeclared identifier}}
+ A::f<3>(b); // expected-error {{no matching}}
+ A::g<3>(b);
+ C::f<3>(b); // expected-error {{no matching}}
+ C::g<3>(b); // expected-error {{no matching}}
+ using C::f;
+ using C::g;
+ f<3>(b); // expected-error {{no matching}}
+ g<3>(b);
+ }
+}
+
+namespace dr243 { // dr243: yes
+ struct B;
+ struct A {
+ A(B); // expected-note {{candidate}}
+ };
+ struct B {
+ operator A() = delete; // expected-error 0-1{{extension}} expected-note {{candidate}}
+ } b;
+ A a1(b);
+ A a2 = b; // expected-error {{ambiguous}}
+}
+
+namespace dr244 { // dr244: no
+ struct B {}; struct D : B {}; // expected-note {{here}}
+
+ D D_object;
+ typedef B B_alias;
+ B* B_ptr = &D_object;
+
+ void f() {
+ D_object.~B(); // expected-error {{expression does not match the type}}
+ D_object.B::~B();
+ B_ptr->~B();
+ B_ptr->~B_alias();
+ B_ptr->B_alias::~B();
+ // This is valid under DR244.
+ B_ptr->B_alias::~B_alias(); // FIXME: expected-error {{expected the class name after '~' to name a destructor}}
+ B_ptr->dr244::~B(); // expected-error {{refers to a member in namespace}}
+ B_ptr->dr244::~B_alias(); // expected-error {{refers to a member in namespace}}
+ }
+}
+
+namespace dr245 { // dr245: yes
+ struct S {
+ enum E {}; // expected-note {{here}}
+ class E *p; // expected-error {{does not match previous declaration}}
+ };
+}
+
+namespace dr246 { // dr246: yes
+ struct S {
+ S() try { // expected-note {{try block}}
+ throw 0;
+X: ;
+ } catch (int) {
+ goto X; // expected-error {{protected scope}}
+ }
+ };
+}
+
+namespace dr247 { // dr247: yes
+ struct A {};
+ struct B : A {
+ void f();
+ void f(int);
+ };
+ void (A::*f)() = (void (A::*)())&B::f;
+
+ struct C {
+ void f();
+ void f(int);
+ };
+ struct D : C {};
+ void (C::*g)() = &D::f;
+ void (D::*h)() = &D::f;
+
+ struct E {
+ void f();
+ };
+ struct F : E {
+ using E::f;
+ void f(int);
+ };
+ void (F::*i)() = &F::f;
+}
+
+namespace dr248 { // dr248: yes c++11
+ // FIXME: Should this also apply to c++98 mode? This was a DR against C++98.
+ int \u040d\u040e = 0;
+#if __cplusplus < 201103L
+ // FIXME: expected-error@-2 {{expected ';'}}
+#endif
+}
+
+namespace dr249 { // dr249: yes
+ template<typename T> struct X { void f(); };
+ template<typename T> void X<T>::f() {}
+}
+
+namespace dr250 { // dr250: yes
+ typedef void (*FPtr)(double x[]);
+
+ template<int I> void f(double x[]);
+ FPtr fp = &f<3>;
+
+ template<int I = 3> void g(double x[]); // expected-error 0-1{{extension}}
+ FPtr gp = &g<>;
+}
+
+namespace dr252 { // dr252: yes
+ struct A {
+ void operator delete(void*); // expected-note {{found}}
+ };
+ struct B {
+ void operator delete(void*); // expected-note {{found}}
+ };
+ struct C : A, B {
+ virtual ~C();
+ };
+ C::~C() {} // expected-error {{'operator delete' found in multiple base classes}}
+
+ struct D {
+ void operator delete(void*, int); // expected-note {{here}}
+ virtual ~D();
+ };
+ D::~D() {} // expected-error {{no suitable member 'operator delete'}}
+
+ struct E {
+ void operator delete(void*, int);
+ void operator delete(void*) = delete; // expected-error 0-1{{extension}} expected-note {{here}}
+ virtual ~E();
+ };
+ E::~E() {} // expected-error {{deleted}}
+
+ struct F {
+ // If both functions are available, the first one is a placement delete.
+ void operator delete(void*, __SIZE_TYPE__);
+ void operator delete(void*) = delete; // expected-error 0-1{{extension}} expected-note {{here}}
+ virtual ~F();
+ };
+ F::~F() {} // expected-error {{deleted}}
+
+ struct G {
+ void operator delete(void*, __SIZE_TYPE__);
+ virtual ~G();
+ };
+ G::~G() {}
+}
+
+namespace dr254 { // dr254: yes
+ template<typename T> struct A {
+ typedef typename T::type type; // ok even if this is a typedef-name, because
+ // it's not an elaborated-type-specifier
+ typedef struct T::type foo; // expected-error {{elaborated type refers to a typedef}}
+ };
+ struct B { struct type {}; };
+ struct C { typedef struct {} type; }; // expected-note {{here}}
+ A<B>::type n;
+ A<C>::type n; // expected-note {{instantiation of}}
+}
+
+// dr256: dup 624
+
+namespace dr257 { // dr257: yes
+ struct A { A(int); }; // expected-note {{here}}
+ struct B : virtual A {
+ B() {}
+ virtual void f() = 0;
+ };
+ struct C : B {
+ C() {}
+ };
+ struct D : B {
+ D() {} // expected-error {{must explicitly initialize the base class 'dr257::A'}}
+ void f();
+ };
+}
+
+namespace dr258 { // dr258: yes
+ struct A {
+ void f(const int);
+ template<typename> void g(int);
+ float &h() const;
+ };
+ struct B : A {
+ using A::f;
+ using A::g;
+ using A::h;
+ int &f(int);
+ template<int> int &g(int); // expected-note {{candidate}}
+ int &h();
+ } b;
+ int &w = b.f(0);
+ int &x = b.g<int>(0); // expected-error {{no match}}
+ int &y = b.h();
+ float &z = const_cast<const B&>(b).h();
+
+ struct C {
+ virtual void f(const int) = 0;
+ };
+ struct D : C {
+ void f(int);
+ } d;
+
+ struct E {
+ virtual void f() = 0; // expected-note {{unimplemented}}
+ };
+ struct F : E {
+ void f() const {}
+ } f; // expected-error {{abstract}}
+}
+
+namespace dr259 { // dr259: yes c++11
+ template<typename T> struct A {};
+ template struct A<int>; // expected-note {{previous}}
+ template struct A<int>; // expected-error {{duplicate explicit instantiation}}
+
+ // FIXME: We only apply this DR in C++11 mode.
+ template<> struct A<float>;
+ template struct A<float>;
+#if __cplusplus < 201103L
+ // expected-error@-2 {{extension}} expected-note@-3 {{here}}
+#endif
+
+ template struct A<char>; // expected-note {{here}}
+ template<> struct A<char>; // expected-error {{explicit specialization of 'dr259::A<char>' after instantiation}}
+
+ template<> struct A<double>;
+ template<> struct A<double>;
+ template<> struct A<double> {}; // expected-note {{here}}
+ template<> struct A<double> {}; // expected-error {{redefinition}}
+
+ template<typename T> struct B; // expected-note {{here}}
+ template struct B<int>; // expected-error {{undefined}}
+
+ template<> struct B<float>;
+ template struct B<float>;
+#if __cplusplus < 201103L
+ // expected-error@-2 {{extension}} expected-note@-3 {{here}}
+#endif
+}
+
+namespace dr261 { // dr261: no
+#pragma clang diagnostic push
+#pragma clang diagnostic warning "-Wused-but-marked-unused"
+
+ // FIXME: This is ill-formed, with a diagnostic required, because operator new
+ // and operator delete are inline and odr-used, but not defined in this
+ // translation unit.
+ // We're also missing the -Wused-but-marked-unused diagnostic here.
+ struct A {
+ inline void *operator new(__SIZE_TYPE__) __attribute__((unused));
+ inline void operator delete(void*) __attribute__((unused));
+ A() {}
+ };
+
+ // FIXME: These are ill-formed, with a required diagnostic, for the same
+ // reason.
+ struct B {
+ inline void operator delete(void*) __attribute__((unused));
+ ~B() {}
+ };
+ struct C {
+ inline void operator delete(void*) __attribute__((unused));
+ virtual ~C() {}
+ };
+
+ struct D {
+ inline void operator delete(void*) __attribute__((unused));
+ };
+ void h() { C::operator delete(0); } // expected-warning {{marked unused but was used}}
+
+#pragma clang diagnostic pop
+}
+
+namespace dr262 { // dr262: yes
+ int f(int = 0, ...);
+ int k = f();
+ int l = f(0);
+ int m = f(0, 0);
+}
+
+namespace dr263 { // dr263: yes
+ struct X {};
+ struct Y {
+#if __cplusplus < 201103L
+ friend X::X() throw();
+ friend X::~X() throw();
+#else
+ friend constexpr X::X() noexcept;
+ friend X::~X();
+#endif
+ Y::Y(); // expected-error {{extra qualification}}
+ Y::~Y(); // expected-error {{extra qualification}}
+ };
+}
+
+// dr265: dup 353
+// dr266: na
+// dr269: na
+// dr270: na
diff --git a/test/CXX/drs/dr4xx.cpp b/test/CXX/drs/dr4xx.cpp
new file mode 100644
index 000000000000..1d3b94064cdd
--- /dev/null
+++ b/test/CXX/drs/dr4xx.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// expected-no-diagnostics
+
+namespace dr408 { // dr408: 3.4
+ template<int N> void g() { int arr[N != 1 ? 1 : -1]; }
+ template<> void g<2>() { }
+
+ template<typename T> struct S {
+ static int i[];
+ void f();
+ };
+ template<typename T> int S<T>::i[] = { 1 };
+
+ template<typename T> void S<T>::f() {
+ g<sizeof (i) / sizeof (int)>();
+ }
+ template<> int S<int>::i[] = { 1, 2 };
+ template void S<int>::f(); // uses g<2>(), not g<1>().
+
+
+ template<typename T> struct R {
+ static int arr[];
+ void f();
+ };
+ template<typename T> int R<T>::arr[1];
+ template<typename T> void R<T>::f() {
+ int arr[sizeof(arr) != sizeof(int) ? 1 : -1];
+ }
+ template<> int R<int>::arr[2];
+ template void R<int>::f();
+}
diff --git a/test/CXX/except/except.spec/p14.cpp b/test/CXX/except/except.spec/p14.cpp
index dda69e9aad60..945a767584fe 100644
--- a/test/CXX/except/except.spec/p14.cpp
+++ b/test/CXX/except/except.spec/p14.cpp
@@ -44,8 +44,8 @@ namespace PR13381 {
struct NoThrowMove {
NoThrowMove(const NoThrowMove &);
NoThrowMove(NoThrowMove &&) noexcept;
- NoThrowMove &operator=(const NoThrowMove &);
- NoThrowMove &operator=(NoThrowMove &&) noexcept;
+ NoThrowMove &operator=(const NoThrowMove &) const;
+ NoThrowMove &operator=(NoThrowMove &&) const noexcept;
};
struct NoThrowMoveOnly {
NoThrowMoveOnly(NoThrowMoveOnly &&) noexcept;
diff --git a/test/CXX/except/except.spec/p4.cpp b/test/CXX/except/except.spec/p4.cpp
index 1bf70188031f..8d1b75fbdd6d 100644
--- a/test/CXX/except/except.spec/p4.cpp
+++ b/test/CXX/except/except.spec/p4.cpp
@@ -34,3 +34,8 @@ template<typename T> struct U {
template<typename T> U<T>::~U() noexcept(true) {} // expected-error {{exception specification in declaration does not match previous declaration}}
template<typename T> void U<T>::operator delete(void*) noexcept(false) {} // expected-error {{exception specification in declaration does not match previous declaration}}
+
+
+// Make sure this restriction interacts properly with __attribute__((noreturn))
+void __attribute__ ((__noreturn__)) PR17110(int status) throw();
+void PR17110(int status) throw();
diff --git a/test/CXX/expr/expr.const/p2-0x.cpp b/test/CXX/expr/expr.const/p2-0x.cpp
index 634dee3782fc..f0b53c7d3b5c 100644
--- a/test/CXX/expr/expr.const/p2-0x.cpp
+++ b/test/CXX/expr/expr.const/p2-0x.cpp
@@ -275,9 +275,7 @@ namespace UndefinedBehavior {
// - a lambda-expression (5.1.2);
struct Lambda {
- // FIXME: clang crashes when trying to parse this! Revisit this check once
- // lambdas are fully implemented.
- //int n : []{ return 1; }();
+ int n : []{ return 1; }(); // expected-error {{constant expression}} expected-error {{integral constant expression}}
};
// - an lvalue-to-rvalue conversion (4.1) unless it is applied to
@@ -322,7 +320,7 @@ namespace LValueToRValue {
// constant expression;
constexpr volatile S f() { return S(); }
static_assert(f().i, ""); // ok! there's no lvalue-to-rvalue conversion here!
- static_assert(((volatile const S&&)(S)0).i, ""); // expected-error {{constant expression}}
+ static_assert(((volatile const S&&)(S)0).i, ""); // expected-error {{constant expression}} expected-note {{read of volatile-qualified type}}
}
// DR1312: The proposed wording for this defect has issues, so we ignore this
@@ -481,17 +479,19 @@ namespace UnspecifiedRelations {
public:
constexpr A() : a(0), b(0) {}
int a;
- constexpr bool cmp() const { return &a < &b; } // expected-error {{constexpr function never produces a constant expression}} expected-note {{comparison of address of fields 'a' and 'b' of 'A' with differing access specifiers (public vs private) has unspecified value}}
+ constexpr bool cmp() const { return &a < &b; } // expected-note {{comparison of address of fields 'a' and 'b' of 'A' with differing access specifiers (public vs private) has unspecified value}}
private:
int b;
};
+ static_assert(A().cmp(), ""); // expected-error {{constant expression}} expected-note {{in call}}
class B {
public:
A a;
- constexpr bool cmp() const { return &a.a < &b.a; } // expected-error {{constexpr function never produces a constant expression}} expected-note {{comparison of address of fields 'a' and 'b' of 'B' with differing access specifiers (public vs protected) has unspecified value}}
+ constexpr bool cmp() const { return &a.a < &b.a; } // expected-note {{comparison of address of fields 'a' and 'b' of 'B' with differing access specifiers (public vs protected) has unspecified value}}
protected:
A b;
};
+ static_assert(B().cmp(), ""); // expected-error {{constant expression}} expected-note {{in call}}
// If two pointers point to different base sub-objects of the same object, or
// one points to a base subobject and the other points to a member, the result
diff --git a/test/CXX/expr/expr.const/p3-0x.cpp b/test/CXX/expr/expr.const/p3-0x.cpp
index 047e238190f8..e3e32dfe0900 100644
--- a/test/CXX/expr/expr.const/p3-0x.cpp
+++ b/test/CXX/expr/expr.const/p3-0x.cpp
@@ -93,7 +93,7 @@ void c() {
break;
}
}
-template<bool B> int f() { return B; }
+template <bool B> int f() { return B; } // expected-note {{candidate template ignored: invalid explicitly-specified argument for template parameter 'B'}}
template int f<&S::operator int>(); // expected-error {{does not refer to a function template}}
template int f<(bool)&S::operator int>();
diff --git a/test/CXX/expr/expr.post/expr.call/p7-0x.cpp b/test/CXX/expr/expr.post/expr.call/p7-0x.cpp
index 018609d9a07d..fbb685c5a448 100644
--- a/test/CXX/expr/expr.post/expr.call/p7-0x.cpp
+++ b/test/CXX/expr/expr.post/expr.call/p7-0x.cpp
@@ -20,11 +20,16 @@ struct X4 {
void vararg(...);
+void g();
+
void f(X1 x1, X2 x2, X3 x3, X4 x4) {
vararg(x1); // OK
vararg(x2); // expected-error{{cannot pass object of non-trivial type 'X2' through variadic function; call will abort at runtime}}
vararg(x3); // OK
vararg(x4); // expected-error{{cannot pass object of non-trivial type 'X4' through variadic function; call will abort at runtime}}
+
+ vararg(g()); // expected-error{{cannot pass expression of type 'void' to variadic function}}
+ vararg({1, 2, 3}); // expected-error{{cannot pass initializer list to variadic function}}
}
@@ -33,7 +38,7 @@ namespace PR11131 {
S &getS();
- void f(...);
+ int f(...);
void g() {
(void)sizeof(f(getS()));
diff --git a/test/CXX/expr/expr.post/expr.const.cast/p1-0x.cpp b/test/CXX/expr/expr.post/expr.const.cast/p1-0x.cpp
index 76ea96fe14ae..f4c0f1ae1229 100644
--- a/test/CXX/expr/expr.post/expr.const.cast/p1-0x.cpp
+++ b/test/CXX/expr/expr.post/expr.const.cast/p1-0x.cpp
@@ -6,14 +6,26 @@
unsigned int f(int);
+struct X {};
+
template<typename T> T& lvalue();
template<typename T> T&& xvalue();
template<typename T> T prvalue();
-void test_classification(const int *ptr) {
- int *ptr0 = const_cast<int *&&>(ptr);
- int *ptr1 = const_cast<int *&&>(xvalue<const int*>());
- int *ptr2 = const_cast<int *&&>(prvalue<const int*>());
+void test_classification(const int *ptr, X x) {
+ int *&&ptr0 = const_cast<int *&&>(ptr);
+ int *&&ptr1 = const_cast<int *&&>(xvalue<const int*>());
+ int *&&ptr2 = const_cast<int *&&>(prvalue<const int*>()); // expected-error {{const_cast from rvalue to reference type 'int *&&'}}
+ X &&ptr3 = const_cast<X&&>(x);
+ X &&ptr4 = const_cast<X&&>(xvalue<X>());
+ X &&ptr5 = const_cast<X&&>(prvalue<X>());
+
+ int *&ptr6 = const_cast<int *&>(ptr);
+ int *&ptr7 = const_cast<int *&>(xvalue<const int*>()); // expected-error {{const_cast from rvalue to reference type 'int *&'}}
+ int *&ptr8 = const_cast<int *&>(prvalue<const int*>()); // expected-error {{const_cast from rvalue to reference type 'int *&'}}
+ X &ptr9 = const_cast<X&>(x);
+ X &ptrA = const_cast<X&>(xvalue<X>()); // expected-error {{const_cast from rvalue to reference type 'X &'}}
+ X &ptrB = const_cast<X&>(prvalue<X>()); // expected-error {{const_cast from rvalue to reference type 'X &'}}
}
struct A {
diff --git a/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp b/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp
index 66579915c7b0..fd90482ae8d2 100644
--- a/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp
@@ -30,16 +30,44 @@ struct C {
float &f(T*) const noexcept;
T* ptr;
- auto g1() noexcept(noexcept(f(ptr))) -> decltype(f((*this).ptr));
+ auto g1() noexcept(noexcept(f(ptr))) -> decltype(f(ptr));
auto g2() const noexcept(noexcept(f(((this))->ptr))) -> decltype(f(ptr));
+ auto g3() noexcept(noexcept(f(this->ptr))) -> decltype(f((*this).ptr));
+ auto g4() const noexcept(noexcept(f(((this))->ptr))) -> decltype(f(this->ptr));
+ auto g5() noexcept(noexcept(this->f(ptr))) -> decltype(this->f(ptr));
+ auto g6() const noexcept(noexcept(this->f(((this))->ptr))) -> decltype(this->f(ptr));
+ auto g7() noexcept(noexcept(this->f(this->ptr))) -> decltype(this->f((*this).ptr));
+ auto g8() const noexcept(noexcept(this->f(((this))->ptr))) -> decltype(this->f(this->ptr));
};
void test_C(C<int> ci) {
- int *p = 0;
int &ir = ci.g1();
float &fr = ci.g2();
+ int &ir2 = ci.g3();
+ float &fr2 = ci.g4();
+ int &ir3 = ci.g5();
+ float &fr3 = ci.g6();
+ int &ir4 = ci.g7();
+ float &fr4 = ci.g8();
static_assert(!noexcept(ci.g1()), "exception-specification failure");
static_assert(noexcept(ci.g2()), "exception-specification failure");
+ static_assert(!noexcept(ci.g3()), "exception-specification failure");
+ static_assert(noexcept(ci.g4()), "exception-specification failure");
+ static_assert(!noexcept(ci.g5()), "exception-specification failure");
+ static_assert(noexcept(ci.g6()), "exception-specification failure");
+ static_assert(!noexcept(ci.g7()), "exception-specification failure");
+ static_assert(noexcept(ci.g8()), "exception-specification failure");
+}
+
+namespace PR14263 {
+ template<typename T> struct X {
+ void f();
+ T f() const;
+
+ auto g() -> decltype(this->f()) { return f(); }
+ auto g() const -> decltype(this->f()) { return f(); }
+ };
+ template struct X<int>;
}
namespace PR10036 {
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm
index 9f9867106930..24ce2cd6c198 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks-irgen.mm
@@ -14,7 +14,7 @@ namespace PR12746 {
}
// CHECK: define internal zeroext i1 @___ZN7PR127462f1EPi_block_invoke
- // CHECK: call zeroext i1 @"_ZNK7PR127462f132___ZN7PR127462f1EPi_block_invoke3$_0clEv"
+ // CHECK: call zeroext i1 @"_ZZZN7PR127462f1EPiEUb_ENK3$_0clEv"
bool f2(int *x) {
auto outer = [&]() -> bool {
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/generic-lambda-unimplemented-1y.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/generic-lambda-unimplemented-1y.cpp
new file mode 100644
index 000000000000..7f42c396ee22
--- /dev/null
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/generic-lambda-unimplemented-1y.cpp
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++1y %s -verify
+//expected-no-diagnostics
+namespace lambda_capturing {
+// FIXME: Once return type deduction is implemented for generic lambdas
+// this will need to be updated.
+void test() {
+ int i = 10;
+ {
+ auto L = [=](auto a) -> int {
+ return i + a;
+ };
+ L(3);
+ }
+ {
+ auto L = [i](auto a) -> int {
+ return i + a;
+ };
+ L(3);
+ }
+ {
+ auto L = [i=i](auto a) -> int {
+ return i + a;
+ };
+ L(3);
+ }
+
+
+}
+
+}
+
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
new file mode 100644
index 000000000000..6be200dd54e5
--- /dev/null
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
@@ -0,0 +1,77 @@
+// RUN: %clang_cc1 -std=c++1y %s -verify
+
+const char *has_no_member = [x("hello")] {}.x; // expected-error {{no member named 'x'}}
+
+double f;
+auto with_float = [f(1.0f)] {
+ using T = decltype(f);
+ using T = float;
+};
+auto with_float_2 = [&f(f)] { // ok, refers to outer f
+ using T = decltype(f);
+ using T = double&;
+};
+
+// Within the lambda-expression's compound-statement,
+// the identifier in the init-capture hides any declaration
+// of the same name in scopes enclosing the lambda-expression.
+void hiding() {
+ char c;
+ (void) [c("foo")] {
+ static_assert(sizeof(c) == sizeof(const char*), "");
+ };
+ (void) [c("bar")] () -> decltype(c) { // outer c, not init-capture
+ return "baz"; // expected-error {{cannot initialize}}
+ };
+}
+
+struct ExplicitCopy {
+ ExplicitCopy(); // expected-note 2{{not viable}}
+ explicit ExplicitCopy(const ExplicitCopy&);
+};
+auto init_kind_1 = [ec(ExplicitCopy())] {};
+auto init_kind_2 = [ec = ExplicitCopy()] {}; // expected-error {{no matching constructor}}
+
+template<typename T> void init_kind_template() {
+ auto init_kind_1 = [ec(T())] {};
+ auto init_kind_2 = [ec = T()] {}; // expected-error {{no matching constructor}}
+}
+template void init_kind_template<int>();
+template void init_kind_template<ExplicitCopy>(); // expected-note {{instantiation of}}
+
+void void_fn();
+int overload_fn();
+int overload_fn(int);
+
+auto bad_init_1 = [a()] {}; // expected-error {{expected expression}}
+auto bad_init_2 = [a(1, 2)] {}; // expected-error {{initializer for lambda capture 'a' contains multiple expressions}}
+auto bad_init_3 = [&a(void_fn())] {}; // expected-error {{cannot form a reference to 'void'}}
+auto bad_init_4 = [a(void_fn())] {}; // expected-error {{has incomplete type 'void'}}
+auto bad_init_5 = [a(overload_fn)] {}; // expected-error {{cannot deduce type for lambda capture 'a' from initializer of type '<overloaded function}}
+auto bad_init_6 = [a{overload_fn}] {}; // expected-error {{cannot deduce type for lambda capture 'a' from initializer list}}
+
+template<typename...T> void pack_1(T...t) { (void)[a(t...)] {}; } // expected-error {{initializer missing for lambda capture 'a'}}
+template void pack_1<>(); // expected-note {{instantiation of}}
+
+// FIXME: Might need lifetime extension for the temporary here.
+// See DR1695.
+auto a = [a(4), b = 5, &c = static_cast<const int&&>(0)] {
+ static_assert(sizeof(a) == sizeof(int), "");
+ static_assert(sizeof(b) == sizeof(int), "");
+ using T = decltype(c);
+ using T = const int &;
+};
+auto b = [a{0}] {}; // expected-error {{include <initializer_list>}}
+
+struct S { S(); S(S&&); };
+template<typename T> struct remove_reference { typedef T type; };
+template<typename T> struct remove_reference<T&> { typedef T type; };
+template<typename T> decltype(auto) move(T &&t) { return static_cast<typename remove_reference<T>::type&&>(t); }
+auto s = [s(move(S()))] {};
+
+template<typename T> T instantiate_test(T t) {
+ [x(&t)]() { *x = 1; } (); // expected-error {{assigning to 'const char *'}}
+ return t;
+}
+int instantiate_test_1 = instantiate_test(0);
+const char *instantiate_test_2 = instantiate_test("foo"); // expected-note {{here}}
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
index 6358215a5559..2ddcf18409e9 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
@@ -88,3 +88,15 @@ struct CaptureArrayAndThis {
}
};
+namespace rdar14468891 {
+ class X {
+ public:
+ virtual ~X() = 0; // expected-note{{unimplemented pure virtual method '~X' in 'X'}}
+ };
+
+ class Y : public X { };
+
+ void capture(X &x) {
+ [x]() {}(); // expected-error{{by-copy capture of value of abstract type 'rdar14468891::X'}}
+ }
+}
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p2-generic-lambda-1y.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p2-generic-lambda-1y.cpp
new file mode 100644
index 000000000000..d41c4507a850
--- /dev/null
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p2-generic-lambda-1y.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++1y -DCXX1Y
+
+// prvalue
+void prvalue() {
+ auto&& x = [](auto a)->void { };
+ auto& y = [](auto *a)->void { }; // expected-error{{cannot bind to a temporary of type}}
+}
+
+namespace std {
+ class type_info;
+}
+
+struct P {
+ virtual ~P();
+};
+
+void unevaluated_operand(P &p, int i) { //expected-note{{declared here}}
+ // FIXME: this should only emit one error.
+ int i2 = sizeof([](auto a, auto b)->void{}(3, '4')); // expected-error{{lambda expression in an unevaluated operand}} \
+ // expected-error{{invalid application of 'sizeof'}}
+ const std::type_info &ti1 = typeid([](auto &a) -> P& { static P p; return p; }(i));
+ const std::type_info &ti2 = typeid([](auto) -> int { return i; }(i)); // expected-error{{lambda expression in an unevaluated operand}}\
+ // expected-error{{cannot be implicitly captured}}\
+ // expected-note{{begins here}}
+}
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p2.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p2.cpp
index c6ed308d79a1..1fbe28722a41 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p2.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p2.cpp
@@ -15,7 +15,7 @@ struct P {
};
void unevaluated_operand(P &p, int i) {
- int i2 = sizeof([]()->void{}()); // expected-error{{lambda expression in an unevaluated operand}}
+ int i2 = sizeof([] ()->int { return 0; }()); // expected-error{{lambda expression in an unevaluated operand}}
const std::type_info &ti1 = typeid([&]() -> P& { return p; }());
const std::type_info &ti2 = typeid([&]() -> int { return i; }()); // expected-error{{lambda expression in an unevaluated operand}}
}
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp
index 82fc04a48fb6..4ae34dec3e34 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify -Wno-c++1y-extensions
+// RUN: %clang_cc1 -fsyntax-only -std=c++1y %s -verify
void print();
@@ -56,3 +57,25 @@ void variadic_lambda(Args... args) {
}
template void variadic_lambda(int*, float*, double*);
+
+template<typename ...Args>
+void init_capture_pack_err(Args ...args) {
+ [as(args)...] {} (); // expected-error {{expected ','}}
+ [as...(args)]{} (); // expected-error {{expected ','}}
+}
+
+template<typename ...Args>
+void init_capture_pack_multi(Args ...args) {
+ [as(args...)] {} (); // expected-error {{initializer missing for lambda capture 'as'}} expected-error {{multiple}}
+}
+template void init_capture_pack_multi(); // expected-note {{instantiation}}
+template void init_capture_pack_multi(int);
+template void init_capture_pack_multi(int, int); // expected-note {{instantiation}}
+
+template<typename ...Args>
+void init_capture_pack_outer(Args ...args) {
+ print([as(args)] { return sizeof(as); } () ...);
+}
+template void init_capture_pack_outer();
+template void init_capture_pack_outer(int);
+template void init_capture_pack_outer(int, int);
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p4-1y.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p4-1y.cpp
new file mode 100644
index 000000000000..f8461335b768
--- /dev/null
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p4-1y.cpp
@@ -0,0 +1,66 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++1y %s -verify
+
+int a;
+int &b = [] (int &r) -> decltype(auto) { return r; } (a);
+int &c = [] (int &r) -> decltype(auto) { return (r); } (a);
+int &d = [] (int &r) -> auto & { return r; } (a);
+int &e = [] (int &r) -> auto { return r; } (a); // expected-error {{cannot bind to a temporary}}
+int &f = [] (int r) -> decltype(auto) { return r; } (a); // expected-error {{cannot bind to a temporary}}
+int &g = [] (int r) -> decltype(auto) { return (r); } (a); // expected-warning {{reference to stack}}
+
+
+int test_explicit_auto_return()
+{
+ struct X {};
+ auto L = [](auto F, auto a) { return F(a); };
+ auto M = [](auto a) -> auto { return a; }; // OK
+ auto MRef = [](auto b) -> auto& { return b; }; //expected-warning{{reference to stack}}
+ auto MPtr = [](auto c) -> auto* { return &c; }; //expected-warning{{address of stack}}
+ auto MDeclType = [](auto&& d) -> decltype(auto) { return static_cast<decltype(d)>(d); }; //OK
+ M(3);
+
+ auto &&x = MDeclType(X{});
+ auto &&x1 = M(X{});
+ auto &&x2 = MRef(X{});//expected-note{{in instantiation of}}
+ auto &&x3 = MPtr(X{}); //expected-note{{in instantiation of}}
+ return 0;
+}
+
+int test_implicit_auto_return()
+{
+ {
+ auto M = [](auto a) { return a; };
+ struct X {};
+ X x = M(X{});
+
+ }
+}
+
+int test_multiple_returns() {
+ auto M = [](auto a) {
+ bool k;
+ if (k)
+ return a;
+ else
+ return 5; //expected-error{{deduced as 'int' here}}
+ };
+ M(3); // OK
+ M('a'); //expected-note{{in instantiation of}}
+ return 0;
+}
+int test_no_parameter_list()
+{
+ static int si = 0;
+ auto M = [] { return 5; }; // OK
+ auto M2 = [] -> auto&& { return si; }; // expected-error{{lambda requires '()'}}
+ M();
+}
+
+int test_conditional_in_return() {
+ auto Fac = [](auto f, auto n) {
+ return n <= 0 ? n : f(f, n - 1) * n;
+ };
+ // FIXME: this test causes a recursive limit - need to error more gracefully.
+ //Fac(Fac, 3);
+
+} \ No newline at end of file
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp
index f580e7e4c46f..1016cb1d3056 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
+// RUN: %clang_cc1 -fsyntax-only -std=c++1y %s -verify -DCPP1Y
void missing_lambda_declarator() {
[](){}();
@@ -17,7 +18,7 @@ void infer_void_return_type(int i) {
switch (x) {
case 0: return get<void>();
case 1: return;
- case 2: return { 1, 2.0 }; // expected-error{{cannot deduce lambda return type from initializer list}}
+ case 2: return { 1, 2.0 }; //expected-error{{cannot deduce}}
}
}(7);
}
@@ -38,7 +39,10 @@ X infer_X_return_type_fail(X x) {
if (y > 0)
return X();
else
- return x; // expected-error{{return type 'const X' must match previous return type 'X' when lambda expression has unspecified explicit return type}}
+ return x;
+#if __cplusplus <= 201103L
+ // expected-error@-2 {{return type 'const X' must match previous return type 'X' when lambda expression has unspecified explicit return type}}
+#endif
}(5);
}
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p4.mm b/test/CXX/expr/expr.prim/expr.prim.lambda/p4.mm
index 0126e23a74ab..92c62904d57b 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p4.mm
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p4.mm
@@ -4,5 +4,5 @@
@end
void test_result_type() {
- auto l1 = [] () -> A { }; // expected-error{{non-pointer Objective-C class type 'A' in lambda expression result}}
+ auto l1 = [] () -> A { }; // expected-error{{interface type 'A' cannot be returned by value; did you forget * in 'A'?}}
}
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p5-generic-lambda-1y.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p5-generic-lambda-1y.cpp
new file mode 100644
index 000000000000..c5d3bf6d1bcf
--- /dev/null
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p5-generic-lambda-1y.cpp
@@ -0,0 +1,131 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++1y -DCXX1Y
+
+namespace test_factorial {
+
+auto Fact = [](auto Self, unsigned n) -> unsigned {
+ return !n ? 1 : Self(Self, n - 1) * n;
+};
+
+auto six = Fact(Fact, 3);
+
+}
+
+namespace overload_generic_lambda {
+ template <class F1, class F2> struct overload : F1, F2 {
+ using F1::operator();
+ using F2::operator();
+ overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
+ };
+
+ auto NumParams = [](auto Self, auto h, auto ... rest) -> unsigned {
+ return 1 + Self(Self, rest...);
+ };
+ auto Base = [](auto Self, auto h) -> unsigned {
+ return 1;
+ };
+ overload<decltype(Base), decltype(NumParams)> O(Base, NumParams);
+ int num_params = O(O, 5, 3, "abc", 3.14, 'a');
+}
+
+
+namespace overload_generic_lambda_return_type_deduction {
+ template <class F1, class F2> struct overload : F1, F2 {
+ using F1::operator();
+ using F2::operator();
+ overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
+ };
+
+ auto NumParams = [](auto Self, auto h, auto ... rest) {
+ return 1 + Self(Self, rest...);
+ };
+ auto Base = [](auto Self, auto h) {
+ return 1;
+ };
+ overload<decltype(Base), decltype(NumParams)> O(Base, NumParams);
+ int num_params = O(O, 5, 3, "abc", 3.14, 'a');
+}
+
+namespace test_standard_p5 {
+// FIXME: This test should eventually compile without an explicit trailing return type
+auto glambda = [](auto a, auto&& b) ->bool { return a < b; };
+bool b = glambda(3, 3.14); // OK
+
+}
+namespace test_deduction_failure {
+ int test() {
+ auto g = [](auto *a) { //expected-note{{candidate template ignored}}
+ return a;
+ };
+ struct X { };
+ X *x;
+ g(x);
+ g(3); //expected-error{{no matching function}}
+ return 0;
+ }
+
+}
+
+namespace test_instantiation_or_sfinae_failure {
+int test2() {
+ {
+ auto L = [](auto *a) {
+ return (*a)(a); }; //expected-error{{called object type 'double' is not a function}}
+ double d;
+ L(&d); //expected-note{{in instantiation of}}
+ auto M = [](auto b) { return b; };
+ L(&M); // ok
+ }
+ {
+ auto L = [](auto *a) ->decltype (a->foo()) { //expected-note2{{candidate template ignored:}}
+ return (*a)(a); };
+ double d;
+ L(&d); //expected-error{{no matching function for call}}
+ auto M = [](auto b) { return b; };
+ L(&M); //expected-error{{no matching function for call}}
+
+ }
+ return 0;
+}
+
+
+}
+
+namespace test_misc {
+auto GL = [](auto a, decltype(a) b) //expected-note{{candidate function}}
+ -> int { return a + b; };
+
+void test() {
+ struct X { };
+ GL(3, X{}); //expected-error{{no matching function}}
+}
+
+void test2() {
+ auto l = [](auto *a) -> int {
+ (*a)(a); return 0; }; //expected-error{{called object type 'double' is not a function}}
+ l(&l);
+ double d;
+ l(&d); //expected-note{{in instantiation of}}
+}
+
+}
+
+namespace nested_lambdas {
+ int test() {
+ auto L = [](auto a) {
+ return [=](auto b) {
+ return a + b;
+ };
+ };
+ }
+ auto get_lambda() {
+ return [](auto a) {
+ return a;
+ };
+ };
+
+ int test2() {
+ auto L = get_lambda();
+ L(3);
+ }
+}
+
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
index d1384f19dd14..b9b8cd76c011 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 %s -verify
+// RUN: %clang_cc1 -std=c++11 %s -verify -Wno-c++1y-extensions
class X0 {
void explicit_capture() {
@@ -26,4 +26,7 @@ void S2::f(int i) {
(void)[=, this]{ }; // expected-error{{'this' cannot be explicitly captured}}
(void)[=]{ this->g(i); };
(void)[i, i]{ }; // expected-error{{'i' can appear only once in a capture list}}
+ (void)[i(0), i(1)]{ }; // expected-error{{'i' can appear only once in a capture list}}
+ (void)[i, i(1)]{ }; // expected-error{{'i' can appear only once in a capture list}}
+ (void)[i(0), i]{ }; // expected-error{{'i' can appear only once in a capture list}}
}
diff --git a/test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp b/test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp
index 4ebbfce289ea..2e99b525b443 100644
--- a/test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp
+++ b/test/CXX/expr/expr.unary/expr.new/p2-cxx0x.cpp
@@ -11,7 +11,7 @@ void f() {
only<double*> q = new (auto) (0.0);
new auto; // expected-error{{new expression for type 'auto' requires a constructor argument}}
- new (const auto)(); // expected-error{{new expression for type 'auto const' requires a constructor argument}}
+ new (const auto)(); // expected-error{{new expression for type 'const auto' requires a constructor argument}}
new (auto) (1,2,3); // expected-error{{new expression for type 'auto' contains multiple constructor arguments}}
}
diff --git a/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp b/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp
index 6a59e3d7ae52..aa76b3a73462 100644
--- a/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp
+++ b/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp
@@ -18,3 +18,31 @@ void test(A *a) {
x = sizeof(a->bitX = 3); // expected-error {{invalid application of 'sizeof' to bit-field}}
x = sizeof(a->bitY += 3); // expected-error {{invalid application of 'sizeof' to bit-field}}
}
+
+void test2() {
+ int x;
+ x = sizeof(void); // expected-error {{invalid application of 'sizeof' to an incomplete type 'void'}}
+ x = sizeof(int()); // expected-error {{invalid application of 'sizeof' to a function type}}
+ x = sizeof(test2()); // expected-error {{invalid application of 'sizeof' to an incomplete type 'void'}}
+ x = sizeof(test2); // expected-error {{invalid application of 'sizeof' to a function type}}
+}
+
+namespace pr16992 {
+
+template<typename T> struct ABC {
+ int func () {
+ return sizeof T; // expected-error {{expected parentheses around type name in sizeof expression}}
+ }
+};
+
+ABC<int> qq;
+
+template<typename T> struct ABC2 {
+ int func () {
+ return sizeof T::A;
+ }
+};
+
+struct QQ { int A; };
+ABC2<QQ> qq2;
+}
diff --git a/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp b/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp
index 1f5969d49327..427e8c5007f2 100644
--- a/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp
+++ b/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify -std=c++11 -fms-extensions %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify -std=c++11 -fms-extensions -Wno-delete-incomplete %s
// expected-no-diagnostics
#define P(e) static_assert(noexcept(e), "expected nothrow")
@@ -39,6 +39,9 @@ void (*pallspec)() throw(...);
void (*pintspec)() throw(int);
void (*pemptyspec)() throw();
+typedef void (*funcptr)();
+funcptr returnsptr() throw();
+
void callptr() {
N(pnospec());
N((*pnospec)());
@@ -48,6 +51,7 @@ void callptr() {
N((*pintspec)());
P(pemptyspec());
P((*pemptyspec)());
+ N(returnsptr()());
}
struct S1 {
@@ -91,6 +95,8 @@ struct S2 {
void *operator new(__typeof__(sizeof(int)) sz, int) throw();
+struct IncompleteStruct;
+
struct Bad1 {
~Bad1() throw(int);
};
@@ -104,6 +110,7 @@ void implicits() {
N(new int);
P(new (0) int);
P(delete (int*)0);
+ P(delete (IncompleteStruct*)0);
N(delete (Bad1*)0);
N(delete (Bad2*)0);
N(S2());
diff --git a/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp b/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp
index 06cc61074026..cd55cc2441a2 100644
--- a/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp
+++ b/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp
@@ -38,6 +38,8 @@ namespace test2 {
};
void A::test() {
- int (A::*ptr)(int) = &(A::foo); // expected-error {{can't form member pointer of type 'int (test2::A::*)(int)' without '&' and class name}}
+ // FIXME: The error message in this case is less than clear, we can do
+ // better.
+ int (A::*ptr)(int) = &(A::foo); // expected-error {{cannot create a non-constant pointer to member function}}
}
}
diff --git a/test/CXX/lex/lex.literal/lex.ext/p11.cpp b/test/CXX/lex/lex.literal/lex.ext/p11.cpp
new file mode 100644
index 000000000000..8b5fcf4b609b
--- /dev/null
+++ b/test/CXX/lex/lex.literal/lex.ext/p11.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
+
+using size_t = decltype(sizeof(int));
+
+template<typename T, typename U> struct same_type;
+template<typename T> struct same_type<T, T> {};
+template<typename T> using X = T;
+template<typename CharT, X<CharT>...>
+int operator "" _x(); // expected-warning {{string literal operator templates are a GNU extension}}
+template<char...>
+double operator "" _x();
+
+auto a="string"_x;
+auto b=42_x;
+same_type<decltype(a), int> test_a;
+same_type<decltype(b), double> test_b;
+
+char operator "" _x(const char *begin, size_t size);
+auto c="string"_x;
+auto d=L"string"_x;
+same_type<decltype(c), char> test_c;
+same_type<decltype(d), int> test_d;
diff --git a/test/CXX/lex/lex.literal/lex.ext/p12.cpp b/test/CXX/lex/lex.literal/lex.ext/p12.cpp
new file mode 100644
index 000000000000..dad468093984
--- /dev/null
+++ b/test/CXX/lex/lex.literal/lex.ext/p12.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -std=gnu++11 -verify %s
+
+template<typename T, T... cs> struct check; // expected-note {{template is declared here}} expected-note {{template is declared here}}
+template<>
+struct check<char, 34, -47, -126, -48, -75, -47, -127, -47, -126, 32, -16, -112, -128, -128>{};
+template<>
+struct check<char16_t, 34, 1090, 1077, 1089, 1090, 32, 55296, 56320>{};
+template<>
+struct check<char32_t, 34, 1090, 1077, 1089, 1090, 32, 65536>{};
+template<typename T, T... str> int operator""_x() { // #1 expected-warning {{string literal operator templates are a GNU extension}}
+ check<T, str...> chars; // expected-error {{implicit instantiation of undefined template 'check<char, 't', 'e', 's', 't'>'}} expected-error {{implicit instantiation of undefined template 'check<char32_t, 34, 1090, 1077, 1089, 1090, 95, 65536>'}}
+ return 1;
+}
+void *operator""_x(const char*); // #2
+void *a = 123_x; // ok, calls #2
+int b = u8"\"теÑÑ‚ ð€€"_x; // ok, calls #1
+int c = u8R"("теÑÑ‚ ð€€)"_x; // ok, calls #1
+int d = "test"_x; // expected-note {{in instantiation of function template specialization 'operator "" _x<char, 't', 'e', 's', 't'>' requested here}}
+int e = uR"("теÑÑ‚ ð€€)"_x;
+int f = UR"("теÑÑ‚ ð€€)"_x;
+int g = UR"("теÑÑ‚_ð€€)"_x; // expected-note {{in instantiation of function template specialization 'operator "" _x<char32_t, 34, 1090, 1077, 1089, 1090, 95, 65536>' requested here}}
diff --git a/test/CXX/lex/lex.literal/lex.ext/p3.cpp b/test/CXX/lex/lex.literal/lex.ext/p3.cpp
index 43f3468e96d3..e812ddddd8a4 100644
--- a/test/CXX/lex/lex.literal/lex.ext/p3.cpp
+++ b/test/CXX/lex/lex.literal/lex.ext/p3.cpp
@@ -9,7 +9,7 @@ int &i2 = 45_x1;
template<char...> char &operator "" _x1 ();
int &i3 = 0377_x1;
-int &i4 = 90000000000000000000000000000000000000000000000_x1; // expected-warning {{integer constant is too large}}
+int &i4 = 90000000000000000000000000000000000000000000000_x1; // expected-error {{integer constant is larger than the largest unsigned integer type}}
double &operator "" _x2 (const char *);
double &i5 = 123123123123123123123123123123123123123123123_x2;
diff --git a/test/CXX/lex/lex.literal/lex.ext/p5.cpp b/test/CXX/lex/lex.literal/lex.ext/p5.cpp
index 06c091d8acae..d364a37c6cf1 100644
--- a/test/CXX/lex/lex.literal/lex.ext/p5.cpp
+++ b/test/CXX/lex/lex.literal/lex.ext/p5.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -triple=x86_64-linux-gnu
using size_t = decltype(sizeof(int));
@@ -6,7 +6,7 @@ int &operator "" _x1 (const char *);
double &operator "" _x1 (const char *, size_t);
double &i1 = "foo"_x1;
double &i2 = u8"foo"_x1;
-double &i3 = L"foo"_x1; // expected-error {{no matching literal operator}}
+double &i3 = L"foo"_x1; // expected-error {{no matching literal operator for call to 'operator "" _x1' with arguments of types 'const wchar_t *' and 'unsigned long'}}
char &operator "" _x1(const wchar_t *, size_t);
char &i4 = L"foo"_x1; // ok
diff --git a/test/CXX/lex/lex.literal/lex.ext/p7.cpp b/test/CXX/lex/lex.literal/lex.ext/p7.cpp
index 79c9394a96ba..be97f0cb922f 100644
--- a/test/CXX/lex/lex.literal/lex.ext/p7.cpp
+++ b/test/CXX/lex/lex.literal/lex.ext/p7.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -triple=x86_64-linux-gnu
using size_t = decltype(sizeof(int));
namespace std {
@@ -17,7 +17,7 @@ int main() {
auto v1 = 1.2_w; // calls operator "" _w(1.2L)
auto v2 = u"one"_w; // calls operator "" _w(u"one", 3)
auto v3 = 12_w; // calls operator "" _w("12")
- "two"_w; // expected-error {{no matching literal operator}}
+ "two"_w; // expected-error {{no matching literal operator for call to 'operator "" _w' with arguments of types 'const char *' and 'unsigned long'}}
same_type<decltype(v1), long double> test1;
same_type<decltype(v2), std::string> test2;
diff --git a/test/CXX/over/over.over/p2-resolve-single-template-id.cpp b/test/CXX/over/over.over/p2-resolve-single-template-id.cpp
index e0217112d91b..b1c819a93b42 100644
--- a/test/CXX/over/over.over/p2-resolve-single-template-id.cpp
+++ b/test/CXX/over/over.over/p2-resolve-single-template-id.cpp
@@ -125,7 +125,7 @@ int main()
namespace member_pointers {
struct S {
- template <typename T> bool f(T) { return false; }
+ template <typename T> bool f(T) { return false; } // expected-note 4 {{possible target for call}}
template <typename T> static bool g(T) { return false; }
template <typename T> bool h(T) { return false; } // expected-note 3 {{possible target for call}}
diff --git a/test/CXX/over/over.over/p2.cpp b/test/CXX/over/over.over/p2.cpp
index 3e8d0f1d8cdd..d03b84a2d15b 100644
--- a/test/CXX/over/over.over/p2.cpp
+++ b/test/CXX/over/over.over/p2.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-template<typename T> T f0(T, T); //expected-note{{candidate}}
+template <typename T>
+T f0(T, T); // expected-note{{deduced conflicting types for parameter 'T' ('int' vs. 'float')}}
void test_f0() {
int (*f0a)(int, int) = f0;
diff --git a/test/CXX/special/class.copy/implicit-move-def.cpp b/test/CXX/special/class.copy/implicit-move-def.cpp
index 5c54aea12443..5696d1f57982 100644
--- a/test/CXX/special/class.copy/implicit-move-def.cpp
+++ b/test/CXX/special/class.copy/implicit-move-def.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-ASSIGN %s
+// FIXME: %clang_cc1 -emit-llvm -o - -std=c++11 %s | FileCheck -check-prefix=CHECK %s
// RUN: %clang_cc1 -emit-llvm -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-ASSIGN %s
// RUN: %clang_cc1 -emit-llvm -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-CTOR %s
diff --git a/test/CXX/special/class.copy/implicit-move.cpp b/test/CXX/special/class.copy/implicit-move.cpp
index 33374129f718..23ecf2e7d95a 100644
--- a/test/CXX/special/class.copy/implicit-move.cpp
+++ b/test/CXX/special/class.copy/implicit-move.cpp
@@ -190,49 +190,114 @@ namespace DR1402 {
NonTrivialMoveAssignVBase &operator=(NonTrivialMoveAssignVBase &&) = default;
};
- // A non-movable, non-trivially-copyable class type as a subobject inhibits
- // the declaration of a move operation.
- struct NoMove1 { NonTrivialCopyCtor ntcc; }; // expected-note 2{{'const DR1402::NoMove1 &'}}
- struct NoMove2 { NonTrivialCopyAssign ntcc; }; // expected-note 2{{'const DR1402::NoMove2 &'}}
- struct NoMove3 : NonTrivialCopyCtor {}; // expected-note 2{{'const DR1402::NoMove3 &'}}
- struct NoMove4 : NonTrivialCopyAssign {}; // expected-note 2{{'const DR1402::NoMove4 &'}}
- struct NoMove5 : virtual NonTrivialCopyCtor {}; // expected-note 2{{'const DR1402::NoMove5 &'}}
- struct NoMove6 : virtual NonTrivialCopyAssign {}; // expected-note 2{{'const DR1402::NoMove6 &'}}
- struct NoMove7 : NonTrivialCopyCtorVBase {}; // expected-note 2{{'const DR1402::NoMove7 &'}}
- struct NoMove8 : NonTrivialCopyAssignVBase {}; // expected-note 2{{'const DR1402::NoMove8 &'}}
-
- // A non-trivially-move-assignable virtual base class inhibits the declaration
- // of a move assignment (which might move-assign the base class multiple
- // times).
+ // DR1402: A non-movable, non-trivially-copyable class type as a subobject no
+ // longer inhibits the declaration of a move operation.
+ struct NoMove1 { NonTrivialCopyCtor ntcc; };
+ struct NoMove2 { NonTrivialCopyAssign ntcc; };
+ struct NoMove3 : NonTrivialCopyCtor {};
+ struct NoMove4 : NonTrivialCopyAssign {};
+ struct NoMove5 : virtual NonTrivialCopyCtor {};
+ struct NoMove6 : virtual NonTrivialCopyAssign {};
+ struct NoMove7 : NonTrivialCopyCtorVBase {};
+ struct NoMove8 : NonTrivialCopyAssignVBase {};
+
+ // DR1402: A non-trivially-move-assignable virtual base class no longer
+ // inhibits the declaration of a move assignment (even though it might
+ // move-assign the base class multiple times).
struct NoMove9 : NonTrivialMoveAssign {};
- struct NoMove10 : virtual NonTrivialMoveAssign {}; // expected-note {{'const DR1402::NoMove10 &'}}
- struct NoMove11 : NonTrivialMoveAssignVBase {}; // expected-note {{'const DR1402::NoMove11 &'}}
-
- struct Test {
- friend NoMove1::NoMove1(NoMove1 &&); // expected-error {{no matching function}}
- friend NoMove2::NoMove2(NoMove2 &&); // expected-error {{no matching function}}
- friend NoMove3::NoMove3(NoMove3 &&); // expected-error {{no matching function}}
- friend NoMove4::NoMove4(NoMove4 &&); // expected-error {{no matching function}}
- friend NoMove5::NoMove5(NoMove5 &&); // expected-error {{no matching function}}
- friend NoMove6::NoMove6(NoMove6 &&); // expected-error {{no matching function}}
- friend NoMove7::NoMove7(NoMove7 &&); // expected-error {{no matching function}}
- friend NoMove8::NoMove8(NoMove8 &&); // expected-error {{no matching function}}
- friend NoMove9::NoMove9(NoMove9 &&);
- friend NoMove10::NoMove10(NoMove10 &&);
- friend NoMove11::NoMove11(NoMove11 &&);
-
- friend NoMove1 &NoMove1::operator=(NoMove1 &&); // expected-error {{no matching function}}
- friend NoMove2 &NoMove2::operator=(NoMove2 &&); // expected-error {{no matching function}}
- friend NoMove3 &NoMove3::operator=(NoMove3 &&); // expected-error {{no matching function}}
- friend NoMove4 &NoMove4::operator=(NoMove4 &&); // expected-error {{no matching function}}
- friend NoMove5 &NoMove5::operator=(NoMove5 &&); // expected-error {{no matching function}}
- friend NoMove6 &NoMove6::operator=(NoMove6 &&); // expected-error {{no matching function}}
- friend NoMove7 &NoMove7::operator=(NoMove7 &&); // expected-error {{no matching function}}
- friend NoMove8 &NoMove8::operator=(NoMove8 &&); // expected-error {{no matching function}}
- friend NoMove9 &NoMove9::operator=(NoMove9 &&);
- friend NoMove10 &NoMove10::operator=(NoMove10 &&); // expected-error {{no matching function}}
- friend NoMove11 &NoMove11::operator=(NoMove11 &&); // expected-error {{no matching function}}
+ struct NoMove10 : virtual NonTrivialMoveAssign {};
+ struct NoMove11 : NonTrivialMoveAssignVBase {};
+
+ template<typename T> void test(T t) {
+ (void)T(static_cast<T&&>(t)); // ok
+ t = static_cast<T&&>(t); // ok
+ }
+ template void test(NoMove1);
+ template void test(NoMove2);
+ template void test(NoMove3);
+ template void test(NoMove4);
+ template void test(NoMove5);
+ template void test(NoMove6);
+ template void test(NoMove7);
+ template void test(NoMove8);
+ template void test(NoMove9);
+ template void test(NoMove10);
+ template void test(NoMove11);
+
+ struct CopyOnly {
+ CopyOnly(const CopyOnly&);
+ CopyOnly &operator=(const CopyOnly&);
};
+ struct MoveOnly {
+ MoveOnly(MoveOnly&&); // expected-note {{user-declared move}}
+ MoveOnly &operator=(MoveOnly&&);
+ };
+ template void test(CopyOnly); // ok, copies
+ template void test(MoveOnly); // ok, moves
+ struct CopyAndMove { // expected-note {{implicitly deleted}}
+ CopyOnly co;
+ MoveOnly mo; // expected-note {{deleted copy}}
+ };
+ template void test(CopyAndMove); // ok, copies co, moves mo
+ void test2(CopyAndMove cm) {
+ (void)CopyAndMove(cm); // expected-error {{deleted}}
+ cm = cm; // expected-error {{deleted}}
+ }
+
+ namespace VbaseMove {
+ struct A {};
+ struct B { B &operator=(B&&); };
+ struct C { C &operator=(const C&); };
+ struct D { B b; };
+
+ template<typename T, unsigned I, bool NonTrivialMove = false>
+ struct E : virtual T {};
+
+ template<typename T, unsigned I>
+ struct E<T, I, true> : virtual T { E &operator=(E&&); };
+
+ template<typename T>
+ struct F :
+ E<T, 0>, // expected-note-re 2{{'[BD]' is a virtual base class of base class 'E<}}
+ E<T, 1> {}; // expected-note-re 2{{'[BD]' is a virtual base class of base class 'E<}}
+
+ template<typename T>
+ struct G : E<T, 0, true>, E<T, 0> {};
+
+ template<typename T>
+ struct H : E<T, 0, true>, E<T, 1, true> {};
+
+ template<typename T>
+ struct I : E<T, 0>, T {};
+
+ template<typename T>
+ struct J :
+ E<T, 0>, // expected-note-re 2{{'[BD]' is a virtual base class of base class 'E<}}
+ virtual T {}; // expected-note-re 2{{virtual base class '[BD]' declared here}}
+
+ template<typename T> void move(T t) { t = static_cast<T&&>(t); }
+ // expected-warning-re@-1 4{{defaulted move assignment operator of .* will move assign virtual base class '[BD]' multiple times}}
+ template void move(F<A>);
+ template void move(F<B>); // expected-note {{in instantiation of}}
+ template void move(F<C>);
+ template void move(F<D>); // expected-note {{in instantiation of}}
+ template void move(G<A>);
+ template void move(G<B>);
+ template void move(G<C>);
+ template void move(G<D>);
+ template void move(H<A>);
+ template void move(H<B>);
+ template void move(H<C>);
+ template void move(H<D>);
+ template void move(I<A>);
+ template void move(I<B>);
+ template void move(I<C>);
+ template void move(I<D>);
+ template void move(J<A>);
+ template void move(J<B>); // expected-note {{in instantiation of}}
+ template void move(J<C>);
+ template void move(J<D>); // expected-note {{in instantiation of}}
+ }
}
namespace PR12625 {
diff --git a/test/CXX/special/class.copy/p11.0x.copy.cpp b/test/CXX/special/class.copy/p11.0x.copy.cpp
index fab3b9dd7bf1..a334c50e9fda 100644
--- a/test/CXX/special/class.copy/p11.0x.copy.cpp
+++ b/test/CXX/special/class.copy/p11.0x.copy.cpp
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+struct Trivial {};
struct NonTrivial {
NonTrivial(const NonTrivial&);
};
@@ -69,6 +70,12 @@ struct Deleted {
Deleted Da;
Deleted Db(Da); // expected-error{{call to implicitly-deleted copy constructor}}
+// It's implied (but not stated) that this also applies in the case where
+// overload resolution would fail.
+struct VolatileMember {
+ volatile Trivial vm; // expected-note {{has no copy}}
+} vm1, vm2(vm1); // expected-error {{deleted}}
+
// -- a direct or virtual base class B that cannot be copied because overload
// resolution results in an ambiguity or a function that is deleted or
// inaccessible
@@ -116,6 +123,7 @@ HasNoAccessDtorBase HNADBb(HNADBa); // expected-error{{implicitly-deleted copy c
// -- a non-static data member of rvalue reference type
struct RValue {
int && ri = 1; // expected-note{{copy constructor of 'RValue' is implicitly deleted because field 'ri' is of rvalue reference type 'int &&'}}
+ // expected-warning@-1{{binding reference member 'ri' to a temporary}} expected-note@-1 {{here}}
};
RValue RVa;
RValue RVb(RVa); // expected-error{{call to implicitly-deleted copy constructor}}
diff --git a/test/CXX/special/class.copy/p11.0x.move.cpp b/test/CXX/special/class.copy/p11.0x.move.cpp
index ff9478be8b49..1dce27a83290 100644
--- a/test/CXX/special/class.copy/p11.0x.move.cpp
+++ b/test/CXX/special/class.copy/p11.0x.move.cpp
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+struct Trivial {};
struct NonTrivial {
NonTrivial(NonTrivial&&);
};
@@ -61,6 +62,24 @@ struct Deleted {
};
Deleted::Deleted(Deleted&&) = default; // expected-error{{would delete}}
+// It's implied (but not stated) that this should also happen if overload
+// resolution fails.
+struct ConstMember {
+ const Trivial ct;
+ ConstMember(ConstMember&&);
+};
+ConstMember::ConstMember(ConstMember&&) = default; // ok, calls copy ctor
+struct ConstMoveOnlyMember {
+ const NonTrivial cnt;
+ ConstMoveOnlyMember(ConstMoveOnlyMember&&);
+};
+ConstMoveOnlyMember::ConstMoveOnlyMember(ConstMoveOnlyMember&&) = default; // expected-error{{would delete}}
+struct VolatileMember {
+ volatile Trivial vt;
+ VolatileMember(VolatileMember&&);
+};
+VolatileMember::VolatileMember(VolatileMember&&) = default; // expected-error{{would delete}}
+
// -- a direct or virtual base class B that cannot be moved because overload
// resolution results in an ambiguity or a function that is deleted or
// inaccessible
@@ -108,7 +127,7 @@ HasNoAccessDtorBase HNADBb(HNADBa); // expected-error{{implicitly-deleted copy c
// The restriction on rvalue reference members applies to only the copy
// constructor.
struct RValue {
- int &&ri = 1;
+ int &&ri = 1; // expected-warning {{binding reference member 'ri' to a temporary}} expected-note {{here}}
RValue(RValue&&);
};
RValue::RValue(RValue&&) = default;
diff --git a/test/CXX/special/class.copy/p12-0x.cpp b/test/CXX/special/class.copy/p12-0x.cpp
index 17b3191d1dc5..1b23b5a4b179 100644
--- a/test/CXX/special/class.copy/p12-0x.cpp
+++ b/test/CXX/special/class.copy/p12-0x.cpp
@@ -157,8 +157,8 @@ namespace TrivialityDependsOnImplicitDeletion {
struct NoAccess {
PrivateMove pm;
- // NoAccess's move would be deleted, so is suppressed,
- // so moves of it use PrivateMove's copy ctor, which is trivial.
+ // NoAccess's move is deleted, so moves of it use PrivateMove's copy ctor,
+ // which is trivial.
};
static_assert(__is_trivially_constructible(NoAccess, const NoAccess &), "");
static_assert(__is_trivially_constructible(NoAccess, NoAccess &&), "");
diff --git a/test/CXX/special/class.copy/p23-cxx11.cpp b/test/CXX/special/class.copy/p23-cxx11.cpp
index 90945c5803a1..de071f050f01 100644
--- a/test/CXX/special/class.copy/p23-cxx11.cpp
+++ b/test/CXX/special/class.copy/p23-cxx11.cpp
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -verify %s -std=c++11
+struct Trivial {};
+
template<typename T> struct CopyAssign {
static T t;
void test() {
@@ -9,7 +11,15 @@ template<typename T> struct CopyAssign {
template<typename T> struct MoveAssign {
static T t;
void test() {
- t = static_cast<T&&>(t); // expected-error +{{deleted}}
+ // Overload resolution will ignore a defaulted, deleted move assignment,
+ // so check for it in a different way.
+ T &(T::*f)(T&&) = &T::operator=; // expected-error +{{deleted}}
+ }
+};
+template<typename T> struct MoveOrCopyAssign {
+ static T t;
+ void test() {
+ t = static_cast<T&&>(t); // expected-error +{{copy assignment operator is implicitly deleted}}
}
};
@@ -39,6 +49,9 @@ class InaccessibleCopyAssign {
class InaccessibleMoveAssign {
InaccessibleMoveAssign &operator=(InaccessibleMoveAssign &&);
};
+class NonConstCopyAssign {
+ NonConstCopyAssign &operator=(NonConstCopyAssign &);
+};
// A defaulted copy/move assignment operator for class X is defined as deleted
// if X has:
@@ -89,29 +102,44 @@ struct D1 {
AmbiguousCopyAssign a; // expected-note {{field 'a' has multiple copy}}
};
struct D2 {
- D2 &operator=(D2 &&) = default; // expected-note {{here}}
+ D2 &operator=(D2 &&) = default; // expected-note {{here}} expected-note {{copy assignment operator is implicitly deleted}}
AmbiguousMoveAssign a; // expected-note {{field 'a' has multiple move}}
};
struct D3 {
DeletedCopyAssign a; // expected-note {{field 'a' has a deleted copy}}
};
struct D4 {
- D4 &operator=(D4 &&) = default; // expected-note {{here}}
+ D4 &operator=(D4 &&) = default; // expected-note {{here}} expected-note {{copy assignment operator is implicitly deleted}}
DeletedMoveAssign a; // expected-note {{field 'a' has a deleted move}}
};
struct D5 {
InaccessibleCopyAssign a; // expected-note {{field 'a' has an inaccessible copy}}
};
struct D6 {
- D6 &operator=(D6 &&) = default; // expected-note {{here}}
+ D6 &operator=(D6 &&) = default; // expected-note {{here}} expected-note {{copy assignment operator is implicitly deleted}}
InaccessibleMoveAssign a; // expected-note {{field 'a' has an inaccessible move}}
};
+struct D7 {
+ const Trivial a; // expected-note 3{{field 'a' has no }}
+};
+struct D8 {
+ volatile Trivial a; // expected-note 3{{field 'a' has no }}
+};
template struct CopyAssign<D1>; // expected-note {{here}}
template struct MoveAssign<D2>; // expected-note {{here}}
+template struct MoveOrCopyAssign<D2>; // expected-note {{here}}
template struct CopyAssign<D3>; // expected-note {{here}}
template struct MoveAssign<D4>; // expected-note {{here}}
+template struct MoveOrCopyAssign<D4>; // expected-note {{here}}
template struct CopyAssign<D5>; // expected-note {{here}}
template struct MoveAssign<D6>; // expected-note {{here}}
+template struct MoveOrCopyAssign<D6>; // expected-note {{here}}
+template struct CopyAssign<D7>; // expected-note {{here}}
+template struct MoveAssign<D7>; // expected-note {{here}}
+template struct MoveOrCopyAssign<D7>; // expected-note {{here}}
+template struct CopyAssign<D8>; // expected-note {{here}}
+template struct MoveAssign<D8>; // expected-note {{here}}
+template struct MoveOrCopyAssign<D8>; // expected-note {{here}}
// -- a direct or virtual base that cannot be copied/moved
struct E1 : AmbiguousCopyAssign {}; // expected-note {{base class 'AmbiguousCopyAssign' has multiple copy}}
@@ -136,7 +164,7 @@ template struct MoveAssign<E6>; // expected-note {{here}}
namespace PR13381 {
struct S {
S &operator=(const S&);
- S &operator=(const volatile S&) = delete; // expected-note{{deleted here}}
+ S &operator=(const volatile S&) volatile = delete; // expected-note{{deleted here}}
};
struct T {
volatile S s; // expected-note{{field 's' has a deleted copy assignment}}
diff --git a/test/CXX/special/class.ctor/p5-0x.cpp b/test/CXX/special/class.ctor/p5-0x.cpp
index 0f4add8c9742..2360345a4846 100644
--- a/test/CXX/special/class.ctor/p5-0x.cpp
+++ b/test/CXX/special/class.ctor/p5-0x.cpp
@@ -43,7 +43,7 @@ class NotDeleted2a { int &a = n; };
NotDeleted2a nd2a;
class NotDeleted2b { int &a = error; }; // expected-error {{undeclared identifier}}
NotDeleted2b nd2b;
-class NotDeleted2c { int &&a = 0; };
+class NotDeleted2c { int &&a = 0; }; // expected-warning {{binding reference member 'a' to a temporary}} expected-note {{here}}
NotDeleted2c nd2c;
// - any non-variant non-static data member of const qualified type (or array
diff --git a/test/CXX/special/class.inhctor/p1.cpp b/test/CXX/special/class.inhctor/p1.cpp
index 8721dec1b405..fa0416e11765 100644
--- a/test/CXX/special/class.inhctor/p1.cpp
+++ b/test/CXX/special/class.inhctor/p1.cpp
@@ -2,31 +2,30 @@
// Per a core issue (no number yet), an ellipsis is always dropped.
struct A {
A(...); // expected-note {{here}}
- A(int = 0, int = 0, int = 0, int = 0, ...); // expected-note 9{{here}}
+ A(int = 0, int = 0, int = 0, int = 0, ...); // expected-note 9{{here}} expected-note 2{{constructor cannot be inherited}}
A(int = 0, int = 0, ...); // expected-note {{here}}
template<typename T> A(T, int = 0, ...); // expected-note 5{{here}}
- template<typename T, int N> A(const T (&)[N]); // expected-note 2{{here}}
+ template<typename T, int N> A(const T (&)[N]); // expected-note 2{{here}} expected-note {{constructor cannot be inherited}}
template<typename T, int N> A(const T (&)[N], int = 0); // expected-note 2{{here}}
};
struct B : A { // expected-note 6{{candidate}}
- using A::A; // expected-warning 4{{inheriting constructor does not inherit ellipsis}} expected-note 16{{candidate}} expected-note 3{{deleted}}
+ using A::A; // expected-warning 4{{inheriting constructor does not inherit ellipsis}} expected-note 16{{candidate}} expected-note 3{{deleted constructor was inherited here}}
};
struct C {} c;
B b0{};
-// expected-error@-1 {{call to implicitly-deleted default constructor}}
+// expected-error@-1 {{call to implicitly-deleted default constructor of 'B'}}
// expected-note@-8 {{default constructor of 'B' is implicitly deleted because base class 'A' has multiple default constructors}}
B b1{1};
-// FIXME: explain why the inheriting constructor was deleted
-// expected-error@-2 {{call to implicitly-deleted function of 'B'}}
+// expected-error@-1 {{call to deleted constructor of 'B'}}
B b2{1,2};
-// expected-error@-1 {{call to implicitly-deleted function of 'B'}}
+// expected-error@-1 {{call to deleted constructor of 'B'}}
B b3{1,2,3};
// ok
diff --git a/test/CXX/special/class.inhctor/p4.cpp b/test/CXX/special/class.inhctor/p4.cpp
index 512705e4dd94..356cdef687fb 100644
--- a/test/CXX/special/class.inhctor/p4.cpp
+++ b/test/CXX/special/class.inhctor/p4.cpp
@@ -43,13 +43,13 @@ FA fa2{X<2>{}}; // expected-error {{calling a private constructor}}
// It is deleted if the corresponding constructor [...] is deleted.
struct G {
- G(int) = delete;
- template<typename T> G(T*) = delete;
+ G(int) = delete; // expected-note {{function has been explicitly marked deleted here}}
+ template<typename T> G(T*) = delete; // expected-note {{function has been explicitly marked deleted here}}
};
struct H : G {
- using G::G; // expected-note 2{{marked deleted here}}
+ using G::G; // expected-note 2{{deleted constructor was inherited here}}
};
-H h1(5); // expected-error {{call to implicitly-deleted function of 'H'}}
+H h1(5); // expected-error {{call to deleted constructor of 'H'}}
H h2("foo"); // expected-error {{call to deleted constructor of 'H'}}
@@ -58,15 +58,14 @@ H h2("foo"); // expected-error {{call to deleted constructor of 'H'}}
namespace DRnnnn {
struct A {
constexpr A(int, float = 0) {}
- explicit A(int, int = 0) {}
+ explicit A(int, int = 0) {} // expected-note {{constructor cannot be inherited}}
A(int, int, int = 0) = delete;
};
struct B : A {
- // FIXME: produce notes indicating why it was deleted
using A::A; // expected-note {{here}}
};
constexpr B b0(0, 0.0f); // ok, constexpr
- B b1(0, 1); // expected-error {{call to implicitly-deleted}}
+ B b1(0, 1); // expected-error {{call to deleted constructor of 'DRnnnn::B'}}
}
diff --git a/test/CXX/special/class.inhctor/p8.cpp b/test/CXX/special/class.inhctor/p8.cpp
index 0c857382e38c..effc2c3bca24 100644
--- a/test/CXX/special/class.inhctor/p8.cpp
+++ b/test/CXX/special/class.inhctor/p8.cpp
@@ -1,6 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -verify %s
-// expected-no-diagnostics
struct A {
constexpr A(const int&) : rval(false) {}
constexpr A(const int&&) : rval(true) {}
@@ -28,3 +27,6 @@ struct D : C {
using C::C;
};
static_assert(D(123).v == 123, "");
+
+// FIXME: This diagnostic sucks.
+template<typename T> constexpr D::D(T t) : C(t) {} // expected-error {{definition of implicitly declared function}}
diff --git a/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp b/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
index b159a15b8d40..c23cd28f3137 100644
--- a/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
+++ b/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
@@ -117,7 +117,7 @@ void g() {
for (extern int a : A()) {} // expected-error {{loop variable 'a' may not be declared 'extern'}}
for (static int a : A()) {} // expected-error {{loop variable 'a' may not be declared 'static'}}
- for (register int a : A()) {} // expected-error {{loop variable 'a' may not be declared 'register'}}
+ for (register int a : A()) {} // expected-error {{loop variable 'a' may not be declared 'register'}} expected-warning {{deprecated}}
for (constexpr int a : A()) {} // expected-error {{loop variable 'a' may not be declared 'constexpr'}}
for (auto u : X::NoBeginADL()) { // expected-error {{invalid range expression of type 'X::NoBeginADL'; no viable 'begin' function available}}
diff --git a/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp b/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
index c4db0027052c..3f70ca7c81ab 100644
--- a/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
+++ b/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
@@ -27,7 +27,7 @@ namespace non_type_tmpl_param {
// omitted if the name refers to a function or array and shall be omitted
// if the corresopnding template-parameter is a reference; or
namespace addr_of_obj_or_func {
- template <int* p> struct X0 { }; // expected-note 4{{here}}
+ template <int* p> struct X0 { }; // expected-note 5{{here}}
template <int (*fp)(int)> struct X1 { };
template <int &p> struct X2 { }; // expected-note 4{{here}}
template <const int &p> struct X2k { }; // expected-note {{here}}
@@ -40,6 +40,7 @@ namespace addr_of_obj_or_func {
__thread int ti = 100; // expected-note 2{{here}}
static int f_internal(int); // expected-note 4{{here}}
template <typename T> T f_tmpl(T t);
+ struct S { union { int NonStaticMember; }; };
void test() {
X0<i> x0a; // expected-error {{must have its address taken}}
@@ -78,6 +79,7 @@ namespace addr_of_obj_or_func {
X0<&n> x0_no_linkage; // expected-error {{non-type template argument refers to object 'n' that does not have linkage}}
struct Local { static int f() {} }; // expected-note {{here}}
X1<&Local::f> x1_no_linkage; // expected-error {{non-type template argument refers to function 'f' that does not have linkage}}
+ X0<&S::NonStaticMember> x0_non_static; // expected-error {{non-static data member}}
}
}
diff --git a/test/CXX/temp/temp.decls/temp.alias/p3.cpp b/test/CXX/temp/temp.decls/temp.alias/p3.cpp
index afd9b4b0de30..2d46502e1d9b 100644
--- a/test/CXX/temp/temp.decls/temp.alias/p3.cpp
+++ b/test/CXX/temp/temp.decls/temp.alias/p3.cpp
@@ -9,5 +9,9 @@ template<class T> struct A {
B<short> b;
template<typename T> using U = int;
+
+template<typename ...T> void f(U<T> ...xs);
+void g() { f<void,void,void>(1, 2, 3); }
+
// FIXME: This is illegal, but probably only because CWG1044 missed this paragraph.
template<typename T> using U = U<T>;
diff --git a/test/CXX/temp/temp.decls/temp.class.spec/p8-1y.cpp b/test/CXX/temp/temp.decls/temp.class.spec/p8-1y.cpp
new file mode 100644
index 000000000000..a49db5166a45
--- /dev/null
+++ b/test/CXX/temp/temp.decls/temp.class.spec/p8-1y.cpp
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 -std=c++1y -fsyntax-only -verify %s
+
+// -- The argument list of the specialization shall not be identical
+// to the implicit argument list of the primary template.
+
+template<typename T, int N, template<typename> class X> int v1;
+template<typename T, int N, template<typename> class X> int v1<T, N, X>;
+// expected-error@-1{{variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
+
+template<typename...T> int v2;
+template<typename...T> int v2<T...>;
+// expected-error@-1{{variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
+
+template<int...N> int v3;
+template<int...N> int v3<N...>;
+// expected-error@-1{{variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
+
+template<template<typename> class...X> int v4;
+template<template<typename> class...X> int v4<X...>;
+// expected-error@-1{{variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
+
+template<typename Outer> struct X {
+ template<typename Inner> static int y;
+ template<typename Inner> static int y<Outer>; // expected-warning {{can not be deduced}} expected-note {{'Inner'}}
+ template<typename Inner> static int y<Inner>; // expected-error {{does not specialize}}
+};
+template<typename Outer> template<typename Inner> int X<Outer>::y<Outer>; // expected-warning {{can not be deduced}} expected-note {{'Inner'}}
+template<typename Outer> template<typename Inner> int X<Outer>::y<Inner>; // expected-error {{does not specialize}}
+
+// FIXME: Merging this with the above class causes an assertion failure when
+// instantiating one of the bogus partial specializations.
+template<typename Outer> struct Y {
+ template<typename Inner> static int y;
+};
+template<> template<typename Inner> int Y<int>::y<Inner>; // expected-error {{does not specialize}}
diff --git a/test/CXX/temp/temp.decls/temp.class/temp.mem.enum/p1.cpp b/test/CXX/temp/temp.decls/temp.class/temp.mem.enum/p1.cpp
index f8cc00947480..2884be146c7c 100644
--- a/test/CXX/temp/temp.decls/temp.class/temp.mem.enum/p1.cpp
+++ b/test/CXX/temp/temp.decls/temp.class/temp.mem.enum/p1.cpp
@@ -12,7 +12,7 @@ A<int> a;
A<int>::E a0 = A<int>().v;
int n = A<int>::E::e1; // expected-error {{implicit instantiation of undefined member}}
-template<typename T> enum A<T>::E : T { e1, e2 };
+template<typename T> enum A<T>::E : T { e1, e2 }; // expected-note 2 {{declared here}}
// FIXME: Now that A<T>::E is defined, we are supposed to inject its enumerators
// into the already-instantiated class A<T>. This seems like a really bad idea,
@@ -20,7 +20,7 @@ template<typename T> enum A<T>::E : T { e1, e2 };
//
// Either do as the standard says, or only include enumerators lexically defined
// within the class in its scope.
-A<int>::E a1 = A<int>::e1; // expected-error {{no member named 'e1' in 'A<int>'}}
+A<int>::E a1 = A<int>::e1; // expected-error {{no member named 'e1' in 'A<int>'; did you mean simply 'e1'?}}
A<char>::E a2 = A<char>::e2;
@@ -94,7 +94,7 @@ D<int>::E d1 = D<int>::E::e1; // expected-error {{incomplete type 'D<int>::E'}}
template<> enum class D<int>::E { e2 };
D<int>::E d2 = D<int>::E::e2;
D<char>::E d3 = D<char>::E::e1; // expected-note {{first required here}}
-D<char>::E d4 = D<char>::E::e2; // expected-error {{no member named 'e2'}}
+D<char>::E d4 = D<char>::E::e2; // expected-error {{no member named 'e2' in 'D<char>::E'; did you mean simply 'e2'?}}
template<> enum class D<char>::E { e3 }; // expected-error {{explicit specialization of 'E' after instantiation}}
template<> enum class D<short>::E;
diff --git a/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp b/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp
index 2eae1125c0db..8a3168e5f806 100644
--- a/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp
+++ b/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp
@@ -23,4 +23,4 @@ X2& get_X2() {
return X0<X2>::value; // expected-note{{instantiation}}
}
-template<typename T> T x; // expected-error{{variable 'x' declared as a template}}
+template<typename T> T x; // expected-warning{{variable templates are a C++1y extension}}
diff --git a/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp b/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp
index 6d22f8809365..60c60cb0b28d 100644
--- a/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp
+++ b/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp
@@ -43,3 +43,10 @@ namespace OrderWithStaticMember {
a.g(p);
}
}
+
+namespace PR17075 {
+ template <typename T> struct V {};
+ struct S { template<typename T> S &operator>>(T &t) = delete; };
+ template<typename T> S &operator>>(S &s, V<T> &v);
+ void f(S s, V<int> v) { s >> v; }
+}
diff --git a/test/CXX/temp/temp.decls/temp.friend/p4.cpp b/test/CXX/temp/temp.decls/temp.friend/p4.cpp
index e036cef32b28..8571a141201b 100644
--- a/test/CXX/temp/temp.decls/temp.friend/p4.cpp
+++ b/test/CXX/temp/temp.decls/temp.friend/p4.cpp
@@ -26,3 +26,20 @@ void g() {
X2<float> xf;
f(xf);
}
+
+template<typename T>
+struct X3 {
+ operator int();
+
+ friend void h(int x);
+};
+
+int array2[sizeof(X3<int>)];
+int array3[sizeof(X3<float>)];
+
+void i() {
+ X3<int> xi;
+ h(xi);
+ X3<float> xf;
+ h(xf);
+}
diff --git a/test/CXX/temp/temp.decls/temp.friend/p5.cpp b/test/CXX/temp/temp.decls/temp.friend/p5.cpp
index 4b899e4e5211..b26abb64f838 100644
--- a/test/CXX/temp/temp.decls/temp.friend/p5.cpp
+++ b/test/CXX/temp/temp.decls/temp.friend/p5.cpp
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// expected-no-diagnostics
namespace test0 {
template <class T> class A {
@@ -7,7 +6,8 @@ namespace test0 {
};
class B {
- template <class T> friend class A<T>::Member;
+ template <class T> friend class A<T>::Member; // expected-warning {{not supported}}
+ int n;
};
A<int> a;
@@ -68,7 +68,7 @@ namespace test3 {
template <class U> class C {
int i;
- template <class T> friend struct A<T>::Inner;
+ template <class T> friend struct A<T>::Inner; // expected-warning {{not supported}}
};
template <class T> int A<T>::Inner::foo() {
@@ -96,7 +96,7 @@ namespace test4 {
namespace test5 {
template<template <class> class T> struct A {
- template<template <class> class T> friend void A<T>::foo();
+ template<template <class> class U> friend void A<U>::foo();
};
template <class> struct B {};
diff --git a/test/CXX/temp/temp.decls/temp.mem/p2.cpp b/test/CXX/temp/temp.decls/temp.mem/p2.cpp
new file mode 100644
index 000000000000..c24d5a9b50de
--- /dev/null
+++ b/test/CXX/temp/temp.decls/temp.mem/p2.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+template <typename>
+void quux();
+
+void fun() {
+ struct foo {
+ template <typename> struct bar {}; // expected-error{{templates cannot be declared inside of a local class}}
+ template <typename> void baz() {} // expected-error{{templates cannot be declared inside of a local class}}
+ template <typename> void qux(); // expected-error{{templates cannot be declared inside of a local class}}
+ };
+}
diff --git a/test/CXX/temp/temp.decls/temp.variadic/p2.cpp b/test/CXX/temp/temp.decls/temp.variadic/p2.cpp
index ce19582c2282..e7a62366a9be 100644
--- a/test/CXX/temp/temp.decls/temp.variadic/p2.cpp
+++ b/test/CXX/temp/temp.decls/temp.variadic/p2.cpp
@@ -12,7 +12,7 @@ void test() {
template<typename Head, typename ...Tail>
void recurse_until_fail(const Head &, const Tail &...tail) { // expected-note{{candidate function template not viable: requires at least 1 argument, but 0 were provided}}
recurse_until_fail(tail...); // expected-error{{no matching function for call to 'recurse_until_fail'}} \
- // expected-note{{in instantiation of function template specialization 'recurse_until_fail<char [7], >' requested here}} \
+ // expected-note{{in instantiation of function template specialization 'recurse_until_fail<char [7]>' requested here}} \
// expected-note{{in instantiation of function template specialization 'recurse_until_fail<double, char [7]>' requested here}}
}
diff --git a/test/CXX/temp/temp.decls/temp.variadic/p5.cpp b/test/CXX/temp/temp.decls/temp.variadic/p5.cpp
index 945379872f78..3681d7757e94 100644
--- a/test/CXX/temp/temp.decls/temp.variadic/p5.cpp
+++ b/test/CXX/temp/temp.decls/temp.variadic/p5.cpp
@@ -165,6 +165,7 @@ template<typename T, typename... Types>
struct alignas(Types) TestUnexpandedDecls : T{ // expected-error{{expression contains unexpanded parameter pack 'Types'}}
void member_function(Types); // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
void member_function () throw(Types); // expected-error{{exception type contains unexpanded parameter pack 'Types'}}
+ void member_function2() noexcept(Types()); // expected-error{{expression contains unexpanded parameter pack 'Types'}}
operator Types() const; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
Types data_member; // expected-error{{data member type contains unexpanded parameter pack 'Types'}}
static Types static_data_member; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
@@ -410,3 +411,14 @@ namespace WorkingPaperExample {
f(h(args ...) + args ...);
}
}
+
+namespace PR16303 {
+ template<int> struct A { A(int); };
+ template<int...N> struct B {
+ template<int...M> struct C : A<N>... {
+ C() : A<N>(M)... {} // expected-error{{pack expansion contains parameter packs 'N' and 'M' that have different lengths (2 vs. 3)}} expected-error{{pack expansion contains parameter packs 'N' and 'M' that have different lengths (4 vs. 3)}}
+ };
+ };
+ B<1,2>::C<4,5,6> c1; // expected-note{{in instantiation of}}
+ B<1,2,3,4>::C<4,5,6> c2; // expected-note{{in instantiation of}}
+}
diff --git a/test/CXX/temp/temp.decls/temp.variadic/sizeofpack.cpp b/test/CXX/temp/temp.decls/temp.variadic/sizeofpack.cpp
new file mode 100644
index 000000000000..4960a2bac20a
--- /dev/null
+++ b/test/CXX/temp/temp.decls/temp.variadic/sizeofpack.cpp
@@ -0,0 +1,203 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+namespace pr12262 {
+
+template<typename T, typename... Ts>
+void abc1(int (*xxx)[sizeof ... (Ts) + 1]);
+
+void qq1 () {
+ abc1<int>(0);
+ abc1<int,double>(0);
+}
+
+
+template <unsigned N> class array {};
+
+
+template<typename T, typename... Types>
+array<sizeof...(Types)> make_array1(Types&&... args);
+
+void qq2 () {
+ array<1> arr = make_array1<int>(1);
+ array<3> arr2 = make_array1<int>(1,array<5>(),0.1);
+}
+
+
+template<typename T, typename... Types>
+int make_array(array<sizeof...(Types)>&, Types... args);
+
+void qq3 () {
+ array<1> a1;
+ int aa1 = make_array<int>(a1,1);
+ array<2> a2;
+ int aa2 = make_array<int>(a2, 0L, "abc");
+}
+
+
+template<typename ... Ts>
+struct AAA {
+ template<typename T, typename... Types>
+ static array<sizeof...(Types)> make_array(Types ... args);
+};
+
+void qq4 () {
+ array<2> arr2 = AAA<int, int>::make_array<int>(1,2);
+}
+
+}
+
+
+namespace pr12439 {
+
+template<class... Members>
+struct X {
+ template<int Idx>
+ using get_t = decltype(sizeof...(Members));
+
+ template<int i>
+ get_t<i> get();
+};
+
+template<class... Members>
+template<int i>
+X<Members...>::get_t<i> X<Members...>::get()
+{
+ return 0;
+}
+
+}
+
+
+namespace pr13272 {
+
+template<bool B, class T = void>
+struct enable_if { };
+
+template<class T> struct enable_if<true, T> {
+ typedef T type;
+};
+
+class Exception {};
+
+template<class Ex, typename... Args>
+void cxx_throw(typename enable_if<(sizeof...(Args) > 0), const char *>::type fmt, Args&&... args) {
+ return;
+}
+
+void test() {
+ cxx_throw<Exception>("Youpi",1);
+}
+
+}
+
+
+namespace pr13817 {
+
+template <unsigned>
+struct zod;
+
+template <>
+struct zod<1> {};
+
+template <typename T, typename ... Ts>
+zod<sizeof...(Ts)> make_zod(Ts ...) {
+ return zod<sizeof...(Ts)>();
+}
+
+int main(int argc, char *argv[])
+{
+ make_zod<int>(1);
+ return 0;
+}
+
+}
+
+
+namespace pr14273 {
+
+template<typename T, int i>
+struct myType
+{ };
+
+template<typename T, typename... Args>
+struct Counter
+{
+ static const int count = 1 + Counter<Args...>::count;
+};
+
+template<typename T>
+struct Counter<T>
+{
+ static const int count = 1;
+};
+
+template<typename Arg, typename... Args>
+myType<Arg, sizeof...(Args)>* make_array_with_type(const Args&... args)
+{
+ return 0;
+}
+
+void func(void)
+{
+ make_array_with_type<char>(1,2,3);
+}
+
+}
+
+
+namespace pr15112
+{
+ template<bool, typename _Tp = void>
+ struct enable_if
+ { };
+ template<typename _Tp>
+ struct enable_if<true,_Tp>
+ { typedef _Tp type; };
+
+ typedef __typeof__(sizeof(int)) size_t;
+
+ template <size_t n, typename T, typename... Args>
+ struct is_array_of { static const bool value = true; };
+
+ struct cpu { using value_type = void; };
+
+ template <size_t Order, typename T>
+ struct coords_alias { typedef T type; };
+
+ template <size_t Order, typename MemoryTag>
+ using coords = typename coords_alias<Order, MemoryTag>::type;
+
+ template <typename MemTag, typename... Args>
+ typename enable_if<is_array_of<sizeof...(Args), size_t, Args...>::value,
+ coords<sizeof...(Args), MemTag>>::type
+ mkcoords(Args... args);
+
+ auto c1 = mkcoords<cpu>(0ul, 0ul, 0ul);
+}
+
+
+namespace pr12699 {
+
+template<bool B>
+struct bool_constant
+{
+ static const bool value = B;
+};
+
+template<typename... A>
+struct F
+{
+ template<typename... B>
+ using SameSize = bool_constant<sizeof...(A) == sizeof...(B)>;
+
+ template<typename... B, typename = SameSize<B...>>
+ F(B...) { }
+};
+
+void func()
+{
+ F<int> f1(3);
+}
+
+}
diff --git a/test/CXX/temp/temp.param/p5.cpp b/test/CXX/temp/temp.param/p5.cpp
index 67efc4e48162..c25868267e49 100644
--- a/test/CXX/temp/temp.param/p5.cpp
+++ b/test/CXX/temp/temp.param/p5.cpp
@@ -1,14 +1,13 @@
// RUN: %clang_cc1 -verify %s -std=c++11
-// expected-no-diagnostics
template<const int I> struct S {
decltype(I) n;
- int &&r = I;
+ int &&r = I; // expected-warning 2{{binding reference member 'r' to a temporary value}} expected-note 2{{declared here}}
};
-S<5> s;
+S<5> s; // expected-note {{instantiation}}
template<typename T, T v> struct U {
decltype(v) n;
- int &&r = v;
+ int &&r = v; // expected-warning {{binding reference member 'r' to a temporary value}} expected-note {{declared here}}
};
-U<const int, 6> u;
+U<const int, 6> u; // expected-note {{instantiation}}
diff --git a/test/CXX/temp/temp.res/temp.local/p6.cpp b/test/CXX/temp/temp.res/temp.local/p6.cpp
new file mode 100644
index 000000000000..eccbb8993213
--- /dev/null
+++ b/test/CXX/temp/temp.res/temp.local/p6.cpp
@@ -0,0 +1,69 @@
+// RUN: %clang_cc1 -verify %s -fcxx-exceptions -std=c++1y
+
+template<typename T, // expected-note {{declared here}}
+ typename T> struct X {}; // expected-error {{declaration of 'T' shadows template parameter}}
+
+template<typename T> struct Y { // expected-note 15{{declared here}}
+ template<typename T> struct A {}; // expected-error {{declaration of 'T' shadows template parameter}}
+
+ struct B {
+ template<typename> struct T {}; // FIXME: desired-error {{declaration of 'T' shadows template parameter}}
+ };
+ struct C {
+ template<typename> void T(); // expected-error {{declaration of 'T' shadows template parameter}}
+ };
+ struct D {
+ struct T {}; // expected-error {{declaration of 'T' shadows template parameter}}
+ };
+ struct E {
+ typedef int T; // expected-error {{declaration of 'T' shadows template parameter}}
+ };
+ struct F {
+ using T = int; // expected-error {{declaration of 'T' shadows template parameter}}
+ };
+ struct G {
+ int T; // expected-error {{declaration of 'T' shadows template parameter}}
+ };
+ struct H {
+ static int T; // expected-error {{declaration of 'T' shadows template parameter}}
+ };
+ struct I {
+ void T(); // expected-error {{declaration of 'T' shadows template parameter}}
+ };
+ struct J {
+ enum T { e }; // expected-error {{declaration of 'T' shadows template parameter}}
+ };
+ struct K {
+ enum E { T }; // expected-error {{declaration of 'T' shadows template parameter}}
+ };
+
+ void a() {
+ extern int T; // expected-error {{declaration of 'T' shadows template parameter}}
+ }
+ void b() {
+ int T; // expected-error {{declaration of 'T' shadows template parameter}}
+ }
+ void c() {
+ try {}
+ catch (int T) {} // expected-error {{declaration of 'T' shadows template parameter}}
+ }
+ void d() {
+ void T(); // expected-error {{declaration of 'T' shadows template parameter}}
+ }
+
+ friend struct T; // expected-error {{declaration of 'T' shadows template parameter}}
+};
+
+template<typename T> // expected-note {{declared here}}
+void f(int T) {} // expected-error {{declaration of 'T' shadows template parameter}}
+
+// FIXME: These are ill-formed: a template-parameter shall not have the same name as the template name.
+namespace A {
+ template<typename T> struct T {};
+}
+namespace B {
+ template<typename T> void T() {}
+}
+namespace C {
+ template<typename T> int T;
+}
diff --git a/test/CXX/temp/temp.spec/cxx1y-variable-template-no-body.cpp b/test/CXX/temp/temp.spec/cxx1y-variable-template-no-body.cpp
new file mode 100644
index 000000000000..93f8ff1697bf
--- /dev/null
+++ b/test/CXX/temp/temp.spec/cxx1y-variable-template-no-body.cpp
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 --std=c++1y -fsyntax-only -verify %s
+// RUN: cp %s %t
+// RUN: not %clang_cc1 --std=c++1y -x c++ -fixit %t -DFIXING
+// RUN: %clang_cc1 --std=c++1y -x c++ %t -DFIXING
+
+template<typename T>
+T pi = T(3.1415926535897932385); // expected-note {{template is declared here}}
+
+template int pi<int>;
+
+#ifndef FIXING
+template float pi<>; // expected-error {{too few template arguments for template 'pi'}}
+template double pi_var0; // expected-error {{explicit instantiation of 'pi_var0' does not refer to a function template, variable template, member function, member class, or static data member}}
+#endif
+
+// Should recover as if definition
+template double pi_var = 5; // expected-error {{variable cannot be defined in an explicit instantiation; if this declaration is meant to be a variable definition, remove the 'template' keyword}}
+#ifndef FIXING
+template<typename T>
+T pi0 = T(3.1415926535897932385); // expected-note {{previous definition is here}}
+
+template int pi0 = 10; // expected-error {{variable cannot be defined in an explicit instantiation; if this declaration is meant to be a variable definition, remove the 'template' keyword}} \
+ expected-error{{redefinition of 'pi0' as different kind of symbol}}
+#endif
+
+template<typename T>
+T pi1 = T(3.1415926535897932385);
+
+// Should recover as if specialization
+template float pi1<float> = 1.0; // expected-error {{explicit template instantiation cannot have a definition; if this definition is meant to be an explicit specialization, add '<>' after the 'template' keyword}}
+#ifndef FIXING
+namespace expected_global {
+ template<> double pi1<double> = 1.5; // expected-error {{no variable template matches specialization}}
+ template int pi1<int> = 10; // expected-error {{explicit template instantiation cannot have a definition; if this definition is meant to be an explicit specialization, add '<>' after the 'template' keyword}} \
+ expected-error {{no variable template matches specialization}}
+}
+#endif
diff --git a/test/CXX/temp/temp.spec/no-body.cpp b/test/CXX/temp/temp.spec/no-body.cpp
new file mode 100644
index 000000000000..a4d7914d9eb6
--- /dev/null
+++ b/test/CXX/temp/temp.spec/no-body.cpp
@@ -0,0 +1,63 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: cp %s %t
+// RUN: not %clang_cc1 -x c++ -fixit %t -DFIXING
+// RUN: %clang_cc1 -x c++ %t -DFIXING
+
+template<typename T> void f(T) { }
+template<typename T> void g(T) { }
+template<typename T> struct x { };
+template<typename T> struct y { }; // expected-note {{declared here}}
+
+namespace good {
+ template void f<int>(int);
+ template void g(int);
+ template struct x<int>;
+}
+
+namespace unsupported {
+#ifndef FIXING
+ template struct y; // expected-error {{elaborated type refers to a template}}
+#endif
+}
+
+template<typename T> void f0(T) { }
+template<typename T> void g0(T) { }
+template<typename T> struct x0 { }; // expected-note {{explicitly specialized declaration is here}}
+template<typename T> struct y0 { };
+
+// Should recover as if definition
+namespace noargs_body {
+#ifndef FIXING
+ template void g0(int) { } // expected-error {{function cannot be defined in an explicit instantiation; if this declaration is meant to be a function definition, remove the 'template' keyword}}
+#endif
+ template struct y0 { }; // expected-error {{class cannot be defined in an explicit instantiation; if this declaration is meant to be a class definition, remove the 'template' keyword}}
+}
+
+// Explicit specializations expected in global scope
+namespace exp_spec {
+#ifndef FIXING
+ template<> void f0<int>(int) { } // expected-error {{no function template matches function template specialization 'f0'}}
+ template<> struct x0<int> { }; // expected-error {{class template specialization of 'x0' must originally be declared in the global scope}}
+#endif
+}
+
+template<typename T> void f1(T) { }
+template<typename T> struct x1 { }; // expected-note {{explicitly specialized declaration is here}}
+
+// Should recover as if specializations,
+// thus also complain about not being in global scope.
+namespace args_bad {
+#ifndef FIXING
+ template void f1<int>(int) { } // expected-error {{explicit template instantiation cannot have a definition; if this definition is meant to be an explicit specialization, add '<>' after the 'template' keyword}} \
+ expected-error {{no function template matches function template specialization 'f1'}}
+ template struct x1<int> { }; // expected-error {{explicit template instantiation cannot have a definition; if this definition is meant to be an explicit specialization, add '<>' after the 'template' keyword}} \
+ expected-error {{class template specialization of 'x1' must originally be declared in the global scope}}
+#endif
+}
+
+template<typename T> void f2(T) { }
+template<typename T> struct x2 { };
+
+// Should recover as if specializations
+template void f2<int>(int) { } // expected-error {{explicit template instantiation cannot have a definition; if this definition is meant to be an explicit specialization, add '<>' after the 'template' keyword}}
+template struct x2<int> { }; // expected-error {{explicit template instantiation cannot have a definition; if this definition is meant to be an explicit specialization, add '<>' after the 'template' keyword}}
diff --git a/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp b/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp
index aecbfb5649f3..d12feeff0bbc 100644
--- a/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp
+++ b/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp
@@ -163,7 +163,7 @@ namespace PR9877 {
template<> struct X<1>::Y { static const int Z = 1; };
const int X<0>::Y::Z;
- template<> const int X<1>::Y::Z; // expected-error{{extraneous 'template<>' in declaration of variable 'Z'}}
+ template<> const int X<1>::Y::Z; // expected-error{{extraneous 'template<>' in declaration of variable 'Z'}}
}
namespace PR9913 {
diff --git a/test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp b/test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp
index ff24ad997dfd..38dc367b227e 100644
--- a/test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp
+++ b/test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -emit-llvm -std=c++11 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -disable-llvm-optzns -emit-llvm -std=c++11 -o - %s | FileCheck %s
template<typename T>
struct X0 {
diff --git a/test/CXX/temp/temp.spec/temp.inst/p1.cpp b/test/CXX/temp/temp.spec/temp.inst/p1.cpp
index 8684fc4dabd9..adf812b714d1 100644
--- a/test/CXX/temp/temp.spec/temp.inst/p1.cpp
+++ b/test/CXX/temp/temp.spec/temp.inst/p1.cpp
@@ -33,24 +33,23 @@ namespace ScopedEnum {
ScopedEnum1<double>::E e1; // ok
ScopedEnum1<double>::E e2 = decltype(e2)::e; // expected-note {{in instantiation of enumeration 'ScopedEnum::ScopedEnum1<double>::E' requested here}}
- // The behavior for enums defined within function templates is not clearly
- // specified by the standard. We follow the rules for enums defined within
- // class templates.
+ // DR1484 specifies that enumerations cannot be separately instantiated,
+ // they will be instantiated with the rest of the template declaration.
template<typename T>
int f() {
enum class E {
- e = T::error
+ e = T::error // expected-error {{has no members}}
};
return (int)E();
}
- int test1 = f<int>();
+ int test1 = f<int>(); // expected-note {{here}}
template<typename T>
int g() {
enum class E {
e = T::error // expected-error {{has no members}}
};
- return E::e; // expected-note {{here}}
+ return E::e;
}
int test2 = g<int>(); // expected-note {{here}}
}
diff --git a/test/CodeCompletion/call.c b/test/CodeCompletion/call.c
index 8581414bf8c3..fe8644595f67 100644
--- a/test/CodeCompletion/call.c
+++ b/test/CodeCompletion/call.c
@@ -6,10 +6,10 @@ void test() {
f0(0, 0);
g0(0, 0);
f1(0, 0);
- // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:6:6 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:6:6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: f0(<#float x#>, float y)
- // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:6:9 %s -o - | FileCheck -check-prefix=CC2 %s
+ // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:6:9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: f0(float x, <#float y#>)
- // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:8:6 %s -o - | FileCheck -check-prefix=CC3 %s
+ // RUN: %clang_cc1 -std=c89 -fsyntax-only -code-completion-at=%s:8:6 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s
// CHECK-CC3: f1()
}
diff --git a/test/CodeCompletion/call.cpp b/test/CodeCompletion/call.cpp
index f06470f4cbe7..40a72ba83602 100644
--- a/test/CodeCompletion/call.cpp
+++ b/test/CodeCompletion/call.cpp
@@ -17,12 +17,12 @@ void f();
void test() {
f(Y(), 0, 0);
- // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: COMPLETION: Pattern : dynamic_cast<<#type#>>(<#expression#>)
// CHECK-CC1: f(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_cc1 -fsyntax-only -code-completion-at=%s:19:13 %s -o - | FileCheck -check-prefix=CC2 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:13 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2-NOT: f(N::Y y, int ZZ)
// CHECK-CC2: f(int i, int j, <#int k#>)
}
diff --git a/test/CodeCompletion/documentation.cpp b/test/CodeCompletion/documentation.cpp
index c049ae3733b5..d7dec9af6c08 100644
--- a/test/CodeCompletion/documentation.cpp
+++ b/test/CodeCompletion/documentation.cpp
@@ -23,11 +23,11 @@ void test() {
t2.
}
-// RUN: %clang_cc1 -fsyntax-only -code-completion-brief-comments -code-completion-at=%s:21:1 %s -o - | FileCheck -check-prefix=CC1 %s
+// RUN: %clang_cc1 -fsyntax-only -code-completion-brief-comments -code-completion-at=%s:21:1 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: COMPLETION: T1 : [#void#]T1(<#float x#>, <#float y#>) : Aaa.
// CHECK-CC1: COMPLETION: T2 : T2 : Bbb.
// CHECK-CC1: COMPLETION: T5 : T5:: : Eee.
-// RUN: %clang_cc1 -fsyntax-only -code-completion-brief-comments -code-completion-at=%s:23:6 %s -o - | FileCheck -check-prefix=CC2 %s
+// RUN: %clang_cc1 -fsyntax-only -code-completion-brief-comments -code-completion-at=%s:23:6 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: COMPLETION: T3 : [#void#]T3() : Ccc.
// CHECK-CC2: COMPLETION: T4 : [#int#]T4 : Ddd.
diff --git a/test/CodeCompletion/enum-switch-case-qualified.cpp b/test/CodeCompletion/enum-switch-case-qualified.cpp
index e74ec9b5fe67..0f256716bc0d 100644
--- a/test/CodeCompletion/enum-switch-case-qualified.cpp
+++ b/test/CodeCompletion/enum-switch-case-qualified.cpp
@@ -21,7 +21,7 @@ namespace M {
void test(enum N::C::Color color) {
switch (color) {
case
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:23:8 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:23:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: Blue : [#M::N::C::Color#]N::C::Blue
// CHECK-CC1-NEXT: Green : [#M::N::C::Color#]N::C::Green
// CHECK-CC1-NEXT: Indigo : [#M::N::C::Color#]N::C::Indigo
diff --git a/test/CodeCompletion/enum-switch-case.c b/test/CodeCompletion/enum-switch-case.c
index b83bd7f6474c..264f46a0a360 100644
--- a/test/CodeCompletion/enum-switch-case.c
+++ b/test/CodeCompletion/enum-switch-case.c
@@ -25,14 +25,14 @@ void test(enum Color color) {
case
}
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:10 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:10 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: Blue
// CHECK-CC1-NEXT: Green
// CHECK-CC1-NEXT: Indigo
// CHECK-CC1-NEXT: Orange
// CHECK-CC1-NEXT: Violet
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:25:10 %s -o - | FileCheck -check-prefix=CC2 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:25:10 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: COMPLETION: Blue : [#enum Color#]Blue
// CHECK-CC2-NEXT: COMPLETION: c2 : [#unsigned int#]c2
// CHECK-CC2-NEXT: COMPLETION: color : [#enum Color#]color
diff --git a/test/CodeCompletion/enum-switch-case.cpp b/test/CodeCompletion/enum-switch-case.cpp
index 2677f33f98f2..997845afe584 100644
--- a/test/CodeCompletion/enum-switch-case.cpp
+++ b/test/CodeCompletion/enum-switch-case.cpp
@@ -19,7 +19,7 @@ void test(enum N::Color color) {
break;
case
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:21:8 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:21:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: Blue : [#N::Color#]N::Blue
// CHECK-CC1-NEXT: Green : [#N::Color#]N::Green
// CHECK-CC1-NEXT: Indigo : [#N::Color#]N::Indigo
diff --git a/test/CodeCompletion/functions.cpp b/test/CodeCompletion/functions.cpp
index fcab3dcbe120..036ed29e4a85 100644
--- a/test/CodeCompletion/functions.cpp
+++ b/test/CodeCompletion/functions.cpp
@@ -3,6 +3,6 @@ void f(float x, float y...);
void test() {
::
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:5:5 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:5:5 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: f(<#int i#>{#, <#int j#>{#, <#int k#>#}#})
// CHECK-CC1: f(<#float x#>, <#float y, ...#>)
diff --git a/test/CodeCompletion/member-access.c b/test/CodeCompletion/member-access.c
index f41c509c8809..226e182ab15f 100644
--- a/test/CodeCompletion/member-access.c
+++ b/test/CodeCompletion/member-access.c
@@ -6,7 +6,7 @@ struct Point {
void test(struct Point *p) {
p->
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:8:6 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:8:6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: x
// CHECK-CC1: y
// CHECK-CC1: z
diff --git a/test/CodeCompletion/namespace-alias.cpp b/test/CodeCompletion/namespace-alias.cpp
index efbf99637285..bd4aef413799 100644
--- a/test/CodeCompletion/namespace-alias.cpp
+++ b/test/CodeCompletion/namespace-alias.cpp
@@ -11,7 +11,7 @@ namespace N2 {
namespace I1 { }
namespace New =
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:13:18 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:13:18 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: I1
// CHECK-CC1: I4
// CHECK-CC1: I5
diff --git a/test/CodeCompletion/namespace.cpp b/test/CodeCompletion/namespace.cpp
index ecd848039a87..8d3908a17889 100644
--- a/test/CodeCompletion/namespace.cpp
+++ b/test/CodeCompletion/namespace.cpp
@@ -8,7 +8,7 @@ namespace N2 {
namespace I1 { }
namespace
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:12 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:12 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: I1
// CHECK-CC1-NEXT: I5
diff --git a/test/CodeCompletion/nested-name-specifier.cpp b/test/CodeCompletion/nested-name-specifier.cpp
index e09a14b4cb46..8789635bd598 100644
--- a/test/CodeCompletion/nested-name-specifier.cpp
+++ b/test/CodeCompletion/nested-name-specifier.cpp
@@ -10,7 +10,7 @@ namespace N {
}
N::
-// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:12:4 %s -o - | FileCheck -check-prefix=CC1 %s
+// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:12:4 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: A
// CHECK-CC1: B
// CHECK-CC1: M
diff --git a/test/CodeCompletion/objc-expr.m b/test/CodeCompletion/objc-expr.m
index d3c95a6e6ff1..4296cc9a8c29 100644
--- a/test/CodeCompletion/objc-expr.m
+++ b/test/CodeCompletion/objc-expr.m
@@ -4,7 +4,7 @@ id testCompleteAfterAtSign() {
return @"";
}
-// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:4:11 %s -fno-const-strings -o - | FileCheck -check-prefix=AT %s
+// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:4:11 %s -fno-const-strings -o - | FileCheck -check-prefix=CHECK-AT %s
// CHECK-AT: COMPLETION: Pattern : [#NSString *#]"<#string#>"
// CHECK-AT: COMPLETION: Pattern : [#id#](<#expression#>)
// CHECK-AT: COMPLETION: Pattern : [#NSArray *#][<#objects, ...#>]
@@ -13,5 +13,5 @@ id testCompleteAfterAtSign() {
// CHECK-AT: COMPLETION: Pattern : [#SEL#]selector(<#selector#>)
// CHECK-AT: COMPLETION: Pattern : [#NSDictionary *#]{<#key#>: <#object, ...#>}
-// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:4:11 %s -fconst-strings -o - | FileCheck -check-prefix=CONST-STRINGS %s
+// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:4:11 %s -fconst-strings -o - | FileCheck -check-prefix=CHECK-CONST-STRINGS %s
// CHECK-CONST-STRINGS: COMPLETION: Pattern : [#const char[]#]encode(<#type-name#>)
diff --git a/test/CodeCompletion/operator.cpp b/test/CodeCompletion/operator.cpp
index 05cd7684ad2c..e0a21860bbc7 100644
--- a/test/CodeCompletion/operator.cpp
+++ b/test/CodeCompletion/operator.cpp
@@ -8,7 +8,7 @@ void f() {
typedef float Float;
operator
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:11 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:11 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: +
// CHECK-CC1: Float
// CHECK-CC1: Integer
diff --git a/test/CodeCompletion/stdin.c b/test/CodeCompletion/stdin.c
index 46495b2cd3ad..dd7f0adab791 100644
--- a/test/CodeCompletion/stdin.c
+++ b/test/CodeCompletion/stdin.c
@@ -2,6 +2,6 @@ enum X { x };
enum Y { y };
enum
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=-:4:6 < %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=-:4:6 < %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: X
// CHECK-CC1: Y
diff --git a/test/CodeCompletion/tag.c b/test/CodeCompletion/tag.c
index 6ad29880666e..d49fb0423618 100644
--- a/test/CodeCompletion/tag.c
+++ b/test/CodeCompletion/tag.c
@@ -7,6 +7,6 @@ void X();
void test() {
enum X { x };
enum
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:9:7 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:9:7 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: X
// CHECK-CC1: Y
diff --git a/test/CodeCompletion/tag.cpp b/test/CodeCompletion/tag.cpp
index 03fc0fda2ec5..c5ba6d31c47b 100644
--- a/test/CodeCompletion/tag.cpp
+++ b/test/CodeCompletion/tag.cpp
@@ -15,7 +15,7 @@ namespace N {
void test() {
class
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:17:10 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:17:10 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// FIXME: the redundant Y is really annoying... it needs qualification to
// actually be useful. Here, it just looks redundant :(
// CHECK-CC1: A
diff --git a/test/CodeCompletion/truncation.c b/test/CodeCompletion/truncation.c
index 473e85847e56..b6c41de024f1 100644
--- a/test/CodeCompletion/truncation.c
+++ b/test/CodeCompletion/truncation.c
@@ -4,10 +4,10 @@
struct
-// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s.h:4:8 -o - %s | FileCheck -check-prefix=CC1 %s
+// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s.h:4:8 -o - %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: X
// CHECK-CC1-NEXT: Y
-// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:5:8 -o - %s | FileCheck -check-prefix=CC2 %s
+// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:5:8 -o - %s | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: X
// CHECK-CC2: Xa
// CHECK-CC2: Y
diff --git a/test/CodeCompletion/using-namespace.cpp b/test/CodeCompletion/using-namespace.cpp
index eb1c2bd50e67..63cb5898ee9a 100644
--- a/test/CodeCompletion/using-namespace.cpp
+++ b/test/CodeCompletion/using-namespace.cpp
@@ -12,7 +12,7 @@ namespace N2 {
void foo() {
using namespace
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:14:20 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:14:20 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: I1
// CHECK-CC1: I4
// CHECK-CC1: I5
diff --git a/test/CodeCompletion/using.cpp b/test/CodeCompletion/using.cpp
index b84aa26be95b..13ebb4b2d8d0 100644
--- a/test/CodeCompletion/using.cpp
+++ b/test/CodeCompletion/using.cpp
@@ -14,7 +14,7 @@ namespace N2 {
int N3;
using
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:16:10 %s -o - | FileCheck -check-prefix=CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:16:10 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: I1
// CHECK-CC1: I4
// CHECK-CC1: I5
diff --git a/test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c b/test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c
index 12bce268cfac..3aa5c003973f 100644
--- a/test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c
+++ b/test/CodeGen/2003-08-06-BuiltinSetjmpLongjmp.c
@@ -1,9 +1,10 @@
-/* RUN: %clang_cc1 %s -emit-llvm -o - | not grep __builtin_
+/* RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
*
- * __builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp
- * just like explicit setjmp/longjmp calls are.
+ * __builtin_longjmp/setjmp should get transformed into intrinsics.
*/
+// CHECK-NOT: builtin_longjmp
+
void jumpaway(int *ptr) {
__builtin_longjmp(ptr,1);
}
diff --git a/test/CodeGen/2004-11-27-InvalidConstantExpr.c b/test/CodeGen/2004-11-27-InvalidConstantExpr.c
deleted file mode 100644
index 431dccffc1a1..000000000000
--- a/test/CodeGen/2004-11-27-InvalidConstantExpr.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | not grep {foo\\* sub}
-// This should not produce a subtrace constantexpr of a pointer
-struct foo {
- int Y;
- char X[100];
-} F;
-
-int test(char *Y) {
- return Y - F.X;
-}
diff --git a/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c b/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c
index 55efa86865de..9ceee4c99127 100644
--- a/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c
+++ b/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c
@@ -1,12 +1,14 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | \
-// RUN: opt -std-compile-opts -emit-llvm | not grep {declare i32.*func}
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
// There should not be an unresolved reference to func here. Believe it or not,
-// the "expected result" is a function named 'func' which is internal and
+// the "expected result" is a function named 'func' which is internal and
// referenced by bar().
// This is PR244
+// CHECK-LABEL: define void @bar(
+// CHECK: call {{.*}} @func
+// CHECK: define internal {{.*}}i32 @func(
static int func();
void bar() {
int func();
diff --git a/test/CodeGen/2007-02-25-C-DotDotDot.c b/test/CodeGen/2007-02-25-C-DotDotDot.c
index abc46683cee9..1c3a3df57094 100644
--- a/test/CodeGen/2007-02-25-C-DotDotDot.c
+++ b/test/CodeGen/2007-02-25-C-DotDotDot.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -O0 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s
// Make sure the call to foo is compiled as:
// call float @foo()
diff --git a/test/CodeGen/2007-03-05-DataLayout.c b/test/CodeGen/2007-03-05-DataLayout.c
deleted file mode 100644
index 751962457379..000000000000
--- a/test/CodeGen/2007-03-05-DataLayout.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Testcase for PR1242
-// RUN: %clang_cc1 -emit-llvm %s -o - | grep datalayout | \
-// RUN: not grep {"\[Ee\]-p:\[36\]\[24\]:\[36\]\[24\]"}
-// END.
-
-typedef __SIZE_TYPE__ size_t;
-void * malloc(size_t size);
-#define NDIM 3
-#define BODY 01
-typedef double vector[NDIM];
-typedef struct bnode* bodyptr;
-// { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x
-// double], double, \2 *, \2 * }
-struct bnode {
- short int type;
- double mass;
- vector pos;
- int proc;
- int new_proc;
- vector vel;
- vector acc;
- vector new_acc;
- double phi;
- bodyptr next;
- bodyptr proc_next;
-} body;
-
-#define Type(x) ((x)->type)
-#define Mass(x) ((x)->mass)
-#define Pos(x) ((x)->pos)
-#define Proc(x) ((x)->proc)
-#define New_Proc(x) ((x)->new_proc)
-#define Vel(x) ((x)->vel)
-#define Acc(x) ((x)->acc)
-#define New_Acc(x) ((x)->new_acc)
-#define Phi(x) ((x)->phi)
-#define Next(x) ((x)->next)
-#define Proc_Next(x) ((x)->proc_next)
-
-bodyptr ubody_alloc(int p)
-{
- register bodyptr tmp;
- tmp = (bodyptr)malloc(sizeof(body));
-
- Type(tmp) = BODY;
- Proc(tmp) = p;
- Proc_Next(tmp) = NULL;
- New_Proc(tmp) = p;
- return tmp;
-}
-
-int main(int argc, char** argv) {
- bodyptr b = ubody_alloc(17);
- return 0;
-}
diff --git a/test/CodeGen/2007-04-14-FNoBuiltin.c b/test/CodeGen/2007-04-14-FNoBuiltin.c
index a5fda6306f28..25ae01c5dcc0 100644
--- a/test/CodeGen/2007-04-14-FNoBuiltin.c
+++ b/test/CodeGen/2007-04-14-FNoBuiltin.c
@@ -1,7 +1,10 @@
-// RUN: %clang_cc1 -emit-llvm %s -O2 -fno-builtin -o - | grep call.*printf
+// RUN: %clang_cc1 -emit-llvm %s -O2 -fno-builtin -o - | FileCheck %s
// Check that -fno-builtin is honored.
extern int printf(const char*, ...);
+
+// CHECK: define void {{.*}}foo(
void foo(const char *msg) {
- printf("%s\n",msg);
+ // CHECK: call {{.*}}printf
+ printf("%s\n",msg);
}
diff --git a/test/CodeGen/2007-05-07-PaddingElements.c b/test/CodeGen/2007-05-07-PaddingElements.c
index 574a37760a38..f8ec2483a8d6 100644
--- a/test/CodeGen/2007-05-07-PaddingElements.c
+++ b/test/CodeGen/2007-05-07-PaddingElements.c
@@ -1,6 +1,6 @@
// PR 1278
-// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | grep {struct.s} | not grep "4 x i8] zeroinitializer"
-// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | not grep "i32 0, i32 2"
+// RUN: %clang_cc1 %s -emit-llvm -o - | grep struct.s | not grep "4 x i8] zeroinitializer"
+// RUN: %clang_cc1 %s -emit-llvm -o - | not grep "i32 0, i32 2"
struct s {
double d1;
int s1;
diff --git a/test/CodeGen/2008-01-11-ChainConsistency.c b/test/CodeGen/2008-01-11-ChainConsistency.c
deleted file mode 100644
index 9ae021f6da58..000000000000
--- a/test/CodeGen/2008-01-11-ChainConsistency.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -fnested-functions | not grep nest
-
-void n1(void) { void a(void) { a(); } a(); }
diff --git a/test/CodeGen/2008-01-25-ByValReadNone.c b/test/CodeGen/2008-01-25-ByValReadNone.c
index ca21f6c443a0..bb5a5887483e 100644
--- a/test/CodeGen/2008-01-25-ByValReadNone.c
+++ b/test/CodeGen/2008-01-25-ByValReadNone.c
@@ -1,7 +1,6 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
-
-// XFAIL: mips
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
+// It could hit in @llvm.memcpy with "-triple x86_64-(mingw32|win32)".
// CHECK-NOT: readonly
// CHECK-NOT: readnone
diff --git a/test/CodeGen/2008-03-05-syncPtr.c b/test/CodeGen/2008-03-05-syncPtr.c
index 93f328a57949..4df94829f572 100644
--- a/test/CodeGen/2008-03-05-syncPtr.c
+++ b/test/CodeGen/2008-03-05-syncPtr.c
@@ -3,38 +3,38 @@
int* foo(int** a, int* b, int* c) {
return __sync_val_compare_and_swap (a, b, c);
}
-// CHECK: define i32* @foo
+// CHECK-LABEL: define i32* @foo
// CHECK: cmpxchg
int foo2(int** a, int* b, int* c) {
return __sync_bool_compare_and_swap (a, b, c);
}
-// CHECK: define i32 @foo2
+// CHECK-LABEL: define i32 @foo2
// CHECK: cmpxchg
int* foo3(int** a, int b) {
return __sync_fetch_and_add (a, b);
}
-// CHECK: define i32* @foo3
+// CHECK-LABEL: define i32* @foo3
// CHECK: atomicrmw add
int* foo4(int** a, int b) {
return __sync_fetch_and_sub (a, b);
}
-// CHECK: define i32* @foo4
+// CHECK-LABEL: define i32* @foo4
// CHECK: atomicrmw sub
int* foo5(int** a, int* b) {
return __sync_lock_test_and_set (a, b);
}
-// CHECK: define i32* @foo5
+// CHECK-LABEL: define i32* @foo5
// CHECK: atomicrmw xchg
int* foo6(int** a, int*** b) {
return __sync_lock_test_and_set (a, b);
}
-// CHECK: define i32* @foo6
+// CHECK-LABEL: define i32* @foo6
// CHECK: atomicrmw xchg
diff --git a/test/CodeGen/2008-03-24-BitField-And-Alloca.c b/test/CodeGen/2008-03-24-BitField-And-Alloca.c
index cb80d76e0596..b0ccdec1116d 100644
--- a/test/CodeGen/2008-03-24-BitField-And-Alloca.c
+++ b/test/CodeGen/2008-03-24-BitField-And-Alloca.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -O2 -emit-llvm %s -o - | not grep alloca
-// RUN: %clang_cc1 -m32 -O2 -emit-llvm %s -o - | not grep {store }
+// RUN: %clang_cc1 -triple i686-pc-linux-gnu -O2 -emit-llvm %s -o - | not grep store
enum {
PP_C,
diff --git a/test/CodeGen/2008-05-19-AlwaysInline.c b/test/CodeGen/2008-05-19-AlwaysInline.c
index 73a7691aed76..419951b1594f 100644
--- a/test/CodeGen/2008-05-19-AlwaysInline.c
+++ b/test/CodeGen/2008-05-19-AlwaysInline.c
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -fno-unit-at-a-time -O0 -o - | not grep sabrina
-// RUN: %clang_cc1 %s -emit-llvm -funit-at-a-time -O0 -o - | not grep sabrina
+// RUN: %clang_cc1 %s -emit-llvm -o - | not grep sabrina
static inline int sabrina (void) __attribute__((always_inline));
static inline int sabrina (void)
diff --git a/test/CodeGen/2008-07-30-implicit-initialization.c b/test/CodeGen/2008-07-30-implicit-initialization.c
index e5162596d712..e77c70a140f9 100644
--- a/test/CodeGen/2008-07-30-implicit-initialization.c
+++ b/test/CodeGen/2008-07-30-implicit-initialization.c
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown -O1 -emit-llvm -o - %s | FileCheck %s
-// CHECK: define i32 @f0()
+// CHECK-LABEL: define i32 @f0()
// CHECK: ret i32 0
-// CHECK: define i32 @f1()
+// CHECK-LABEL: define i32 @f1()
// CHECK: ret i32 0
-// CHECK: define i32 @f2()
+// CHECK-LABEL: define i32 @f2()
// CHECK: ret i32 0
// <rdar://problem/6113085>
diff --git a/test/CodeGen/2008-07-31-asm-labels.c b/test/CodeGen/2008-07-31-asm-labels.c
index 130ad6ba46cc..733742bd85ed 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_cc1 -emit-llvm -o %t %s
-// RUN: grep "@pipe()" %t | count 0
+// RUN: not grep "@pipe()" %t
// RUN: grep '_thisIsNotAPipe' %t | count 3
-// RUN: grep 'g0' %t | count 0
+// RUN: not grep 'g0' %t
// RUN: grep '_renamed' %t | count 2
// RUN: %clang_cc1 -DUSE_DEF -emit-llvm -o %t %s
-// RUN: grep "@pipe()" %t | count 0
+// RUN: not grep "@pipe()" %t
// RUN: grep '_thisIsNotAPipe' %t | count 3
// <rdr://6116729>
diff --git a/test/CodeGen/2008-07-31-promotion-of-compound-pointer-arithmetic.c b/test/CodeGen/2008-07-31-promotion-of-compound-pointer-arithmetic.c
index 429fb1fcc27b..f348b2b6fda6 100644
--- a/test/CodeGen/2008-07-31-promotion-of-compound-pointer-arithmetic.c
+++ b/test/CodeGen/2008-07-31-promotion-of-compound-pointer-arithmetic.c
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown -O1 -emit-llvm -o - %s | FileCheck %s
-// CHECK: define i32 @f0
+// CHECK-LABEL: define i32 @f0
// CHECK: ret i32 1
-// CHECK: define i32 @f1
+// CHECK-LABEL: define i32 @f1
// CHECK: ret i32 1
-// CHECK: define i32 @f2
+// CHECK-LABEL: define i32 @f2
// CHECK: ret i32 1
// <rdr://6115726>
diff --git a/test/CodeGen/2008-08-07-AlignPadding2.c b/test/CodeGen/2008-08-07-AlignPadding2.c
index ecf28dd72de0..cef71a30940d 100644
--- a/test/CodeGen/2008-08-07-AlignPadding2.c
+++ b/test/CodeGen/2008-08-07-AlignPadding2.c
@@ -1,4 +1,4 @@
-/* RUN: %clang_cc1 %s -emit-llvm -o - -O0 | grep zeroinitializer | count 1
+/* RUN: %clang_cc1 %s -emit-llvm -o - | grep zeroinitializer | count 1
The FE must not generate padding here between array elements. PR 2533. */
diff --git a/test/CodeGen/2010-01-18-Inlined-Debug.c b/test/CodeGen/2010-01-18-Inlined-Debug.c
index cf00be7752cf..bdc6fc5267e7 100644
--- a/test/CodeGen/2010-01-18-Inlined-Debug.c
+++ b/test/CodeGen/2010-01-18-Inlined-Debug.c
@@ -1,5 +1,5 @@
// PR: 6058
-// RUN: %clang_cc1 -g -emit-llvm %s -O0 -o /dev/null
+// RUN: %clang_cc1 -g -emit-llvm %s -o /dev/null
static inline int foo(double) __attribute__ ((always_inline));
static inline int foo(double __x) { return __x; }
diff --git a/test/CodeGen/2010-03-5-LexicalScope.c b/test/CodeGen/2010-03-5-LexicalScope.c
index e0e41dd2379b..8dc68d70557f 100644
--- a/test/CodeGen/2010-03-5-LexicalScope.c
+++ b/test/CodeGen/2010-03-5-LexicalScope.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -O0 -g %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
// CHECK: DW_TAG_lexical_block
// CHECK: DW_TAG_lexical_block
int foo(int i) {
diff --git a/test/CodeGen/2010-07-08-DeclDebugLineNo.c b/test/CodeGen/2010-07-08-DeclDebugLineNo.c
index 1637a4936747..5e9edd9acd99 100644
--- a/test/CodeGen/2010-07-08-DeclDebugLineNo.c
+++ b/test/CodeGen/2010-07-08-DeclDebugLineNo.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -O0 -g %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
// Insure that dbg.declare lines for locals refer to correct line number records.
// Radar 8152866.
void foo() {
diff --git a/test/CodeGen/2010-08-12-asm-aggr-arg.c b/test/CodeGen/2010-08-12-asm-aggr-arg.c
index 5ddc4122d60f..dcd507d81953 100644
--- a/test/CodeGen/2010-08-12-asm-aggr-arg.c
+++ b/test/CodeGen/2010-08-12-asm-aggr-arg.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
// Radar 8288710: A small aggregate can be passed as an integer. Make sure
// we don't get an error with "input constraint with a matching output
// constraint of incompatible type!"
diff --git a/test/CodeGen/3dnow-builtins.c b/test/CodeGen/3dnow-builtins.c
index 294fbc0579eb..f53b85c931df 100644
--- a/test/CodeGen/3dnow-builtins.c
+++ b/test/CodeGen/3dnow-builtins.c
@@ -6,151 +6,151 @@
#include <x86intrin.h>
__m64 test_m_pavgusb(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pavgusb
+ // CHECK-LABEL: define i64 @test_m_pavgusb
// CHECK: @llvm.x86.3dnow.pavgusb
return _m_pavgusb(m1, m2);
}
__m64 test_m_pf2id(__m64 m) {
- // CHECK: define i64 @test_m_pf2id
+ // CHECK-LABEL: define i64 @test_m_pf2id
// CHECK: @llvm.x86.3dnow.pf2id
return _m_pf2id(m);
}
__m64 test_m_pfacc(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfacc
+ // CHECK-LABEL: define i64 @test_m_pfacc
// CHECK: @llvm.x86.3dnow.pfacc
return _m_pfacc(m1, m2);
}
__m64 test_m_pfadd(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfadd
+ // CHECK-LABEL: define i64 @test_m_pfadd
// CHECK: @llvm.x86.3dnow.pfadd
return _m_pfadd(m1, m2);
}
__m64 test_m_pfcmpeq(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfcmpeq
+ // CHECK-LABEL: define i64 @test_m_pfcmpeq
// CHECK: @llvm.x86.3dnow.pfcmpeq
return _m_pfcmpeq(m1, m2);
}
__m64 test_m_pfcmpge(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfcmpge
+ // CHECK-LABEL: define i64 @test_m_pfcmpge
// CHECK: @llvm.x86.3dnow.pfcmpge
return _m_pfcmpge(m1, m2);
}
__m64 test_m_pfcmpgt(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfcmpgt
+ // CHECK-LABEL: define i64 @test_m_pfcmpgt
// CHECK: @llvm.x86.3dnow.pfcmpgt
return _m_pfcmpgt(m1, m2);
}
__m64 test_m_pfmax(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfmax
+ // CHECK-LABEL: define i64 @test_m_pfmax
// CHECK: @llvm.x86.3dnow.pfmax
return _m_pfmax(m1, m2);
}
__m64 test_m_pfmin(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfmin
+ // CHECK-LABEL: define i64 @test_m_pfmin
// CHECK: @llvm.x86.3dnow.pfmin
return _m_pfmin(m1, m2);
}
__m64 test_m_pfmul(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfmul
+ // CHECK-LABEL: define i64 @test_m_pfmul
// CHECK: @llvm.x86.3dnow.pfmul
return _m_pfmul(m1, m2);
}
__m64 test_m_pfrcp(__m64 m) {
- // CHECK: define i64 @test_m_pfrcp
+ // CHECK-LABEL: define i64 @test_m_pfrcp
// CHECK: @llvm.x86.3dnow.pfrcp
return _m_pfrcp(m);
}
__m64 test_m_pfrcpit1(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfrcpit1
+ // CHECK-LABEL: define i64 @test_m_pfrcpit1
// CHECK: @llvm.x86.3dnow.pfrcpit1
return _m_pfrcpit1(m1, m2);
}
__m64 test_m_pfrcpit2(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfrcpit2
+ // CHECK-LABEL: define i64 @test_m_pfrcpit2
// CHECK: @llvm.x86.3dnow.pfrcpit2
return _m_pfrcpit2(m1, m2);
}
__m64 test_m_pfrsqrt(__m64 m) {
- // CHECK: define i64 @test_m_pfrsqrt
+ // CHECK-LABEL: define i64 @test_m_pfrsqrt
// CHECK: @llvm.x86.3dnow.pfrsqrt
return _m_pfrsqrt(m);
}
__m64 test_m_pfrsqrtit1(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfrsqrtit1
+ // CHECK-LABEL: define i64 @test_m_pfrsqrtit1
// CHECK: @llvm.x86.3dnow.pfrsqit1
return _m_pfrsqrtit1(m1, m2);
}
__m64 test_m_pfsub(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfsub
+ // CHECK-LABEL: define i64 @test_m_pfsub
// CHECK: @llvm.x86.3dnow.pfsub
return _m_pfsub(m1, m2);
}
__m64 test_m_pfsubr(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfsubr
+ // CHECK-LABEL: define i64 @test_m_pfsubr
// CHECK: @llvm.x86.3dnow.pfsubr
return _m_pfsubr(m1, m2);
}
__m64 test_m_pi2fd(__m64 m) {
- // CHECK: define i64 @test_m_pi2fd
+ // CHECK-LABEL: define i64 @test_m_pi2fd
// CHECK: @llvm.x86.3dnow.pi2fd
return _m_pi2fd(m);
}
__m64 test_m_pmulhrw(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pmulhrw
+ // CHECK-LABEL: define i64 @test_m_pmulhrw
// CHECK: @llvm.x86.3dnow.pmulhrw
return _m_pmulhrw(m1, m2);
}
__m64 test_m_pf2iw(__m64 m) {
- // CHECK: define i64 @test_m_pf2iw
+ // CHECK-LABEL: define i64 @test_m_pf2iw
// CHECK: @llvm.x86.3dnowa.pf2iw
return _m_pf2iw(m);
}
__m64 test_m_pfnacc(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfnacc
+ // CHECK-LABEL: define i64 @test_m_pfnacc
// CHECK: @llvm.x86.3dnowa.pfnacc
return _m_pfnacc(m1, m2);
}
__m64 test_m_pfpnacc(__m64 m1, __m64 m2) {
- // CHECK: define i64 @test_m_pfpnacc
+ // CHECK-LABEL: define i64 @test_m_pfpnacc
// CHECK: @llvm.x86.3dnowa.pfpnacc
return _m_pfpnacc(m1, m2);
}
__m64 test_m_pi2fw(__m64 m) {
- // CHECK: define i64 @test_m_pi2fw
+ // CHECK-LABEL: define i64 @test_m_pi2fw
// CHECK: @llvm.x86.3dnowa.pi2fw
return _m_pi2fw(m);
}
__m64 test_m_pswapdsf(__m64 m) {
- // CHECK: define i64 @test_m_pswapdsf
+ // CHECK-LABEL: define i64 @test_m_pswapdsf
// CHECK: @llvm.x86.3dnowa.pswapd
return _m_pswapdsf(m);
}
__m64 test_m_pswapdsi(__m64 m) {
- // CHECK: define i64 @test_m_pswapdsi
+ // CHECK-LABEL: define i64 @test_m_pswapdsi
// CHECK: @llvm.x86.3dnowa.pswapd
return _m_pswapdsi(m);
}
diff --git a/test/CodeGen/Atomics.c b/test/CodeGen/Atomics.c
index 2bb38fd749c2..5798dfff46b1 100644
--- a/test/CodeGen/Atomics.c
+++ b/test/CodeGen/Atomics.c
@@ -11,7 +11,7 @@ unsigned int ui;
signed long long sll;
unsigned long long ull;
-void test_op_ignore (void) // CHECK: define void @test_op_ignore
+void test_op_ignore (void) // CHECK-LABEL: define void @test_op_ignore
{
(void) __sync_fetch_and_add (&sc, 1); // CHECK: atomicrmw add i8
(void) __sync_fetch_and_add (&uc, 1); // CHECK: atomicrmw add i8
@@ -60,7 +60,7 @@ void test_op_ignore (void) // CHECK: define void @test_op_ignore
}
-void test_fetch_and_op (void) // CHECK: define void @test_fetch_and_op
+void test_fetch_and_op (void) // CHECK-LABEL: define void @test_fetch_and_op
{
sc = __sync_fetch_and_add (&sc, 11); // CHECK: atomicrmw add
uc = __sync_fetch_and_add (&uc, 11); // CHECK: atomicrmw add
diff --git a/test/CodeGen/PR15826.c b/test/CodeGen/PR15826.c
new file mode 100644
index 000000000000..28d7445647ef
--- /dev/null
+++ b/test/CodeGen/PR15826.c
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -verify -emit-llvm-only %s -o %t
+
+/* Testcase for PR15826 - clang hits assert in clang::ASTContext::getASTRecordLayout */
+struct sysctl_req {
+ struct aiocblist *p_aio;
+};
+
+struct sysctl_oid {
+ int (*oid_handler)(struct sysctl_req *req);
+};
+
+static struct sysctl_oid sysctl___kern_features_aio;
+
+static void const *const __set_sysctl_set_sym_sysctl___kern_features_aio
+ __attribute__((__used__)) = &sysctl___kern_features_aio;
+
+struct aiocblist {
+ struct aiocb uaiocb; // expected-error {{field has incomplete type}} expected-note {{forward declaration}}
+};
diff --git a/test/CodeGen/PR3589-freestanding-libcalls.c b/test/CodeGen/PR3589-freestanding-libcalls.c
index 40e5fb11214b..5216e820411a 100644
--- a/test/CodeGen/PR3589-freestanding-libcalls.c
+++ b/test/CodeGen/PR3589-freestanding-libcalls.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1
// RUN: %clang_cc1 -triple i386-unknown-unknown -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1
-// RUN: %clang_cc1 -triple i386-unknown-unknown -ffreestanding -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 0
+// RUN: %clang_cc1 -triple i386-unknown-unknown -ffreestanding -O2 -emit-llvm %s -o - | not grep 'declare i32 @puts'
int printf(const char *, ...);
diff --git a/test/CodeGen/PR5060-align.c b/test/CodeGen/PR5060-align.c
index efd852055398..34293a933aa9 100644
--- a/test/CodeGen/PR5060-align.c
+++ b/test/CodeGen/PR5060-align.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -verify | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
// CHECK: @foo.p = internal global i8 0, align 32
char *foo(void) {
diff --git a/test/CodeGen/_Bool-conversion.c b/test/CodeGen/_Bool-conversion.c
index 9e5e89450314..a51cd8ecf535 100644
--- a/test/CodeGen/_Bool-conversion.c
+++ b/test/CodeGen/_Bool-conversion.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -triple i386 -emit-llvm -O2 -o - %s | FileCheck %s
-// CHECK: define i32 @f0()
+// CHECK-LABEL: define i32 @f0()
// CHECK: ret i32 1
// CHECK: }
diff --git a/test/CodeGen/aarch64-arguments.c b/test/CodeGen/aarch64-arguments.c
index 901e7342ddac..a70dfb1e3d4d 100644
--- a/test/CodeGen/aarch64-arguments.c
+++ b/test/CodeGen/aarch64-arguments.c
@@ -3,7 +3,7 @@
// Sign extension is performed by the callee on AArch64, which means
// that we *shouldn't* tag arguments and returns with their extension.
-// PCS: define i8 @f0(i16 %a)
+// PCS-LABEL: define i8 @f0(i16 %a)
char f0(short a) {
return a;
}
@@ -32,11 +32,11 @@ struct s5 f5(void) {}
struct s6 { int f0[1]; };
struct s6 f6(void) {}
-// PCS: define void @f7()
+// PCS-LABEL: define void @f7()
struct s7 { struct { int : 0; } f0; };
struct s7 f7(void) {}
-// PCS: define void @f8()
+// PCS-LABEL: define void @f8()
struct s8 { struct { int : 0; } f0[1]; };
struct s8 f8(void) {}
@@ -56,18 +56,18 @@ struct s11 f11(void) {}
union u12 { char f0; short f1; int f2; long f3; };
union u12 f12(void) {}
-// PCS: define %struct.s13 @f13()
+// PCS-LABEL: define %struct.s13 @f13()
struct s13 { float f0; };
struct s13 f13(void) {}
-// PCS: define %union.u14 @f14()
+// PCS-LABEL: define %union.u14 @f14()
union u14 { float f0; };
union u14 f14(void) {}
-// PCS: define void @f15()
+// PCS-LABEL: define void @f15()
void f15(struct s7 a0) {}
-// PCS: define void @f16()
+// PCS-LABEL: define void @f16()
void f16(struct s8 a0) {}
// PCS: define [1 x i64] @f17()
@@ -111,14 +111,14 @@ struct s26 f26() {}
struct s27 { _Complex long f0; };
struct s27 f27() {}
-// PCS: define void @f28(i8 %a, i16 %b, i32 %c, i64 %d, float %e, double %f)
+// PCS-LABEL: define void @f28(i8 %a, i16 %b, i32 %c, i64 %d, float %e, double %f)
void f28(char a, short b, int c, long d, float e, double f) {}
// PCS: define void @f29([2 x i64] %a
struct s29 { int arr[4]; };
void f29(struct s29 a) {}
-// PCS: define void @f30(%struct.s30* %a)
+// PCS-LABEL: define void @f30(%struct.s30* %a)
struct s30 { int arr[4]; char c;};
void f30(struct s30 a) {}
@@ -126,7 +126,7 @@ void f30(struct s30 a) {}
struct s31 { double arr[4]; };
void f31(struct s31 a) {}
-// PCS: define void @f32(%struct.s32* %a)
+// PCS-LABEL: define void @f32(%struct.s32* %a)
struct s32 { float arr[5]; };
void f32(struct s32 a) {}
@@ -135,11 +135,11 @@ void f32(struct s32 a) {}
struct s33 { float arr[3]; float a; };
void f33(struct s33 a) {}
-// PCS: define void @f34(%struct.s34* noalias sret
+// PCS-LABEL: define void @f34(%struct.s34* noalias sret
struct s34 { int a[4]; char b };
struct s34 f34(void) {}
-// PCS: define void @f35()
+// PCS-LABEL: define void @f35()
struct s35 {};
void f35(struct s35 a) {}
diff --git a/test/CodeGen/aarch64-neon-2velem.c b/test/CodeGen/aarch64-neon-2velem.c
new file mode 100644
index 000000000000..03f7df715c53
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-2velem.c
@@ -0,0 +1,1698 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+int16x4_t test_vmla_lane_s16(int16x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmla_lane_s16
+ return vmla_lane_s16(a, b, v, 3);
+ // CHECK: mla {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int16x8_t test_vmlaq_lane_s16(int16x8_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlaq_lane_s16
+ return vmlaq_lane_s16(a, b, v, 3);
+ // CHECK: mla {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int32x2_t test_vmla_lane_s32(int32x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmla_lane_s32
+ return vmla_lane_s32(a, b, v, 1);
+ // CHECK: mla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmlaq_lane_s32(int32x4_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlaq_lane_s32
+ return vmlaq_lane_s32(a, b, v, 1);
+ // CHECK: mla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int16x4_t test_vmla_laneq_s16(int16x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmla_laneq_s16
+ return vmla_laneq_s16(a, b, v, 7);
+ // CHECK: mla {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[7]
+}
+
+int16x8_t test_vmlaq_laneq_s16(int16x8_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlaq_laneq_s16
+ return vmlaq_laneq_s16(a, b, v, 7);
+ // CHECK: mla {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+int32x2_t test_vmla_laneq_s32(int32x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmla_laneq_s32
+ return vmla_laneq_s32(a, b, v, 3);
+ // CHECK: mla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmlaq_laneq_s32(int32x4_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlaq_laneq_s32
+ return vmlaq_laneq_s32(a, b, v, 3);
+ // CHECK: mla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+int16x4_t test_vmls_lane_s16(int16x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmls_lane_s16
+ return vmls_lane_s16(a, b, v, 3);
+ // CHECK: mls {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int16x8_t test_vmlsq_lane_s16(int16x8_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlsq_lane_s16
+ return vmlsq_lane_s16(a, b, v, 3);
+ // CHECK: mls {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int32x2_t test_vmls_lane_s32(int32x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmls_lane_s32
+ return vmls_lane_s32(a, b, v, 1);
+ // CHECK: mls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmlsq_lane_s32(int32x4_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlsq_lane_s32
+ return vmlsq_lane_s32(a, b, v, 1);
+ // CHECK: mls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int16x4_t test_vmls_laneq_s16(int16x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmls_laneq_s16
+ return vmls_laneq_s16(a, b, v, 7);
+ // CHECK: mls {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[7]
+}
+
+int16x8_t test_vmlsq_laneq_s16(int16x8_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlsq_laneq_s16
+ return vmlsq_laneq_s16(a, b, v, 7);
+ // CHECK: mls {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+int32x2_t test_vmls_laneq_s32(int32x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmls_laneq_s32
+ return vmls_laneq_s32(a, b, v, 3);
+ // CHECK: mls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmlsq_laneq_s32(int32x4_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlsq_laneq_s32
+ return vmlsq_laneq_s32(a, b, v, 3);
+ // CHECK: mls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+int16x4_t test_vmul_lane_s16(int16x4_t a, int16x4_t v) {
+ // CHECK: test_vmul_lane_s16
+ return vmul_lane_s16(a, v, 3);
+ // CHECK: mul {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int16x8_t test_vmulq_lane_s16(int16x8_t a, int16x4_t v) {
+ // CHECK: test_vmulq_lane_s16
+ return vmulq_lane_s16(a, v, 3);
+ // CHECK: mul {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int32x2_t test_vmul_lane_s32(int32x2_t a, int32x2_t v) {
+ // CHECK: test_vmul_lane_s32
+ return vmul_lane_s32(a, v, 1);
+ // CHECK: mul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmulq_lane_s32(int32x4_t a, int32x2_t v) {
+ // CHECK: test_vmulq_lane_s32
+ return vmulq_lane_s32(a, v, 1);
+ // CHECK: mul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+uint16x4_t test_vmul_lane_u16(uint16x4_t a, uint16x4_t v) {
+ // CHECK: test_vmul_lane_u16
+ return vmul_lane_u16(a, v, 3);
+ // CHECK: mul {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+uint16x8_t test_vmulq_lane_u16(uint16x8_t a, uint16x4_t v) {
+ // CHECK: test_vmulq_lane_u16
+ return vmulq_lane_u16(a, v, 3);
+ // CHECK: mul {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+uint32x2_t test_vmul_lane_u32(uint32x2_t a, uint32x2_t v) {
+ // CHECK: test_vmul_lane_u32
+ return vmul_lane_u32(a, v, 1);
+ // CHECK: mul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+uint32x4_t test_vmulq_lane_u32(uint32x4_t a, uint32x2_t v) {
+ // CHECK: test_vmulq_lane_u32
+ return vmulq_lane_u32(a, v, 1);
+ // CHECK: mul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int16x4_t test_vmul_laneq_s16(int16x4_t a, int16x8_t v) {
+ // CHECK: test_vmul_laneq_s16
+ return vmul_laneq_s16(a, v, 7);
+ // CHECK: mul {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[7]
+}
+
+int16x8_t test_vmulq_laneq_s16(int16x8_t a, int16x8_t v) {
+ // CHECK: test_vmulq_laneq_s16
+ return vmulq_laneq_s16(a, v, 7);
+ // CHECK: mul {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+int32x2_t test_vmul_laneq_s32(int32x2_t a, int32x4_t v) {
+ // CHECK: test_vmul_laneq_s32
+ return vmul_laneq_s32(a, v, 3);
+ // CHECK: mul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmulq_laneq_s32(int32x4_t a, int32x4_t v) {
+ // CHECK: test_vmulq_laneq_s32
+ return vmulq_laneq_s32(a, v, 3);
+ // CHECK: mul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+uint16x4_t test_vmul_laneq_u16(uint16x4_t a, uint16x8_t v) {
+ // CHECK: test_vmul_laneq_u16
+ return vmul_laneq_u16(a, v, 7);
+ // CHECK: mul {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[7]
+}
+
+uint16x8_t test_vmulq_laneq_u16(uint16x8_t a, uint16x8_t v) {
+ // CHECK: test_vmulq_laneq_u16
+ return vmulq_laneq_u16(a, v, 7);
+ // CHECK: mul {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+uint32x2_t test_vmul_laneq_u32(uint32x2_t a, uint32x4_t v) {
+ // CHECK: test_vmul_laneq_u32
+ return vmul_laneq_u32(a, v, 3);
+ // CHECK: mul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+uint32x4_t test_vmulq_laneq_u32(uint32x4_t a, uint32x4_t v) {
+ // CHECK: test_vmulq_laneq_u32
+ return vmulq_laneq_u32(a, v, 3);
+ // CHECK: mul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+float32x2_t test_vfma_lane_f32(float32x2_t a, float32x2_t b, float32x2_t v) {
+ // CHECK: test_vfma_lane_f32
+ return vfma_lane_f32(a, b, v, 1);
+ // CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+float32x4_t test_vfmaq_lane_f32(float32x4_t a, float32x4_t b, float32x2_t v) {
+ // CHECK: test_vfmaq_lane_f32
+ return vfmaq_lane_f32(a, b, v, 1);
+ // CHECK: fmla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+float32x2_t test_vfma_laneq_f32(float32x2_t a, float32x2_t b, float32x4_t v) {
+ // CHECK: test_vfma_laneq_f32
+ return vfma_laneq_f32(a, b, v, 3);
+ // CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+float32x4_t test_vfmaq_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t v) {
+ // CHECK: test_vfmaq_laneq_f32
+ return vfmaq_laneq_f32(a, b, v, 3);
+ // CHECK: fmla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+float32x2_t test_vfms_lane_f32(float32x2_t a, float32x2_t b, float32x2_t v) {
+ // CHECK: test_vfms_lane_f32
+ return vfms_lane_f32(a, b, v, 1);
+ // CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+float32x4_t test_vfmsq_lane_f32(float32x4_t a, float32x4_t b, float32x2_t v) {
+ // CHECK: test_vfmsq_lane_f32
+ return vfmsq_lane_f32(a, b, v, 1);
+ // CHECK: fmls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+float32x2_t test_vfms_laneq_f32(float32x2_t a, float32x2_t b, float32x4_t v) {
+ // CHECK: test_vfms_laneq_f32
+ return vfms_laneq_f32(a, b, v, 3);
+ // CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+float32x4_t test_vfmsq_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t v) {
+ // CHECK: test_vfmsq_laneq_f32
+ return vfmsq_laneq_f32(a, b, v, 3);
+ // CHECK: fmls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+float64x2_t test_vfmaq_lane_f64(float64x2_t a, float64x2_t b, float64x1_t v) {
+ // CHECK: test_vfmaq_lane_f64
+ return vfmaq_lane_f64(a, b, v, 0);
+ // CHECK: fmla {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+float64x2_t test_vfmaq_laneq_f64(float64x2_t a, float64x2_t b, float64x2_t v) {
+ // CHECK: test_vfmaq_laneq_f64
+ return vfmaq_laneq_f64(a, b, v, 1);
+ // CHECK: fmla {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[1]
+}
+
+float64x2_t test_vfmsq_lane_f64(float64x2_t a, float64x2_t b, float64x1_t v) {
+ // CHECK: test_vfmsq_lane_f64
+ return vfmsq_lane_f64(a, b, v, 0);
+ // CHECK: fmls {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+float64x2_t test_vfmsq_laneq_f64(float64x2_t a, float64x2_t b, float64x2_t v) {
+ // CHECK: test_vfmsq_laneq_f64
+ return vfmsq_laneq_f64(a, b, v, 1);
+ // CHECK: fmls {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[1]
+}
+
+int32x4_t test_vmlal_lane_s16(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmlal_lane_s16
+ return vmlal_lane_s16(a, b, v, 3);
+ // CHECK: smlal {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vmlal_lane_s32(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmlal_lane_s32
+ return vmlal_lane_s32(a, b, v, 1);
+ // CHECK: smlal {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmlal_laneq_s16(int32x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmlal_laneq_s16
+ return vmlal_laneq_s16(a, b, v, 7);
+ // CHECK: smlal {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vmlal_laneq_s32(int64x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmlal_laneq_s32
+ return vmlal_laneq_s32(a, b, v, 3);
+ // CHECK: smlal {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmlal_high_lane_s16(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlal_high_lane_s16
+ return vmlal_high_lane_s16(a, b, v, 3);
+ // CHECK: smlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vmlal_high_lane_s32(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlal_high_lane_s32
+ return vmlal_high_lane_s32(a, b, v, 1);
+ // CHECK: smlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmlal_high_laneq_s16(int32x4_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlal_high_laneq_s16
+ return vmlal_high_laneq_s16(a, b, v, 7);
+ // CHECK: smlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vmlal_high_laneq_s32(int64x2_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlal_high_laneq_s32
+ return vmlal_high_laneq_s32(a, b, v, 3);
+ // CHECK: smlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmlsl_lane_s16(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmlsl_lane_s16
+ return vmlsl_lane_s16(a, b, v, 3);
+ // CHECK: smlsl {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vmlsl_lane_s32(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmlsl_lane_s32
+ return vmlsl_lane_s32(a, b, v, 1);
+ // CHECK: smlsl {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmlsl_laneq_s16(int32x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmlsl_laneq_s16
+ return vmlsl_laneq_s16(a, b, v, 7);
+ // CHECK: smlsl {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vmlsl_laneq_s32(int64x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmlsl_laneq_s32
+ return vmlsl_laneq_s32(a, b, v, 3);
+ // CHECK: smlsl {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmlsl_high_lane_s16(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlsl_high_lane_s16
+ return vmlsl_high_lane_s16(a, b, v, 3);
+ // CHECK: smlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vmlsl_high_lane_s32(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlsl_high_lane_s32
+ return vmlsl_high_lane_s32(a, b, v, 1);
+ // CHECK: smlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmlsl_high_laneq_s16(int32x4_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlsl_high_laneq_s16
+ return vmlsl_high_laneq_s16(a, b, v, 7);
+ // CHECK: smlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vmlsl_high_laneq_s32(int64x2_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlsl_high_laneq_s32
+ return vmlsl_high_laneq_s32(a, b, v, 3);
+ // CHECK: smlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmlal_lane_u16(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmlal_lane_u16
+ return vmlal_lane_u16(a, b, v, 3);
+ // CHECK: umlal {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vmlal_lane_u32(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmlal_lane_u32
+ return vmlal_lane_u32(a, b, v, 1);
+ // CHECK: umlal {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmlal_laneq_u16(int32x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmlal_laneq_u16
+ return vmlal_laneq_u16(a, b, v, 7);
+ // CHECK: umlal {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vmlal_laneq_u32(int64x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmlal_laneq_u32
+ return vmlal_laneq_u32(a, b, v, 3);
+ // CHECK: umlal {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmlal_high_lane_u16(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlal_high_lane_u16
+ return vmlal_high_lane_u16(a, b, v, 3);
+ // CHECK: umlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vmlal_high_lane_u32(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlal_high_lane_u32
+ return vmlal_high_lane_u32(a, b, v, 1);
+ // CHECK: umlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmlal_high_laneq_u16(int32x4_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlal_high_laneq_u16
+ return vmlal_high_laneq_u16(a, b, v, 7);
+ // CHECK: umlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vmlal_high_laneq_u32(int64x2_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlal_high_laneq_u32
+ return vmlal_high_laneq_u32(a, b, v, 3);
+ // CHECK: umlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmlsl_lane_u16(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmlsl_lane_u16
+ return vmlsl_lane_u16(a, b, v, 3);
+ // CHECK: umlsl {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vmlsl_lane_u32(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmlsl_lane_u32
+ return vmlsl_lane_u32(a, b, v, 1);
+ // CHECK: umlsl {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmlsl_laneq_u16(int32x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmlsl_laneq_u16
+ return vmlsl_laneq_u16(a, b, v, 7);
+ // CHECK: umlsl {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vmlsl_laneq_u32(int64x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmlsl_laneq_u32
+ return vmlsl_laneq_u32(a, b, v, 3);
+ // CHECK: umlsl {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmlsl_high_lane_u16(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlsl_high_lane_u16
+ return vmlsl_high_lane_u16(a, b, v, 3);
+ // CHECK: umlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vmlsl_high_lane_u32(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlsl_high_lane_u32
+ return vmlsl_high_lane_u32(a, b, v, 1);
+ // CHECK: umlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmlsl_high_laneq_u16(int32x4_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlsl_high_laneq_u16
+ return vmlsl_high_laneq_u16(a, b, v, 7);
+ // CHECK: umlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vmlsl_high_laneq_u32(int64x2_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlsl_high_laneq_u32
+ return vmlsl_high_laneq_u32(a, b, v, 3);
+ // CHECK: umlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmull_lane_s16(int16x4_t a, int16x4_t v) {
+ // CHECK: test_vmull_lane_s16
+ return vmull_lane_s16(a, v, 3);
+ // CHECK: smull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vmull_lane_s32(int32x2_t a, int32x2_t v) {
+ // CHECK: test_vmull_lane_s32
+ return vmull_lane_s32(a, v, 1);
+ // CHECK: smull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+uint32x4_t test_vmull_lane_u16(uint16x4_t a, uint16x4_t v) {
+ // CHECK: test_vmull_lane_u16
+ return vmull_lane_u16(a, v, 3);
+ // CHECK: umull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+uint64x2_t test_vmull_lane_u32(uint32x2_t a, uint32x2_t v) {
+ // CHECK: test_vmull_lane_u32
+ return vmull_lane_u32(a, v, 1);
+ // CHECK: umull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmull_high_lane_s16(int16x8_t a, int16x4_t v) {
+ // CHECK: test_vmull_high_lane_s16
+ return vmull_high_lane_s16(a, v, 3);
+ // CHECK: smull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vmull_high_lane_s32(int32x4_t a, int32x2_t v) {
+ // CHECK: test_vmull_high_lane_s32
+ return vmull_high_lane_s32(a, v, 1);
+ // CHECK: smull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+uint32x4_t test_vmull_high_lane_u16(uint16x8_t a, uint16x4_t v) {
+ // CHECK: test_vmull_high_lane_u16
+ return vmull_high_lane_u16(a, v, 3);
+ // CHECK: umull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+uint64x2_t test_vmull_high_lane_u32(uint32x4_t a, uint32x2_t v) {
+ // CHECK: test_vmull_high_lane_u32
+ return vmull_high_lane_u32(a, v, 1);
+ // CHECK: umull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vmull_laneq_s16(int16x4_t a, int16x8_t v) {
+ // CHECK: test_vmull_laneq_s16
+ return vmull_laneq_s16(a, v, 7);
+ // CHECK: smull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vmull_laneq_s32(int32x2_t a, int32x4_t v) {
+ // CHECK: test_vmull_laneq_s32
+ return vmull_laneq_s32(a, v, 3);
+ // CHECK: smull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+uint32x4_t test_vmull_laneq_u16(uint16x4_t a, uint16x8_t v) {
+ // CHECK: test_vmull_laneq_u16
+ return vmull_laneq_u16(a, v, 7);
+ // CHECK: umull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[7]
+}
+
+uint64x2_t test_vmull_laneq_u32(uint32x2_t a, uint32x4_t v) {
+ // CHECK: test_vmull_laneq_u32
+ return vmull_laneq_u32(a, v, 3);
+ // CHECK: umull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vmull_high_laneq_s16(int16x8_t a, int16x8_t v) {
+ // CHECK: test_vmull_high_laneq_s16
+ return vmull_high_laneq_s16(a, v, 7);
+ // CHECK: smull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vmull_high_laneq_s32(int32x4_t a, int32x4_t v) {
+ // CHECK: test_vmull_high_laneq_s32
+ return vmull_high_laneq_s32(a, v, 3);
+ // CHECK: smull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+uint32x4_t test_vmull_high_laneq_u16(uint16x8_t a, uint16x8_t v) {
+ // CHECK: test_vmull_high_laneq_u16
+ return vmull_high_laneq_u16(a, v, 7);
+ // CHECK: umull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+uint64x2_t test_vmull_high_laneq_u32(uint32x4_t a, uint32x4_t v) {
+ // CHECK: test_vmull_high_laneq_u32
+ return vmull_high_laneq_u32(a, v, 3);
+ // CHECK: umull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vqdmlal_lane_s16(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vqdmlal_lane_s16
+ return vqdmlal_lane_s16(a, b, v, 3);
+ // CHECK: sqdmlal {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vqdmlal_lane_s32(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vqdmlal_lane_s32
+ return vqdmlal_lane_s32(a, b, v, 1);
+ // CHECK: sqdmlal {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vqdmlal_high_lane_s16(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vqdmlal_high_lane_s16
+ return vqdmlal_high_lane_s16(a, b, v, 3);
+ // CHECK: sqdmlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vqdmlal_high_lane_s32(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vqdmlal_high_lane_s32
+ return vqdmlal_high_lane_s32(a, b, v, 1);
+ // CHECK: sqdmlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vqdmlsl_lane_s16(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vqdmlsl_lane_s16
+ return vqdmlsl_lane_s16(a, b, v, 3);
+ // CHECK: sqdmlsl {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vqdmlsl_lane_s32(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vqdmlsl_lane_s32
+ return vqdmlsl_lane_s32(a, b, v, 1);
+ // CHECK: sqdmlsl {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vqdmlsl_high_lane_s16(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vqdmlsl_high_lane_s16
+ return vqdmlsl_high_lane_s16(a, b, v, 3);
+ // CHECK: sqdmlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vqdmlsl_high_lane_s32(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vqdmlsl_high_lane_s32
+ return vqdmlsl_high_lane_s32(a, b, v, 1);
+ // CHECK: sqdmlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vqdmull_lane_s16(int16x4_t a, int16x4_t v) {
+ // CHECK: test_vqdmull_lane_s16
+ return vqdmull_lane_s16(a, v, 3);
+ // CHECK: sqdmull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vqdmull_lane_s32(int32x2_t a, int32x2_t v) {
+ // CHECK: test_vqdmull_lane_s32
+ return vqdmull_lane_s32(a, v, 1);
+ // CHECK: sqdmull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vqdmull_laneq_s16(int16x4_t a, int16x8_t v) {
+ // CHECK: test_vqdmull_laneq_s16
+ return vqdmull_laneq_s16(a, v, 3);
+ // CHECK: sqdmull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vqdmull_laneq_s32(int32x2_t a, int32x4_t v) {
+ // CHECK: test_vqdmull_laneq_s32
+ return vqdmull_laneq_s32(a, v, 3);
+ // CHECK: sqdmull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+int32x4_t test_vqdmull_high_lane_s16(int16x8_t a, int16x4_t v) {
+ // CHECK: test_vqdmull_high_lane_s16
+ return vqdmull_high_lane_s16(a, v, 3);
+ // CHECK: sqdmull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int64x2_t test_vqdmull_high_lane_s32(int32x4_t a, int32x2_t v) {
+ // CHECK: test_vqdmull_high_lane_s32
+ return vqdmull_high_lane_s32(a, v, 1);
+ // CHECK: sqdmull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vqdmull_high_laneq_s16(int16x8_t a, int16x8_t v) {
+ // CHECK: test_vqdmull_high_laneq_s16
+ return vqdmull_high_laneq_s16(a, v, 7);
+ // CHECK: sqdmull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[7]
+}
+
+int64x2_t test_vqdmull_high_laneq_s32(int32x4_t a, int32x4_t v) {
+ // CHECK: test_vqdmull_high_laneq_s32
+ return vqdmull_high_laneq_s32(a, v, 3);
+ // CHECK: sqdmull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+int16x4_t test_vqdmulh_lane_s16(int16x4_t a, int16x4_t v) {
+ // CHECK: test_vqdmulh_lane_s16
+ return vqdmulh_lane_s16(a, v, 3);
+ // CHECK: sqdmulh {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int16x8_t test_vqdmulhq_lane_s16(int16x8_t a, int16x4_t v) {
+ // CHECK: test_vqdmulhq_lane_s16
+ return vqdmulhq_lane_s16(a, v, 3);
+ // CHECK: sqdmulh {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int32x2_t test_vqdmulh_lane_s32(int32x2_t a, int32x2_t v) {
+ // CHECK: test_vqdmulh_lane_s32
+ return vqdmulh_lane_s32(a, v, 1);
+ // CHECK: sqdmulh {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vqdmulhq_lane_s32(int32x4_t a, int32x2_t v) {
+ // CHECK: test_vqdmulhq_lane_s32
+ return vqdmulhq_lane_s32(a, v, 1);
+ // CHECK: sqdmulh {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int16x4_t test_vqrdmulh_lane_s16(int16x4_t a, int16x4_t v) {
+ // CHECK: test_vqrdmulh_lane_s16
+ return vqrdmulh_lane_s16(a, v, 3);
+ // CHECK: sqrdmulh {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[3]
+}
+
+int16x8_t test_vqrdmulhq_lane_s16(int16x8_t a, int16x4_t v) {
+ // CHECK: test_vqrdmulhq_lane_s16
+ return vqrdmulhq_lane_s16(a, v, 3);
+ // CHECK: sqrdmulh {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[3]
+}
+
+int32x2_t test_vqrdmulh_lane_s32(int32x2_t a, int32x2_t v) {
+ // CHECK: test_vqrdmulh_lane_s32
+ return vqrdmulh_lane_s32(a, v, 1);
+ // CHECK: sqrdmulh {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vqrdmulhq_lane_s32(int32x4_t a, int32x2_t v) {
+ // CHECK: test_vqrdmulhq_lane_s32
+ return vqrdmulhq_lane_s32(a, v, 1);
+ // CHECK: sqrdmulh {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+float32x2_t test_vmul_lane_f32(float32x2_t a, float32x2_t v) {
+ // CHECK: test_vmul_lane_f32
+ return vmul_lane_f32(a, v, 1);
+ // CHECK: fmul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+
+float64x1_t test_vmul_lane_f64(float64x1_t a, float64x1_t v) {
+ // CHECK: test_vmul_lane_f64
+ return vmul_lane_f64(a, v, 0);
+ // CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+
+float32x4_t test_vmulq_lane_f32(float32x4_t a, float32x2_t v) {
+ // CHECK: test_vmulq_lane_f32
+ return vmulq_lane_f32(a, v, 1);
+ // CHECK: fmul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+float64x2_t test_vmulq_lane_f64(float64x2_t a, float64x1_t v) {
+ // CHECK: test_vmulq_lane_f64
+ return vmulq_lane_f64(a, v, 0);
+ // CHECK: fmul {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+float32x2_t test_vmul_laneq_f32(float32x2_t a, float32x4_t v) {
+ // CHECK: test_vmul_laneq_f32
+ return vmul_laneq_f32(a, v, 3);
+ // CHECK: fmul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+float64x1_t test_vmul_laneq_f64(float64x1_t a, float64x2_t v) {
+ // CHECK: test_vmul_laneq_f64
+ return vmul_laneq_f64(a, v, 1);
+ // CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+
+float32x4_t test_vmulq_laneq_f32(float32x4_t a, float32x4_t v) {
+ // CHECK: test_vmulq_laneq_f32
+ return vmulq_laneq_f32(a, v, 3);
+ // CHECK: fmul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+float64x2_t test_vmulq_laneq_f64(float64x2_t a, float64x2_t v) {
+ // CHECK: test_vmulq_laneq_f64
+ return vmulq_laneq_f64(a, v, 1);
+ // CHECK: fmul {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[1]
+}
+
+float32x2_t test_vmulx_lane_f32(float32x2_t a, float32x2_t v) {
+ // CHECK: test_vmulx_lane_f32
+ return vmulx_lane_f32(a, v, 1);
+ // CHECK: fmulx {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+float32x4_t test_vmulxq_lane_f32(float32x4_t a, float32x2_t v) {
+ // CHECK: test_vmulxq_lane_f32
+ return vmulxq_lane_f32(a, v, 1);
+ // CHECK: fmulx {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+float64x2_t test_vmulxq_lane_f64(float64x2_t a, float64x1_t v) {
+ // CHECK: test_vmulxq_lane_f64
+ return vmulxq_lane_f64(a, v, 0);
+ // CHECK: fmulx {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+float32x2_t test_vmulx_laneq_f32(float32x2_t a, float32x4_t v) {
+ // CHECK: test_vmulx_laneq_f32
+ return vmulx_laneq_f32(a, v, 3);
+ // CHECK: fmulx {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[3]
+}
+
+float32x4_t test_vmulxq_laneq_f32(float32x4_t a, float32x4_t v) {
+ // CHECK: test_vmulxq_laneq_f32
+ return vmulxq_laneq_f32(a, v, 3);
+ // CHECK: fmulx {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[3]
+}
+
+float64x2_t test_vmulxq_laneq_f64(float64x2_t a, float64x2_t v) {
+ // CHECK: test_vmulxq_laneq_f64
+ return vmulxq_laneq_f64(a, v, 1);
+ // CHECK: fmulx {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[1]
+}
+
+int16x4_t test_vmla_lane_s16_0(int16x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmla_lane_s16_0
+ return vmla_lane_s16(a, b, v, 0);
+ // CHECK: mla {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int16x8_t test_vmlaq_lane_s16_0(int16x8_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlaq_lane_s16_0
+ return vmlaq_lane_s16(a, b, v, 0);
+ // CHECK: mla {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int32x2_t test_vmla_lane_s32_0(int32x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmla_lane_s32_0
+ return vmla_lane_s32(a, b, v, 0);
+ // CHECK: mla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlaq_lane_s32_0(int32x4_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlaq_lane_s32_0
+ return vmlaq_lane_s32(a, b, v, 0);
+ // CHECK: mla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int16x4_t test_vmla_laneq_s16_0(int16x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmla_laneq_s16_0
+ return vmla_laneq_s16(a, b, v, 0);
+ // CHECK: mla {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int16x8_t test_vmlaq_laneq_s16_0(int16x8_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlaq_laneq_s16_0
+ return vmlaq_laneq_s16(a, b, v, 0);
+ // CHECK: mla {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int32x2_t test_vmla_laneq_s32_0(int32x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmla_laneq_s32_0
+ return vmla_laneq_s32(a, b, v, 0);
+ // CHECK: mla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlaq_laneq_s32_0(int32x4_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlaq_laneq_s32_0
+ return vmlaq_laneq_s32(a, b, v, 0);
+ // CHECK: mla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int16x4_t test_vmls_lane_s16_0(int16x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmls_lane_s16_0
+ return vmls_lane_s16(a, b, v, 0);
+ // CHECK: mls {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int16x8_t test_vmlsq_lane_s16_0(int16x8_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlsq_lane_s16_0
+ return vmlsq_lane_s16(a, b, v, 0);
+ // CHECK: mls {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int32x2_t test_vmls_lane_s32_0(int32x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmls_lane_s32_0
+ return vmls_lane_s32(a, b, v, 0);
+ // CHECK: mls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsq_lane_s32_0(int32x4_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlsq_lane_s32_0
+ return vmlsq_lane_s32(a, b, v, 0);
+ // CHECK: mls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int16x4_t test_vmls_laneq_s16_0(int16x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmls_laneq_s16_0
+ return vmls_laneq_s16(a, b, v, 0);
+ // CHECK: mls {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int16x8_t test_vmlsq_laneq_s16_0(int16x8_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlsq_laneq_s16_0
+ return vmlsq_laneq_s16(a, b, v, 0);
+ // CHECK: mls {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int32x2_t test_vmls_laneq_s32_0(int32x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmls_laneq_s32_0
+ return vmls_laneq_s32(a, b, v, 0);
+ // CHECK: mls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsq_laneq_s32_0(int32x4_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlsq_laneq_s32_0
+ return vmlsq_laneq_s32(a, b, v, 0);
+ // CHECK: mls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int16x4_t test_vmul_lane_s16_0(int16x4_t a, int16x4_t v) {
+ // CHECK: test_vmul_lane_s16_0
+ return vmul_lane_s16(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int16x8_t test_vmulq_lane_s16_0(int16x8_t a, int16x4_t v) {
+ // CHECK: test_vmulq_lane_s16_0
+ return vmulq_lane_s16(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int32x2_t test_vmul_lane_s32_0(int32x2_t a, int32x2_t v) {
+ // CHECK: test_vmul_lane_s32_0
+ return vmul_lane_s32(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmulq_lane_s32_0(int32x4_t a, int32x2_t v) {
+ // CHECK: test_vmulq_lane_s32_0
+ return vmulq_lane_s32(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+uint16x4_t test_vmul_lane_u16_0(uint16x4_t a, uint16x4_t v) {
+ // CHECK: test_vmul_lane_u16_0
+ return vmul_lane_u16(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+uint16x8_t test_vmulq_lane_u16_0(uint16x8_t a, uint16x4_t v) {
+ // CHECK: test_vmulq_lane_u16_0
+ return vmulq_lane_u16(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+uint32x2_t test_vmul_lane_u32_0(uint32x2_t a, uint32x2_t v) {
+ // CHECK: test_vmul_lane_u32_0
+ return vmul_lane_u32(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vmulq_lane_u32_0(uint32x4_t a, uint32x2_t v) {
+ // CHECK: test_vmulq_lane_u32_0
+ return vmulq_lane_u32(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int16x4_t test_vmul_laneq_s16_0(int16x4_t a, int16x8_t v) {
+ // CHECK: test_vmul_laneq_s16_0
+ return vmul_laneq_s16(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int16x8_t test_vmulq_laneq_s16_0(int16x8_t a, int16x8_t v) {
+ // CHECK: test_vmulq_laneq_s16_0
+ return vmulq_laneq_s16(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int32x2_t test_vmul_laneq_s32_0(int32x2_t a, int32x4_t v) {
+ // CHECK: test_vmul_laneq_s32_0
+ return vmul_laneq_s32(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmulq_laneq_s32_0(int32x4_t a, int32x4_t v) {
+ // CHECK: test_vmulq_laneq_s32_0
+ return vmulq_laneq_s32(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+uint16x4_t test_vmul_laneq_u16_0(uint16x4_t a, uint16x8_t v) {
+ // CHECK: test_vmul_laneq_u16_0
+ return vmul_laneq_u16(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+uint16x8_t test_vmulq_laneq_u16_0(uint16x8_t a, uint16x8_t v) {
+ // CHECK: test_vmulq_laneq_u16_0
+ return vmulq_laneq_u16(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+uint32x2_t test_vmul_laneq_u32_0(uint32x2_t a, uint32x4_t v) {
+ // CHECK: test_vmul_laneq_u32_0
+ return vmul_laneq_u32(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vmulq_laneq_u32_0(uint32x4_t a, uint32x4_t v) {
+ // CHECK: test_vmulq_laneq_u32_0
+ return vmulq_laneq_u32(a, v, 0);
+ // CHECK: mul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float32x2_t test_vfma_lane_f32_0(float32x2_t a, float32x2_t b, float32x2_t v) {
+ // CHECK: test_vfma_lane_f32_0
+ return vfma_lane_f32(a, b, v, 0);
+ // CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vfmaq_lane_f32_0(float32x4_t a, float32x4_t b, float32x2_t v) {
+ // CHECK: test_vfmaq_lane_f32_0
+ return vfmaq_lane_f32(a, b, v, 0);
+ // CHECK: fmla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float32x2_t test_vfma_laneq_f32_0(float32x2_t a, float32x2_t b, float32x4_t v) {
+ // CHECK: test_vfma_laneq_f32_0
+ return vfma_laneq_f32(a, b, v, 0);
+ // CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vfmaq_laneq_f32_0(float32x4_t a, float32x4_t b, float32x4_t v) {
+ // CHECK: test_vfmaq_laneq_f32_0
+ return vfmaq_laneq_f32(a, b, v, 0);
+ // CHECK: fmla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float32x2_t test_vfms_lane_f32_0(float32x2_t a, float32x2_t b, float32x2_t v) {
+ // CHECK: test_vfms_lane_f32_0
+ return vfms_lane_f32(a, b, v, 0);
+ // CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vfmsq_lane_f32_0(float32x4_t a, float32x4_t b, float32x2_t v) {
+ // CHECK: test_vfmsq_lane_f32_0
+ return vfmsq_lane_f32(a, b, v, 0);
+ // CHECK: fmls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float32x2_t test_vfms_laneq_f32_0(float32x2_t a, float32x2_t b, float32x4_t v) {
+ // CHECK: test_vfms_laneq_f32_0
+ return vfms_laneq_f32(a, b, v, 0);
+ // CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vfmsq_laneq_f32_0(float32x4_t a, float32x4_t b, float32x4_t v) {
+ // CHECK: test_vfmsq_laneq_f32_0
+ return vfmsq_laneq_f32(a, b, v, 0);
+ // CHECK: fmls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float64x2_t test_vfmaq_laneq_f64_0(float64x2_t a, float64x2_t b, float64x2_t v) {
+ // CHECK: test_vfmaq_laneq_f64_0
+ return vfmaq_laneq_f64(a, b, v, 0);
+ // CHECK: fmla {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+float64x2_t test_vfmsq_laneq_f64_0(float64x2_t a, float64x2_t b, float64x2_t v) {
+ // CHECK: test_vfmsq_laneq_f64_0
+ return vfmsq_laneq_f64(a, b, v, 0);
+ // CHECK: fmls {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+int32x4_t test_vmlal_lane_s16_0(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmlal_lane_s16_0
+ return vmlal_lane_s16(a, b, v, 0);
+ // CHECK: smlal {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlal_lane_s32_0(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmlal_lane_s32_0
+ return vmlal_lane_s32(a, b, v, 0);
+ // CHECK: smlal {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlal_laneq_s16_0(int32x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmlal_laneq_s16_0
+ return vmlal_laneq_s16(a, b, v, 0);
+ // CHECK: smlal {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlal_laneq_s32_0(int64x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmlal_laneq_s32_0
+ return vmlal_laneq_s32(a, b, v, 0);
+ // CHECK: smlal {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlal_high_lane_s16_0(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlal_high_lane_s16_0
+ return vmlal_high_lane_s16(a, b, v, 0);
+ // CHECK: smlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlal_high_lane_s32_0(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlal_high_lane_s32_0
+ return vmlal_high_lane_s32(a, b, v, 0);
+ // CHECK: smlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlal_high_laneq_s16_0(int32x4_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlal_high_laneq_s16_0
+ return vmlal_high_laneq_s16(a, b, v, 0);
+ // CHECK: smlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlal_high_laneq_s32_0(int64x2_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlal_high_laneq_s32_0
+ return vmlal_high_laneq_s32(a, b, v, 0);
+ // CHECK: smlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsl_lane_s16_0(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmlsl_lane_s16_0
+ return vmlsl_lane_s16(a, b, v, 0);
+ // CHECK: smlsl {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlsl_lane_s32_0(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmlsl_lane_s32_0
+ return vmlsl_lane_s32(a, b, v, 0);
+ // CHECK: smlsl {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsl_laneq_s16_0(int32x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmlsl_laneq_s16_0
+ return vmlsl_laneq_s16(a, b, v, 0);
+ // CHECK: smlsl {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlsl_laneq_s32_0(int64x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmlsl_laneq_s32_0
+ return vmlsl_laneq_s32(a, b, v, 0);
+ // CHECK: smlsl {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsl_high_lane_s16_0(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlsl_high_lane_s16_0
+ return vmlsl_high_lane_s16(a, b, v, 0);
+ // CHECK: smlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlsl_high_lane_s32_0(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlsl_high_lane_s32_0
+ return vmlsl_high_lane_s32(a, b, v, 0);
+ // CHECK: smlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsl_high_laneq_s16_0(int32x4_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlsl_high_laneq_s16_0
+ return vmlsl_high_laneq_s16(a, b, v, 0);
+ // CHECK: smlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlsl_high_laneq_s32_0(int64x2_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlsl_high_laneq_s32_0
+ return vmlsl_high_laneq_s32(a, b, v, 0);
+ // CHECK: smlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlal_lane_u16_0(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmlal_lane_u16_0
+ return vmlal_lane_u16(a, b, v, 0);
+ // CHECK: umlal {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlal_lane_u32_0(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmlal_lane_u32_0
+ return vmlal_lane_u32(a, b, v, 0);
+ // CHECK: umlal {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlal_laneq_u16_0(int32x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmlal_laneq_u16_0
+ return vmlal_laneq_u16(a, b, v, 0);
+ // CHECK: umlal {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlal_laneq_u32_0(int64x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmlal_laneq_u32_0
+ return vmlal_laneq_u32(a, b, v, 0);
+ // CHECK: umlal {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlal_high_lane_u16_0(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlal_high_lane_u16_0
+ return vmlal_high_lane_u16(a, b, v, 0);
+ // CHECK: umlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlal_high_lane_u32_0(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlal_high_lane_u32_0
+ return vmlal_high_lane_u32(a, b, v, 0);
+ // CHECK: umlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlal_high_laneq_u16_0(int32x4_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlal_high_laneq_u16_0
+ return vmlal_high_laneq_u16(a, b, v, 0);
+ // CHECK: umlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlal_high_laneq_u32_0(int64x2_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlal_high_laneq_u32_0
+ return vmlal_high_laneq_u32(a, b, v, 0);
+ // CHECK: umlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsl_lane_u16_0(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vmlsl_lane_u16_0
+ return vmlsl_lane_u16(a, b, v, 0);
+ // CHECK: umlsl {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlsl_lane_u32_0(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vmlsl_lane_u32_0
+ return vmlsl_lane_u32(a, b, v, 0);
+ // CHECK: umlsl {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsl_laneq_u16_0(int32x4_t a, int16x4_t b, int16x8_t v) {
+ // CHECK: test_vmlsl_laneq_u16_0
+ return vmlsl_laneq_u16(a, b, v, 0);
+ // CHECK: umlsl {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlsl_laneq_u32_0(int64x2_t a, int32x2_t b, int32x4_t v) {
+ // CHECK: test_vmlsl_laneq_u32_0
+ return vmlsl_laneq_u32(a, b, v, 0);
+ // CHECK: umlsl {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsl_high_lane_u16_0(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vmlsl_high_lane_u16_0
+ return vmlsl_high_lane_u16(a, b, v, 0);
+ // CHECK: umlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlsl_high_lane_u32_0(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vmlsl_high_lane_u32_0
+ return vmlsl_high_lane_u32(a, b, v, 0);
+ // CHECK: umlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsl_high_laneq_u16_0(int32x4_t a, int16x8_t b, int16x8_t v) {
+ // CHECK: test_vmlsl_high_laneq_u16_0
+ return vmlsl_high_laneq_u16(a, b, v, 0);
+ // CHECK: umlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlsl_high_laneq_u32_0(int64x2_t a, int32x4_t b, int32x4_t v) {
+ // CHECK: test_vmlsl_high_laneq_u32_0
+ return vmlsl_high_laneq_u32(a, b, v, 0);
+ // CHECK: umlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmull_lane_s16_0(int16x4_t a, int16x4_t v) {
+ // CHECK: test_vmull_lane_s16_0
+ return vmull_lane_s16(a, v, 0);
+ // CHECK: smull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmull_lane_s32_0(int32x2_t a, int32x2_t v) {
+ // CHECK: test_vmull_lane_s32_0
+ return vmull_lane_s32(a, v, 0);
+ // CHECK: smull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vmull_lane_u16_0(uint16x4_t a, uint16x4_t v) {
+ // CHECK: test_vmull_lane_u16_0
+ return vmull_lane_u16(a, v, 0);
+ // CHECK: umull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+uint64x2_t test_vmull_lane_u32_0(uint32x2_t a, uint32x2_t v) {
+ // CHECK: test_vmull_lane_u32_0
+ return vmull_lane_u32(a, v, 0);
+ // CHECK: umull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmull_high_lane_s16_0(int16x8_t a, int16x4_t v) {
+ // CHECK: test_vmull_high_lane_s16_0
+ return vmull_high_lane_s16(a, v, 0);
+ // CHECK: smull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmull_high_lane_s32_0(int32x4_t a, int32x2_t v) {
+ // CHECK: test_vmull_high_lane_s32_0
+ return vmull_high_lane_s32(a, v, 0);
+ // CHECK: smull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vmull_high_lane_u16_0(uint16x8_t a, uint16x4_t v) {
+ // CHECK: test_vmull_high_lane_u16_0
+ return vmull_high_lane_u16(a, v, 0);
+ // CHECK: umull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+uint64x2_t test_vmull_high_lane_u32_0(uint32x4_t a, uint32x2_t v) {
+ // CHECK: test_vmull_high_lane_u32_0
+ return vmull_high_lane_u32(a, v, 0);
+ // CHECK: umull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmull_laneq_s16_0(int16x4_t a, int16x8_t v) {
+ // CHECK: test_vmull_laneq_s16_0
+ return vmull_laneq_s16(a, v, 0);
+ // CHECK: smull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmull_laneq_s32_0(int32x2_t a, int32x4_t v) {
+ // CHECK: test_vmull_laneq_s32_0
+ return vmull_laneq_s32(a, v, 0);
+ // CHECK: smull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vmull_laneq_u16_0(uint16x4_t a, uint16x8_t v) {
+ // CHECK: test_vmull_laneq_u16_0
+ return vmull_laneq_u16(a, v, 0);
+ // CHECK: umull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+uint64x2_t test_vmull_laneq_u32_0(uint32x2_t a, uint32x4_t v) {
+ // CHECK: test_vmull_laneq_u32_0
+ return vmull_laneq_u32(a, v, 0);
+ // CHECK: umull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmull_high_laneq_s16_0(int16x8_t a, int16x8_t v) {
+ // CHECK: test_vmull_high_laneq_s16_0
+ return vmull_high_laneq_s16(a, v, 0);
+ // CHECK: smull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmull_high_laneq_s32_0(int32x4_t a, int32x4_t v) {
+ // CHECK: test_vmull_high_laneq_s32_0
+ return vmull_high_laneq_s32(a, v, 0);
+ // CHECK: smull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vmull_high_laneq_u16_0(uint16x8_t a, uint16x8_t v) {
+ // CHECK: test_vmull_high_laneq_u16_0
+ return vmull_high_laneq_u16(a, v, 0);
+ // CHECK: umull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+uint64x2_t test_vmull_high_laneq_u32_0(uint32x4_t a, uint32x4_t v) {
+ // CHECK: test_vmull_high_laneq_u32_0
+ return vmull_high_laneq_u32(a, v, 0);
+ // CHECK: umull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmlal_lane_s16_0(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vqdmlal_lane_s16_0
+ return vqdmlal_lane_s16(a, b, v, 0);
+ // CHECK: sqdmlal {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmlal_lane_s32_0(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vqdmlal_lane_s32_0
+ return vqdmlal_lane_s32(a, b, v, 0);
+ // CHECK: sqdmlal {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmlal_high_lane_s16_0(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vqdmlal_high_lane_s16_0
+ return vqdmlal_high_lane_s16(a, b, v, 0);
+ // CHECK: sqdmlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmlal_high_lane_s32_0(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vqdmlal_high_lane_s32_0
+ return vqdmlal_high_lane_s32(a, b, v, 0);
+ // CHECK: sqdmlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmlsl_lane_s16_0(int32x4_t a, int16x4_t b, int16x4_t v) {
+ // CHECK: test_vqdmlsl_lane_s16_0
+ return vqdmlsl_lane_s16(a, b, v, 0);
+ // CHECK: sqdmlsl {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmlsl_lane_s32_0(int64x2_t a, int32x2_t b, int32x2_t v) {
+ // CHECK: test_vqdmlsl_lane_s32_0
+ return vqdmlsl_lane_s32(a, b, v, 0);
+ // CHECK: sqdmlsl {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmlsl_high_lane_s16_0(int32x4_t a, int16x8_t b, int16x4_t v) {
+ // CHECK: test_vqdmlsl_high_lane_s16_0
+ return vqdmlsl_high_lane_s16(a, b, v, 0);
+ // CHECK: sqdmlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmlsl_high_lane_s32_0(int64x2_t a, int32x4_t b, int32x2_t v) {
+ // CHECK: test_vqdmlsl_high_lane_s32_0
+ return vqdmlsl_high_lane_s32(a, b, v, 0);
+ // CHECK: sqdmlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmull_lane_s16_0(int16x4_t a, int16x4_t v) {
+ // CHECK: test_vqdmull_lane_s16_0
+ return vqdmull_lane_s16(a, v, 0);
+ // CHECK: sqdmull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmull_lane_s32_0(int32x2_t a, int32x2_t v) {
+ // CHECK: test_vqdmull_lane_s32_0
+ return vqdmull_lane_s32(a, v, 0);
+ // CHECK: sqdmull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmull_laneq_s16_0(int16x4_t a, int16x8_t v) {
+ // CHECK: test_vqdmull_laneq_s16_0
+ return vqdmull_laneq_s16(a, v, 0);
+ // CHECK: sqdmull {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmull_laneq_s32_0(int32x2_t a, int32x4_t v) {
+ // CHECK: test_vqdmull_laneq_s32_0
+ return vqdmull_laneq_s32(a, v, 0);
+ // CHECK: sqdmull {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmull_high_lane_s16_0(int16x8_t a, int16x4_t v) {
+ // CHECK: test_vqdmull_high_lane_s16_0
+ return vqdmull_high_lane_s16(a, v, 0);
+ // CHECK: sqdmull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmull_high_lane_s32_0(int32x4_t a, int32x2_t v) {
+ // CHECK: test_vqdmull_high_lane_s32_0
+ return vqdmull_high_lane_s32(a, v, 0);
+ // CHECK: sqdmull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmull_high_laneq_s16_0(int16x8_t a, int16x8_t v) {
+ // CHECK: test_vqdmull_high_laneq_s16_0
+ return vqdmull_high_laneq_s16(a, v, 0);
+ // CHECK: sqdmull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmull_high_laneq_s32_0(int32x4_t a, int32x4_t v) {
+ // CHECK: test_vqdmull_high_laneq_s32_0
+ return vqdmull_high_laneq_s32(a, v, 0);
+ // CHECK: sqdmull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int16x4_t test_vqdmulh_lane_s16_0(int16x4_t a, int16x4_t v) {
+ // CHECK: test_vqdmulh_lane_s16_0
+ return vqdmulh_lane_s16(a, v, 0);
+ // CHECK: sqdmulh {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int16x8_t test_vqdmulhq_lane_s16_0(int16x8_t a, int16x4_t v) {
+ // CHECK: test_vqdmulhq_lane_s16_0
+ return vqdmulhq_lane_s16(a, v, 0);
+ // CHECK: sqdmulh {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int32x2_t test_vqdmulh_lane_s32_0(int32x2_t a, int32x2_t v) {
+ // CHECK: test_vqdmulh_lane_s32_0
+ return vqdmulh_lane_s32(a, v, 0);
+ // CHECK: sqdmulh {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmulhq_lane_s32_0(int32x4_t a, int32x2_t v) {
+ // CHECK: test_vqdmulhq_lane_s32_0
+ return vqdmulhq_lane_s32(a, v, 0);
+ // CHECK: sqdmulh {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int16x4_t test_vqrdmulh_lane_s16_0(int16x4_t a, int16x4_t v) {
+ // CHECK: test_vqrdmulh_lane_s16_0
+ return vqrdmulh_lane_s16(a, v, 0);
+ // CHECK: sqrdmulh {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.h[0]
+}
+
+int16x8_t test_vqrdmulhq_lane_s16_0(int16x8_t a, int16x4_t v) {
+ // CHECK: test_vqrdmulhq_lane_s16_0
+ return vqrdmulhq_lane_s16(a, v, 0);
+ // CHECK: sqrdmulh {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int32x2_t test_vqrdmulh_lane_s32_0(int32x2_t a, int32x2_t v) {
+ // CHECK: test_vqrdmulh_lane_s32_0
+ return vqrdmulh_lane_s32(a, v, 0);
+ // CHECK: sqrdmulh {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqrdmulhq_lane_s32_0(int32x4_t a, int32x2_t v) {
+ // CHECK: test_vqrdmulhq_lane_s32_0
+ return vqrdmulhq_lane_s32(a, v, 0);
+ // CHECK: sqrdmulh {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float32x2_t test_vmul_lane_f32_0(float32x2_t a, float32x2_t v) {
+ // CHECK: test_vmul_lane_f32_0
+ return vmul_lane_f32(a, v, 0);
+ // CHECK: fmul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vmulq_lane_f32_0(float32x4_t a, float32x2_t v) {
+ // CHECK: test_vmulq_lane_f32_0
+ return vmulq_lane_f32(a, v, 0);
+ // CHECK: fmul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float32x2_t test_vmul_laneq_f32_0(float32x2_t a, float32x4_t v) {
+ // CHECK: test_vmul_laneq_f32_0
+ return vmul_laneq_f32(a, v, 0);
+ // CHECK: fmul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float64x1_t test_vmul_laneq_f64_0(float64x1_t a, float64x2_t v) {
+ // CHECK: test_vmul_laneq_f64_0
+ return vmul_laneq_f64(a, v, 0);
+ // CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+float32x4_t test_vmulq_laneq_f32_0(float32x4_t a, float32x4_t v) {
+ // CHECK: test_vmulq_laneq_f32_0
+ return vmulq_laneq_f32(a, v, 0);
+ // CHECK: fmul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float64x2_t test_vmulq_laneq_f64_0(float64x2_t a, float64x2_t v) {
+ // CHECK: test_vmulq_laneq_f64_0
+ return vmulq_laneq_f64(a, v, 0);
+ // CHECK: fmul {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+float32x2_t test_vmulx_lane_f32_0(float32x2_t a, float32x2_t v) {
+ // CHECK: test_vmulx_lane_f32_0
+ return vmulx_lane_f32(a, v, 0);
+ // CHECK: fmulx {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vmulxq_lane_f32_0(float32x4_t a, float32x2_t v) {
+ // CHECK: test_vmulxq_lane_f32_0
+ return vmulxq_lane_f32(a, v, 0);
+ // CHECK: fmulx {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float64x2_t test_vmulxq_lane_f64_0(float64x2_t a, float64x1_t v) {
+ // CHECK: test_vmulxq_lane_f64_0
+ return vmulxq_lane_f64(a, v, 0);
+ // CHECK: fmulx {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+float32x2_t test_vmulx_laneq_f32_0(float32x2_t a, float32x4_t v) {
+ // CHECK: test_vmulx_laneq_f32_0
+ return vmulx_laneq_f32(a, v, 0);
+ // CHECK: fmulx {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vmulxq_laneq_f32_0(float32x4_t a, float32x4_t v) {
+ // CHECK: test_vmulxq_laneq_f32_0
+ return vmulxq_laneq_f32(a, v, 0);
+ // CHECK: fmulx {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float64x2_t test_vmulxq_laneq_f64_0(float64x2_t a, float64x2_t v) {
+ // CHECK: test_vmulxq_laneq_f64_0
+ return vmulxq_laneq_f64(a, v, 0);
+ // CHECK: fmulx {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+int32x4_t test_vmull_high_n_s16(int16x8_t a, int16_t b) {
+ // CHECK: test_vmull_high_n_s16
+ return vmull_high_n_s16(a, b);
+ // CHECK: smull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmull_high_n_s32(int32x4_t a, int32_t b) {
+ // CHECK: test_vmull_high_n_s32
+ return vmull_high_n_s32(a, b);
+ // CHECK: smull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vmull_high_n_u16(uint16x8_t a, uint16_t b) {
+ // CHECK: test_vmull_high_n_u16
+ return vmull_high_n_u16(a, b);
+ // CHECK: umull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+uint64x2_t test_vmull_high_n_u32(uint32x4_t a, uint32_t b) {
+ // CHECK: test_vmull_high_n_u32
+ return vmull_high_n_u32(a, b);
+ // CHECK: umull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmull_high_n_s16(int16x8_t a, int16_t b) {
+ // CHECK: test_vqdmull_high_n_s16
+ return vqdmull_high_n_s16(a, b);
+ // CHECK: sqdmull2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmull_high_n_s32(int32x4_t a, int32_t b) {
+ // CHECK: test_vqdmull_high_n_s32
+ return vqdmull_high_n_s32(a, b);
+ // CHECK: sqdmull2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlal_high_n_s16(int32x4_t a, int16x8_t b, int16_t c) {
+ // CHECK: test_vmlal_high_n_s16
+ return vmlal_high_n_s16(a, b, c);
+ // CHECK: smlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlal_high_n_s32(int64x2_t a, int32x4_t b, int32_t c) {
+ // CHECK: test_vmlal_high_n_s32
+ return vmlal_high_n_s32(a, b, c);
+ // CHECK: smlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vmlal_high_n_u16(uint32x4_t a, uint16x8_t b, uint16_t c) {
+ // CHECK: test_vmlal_high_n_u16
+ return vmlal_high_n_u16(a, b, c);
+ // CHECK: umlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+uint64x2_t test_vmlal_high_n_u32(uint64x2_t a, uint32x4_t b, uint32_t c) {
+ // CHECK: test_vmlal_high_n_u32
+ return vmlal_high_n_u32(a, b, c);
+ // CHECK: umlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmlal_high_n_s16(int32x4_t a, int16x8_t b, int16_t c) {
+ // CHECK: test_vqdmlal_high_n_s16
+ return vqdmlal_high_n_s16(a, b, c);
+ // CHECK: sqdmlal2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmlal_high_n_s32(int64x2_t a, int32x4_t b, int32_t c) {
+ // CHECK: test_vqdmlal_high_n_s32
+ return vqdmlal_high_n_s32(a, b, c);
+ // CHECK: sqdmlal2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vmlsl_high_n_s16(int32x4_t a, int16x8_t b, int16_t c) {
+ // CHECK: test_vmlsl_high_n_s16
+ return vmlsl_high_n_s16(a, b, c);
+ // CHECK: smlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vmlsl_high_n_s32(int64x2_t a, int32x4_t b, int32_t c) {
+ // CHECK: test_vmlsl_high_n_s32
+ return vmlsl_high_n_s32(a, b, c);
+ // CHECK: smlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vmlsl_high_n_u16(uint32x4_t a, uint16x8_t b, uint16_t c) {
+ // CHECK: test_vmlsl_high_n_u16
+ return vmlsl_high_n_u16(a, b, c);
+ // CHECK: umlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+uint64x2_t test_vmlsl_high_n_u32(uint64x2_t a, uint32x4_t b, uint32_t c) {
+ // CHECK: test_vmlsl_high_n_u32
+ return vmlsl_high_n_u32(a, b, c);
+ // CHECK: umlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vqdmlsl_high_n_s16(int32x4_t a, int16x8_t b, int16_t c) {
+ // CHECK: test_vqdmlsl_high_n_s16
+ return vqdmlsl_high_n_s16(a, b, c);
+ // CHECK: sqdmlsl2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, {{v[0-9]+}}.h[0]
+}
+
+int64x2_t test_vqdmlsl_high_n_s32(int64x2_t a, int32x4_t b, int32_t c) {
+ // CHECK: test_vqdmlsl_high_n_s32
+ return vqdmlsl_high_n_s32(a, b, c);
+ // CHECK: sqdmlsl2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float32x2_t test_vmul_n_f32(float32x2_t a, float32_t b) {
+ // CHECK: test_vmul_n_f32
+ return vmul_n_f32(a, b);
+ // CHECK: fmul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vmulq_n_f32(float32x4_t a, float32_t b) {
+ // CHECK: test_vmulq_n_f32
+ return vmulq_n_f32(a, b);
+ // CHECK: fmul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float64x2_t test_vmulq_n_f64(float64x2_t a, float64_t b) {
+ // CHECK: test_vmulq_n_f64
+ return vmulq_n_f64(a, b);
+ // CHECK: fmul {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+float32x2_t test_vfma_n_f32(float32x2_t a, float32x2_t b, float32_t n) {
+ // CHECK: test_vfma_n_f32
+ return vfma_n_f32(a, b, n);
+ // CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vfmaq_n_f32(float32x4_t a, float32x4_t b, float32_t n) {
+ // CHECK: test_vfmaq_n_f32
+ return vfmaq_n_f32(a, b, n);
+ // CHECK: fmla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float32x2_t test_vfms_n_f32(float32x2_t a, float32x2_t b, float32_t n) {
+ // CHECK: test_vfms_n_f32
+ return vfms_n_f32(a, b, n);
+ // CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vfmsq_n_f32(float32x4_t a, float32x4_t b, float32_t n) {
+ // CHECK: test_vfmsq_n_f32
+ return vfmsq_n_f32(a, b, n);
+ // CHECK: fmls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
diff --git a/test/CodeGen/aarch64-neon-across.c b/test/CodeGen/aarch64-neon-across.c
new file mode 100644
index 000000000000..257b839e2248
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-across.c
@@ -0,0 +1,271 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+int16_t test_vaddlv_s8(int8x8_t a) {
+ // CHECK: test_vaddlv_s8
+ return vaddlv_s8(a);
+ // CHECK: saddlv {{h[0-9]+}}, {{v[0-9]+}}.8b
+}
+
+int32_t test_vaddlv_s16(int16x4_t a) {
+ // CHECK: test_vaddlv_s16
+ return vaddlv_s16(a);
+ // CHECK: saddlv {{s[0-9]+}}, {{v[0-9]+}}.4h
+}
+
+uint16_t test_vaddlv_u8(uint8x8_t a) {
+ // CHECK: test_vaddlv_u8
+ return vaddlv_u8(a);
+ // CHECK: uaddlv {{h[0-9]+}}, {{v[0-9]+}}.8b
+}
+
+uint32_t test_vaddlv_u16(uint16x4_t a) {
+ // CHECK: test_vaddlv_u16
+ return vaddlv_u16(a);
+ // CHECK: uaddlv {{s[0-9]+}}, {{v[0-9]+}}.4h
+}
+
+int16_t test_vaddlvq_s8(int8x16_t a) {
+ // CHECK: test_vaddlvq_s8
+ return vaddlvq_s8(a);
+ // CHECK: saddlv {{h[0-9]+}}, {{v[0-9]+}}.16b
+}
+
+int32_t test_vaddlvq_s16(int16x8_t a) {
+ // CHECK: test_vaddlvq_s16
+ return vaddlvq_s16(a);
+ // CHECK: saddlv {{s[0-9]+}}, {{v[0-9]+}}.8h
+}
+
+int64_t test_vaddlvq_s32(int32x4_t a) {
+ // CHECK: test_vaddlvq_s32
+ return vaddlvq_s32(a);
+ // CHECK: saddlv {{d[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+uint16_t test_vaddlvq_u8(uint8x16_t a) {
+ // CHECK: test_vaddlvq_u8
+ return vaddlvq_u8(a);
+ // CHECK: uaddlv {{h[0-9]+}}, {{v[0-9]+}}.16b
+}
+
+uint32_t test_vaddlvq_u16(uint16x8_t a) {
+ // CHECK: test_vaddlvq_u16
+ return vaddlvq_u16(a);
+ // CHECK: uaddlv {{s[0-9]+}}, {{v[0-9]+}}.8h
+}
+
+uint64_t test_vaddlvq_u32(uint32x4_t a) {
+ // CHECK: test_vaddlvq_u32
+ return vaddlvq_u32(a);
+ // CHECK: uaddlv {{d[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+int8_t test_vmaxv_s8(int8x8_t a) {
+ // CHECK: test_vmaxv_s8
+ return vmaxv_s8(a);
+ // CHECK: smaxv {{b[0-9]+}}, {{v[0-9]+}}.8b
+}
+
+int16_t test_vmaxv_s16(int16x4_t a) {
+ // CHECK: test_vmaxv_s16
+ return vmaxv_s16(a);
+ // CHECK: smaxv {{h[0-9]+}}, {{v[0-9]+}}.4h
+}
+
+uint8_t test_vmaxv_u8(uint8x8_t a) {
+ // CHECK: test_vmaxv_u8
+ return vmaxv_u8(a);
+ // CHECK: umaxv {{b[0-9]+}}, {{v[0-9]+}}.8b
+}
+
+uint16_t test_vmaxv_u16(uint16x4_t a) {
+ // CHECK: test_vmaxv_u16
+ return vmaxv_u16(a);
+ // CHECK: umaxv {{h[0-9]+}}, {{v[0-9]+}}.4h
+}
+
+int8_t test_vmaxvq_s8(int8x16_t a) {
+ // CHECK: test_vmaxvq_s8
+ return vmaxvq_s8(a);
+ // CHECK: smaxv {{b[0-9]+}}, {{v[0-9]+}}.16b
+}
+
+int16_t test_vmaxvq_s16(int16x8_t a) {
+ // CHECK: test_vmaxvq_s16
+ return vmaxvq_s16(a);
+ // CHECK: smaxv {{h[0-9]+}}, {{v[0-9]+}}.8h
+}
+
+int32_t test_vmaxvq_s32(int32x4_t a) {
+ // CHECK: test_vmaxvq_s32
+ return vmaxvq_s32(a);
+ // CHECK: smaxv {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+uint8_t test_vmaxvq_u8(uint8x16_t a) {
+ // CHECK: test_vmaxvq_u8
+ return vmaxvq_u8(a);
+ // CHECK: umaxv {{b[0-9]+}}, {{v[0-9]+}}.16b
+}
+
+uint16_t test_vmaxvq_u16(uint16x8_t a) {
+ // CHECK: test_vmaxvq_u16
+ return vmaxvq_u16(a);
+ // CHECK: umaxv {{h[0-9]+}}, {{v[0-9]+}}.8h
+}
+
+uint32_t test_vmaxvq_u32(uint32x4_t a) {
+ // CHECK: test_vmaxvq_u32
+ return vmaxvq_u32(a);
+ // CHECK: umaxv {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+int8_t test_vminv_s8(int8x8_t a) {
+ // CHECK: test_vminv_s8
+ return vminv_s8(a);
+ // CHECK: sminv {{b[0-9]+}}, {{v[0-9]+}}.8b
+}
+
+int16_t test_vminv_s16(int16x4_t a) {
+ // CHECK: test_vminv_s16
+ return vminv_s16(a);
+ // CHECK: sminv {{h[0-9]+}}, {{v[0-9]+}}.4h
+}
+
+uint8_t test_vminv_u8(uint8x8_t a) {
+ // CHECK: test_vminv_u8
+ return vminv_u8(a);
+ // CHECK: uminv {{b[0-9]+}}, {{v[0-9]+}}.8b
+}
+
+uint16_t test_vminv_u16(uint16x4_t a) {
+ // CHECK: test_vminv_u16
+ return vminv_u16(a);
+ // CHECK: uminv {{h[0-9]+}}, {{v[0-9]+}}.4h
+}
+
+int8_t test_vminvq_s8(int8x16_t a) {
+ // CHECK: test_vminvq_s8
+ return vminvq_s8(a);
+ // CHECK: sminv {{b[0-9]+}}, {{v[0-9]+}}.16b
+}
+
+int16_t test_vminvq_s16(int16x8_t a) {
+ // CHECK: test_vminvq_s16
+ return vminvq_s16(a);
+ // CHECK: sminv {{h[0-9]+}}, {{v[0-9]+}}.8h
+}
+
+int32_t test_vminvq_s32(int32x4_t a) {
+ // CHECK: test_vminvq_s32
+ return vminvq_s32(a);
+ // CHECK: sminv {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+uint8_t test_vminvq_u8(uint8x16_t a) {
+ // CHECK: test_vminvq_u8
+ return vminvq_u8(a);
+ // CHECK: uminv {{b[0-9]+}}, {{v[0-9]+}}.16b
+}
+
+uint16_t test_vminvq_u16(uint16x8_t a) {
+ // CHECK: test_vminvq_u16
+ return vminvq_u16(a);
+ // CHECK: uminv {{h[0-9]+}}, {{v[0-9]+}}.8h
+}
+
+uint32_t test_vminvq_u32(uint32x4_t a) {
+ // CHECK: test_vminvq_u32
+ return vminvq_u32(a);
+ // CHECK: uminv {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+int8_t test_vaddv_s8(int8x8_t a) {
+ // CHECK: test_vaddv_s8
+ return vaddv_s8(a);
+ // CHECK: addv {{b[0-9]+}}, {{v[0-9]+}}.8b
+}
+
+int16_t test_vaddv_s16(int16x4_t a) {
+ // CHECK: test_vaddv_s16
+ return vaddv_s16(a);
+ // CHECK: addv {{h[0-9]+}}, {{v[0-9]+}}.4h
+}
+
+uint8_t test_vaddv_u8(uint8x8_t a) {
+ // CHECK: test_vaddv_u8
+ return vaddv_u8(a);
+ // CHECK: addv {{b[0-9]+}}, {{v[0-9]+}}.8b
+}
+
+uint16_t test_vaddv_u16(uint16x4_t a) {
+ // CHECK: test_vaddv_u16
+ return vaddv_u16(a);
+ // CHECK: addv {{h[0-9]+}}, {{v[0-9]+}}.4h
+}
+
+int8_t test_vaddvq_s8(int8x16_t a) {
+ // CHECK: test_vaddvq_s8
+ return vaddvq_s8(a);
+ // CHECK: addv {{b[0-9]+}}, {{v[0-9]+}}.16b
+}
+
+int16_t test_vaddvq_s16(int16x8_t a) {
+ // CHECK: test_vaddvq_s16
+ return vaddvq_s16(a);
+ // CHECK: addv {{h[0-9]+}}, {{v[0-9]+}}.8h
+}
+
+int32_t test_vaddvq_s32(int32x4_t a) {
+ // CHECK: test_vaddvq_s32
+ return vaddvq_s32(a);
+ // CHECK: addv {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+uint8_t test_vaddvq_u8(uint8x16_t a) {
+ // CHECK: test_vaddvq_u8
+ return vaddvq_u8(a);
+ // CHECK: addv {{b[0-9]+}}, {{v[0-9]+}}.16b
+}
+
+uint16_t test_vaddvq_u16(uint16x8_t a) {
+ // CHECK: test_vaddvq_u16
+ return vaddvq_u16(a);
+ // CHECK: addv {{h[0-9]+}}, {{v[0-9]+}}.8h
+}
+
+uint32_t test_vaddvq_u32(uint32x4_t a) {
+ // CHECK: test_vaddvq_u32
+ return vaddvq_u32(a);
+ // CHECK: addv {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+float32_t test_vmaxvq_f32(float32x4_t a) {
+ // CHECK: test_vmaxvq_f32
+ return vmaxvq_f32(a);
+ // CHECK: fmaxv {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+float32_t test_vminvq_f32(float32x4_t a) {
+ // CHECK: test_vminvq_f32
+ return vminvq_f32(a);
+ // CHECK: fminv {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+float32_t test_vmaxnmvq_f32(float32x4_t a) {
+ // CHECK: test_vmaxnmvq_f32
+ return vmaxnmvq_f32(a);
+ // CHECK: fmaxnmv {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+float32_t test_vminnmvq_f32(float32x4_t a) {
+ // CHECK: test_vminnmvq_f32
+ return vminnmvq_f32(a);
+ // CHECK: fminnmv {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
diff --git a/test/CodeGen/aarch64-neon-copy.c b/test/CodeGen/aarch64-neon-copy.c
new file mode 100644
index 000000000000..eb91bf9b5a5c
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-copy.c
@@ -0,0 +1,1319 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+uint8x8_t test_vset_lane_u8(uint8_t v1, uint8x8_t v2) {
+ // CHECK: test_vset_lane_u8
+ return vset_lane_u8(v1, v2, 6);
+ // CHECK: ins {{v[0-9]+}}.b[6], {{w[0-9]+}}
+}
+
+uint16x4_t test_vset_lane_u16(uint16_t v1, uint16x4_t v2) {
+ // CHECK: test_vset_lane_u16
+ return vset_lane_u16(v1, v2, 2);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{w[0-9]+}}
+}
+
+uint32x2_t test_vset_lane_u32(uint32_t v1, uint32x2_t v2) {
+ // CHECK: test_vset_lane_u32
+ return vset_lane_u32(v1, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{w[0-9]+}}
+}
+uint64x1_t test_vset_lane_u64(uint64_t v1, uint64x1_t v2) {
+ // CHECK: test_vset_lane_u64
+ return vset_lane_u64(v1, v2, 0);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+int8x8_t test_vset_lane_s8(int8_t v1, int8x8_t v2) {
+ // CHECK: test_vset_lane_s8
+ return vset_lane_s8(v1, v2, 6);
+ // CHECK: ins {{v[0-9]+}}.b[6], {{w[0-9]+}}
+}
+
+int16x4_t test_vset_lane_s16(int16_t v1, int16x4_t v2) {
+ // CHECK: test_vset_lane_s16
+ return vset_lane_s16(v1, v2, 2);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{w[0-9]+}}
+}
+
+int32x2_t test_vset_lane_s32(int32_t v1, int32x2_t v2) {
+ // CHECK: test_vset_lane_s32
+ return vset_lane_s32(v1, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{w[0-9]+}}
+}
+
+ int64x1_t test_vset_lane_s64(int64_t v1, int64x1_t v2) {
+ // CHECK: test_vset_lane_s64
+ return vset_lane_s64(v1, v2, 0);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+uint8x16_t test_vsetq_lane_u8(uint8_t v1, uint8x16_t v2) {
+ // CHECK: test_vsetq_lane_u8
+ return vsetq_lane_u8(v1, v2, 6);
+ // CHECK: ins {{v[0-9]+}}.b[6], {{w[0-9]+}}
+}
+
+uint16x8_t test_vsetq_lane_u16(uint16_t v1, uint16x8_t v2) {
+ // CHECK: test_vsetq_lane_u16
+ return vsetq_lane_u16(v1, v2, 2);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{w[0-9]+}}
+}
+
+uint32x4_t test_vsetq_lane_u32(uint32_t v1, uint32x4_t v2) {
+ // CHECK: test_vsetq_lane_u32
+ return vsetq_lane_u32(v1, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{w[0-9]+}}
+}
+
+ uint64x2_t test_vsetq_lane_u64(uint64_t v1, uint64x2_t v2) {
+ // CHECK: test_vsetq_lane_u64
+ return vsetq_lane_u64(v1, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{x[0-9]+}}
+}
+
+int8x16_t test_vsetq_lane_s8(int8_t v1, int8x16_t v2) {
+ // CHECK: test_vsetq_lane_s8
+ return vsetq_lane_s8(v1, v2, 6);
+ // CHECK: ins {{v[0-9]+}}.b[6], {{w[0-9]+}}
+}
+
+int16x8_t test_vsetq_lane_s16(int16_t v1, int16x8_t v2) {
+ // CHECK: test_vsetq_lane_s16
+ return vsetq_lane_s16(v1, v2, 2);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{w[0-9]+}}
+}
+
+int32x4_t test_vsetq_lane_s32(int32_t v1, int32x4_t v2) {
+ // CHECK: test_vsetq_lane_s32
+ return vsetq_lane_s32(v1, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{w[0-9]+}}
+}
+
+int64x2_t test_vsetq_lane_s64(int64_t v1, int64x2_t v2) {
+ // CHECK: test_vsetq_lane_s64
+ return vsetq_lane_s64(v1, v2, 0);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{x[0-9]+}}
+}
+
+poly8x8_t test_vset_lane_p8(poly8_t v1, poly8x8_t v2) {
+ // CHECK: test_vset_lane_p8
+ return vset_lane_p8(v1, v2, 6);
+ // CHECK: ins {{v[0-9]+}}.b[6], {{w[0-9]+}}
+}
+
+poly16x4_t test_vset_lane_p16(poly16_t v1, poly16x4_t v2) {
+ // CHECK: test_vset_lane_p16
+ return vset_lane_p16(v1, v2, 2);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{w[0-9]+}}
+}
+
+poly8x16_t test_vsetq_lane_p8(poly8_t v1, poly8x16_t v2) {
+ // CHECK: test_vsetq_lane_p8
+ return vsetq_lane_p8(v1, v2, 6);
+ // CHECK: ins {{v[0-9]+}}.b[6], {{w[0-9]+}}
+}
+
+poly16x8_t test_vsetq_lane_p16(poly16_t v1, poly16x8_t v2) {
+ // CHECK: test_vsetq_lane_p16
+ return vsetq_lane_p16(v1, v2, 2);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{w[0-9]+}}
+}
+
+float32x2_t test_vset_lane_f32(float32_t v1, float32x2_t v2) {
+ // CHECK: test_vset_lane_f32
+ return vset_lane_f32(v1, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vsetq_lane_f32(float32_t v1, float32x4_t v2) {
+ // CHECK: test_vsetq_lane_f32
+ return vsetq_lane_f32(v1, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+float64x1_t test_vset_lane_f64(float64_t v1, float64x1_t v2) {
+ // CHECK: test_vset_lane_f64
+ return vset_lane_f64(v1, v2, 0);
+ // CHECK: ret
+}
+
+float64x2_t test_vsetq_lane_f64(float64_t v1, float64x2_t v2) {
+ // CHECK: test_vsetq_lane_f64
+ return vsetq_lane_f64(v1, v2, 0);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[0]
+}
+
+uint8_t test_vget_lane_u8(uint8x8_t v1) {
+ // CHECK: test_vget_lane_u8
+ return vget_lane_u8(v1, 7);
+ // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[7]
+}
+
+uint16_t test_vget_lane_u16(uint16x4_t v1) {
+ // CHECK: test_vget_lane_u16
+ return vget_lane_u16(v1, 3);
+ // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+uint32_t test_vget_lane_u32(uint32x2_t v1) {
+ // CHECK: test_vget_lane_u32
+ return vget_lane_u32(v1, 1);
+ // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+uint64_t test_vget_lane_u64(uint64x1_t v1) {
+ // CHECK: test_vget_lane_u64
+ return vget_lane_u64(v1, 0);
+ // CHECK: fmov {{x[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8_t test_vgetq_lane_u8(uint8x16_t v1) {
+ // CHECK: test_vgetq_lane_u8
+ return vgetq_lane_u8(v1, 15);
+ // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[15]
+}
+
+uint16_t test_vgetq_lane_u16(uint16x8_t v1) {
+ // CHECK: test_vgetq_lane_u16
+ return vgetq_lane_u16(v1, 6);
+ // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[6]
+}
+
+uint32_t test_vgetq_lane_u32(uint32x4_t v1) {
+ // CHECK: test_vgetq_lane_u32
+ return vgetq_lane_u32(v1, 2);
+ // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.s[2]
+}
+
+uint64_t test_vgetq_lane_u64(uint64x2_t v1) {
+ // CHECK: test_vgetq_lane_u64
+ return vgetq_lane_u64(v1, 1);
+ // CHECK: umov {{x[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+poly8_t test_vget_lane_p8(poly8x8_t v1) {
+ // CHECK: test_vget_lane_p8
+ return vget_lane_p8(v1, 7);
+ // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[7]
+}
+
+poly16_t test_vget_lane_p16(poly16x4_t v1) {
+ // CHECK: test_vget_lane_p16
+ return vget_lane_p16(v1, 3);
+ // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+poly8_t test_vgetq_lane_p8(poly8x16_t v1) {
+ // CHECK: test_vgetq_lane_p8
+ return vgetq_lane_p8(v1, 14);
+ // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[14]
+}
+
+poly16_t test_vgetq_lane_p16(poly16x8_t v1) {
+ // CHECK: test_vgetq_lane_p16
+ return vgetq_lane_p16(v1, 6);
+ // CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[6]
+}
+
+int32_t test_vget_lane_s8(int8x8_t v1) {
+ // CHECK: test_vget_lane_s8
+ return vget_lane_s8(v1, 7)+1;
+ // CHECK: smov {{w[0-9]+}}, {{v[0-9]+}}.b[7]
+}
+
+int32_t test_vget_lane_s16(int16x4_t v1) {
+ // CHECK: test_vget_lane_s16
+ return vget_lane_s16(v1, 3)+1;
+ // CHECK: smov {{w[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+int64_t test_vget_lane_s32(int32x2_t v1) {
+ // CHECK: test_vget_lane_s32
+ return vget_lane_s32(v1, 1);
+ // CHECK: smov {{x[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+int64_t test_vget_lane_s64(int64x1_t v1) {
+ // CHECK: test_vget_lane_s64
+ return vget_lane_s64(v1, 0);
+ // CHECK: fmov {{x[0-9]+}}, {{d[0-9]+}}
+}
+
+int32_t test_vgetq_lane_s8(int8x16_t v1) {
+ // CHECK: test_vgetq_lane_s8
+ return vgetq_lane_s8(v1, 15)+1;
+ // CHECK: smov {{w[0-9]+}}, {{v[0-9]+}}.b[15]
+}
+
+int32_t test_vgetq_lane_s16(int16x8_t v1) {
+ // CHECK: test_vgetq_lane_s16
+ return vgetq_lane_s16(v1, 6)+1;
+ // CHECK: smov {{w[0-9]+}}, {{v[0-9]+}}.h[6]
+}
+
+int64_t test_vgetq_lane_s32(int32x4_t v1) {
+ // CHECK: test_vgetq_lane_s32
+ return vgetq_lane_s32(v1, 2);
+ // CHECK: smov {{x[0-9]+}}, {{v[0-9]+}}.s[2]
+}
+
+int64_t test_vgetq_lane_s64(int64x2_t v1) {
+ // CHECK: test_vgetq_lane_s64
+ return vgetq_lane_s64(v1, 1);
+ // CHECK: umov {{x[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+int8x8_t test_vcopy_lane_s8(int8x8_t v1, int8x8_t v2) {
+ // CHECK: test_vcopy_lane_s8
+ return vcopy_lane_s8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+int16x4_t test_vcopy_lane_s16(int16x4_t v1, int16x4_t v2) {
+ // CHECK: test_vcopy_lane_s16
+ return vcopy_lane_s16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+poly8x8_t test_vcopy_lane_p8(poly8x8_t v1, poly8x8_t v2) {
+ // CHECK: test_vcopy_lane_p8
+ return vcopy_lane_p8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+poly16x4_t test_vcopy_lane_p16(poly16x4_t v1, poly16x4_t v2) {
+ // CHECK: test_vcopy_lane_p16
+ return vcopy_lane_p16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+int32x2_t test_vcopy_lane_s32(int32x2_t v1, int32x2_t v2) {
+ // CHECK: test_vcopy_lane_s32
+ return vcopy_lane_s32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+float32x2_t test_vcopy_lane_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vcopy_lane_f32
+ return vcopy_lane_f32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+uint8x8_t test_vcopy_lane_u8(uint8x8_t v1, uint8x8_t v2) {
+ // CHECK: test_vcopy_lane_u8
+ return vcopy_lane_u8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+uint16x4_t test_vcopy_lane_u16(uint16x4_t v1, uint16x4_t v2) {
+ // CHECK: test_vcopy_lane_u16
+ return vcopy_lane_u16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+uint32x2_t test_vcopy_lane_u32(uint32x2_t v1, uint32x2_t v2) {
+ // CHECK: test_vcopy_lane_u32
+ return vcopy_lane_u32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+int8x8_t test_vcopy_laneq_s8(int8x8_t v1, int8x16_t v2) {
+ // CHECK: test_vcopy_laneq_s8
+ return vcopy_laneq_s8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+int16x4_t test_vcopy_laneq_s16(int16x4_t v1, int16x8_t v2) {
+ // CHECK: test_vcopy_laneq_s16
+ return vcopy_laneq_s16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+poly8x8_t test_vcopy_laneq_p8(poly8x8_t v1, poly8x16_t v2) {
+ // CHECK: test_vcopy_laneq_p8
+ return vcopy_laneq_p8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+poly16x4_t test_vcopy_laneq_p16(poly16x4_t v1, poly16x8_t v2) {
+ // CHECK: test_vcopy_laneq_p16
+ return vcopy_laneq_p16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+int32x2_t test_vcopy_laneq_s32(int32x2_t v1, int32x4_t v2) {
+ // CHECK: test_vcopy_laneq_s32
+ return vcopy_laneq_s32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+float32x2_t test_vcopy_laneq_f32(float32x2_t v1, float32x4_t v2) {
+ // CHECK: test_vcopy_laneq_f32
+ return vcopy_laneq_f32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+uint8x8_t test_vcopy_laneq_u8(uint8x8_t v1, uint8x16_t v2) {
+ // CHECK: test_vcopy_laneq_u8
+ return vcopy_laneq_u8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+uint16x4_t test_vcopy_laneq_u16(uint16x4_t v1, uint16x8_t v2) {
+ // CHECK: test_vcopy_laneq_u16
+ return vcopy_laneq_u16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+uint32x2_t test_vcopy_laneq_u32(uint32x2_t v1, uint32x4_t v2) {
+ // CHECK: test_vcopy_laneq_u32
+ return vcopy_laneq_u32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+int8x16_t test_vcopyq_lane_s8(int8x16_t v1, int8x8_t v2) {
+ // CHECK: test_vcopyq_lane_s8
+ return vcopyq_lane_s8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+int16x8_t test_vcopyq_lane_s16(int16x8_t v1, int16x4_t v2) {
+ // CHECK: test_vcopyq_lane_s16
+ return vcopyq_lane_s16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+poly8x16_t test_vcopyq_lane_p8(poly8x16_t v1, poly8x8_t v2) {
+ // CHECK: test_vcopyq_lane_p8
+ return vcopyq_lane_p8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+poly16x8_t test_vcopyq_lane_p16(poly16x8_t v1, poly16x4_t v2) {
+ // CHECK: test_vcopyq_lane_p16
+ return vcopyq_lane_p16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+int32x4_t test_vcopyq_lane_s32(int32x4_t v1, int32x2_t v2) {
+ // CHECK: test_vcopyq_lane_s32
+ return vcopyq_lane_s32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+int64x2_t test_vcopyq_lane_s64(int64x2_t v1, int64x1_t v2) {
+ // CHECK: test_vcopyq_lane_s64
+ return vcopyq_lane_s64(v1, 1, v2, 0);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+float32x4_t test_vcopyq_lane_f32(float32x4_t v1, float32x2_t v2) {
+ // CHECK: test_vcopyq_lane_f32
+ return vcopyq_lane_f32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+float64x2_t test_vcopyq_lane_f64(float64x2_t v1, float64x1_t v2) {
+ // CHECK: test_vcopyq_lane_f64
+ return vcopyq_lane_f64(v1, 1, v2, 0);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+uint8x16_t test_vcopyq_lane_u8(uint8x16_t v1, uint8x8_t v2) {
+ // CHECK: test_vcopyq_lane_u8
+ return vcopyq_lane_u8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+uint16x8_t test_vcopyq_lane_u16(uint16x8_t v1, uint16x4_t v2) {
+ // CHECK: test_vcopyq_lane_u16
+ return vcopyq_lane_u16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+uint32x4_t test_vcopyq_lane_u32(uint32x4_t v1, uint32x2_t v2) {
+ // CHECK: test_vcopyq_lane_u32
+ return vcopyq_lane_u32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+uint64x2_t test_vcopyq_lane_u64(uint64x2_t v1, uint64x1_t v2) {
+ // CHECK: test_vcopyq_lane_u64
+ return vcopyq_lane_u64(v1, 1, v2, 0);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+int8x16_t test_vcopyq_laneq_s8(int8x16_t v1, int8x16_t v2) {
+ // CHECK: test_vcopyq_laneq_s8
+ return vcopyq_laneq_s8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+int16x8_t test_vcopyq_laneq_s16(int16x8_t v1, int16x8_t v2) {
+ // CHECK: test_vcopyq_laneq_s16
+ return vcopyq_laneq_s16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+poly8x16_t test_vcopyq_laneq_p8(poly8x16_t v1, poly8x16_t v2) {
+ // CHECK: test_vcopyq_laneq_p8
+ return vcopyq_laneq_p8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+poly16x8_t test_vcopyq_laneq_p16(poly16x8_t v1, poly16x8_t v2) {
+ // CHECK: test_vcopyq_laneq_p16
+ return vcopyq_laneq_p16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+int32x4_t test_vcopyq_laneq_s32(int32x4_t v1, int32x4_t v2) {
+ // CHECK: test_vcopyq_laneq_s32
+ return vcopyq_laneq_s32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+float32x4_t test_vcopyq_laneq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vcopyq_laneq_f32
+ return vcopyq_laneq_f32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+int64x2_t test_vcopyq_laneq_s64(int64x2_t v1, int64x2_t v2) {
+ // CHECK: test_vcopyq_laneq_s64
+ return vcopyq_laneq_s64(v1, 1, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[1]
+}
+
+uint8x16_t test_vcopyq_laneq_u8(uint8x16_t v1, uint8x16_t v2) {
+ // CHECK: test_vcopyq_laneq_u8
+ return vcopyq_laneq_u8(v1, 5, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.b[5], {{v[0-9]+}}.b[3]
+}
+
+uint16x8_t test_vcopyq_laneq_u16(uint16x8_t v1, uint16x8_t v2) {
+ // CHECK: test_vcopyq_laneq_u16
+ return vcopyq_laneq_u16(v1, 2, v2, 3);
+ // CHECK: ins {{v[0-9]+}}.h[2], {{v[0-9]+}}.h[3]
+}
+
+uint32x4_t test_vcopyq_laneq_u32(uint32x4_t v1, uint32x4_t v2) {
+ // CHECK: test_vcopyq_laneq_u32
+ return vcopyq_laneq_u32(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+uint64x2_t test_vcopyq_laneq_u64(uint64x2_t v1, uint64x2_t v2) {
+ // CHECK: test_vcopyq_laneq_u64
+ return vcopyq_laneq_u64(v1, 0, v2, 1);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+int8x8_t test_vcreate_s8(uint64_t v1) {
+ // CHECK: test_vcreate_s8
+ return vcreate_s8(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+int16x4_t test_vcreate_s16(uint64_t v1) {
+ // CHECK: test_vcreate_s16
+ return vcreate_s16(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+int32x2_t test_vcreate_s32(uint64_t v1) {
+ // CHECK: test_vcreate_s32
+ return vcreate_s32(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+int64x1_t test_vcreate_s64(uint64_t v1) {
+ // CHECK: test_vcreate_s64
+ return vcreate_s64(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+uint8x8_t test_vcreate_u8(uint64_t v1) {
+ // CHECK: test_vcreate_u8
+ return vcreate_u8(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+uint16x4_t test_vcreate_u16(uint64_t v1) {
+ // CHECK: test_vcreate_u16
+ return vcreate_u16(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+uint32x2_t test_vcreate_u32(uint64_t v1) {
+ // CHECK: test_vcreate_u32
+ return vcreate_u32(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+uint64x1_t test_vcreate_u64(uint64_t v1) {
+ // CHECK: test_vcreate_u64
+ return vcreate_u64(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+poly8x8_t test_vcreate_p8(uint64_t v1) {
+ // CHECK: test_vcreate_p8
+ return vcreate_p8(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+poly16x4_t test_vcreate_p16(uint64_t v1) {
+ // CHECK: test_vcreate_p16
+ return vcreate_p16(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+float16x4_t test_vcreate_f16(uint64_t v1) {
+ // CHECK: test_vcreate_f16
+ return vcreate_f16(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+float32x2_t test_vcreate_f32(uint64_t v1) {
+ // CHECK: test_vcreate_f32
+ return vcreate_f32(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+float64x1_t test_vcreate_f64(uint64_t v1) {
+ // CHECK: test_vcreate_f64
+ return vcreate_f64(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+uint8x8_t test_vdup_n_u8(uint8_t v1) {
+ // CHECK: test_vdup_n_u8
+ return vdup_n_u8(v1);
+ // CHECK: dup {{v[0-9]+}}.8b, {{w[0-9]+}}
+}
+
+uint16x4_t test_vdup_n_u16(uint16_t v1) {
+ // CHECK: test_vdup_n_u16
+ return vdup_n_u16(v1);
+ // CHECK: dup {{v[0-9]+}}.4h, {{w[0-9]+}}
+}
+
+uint32x2_t test_vdup_n_u32(uint32_t v1) {
+ // CHECK: test_vdup_n_u32
+ return vdup_n_u32(v1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{w[0-9]+}}
+}
+
+uint64x1_t test_vdup_n_u64(uint64_t v1) {
+ // CHECK: test_vdup_n_u64
+ return vdup_n_u64(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+uint8x16_t test_vdupq_n_u8(uint8_t v1) {
+ // CHECK: test_vdupq_n_u8
+ return vdupq_n_u8(v1);
+ // CHECK: dup {{v[0-9]+}}.16b, {{w[0-9]+}}
+}
+
+uint16x8_t test_vdupq_n_u16(uint16_t v1) {
+ // CHECK: test_vdupq_n_u16
+ return vdupq_n_u16(v1);
+ // CHECK: dup {{v[0-9]+}}.8h, {{w[0-9]+}}
+}
+
+uint32x4_t test_vdupq_n_u32(uint32_t v1) {
+ // CHECK: test_vdupq_n_u32
+ return vdupq_n_u32(v1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{w[0-9]+}}
+}
+
+uint64x2_t test_vdupq_n_u64(uint64_t v1) {
+ // CHECK: test_vdupq_n_u64
+ return vdupq_n_u64(v1);
+ // CHECK: dup {{v[0-9]+}}.2d, {{x[0-9]+}}
+}
+
+int8x8_t test_vdup_n_s8(int8_t v1) {
+ // CHECK: test_vdup_n_s8
+ return vdup_n_s8(v1);
+ // CHECK: dup {{v[0-9]+}}.8b, {{w[0-9]+}}
+}
+
+int16x4_t test_vdup_n_s16(int16_t v1) {
+ // CHECK: test_vdup_n_s16
+ return vdup_n_s16(v1);
+ // CHECK: dup {{v[0-9]+}}.4h, {{w[0-9]+}}
+}
+
+int32x2_t test_vdup_n_s32(int32_t v1) {
+ // CHECK: test_vdup_n_s32
+ return vdup_n_s32(v1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{w[0-9]+}}
+}
+
+int64x1_t test_vdup_n_s64(int64_t v1) {
+ // CHECK: test_vdup_n_s64
+ return vdup_n_s64(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+int8x16_t test_vdupq_n_s8(int8_t v1) {
+ // CHECK: test_vdupq_n_s8
+ return vdupq_n_s8(v1);
+ // CHECK: dup {{v[0-9]+}}.16b, {{w[0-9]+}}
+}
+
+int16x8_t test_vdupq_n_s16(int16_t v1) {
+ // CHECK: test_vdupq_n_s16
+ return vdupq_n_s16(v1);
+ // CHECK: dup {{v[0-9]+}}.8h, {{w[0-9]+}}
+}
+
+int32x4_t test_vdupq_n_s32(int32_t v1) {
+ // CHECK: test_vdupq_n_s32
+ return vdupq_n_s32(v1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{w[0-9]+}}
+}
+
+int64x2_t test_vdupq_n_s64(int64_t v1) {
+ // CHECK: test_vdupq_n_s64
+ return vdupq_n_s64(v1);
+ // CHECK: dup {{v[0-9]+}}.2d, {{x[0-9]+}}
+}
+
+poly8x8_t test_vdup_n_p8(poly8_t v1) {
+ // CHECK: test_vdup_n_p8
+ return vdup_n_p8(v1);
+ // CHECK: dup {{v[0-9]+}}.8b, {{w[0-9]+}}
+}
+
+poly16x4_t test_vdup_n_p16(poly16_t v1) {
+ // CHECK: test_vdup_n_p16
+ return vdup_n_p16(v1);
+ // CHECK: dup {{v[0-9]+}}.4h, {{w[0-9]+}}
+}
+
+poly8x16_t test_vdupq_n_p8(poly8_t v1) {
+ // CHECK: test_vdupq_n_p8
+ return vdupq_n_p8(v1);
+ // CHECK: dup {{v[0-9]+}}.16b, {{w[0-9]+}}
+}
+
+poly16x8_t test_vdupq_n_p16(poly16_t v1) {
+ // CHECK: test_vdupq_n_p16
+ return vdupq_n_p16(v1);
+ // CHECK: dup {{v[0-9]+}}.8h, {{w[0-9]+}}
+}
+
+float32x2_t test_vdup_n_f32(float32_t v1) {
+ // CHECK: test_vdup_n_f32
+ return vdup_n_f32(v1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float64x1_t test_vdup_n_f64(float64_t v1) {
+ // CHECK: test_vdup_n_f64
+ return vdup_n_f64(v1);
+ // CHECK: ret
+}
+
+float32x4_t test_vdupq_n_f32(float32_t v1) {
+ // CHECK: test_vdupq_n_f32
+ return vdupq_n_f32(v1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float64x2_t test_vdupq_n_f64(float64_t v1) {
+ // CHECK: test_vdupq_n_f64
+ return vdupq_n_f64(v1);
+ // CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+int8x8_t test_vdup_lane_s8(int8x8_t v1) {
+ // CHECK: test_vdup_lane_s8
+ return vdup_lane_s8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.8b, {{v[0-9]+}}.b[5]
+}
+
+int16x4_t test_vdup_lane_s16(int16x4_t v1) {
+ // CHECK: test_vdup_lane_s16
+ return vdup_lane_s16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.4h, {{v[0-9]+}}.h[2]
+}
+
+int32x2_t test_vdup_lane_s32(int32x2_t v1) {
+ // CHECK: test_vdup_lane_s32
+ return vdup_lane_s32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int64x1_t test_vdup_lane_s64(int64x1_t v1) {
+ // CHECK: test_vdup_lane_s64
+ return vdup_lane_s64(v1, 0);
+ // CHECK: ret
+}
+
+int8x16_t test_vdupq_lane_s8(int8x8_t v1) {
+ // CHECK: test_vdupq_lane_s8
+ return vdupq_lane_s8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.16b, {{v[0-9]+}}.b[5]
+}
+
+int16x8_t test_vdupq_lane_s16(int16x4_t v1) {
+ // CHECK: test_vdupq_lane_s16
+ return vdupq_lane_s16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.8h, {{v[0-9]+}}.h[2]
+}
+
+int32x4_t test_vdupq_lane_s32(int32x2_t v1) {
+ // CHECK: test_vdupq_lane_s32
+ return vdupq_lane_s32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int64x2_t test_vdupq_lane_s64(int64x1_t v1) {
+ // CHECK: test_vdupq_lane_s64
+ return vdupq_lane_s64(v1, 0);
+ // CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+uint8x8_t test_vdup_lane_u8(uint8x8_t v1) {
+ // CHECK: test_vdup_lane_u8
+ return vdup_lane_u8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.8b, {{v[0-9]+}}.b[5]
+}
+
+uint16x4_t test_vdup_lane_u16(uint16x4_t v1) {
+ // CHECK: test_vdup_lane_u16
+ return vdup_lane_u16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.4h, {{v[0-9]+}}.h[2]
+}
+
+uint32x2_t test_vdup_lane_u32(uint32x2_t v1) {
+ // CHECK: test_vdup_lane_u32
+ return vdup_lane_u32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+uint64x1_t test_vdup_lane_u64(uint64x1_t v1) {
+ // CHECK: test_vdup_lane_u64
+ return vdup_lane_u64(v1, 0);
+ // CHECK: ret
+}
+
+uint8x16_t test_vdupq_lane_u8(uint8x8_t v1) {
+ // CHECK: test_vdupq_lane_u8
+ return vdupq_lane_u8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.16b, {{v[0-9]+}}.b[5]
+}
+
+uint16x8_t test_vdupq_lane_u16(uint16x4_t v1) {
+ // CHECK: test_vdupq_lane_u16
+ return vdupq_lane_u16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.8h, {{v[0-9]+}}.h[2]
+}
+
+uint32x4_t test_vdupq_lane_u32(uint32x2_t v1) {
+ // CHECK: test_vdupq_lane_u32
+ return vdupq_lane_u32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+uint64x2_t test_vdupq_lane_u64(uint64x1_t v1) {
+ // CHECK: test_vdupq_lane_u64
+ return vdupq_lane_u64(v1, 0);
+ // CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+int8x8_t test_vdup_laneq_s8(int8x16_t v1) {
+ // CHECK: test_vdup_laneq_s8
+ return vdup_laneq_s8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.8b, {{v[0-9]+}}.b[5]
+}
+
+int16x4_t test_vdup_laneq_s16(int16x8_t v1) {
+ // CHECK: test_vdup_laneq_s16
+ return vdup_laneq_s16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.4h, {{v[0-9]+}}.h[2]
+}
+
+int32x2_t test_vdup_laneq_s32(int32x4_t v1) {
+ // CHECK: test_vdup_laneq_s32
+ return vdup_laneq_s32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+int64x1_t test_vdup_laneq_s64(int64x2_t v1) {
+ // CHECK: test_vdup_laneq_s64
+ return vdup_laneq_s64(v1, 0);
+ // CHECK: ret
+}
+
+int8x16_t test_vdupq_laneq_s8(int8x16_t v1) {
+ // CHECK: test_vdupq_laneq_s8
+ return vdupq_laneq_s8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.16b, {{v[0-9]+}}.b[5]
+}
+
+int16x8_t test_vdupq_laneq_s16(int16x8_t v1) {
+ // CHECK: test_vdupq_laneq_s16
+ return vdupq_laneq_s16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.8h, {{v[0-9]+}}.h[2]
+}
+
+int32x4_t test_vdupq_laneq_s32(int32x4_t v1) {
+ // CHECK: test_vdupq_laneq_s32
+ return vdupq_laneq_s32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+int64x2_t test_vdupq_laneq_s64(int64x2_t v1) {
+ // CHECK: test_vdupq_laneq_s64
+ return vdupq_laneq_s64(v1, 0);
+ // CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+uint8x8_t test_vdup_laneq_u8(uint8x16_t v1) {
+ // CHECK: test_vdup_laneq_u8
+ return vdup_laneq_u8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.8b, {{v[0-9]+}}.b[5]
+}
+
+uint16x4_t test_vdup_laneq_u16(uint16x8_t v1) {
+ // CHECK: test_vdup_laneq_u16
+ return vdup_laneq_u16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.4h, {{v[0-9]+}}.h[2]
+}
+
+uint32x2_t test_vdup_laneq_u32(uint32x4_t v1) {
+ // CHECK: test_vdup_laneq_u32
+ return vdup_laneq_u32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+uint64x1_t test_vdup_laneq_u64(uint64x2_t v1) {
+ // CHECK: test_vdup_laneq_u64
+ return vdup_laneq_u64(v1, 0);
+ // CHECK: ret
+}
+
+uint8x16_t test_vdupq_laneq_u8(uint8x16_t v1) {
+ // CHECK: test_vdupq_laneq_u8
+ return vdupq_laneq_u8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.16b, {{v[0-9]+}}.b[5]
+}
+
+uint16x8_t test_vdupq_laneq_u16(uint16x8_t v1) {
+ // CHECK: test_vdupq_laneq_u16
+ return vdupq_laneq_u16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.8h, {{v[0-9]+}}.h[2]
+}
+
+uint32x4_t test_vdupq_laneq_u32(uint32x4_t v1) {
+ // CHECK: test_vdupq_laneq_u32
+ return vdupq_laneq_u32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+uint64x2_t test_vdupq_laneq_u64(uint64x2_t v1) {
+ // CHECK: test_vdupq_laneq_u64
+ return vdupq_laneq_u64(v1, 0);
+ // CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+poly8x8_t test_vdup_lane_p8(poly8x8_t v1) {
+ // CHECK: test_vdup_lane_p8
+ return vdup_lane_p8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.8b, {{v[0-9]+}}.b[5]
+}
+
+poly16x4_t test_vdup_lane_p16(poly16x4_t v1) {
+ // CHECK: test_vdup_lane_p16
+ return vdup_lane_p16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.4h, {{v[0-9]+}}.h[2]
+}
+
+poly8x16_t test_vdupq_lane_p8(poly8x8_t v1) {
+ // CHECK: test_vdupq_lane_p8
+ return vdupq_lane_p8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.16b, {{v[0-9]+}}.b[5]
+}
+
+poly16x8_t test_vdupq_lane_p16(poly16x4_t v1) {
+ // CHECK: test_vdupq_lane_p16
+ return vdupq_lane_p16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.8h, {{v[0-9]+}}.h[2]
+}
+
+poly8x8_t test_vdup_laneq_p8(poly8x16_t v1) {
+ // CHECK: test_vdup_laneq_p8
+ return vdup_laneq_p8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.8b, {{v[0-9]+}}.b[5]
+}
+
+poly16x4_t test_vdup_laneq_p16(poly16x8_t v1) {
+ // CHECK: test_vdup_laneq_p16
+ return vdup_laneq_p16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.4h, {{v[0-9]+}}.h[2]
+}
+
+poly8x16_t test_vdupq_laneq_p8(poly8x16_t v1) {
+ // CHECK: test_vdupq_laneq_p8
+ return vdupq_laneq_p8(v1, 5);
+ // CHECK: dup {{v[0-9]+}}.16b, {{v[0-9]+}}.b[5]
+}
+
+poly16x8_t test_vdupq_laneq_p16(poly16x8_t v1) {
+ // CHECK: test_vdupq_laneq_p16
+ return vdupq_laneq_p16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.8h, {{v[0-9]+}}.h[2]
+}
+
+float16x4_t test_vdup_lane_f16(float16x4_t v1) {
+ // CHECK: test_vdup_lane_f16
+ return vdup_lane_f16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.4h, {{v[0-9]+}}.h[2]
+}
+
+float32x2_t test_vdup_lane_f32(float32x2_t v1) {
+ // CHECK: test_vdup_lane_f32
+ return vdup_lane_f32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+float64x1_t test_vdup_lane_f64(float64x1_t v1) {
+ // CHECK: test_vdup_lane_f64
+ return vdup_lane_f64(v1, 0);
+ // CHECK: ret
+}
+
+float16x4_t test_vdup_laneq_f16(float16x8_t v1) {
+ // CHECK: test_vdup_laneq_f16
+ return vdup_laneq_f16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.4h, {{v[0-9]+}}.h[2]
+}
+
+float32x2_t test_vdup_laneq_f32(float32x4_t v1) {
+ // CHECK: test_vdup_laneq_f32
+ return vdup_laneq_f32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{v[0-9]+}}.s[1]
+}
+
+float64x1_t test_vdup_laneq_f64(float64x2_t v1) {
+ // CHECK: test_vdup_laneq_f64
+ return vdup_laneq_f64(v1, 0);
+ // CHECK: ret
+}
+
+float16x8_t test_vdupq_lane_f16(float16x4_t v1) {
+ // CHECK: test_vdupq_lane_f16
+ return vdupq_lane_f16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.8h, {{v[0-9]+}}.h[2]
+}
+
+float32x4_t test_vdupq_lane_f32(float32x2_t v1) {
+ // CHECK: test_vdupq_lane_f32
+ return vdupq_lane_f32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+float64x2_t test_vdupq_lane_f64(float64x1_t v1) {
+ // CHECK: test_vdupq_lane_f64
+ return vdupq_lane_f64(v1, 0);
+ // CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+float16x8_t test_vdupq_laneq_f16(float16x8_t v1) {
+ // CHECK: test_vdupq_laneq_f16
+ return vdupq_laneq_f16(v1, 2);
+ // CHECK: dup {{v[0-9]+}}.8h, {{v[0-9]+}}.h[2]
+}
+
+float32x4_t test_vdupq_laneq_f32(float32x4_t v1) {
+ // CHECK: test_vdupq_laneq_f32
+ return vdupq_laneq_f32(v1, 1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{v[0-9]+}}.s[1]
+}
+
+float64x2_t test_vdupq_laneq_f64(float64x2_t v1) {
+ // CHECK: test_vdupq_laneq_f64
+ return vdupq_laneq_f64(v1, 0);
+ // CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+int8x8_t test_vmov_n_s8(int8_t v1) {
+ // CHECK: test_vmov_n_s8
+ return vmov_n_s8(v1);
+ // CHECK: dup {{v[0-9]+}}.8b, {{w[0-9]+}}
+}
+
+int16x4_t test_vmov_n_s16(int16_t v1) {
+ // CHECK: test_vmov_n_s16
+ return vmov_n_s16(v1);
+ // CHECK: dup {{v[0-9]+}}.4h, {{w[0-9]+}}
+}
+
+int32x2_t test_vmov_n_s32(int32_t v1) {
+ // CHECK: test_vmov_n_s32
+ return vmov_n_s32(v1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{w[0-9]+}}
+}
+
+int64x1_t test_vmov_n_s64(int64_t v1) {
+ // CHECK: test_vmov_n_s64
+ return vmov_n_s64(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+int8x16_t test_vmovq_n_s8(int8_t v1) {
+ // CHECK: test_vmovq_n_s8
+ return vmovq_n_s8(v1);
+ // CHECK: dup {{v[0-9]+}}.16b, {{w[0-9]+}}
+}
+
+int16x8_t test_vmovq_n_s16(int16_t v1) {
+ // CHECK: test_vmovq_n_s16
+ return vmovq_n_s16(v1);
+ // CHECK: dup {{v[0-9]+}}.8h, {{w[0-9]+}}
+}
+
+int32x4_t test_vmovq_n_s32(int32_t v1) {
+ // CHECK: test_vmovq_n_s32
+ return vmovq_n_s32(v1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{w[0-9]+}}
+}
+
+int64x2_t test_vmovq_n_s64(int64_t v1) {
+ // CHECK: test_vmovq_n_s64
+ return vmovq_n_s64(v1);
+ // CHECK: dup {{v[0-9]+}}.2d, {{x[0-9]+}}
+}
+
+uint8x8_t test_vmov_n_u8(uint8_t v1) {
+ // CHECK: test_vmov_n_u8
+ return vmov_n_u8(v1);
+ // CHECK: dup {{v[0-9]+}}.8b, {{w[0-9]+}}
+}
+
+uint16x4_t test_vmov_n_u16(uint16_t v1) {
+ // CHECK: test_vmov_n_u16
+ return vmov_n_u16(v1);
+ // CHECK: dup {{v[0-9]+}}.4h, {{w[0-9]+}}
+}
+
+uint32x2_t test_vmov_n_u32(uint32_t v1) {
+ // CHECK: test_vmov_n_u32
+ return vmov_n_u32(v1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{w[0-9]+}}
+}
+
+uint64x1_t test_vmov_n_u64(uint64_t v1) {
+ // CHECK: test_vmov_n_u64
+ return vmov_n_u64(v1);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+uint8x16_t test_vmovq_n_u8(uint8_t v1) {
+ // CHECK: test_vmovq_n_u8
+ return vmovq_n_u8(v1);
+ // CHECK: dup {{v[0-9]+}}.16b, {{w[0-9]+}}
+}
+
+uint16x8_t test_vmovq_n_u16(uint16_t v1) {
+ // CHECK: test_vmovq_n_u16
+ return vmovq_n_u16(v1);
+ // CHECK: dup {{v[0-9]+}}.8h, {{w[0-9]+}}
+}
+
+uint32x4_t test_vmovq_n_u32(uint32_t v1) {
+ // CHECK: test_vmovq_n_u32
+ return vmovq_n_u32(v1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{w[0-9]+}}
+}
+
+uint64x2_t test_vmovq_n_u64(uint64_t v1) {
+ // CHECK: test_vmovq_n_u64
+ return vmovq_n_u64(v1);
+ // CHECK: dup {{v[0-9]+}}.2d, {{x[0-9]+}}
+}
+
+poly8x8_t test_vmov_n_p8(poly8_t v1) {
+ // CHECK: test_vmov_n_p8
+ return vmov_n_p8(v1);
+ // CHECK: dup {{v[0-9]+}}.8b, {{w[0-9]+}}
+}
+
+poly16x4_t test_vmov_n_p16(poly16_t v1) {
+ // CHECK: test_vmov_n_p16
+ return vmov_n_p16(v1);
+ // CHECK: dup {{v[0-9]+}}.4h, {{w[0-9]+}}
+}
+
+poly8x16_t test_vmovq_n_p8(poly8_t v1) {
+ // CHECK: test_vmovq_n_p8
+ return vmovq_n_p8(v1);
+ // CHECK: dup {{v[0-9]+}}.16b, {{w[0-9]+}}
+}
+
+poly16x8_t test_vmovq_n_p16(poly16_t v1) {
+ // CHECK: test_vmovq_n_p16
+ return vmovq_n_p16(v1);
+ // CHECK: dup {{v[0-9]+}}.8h, {{w[0-9]+}}
+}
+
+float32x2_t test_vmov_n_f32(float32_t v1) {
+ // CHECK: test_vmov_n_f32
+ return vmov_n_f32(v1);
+ // CHECK: dup {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
+}
+
+float64x1_t test_vmov_n_f64(float64_t v1) {
+ // CHECK: test_vmov_n_f64
+ return vmov_n_f64(v1);
+ // CHECK: ret
+}
+
+float32x4_t test_vmovq_n_f32(float32_t v1) {
+ // CHECK: test_vmovq_n_f32
+ return vmovq_n_f32(v1);
+ // CHECK: dup {{v[0-9]+}}.4s, {{v[0-9]+}}.s[0]
+}
+
+float64x2_t test_vmovq_n_f64(float64_t v1) {
+ // CHECK: test_vmovq_n_f64
+ return vmovq_n_f64(v1);
+ // CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vcopy_lane_s64
+int64x1_t test_vcopy_lane_s64(int64x1_t a, int64x1_t c) {
+ return vcopy_lane_s64(a, 0, c, 0);
+// CHECK: fmov {{d[0-9]+}}, {{d[0-9]+}}
+// CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vcopy_lane_u64
+uint64x1_t test_vcopy_lane_u64(uint64x1_t a, uint64x1_t c) {
+ return vcopy_lane_u64(a, 0, c, 0);
+// CHECK: fmov {{d[0-9]+}}, {{d[0-9]+}}
+// CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vcopy_lane_f64
+float64x1_t test_vcopy_lane_f64(float64x1_t a, float64x1_t c) {
+ return vcopy_lane_f64(a, 0, c, 0);
+// CHECK: fmov {{d[0-9]+}}, {{d[0-9]+}}
+// CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vcopy_laneq_s64
+int64x1_t test_vcopy_laneq_s64(int64x1_t a, int64x2_t c) {
+ return vcopy_laneq_s64(a, 0, c, 1);
+// CHECK: dup {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+// CHECK: test_vcopy_laneq_u64
+uint64x1_t test_vcopy_laneq_u64(uint64x1_t a, uint64x2_t c) {
+ return vcopy_laneq_u64(a, 0, c, 1);
+// CHECK: dup {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+// CHECK: test_vcopy_laneq_f64
+float64x1_t test_vcopy_laneq_f64(float64x1_t a, float64x2_t c) {
+ return vcopy_laneq_f64(a, 0, c, 1);
+// CHECK: dup {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+// CHECK: test_vcopy_laneq_p64
+poly64x1_t test_vcopy_laneq_p64(poly64x1_t a, poly64x2_t c) {
+ return vcopy_laneq_p64(a, 0, c, 1);
+// CHECK: dup {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+// CHECK: test_vcopyq_laneq_f64
+float64x2_t test_vcopyq_laneq_f64(float64x2_t a, float64x2_t c) {
+// CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[1]
+ return vcopyq_laneq_f64(a, 1, c, 1);
+}
+
+// CHECK: test_vget_lane_f16
+int test_vget_lane_f16(float16x4_t v1) {
+ float16_t a = vget_lane_f16(v1, 3);
+ return (int)a;
+// CHECK: dup {{h[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+// CHECK: test_vgetq_lane_f16
+int test_vgetq_lane_f16(float16x8_t v1) {
+ float16_t a = vgetq_lane_f16(v1, 7);
+ return (int)a;
+// CHECK: dup {{h[0-9]+}}, {{v[0-9]+}}.h[7]
+}
+
+// CHECK: test_vget_lane_f16_2
+float test_vget_lane_f16_2(float16x4_t v1) {
+ float16_t a = vget_lane_f16(v1, 3);
+ return (float)a;
+// CHECK: dup {{h[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+// CHECK: test_vgetq_lane_f16_2
+float test_vgetq_lane_f16_2(float16x8_t v1) {
+ float16_t a = vgetq_lane_f16(v1, 7);
+ return (float)a;
+// CHECK: dup {{h[0-9]+}}, {{v[0-9]+}}.h[7]
+}
+
+// CHECK: test_vset_lane_f16
+float16x4_t test_vset_lane_f16(float16x4_t v1) {
+ float16_t a;
+ return vset_lane_f16(a, v1, 3);
+// CHECK: fmov {{s[0-9]+}}, wzr
+// CHECK-NEXT: ins {{v[0-9]+}}.h[3], {{v[0-9]+}}.h[0]
+}
+
+// CHECK: test_vsetq_lane_f16
+float16x8_t test_vsetq_lane_f16(float16x8_t v1) {
+ float16_t a;
+ return vsetq_lane_f16(a, v1, 7);
+// CHECK: fmov {{s[0-9]+}}, wzr
+// CHECK-NEXT: ins {{v[0-9]+}}.h[7], {{v[0-9]+}}.h[0]
+}
+
+// CHECK: test_vset_lane_f16_2
+float16x4_t test_vset_lane_f16_2(float16x4_t v1) {
+ float16_t a = vget_lane_f16(v1, 0);
+ return vset_lane_f16(a, v1, 3);
+// CHECK: ins {{v[0-9]+}}.h[3], {{v[0-9]+}}.h[0]
+}
+
+// CHECK: test_vsetq_lane_f16_2
+float16x8_t test_vsetq_lane_f16_2(float16x8_t v1) {
+ float16_t a = vgetq_lane_f16(v1, 0);
+ return vsetq_lane_f16(a, v1, 7);
+// CHECK: ins {{v[0-9]+}}.h[7], {{v[0-9]+}}.h[0]
+}
+
+
+// CHECK: test_vsetq_lane_f16_3
+float16x8_t test_vsetq_lane_f16_3(float16x8_t v1, float b, float c) {
+ float16_t a = (float16_t)b;
+ return vsetq_lane_f16(a, v1, 7);
+// CHECK: ins {{v[0-9]+}}.h[7], {{w[0-9]+}}
+}
+
+// CHECK: test_vsetq_lane_f16_4
+float16x8_t test_vsetq_lane_f16_4(float16x8_t v1, float b, float c) {
+ float16_t a = (float16_t)b + 1.0;
+ return vsetq_lane_f16(a, v1, 7);
+// CHECK: ins {{v[0-9]+}}.h[7], {{w[0-9]+}}
+}
+
diff --git a/test/CodeGen/aarch64-neon-crypto.c b/test/CodeGen/aarch64-neon-crypto.c
new file mode 100644
index 000000000000..240f3794b965
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-crypto.c
@@ -0,0 +1,94 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -target-feature +crypto -S -O3 -o - %s | FileCheck %s
+// RUN: not %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -S -O3 -o - %s 2>&1 | FileCheck --check-prefix=CHECK-NO-CRYPTO %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+uint8x16_t test_vaeseq_u8(uint8x16_t data, uint8x16_t key) {
+ // CHECK: test_vaeseq_u8
+ // CHECK-NO-CRYPTO: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99
+ return vaeseq_u8(data, key);
+ // CHECK: aese {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint8x16_t test_vaesdq_u8(uint8x16_t data, uint8x16_t key) {
+ // CHECK: test_vaesdq_u8
+ return vaesdq_u8(data, key);
+ // CHECK: aesd {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint8x16_t test_vaesmcq_u8(uint8x16_t data) {
+ // CHECK: test_vaesmcq_u8
+ return vaesmcq_u8(data);
+ // CHECK: aesmc {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint8x16_t test_vaesimcq_u8(uint8x16_t data) {
+ // CHECK: test_vaesimcq_u8
+ return vaesimcq_u8(data);
+ // CHECK: aesimc {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint32_t test_vsha1h_u32(uint32_t hash_e) {
+ // CHECK: test_vsha1h_u32
+ return vsha1h_u32(hash_e);
+ // CHECK: sha1h {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+uint32x4_t test_vsha1su1q_u32(uint32x4_t tw0_3, uint32x4_t w12_15) {
+ // CHECK: test_vsha1su1q_u32
+ return vsha1su1q_u32(tw0_3, w12_15);
+ // CHECK: sha1su1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vsha256su0q_u32(uint32x4_t w0_3, uint32x4_t w4_7) {
+ // CHECK: test_vsha256su0q_u32
+ return vsha256su0q_u32(w0_3, w4_7);
+ // CHECK: sha256su0 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vsha1cq_u32(uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) {
+ // CHECK: test_vsha1cq_u32
+ return vsha1cq_u32(hash_abcd, hash_e, wk);
+ // CHECK: sha1c {{q[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vsha1pq_u32(uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) {
+ // CHECK: test_vsha1pq_u32
+ return vsha1pq_u32(hash_abcd, hash_e, wk);
+ // CHECK: sha1p {{q[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vsha1mq_u32(uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) {
+ // CHECK: test_vsha1mq_u32
+ return vsha1mq_u32(hash_abcd, hash_e, wk);
+ // CHECK: sha1m {{q[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vsha1su0q_u32(uint32x4_t w0_3, uint32x4_t w4_7, uint32x4_t w8_11) {
+ // CHECK: test_vsha1su0q_u32
+ return vsha1su0q_u32(w0_3, w4_7, w8_11);
+ // CHECK: sha1su0 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vsha256hq_u32(uint32x4_t hash_abcd, uint32x4_t hash_efgh, uint32x4_t wk) {
+ // CHECK: test_vsha256hq_u32
+ return vsha256hq_u32(hash_abcd, hash_efgh, wk);
+ // CHECK: sha256h {{q[0-9]+}}, {{q[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vsha256h2q_u32(uint32x4_t hash_efgh, uint32x4_t hash_abcd, uint32x4_t wk) {
+ // CHECK: test_vsha256h2q_u32
+ return vsha256h2q_u32(hash_efgh, hash_abcd, wk);
+ // CHECK: sha256h2 {{q[0-9]+}}, {{q[0-9]+}}, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vsha256su1q_u32(uint32x4_t tw0_3, uint32x4_t w8_11, uint32x4_t w12_15) {
+ // CHECK: test_vsha256su1q_u32
+ return vsha256su1q_u32(tw0_3, w8_11, w12_15);
+ // CHECK: sha256su1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
diff --git a/test/CodeGen/aarch64-neon-extract.c b/test/CodeGen/aarch64-neon-extract.c
new file mode 100644
index 000000000000..faf35afad6f7
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-extract.c
@@ -0,0 +1,148 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+int8x8_t test_vext_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vext_s8
+ return vext_s8(a, b, 2);
+ // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x2
+}
+
+int16x4_t test_vext_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vext_s16
+ return vext_s16(a, b, 3);
+ // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x6
+}
+
+int32x2_t test_vext_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vext_s32
+ return vext_s32(a, b, 1);
+ // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x4
+}
+
+int64x1_t test_vext_s64(int64x1_t a, int64x1_t b) {
+ // CHECK: test_vext_s64
+ return vext_s64(a, b, 0);
+}
+
+int8x16_t test_vextq_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vextq_s8
+ return vextq_s8(a, b, 2);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x2
+}
+
+int16x8_t test_vextq_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vextq_s16
+ return vextq_s16(a, b, 3);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x6
+}
+
+int32x4_t test_vextq_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vextq_s32
+ return vextq_s32(a, b, 1);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x4
+}
+
+int64x2_t test_vextq_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vextq_s64
+ return vextq_s64(a, b, 1);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x8
+}
+
+uint8x8_t test_vext_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vext_u8
+ return vext_u8(a, b, 2);
+ // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x2
+}
+
+uint16x4_t test_vext_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vext_u16
+ return vext_u16(a, b, 3);
+ // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x6
+}
+
+uint32x2_t test_vext_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vext_u32
+ return vext_u32(a, b, 1);
+ // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x4
+}
+
+uint64x1_t test_vext_u64(uint64x1_t a, uint64x1_t b) {
+ // CHECK: test_vext_u64
+ return vext_u64(a, b, 0);
+}
+
+uint8x16_t test_vextq_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vextq_u8
+ return vextq_u8(a, b, 2);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x2
+}
+
+uint16x8_t test_vextq_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vextq_u16
+ return vextq_u16(a, b, 3);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x6
+}
+
+uint32x4_t test_vextq_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vextq_u32
+ return vextq_u32(a, b, 1);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x4
+}
+
+uint64x2_t test_vextq_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vextq_u64
+ return vextq_u64(a, b, 1);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x8
+}
+
+float32x2_t test_vext_f32(float32x2_t a, float32x2_t b) {
+ // CHECK: test_vext_f32
+ return vext_f32(a, b, 1);
+ // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x4
+}
+
+float64x1_t test_vext_f64(float64x1_t a, float64x1_t b) {
+ // CHECK: test_vext_f64
+ return vext_f64(a, b, 0);
+}
+
+float32x4_t test_vextq_f32(float32x4_t a, float32x4_t b) {
+ // CHECK: test_vextq_f32
+ return vextq_f32(a, b, 1);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x4
+}
+
+float64x2_t test_vextq_f64(float64x2_t a, float64x2_t b) {
+ // CHECK: test_vextq_f64
+ return vextq_f64(a, b, 1);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x8
+}
+
+poly8x8_t test_vext_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vext_p8
+ return vext_p8(a, b, 2);
+ // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x2
+}
+
+poly16x4_t test_vext_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vext_p16
+ return vext_p16(a, b, 3);
+ // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x6
+}
+
+poly8x16_t test_vextq_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vextq_p8
+ return vextq_p8(a, b, 2);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x2
+}
+
+poly16x8_t test_vextq_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vextq_p16
+ return vextq_p16(a, b, 3);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x6
+}
diff --git a/test/CodeGen/aarch64-neon-fcvt-intrinsics.c b/test/CodeGen/aarch64-neon-fcvt-intrinsics.c
new file mode 100644
index 000000000000..98f1389be4ea
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-fcvt-intrinsics.c
@@ -0,0 +1,133 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+float32_t test_vcvtxd_f32_f64(float64_t a) {
+// CHECK: test_vcvtxd_f32_f64
+// CHECK: fcvtxn {{s[0-9]+}}, {{d[0-9]+}}
+ return (float32_t)vcvtxd_f32_f64(a);
+}
+
+int32_t test_vcvtas_s32_f32(float32_t a) {
+// CHECK: test_vcvtas_s32_f32
+// CHECK: fcvtas {{s[0-9]+}}, {{s[0-9]+}}
+ return (int32_t)vcvtas_s32_f32(a);
+}
+
+int64_t test_test_vcvtad_s64_f64(float64_t a) {
+// CHECK: test_test_vcvtad_s64_f64
+// CHECK: fcvtas {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vcvtad_s64_f64(a);
+}
+
+uint32_t test_vcvtas_u32_f32(float32_t a) {
+// CHECK: test_vcvtas_u32_f32
+// CHECK: fcvtau {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcvtas_u32_f32(a);
+}
+
+uint64_t test_vcvtad_u64_f64(float64_t a) {
+// CHECK: test_vcvtad_u64_f64
+// CHECK: fcvtau {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcvtad_u64_f64(a);
+}
+
+int32_t test_vcvtms_s32_f32(float32_t a) {
+// CHECK: test_vcvtms_s32_f32
+// CHECK: fcvtms {{s[0-9]+}}, {{s[0-9]+}}
+ return (int32_t)vcvtms_s32_f32(a);
+}
+
+int64_t test_vcvtmd_s64_f64(float64_t a) {
+// CHECK: test_vcvtmd_s64_f64
+// CHECK: fcvtms {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vcvtmd_s64_f64(a);
+}
+
+uint32_t test_vcvtms_u32_f32(float32_t a) {
+// CHECK: test_vcvtms_u32_f32
+// CHECK: fcvtmu {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcvtms_u32_f32(a);
+}
+
+uint64_t test_vcvtmd_u64_f64(float64_t a) {
+// CHECK: test_vcvtmd_u64_f64
+// CHECK: fcvtmu {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcvtmd_u64_f64(a);
+}
+
+int32_t test_vcvtns_s32_f32(float32_t a) {
+// CHECK: test_vcvtns_s32_f32
+// CHECK: fcvtns {{s[0-9]+}}, {{s[0-9]+}}
+ return (int32_t)vcvtns_s32_f32(a);
+}
+
+int64_t test_vcvtnd_s64_f64(float64_t a) {
+// CHECK: test_vcvtnd_s64_f64
+// CHECK: fcvtns {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vcvtnd_s64_f64(a);
+}
+
+uint32_t test_vcvtns_u32_f32(float32_t a) {
+// CHECK: test_vcvtns_u32_f32
+// CHECK: fcvtnu {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcvtns_u32_f32(a);
+}
+
+uint64_t test_vcvtnd_u64_f64(float64_t a) {
+// CHECK: test_vcvtnd_u64_f64
+// CHECK: fcvtnu {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcvtnd_u64_f64(a);
+}
+
+int32_t test_vcvtps_s32_f32(float32_t a) {
+// CHECK: test_vcvtps_s32_f32
+// CHECK: fcvtps {{s[0-9]+}}, {{s[0-9]+}}
+ return (int32_t)vcvtps_s32_f32(a);
+}
+
+int64_t test_vcvtpd_s64_f64(float64_t a) {
+// CHECK: test_vcvtpd_s64_f64
+// CHECK: fcvtps {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vcvtpd_s64_f64(a);
+}
+
+uint32_t test_vcvtps_u32_f32(float32_t a) {
+// CHECK: test_vcvtps_u32_f32
+// CHECK: fcvtpu {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcvtps_u32_f32(a);
+}
+
+uint64_t test_vcvtpd_u64_f64(float64_t a) {
+// CHECK: test_vcvtpd_u64_f64
+// CHECK: fcvtpu {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcvtpd_u64_f64(a);
+}
+
+int32_t test_vcvts_s32_f32(float32_t a) {
+// CHECK: test_vcvts_s32_f32
+// CHECK: fcvtzs {{s[0-9]+}}, {{s[0-9]+}}
+ return (int32_t)vcvts_s32_f32(a);
+}
+
+int64_t test_vcvtd_s64_f64(float64_t a) {
+// CHECK: test_vcvtd_s64_f64
+// CHECK: fcvtzs {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vcvtd_s64_f64(a);
+}
+
+uint32_t test_vcvts_u32_f32(float32_t a) {
+// CHECK: test_vcvts_u32_f32
+// CHECK: fcvtzu {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcvts_u32_f32(a);
+}
+
+uint64_t test_vcvtd_u64_f64(float64_t a) {
+// CHECK: test_vcvtd_u64_f64
+// CHECK: fcvtzu {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcvtd_u64_f64(a);
+}
diff --git a/test/CodeGen/aarch64-neon-intrinsics.c b/test/CodeGen/aarch64-neon-intrinsics.c
new file mode 100644
index 000000000000..6e9b7f10b362
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-intrinsics.c
@@ -0,0 +1,11725 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+int8x8_t test_vadd_s8(int8x8_t v1, int8x8_t v2) {
+ // CHECK: test_vadd_s8
+ return vadd_s8(v1, v2);
+ // CHECK: add {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vadd_s16(int16x4_t v1, int16x4_t v2) {
+ // CHECK: test_vadd_s16
+ return vadd_s16(v1, v2);
+ // CHECK: add {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vadd_s32(int32x2_t v1, int32x2_t v2) {
+ // CHECK: test_vadd_s32
+ return vadd_s32(v1, v2);
+ // CHECK: add {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int64x1_t test_vadd_s64(int64x1_t v1, int64x1_t v2) {
+ // CHECK: test_vadd_s64
+ return vadd_s64(v1, v2);
+ // CHECK: add {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+float32x2_t test_vadd_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vadd_f32
+ return vadd_f32(v1, v2);
+ // CHECK: fadd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vadd_u8(uint8x8_t v1, uint8x8_t v2) {
+ // CHECK: test_vadd_u8
+ return vadd_u8(v1, v2);
+ // CHECK: add {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vadd_u16(uint16x4_t v1, uint16x4_t v2) {
+ // CHECK: test_vadd_u16
+ return vadd_u16(v1, v2);
+ // CHECK: add {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vadd_u32(uint32x2_t v1, uint32x2_t v2) {
+ // CHECK: test_vadd_u32
+ return vadd_u32(v1, v2);
+ // CHECK: add {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vadd_u64(uint64x1_t v1, uint64x1_t v2) {
+ // CHECK: test_vadd_u64
+ return vadd_u64(v1, v2);
+ // CHECK: add {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int8x16_t test_vaddq_s8(int8x16_t v1, int8x16_t v2) {
+ // CHECK: test_vaddq_s8
+ return vaddq_s8(v1, v2);
+ // CHECK: add {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vaddq_s16(int16x8_t v1, int16x8_t v2) {
+ // CHECK: test_vaddq_s16
+ return vaddq_s16(v1, v2);
+ // CHECK: add {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vaddq_s32(int32x4_t v1,int32x4_t v2) {
+ // CHECK: test_vaddq_s32
+ return vaddq_s32(v1, v2);
+ // CHECK: add {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vaddq_s64(int64x2_t v1, int64x2_t v2) {
+ // CHECK: test_vaddq_s64
+ return vaddq_s64(v1, v2);
+ // CHECK: add {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+float32x4_t test_vaddq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vaddq_f32
+ return vaddq_f32(v1, v2);
+ // CHECK: fadd {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vaddq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vaddq_f64
+ return vaddq_f64(v1, v2);
+ // CHECK: fadd {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint8x16_t test_vaddq_u8(uint8x16_t v1, uint8x16_t v2) {
+ // CHECK: test_vaddq_u8
+ return vaddq_u8(v1, v2);
+ // CHECK: add {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vaddq_u16(uint16x8_t v1, uint16x8_t v2) {
+ // CHECK: test_vaddq_u16
+ return vaddq_u16(v1, v2);
+ // CHECK: add {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vaddq_u32(uint32x4_t v1, uint32x4_t v2) {
+ // CHECK: vaddq_u32
+ return vaddq_u32(v1, v2);
+ // CHECK: add {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vaddq_u64(uint64x2_t v1, uint64x2_t v2) {
+ // CHECK: test_vaddq_u64
+ return vaddq_u64(v1, v2);
+ // CHECK: add {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+int8x8_t test_vsub_s8(int8x8_t v1, int8x8_t v2) {
+ // CHECK: test_vsub_s8
+ return vsub_s8(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+int16x4_t test_vsub_s16(int16x4_t v1, int16x4_t v2) {
+ // CHECK: test_vsub_s16
+ return vsub_s16(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+int32x2_t test_vsub_s32(int32x2_t v1, int32x2_t v2) {
+ // CHECK: test_vsub_s32
+ return vsub_s32(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int64x1_t test_vsub_s64(int64x1_t v1, int64x1_t v2) {
+ // CHECK: test_vsub_s64
+ return vsub_s64(v1, v2);
+ // CHECK: sub {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+float32x2_t test_vsub_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vsub_f32
+ return vsub_f32(v1, v2);
+ // CHECK: fsub {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vsub_u8(uint8x8_t v1, uint8x8_t v2) {
+ // CHECK: test_vsub_u8
+ return vsub_u8(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vsub_u16(uint16x4_t v1, uint16x4_t v2) {
+ // CHECK: test_vsub_u16
+ return vsub_u16(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vsub_u32(uint32x2_t v1, uint32x2_t v2) {
+ // CHECK: test_vsub_u32
+ return vsub_u32(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vsub_u64(uint64x1_t v1, uint64x1_t v2) {
+ // CHECK: test_vsub_u64
+ return vsub_u64(v1, v2);
+ // CHECK: sub {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int8x16_t test_vsubq_s8(int8x16_t v1, int8x16_t v2) {
+ // CHECK: test_vsubq_s8
+ return vsubq_s8(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vsubq_s16(int16x8_t v1, int16x8_t v2) {
+ // CHECK: test_vsubq_s16
+ return vsubq_s16(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vsubq_s32(int32x4_t v1,int32x4_t v2) {
+ // CHECK: test_vsubq_s32
+ return vsubq_s32(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vsubq_s64(int64x2_t v1, int64x2_t v2) {
+ // CHECK: test_vsubq_s64
+ return vsubq_s64(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+float32x4_t test_vsubq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vsubq_f32
+ return vsubq_f32(v1, v2);
+ // CHECK: fsub {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vsubq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vsubq_f64
+ return vsubq_f64(v1, v2);
+ // CHECK: fsub {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint8x16_t test_vsubq_u8(uint8x16_t v1, uint8x16_t v2) {
+ // CHECK: test_vsubq_u8
+ return vsubq_u8(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vsubq_u16(uint16x8_t v1, uint16x8_t v2) {
+ // CHECK: test_vsubq_u16
+ return vsubq_u16(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vsubq_u32(uint32x4_t v1, uint32x4_t v2) {
+ // CHECK: vsubq_u32
+ return vsubq_u32(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vsubq_u64(uint64x2_t v1, uint64x2_t v2) {
+ // CHECK: test_vsubq_u64
+ return vsubq_u64(v1, v2);
+ // CHECK: sub {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+int8x8_t test_vmul_s8(int8x8_t v1, int8x8_t v2) {
+ // CHECK: test_vmul_s8
+ return vmul_s8(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vmul_s16(int16x4_t v1, int16x4_t v2) {
+ // CHECK: test_vmul_s16
+ return vmul_s16(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vmul_s32(int32x2_t v1, int32x2_t v2) {
+ // CHECK: test_vmul_s32
+ return vmul_s32(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x2_t test_vmul_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vmul_f32
+ return vmul_f32(v1, v2);
+ // CHECK: fmul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+
+uint8x8_t test_vmul_u8(uint8x8_t v1, uint8x8_t v2) {
+ // CHECK: test_vmul_u8
+ return vmul_u8(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vmul_u16(uint16x4_t v1, uint16x4_t v2) {
+ // CHECK: test_vmul_u16
+ return vmul_u16(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vmul_u32(uint32x2_t v1, uint32x2_t v2) {
+ // CHECK: test_vmul_u32
+ return vmul_u32(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vmulq_s8(int8x16_t v1, int8x16_t v2) {
+ // CHECK: test_vmulq_s8
+ return vmulq_s8(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vmulq_s16(int16x8_t v1, int16x8_t v2) {
+ // CHECK: test_vmulq_s16
+ return vmulq_s16(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vmulq_s32(int32x4_t v1, int32x4_t v2) {
+ // CHECK: test_vmulq_s32
+ return vmulq_s32(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vmulq_u8(uint8x16_t v1, uint8x16_t v2) {
+ // CHECK: test_vmulq_u8
+ return vmulq_u8(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vmulq_u16(uint16x8_t v1, uint16x8_t v2) {
+ // CHECK: test_vmulq_u16
+ return vmulq_u16(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vmulq_u32(uint32x4_t v1, uint32x4_t v2) {
+ // CHECK: test_vmulq_u32
+ return vmulq_u32(v1, v2);
+ // CHECK: mul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float32x4_t test_vmulq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vmulq_f32
+ return vmulq_f32(v1, v2);
+ // CHECK: fmul {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vmulq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vmulq_f64
+ return vmulq_f64(v1, v2);
+ // CHECK: fmul {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+poly8x8_t test_vmul_p8(poly8x8_t v1, poly8x8_t v2) {
+ // test_vmul_p8
+ return vmul_p8(v1, v2);
+ // pmul {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly8x16_t test_vmulq_p8(poly8x16_t v1, poly8x16_t v2) {
+ // test_vmulq_p8
+ return vmulq_p8(v1, v2);
+ // pmul {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+
+int8x8_t test_vmla_s8(int8x8_t v1, int8x8_t v2, int8x8_t v3) {
+ // CHECK: test_vmla_s8
+ return vmla_s8(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vmla_s16(int16x4_t v1, int16x4_t v2, int16x4_t v3) {
+ // CHECK: test_vmla_s16
+ return vmla_s16(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vmla_s32(int32x2_t v1, int32x2_t v2, int32x2_t v3) {
+ // CHECK: test_vmla_s32
+ return vmla_s32(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x2_t test_vmla_f32(float32x2_t v1, float32x2_t v2, float32x2_t v3) {
+ // CHECK: test_vmla_f32
+ return vmla_f32(v1, v2, v3);
+ // CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vmla_u8(uint8x8_t v1, uint8x8_t v2, uint8x8_t v3) {
+ // CHECK: test_vmla_u8
+ return vmla_u8(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vmla_u16(uint16x4_t v1, uint16x4_t v2, uint16x4_t v3) {
+ // CHECK: test_vmla_u16
+ return vmla_u16(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vmla_u32(uint32x2_t v1, uint32x2_t v2, uint32x2_t v3) {
+ // CHECK: test_vmla_u32
+ return vmla_u32(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vmlaq_s8(int8x16_t v1, int8x16_t v2, int8x16_t v3) {
+ // CHECK: test_vmlaq_s8
+ return vmlaq_s8(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vmlaq_s16(int16x8_t v1, int16x8_t v2, int16x8_t v3) {
+ // CHECK: test_vmlaq_s16
+ return vmlaq_s16(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vmlaq_s32(int32x4_t v1, int32x4_t v2, int32x4_t v3) {
+ // CHECK: test_vmlaq_s32
+ return vmlaq_s32(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float32x4_t test_vmlaq_f32(float32x4_t v1, float32x4_t v2, float32x4_t v3) {
+ // CHECK: test_vmlaq_f32
+ return vmlaq_f32(v1, v2, v3);
+ // CHECK: fmla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vmlaq_u8(uint8x16_t v1, uint8x16_t v2, uint8x16_t v3) {
+ // CHECK: test_vmlaq_u8
+ return vmlaq_u8(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vmlaq_u16(uint16x8_t v1, uint16x8_t v2, uint16x8_t v3) {
+ // CHECK: test_vmlaq_u16
+ return vmlaq_u16(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vmlaq_u32(uint32x4_t v1, uint32x4_t v2, uint32x4_t v3) {
+ // CHECK: test_vmlaq_u32
+ return vmlaq_u32(v1, v2, v3);
+ // CHECK: mla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vmlaq_f64(float64x2_t v1, float64x2_t v2, float64x2_t v3) {
+ // CHECK: test_vmlaq_f64
+ return vmlaq_f64(v1, v2, v3);
+ // CHECK: fmla {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+int8x8_t test_vmls_s8(int8x8_t v1, int8x8_t v2, int8x8_t v3) {
+ // CHECK: test_vmls_s8
+ return vmls_s8(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vmls_s16(int16x4_t v1, int16x4_t v2, int16x4_t v3) {
+ // CHECK: test_vmls_s16
+ return vmls_s16(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vmls_s32(int32x2_t v1, int32x2_t v2, int32x2_t v3) {
+ // CHECK: test_vmls_s32
+ return vmls_s32(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x2_t test_vmls_f32(float32x2_t v1, float32x2_t v2, float32x2_t v3) {
+ // CHECK: test_vmls_f32
+ return vmls_f32(v1, v2, v3);
+ // CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vmls_u8(uint8x8_t v1, uint8x8_t v2, uint8x8_t v3) {
+ // CHECK: test_vmls_u8
+ return vmls_u8(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vmls_u16(uint16x4_t v1, uint16x4_t v2, uint16x4_t v3) {
+ // CHECK: test_vmls_u16
+ return vmls_u16(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vmls_u32(uint32x2_t v1, uint32x2_t v2, uint32x2_t v3) {
+ // CHECK: test_vmls_u32
+ return vmls_u32(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+int8x16_t test_vmlsq_s8(int8x16_t v1, int8x16_t v2, int8x16_t v3) {
+ // CHECK: test_vmlsq_s8
+ return vmlsq_s8(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vmlsq_s16(int16x8_t v1, int16x8_t v2, int16x8_t v3) {
+ // CHECK: test_vmlsq_s16
+ return vmlsq_s16(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vmlsq_s32(int32x4_t v1, int32x4_t v2, int32x4_t v3) {
+ // CHECK: test_vmlsq_s32
+ return vmlsq_s32(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float32x4_t test_vmlsq_f32(float32x4_t v1, float32x4_t v2, float32x4_t v3) {
+ // CHECK: test_vmlsq_f32
+ return vmlsq_f32(v1, v2, v3);
+ // CHECK: fmls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+uint8x16_t test_vmlsq_u8(uint8x16_t v1, uint8x16_t v2, uint8x16_t v3) {
+ // CHECK: test_vmlsq_u8
+ return vmlsq_u8(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vmlsq_u16(uint16x8_t v1, uint16x8_t v2, uint16x8_t v3) {
+ // CHECK: test_vmlsq_u16
+ return vmlsq_u16(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vmlsq_u32(uint32x4_t v1, uint32x4_t v2, uint32x4_t v3) {
+ // CHECK: test_vmlsq_u32
+ return vmlsq_u32(v1, v2, v3);
+ // CHECK: mls {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vmlsq_f64(float64x2_t v1, float64x2_t v2, float64x2_t v3) {
+ // CHECK: test_vmlsq_f64
+ return vmlsq_f64(v1, v2, v3);
+ // CHECK: fmls {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+float32x2_t test_vfma_f32(float32x2_t v1, float32x2_t v2, float32x2_t v3) {
+ // CHECK: test_vfma_f32
+ return vfma_f32(v1, v2, v3);
+ // CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x4_t test_vfmaq_f32(float32x4_t v1, float32x4_t v2, float32x4_t v3) {
+ // CHECK: test_vfmaq_f32
+ return vfmaq_f32(v1, v2, v3);
+ // CHECK: fmla {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vfmaq_f64(float64x2_t v1, float64x2_t v2, float64x2_t v3) {
+ // CHECK: test_vfmaq_f64
+ return vfmaq_f64(v1, v2, v3);
+ // CHECK: fmla {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+float32x2_t test_vfms_f32(float32x2_t v1, float32x2_t v2, float32x2_t v3) {
+ // CHECK: test_vfms_f32
+ return vfms_f32(v1, v2, v3);
+ // CHECK: fmls v0.2s, v1.2s, v2.2s
+}
+
+float32x4_t test_vfmsq_f32(float32x4_t v1, float32x4_t v2, float32x4_t v3) {
+ // CHECK: test_vfmsq_f32
+ return vfmsq_f32(v1, v2, v3);
+ // CHECK: fmls v0.4s, v1.4s, v2.4s
+}
+
+float64x2_t test_vfmsq_f64(float64x2_t v1, float64x2_t v2, float64x2_t v3) {
+ // CHECK: vfmsq_f64
+ return vfmsq_f64(v1, v2, v3);
+ // CHECK: fmls v0.2d, v1.2d, v2.2d
+}
+
+float64x2_t test_vdivq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vdivq_f64
+ return vdivq_f64(v1, v2);
+ // CHECK: fdiv {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+float32x4_t test_vdivq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vdivq_f32
+ return vdivq_f32(v1, v2);
+ // CHECK: fdiv {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float32x2_t test_vdiv_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vdiv_f32
+ return vdiv_f32(v1, v2);
+ // CHECK: fdiv {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x8_t test_vaba_s8(int8x8_t v1, int8x8_t v2, int8x8_t v3) {
+ // CHECK: test_vaba_s8
+ return vaba_s8(v1, v2, v3);
+ // CHECK: saba {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vaba_s16(int16x4_t v1, int16x4_t v2, int16x4_t v3) {
+ // CHECK: test_vaba_s16
+ return vaba_s16(v1, v2, v3);
+ // CHECK: saba {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vaba_s32(int32x2_t v1, int32x2_t v2, int32x2_t v3) {
+ // CHECK: test_vaba_s32
+ return vaba_s32(v1, v2, v3);
+ // CHECK: saba {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vaba_u8(uint8x8_t v1, uint8x8_t v2, uint8x8_t v3) {
+ // CHECK: test_vaba_u8
+ return vaba_u8(v1, v2, v3);
+ // CHECK: uaba {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vaba_u16(uint16x4_t v1, uint16x4_t v2, uint16x4_t v3) {
+ // CHECK: test_vaba_u16
+ return vaba_u16(v1, v2, v3);
+ // CHECK: uaba {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vaba_u32(uint32x2_t v1, uint32x2_t v2, uint32x2_t v3) {
+ // CHECK: test_vaba_u32
+ return vaba_u32(v1, v2, v3);
+ // CHECK: uaba {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vabaq_s8(int8x16_t v1, int8x16_t v2, int8x16_t v3) {
+ // CHECK: test_vabaq_s8
+ return vabaq_s8(v1, v2, v3);
+ // CHECK: saba {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vabaq_s16(int16x8_t v1, int16x8_t v2, int16x8_t v3) {
+ // CHECK: test_vabaq_s16
+ return vabaq_s16(v1, v2, v3);
+ // CHECK: saba {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vabaq_s32(int32x4_t v1, int32x4_t v2, int32x4_t v3) {
+ // CHECK: test_vabaq_s32
+ return vabaq_s32(v1, v2, v3);
+ // CHECK: saba {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vabaq_u8(uint8x16_t v1, uint8x16_t v2, uint8x16_t v3) {
+ // CHECK: test_vabaq_u8
+ return vabaq_u8(v1, v2, v3);
+ // CHECK: uaba {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vabaq_u16(uint16x8_t v1, uint16x8_t v2, uint16x8_t v3) {
+ // CHECK: test_vabaq_u16
+ return vabaq_u16(v1, v2, v3);
+ // CHECK: uaba {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vabaq_u32(uint32x4_t v1, uint32x4_t v2, uint32x4_t v3) {
+ // CHECK: test_vabaq_u32
+ return vabaq_u32(v1, v2, v3);
+ // CHECK: uaba {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int8x8_t test_vabd_s8(int8x8_t v1, int8x8_t v2) {
+ // CHECK: test_vabd_s8
+ return vabd_s8(v1, v2);
+ // CHECK: sabd {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vabd_s16(int16x4_t v1, int16x4_t v2) {
+ // CHECK: test_vabd_s16
+ return vabd_s16(v1, v2);
+ // CHECK: sabd {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vabd_s32(int32x2_t v1, int32x2_t v2) {
+ // CHECK: test_vabd_s32
+ return vabd_s32(v1, v2);
+ // CHECK: sabd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vabd_u8(uint8x8_t v1, uint8x8_t v2) {
+ // CHECK: test_vabd_u8
+ return vabd_u8(v1, v2);
+ // CHECK: uabd {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vabd_u16(uint16x4_t v1, uint16x4_t v2) {
+ // CHECK: test_vabd_u16
+ return vabd_u16(v1, v2);
+ // CHECK: uabd {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vabd_u32(uint32x2_t v1, uint32x2_t v2) {
+ // CHECK: test_vabd_u32
+ return vabd_u32(v1, v2);
+ // CHECK: uabd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x2_t test_vabd_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vabd_f32
+ return vabd_f32(v1, v2);
+ // CHECK: fabd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vabdq_s8(int8x16_t v1, int8x16_t v2) {
+ // CHECK: test_vabdq_s8
+ return vabdq_s8(v1, v2);
+ // CHECK: sabd {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vabdq_s16(int16x8_t v1, int16x8_t v2) {
+ // CHECK: test_vabdq_s16
+ return vabdq_s16(v1, v2);
+ // CHECK: sabd {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vabdq_s32(int32x4_t v1, int32x4_t v2) {
+ // CHECK: test_vabdq_s32
+ return vabdq_s32(v1, v2);
+ // CHECK: sabd {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vabdq_u8(uint8x16_t v1, uint8x16_t v2) {
+ // CHECK: test_vabdq_u8
+ return vabdq_u8(v1, v2);
+ // CHECK: uabd {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vabdq_u16(uint16x8_t v1, uint16x8_t v2) {
+ // CHECK: test_vabdq_u16
+ return vabdq_u16(v1, v2);
+ // CHECK: uabd {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vabdq_u32(uint32x4_t v1, uint32x4_t v2) {
+ // CHECK: test_vabdq_u32
+ return vabdq_u32(v1, v2);
+ // CHECK: uabd {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float32x4_t test_vabdq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vabdq_f32
+ return vabdq_f32(v1, v2);
+ // CHECK: fabd {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vabdq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vabdq_f64
+ return vabdq_f64(v1, v2);
+ // CHECK: fabd {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+
+int8x8_t test_vbsl_s8(uint8x8_t v1, int8x8_t v2, int8x8_t v3) {
+ // CHECK: test_vbsl_s8
+ return vbsl_s8(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vbsl_s16(uint16x4_t v1, int16x4_t v2, int16x4_t v3) {
+ // CHECK: test_vbsl_s16
+ return vbsl_s16(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int32x2_t test_vbsl_s32(uint32x2_t v1, int32x2_t v2, int32x2_t v3) {
+ // CHECK: test_vbsl_s32
+ return vbsl_s32(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint64x1_t test_vbsl_s64(uint64x1_t v1, uint64x1_t v2, uint64x1_t v3) {
+ // CHECK: test_vbsl_s64
+ return vbsl_s64(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vbsl_u8(uint8x8_t v1, uint8x8_t v2, uint8x8_t v3) {
+ // CHECK: test_vbsl_u8
+ return vbsl_u8(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vbsl_u16(uint16x4_t v1, uint16x4_t v2, uint16x4_t v3) {
+ // CHECK: test_vbsl_u16
+ return vbsl_u16(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint32x2_t test_vbsl_u32(uint32x2_t v1, uint32x2_t v2, uint32x2_t v3) {
+ // CHECK: test_vbsl_u32
+ return vbsl_u32(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint64x1_t test_vbsl_u64(uint64x1_t v1, uint64x1_t v2, uint64x1_t v3) {
+ // CHECK: test_vbsl_u64
+ return vbsl_u64(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+float32x2_t test_vbsl_f32(float32x2_t v1, float32x2_t v2, float32x2_t v3) {
+ // CHECK: test_vbsl_f32
+ return vbsl_f32(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+float64x1_t test_vbsl_f64(uint64x1_t v1, float64x1_t v2, float64x1_t v3) {
+ // CHECK: test_vbsl_f64
+ return vbsl_f64(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vbsl_p8(uint8x8_t v1, poly8x8_t v2, poly8x8_t v3) {
+ // CHECK: test_vbsl_p8
+ return vbsl_p8(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly16x4_t test_vbsl_p16(uint16x4_t v1, poly16x4_t v2, poly16x4_t v3) {
+ // CHECK: test_vbsl_p16
+ return vbsl_p16(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x16_t test_vbslq_s8(uint8x16_t v1, int8x16_t v2, int8x16_t v3) {
+ // CHECK: test_vbslq_s8
+ return vbslq_s8(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vbslq_s16(uint16x8_t v1, int16x8_t v2, int16x8_t v3) {
+ // CHECK: test_vbslq_s16
+ return vbslq_s16(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int32x4_t test_vbslq_s32(uint32x4_t v1, int32x4_t v2, int32x4_t v3) {
+ // CHECK: test_vbslq_s32
+ return vbslq_s32(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int64x2_t test_vbslq_s64(uint64x2_t v1, int64x2_t v2, int64x2_t v3) {
+ // CHECK: test_vbslq_s64
+ return vbslq_s64(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint8x16_t test_vbslq_u8(uint8x16_t v1, uint8x16_t v2, uint8x16_t v3) {
+ // CHECK: test_vbslq_u8
+ return vbslq_u8(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vbslq_u16(uint16x8_t v1, uint16x8_t v2, uint16x8_t v3) {
+ // CHECK: test_vbslq_u16
+ return vbslq_u16(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int32x4_t test_vbslq_u32(uint32x4_t v1, int32x4_t v2, int32x4_t v3) {
+ // CHECK: test_vbslq_u32
+ return vbslq_s32(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint64x2_t test_vbslq_u64(uint64x2_t v1, uint64x2_t v2, uint64x2_t v3) {
+ // CHECK: test_vbslq_u64
+ return vbslq_u64(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+float32x4_t test_vbslq_f32(uint32x4_t v1, float32x4_t v2, float32x4_t v3) {
+ // CHECK: test_vbslq_f32
+ return vbslq_f32(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+poly8x16_t test_vbslq_p8(uint8x16_t v1, poly8x16_t v2, poly8x16_t v3) {
+ // CHECK: test_vbslq_p8
+ return vbslq_p8(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+poly16x8_t test_vbslq_p16(uint16x8_t v1, poly16x8_t v2, poly16x8_t v3) {
+ // CHECK: test_vbslq_p16
+ return vbslq_p16(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+float64x2_t test_vbslq_f64(uint64x2_t v1, float64x2_t v2, float64x2_t v3) {
+ // CHECK: test_vbslq_f64
+ return vbslq_f64(v1, v2, v3);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+float32x2_t test_vrecps_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vrecps_f32
+ return vrecps_f32(v1, v2);
+ // CHECK: frecps {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x4_t test_vrecpsq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vrecpsq_f32
+ return vrecpsq_f32(v1, v2);
+ // CHECK: frecps {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vrecpsq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vrecpsq_f64
+ return vrecpsq_f64(v1, v2);
+ // CHECK: frecps {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+float32x2_t test_vrsqrts_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vrsqrts_f32
+ return vrsqrts_f32(v1, v2);
+ // CHECK: frsqrts {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x4_t test_vrsqrtsq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vrsqrtsq_f32
+ return vrsqrtsq_f32(v1, v2);
+ // CHECK: frsqrts {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vrsqrtsq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vrsqrtsq_f64
+ return vrsqrtsq_f64(v1, v2);
+ // CHECK: frsqrts {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint32x2_t test_vcage_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vcage_f32
+ return vcage_f32(v1, v2);
+ // CHECK: facge {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vcage_f64(float64x1_t a, float64x1_t b) {
+ // CHECK: test_vcage_f64
+ return vcage_f64(a, b);
+ // CHECK: facge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint32x4_t test_vcageq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vcageq_f32
+ return vcageq_f32(v1, v2);
+ // CHECK: facge {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vcageq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vcageq_f64
+ return vcageq_f64(v1, v2);
+ // CHECK: facge {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint32x2_t test_vcagt_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vcagt_f32
+ return vcagt_f32(v1, v2);
+ // CHECK: facgt {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vcagt_f64(float64x1_t a, float64x1_t b) {
+ // CHECK: test_vcagt_f64
+ return vcagt_f64(a, b);
+ // CHECK: facgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint32x4_t test_vcagtq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vcagtq_f32
+ return vcagtq_f32(v1, v2);
+ // CHECK: facgt {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vcagtq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vcagtq_f64
+ return vcagtq_f64(v1, v2);
+ // CHECK: facgt {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint32x2_t test_vcale_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vcale_f32
+ return vcale_f32(v1, v2);
+ // Using registers other than v0, v1 are possible, but would be odd.
+ // CHECK: facge {{v[0-9]+}}.2s, v1.2s, v0.2s
+}
+
+uint64x1_t test_vcale_f64(float64x1_t a, float64x1_t b) {
+ // CHECK: test_vcale_f64
+ return vcale_f64(a, b);
+ // CHECK: facge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint32x4_t test_vcaleq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vcaleq_f32
+ return vcaleq_f32(v1, v2);
+ // Using registers other than v0, v1 are possible, but would be odd.
+ // CHECK: facge {{v[0-9]+}}.4s, v1.4s, v0.4s
+}
+
+uint64x2_t test_vcaleq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vcaleq_f64
+ return vcaleq_f64(v1, v2);
+ // Using registers other than v0, v1 are possible, but would be odd.
+ // CHECK: facge {{v[0-9]+}}.2d, v1.2d, v0.2d
+}
+
+uint32x2_t test_vcalt_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vcalt_f32
+ return vcalt_f32(v1, v2);
+ // Using registers other than v0, v1 are possible, but would be odd.
+ // CHECK: facgt {{v[0-9]+}}.2s, v1.2s, v0.2s
+}
+
+uint64x1_t test_vcalt_f64(float64x1_t a, float64x1_t b) {
+ // CHECK: test_vcalt_f64
+ return vcalt_f64(a, b);
+ // CHECK: facgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint32x4_t test_vcaltq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vcaltq_f32
+ return vcaltq_f32(v1, v2);
+ // Using registers other than v0, v1 are possible, but would be odd.
+ // CHECK: facgt {{v[0-9]+}}.4s, v1.4s, v0.4s
+}
+
+uint64x2_t test_vcaltq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vcaltq_f64
+ return vcaltq_f64(v1, v2);
+ // Using registers other than v0, v1 are possible, but would be odd.
+ // CHECK: facgt {{v[0-9]+}}.2d, v1.2d, v0.2d
+}
+
+uint8x8_t test_vtst_s8(int8x8_t v1, int8x8_t v2) {
+ // CHECK: test_vtst_s8
+ return vtst_s8(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vtst_s16(int16x4_t v1, int16x4_t v2) {
+ // CHECK: test_vtst_s16
+ return vtst_s16(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vtst_s32(int32x2_t v1, int32x2_t v2) {
+ // CHECK: test_vtst_s32
+ return vtst_s32(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vtst_u8(uint8x8_t v1, uint8x8_t v2) {
+ // CHECK: test_vtst_u8
+ return vtst_u8(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vtst_u16(uint16x4_t v1, uint16x4_t v2) {
+ // CHECK: test_vtst_u16
+ return vtst_u16(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vtst_u32(uint32x2_t v1, uint32x2_t v2) {
+ // CHECK: test_vtst_u32
+ return vtst_u32(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x16_t test_vtstq_s8(int8x16_t v1, int8x16_t v2) {
+ // CHECK: test_vtstq_s8
+ return vtstq_s8(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vtstq_s16(int16x8_t v1, int16x8_t v2) {
+ // CHECK: test_vtstq_s16
+ return vtstq_s16(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vtstq_s32(int32x4_t v1, int32x4_t v2) {
+ // CHECK: test_vtstq_s32
+ return vtstq_s32(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vtstq_u8(uint8x16_t v1, uint8x16_t v2) {
+ // CHECK: test_vtstq_u8
+ return vtstq_u8(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vtstq_u16(uint16x8_t v1, uint16x8_t v2) {
+ // CHECK: test_vtstq_u16
+ return vtstq_u16(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vtstq_u32(uint32x4_t v1, uint32x4_t v2) {
+ // CHECK: test_vtstq_u32
+ return vtstq_u32(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vtstq_s64(int64x2_t v1, int64x2_t v2) {
+ // CHECK: test_vtstq_s64
+ return vtstq_s64(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint64x2_t test_vtstq_u64(uint64x2_t v1, uint64x2_t v2) {
+ // CHECK: test_vtstq_u64
+ return vtstq_u64(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint8x8_t test_vtst_p8(poly8x8_t v1, poly8x8_t v2) {
+ // CHECK: test_vtst_p8
+ return vtst_p8(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vtst_p16(poly16x4_t v1, poly16x4_t v2) {
+ // CHECK: test_vtst_p16
+ return vtst_p16(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint8x16_t test_vtstq_p8(poly8x16_t v1, poly8x16_t v2) {
+ // CHECK: test_vtstq_p8
+ return vtstq_p8(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vtstq_p16(poly16x8_t v1, poly16x8_t v2) {
+ // CHECK: test_vtstq_p16
+ return vtstq_p16(v1, v2);
+ // CHECK: cmtst {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+
+uint8x8_t test_vceq_s8(int8x8_t v1, int8x8_t v2) {
+ // CHECK: test_vceq_s8
+ return vceq_s8(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vceq_s16(int16x4_t v1, int16x4_t v2) {
+ // CHECK: test_vceq_s16
+ return vceq_s16(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vceq_s32(int32x2_t v1, int32x2_t v2) {
+ // CHECK: test_vceq_s32
+ return vceq_s32(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vceq_s64(int64x1_t a, int64x1_t b) {
+ // CHECK: test_vceq_s64
+ return vceq_s64(a, b);
+ // CHECK: cmeq {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint64x1_t test_vceq_u64(uint64x1_t a, uint64x1_t b) {
+ // CHECK: test_vceq_u64
+ return vceq_u64(a, b);
+ // CHECK: cmeq {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint32x2_t test_vceq_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vceq_f32
+ return vceq_f32(v1, v2);
+ // CHECK: fcmeq {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vceq_f64(float64x1_t a, float64x1_t b) {
+ // CHECK: test_vceq_f64
+ return vceq_f64(a, b);
+ // CHECK: fcmeq {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vceq_u8(uint8x8_t v1, uint8x8_t v2) {
+ // CHECK: test_vceq_u8
+ return vceq_u8(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vceq_u16(uint16x4_t v1, uint16x4_t v2) {
+ // CHECK: test_vceq_u16
+ return vceq_u16(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vceq_u32(uint32x2_t v1, uint32x2_t v2) {
+ // CHECK: test_vceq_u32
+ return vceq_u32(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vceq_p8(poly8x8_t v1, poly8x8_t v2) {
+ // CHECK: test_vceq_p8
+ return vceq_p8(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint8x16_t test_vceqq_s8(int8x16_t v1, int8x16_t v2) {
+ // CHECK: test_vceqq_s8
+ return vceqq_s8(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vceqq_s16(int16x8_t v1, int16x8_t v2) {
+ // CHECK: test_vceqq_s16
+ return vceqq_s16(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vceqq_s32(int32x4_t v1, int32x4_t v2) {
+ // CHECK: test_vceqq_s32
+ return vceqq_s32(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vceqq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vceqq_f32
+ return vceqq_f32(v1, v2);
+ // CHECK: fcmeq {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vceqq_u8(uint8x16_t v1, uint8x16_t v2) {
+ // CHECK: test_vceqq_u8
+ return vceqq_u8(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vceqq_u16(uint16x8_t v1, uint16x8_t v2) {
+ // CHECK: test_vceqq_u16
+ return vceqq_u16(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vceqq_u32(uint32x4_t v1, uint32x4_t v2) {
+ // CHECK: test_vceqq_u32
+ return vceqq_u32(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vceqq_p8(poly8x16_t v1, poly8x16_t v2) {
+ // CHECK: test_vceqq_p8
+ return vceqq_p8(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+
+uint64x2_t test_vceqq_s64(int64x2_t v1, int64x2_t v2) {
+ // CHECK: test_vceqq_s64
+ return vceqq_s64(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint64x2_t test_vceqq_u64(uint64x2_t v1, uint64x2_t v2) {
+ // CHECK: test_vceqq_u64
+ return vceqq_u64(v1, v2);
+ // CHECK: cmeq {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint64x2_t test_vceqq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vceqq_f64
+ return vceqq_f64(v1, v2);
+ // CHECK: fcmeq {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+uint8x8_t test_vcge_s8(int8x8_t v1, int8x8_t v2) {
+// CHECK: test_vcge_s8
+ return vcge_s8(v1, v2);
+// CHECK: cmge {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vcge_s16(int16x4_t v1, int16x4_t v2) {
+// CHECK: test_vcge_s16
+ return vcge_s16(v1, v2);
+// CHECK: cmge {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vcge_s32(int32x2_t v1, int32x2_t v2) {
+// CHECK: test_vcge_s32
+ return vcge_s32(v1, v2);
+// CHECK: cmge {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vcge_s64(int64x1_t a, int64x1_t b) {
+ // CHECK: test_vcge_s64
+ return vcge_s64(a, b);
+ // CHECK: cmge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint64x1_t test_vcge_u64(uint64x1_t a, uint64x1_t b) {
+ // CHECK: test_vcge_u64
+ return vcge_u64(a, b);
+ // CHECK: cmhs {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint32x2_t test_vcge_f32(float32x2_t v1, float32x2_t v2) {
+// CHECK: test_vcge_f32
+ return vcge_f32(v1, v2);
+// CHECK: fcmge {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vcge_f64(float64x1_t a, float64x1_t b) {
+ // CHECK: test_vcge_f64
+ return vcge_f64(a, b);
+ // CHECK: fcmge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vcge_u8(uint8x8_t v1, uint8x8_t v2) {
+// CHECK: test_vcge_u8
+ return vcge_u8(v1, v2);
+// CHECK: cmhs {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vcge_u16(uint16x4_t v1, uint16x4_t v2) {
+// CHECK: test_vcge_u16
+ return vcge_u16(v1, v2);
+// CHECK: cmhs {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vcge_u32(uint32x2_t v1, uint32x2_t v2) {
+// CHECK: test_vcge_u32
+ return vcge_u32(v1, v2);
+// CHECK: cmhs {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x16_t test_vcgeq_s8(int8x16_t v1, int8x16_t v2) {
+// CHECK: test_vcgeq_s8
+ return vcgeq_s8(v1, v2);
+// CHECK: cmge {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vcgeq_s16(int16x8_t v1, int16x8_t v2) {
+// CHECK: test_vcgeq_s16
+ return vcgeq_s16(v1, v2);
+// CHECK: cmge {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vcgeq_s32(int32x4_t v1, int32x4_t v2) {
+// CHECK: test_vcgeq_s32
+ return vcgeq_s32(v1, v2);
+// CHECK: cmge {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vcgeq_f32(float32x4_t v1, float32x4_t v2) {
+// CHECK: test_vcgeq_f32
+ return vcgeq_f32(v1, v2);
+// CHECK: fcmge {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vcgeq_u8(uint8x16_t v1, uint8x16_t v2) {
+// CHECK: test_vcgeq_u8
+ return vcgeq_u8(v1, v2);
+// CHECK: cmhs {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vcgeq_u16(uint16x8_t v1, uint16x8_t v2) {
+// CHECK: test_vcgeq_u16
+ return vcgeq_u16(v1, v2);
+// CHECK: cmhs {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vcgeq_u32(uint32x4_t v1, uint32x4_t v2) {
+// CHECK: test_vcgeq_u32
+ return vcgeq_u32(v1, v2);
+// CHECK: cmhs {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vcgeq_s64(int64x2_t v1, int64x2_t v2) {
+// CHECK: test_vcgeq_s64
+ return vcgeq_s64(v1, v2);
+// CHECK: cmge {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint64x2_t test_vcgeq_u64(uint64x2_t v1, uint64x2_t v2) {
+// CHECK: test_vcgeq_u64
+ return vcgeq_u64(v1, v2);
+// CHECK: cmhs {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint64x2_t test_vcgeq_f64(float64x2_t v1, float64x2_t v2) {
+// CHECK: test_vcgeq_f64
+ return vcgeq_f64(v1, v2);
+// CHECK: fcmge {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+// Notes about vcle:
+// LE condition predicate implemented as GE, so check reversed operands.
+// Using registers other than v0, v1 are possible, but would be odd.
+uint8x8_t test_vcle_s8(int8x8_t v1, int8x8_t v2) {
+ // CHECK: test_vcle_s8
+ return vcle_s8(v1, v2);
+ // CHECK: cmge {{v[0-9]+}}.8b, v1.8b, v0.8b
+}
+
+uint16x4_t test_vcle_s16(int16x4_t v1, int16x4_t v2) {
+ // CHECK: test_vcle_s16
+ return vcle_s16(v1, v2);
+ // CHECK: cmge {{v[0-9]+}}.4h, v1.4h, v0.4h
+}
+
+uint32x2_t test_vcle_s32(int32x2_t v1, int32x2_t v2) {
+ // CHECK: test_vcle_s32
+ return vcle_s32(v1, v2);
+ // CHECK: cmge {{v[0-9]+}}.2s, v1.2s, v0.2s
+}
+
+uint64x1_t test_vcle_s64(int64x1_t a, int64x1_t b) {
+ // CHECK: test_vcle_s64
+ return vcle_s64(a, b);
+ // CHECK: cmge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint64x1_t test_vcle_u64(uint64x1_t a, uint64x1_t b) {
+ // CHECK: test_vcle_u64
+ return vcle_u64(a, b);
+ // CHECK: cmhs {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint32x2_t test_vcle_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vcle_f32
+ return vcle_f32(v1, v2);
+ // CHECK: fcmge {{v[0-9]+}}.2s, v1.2s, v0.2s
+}
+
+uint64x1_t test_vcle_f64(float64x1_t a, float64x1_t b) {
+ // CHECK: test_vcle_f64
+ return vcle_f64(a, b);
+ // CHECK: fcmge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vcle_u8(uint8x8_t v1, uint8x8_t v2) {
+ // CHECK: test_vcle_u8
+ return vcle_u8(v1, v2);
+ // CHECK: cmhs {{v[0-9]+}}.8b, v1.8b, v0.8b
+}
+
+uint16x4_t test_vcle_u16(uint16x4_t v1, uint16x4_t v2) {
+ // CHECK: test_vcle_u16
+ return vcle_u16(v1, v2);
+ // CHECK: cmhs {{v[0-9]+}}.4h, v1.4h, v0.4h
+}
+
+uint32x2_t test_vcle_u32(uint32x2_t v1, uint32x2_t v2) {
+ // CHECK: test_vcle_u32
+ return vcle_u32(v1, v2);
+ // CHECK: cmhs {{v[0-9]+}}.2s, v1.2s, v0.2s
+}
+
+uint8x16_t test_vcleq_s8(int8x16_t v1, int8x16_t v2) {
+ // CHECK: test_vcleq_s8
+ return vcleq_s8(v1, v2);
+ // CHECK: cmge {{v[0-9]+}}.16b, v1.16b, v0.16b
+}
+
+uint16x8_t test_vcleq_s16(int16x8_t v1, int16x8_t v2) {
+ // CHECK: test_vcleq_s16
+ return vcleq_s16(v1, v2);
+ // CHECK: cmge {{v[0-9]+}}.8h, v1.8h, v0.8h
+}
+
+uint32x4_t test_vcleq_s32(int32x4_t v1, int32x4_t v2) {
+ // CHECK: test_vcleq_s32
+ return vcleq_s32(v1, v2);
+ // CHECK: cmge {{v[0-9]+}}.4s, v1.4s, v0.4s
+}
+
+uint32x4_t test_vcleq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vcleq_f32
+ return vcleq_f32(v1, v2);
+ // CHECK: fcmge {{v[0-9]+}}.4s, v1.4s, v0.4s
+}
+
+uint8x16_t test_vcleq_u8(uint8x16_t v1, uint8x16_t v2) {
+ // CHECK: test_vcleq_u8
+ return vcleq_u8(v1, v2);
+ // CHECK: cmhs {{v[0-9]+}}.16b, v1.16b, v0.16b
+}
+
+uint16x8_t test_vcleq_u16(uint16x8_t v1, uint16x8_t v2) {
+ // CHECK: test_vcleq_u16
+ return vcleq_u16(v1, v2);
+ // CHECK: cmhs {{v[0-9]+}}.8h, v1.8h, v0.8h
+}
+
+uint32x4_t test_vcleq_u32(uint32x4_t v1, uint32x4_t v2) {
+ // CHECK: test_vcleq_u32
+ return vcleq_u32(v1, v2);
+ // CHECK: cmhs {{v[0-9]+}}.4s, v1.4s, v0.4s
+}
+
+uint64x2_t test_vcleq_s64(int64x2_t v1, int64x2_t v2) {
+ // CHECK: test_vcleq_s64
+ return vcleq_s64(v1, v2);
+ // CHECK: cmge {{v[0-9]+}}.2d, v1.2d, v0.2d
+}
+
+uint64x2_t test_vcleq_u64(uint64x2_t v1, uint64x2_t v2) {
+ // CHECK: test_vcleq_u64
+ return vcleq_u64(v1, v2);
+ // CHECK: cmhs {{v[0-9]+}}.2d, v1.2d, v0.2d
+}
+
+uint64x2_t test_vcleq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vcleq_f64
+ return vcleq_f64(v1, v2);
+ // CHECK: fcmge {{v[0-9]+}}.2d, v1.2d, v0.2d
+}
+
+
+uint8x8_t test_vcgt_s8(int8x8_t v1, int8x8_t v2) {
+ // CHECK: test_vcgt_s8
+ return vcgt_s8(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vcgt_s16(int16x4_t v1, int16x4_t v2) {
+ // CHECK: test_vcgt_s16
+ return vcgt_s16(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vcgt_s32(int32x2_t v1, int32x2_t v2) {
+ // CHECK: test_vcgt_s32
+ return vcgt_s32(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vcgt_s64(int64x1_t a, int64x1_t b) {
+ // CHECK: test_vcgt_s64
+ return vcgt_s64(a, b);
+ // CHECK: cmgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint64x1_t test_vcgt_u64(uint64x1_t a, uint64x1_t b) {
+ // CHECK: test_vcgt_u64
+ return vcgt_u64(a, b);
+ // CHECK: cmhi {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint32x2_t test_vcgt_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vcgt_f32
+ return vcgt_f32(v1, v2);
+ // CHECK: fcmgt {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vcgt_f64(float64x1_t a, float64x1_t b) {
+ // CHECK: test_vcgt_f64
+ return vcgt_f64(a, b);
+ // CHECK: fcmgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vcgt_u8(uint8x8_t v1, uint8x8_t v2) {
+ // CHECK: test_vcgt_u8
+ return vcgt_u8(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vcgt_u16(uint16x4_t v1, uint16x4_t v2) {
+ // CHECK: test_vcgt_u16
+ return vcgt_u16(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vcgt_u32(uint32x2_t v1, uint32x2_t v2) {
+ // CHECK: test_vcgt_u32
+ return vcgt_u32(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x16_t test_vcgtq_s8(int8x16_t v1, int8x16_t v2) {
+ // CHECK: test_vcgtq_s8
+ return vcgtq_s8(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vcgtq_s16(int16x8_t v1, int16x8_t v2) {
+ // CHECK: test_vcgtq_s16
+ return vcgtq_s16(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vcgtq_s32(int32x4_t v1, int32x4_t v2) {
+ // CHECK: test_vcgtq_s32
+ return vcgtq_s32(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint32x4_t test_vcgtq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vcgtq_f32
+ return vcgtq_f32(v1, v2);
+ // CHECK: fcmgt {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vcgtq_u8(uint8x16_t v1, uint8x16_t v2) {
+ // CHECK: test_vcgtq_u8
+ return vcgtq_u8(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vcgtq_u16(uint16x8_t v1, uint16x8_t v2) {
+ // CHECK: test_vcgtq_u16
+ return vcgtq_u16(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vcgtq_u32(uint32x4_t v1, uint32x4_t v2) {
+ // CHECK: test_vcgtq_u32
+ return vcgtq_u32(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vcgtq_s64(int64x2_t v1, int64x2_t v2) {
+ // CHECK: test_vcgtq_s64
+ return vcgtq_s64(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint64x2_t test_vcgtq_u64(uint64x2_t v1, uint64x2_t v2) {
+ // CHECK: test_vcgtq_u64
+ return vcgtq_u64(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint64x2_t test_vcgtq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vcgtq_f64
+ return vcgtq_f64(v1, v2);
+ // CHECK: fcmgt {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+
+// Notes about vclt:
+// LT condition predicate implemented as GT, so check reversed operands.
+// Using registers other than v0, v1 are possible, but would be odd.
+
+uint8x8_t test_vclt_s8(int8x8_t v1, int8x8_t v2) {
+ // CHECK: test_vclt_s8
+ return vclt_s8(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.8b, v1.8b, v0.8b
+}
+
+uint16x4_t test_vclt_s16(int16x4_t v1, int16x4_t v2) {
+ // CHECK: test_vclt_s16
+ return vclt_s16(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.4h, v1.4h, v0.4h
+}
+
+uint32x2_t test_vclt_s32(int32x2_t v1, int32x2_t v2) {
+ // CHECK: test_vclt_s32
+ return vclt_s32(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.2s, v1.2s, v0.2s
+}
+
+uint64x1_t test_vclt_s64(int64x1_t a, int64x1_t b) {
+ // CHECK: test_vclt_s64
+ return vclt_s64(a, b);
+ // CHECK: cmgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint64x1_t test_vclt_u64(uint64x1_t a, uint64x1_t b) {
+ // CHECK: test_vclt_u64
+ return vclt_u64(a, b);
+ // CHECK: cmhi {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint32x2_t test_vclt_f32(float32x2_t v1, float32x2_t v2) {
+ // CHECK: test_vclt_f32
+ return vclt_f32(v1, v2);
+ // CHECK: fcmgt {{v[0-9]+}}.2s, v1.2s, v0.2s
+}
+
+uint64x1_t test_vclt_f64(float64x1_t a, float64x1_t b) {
+ // CHECK: test_vclt_f64
+ return vclt_f64(a, b);
+ // CHECK: fcmgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vclt_u8(uint8x8_t v1, uint8x8_t v2) {
+ // CHECK: test_vclt_u8
+ return vclt_u8(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.8b, v1.8b, v0.8b
+}
+
+uint16x4_t test_vclt_u16(uint16x4_t v1, uint16x4_t v2) {
+ // CHECK: test_vclt_u16
+ return vclt_u16(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.4h, v1.4h, v0.4h
+}
+
+uint32x2_t test_vclt_u32(uint32x2_t v1, uint32x2_t v2) {
+ // CHECK: test_vclt_u32
+ return vclt_u32(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.2s, v1.2s, v0.2s
+}
+
+uint8x16_t test_vcltq_s8(int8x16_t v1, int8x16_t v2) {
+ // CHECK: test_vcltq_s8
+ return vcltq_s8(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.16b, v1.16b, v0.16b
+}
+
+uint16x8_t test_vcltq_s16(int16x8_t v1, int16x8_t v2) {
+ // CHECK: test_vcltq_s16
+ return vcltq_s16(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.8h, v1.8h, v0.8h
+}
+
+uint32x4_t test_vcltq_s32(int32x4_t v1, int32x4_t v2) {
+ // CHECK: test_vcltq_s32
+ return vcltq_s32(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.4s, v1.4s, v0.4s
+}
+
+uint32x4_t test_vcltq_f32(float32x4_t v1, float32x4_t v2) {
+ // CHECK: test_vcltq_f32
+ return vcltq_f32(v1, v2);
+ // CHECK: fcmgt {{v[0-9]+}}.4s, v1.4s, v0.4s
+}
+
+uint8x16_t test_vcltq_u8(uint8x16_t v1, uint8x16_t v2) {
+ // CHECK: test_vcltq_u8
+ return vcltq_u8(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.16b, v1.16b, v0.16b
+}
+
+uint16x8_t test_vcltq_u16(uint16x8_t v1, uint16x8_t v2) {
+ // CHECK: test_vcltq_u16
+ return vcltq_u16(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.8h, v1.8h, v0.8h
+}
+
+uint32x4_t test_vcltq_u32(uint32x4_t v1, uint32x4_t v2) {
+ // CHECK: test_vcltq_u32
+ return vcltq_u32(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.4s, v1.4s, v0.4s
+}
+
+uint64x2_t test_vcltq_s64(int64x2_t v1, int64x2_t v2) {
+ // CHECK: test_vcltq_s64
+ return vcltq_s64(v1, v2);
+ // CHECK: cmgt {{v[0-9]+}}.2d, v1.2d, v0.2d
+}
+
+uint64x2_t test_vcltq_u64(uint64x2_t v1, uint64x2_t v2) {
+ // CHECK: test_vcltq_u64
+ return vcltq_u64(v1, v2);
+ // CHECK: cmhi {{v[0-9]+}}.2d, v1.2d, v0.2d
+}
+
+uint64x2_t test_vcltq_f64(float64x2_t v1, float64x2_t v2) {
+ // CHECK: test_vcltq_f64
+ return vcltq_f64(v1, v2);
+ // CHECK: fcmgt {{v[0-9]+}}.2d, v1.2d, v0.2d
+}
+
+
+int8x8_t test_vhadd_s8(int8x8_t v1, int8x8_t v2) {
+// CHECK: test_vhadd_s8
+ return vhadd_s8(v1, v2);
+ // CHECK: shadd {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vhadd_s16(int16x4_t v1, int16x4_t v2) {
+// CHECK: test_vhadd_s16
+ return vhadd_s16(v1, v2);
+ // CHECK: shadd {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vhadd_s32(int32x2_t v1, int32x2_t v2) {
+// CHECK: test_vhadd_s32
+ return vhadd_s32(v1, v2);
+ // CHECK: shadd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vhadd_u8(uint8x8_t v1, uint8x8_t v2) {
+// CHECK: test_vhadd_u8
+ return vhadd_u8(v1, v2);
+ // CHECK: uhadd {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vhadd_u16(uint16x4_t v1, uint16x4_t v2) {
+// CHECK: test_vhadd_u16
+ return vhadd_u16(v1, v2);
+ // CHECK: uhadd {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vhadd_u32(uint32x2_t v1, uint32x2_t v2) {
+// CHECK: test_vhadd_u32
+ return vhadd_u32(v1, v2);
+ // CHECK: uhadd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vhaddq_s8(int8x16_t v1, int8x16_t v2) {
+// CHECK: test_vhaddq_s8
+ return vhaddq_s8(v1, v2);
+ // CHECK: shadd {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vhaddq_s16(int16x8_t v1, int16x8_t v2) {
+// CHECK: test_vhaddq_s16
+ return vhaddq_s16(v1, v2);
+ // CHECK: shadd {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vhaddq_s32(int32x4_t v1, int32x4_t v2) {
+// CHECK: test_vhaddq_s32
+ return vhaddq_s32(v1, v2);
+ // CHECK: shadd {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vhaddq_u8(uint8x16_t v1, uint8x16_t v2) {
+// CHECK: test_vhaddq_u8
+ return vhaddq_u8(v1, v2);
+ // CHECK: uhadd {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vhaddq_u16(uint16x8_t v1, uint16x8_t v2) {
+// CHECK: test_vhaddq_u16
+ return vhaddq_u16(v1, v2);
+ // CHECK: uhadd {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vhaddq_u32(uint32x4_t v1, uint32x4_t v2) {
+// CHECK: test_vhaddq_u32
+ return vhaddq_u32(v1, v2);
+ // CHECK: uhadd {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+
+int8x8_t test_vhsub_s8(int8x8_t v1, int8x8_t v2) {
+// CHECK: test_vhsub_s8
+ return vhsub_s8(v1, v2);
+ // CHECK: shsub {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vhsub_s16(int16x4_t v1, int16x4_t v2) {
+// CHECK: test_vhsub_s16
+ return vhsub_s16(v1, v2);
+ // CHECK: shsub {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vhsub_s32(int32x2_t v1, int32x2_t v2) {
+// CHECK: test_vhsub_s32
+ return vhsub_s32(v1, v2);
+ // CHECK: shsub {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vhsub_u8(uint8x8_t v1, uint8x8_t v2) {
+// CHECK: test_vhsub_u8
+ return vhsub_u8(v1, v2);
+ // CHECK: uhsub {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vhsub_u16(uint16x4_t v1, uint16x4_t v2) {
+// CHECK: test_vhsub_u16
+ return vhsub_u16(v1, v2);
+ // CHECK: uhsub {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vhsub_u32(uint32x2_t v1, uint32x2_t v2) {
+// CHECK: test_vhsub_u32
+ return vhsub_u32(v1, v2);
+ // CHECK: uhsub {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vhsubq_s8(int8x16_t v1, int8x16_t v2) {
+// CHECK: test_vhsubq_s8
+ return vhsubq_s8(v1, v2);
+ // CHECK: shsub {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vhsubq_s16(int16x8_t v1, int16x8_t v2) {
+// CHECK: test_vhsubq_s16
+ return vhsubq_s16(v1, v2);
+ // CHECK: shsub {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vhsubq_s32(int32x4_t v1, int32x4_t v2) {
+// CHECK: test_vhsubq_s32
+ return vhsubq_s32(v1, v2);
+ // CHECK: shsub {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vhsubq_u8(uint8x16_t v1, uint8x16_t v2) {
+// CHECK: test_vhsubq_u8
+ return vhsubq_u8(v1, v2);
+ // CHECK: uhsub {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vhsubq_u16(uint16x8_t v1, uint16x8_t v2) {
+// CHECK: test_vhsubq_u16
+ return vhsubq_u16(v1, v2);
+ // CHECK: uhsub {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vhsubq_u32(uint32x4_t v1, uint32x4_t v2) {
+// CHECK: test_vhsubq_u32
+ return vhsubq_u32(v1, v2);
+ // CHECK: uhsub {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+
+int8x8_t test_vrhadd_s8(int8x8_t v1, int8x8_t v2) {
+// CHECK: test_vrhadd_s8
+ return vrhadd_s8(v1, v2);
+// CHECK: srhadd {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vrhadd_s16(int16x4_t v1, int16x4_t v2) {
+// CHECK: test_vrhadd_s16
+ return vrhadd_s16(v1, v2);
+// CHECK: srhadd {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vrhadd_s32(int32x2_t v1, int32x2_t v2) {
+// CHECK: test_vrhadd_s32
+ return vrhadd_s32(v1, v2);
+// CHECK: srhadd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vrhadd_u8(uint8x8_t v1, uint8x8_t v2) {
+// CHECK: test_vrhadd_u8
+ return vrhadd_u8(v1, v2);
+// CHECK: urhadd {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vrhadd_u16(uint16x4_t v1, uint16x4_t v2) {
+// CHECK: test_vrhadd_u16
+ return vrhadd_u16(v1, v2);
+// CHECK: urhadd {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vrhadd_u32(uint32x2_t v1, uint32x2_t v2) {
+// CHECK: test_vrhadd_u32
+ return vrhadd_u32(v1, v2);
+// CHECK: urhadd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vrhaddq_s8(int8x16_t v1, int8x16_t v2) {
+// CHECK: test_vrhaddq_s8
+ return vrhaddq_s8(v1, v2);
+// CHECK: srhadd {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vrhaddq_s16(int16x8_t v1, int16x8_t v2) {
+// CHECK: test_vrhaddq_s16
+ return vrhaddq_s16(v1, v2);
+// CHECK: srhadd {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vrhaddq_s32(int32x4_t v1, int32x4_t v2) {
+// CHECK: test_vrhaddq_s32
+ return vrhaddq_s32(v1, v2);
+// CHECK: srhadd {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vrhaddq_u8(uint8x16_t v1, uint8x16_t v2) {
+// CHECK: test_vrhaddq_u8
+ return vrhaddq_u8(v1, v2);
+// CHECK: urhadd {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vrhaddq_u16(uint16x8_t v1, uint16x8_t v2) {
+// CHECK: test_vrhaddq_u16
+ return vrhaddq_u16(v1, v2);
+// CHECK: urhadd {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vrhaddq_u32(uint32x4_t v1, uint32x4_t v2) {
+// CHECK: test_vrhaddq_u32
+ return vrhaddq_u32(v1, v2);
+// CHECK: urhadd {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+int8x8_t test_vqadd_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vqadd_s8
+ return vqadd_s8(a, b);
+ // CHECK: sqadd {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vqadd_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vqadd_s16
+ return vqadd_s16(a, b);
+ // CHECK: sqadd {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vqadd_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vqadd_s32
+ return vqadd_s32(a, b);
+ // CHECK: sqadd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int64x1_t test_vqadd_s64(int64x1_t a, int64x1_t b) {
+// CHECK: test_vqadd_s64
+ return vqadd_s64(a, b);
+// CHECK: sqadd {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vqadd_u8(uint8x8_t a, uint8x8_t b) {
+// CHECK: test_vqadd_u8
+ return vqadd_u8(a, b);
+ // CHECK: uqadd {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vqadd_u16(uint16x4_t a, uint16x4_t b) {
+// CHECK: test_vqadd_u16
+ return vqadd_u16(a, b);
+ // CHECK: uqadd {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vqadd_u32(uint32x2_t a, uint32x2_t b) {
+// CHECK: test_vqadd_u32
+ return vqadd_u32(a, b);
+ // CHECK: uqadd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vqadd_u64(uint64x1_t a, uint64x1_t b) {
+// CHECK: test_vqadd_u64
+ return vqadd_u64(a, b);
+// CHECK: uqadd {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int8x16_t test_vqaddq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vqaddq_s8
+ return vqaddq_s8(a, b);
+ // CHECK: sqadd {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vqaddq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vqaddq_s16
+ return vqaddq_s16(a, b);
+ // CHECK: sqadd {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vqaddq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vqaddq_s32
+ return vqaddq_s32(a, b);
+ // CHECK: sqadd {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vqaddq_s64(int64x2_t a, int64x2_t b) {
+// CHECK: test_vqaddq_s64
+ return vqaddq_s64(a, b);
+// CHECK: sqadd {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint8x16_t test_vqaddq_u8(uint8x16_t a, uint8x16_t b) {
+// CHECK: test_vqaddq_u8
+ return vqaddq_u8(a, b);
+ // CHECK: uqadd {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vqaddq_u16(uint16x8_t a, uint16x8_t b) {
+// CHECK: test_vqaddq_u16
+ return vqaddq_u16(a, b);
+ // CHECK: uqadd {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vqaddq_u32(uint32x4_t a, uint32x4_t b) {
+// CHECK: test_vqaddq_u32
+ return vqaddq_u32(a, b);
+ // CHECK: uqadd {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vqaddq_u64(uint64x2_t a, uint64x2_t b) {
+// CHECK: test_vqaddq_u64
+ return vqaddq_u64(a, b);
+// CHECK: uqadd {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+
+int8x8_t test_vqsub_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vqsub_s8
+ return vqsub_s8(a, b);
+ // CHECK: sqsub {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vqsub_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vqsub_s16
+ return vqsub_s16(a, b);
+ // CHECK: sqsub {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vqsub_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vqsub_s32
+ return vqsub_s32(a, b);
+ // CHECK: sqsub {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int64x1_t test_vqsub_s64(int64x1_t a, int64x1_t b) {
+// CHECK: test_vqsub_s64
+ return vqsub_s64(a, b);
+// CHECK: sqsub {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vqsub_u8(uint8x8_t a, uint8x8_t b) {
+// CHECK: test_vqsub_u8
+ return vqsub_u8(a, b);
+ // CHECK: uqsub {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vqsub_u16(uint16x4_t a, uint16x4_t b) {
+// CHECK: test_vqsub_u16
+ return vqsub_u16(a, b);
+ // CHECK: uqsub {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vqsub_u32(uint32x2_t a, uint32x2_t b) {
+// CHECK: test_vqsub_u32
+ return vqsub_u32(a, b);
+ // CHECK: uqsub {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vqsub_u64(uint64x1_t a, uint64x1_t b) {
+// CHECK: test_vqsub_u64
+ return vqsub_u64(a, b);
+// CHECK: uqsub {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int8x16_t test_vqsubq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vqsubq_s8
+ return vqsubq_s8(a, b);
+ // CHECK: sqsub {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vqsubq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vqsubq_s16
+ return vqsubq_s16(a, b);
+ // CHECK: sqsub {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vqsubq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vqsubq_s32
+ return vqsubq_s32(a, b);
+ // CHECK: sqsub {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vqsubq_s64(int64x2_t a, int64x2_t b) {
+// CHECK: test_vqsubq_s64
+ return vqsubq_s64(a, b);
+// CHECK: sqsub {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint8x16_t test_vqsubq_u8(uint8x16_t a, uint8x16_t b) {
+// CHECK: test_vqsubq_u8
+ return vqsubq_u8(a, b);
+ // CHECK: uqsub {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vqsubq_u16(uint16x8_t a, uint16x8_t b) {
+// CHECK: test_vqsubq_u16
+ return vqsubq_u16(a, b);
+ // CHECK: uqsub {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vqsubq_u32(uint32x4_t a, uint32x4_t b) {
+// CHECK: test_vqsubq_u32
+ return vqsubq_u32(a, b);
+ // CHECK: uqsub {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vqsubq_u64(uint64x2_t a, uint64x2_t b) {
+// CHECK: test_vqsubq_u64
+ return vqsubq_u64(a, b);
+ // CHECK: uqsub {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+
+int8x8_t test_vshl_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vshl_s8
+ return vshl_s8(a, b);
+// CHECK: sshl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vshl_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vshl_s16
+ return vshl_s16(a, b);
+// CHECK: sshl {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vshl_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vshl_s32
+ return vshl_s32(a, b);
+// CHECK: sshl {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int64x1_t test_vshl_s64(int64x1_t a, int64x1_t b) {
+// CHECK: test_vshl_s64
+ return vshl_s64(a, b);
+// CHECK: sshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vshl_u8(uint8x8_t a, int8x8_t b) {
+// CHECK: test_vshl_u8
+ return vshl_u8(a, b);
+// CHECK: ushl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vshl_u16(uint16x4_t a, int16x4_t b) {
+// CHECK: test_vshl_u16
+ return vshl_u16(a, b);
+// CHECK: ushl {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vshl_u32(uint32x2_t a, int32x2_t b) {
+// CHECK: test_vshl_u32
+ return vshl_u32(a, b);
+// CHECK: ushl {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vshl_u64(uint64x1_t a, int64x1_t b) {
+// CHECK: test_vshl_u64
+ return vshl_u64(a, b);
+// CHECK: ushl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int8x16_t test_vshlq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vshlq_s8
+ return vshlq_s8(a, b);
+// CHECK: sshl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vshlq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vshlq_s16
+ return vshlq_s16(a, b);
+// CHECK: sshl {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vshlq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vshlq_s32
+ return vshlq_s32(a, b);
+// CHECK: sshl {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vshlq_s64(int64x2_t a, int64x2_t b) {
+// CHECK: test_vshlq_s64
+ return vshlq_s64(a, b);
+// CHECK: sshl {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint8x16_t test_vshlq_u8(uint8x16_t a, int8x16_t b) {
+// CHECK: test_vshlq_u8
+ return vshlq_u8(a, b);
+// CHECK: ushl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vshlq_u16(uint16x8_t a, int16x8_t b) {
+// CHECK: test_vshlq_u16
+ return vshlq_u16(a, b);
+// CHECK: ushl {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vshlq_u32(uint32x4_t a, int32x4_t b) {
+// CHECK: test_vshlq_u32
+ return vshlq_u32(a, b);
+// CHECK: ushl {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vshlq_u64(uint64x2_t a, int64x2_t b) {
+// CHECK: test_vshlq_u64
+ return vshlq_u64(a, b);
+// CHECK: ushl {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+
+int8x8_t test_vqshl_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vqshl_s8
+ return vqshl_s8(a, b);
+// CHECK: sqshl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vqshl_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vqshl_s16
+ return vqshl_s16(a, b);
+// CHECK: sqshl {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vqshl_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vqshl_s32
+ return vqshl_s32(a, b);
+// CHECK: sqshl {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int64x1_t test_vqshl_s64(int64x1_t a, int64x1_t b) {
+// CHECK: test_vqshl_s64
+ return vqshl_s64(a, b);
+// CHECK: sqshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vqshl_u8(uint8x8_t a, int8x8_t b) {
+// CHECK: test_vqshl_u8
+ return vqshl_u8(a, b);
+// CHECK: uqshl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vqshl_u16(uint16x4_t a, int16x4_t b) {
+// CHECK: test_vqshl_u16
+ return vqshl_u16(a, b);
+// CHECK: uqshl {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vqshl_u32(uint32x2_t a, int32x2_t b) {
+// CHECK: test_vqshl_u32
+ return vqshl_u32(a, b);
+// CHECK: uqshl {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vqshl_u64(uint64x1_t a, int64x1_t b) {
+// CHECK: test_vqshl_u64
+ return vqshl_u64(a, b);
+// CHECK: uqshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int8x16_t test_vqshlq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vqshlq_s8
+ return vqshlq_s8(a, b);
+// CHECK: sqshl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vqshlq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vqshlq_s16
+ return vqshlq_s16(a, b);
+// CHECK: sqshl {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vqshlq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vqshlq_s32
+ return vqshlq_s32(a, b);
+// CHECK: sqshl {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vqshlq_s64(int64x2_t a, int64x2_t b) {
+// CHECK: test_vqshlq_s64
+ return vqshlq_s64(a, b);
+// CHECK: sqshl {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint8x16_t test_vqshlq_u8(uint8x16_t a, int8x16_t b) {
+// CHECK: test_vqshlq_u8
+ return vqshlq_u8(a, b);
+// CHECK: uqshl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vqshlq_u16(uint16x8_t a, int16x8_t b) {
+// CHECK: test_vqshlq_u16
+ return vqshlq_u16(a, b);
+// CHECK: uqshl {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vqshlq_u32(uint32x4_t a, int32x4_t b) {
+// CHECK: test_vqshlq_u32
+ return vqshlq_u32(a, b);
+// CHECK: uqshl {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vqshlq_u64(uint64x2_t a, int64x2_t b) {
+// CHECK: test_vqshlq_u32
+ return vqshlq_u64(a, b);
+// CHECK: uqshl {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+int8x8_t test_vrshl_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vrshl_s8
+ return vrshl_s8(a, b);
+// CHECK: srshl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vrshl_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vrshl_s16
+ return vrshl_s16(a, b);
+// CHECK: srshl {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vrshl_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vrshl_s32
+ return vrshl_s32(a, b);
+// CHECK: srshl {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int64x1_t test_vrshl_s64(int64x1_t a, int64x1_t b) {
+// CHECK: test_vrshl_s64
+ return vrshl_s64(a, b);
+// CHECK: srshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vrshl_u8(uint8x8_t a, int8x8_t b) {
+// CHECK: test_vrshl_u8
+ return vrshl_u8(a, b);
+// CHECK: urshl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vrshl_u16(uint16x4_t a, int16x4_t b) {
+// CHECK: test_vrshl_u16
+ return vrshl_u16(a, b);
+// CHECK: urshl {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vrshl_u32(uint32x2_t a, int32x2_t b) {
+// CHECK: test_vrshl_u32
+ return vrshl_u32(a, b);
+// CHECK: urshl {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vrshl_u64(uint64x1_t a, int64x1_t b) {
+// CHECK: test_vrshl_u64
+ return vrshl_u64(a, b);
+// CHECK: urshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int8x16_t test_vrshlq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vrshlq_s8
+ return vrshlq_s8(a, b);
+// CHECK: srshl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vrshlq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vrshlq_s16
+ return vrshlq_s16(a, b);
+// CHECK: srshl {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vrshlq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vrshlq_s32
+ return vrshlq_s32(a, b);
+// CHECK: srshl {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vrshlq_s64(int64x2_t a, int64x2_t b) {
+// CHECK: test_vrshlq_s64
+ return vrshlq_s64(a, b);
+// CHECK: srshl {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint8x16_t test_vrshlq_u8(uint8x16_t a, int8x16_t b) {
+// CHECK: test_vrshlq_u8
+ return vrshlq_u8(a, b);
+// CHECK: urshl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vrshlq_u16(uint16x8_t a, int16x8_t b) {
+// CHECK: test_vrshlq_u16
+ return vrshlq_u16(a, b);
+// CHECK: urshl {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vrshlq_u32(uint32x4_t a, int32x4_t b) {
+// CHECK: test_vrshlq_u32
+ return vrshlq_u32(a, b);
+// CHECK: urshl {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vrshlq_u64(uint64x2_t a, int64x2_t b) {
+// CHECK: test_vrshlq_u64
+ return vrshlq_u64(a, b);
+// CHECK: urshl {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+
+int8x8_t test_vqrshl_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vqrshl_s8
+ return vqrshl_s8(a, b);
+// CHECK: sqrshl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vqrshl_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vqrshl_s16
+ return vqrshl_s16(a, b);
+// CHECK: sqrshl {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vqrshl_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vqrshl_s32
+ return vqrshl_s32(a, b);
+// CHECK: sqrshl {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int64x1_t test_vqrshl_s64(int64x1_t a, int64x1_t b) {
+// CHECK: test_vqrshl_s64
+ return vqrshl_s64(a, b);
+// CHECK: sqrshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8x8_t test_vqrshl_u8(uint8x8_t a, int8x8_t b) {
+// CHECK: test_vqrshl_u8
+ return vqrshl_u8(a, b);
+// CHECK: uqrshl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vqrshl_u16(uint16x4_t a, int16x4_t b) {
+// CHECK: test_vqrshl_u16
+ return vqrshl_u16(a, b);
+// CHECK: uqrshl {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vqrshl_u32(uint32x2_t a, int32x2_t b) {
+// CHECK: test_vqrshl_u32
+ return vqrshl_u32(a, b);
+// CHECK: uqrshl {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint64x1_t test_vqrshl_u64(uint64x1_t a, int64x1_t b) {
+// CHECK: test_vqrshl_u64
+ return vqrshl_u64(a, b);
+// CHECK: uqrshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int8x16_t test_vqrshlq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vqrshlq_s8
+ return vqrshlq_s8(a, b);
+// CHECK: sqrshl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vqrshlq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vqrshlq_s16
+ return vqrshlq_s16(a, b);
+// CHECK: sqrshl {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vqrshlq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vqrshlq_s32
+ return vqrshlq_s32(a, b);
+// CHECK: sqrshl {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vqrshlq_s64(int64x2_t a, int64x2_t b) {
+// CHECK: test_vqrshlq_s64
+ return vqrshlq_s64(a, b);
+// CHECK: sqrshl {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+// CHECK: test_vqrshlq_u8
+uint8x16_t test_vqrshlq_u8(uint8x16_t a, int8x16_t b) {
+ return vqrshlq_u8(a, b);
+// CHECK: uqrshl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vqrshlq_u16(uint16x8_t a, int16x8_t b) {
+// CHECK: test_vqrshlq_u16
+ return vqrshlq_u16(a, b);
+// CHECK: uqrshl {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vqrshlq_u32(uint32x4_t a, int32x4_t b) {
+// CHECK: test_vqrshlq_u32
+ return vqrshlq_u32(a, b);
+// CHECK: uqrshl {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vqrshlq_u64(uint64x2_t a, int64x2_t b) {
+// CHECK: test_vqrshlq_u64
+ return vqrshlq_u64(a, b);
+// CHECK: uqrshl {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+int8x8_t test_vmax_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vmax_s8
+ return vmax_s8(a, b);
+// CHECK: smax {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vmax_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vmax_s16
+ return vmax_s16(a, b);
+// CHECK: smax {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vmax_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vmax_s32
+ return vmax_s32(a, b);
+// CHECK: smax {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vmax_u8(uint8x8_t a, uint8x8_t b) {
+// CHECK: test_vmax_u8
+ return vmax_u8(a, b);
+// CHECK: umax {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vmax_u16(uint16x4_t a, uint16x4_t b) {
+// CHECK: test_vmax_u16
+ return vmax_u16(a, b);
+// CHECK: umax {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vmax_u32(uint32x2_t a, uint32x2_t b) {
+// CHECK: test_vmax_u32
+ return vmax_u32(a, b);
+// CHECK: umax {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x2_t test_vmax_f32(float32x2_t a, float32x2_t b) {
+// CHECK: test_vmax_f32
+ return vmax_f32(a, b);
+// CHECK: fmax {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vmaxq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vmaxq_s8
+ return vmaxq_s8(a, b);
+// CHECK: smax {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vmaxq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vmaxq_s16
+ return vmaxq_s16(a, b);
+// CHECK: smax {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vmaxq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vmaxq_s32
+ return vmaxq_s32(a, b);
+// CHECK: smax {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vmaxq_u8(uint8x16_t a, uint8x16_t b) {
+// CHECK: test_vmaxq_u8
+ return vmaxq_u8(a, b);
+// CHECK: umax {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vmaxq_u16(uint16x8_t a, uint16x8_t b) {
+// CHECK: test_vmaxq_u16
+ return vmaxq_u16(a, b);
+// CHECK: umax {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vmaxq_u32(uint32x4_t a, uint32x4_t b) {
+// CHECK: test_vmaxq_u32
+ return vmaxq_u32(a, b);
+// CHECK: umax {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float32x4_t test_vmaxq_f32(float32x4_t a, float32x4_t b) {
+// CHECK: test_vmaxq_f32
+ return vmaxq_f32(a, b);
+// CHECK: fmax {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vmaxq_f64(float64x2_t a, float64x2_t b) {
+// CHECK: test_vmaxq_f64
+ return vmaxq_f64(a, b);
+// CHECK: fmax {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+
+int8x8_t test_vmin_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vmin_s8
+ return vmin_s8(a, b);
+// CHECK: smin {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vmin_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vmin_s16
+ return vmin_s16(a, b);
+// CHECK: smin {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vmin_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vmin_s32
+ return vmin_s32(a, b);
+// CHECK: smin {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vmin_u8(uint8x8_t a, uint8x8_t b) {
+// CHECK: test_vmin_u8
+ return vmin_u8(a, b);
+// CHECK: umin {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vmin_u16(uint16x4_t a, uint16x4_t b) {
+// CHECK: test_vmin_u16
+ return vmin_u16(a, b);
+// CHECK: umin {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vmin_u32(uint32x2_t a, uint32x2_t b) {
+// CHECK: test_vmin_u32
+ return vmin_u32(a, b);
+// CHECK: umin {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x2_t test_vmin_f32(float32x2_t a, float32x2_t b) {
+// CHECK: test_vmin_f32
+ return vmin_f32(a, b);
+// CHECK: fmin {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vminq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vminq_s8
+ return vminq_s8(a, b);
+// CHECK: smin {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vminq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vminq_s16
+ return vminq_s16(a, b);
+// CHECK: smin {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vminq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vminq_s32
+ return vminq_s32(a, b);
+// CHECK: smin {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vminq_u8(uint8x16_t a, uint8x16_t b) {
+// CHECK: test_vminq_u8
+ return vminq_u8(a, b);
+// CHECK: umin {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vminq_u16(uint16x8_t a, uint16x8_t b) {
+// CHECK: test_vminq_u16
+ return vminq_u16(a, b);
+// CHECK: umin {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vminq_u32(uint32x4_t a, uint32x4_t b) {
+// CHECK: test_vminq_u32
+ return vminq_u32(a, b);
+// CHECK: umin {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float32x4_t test_vminq_f32(float32x4_t a, float32x4_t b) {
+// CHECK: test_vminq_f32
+ return vminq_f32(a, b);
+// CHECK: fmin {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vminq_f64(float64x2_t a, float64x2_t b) {
+// CHECK: test_vminq_f64
+ return vminq_f64(a, b);
+// CHECK: fmin {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+float32x2_t test_vmaxnm_f32(float32x2_t a, float32x2_t b) {
+// CHECK: test_vmaxnm_f32
+ return vmaxnm_f32(a, b);
+// CHECK: fmaxnm {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x4_t test_vmaxnmq_f32(float32x4_t a, float32x4_t b) {
+// CHECK: test_vmaxnmq_f32
+ return vmaxnmq_f32(a, b);
+// CHECK: fmaxnm {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vmaxnmq_f64(float64x2_t a, float64x2_t b) {
+// CHECK: test_vmaxnmq_f64
+ return vmaxnmq_f64(a, b);
+// CHECK: fmaxnm {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+float32x2_t test_vminnm_f32(float32x2_t a, float32x2_t b) {
+// CHECK: test_vminnm_f32
+ return vminnm_f32(a, b);
+// CHECK: fminnm {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x4_t test_vminnmq_f32(float32x4_t a, float32x4_t b) {
+// CHECK: test_vminnmq_f32
+ return vminnmq_f32(a, b);
+// CHECK: fminnm {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vminnmq_f64(float64x2_t a, float64x2_t b) {
+// CHECK: test_vminnmq_f64
+ return vminnmq_f64(a, b);
+// CHECK: fminnm {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+int8x8_t test_vpmax_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vpmax_s8
+ return vpmax_s8(a, b);
+// CHECK: smaxp {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vpmax_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vpmax_s16
+ return vpmax_s16(a, b);
+// CHECK: smaxp {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vpmax_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vpmax_s32
+ return vpmax_s32(a, b);
+// CHECK: smaxp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vpmax_u8(uint8x8_t a, uint8x8_t b) {
+// CHECK: test_vpmax_u8
+ return vpmax_u8(a, b);
+// CHECK: umaxp {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vpmax_u16(uint16x4_t a, uint16x4_t b) {
+// CHECK: test_vpmax_u16
+ return vpmax_u16(a, b);
+// CHECK: umaxp {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vpmax_u32(uint32x2_t a, uint32x2_t b) {
+// CHECK: test_vpmax_u32
+ return vpmax_u32(a, b);
+// CHECK: umaxp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x2_t test_vpmax_f32(float32x2_t a, float32x2_t b) {
+// CHECK: test_vpmax_f32
+ return vpmax_f32(a, b);
+// CHECK: fmaxp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vpmaxq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vpmaxq_s8
+ return vpmaxq_s8(a, b);
+// CHECK: smaxp {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vpmaxq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vpmaxq_s16
+ return vpmaxq_s16(a, b);
+// CHECK: smaxp {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vpmaxq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vpmaxq_s32
+ return vpmaxq_s32(a, b);
+// CHECK: smaxp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vpmaxq_u8(uint8x16_t a, uint8x16_t b) {
+// CHECK: test_vpmaxq_u8
+ return vpmaxq_u8(a, b);
+// CHECK: umaxp {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vpmaxq_u16(uint16x8_t a, uint16x8_t b) {
+// CHECK: test_vpmaxq_u16
+ return vpmaxq_u16(a, b);
+// CHECK: umaxp {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vpmaxq_u32(uint32x4_t a, uint32x4_t b) {
+// CHECK: test_vpmaxq_u32
+ return vpmaxq_u32(a, b);
+// CHECK: umaxp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float32x4_t test_vpmaxq_f32(float32x4_t a, float32x4_t b) {
+// CHECK: test_vpmaxq_f32
+ return vpmaxq_f32(a, b);
+// CHECK: fmaxp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vpmaxq_f64(float64x2_t a, float64x2_t b) {
+// CHECK: test_vpmaxq_f64
+ return vpmaxq_f64(a, b);
+// CHECK: fmaxp {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+int8x8_t test_vpmin_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vpmin_s8
+ return vpmin_s8(a, b);
+// CHECK: sminp {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vpmin_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vpmin_s16
+ return vpmin_s16(a, b);
+// CHECK: sminp {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vpmin_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vpmin_s32
+ return vpmin_s32(a, b);
+// CHECK: sminp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vpmin_u8(uint8x8_t a, uint8x8_t b) {
+// CHECK: test_vpmin_u8
+ return vpmin_u8(a, b);
+// CHECK: uminp {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vpmin_u16(uint16x4_t a, uint16x4_t b) {
+// CHECK: test_vpmin_u16
+ return vpmin_u16(a, b);
+// CHECK: uminp {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vpmin_u32(uint32x2_t a, uint32x2_t b) {
+// CHECK: test_vpmin_u32
+ return vpmin_u32(a, b);
+// CHECK: uminp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x2_t test_vpmin_f32(float32x2_t a, float32x2_t b) {
+// CHECK: test_vpmin_f32
+ return vpmin_f32(a, b);
+// CHECK: fminp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vpminq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vpminq_s8
+ return vpminq_s8(a, b);
+// CHECK: sminp {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vpminq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vpminq_s16
+ return vpminq_s16(a, b);
+// CHECK: sminp {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vpminq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vpminq_s32
+ return vpminq_s32(a, b);
+// CHECK: sminp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vpminq_u8(uint8x16_t a, uint8x16_t b) {
+// CHECK: test_vpminq_u8
+ return vpminq_u8(a, b);
+// CHECK: uminp {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vpminq_u16(uint16x8_t a, uint16x8_t b) {
+// CHECK: test_vpminq_u16
+ return vpminq_u16(a, b);
+// CHECK: uminp {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vpminq_u32(uint32x4_t a, uint32x4_t b) {
+// CHECK: test_vpminq_u32
+ return vpminq_u32(a, b);
+// CHECK: uminp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float32x4_t test_vpminq_f32(float32x4_t a, float32x4_t b) {
+// CHECK: test_vpminq_f32
+ return vpminq_f32(a, b);
+// CHECK: fminp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vpminq_f64(float64x2_t a, float64x2_t b) {
+// CHECK: test_vpminq_f64
+ return vpminq_f64(a, b);
+// CHECK: fminp {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+float32x2_t test_vpmaxnm_f32(float32x2_t a, float32x2_t b) {
+// CHECK: test_vpmaxnm_f32
+ return vpmaxnm_f32(a, b);
+// CHECK: fmaxnmp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x4_t test_vpmaxnmq_f32(float32x4_t a, float32x4_t b) {
+// CHECK: test_vpmaxnmq_f32
+ return vpmaxnmq_f32(a, b);
+// CHECK: fmaxnmp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vpmaxnmq_f64(float64x2_t a, float64x2_t b) {
+// CHECK: test_vpmaxnmq_f64
+ return vpmaxnmq_f64(a, b);
+// CHECK: fmaxnmp {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+float32x2_t test_vpminnm_f32(float32x2_t a, float32x2_t b) {
+// CHECK: test_vpminnm_f32
+ return vpminnm_f32(a, b);
+// CHECK: fminnmp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x4_t test_vpminnmq_f32(float32x4_t a, float32x4_t b) {
+// CHECK: test_vpminnmq_f32
+ return vpminnmq_f32(a, b);
+// CHECK: fminnmp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vpminnmq_f64(float64x2_t a, float64x2_t b) {
+// CHECK: test_vpminnmq_f64
+ return vpminnmq_f64(a, b);
+// CHECK: fminnmp {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+int8x8_t test_vpadd_s8(int8x8_t a, int8x8_t b) {
+// CHECK: test_vpadd_s8
+ return vpadd_s8(a, b);
+// CHECK: addp {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4_t test_vpadd_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vpadd_s16
+ return vpadd_s16(a, b);
+// CHECK: addp {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vpadd_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vpadd_s32
+ return vpadd_s32(a, b);
+// CHECK: addp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+uint8x8_t test_vpadd_u8(uint8x8_t a, uint8x8_t b) {
+// CHECK: test_vpadd_u8
+ return vpadd_u8(a, b);
+// CHECK: addp {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint16x4_t test_vpadd_u16(uint16x4_t a, uint16x4_t b) {
+// CHECK: test_vpadd_u16
+ return vpadd_u16(a, b);
+// CHECK: addp {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint32x2_t test_vpadd_u32(uint32x2_t a, uint32x2_t b) {
+// CHECK: test_vpadd_u32
+ return vpadd_u32(a, b);
+// CHECK: addp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x2_t test_vpadd_f32(float32x2_t a, float32x2_t b) {
+// CHECK: test_vpadd_f32
+ return vpadd_f32(a, b);
+// CHECK: faddp {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int8x16_t test_vpaddq_s8(int8x16_t a, int8x16_t b) {
+// CHECK: test_vpaddq_s8
+ return vpaddq_s8(a, b);
+// CHECK: addp {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x8_t test_vpaddq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vpaddq_s16
+ return vpaddq_s16(a, b);
+// CHECK: addp {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vpaddq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vpaddq_s32
+ return vpaddq_s32(a, b);
+// CHECK: addp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint8x16_t test_vpaddq_u8(uint8x16_t a, uint8x16_t b) {
+// CHECK: test_vpaddq_u8
+ return vpaddq_u8(a, b);
+// CHECK: addp {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x8_t test_vpaddq_u16(uint16x8_t a, uint16x8_t b) {
+// CHECK: test_vpaddq_u16
+ return vpaddq_u16(a, b);
+// CHECK: addp {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x4_t test_vpaddq_u32(uint32x4_t a, uint32x4_t b) {
+// CHECK: test_vpaddq_u32
+ return vpaddq_u32(a, b);
+// CHECK: addp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float32x4_t test_vpaddq_f32(float32x4_t a, float32x4_t b) {
+// CHECK: test_vpaddq_f32
+ return vpaddq_f32(a, b);
+// CHECK: faddp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vpaddq_f64(float64x2_t a, float64x2_t b) {
+// CHECK: test_vpaddq_f64
+ return vpaddq_f64(a, b);
+// CHECK: faddp {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+int16x4_t test_vqdmulh_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vqdmulh_s16
+ return vqdmulh_s16(a, b);
+// CHECK: sqdmulh {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vqdmulh_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vqdmulh_s32
+ return vqdmulh_s32(a, b);
+// CHECK: sqdmulh {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int16x8_t test_vqdmulhq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vqdmulhq_s16
+ return vqdmulhq_s16(a, b);
+// CHECK: sqdmulh {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vqdmulhq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vqdmulhq_s32
+ return vqdmulhq_s32(a, b);
+// CHECK: sqdmulh {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int16x4_t test_vqrdmulh_s16(int16x4_t a, int16x4_t b) {
+// CHECK: test_vqrdmulh_s16
+ return vqrdmulh_s16(a, b);
+// CHECK: sqrdmulh {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int32x2_t test_vqrdmulh_s32(int32x2_t a, int32x2_t b) {
+// CHECK: test_vqrdmulh_s32
+ return vqrdmulh_s32(a, b);
+// CHECK: sqrdmulh {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+int16x8_t test_vqrdmulhq_s16(int16x8_t a, int16x8_t b) {
+// CHECK: test_vqrdmulhq_s16
+ return vqrdmulhq_s16(a, b);
+// CHECK: sqrdmulh {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x4_t test_vqrdmulhq_s32(int32x4_t a, int32x4_t b) {
+// CHECK: test_vqrdmulhq_s32
+ return vqrdmulhq_s32(a, b);
+// CHECK: sqrdmulh {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+
+float32x2_t test_vmulx_f32(float32x2_t a, float32x2_t b) {
+// CHECK: test_vmulx_f32
+ return vmulx_f32(a, b);
+// CHECK: fmulx {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+}
+
+float32x4_t test_vmulxq_f32(float32x4_t a, float32x4_t b) {
+// CHECK: test_vmulxq_f32
+ return vmulxq_f32(a, b);
+// CHECK: fmulx {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vmulxq_f64(float64x2_t a, float64x2_t b) {
+// CHECK: test_vmulxq_f64
+ return vmulxq_f64(a, b);
+// CHECK: fmulx {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+int8x8_t test_vshl_n_s8(int8x8_t a) {
+// CHECK: test_vshl_n_s8
+ return vshl_n_s8(a, 3);
+// CHECK: shl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vshl_n_s16(int16x4_t a) {
+// CHECK: test_vshl_n_s16
+ return vshl_n_s16(a, 3);
+// CHECK: shl {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vshl_n_s32(int32x2_t a) {
+// CHECK: test_vshl_n_s32
+ return vshl_n_s32(a, 3);
+// CHECK: shl {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vshlq_n_s8(int8x16_t a) {
+// CHECK: test_vshlq_n_s8
+ return vshlq_n_s8(a, 3);
+// CHECK: shl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vshlq_n_s16(int16x8_t a) {
+// CHECK: test_vshlq_n_s16
+ return vshlq_n_s16(a, 3);
+// CHECK: shl {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vshlq_n_s32(int32x4_t a) {
+// CHECK: test_vshlq_n_s32
+ return vshlq_n_s32(a, 3);
+// CHECK: shl {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vshlq_n_s64(int64x2_t a) {
+// CHECK: test_vshlq_n_s64
+ return vshlq_n_s64(a, 3);
+// CHECK: shl {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vshl_n_u8(int8x8_t a) {
+// CHECK: test_vshl_n_u8
+ return vshl_n_u8(a, 3);
+// CHECK: shl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vshl_n_u16(int16x4_t a) {
+// CHECK: test_vshl_n_u16
+ return vshl_n_u16(a, 3);
+// CHECK: shl {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vshl_n_u32(int32x2_t a) {
+// CHECK: test_vshl_n_u32
+ return vshl_n_u32(a, 3);
+// CHECK: shl {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vshlq_n_u8(int8x16_t a) {
+// CHECK: test_vshlq_n_u8
+ return vshlq_n_u8(a, 3);
+// CHECK: shl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vshlq_n_u16(int16x8_t a) {
+// CHECK: test_vshlq_n_u16
+ return vshlq_n_u16(a, 3);
+// CHECK: shl {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vshlq_n_u32(int32x4_t a) {
+// CHECK: test_vshlq_n_u32
+ return vshlq_n_u32(a, 3);
+// CHECK: shl {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vshlq_n_u64(int64x2_t a) {
+// CHECK: test_vshlq_n_u64
+ return vshlq_n_u64(a, 3);
+// CHECK: shl {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vshr_n_s8(int8x8_t a) {
+ // CHECK: test_vshr_n_s8
+ return vshr_n_s8(a, 3);
+ // CHECK: sshr {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vshr_n_s16(int16x4_t a) {
+ // CHECK: test_vshr_n_s16
+ return vshr_n_s16(a, 3);
+ // CHECK: sshr {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vshr_n_s32(int32x2_t a) {
+ // CHECK: test_vshr_n_s32
+ return vshr_n_s32(a, 3);
+ // CHECK: sshr {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vshrq_n_s8(int8x16_t a) {
+ // CHECK: test_vshrq_n_s8
+ return vshrq_n_s8(a, 3);
+ // CHECK: sshr {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vshrq_n_s16(int16x8_t a) {
+ // CHECK: test_vshrq_n_s16
+ return vshrq_n_s16(a, 3);
+ // CHECK: sshr {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vshrq_n_s32(int32x4_t a) {
+ // CHECK: test_vshrq_n_s32
+ return vshrq_n_s32(a, 3);
+ // CHECK: sshr {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vshrq_n_s64(int64x2_t a) {
+ // CHECK: test_vshrq_n_s64
+ return vshrq_n_s64(a, 3);
+ // CHECK: sshr {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vshr_n_u8(int8x8_t a) {
+ // CHECK: test_vshr_n_u8
+ return vshr_n_u8(a, 3);
+ // CHECK: ushr {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vshr_n_u16(int16x4_t a) {
+ // CHECK: test_vshr_n_u16
+ return vshr_n_u16(a, 3);
+ // CHECK: ushr {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vshr_n_u32(int32x2_t a) {
+ // CHECK: test_vshr_n_u32
+ return vshr_n_u32(a, 3);
+ // CHECK: ushr {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vshrq_n_u8(int8x16_t a) {
+ // CHECK: test_vshrq_n_u8
+ return vshrq_n_u8(a, 3);
+ // CHECK: ushr {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vshrq_n_u16(int16x8_t a) {
+ // CHECK: test_vshrq_n_u16
+ return vshrq_n_u16(a, 3);
+ // CHECK: ushr {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vshrq_n_u32(int32x4_t a) {
+ // CHECK: test_vshrq_n_u32
+ return vshrq_n_u32(a, 3);
+ // CHECK: ushr {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vshrq_n_u64(int64x2_t a) {
+ // CHECK: test_vshrq_n_u64
+ return vshrq_n_u64(a, 3);
+ // CHECK: ushr {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vsra_n_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vsra_n_s8
+ return vsra_n_s8(a, b, 3);
+ // CHECK: ssra {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vsra_n_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vsra_n_s16
+ return vsra_n_s16(a, b, 3);
+ // CHECK: ssra {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vsra_n_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vsra_n_s32
+ return vsra_n_s32(a, b, 3);
+ // CHECK: ssra {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vsraq_n_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vsraq_n_s8
+ return vsraq_n_s8(a, b, 3);
+ // CHECK: ssra {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vsraq_n_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vsraq_n_s16
+ return vsraq_n_s16(a, b, 3);
+ // CHECK: ssra {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vsraq_n_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vsraq_n_s32
+ return vsraq_n_s32(a, b, 3);
+ // CHECK: ssra {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vsraq_n_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vsraq_n_s64
+ return vsraq_n_s64(a, b, 3);
+ // CHECK: ssra {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vsra_n_u8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vsra_n_u8
+ return vsra_n_u8(a, b, 3);
+ // CHECK: usra {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vsra_n_u16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vsra_n_u16
+ return vsra_n_u16(a, b, 3);
+ // CHECK: usra {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vsra_n_u32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vsra_n_u32
+ return vsra_n_u32(a, b, 3);
+ // CHECK: usra {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vsraq_n_u8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vsraq_n_u8
+ return vsraq_n_u8(a, b, 3);
+ // CHECK: usra {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vsraq_n_u16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vsraq_n_u16
+ return vsraq_n_u16(a, b, 3);
+ // CHECK: usra {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vsraq_n_u32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vsraq_n_u32
+ return vsraq_n_u32(a, b, 3);
+ // CHECK: usra {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vsraq_n_u64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vsraq_n_u64
+ return vsraq_n_u64(a, b, 3);
+ // CHECK: usra {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vrshr_n_s8(int8x8_t a) {
+ // CHECK: test_vrshr_n_s8
+ return vrshr_n_s8(a, 3);
+ // CHECK: srshr {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vrshr_n_s16(int16x4_t a) {
+ // CHECK: test_vrshr_n_s16
+ return vrshr_n_s16(a, 3);
+ // CHECK: srshr {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vrshr_n_s32(int32x2_t a) {
+ // CHECK: test_vrshr_n_s32
+ return vrshr_n_s32(a, 3);
+ // CHECK: srshr {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vrshrq_n_s8(int8x16_t a) {
+ // CHECK: test_vrshrq_n_s8
+ return vrshrq_n_s8(a, 3);
+ // CHECK: srshr {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vrshrq_n_s16(int16x8_t a) {
+ // CHECK: test_vrshrq_n_s16
+ return vrshrq_n_s16(a, 3);
+ // CHECK: srshr {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vrshrq_n_s32(int32x4_t a) {
+ // CHECK: test_vrshrq_n_s32
+ return vrshrq_n_s32(a, 3);
+ // CHECK: srshr {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vrshrq_n_s64(int64x2_t a) {
+ // CHECK: test_vrshrq_n_s64
+ return vrshrq_n_s64(a, 3);
+ // CHECK: srshr {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vrshr_n_u8(int8x8_t a) {
+ // CHECK: test_vrshr_n_u8
+ return vrshr_n_u8(a, 3);
+ // CHECK: urshr {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vrshr_n_u16(int16x4_t a) {
+ // CHECK: test_vrshr_n_u16
+ return vrshr_n_u16(a, 3);
+ // CHECK: urshr {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vrshr_n_u32(int32x2_t a) {
+ // CHECK: test_vrshr_n_u32
+ return vrshr_n_u32(a, 3);
+ // CHECK: urshr {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vrshrq_n_u8(int8x16_t a) {
+ // CHECK: test_vrshrq_n_u8
+ return vrshrq_n_u8(a, 3);
+ // CHECK: urshr {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vrshrq_n_u16(int16x8_t a) {
+ // CHECK: test_vrshrq_n_u16
+ return vrshrq_n_u16(a, 3);
+ // CHECK: urshr {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vrshrq_n_u32(int32x4_t a) {
+ // CHECK: test_vrshrq_n_u32
+ return vrshrq_n_u32(a, 3);
+ // CHECK: urshr {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vrshrq_n_u64(int64x2_t a) {
+ // CHECK: test_vrshrq_n_u64
+ return vrshrq_n_u64(a, 3);
+ // CHECK: urshr {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vrsra_n_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vrsra_n_s8
+ return vrsra_n_s8(a, b, 3);
+ // CHECK: srsra {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vrsra_n_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vrsra_n_s16
+ return vrsra_n_s16(a, b, 3);
+ // CHECK: srsra {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vrsra_n_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vrsra_n_s32
+ return vrsra_n_s32(a, b, 3);
+ // CHECK: srsra {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vrsraq_n_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vrsraq_n_s8
+ return vrsraq_n_s8(a, b, 3);
+ // CHECK: srsra {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vrsraq_n_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vrsraq_n_s16
+ return vrsraq_n_s16(a, b, 3);
+ // CHECK: srsra {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vrsraq_n_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vrsraq_n_s32
+ return vrsraq_n_s32(a, b, 3);
+ // CHECK: srsra {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vrsraq_n_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vrsraq_n_s64
+ return vrsraq_n_s64(a, b, 3);
+ // CHECK: srsra {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vrsra_n_u8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vrsra_n_u8
+ return vrsra_n_u8(a, b, 3);
+ // CHECK: ursra {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vrsra_n_u16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vrsra_n_u16
+ return vrsra_n_u16(a, b, 3);
+ // CHECK: ursra {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vrsra_n_u32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vrsra_n_u32
+ return vrsra_n_u32(a, b, 3);
+ // CHECK: ursra {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vrsraq_n_u8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vrsraq_n_u8
+ return vrsraq_n_u8(a, b, 3);
+ // CHECK: ursra {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vrsraq_n_u16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vrsraq_n_u16
+ return vrsraq_n_u16(a, b, 3);
+ // CHECK: ursra {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vrsraq_n_u32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vrsraq_n_u32
+ return vrsraq_n_u32(a, b, 3);
+ // CHECK: ursra {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vrsraq_n_u64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vrsraq_n_u64
+ return vrsraq_n_u64(a, b, 3);
+ // CHECK: ursra {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vsri_n_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vsri_n_s8
+ return vsri_n_s8(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vsri_n_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vsri_n_s16
+ return vsri_n_s16(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vsri_n_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vsri_n_s32
+ return vsri_n_s32(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vsriq_n_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vsriq_n_s8
+ return vsriq_n_s8(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vsriq_n_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vsriq_n_s16
+ return vsriq_n_s16(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vsriq_n_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vsriq_n_s32
+ return vsriq_n_s32(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vsriq_n_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vsriq_n_s64
+ return vsriq_n_s64(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vsri_n_u8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vsri_n_u8
+ return vsri_n_u8(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vsri_n_u16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vsri_n_u16
+ return vsri_n_u16(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vsri_n_u32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vsri_n_u32
+ return vsri_n_u32(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vsriq_n_u8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vsriq_n_u8
+ return vsriq_n_u8(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vsriq_n_u16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vsriq_n_u16
+ return vsriq_n_u16(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vsriq_n_u32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vsriq_n_u32
+ return vsriq_n_u32(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vsriq_n_u64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vsriq_n_u64
+ return vsriq_n_u64(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+poly8x8_t test_vsri_n_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vsri_n_p8
+ return vsri_n_p8(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+poly16x4_t test_vsri_n_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vsri_n_p16
+ return vsri_n_p16(a, b, 15);
+ // CHECK: sri {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #15
+}
+
+poly8x16_t test_vsriq_n_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vsriq_n_p8
+ return vsriq_n_p8(a, b, 3);
+ // CHECK: sri {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+poly16x8_t test_vsriq_n_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vsriq_n_p16
+ return vsriq_n_p16(a, b, 15);
+ // CHECK: sri {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #15
+}
+
+int8x8_t test_vsli_n_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vsli_n_s8
+ return vsli_n_s8(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vsli_n_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vsli_n_s16
+ return vsli_n_s16(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vsli_n_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vsli_n_s32
+ return vsli_n_s32(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vsliq_n_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vsliq_n_s8
+ return vsliq_n_s8(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vsliq_n_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vsliq_n_s16
+ return vsliq_n_s16(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vsliq_n_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vsliq_n_s32
+ return vsliq_n_s32(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vsliq_n_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vsliq_n_s64
+ return vsliq_n_s64(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+uint8x8_t test_vsli_n_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vsli_n_u8
+ return vsli_n_u8(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+uint16x4_t test_vsli_n_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vsli_n_u16
+ return vsli_n_u16(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+uint32x2_t test_vsli_n_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vsli_n_u32
+ return vsli_n_u32(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+uint8x16_t test_vsliq_n_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vsliq_n_u8
+ return vsliq_n_u8(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+uint16x8_t test_vsliq_n_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vsliq_n_u16
+ return vsliq_n_u16(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+uint32x4_t test_vsliq_n_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vsliq_n_u32
+ return vsliq_n_u32(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+uint64x2_t test_vsliq_n_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vsliq_n_u64
+ return vsliq_n_u64(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+poly8x8_t test_vsli_n_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vsli_n_p8
+ return vsli_n_p8(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+poly16x4_t test_vsli_n_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vsli_n_p16
+ return vsli_n_p16(a, b, 15);
+ // CHECK: sli {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #15
+}
+
+poly8x16_t test_vsliq_n_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vsliq_n_p8
+ return vsliq_n_p8(a, b, 3);
+ // CHECK: sli {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+poly16x8_t test_vsliq_n_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vsliq_n_p16
+ return vsliq_n_p16(a, b, 15);
+ // CHECK: sli {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #15
+}
+
+int8x8_t test_vqshlu_n_s8(int8x8_t a) {
+ // CHECK: test_vqshlu_n_s8
+ return vqshlu_n_s8(a, 3);
+ // CHECK: sqshlu {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #3
+}
+
+int16x4_t test_vqshlu_n_s16(int16x4_t a) {
+ // CHECK: test_vqshlu_n_s16
+ return vqshlu_n_s16(a, 3);
+ // CHECK: sqshlu {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #3
+}
+
+int32x2_t test_vqshlu_n_s32(int32x2_t a) {
+ // CHECK: test_vqshlu_n_s32
+ return vqshlu_n_s32(a, 3);
+ // CHECK: sqshlu {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #3
+}
+
+int8x16_t test_vqshluq_n_s8(int8x16_t a) {
+ // CHECK: test_vqshluq_n_s8
+ return vqshluq_n_s8(a, 3);
+ // CHECK: sqshlu {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #3
+}
+
+int16x8_t test_vqshluq_n_s16(int16x8_t a) {
+ // CHECK: test_vqshluq_n_s16
+ return vqshluq_n_s16(a, 3);
+ // CHECK: sqshlu {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #3
+}
+
+int32x4_t test_vqshluq_n_s32(int32x4_t a) {
+ // CHECK: test_vqshluq_n_s32
+ return vqshluq_n_s32(a, 3);
+ // CHECK: sqshlu {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #3
+}
+
+int64x2_t test_vqshluq_n_s64(int64x2_t a) {
+ // CHECK: test_vqshluq_n_s64
+ return vqshluq_n_s64(a, 3);
+ // CHECK: sqshlu {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #3
+}
+
+int8x8_t test_vshrn_n_s16(int16x8_t a) {
+ // CHECK: test_vshrn_n_s16
+ return vshrn_n_s16(a, 3);
+ // CHECK: shrn {{v[0-9]+}}.8b, {{v[0-9]+}}.8h, #3
+}
+
+int16x4_t test_vshrn_n_s32(int32x4_t a) {
+ // CHECK: test_vshrn_n_s32
+ return vshrn_n_s32(a, 9);
+ // CHECK: shrn {{v[0-9]+}}.4h, {{v[0-9]+}}.4s, #9
+}
+
+int32x2_t test_vshrn_n_s64(int64x2_t a) {
+ // CHECK: test_vshrn_n_s64
+ return vshrn_n_s64(a, 19);
+ // CHECK: shrn {{v[0-9]+}}.2s, {{v[0-9]+}}.2d, #19
+}
+
+uint8x8_t test_vshrn_n_u16(uint16x8_t a) {
+ // CHECK: test_vshrn_n_u16
+ return vshrn_n_u16(a, 3);
+ // CHECK: shrn {{v[0-9]+}}.8b, {{v[0-9]+}}.8h, #3
+}
+
+uint16x4_t test_vshrn_n_u32(uint32x4_t a) {
+ // CHECK: test_vshrn_n_u32
+ return vshrn_n_u32(a, 9);
+ // CHECK: shrn {{v[0-9]+}}.4h, {{v[0-9]+}}.4s, #9
+}
+
+uint32x2_t test_vshrn_n_u64(uint64x2_t a) {
+ // CHECK: test_vshrn_n_u64
+ return vshrn_n_u64(a, 19);
+ // CHECK: shrn {{v[0-9]+}}.2s, {{v[0-9]+}}.2d, #19
+}
+
+int8x16_t test_vshrn_high_n_s16(int8x8_t a, int16x8_t b) {
+ // CHECK: test_vshrn_high_n_s16
+ return vshrn_high_n_s16(a, b, 3);
+ // CHECK: shrn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.8h, #3
+}
+
+int16x8_t test_vshrn_high_n_s32(int16x4_t a, int32x4_t b) {
+ // CHECK: test_vshrn_high_n_s32
+ return vshrn_high_n_s32(a, b, 9);
+ // CHECK: shrn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.4s, #9
+}
+
+int32x4_t test_vshrn_high_n_s64(int32x2_t a, int64x2_t b) {
+ // CHECK: test_vshrn_high_n_s64
+ return vshrn_high_n_s64(a, b, 19);
+ // CHECK: shrn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.2d, #19
+}
+
+uint8x16_t test_vshrn_high_n_u16(uint8x8_t a, uint16x8_t b) {
+ // CHECK: test_vshrn_high_n_u16
+ return vshrn_high_n_u16(a, b, 3);
+ // CHECK: shrn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.8h, #3
+}
+
+uint16x8_t test_vshrn_high_n_u32(uint16x4_t a, uint32x4_t b) {
+ // CHECK: test_vshrn_high_n_u32
+ return vshrn_high_n_u32(a, b, 9);
+ // CHECK: shrn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.4s, #9
+}
+
+uint32x4_t test_vshrn_high_n_u64(uint32x2_t a, uint64x2_t b) {
+ // CHECK: test_vshrn_high_n_u64
+ return vshrn_high_n_u64(a, b, 19);
+ // CHECK: shrn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.2d, #19
+}
+
+int8x8_t test_vqshrun_n_s16(int16x8_t a) {
+ // CHECK: test_vqshrun_n_s16
+ return vqshrun_n_s16(a, 3);
+ // CHECK: sqshrun {{v[0-9]+}}.8b, {{v[0-9]+}}.8h, #3
+}
+
+int16x4_t test_vqshrun_n_s32(int32x4_t a) {
+ // CHECK: test_vqshrun_n_s32
+ return vqshrun_n_s32(a, 9);
+ // CHECK: sqshrun {{v[0-9]+}}.4h, {{v[0-9]+}}.4s, #9
+}
+
+int32x2_t test_vqshrun_n_s64(int64x2_t a) {
+ // CHECK: test_vqshrun_n_s64
+ return vqshrun_n_s64(a, 19);
+ // CHECK: sqshrun {{v[0-9]+}}.2s, {{v[0-9]+}}.2d, #19
+}
+
+int8x16_t test_vqshrun_high_n_s16(int8x8_t a, int16x8_t b) {
+ // CHECK: test_vqshrun_high_n_s16
+ return vqshrun_high_n_s16(a, b, 3);
+ // CHECK: sqshrun2 {{v[0-9]+}}.16b, {{v[0-9]+}}.8h, #3
+}
+
+int16x8_t test_vqshrun_high_n_s32(int16x4_t a, int32x4_t b) {
+ // CHECK: test_vqshrun_high_n_s32
+ return vqshrun_high_n_s32(a, b, 9);
+ // CHECK: sqshrun2 {{v[0-9]+}}.8h, {{v[0-9]+}}.4s, #9
+}
+
+int32x4_t test_vqshrun_high_n_s64(int32x2_t a, int64x2_t b) {
+ // CHECK: test_vqshrun_high_n_s64
+ return vqshrun_high_n_s64(a, b, 19);
+ // CHECK: sqshrun2 {{v[0-9]+}}.4s, {{v[0-9]+}}.2d, #19
+}
+
+int8x8_t test_vrshrn_n_s16(int16x8_t a) {
+ // CHECK: test_vrshrn_n_s16
+ return vrshrn_n_s16(a, 3);
+ // CHECK: rshrn {{v[0-9]+}}.8b, {{v[0-9]+}}.8h, #3
+}
+
+int16x4_t test_vrshrn_n_s32(int32x4_t a) {
+ // CHECK: test_vrshrn_n_s32
+ return vrshrn_n_s32(a, 9);
+ // CHECK: rshrn {{v[0-9]+}}.4h, {{v[0-9]+}}.4s, #9
+}
+
+int32x2_t test_vrshrn_n_s64(int64x2_t a) {
+ // CHECK: test_vrshrn_n_s64
+ return vrshrn_n_s64(a, 19);
+ // CHECK: rshrn {{v[0-9]+}}.2s, {{v[0-9]+}}.2d, #19
+}
+
+uint8x8_t test_vrshrn_n_u16(uint16x8_t a) {
+ // CHECK: test_vrshrn_n_u16
+ return vrshrn_n_u16(a, 3);
+ // CHECK: rshrn {{v[0-9]+}}.8b, {{v[0-9]+}}.8h, #3
+}
+
+uint16x4_t test_vrshrn_n_u32(uint32x4_t a) {
+ // CHECK: test_vrshrn_n_u32
+ return vrshrn_n_u32(a, 9);
+ // CHECK: rshrn {{v[0-9]+}}.4h, {{v[0-9]+}}.4s, #9
+}
+
+uint32x2_t test_vrshrn_n_u64(uint64x2_t a) {
+ // CHECK: test_vrshrn_n_u64
+ return vrshrn_n_u64(a, 19);
+ // CHECK: rshrn {{v[0-9]+}}.2s, {{v[0-9]+}}.2d, #19
+}
+
+int8x16_t test_vrshrn_high_n_s16(int8x8_t a, int16x8_t b) {
+ // CHECK: test_vrshrn_high_n_s16
+ return vrshrn_high_n_s16(a, b, 3);
+ // CHECK: rshrn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.8h, #3
+}
+
+int16x8_t test_vrshrn_high_n_s32(int16x4_t a, int32x4_t b) {
+ // CHECK: test_vrshrn_high_n_s32
+ return vrshrn_high_n_s32(a, b, 9);
+ // CHECK: rshrn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.4s, #9
+}
+
+int32x4_t test_vrshrn_high_n_s64(int32x2_t a, int64x2_t b) {
+ // CHECK: test_vrshrn_high_n_s64
+ return vrshrn_high_n_s64(a, b, 19);
+ // CHECK: rshrn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.2d, #19
+}
+
+uint8x16_t test_vrshrn_high_n_u16(uint8x8_t a, uint16x8_t b) {
+ // CHECK: test_vrshrn_high_n_u16
+ return vrshrn_high_n_u16(a, b, 3);
+ // CHECK: rshrn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.8h, #3
+}
+
+uint16x8_t test_vrshrn_high_n_u32(uint16x4_t a, uint32x4_t b) {
+ // CHECK: test_vrshrn_high_n_u32
+ return vrshrn_high_n_u32(a, b, 9);
+ // CHECK: rshrn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.4s, #9
+}
+
+uint32x4_t test_vrshrn_high_n_u64(uint32x2_t a, uint64x2_t b) {
+ // CHECK: test_vrshrn_high_n_u64
+ return vrshrn_high_n_u64(a, b, 19);
+ // CHECK: rshrn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.2d, #19
+}
+
+int8x8_t test_vqrshrun_n_s16(int16x8_t a) {
+ // CHECK: test_vqrshrun_n_s16
+ return vqrshrun_n_s16(a, 3);
+ // CHECK: sqrshrun {{v[0-9]+}}.8b, {{v[0-9]+}}.8h, #3
+}
+
+int16x4_t test_vqrshrun_n_s32(int32x4_t a) {
+ // CHECK: test_vqrshrun_n_s32
+ return vqrshrun_n_s32(a, 9);
+ // CHECK: sqrshrun {{v[0-9]+}}.4h, {{v[0-9]+}}.4s, #9
+}
+
+int32x2_t test_vqrshrun_n_s64(int64x2_t a) {
+ // CHECK: test_vqrshrun_n_s64
+ return vqrshrun_n_s64(a, 19);
+ // CHECK: sqrshrun {{v[0-9]+}}.2s, {{v[0-9]+}}.2d, #19
+}
+
+int8x16_t test_vqrshrun_high_n_s16(int8x8_t a, int16x8_t b) {
+ // CHECK: test_vqrshrun_high_n_s16
+ return vqrshrun_high_n_s16(a, b, 3);
+ // CHECK: sqrshrun2 {{v[0-9]+}}.16b, {{v[0-9]+}}.8h, #3
+}
+
+int16x8_t test_vqrshrun_high_n_s32(int16x4_t a, int32x4_t b) {
+ // CHECK: test_vqrshrun_high_n_s32
+ return vqrshrun_high_n_s32(a, b, 9);
+ // CHECK: sqrshrun2 {{v[0-9]+}}.8h, {{v[0-9]+}}.4s, #9
+}
+
+int32x4_t test_vqrshrun_high_n_s64(int32x2_t a, int64x2_t b) {
+ // CHECK: test_vqrshrun_high_n_s64
+ return vqrshrun_high_n_s64(a, b, 19);
+ // CHECK: sqrshrun2 {{v[0-9]+}}.4s, {{v[0-9]+}}.2d, #19
+}
+
+int8x8_t test_vqshrn_n_s16(int16x8_t a) {
+ // CHECK: test_vqshrn_n_s16
+ return vqshrn_n_s16(a, 3);
+ // CHECK: sqshrn {{v[0-9]+}}.8b, {{v[0-9]+}}.8h, #3
+}
+
+int16x4_t test_vqshrn_n_s32(int32x4_t a) {
+ // CHECK: test_vqshrn_n_s32
+ return vqshrn_n_s32(a, 9);
+ // CHECK: sqshrn {{v[0-9]+}}.4h, {{v[0-9]+}}.4s, #9
+}
+
+int32x2_t test_vqshrn_n_s64(int64x2_t a) {
+ // CHECK: test_vqshrn_n_s64
+ return vqshrn_n_s64(a, 19);
+ // CHECK: sqshrn {{v[0-9]+}}.2s, {{v[0-9]+}}.2d, #19
+}
+
+uint8x8_t test_vqshrn_n_u16(uint16x8_t a) {
+ // CHECK: test_vqshrn_n_u16
+ return vqshrn_n_u16(a, 3);
+ // CHECK: uqshrn {{v[0-9]+}}.8b, {{v[0-9]+}}.8h, #3
+}
+
+uint16x4_t test_vqshrn_n_u32(uint32x4_t a) {
+ // CHECK: test_vqshrn_n_u32
+ return vqshrn_n_u32(a, 9);
+ // CHECK: uqshrn {{v[0-9]+}}.4h, {{v[0-9]+}}.4s, #9
+}
+
+uint32x2_t test_vqshrn_n_u64(uint64x2_t a) {
+ // CHECK: test_vqshrn_n_u64
+ return vqshrn_n_u64(a, 19);
+ // CHECK: uqshrn {{v[0-9]+}}.2s, {{v[0-9]+}}.2d, #19
+}
+
+int8x16_t test_vqshrn_high_n_s16(int8x8_t a, int16x8_t b) {
+ // CHECK: test_vqshrn_high_n_s16
+ return vqshrn_high_n_s16(a, b, 3);
+ // CHECK: sqshrn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.8h, #3
+}
+
+int16x8_t test_vqshrn_high_n_s32(int16x4_t a, int32x4_t b) {
+ // CHECK: test_vqshrn_high_n_s32
+ return vqshrn_high_n_s32(a, b, 9);
+ // CHECK: sqshrn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.4s, #9
+}
+
+int32x4_t test_vqshrn_high_n_s64(int32x2_t a, int64x2_t b) {
+ // CHECK: test_vqshrn_high_n_s64
+ return vqshrn_high_n_s64(a, b, 19);
+ // CHECK: sqshrn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.2d, #19
+}
+
+uint8x16_t test_vqshrn_high_n_u16(uint8x8_t a, uint16x8_t b) {
+ // CHECK: test_vqshrn_high_n_u16
+ return vqshrn_high_n_u16(a, b, 3);
+ // CHECK: uqshrn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.8h, #3
+}
+
+uint16x8_t test_vqshrn_high_n_u32(uint16x4_t a, uint32x4_t b) {
+ // CHECK: test_vqshrn_high_n_u32
+ return vqshrn_high_n_u32(a, b, 9);
+ // CHECK: uqshrn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.4s, #9
+}
+
+uint32x4_t test_vqshrn_high_n_u64(uint32x2_t a, uint64x2_t b) {
+ // CHECK: test_vqshrn_high_n_u64
+ return vqshrn_high_n_u64(a, b, 19);
+ // CHECK: uqshrn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.2d, #19
+}
+
+int8x8_t test_vqrshrn_n_s16(int16x8_t a) {
+ // CHECK: test_vqrshrn_n_s16
+ return vqrshrn_n_s16(a, 3);
+ // CHECK: sqrshrn {{v[0-9]+}}.8b, {{v[0-9]+}}.8h, #3
+}
+
+int16x4_t test_vqrshrn_n_s32(int32x4_t a) {
+ // CHECK: test_vqrshrn_n_s32
+ return vqrshrn_n_s32(a, 9);
+ // CHECK: sqrshrn {{v[0-9]+}}.4h, {{v[0-9]+}}.4s, #9
+}
+
+int32x2_t test_vqrshrn_n_s64(int64x2_t a) {
+ // CHECK: test_vqrshrn_n_s64
+ return vqrshrn_n_s64(a, 19);
+ // CHECK: sqrshrn {{v[0-9]+}}.2s, {{v[0-9]+}}.2d, #19
+}
+
+uint8x8_t test_vqrshrn_n_u16(uint16x8_t a) {
+ // CHECK: test_vqrshrn_n_u16
+ return vqrshrn_n_u16(a, 3);
+ // CHECK: uqrshrn {{v[0-9]+}}.8b, {{v[0-9]+}}.8h, #3
+}
+
+uint16x4_t test_vqrshrn_n_u32(uint32x4_t a) {
+ // CHECK: test_vqrshrn_n_u32
+ return vqrshrn_n_u32(a, 9);
+ // CHECK: uqrshrn {{v[0-9]+}}.4h, {{v[0-9]+}}.4s, #9
+}
+
+uint32x2_t test_vqrshrn_n_u64(uint64x2_t a) {
+ // CHECK: test_vqrshrn_n_u64
+ return vqrshrn_n_u64(a, 19);
+ // CHECK: uqrshrn {{v[0-9]+}}.2s, {{v[0-9]+}}.2d, #19
+}
+
+int8x16_t test_vqrshrn_high_n_s16(int8x8_t a, int16x8_t b) {
+ // CHECK: test_vqrshrn_high_n_s16
+ return vqrshrn_high_n_s16(a, b, 3);
+ // CHECK: sqrshrn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.8h, #3
+}
+
+int16x8_t test_vqrshrn_high_n_s32(int16x4_t a, int32x4_t b) {
+ // CHECK: test_vqrshrn_high_n_s32
+ return vqrshrn_high_n_s32(a, b, 9);
+ // CHECK: sqrshrn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.4s, #9
+}
+
+int32x4_t test_vqrshrn_high_n_s64(int32x2_t a, int64x2_t b) {
+ // CHECK: test_vqrshrn_high_n_s64
+ return vqrshrn_high_n_s64(a, b, 19);
+ // CHECK: sqrshrn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.2d, #19
+}
+
+uint8x16_t test_vqrshrn_high_n_u16(uint8x8_t a, uint16x8_t b) {
+ // CHECK: test_vqrshrn_high_n_u16
+ return vqrshrn_high_n_u16(a, b, 3);
+ // CHECK: uqrshrn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.8h, #3
+}
+
+uint16x8_t test_vqrshrn_high_n_u32(uint16x4_t a, uint32x4_t b) {
+ // CHECK: test_vqrshrn_high_n_u32
+ return vqrshrn_high_n_u32(a, b, 9);
+ // CHECK: uqrshrn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.4s, #9
+}
+
+uint32x4_t test_vqrshrn_high_n_u64(uint32x2_t a, uint64x2_t b) {
+ // CHECK: test_vqrshrn_high_n_u64
+ return vqrshrn_high_n_u64(a, b, 19);
+ // CHECK: uqrshrn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.2d, #19
+}
+
+int16x8_t test_vshll_n_s8(int8x8_t a) {
+// CHECK: test_vshll_n_s8
+ return vshll_n_s8(a, 3);
+// CHECK: sshll {{v[0-9]+}}.8h, {{v[0-9]+}}.8b, #3
+}
+
+int32x4_t test_vshll_n_s16(int16x4_t a) {
+// CHECK: test_vshll_n_s16
+ return vshll_n_s16(a, 9);
+// CHECK: sshll {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, #9
+}
+
+int64x2_t test_vshll_n_s32(int32x2_t a) {
+// CHECK: test_vshll_n_s32
+ return vshll_n_s32(a, 19);
+// CHECK: sshll {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, #19
+}
+
+uint16x8_t test_vshll_n_u8(uint8x8_t a) {
+// CHECK: test_vshll_n_u8
+ return vshll_n_u8(a, 3);
+// CHECK: ushll {{v[0-9]+}}.8h, {{v[0-9]+}}.8b, #3
+}
+
+uint32x4_t test_vshll_n_u16(uint16x4_t a) {
+// CHECK: test_vshll_n_u16
+ return vshll_n_u16(a, 9);
+// CHECK: ushll {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, #9
+}
+
+uint64x2_t test_vshll_n_u32(uint32x2_t a) {
+// CHECK: test_vshll_n_u32
+ return vshll_n_u32(a, 19);
+// CHECK: ushll {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, #19
+}
+
+int16x8_t test_vshll_high_n_s8(int8x16_t a) {
+// CHECK: test_vshll_high_n_s8
+ return vshll_high_n_s8(a, 3);
+// CHECK: sshll2 {{v[0-9]+}}.8h, {{v[0-9]+}}.16b, #3
+}
+
+int32x4_t test_vshll_high_n_s16(int16x8_t a) {
+// CHECK: test_vshll_high_n_s16
+ return vshll_high_n_s16(a, 9);
+// CHECK: sshll2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, #9
+}
+
+int64x2_t test_vshll_high_n_s32(int32x4_t a) {
+// CHECK: test_vshll_high_n_s32
+ return vshll_high_n_s32(a, 19);
+// CHECK: sshll2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, #19
+}
+
+uint16x8_t test_vshll_high_n_u8(uint8x16_t a) {
+// CHECK: test_vshll_high_n_u8
+ return vshll_high_n_u8(a, 3);
+// CHECK: ushll2 {{v[0-9]+}}.8h, {{v[0-9]+}}.16b, #3
+}
+
+uint32x4_t test_vshll_high_n_u16(uint16x8_t a) {
+// CHECK: test_vshll_high_n_u16
+ return vshll_high_n_u16(a, 9);
+// CHECK: ushll2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, #9
+}
+
+uint64x2_t test_vshll_high_n_u32(uint32x4_t a) {
+// CHECK: test_vshll_high_n_u32
+ return vshll_high_n_u32(a, 19);
+// CHECK: ushll2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, #19
+}
+
+int16x8_t test_vmovl_s8(int8x8_t a) {
+// CHECK: test_vmovl_s8
+ return vmovl_s8(a);
+// CHECK: sshll {{v[0-9]+}}.8h, {{v[0-9]+}}.8b, #0
+}
+
+int32x4_t test_vmovl_s16(int16x4_t a) {
+// CHECK: test_vmovl_s16
+ return vmovl_s16(a);
+// CHECK: sshll {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, #0
+}
+
+int64x2_t test_vmovl_s32(int32x2_t a) {
+// CHECK: test_vmovl_s32
+ return vmovl_s32(a);
+// CHECK: sshll {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, #0
+}
+
+uint16x8_t test_vmovl_u8(uint8x8_t a) {
+// CHECK: test_vmovl_u8
+ return vmovl_u8(a);
+// CHECK: ushll {{v[0-9]+}}.8h, {{v[0-9]+}}.8b, #0
+}
+
+uint32x4_t test_vmovl_u16(uint16x4_t a) {
+// CHECK: test_vmovl_u16
+ return vmovl_u16(a);
+// CHECK: ushll {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, #0
+}
+
+uint64x2_t test_vmovl_u32(uint32x2_t a) {
+// CHECK: test_vmovl_u32
+ return vmovl_u32(a);
+// CHECK: ushll {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, #0
+}
+
+int16x8_t test_vmovl_high_s8(int8x16_t a) {
+// CHECK: test_vmovl_high_s8
+ return vmovl_high_s8(a);
+// CHECK: sshll2 {{v[0-9]+}}.8h, {{v[0-9]+}}.16b, #0
+}
+
+int32x4_t test_vmovl_high_s16(int16x8_t a) {
+// CHECK: test_vmovl_high_s16
+ return vmovl_high_s16(a);
+// CHECK: sshll2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, #0
+}
+
+int64x2_t test_vmovl_high_s32(int32x4_t a) {
+// CHECK: test_vmovl_high_s32
+ return vmovl_high_s32(a);
+// CHECK: sshll2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, #0
+}
+
+uint16x8_t test_vmovl_high_u8(uint8x16_t a) {
+// CHECK: test_vmovl_high_u8
+ return vmovl_high_u8(a);
+// CHECK: ushll2 {{v[0-9]+}}.8h, {{v[0-9]+}}.16b, #0
+}
+
+uint32x4_t test_vmovl_high_u16(uint16x8_t a) {
+// CHECK: test_vmovl_high_u16
+ return vmovl_high_u16(a);
+// CHECK: ushll2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, #0
+}
+
+uint64x2_t test_vmovl_high_u32(uint32x4_t a) {
+// CHECK: test_vmovl_high_u32
+ return vmovl_high_u32(a);
+// CHECK: ushll2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, #0
+}
+
+float32x2_t test_vcvt_n_f32_s32(int32x2_t a) {
+ // CHECK: test_vcvt_n_f32_s32
+ return vcvt_n_f32_s32(a, 31);
+ // CHECK: scvtf {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #31
+}
+
+float32x4_t test_vcvtq_n_f32_s32(int32x4_t a) {
+ // CHECK: test_vcvtq_n_f32_s32
+ return vcvtq_n_f32_s32(a, 31);
+ // CHECK: scvtf {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #31
+}
+
+float64x2_t test_vcvtq_n_f64_s64(int64x2_t a) {
+ // CHECK: test_vcvtq_n_f64_s64
+ return vcvtq_n_f64_s64(a, 50);
+ // CHECK: scvtf {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #50
+}
+
+float32x2_t test_vcvt_n_f32_u32(uint32x2_t a) {
+ // CHECK: test_vcvt_n_f32_u32
+ return vcvt_n_f32_u32(a, 31);
+ // CHECK: ucvtf {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #31
+}
+
+float32x4_t test_vcvtq_n_f32_u32(uint32x4_t a) {
+ // CHECK: test_vcvtq_n_f32_u32
+ return vcvtq_n_f32_u32(a, 31);
+ // CHECK: ucvtf {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #31
+}
+
+float64x2_t test_vcvtq_n_f64_u64(uint64x2_t a) {
+ // CHECK: test_vcvtq_n_f64_u64
+ return vcvtq_n_f64_u64(a, 50);
+ // CHECK: ucvtf {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #50
+}
+
+int32x2_t test_vcvt_n_s32_f32(float32x2_t a) {
+ // CHECK: test_vcvt_n_s32_f32
+ return vcvt_n_s32_f32(a, 31);
+ // CHECK: fcvtzs {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #31
+}
+
+int32x4_t test_vcvtq_n_s32_f32(float32x4_t a) {
+ // CHECK: test_vcvtq_n_s32_f32
+ return vcvtq_n_s32_f32(a, 31);
+ // CHECK: fcvtzs {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #31
+}
+
+int64x2_t test_vcvtq_n_s64_f64(float64x2_t a) {
+ // CHECK: test_vcvtq_n_s64_f64
+ return vcvtq_n_s64_f64(a, 50);
+ // CHECK: fcvtzs {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #50
+}
+
+uint32x2_t test_vcvt_n_u32_f32(float32x2_t a) {
+ // CHECK: test_vcvt_n_u32_f32
+ return vcvt_n_u32_f32(a, 31);
+ // CHECK: fcvtzu {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #31
+}
+
+uint32x4_t test_vcvtq_n_u32_f32(float32x4_t a) {
+ // CHECK: test_vcvt_n_u32_f32
+ return vcvtq_n_u32_f32(a, 31);
+ // CHECK: fcvtzu {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #31
+}
+
+uint64x2_t test_vcvtq_n_u64_f64(float64x2_t a) {
+ // CHECK: test_vcvtq_n_u64_f64
+ return vcvtq_n_u64_f64(a, 50);
+ // CHECK: fcvtzu {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #50
+}
+
+int16x8_t test_vaddl_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vaddl_s8
+ return vaddl_s8(a, b);
+ // CHECK: saddl {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+
+int32x4_t test_vaddl_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vaddl_s16
+ return vaddl_s16(a, b);
+ // CHECK: saddl {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+
+int64x2_t test_vaddl_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vaddl_s32
+ return vaddl_s32(a, b);
+ // CHECK: saddl {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+uint16x8_t test_vaddl_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vaddl_u8
+ return vaddl_u8(a, b);
+ // CHECK: uaddl {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+
+uint32x4_t test_vaddl_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vaddl_u16
+ return vaddl_u16(a, b);
+ // CHECK: uaddl {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+
+uint64x2_t test_vaddl_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vaddl_u32
+ return vaddl_u32(a, b);
+ // CHECK: uaddl {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+int16x8_t test_vaddl_high_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vaddl_high_s8
+ return vaddl_high_s8(a, b);
+ // CHECK: saddl2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+
+int32x4_t test_vaddl_high_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vaddl_high_s16
+ return vaddl_high_s16(a, b);
+ // CHECK: saddl2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int64x2_t test_vaddl_high_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vaddl_high_s32
+ return vaddl_high_s32(a, b);
+ // CHECK: saddl2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+uint16x8_t test_vaddl_high_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vaddl_high_u8
+ return vaddl_high_u8(a, b);
+ // CHECK: uaddl2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+
+uint32x4_t test_vaddl_high_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vaddl_high_u16
+ return vaddl_high_u16(a, b);
+ // CHECK: uaddl2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+uint64x2_t test_vaddl_high_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vaddl_high_u32
+ return vaddl_high_u32(a, b);
+ // CHECK: uaddl2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int16x8_t test_vaddw_s8(int16x8_t a, int8x8_t b) {
+ // CHECK: test_vaddw_s8
+ return vaddw_s8(a, b);
+ // CHECK: saddw {{v[0-31]+}}.8h, {{v[0-31]+}}.8h, {{v[0-31]+}}.8b
+}
+
+int32x4_t test_vaddw_s16(int32x4_t a, int16x4_t b) {
+ // CHECK: test_vaddw_s16
+ return vaddw_s16(a, b);
+ // CHECK: saddw {{v[0-31]+}}.4s, {{v[0-31]+}}.4s, {{v[0-31]+}}.4h
+}
+
+int64x2_t test_vaddw_s32(int64x2_t a, int32x2_t b) {
+ // CHECK: test_vaddw_s32
+ return vaddw_s32(a, b);
+ // CHECK: saddw {{v[0-31]+}}.2d, {{v[0-31]+}}.2d, {{v[0-31]+}}.2s
+}
+
+uint16x8_t test_vaddw_u8(uint16x8_t a, uint8x8_t b) {
+ // CHECK: test_vaddw_u8
+ return vaddw_u8(a, b);
+ // CHECK: uaddw {{v[0-31]+}}.8h, {{v[0-31]+}}.8h, {{v[0-31]+}}.8b
+}
+
+uint32x4_t test_vaddw_u16(uint32x4_t a, uint16x4_t b) {
+ // CHECK: test_vaddw_u16
+ return vaddw_u16(a, b);
+ // CHECK: uaddw {{v[0-31]+}}.4s, {{v[0-31]+}}.4s, {{v[0-31]+}}.4h
+}
+
+uint64x2_t test_vaddw_u32(uint64x2_t a, uint32x2_t b) {
+ // CHECK: test_vaddw_u32
+ return vaddw_u32(a, b);
+ // CHECK: uaddw {{v[0-31]+}}.2d, {{v[0-31]+}}.2d, {{v[0-31]+}}.2s
+}
+
+int16x8_t test_vaddw_high_s8(int16x8_t a, int8x16_t b) {
+ // CHECK: test_vaddw_high_s8
+ return vaddw_high_s8(a, b);
+ // CHECK: saddw2 {{v[0-31]+}}.8h, {{v[0-31]+}}.8h, {{v[0-31]+}}.16b
+}
+
+int32x4_t test_vaddw_high_s16(int32x4_t a, int16x8_t b) {
+ // CHECK: test_vaddw_high_s16
+ return vaddw_high_s16(a, b);
+ // CHECK: saddw2 {{v[0-31]+}}.4s, {{v[0-31]+}}.4s, {{v[0-31]+}}.8h
+}
+
+int64x2_t test_vaddw_high_s32(int64x2_t a, int32x4_t b) {
+ // CHECK: test_vaddw_high_s32
+ return vaddw_high_s32(a, b);
+ // CHECK: saddw2 {{v[0-31]+}}.2d, {{v[0-31]+}}.2d, {{v[0-31]+}}.4s
+}
+
+uint16x8_t test_vaddw_high_u8(uint16x8_t a, uint8x16_t b) {
+ // CHECK: test_vaddw_high_u8
+ return vaddw_high_u8(a, b);
+ // CHECK: uaddw2 {{v[0-31]+}}.8h, {{v[0-31]+}}.8h, {{v[0-31]+}}.16b
+}
+
+uint32x4_t test_vaddw_high_u16(uint32x4_t a, uint16x8_t b) {
+ // CHECK: test_vaddw_high_u16
+ return vaddw_high_u16(a, b);
+ // CHECK: uaddw2 {{v[0-31]+}}.4s, {{v[0-31]+}}.4s, {{v[0-31]+}}.8h
+}
+
+uint64x2_t test_vaddw_high_u32(uint64x2_t a, uint32x4_t b) {
+ // CHECK: test_vaddw_high_u32
+ return vaddw_high_u32(a, b);
+ // CHECK: uaddw2 {{v[0-31]+}}.2d, {{v[0-31]+}}.2d, {{v[0-31]+}}.4s
+}
+
+int16x8_t test_vsubl_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vsubl_s8
+ return vsubl_s8(a, b);
+ // CHECK: ssubl {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+
+int32x4_t test_vsubl_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vsubl_s16
+ return vsubl_s16(a, b);
+ // CHECK: ssubl {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+
+int64x2_t test_vsubl_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vsubl_s32
+ return vsubl_s32(a, b);
+ // CHECK: ssubl {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+uint16x8_t test_vsubl_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vsubl_u8
+ return vsubl_u8(a, b);
+ // CHECK: usubl {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+
+uint32x4_t test_vsubl_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vsubl_u16
+ return vsubl_u16(a, b);
+ // CHECK: usubl {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+
+uint64x2_t test_vsubl_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vsubl_u32
+ return vsubl_u32(a, b);
+ // CHECK: usubl {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+int16x8_t test_vsubl_high_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vsubl_high_s8
+ return vsubl_high_s8(a, b);
+ // CHECK: ssubl2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+
+int32x4_t test_vsubl_high_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vsubl_high_s16
+ return vsubl_high_s16(a, b);
+ // CHECK: ssubl2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int64x2_t test_vsubl_high_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vsubl_high_s32
+ return vsubl_high_s32(a, b);
+ // CHECK: ssubl2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+uint16x8_t test_vsubl_high_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vsubl_high_u8
+ return vsubl_high_u8(a, b);
+ // CHECK: usubl2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+
+uint32x4_t test_vsubl_high_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vsubl_high_u16
+ return vsubl_high_u16(a, b);
+ // CHECK: usubl2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+uint64x2_t test_vsubl_high_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vsubl_high_u32
+ return vsubl_high_u32(a, b);
+ // CHECK: usubl2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int16x8_t test_vsubw_s8(int16x8_t a, int8x8_t b) {
+ // CHECK: test_vsubw_s8
+ return vsubw_s8(a, b);
+ // CHECK: ssubw {{v[0-31]+}}.8h, {{v[0-31]+}}.8h, {{v[0-31]+}}.8b
+}
+
+int32x4_t test_vsubw_s16(int32x4_t a, int16x4_t b) {
+ // CHECK: test_vsubw_s16
+ return vsubw_s16(a, b);
+ // CHECK: ssubw {{v[0-31]+}}.4s, {{v[0-31]+}}.4s, {{v[0-31]+}}.4h
+}
+
+int64x2_t test_vsubw_s32(int64x2_t a, int32x2_t b) {
+ // CHECK: test_vsubw_s32
+ return vsubw_s32(a, b);
+ // CHECK: ssubw {{v[0-31]+}}.2d, {{v[0-31]+}}.2d, {{v[0-31]+}}.2s
+}
+
+uint16x8_t test_vsubw_u8(uint16x8_t a, uint8x8_t b) {
+ // CHECK: test_vsubw_u8
+ return vsubw_u8(a, b);
+ // CHECK: usubw {{v[0-31]+}}.8h, {{v[0-31]+}}.8h, {{v[0-31]+}}.8b
+}
+
+uint32x4_t test_vsubw_u16(uint32x4_t a, uint16x4_t b) {
+ // CHECK: test_vsubw_u16
+ return vsubw_u16(a, b);
+ // CHECK: usubw {{v[0-31]+}}.4s, {{v[0-31]+}}.4s, {{v[0-31]+}}.4h
+}
+
+uint64x2_t test_vsubw_u32(uint64x2_t a, uint32x2_t b) {
+ // CHECK: test_vsubw_u32
+ return vsubw_u32(a, b);
+ // CHECK: usubw {{v[0-31]+}}.2d, {{v[0-31]+}}.2d, {{v[0-31]+}}.2s
+}
+
+int16x8_t test_vsubw_high_s8(int16x8_t a, int8x16_t b) {
+ // CHECK: test_vsubw_high_s8
+ return vsubw_high_s8(a, b);
+ // CHECK: ssubw2 {{v[0-31]+}}.8h, {{v[0-31]+}}.8h, {{v[0-31]+}}.16b
+}
+
+int32x4_t test_vsubw_high_s16(int32x4_t a, int16x8_t b) {
+ // CHECK: test_vsubw_high_s16
+ return vsubw_high_s16(a, b);
+ // CHECK: ssubw2 {{v[0-31]+}}.4s, {{v[0-31]+}}.4s, {{v[0-31]+}}.8h
+}
+
+int64x2_t test_vsubw_high_s32(int64x2_t a, int32x4_t b) {
+ // CHECK: test_vsubw_high_s32
+ return vsubw_high_s32(a, b);
+ // CHECK: ssubw2 {{v[0-31]+}}.2d, {{v[0-31]+}}.2d, {{v[0-31]+}}.4s
+}
+
+uint16x8_t test_vsubw_high_u8(uint16x8_t a, uint8x16_t b) {
+ // CHECK: test_vsubw_high_u8
+ return vsubw_high_u8(a, b);
+ // CHECK: usubw2 {{v[0-31]+}}.8h, {{v[0-31]+}}.8h, {{v[0-31]+}}.16b
+}
+
+uint32x4_t test_vsubw_high_u16(uint32x4_t a, uint16x8_t b) {
+ // CHECK: test_vsubw_high_u16
+ return vsubw_high_u16(a, b);
+ // CHECK: usubw2 {{v[0-31]+}}.4s, {{v[0-31]+}}.4s, {{v[0-31]+}}.8h
+}
+
+uint64x2_t test_vsubw_high_u32(uint64x2_t a, uint32x4_t b) {
+ // CHECK: test_vsubw_high_u32
+ return vsubw_high_u32(a, b);
+ // CHECK: usubw2 {{v[0-31]+}}.2d, {{v[0-31]+}}.2d, {{v[0-31]+}}.4s
+}
+
+int8x8_t test_vaddhn_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vaddhn_s16
+ return vaddhn_s16(a, b);
+ // CHECK: addhn {{v[0-31]+}}.8b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int16x4_t test_vaddhn_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vaddhn_s32
+ return vaddhn_s32(a, b);
+ // CHECK: addhn {{v[0-31]+}}.4h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x2_t test_vaddhn_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vaddhn_s64
+ return vaddhn_s64(a, b);
+ // CHECK: addhn {{v[0-31]+}}.2s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+uint8x8_t test_vaddhn_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vaddhn_u16
+ return vaddhn_u16(a, b);
+ // CHECK: addhn {{v[0-31]+}}.8b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+uint16x4_t test_vaddhn_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vaddhn_u32
+ return vaddhn_u32(a, b);
+ // CHECK: addhn {{v[0-31]+}}.4h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+uint32x2_t test_vaddhn_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vaddhn_u64
+ return vaddhn_u64(a, b);
+ // CHECK: addhn {{v[0-31]+}}.2s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+int8x16_t test_vaddhn_high_s16(int8x8_t r, int16x8_t a, int16x8_t b) {
+ // CHECK: test_vaddhn_high_s16
+ return vaddhn_high_s16(r, a, b);
+ // CHECK: addhn2 {{v[0-31]+}}.16b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int16x8_t test_vaddhn_high_s32(int16x4_t r, int32x4_t a, int32x4_t b) {
+ // CHECK: test_vaddhn_high_s32
+ return vaddhn_high_s32(r, a, b);
+ // CHECK: addhn2 {{v[0-31]+}}.8h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x4_t test_vaddhn_high_s64(int32x2_t r, int64x2_t a, int64x2_t b) {
+ // CHECK: test_vaddhn_high_s64
+ return vaddhn_high_s64(r, a, b);
+ // CHECK: addhn2 {{v[0-31]+}}.4s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+uint8x16_t test_vaddhn_high_u16(uint8x8_t r, uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vaddhn_high_u16
+ return vaddhn_high_u16(r, a, b);
+ // CHECK: addhn2 {{v[0-31]+}}.16b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+uint16x8_t test_vaddhn_high_u32(uint16x4_t r, uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vaddhn_high_u32
+ return vaddhn_high_u32(r, a, b);
+ // CHECK: addhn2 {{v[0-31]+}}.8h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+uint32x4_t test_vaddhn_high_u64(uint32x2_t r, uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vaddhn_high_u64
+ return vaddhn_high_u64(r, a, b);
+ // CHECK: addhn2 {{v[0-31]+}}.4s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+int8x8_t test_vraddhn_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vraddhn_s16
+ return vraddhn_s16(a, b);
+ // CHECK: raddhn {{v[0-31]+}}.8b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int16x4_t test_vraddhn_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vraddhn_s32
+ return vraddhn_s32(a, b);
+ // CHECK: raddhn {{v[0-31]+}}.4h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x2_t test_vraddhn_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vraddhn_s64
+ return vraddhn_s64(a, b);
+ // CHECK: raddhn {{v[0-31]+}}.2s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+uint8x8_t test_vraddhn_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vraddhn_u16
+ return vraddhn_u16(a, b);
+ // CHECK: raddhn {{v[0-31]+}}.8b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+uint16x4_t test_vraddhn_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vraddhn_u32
+ return vraddhn_u32(a, b);
+ // CHECK: raddhn {{v[0-31]+}}.4h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+uint32x2_t test_vraddhn_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vraddhn_u64
+ return vraddhn_u64(a, b);
+ // CHECK: raddhn {{v[0-31]+}}.2s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+int8x16_t test_vraddhn_high_s16(int8x8_t r, int16x8_t a, int16x8_t b) {
+ // CHECK: test_vraddhn_high_s16
+ return vraddhn_high_s16(r, a, b);
+ // CHECK: raddhn2 {{v[0-31]+}}.16b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int16x8_t test_vraddhn_high_s32(int16x4_t r, int32x4_t a, int32x4_t b) {
+ // CHECK: test_vraddhn_high_s32
+ return vraddhn_high_s32(r, a, b);
+ // CHECK: raddhn2 {{v[0-31]+}}.8h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x4_t test_vraddhn_high_s64(int32x2_t r, int64x2_t a, int64x2_t b) {
+ // CHECK: test_vraddhn_high_s64
+ return vraddhn_high_s64(r, a, b);
+ // CHECK: raddhn2 {{v[0-31]+}}.4s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+uint8x16_t test_vraddhn_high_u16(uint8x8_t r, uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vraddhn_high_u16
+ return vraddhn_high_u16(r, a, b);
+ // CHECK: raddhn2 {{v[0-31]+}}.16b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+uint16x8_t test_vraddhn_high_u32(uint16x4_t r, uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vraddhn_high_u32
+ return vraddhn_high_u32(r, a, b);
+ // CHECK: raddhn2 {{v[0-31]+}}.8h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+uint32x4_t test_vraddhn_high_u64(uint32x2_t r, uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vraddhn_high_u64
+ return vraddhn_high_u64(r, a, b);
+ // CHECK: raddhn2 {{v[0-31]+}}.4s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+int8x8_t test_vsubhn_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vsubhn_s16
+ return vsubhn_s16(a, b);
+ // CHECK: subhn {{v[0-31]+}}.8b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int16x4_t test_vsubhn_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vsubhn_s32
+ return vsubhn_s32(a, b);
+ // CHECK: subhn {{v[0-31]+}}.4h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x2_t test_vsubhn_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vsubhn_s64
+ return vsubhn_s64(a, b);
+ // CHECK: subhn {{v[0-31]+}}.2s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+uint8x8_t test_vsubhn_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vsubhn_u16
+ return vsubhn_u16(a, b);
+ // CHECK: subhn {{v[0-31]+}}.8b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+uint16x4_t test_vsubhn_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vsubhn_u32
+ return vsubhn_u32(a, b);
+ // CHECK: subhn {{v[0-31]+}}.4h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+uint32x2_t test_vsubhn_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vsubhn_u64
+ return vsubhn_u64(a, b);
+ // CHECK: subhn {{v[0-31]+}}.2s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+int8x16_t test_vsubhn_high_s16(int8x8_t r, int16x8_t a, int16x8_t b) {
+ // CHECK: test_vsubhn_high_s16
+ return vsubhn_high_s16(r, a, b);
+ // CHECK: subhn2 {{v[0-31]+}}.16b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int16x8_t test_vsubhn_high_s32(int16x4_t r, int32x4_t a, int32x4_t b) {
+ // CHECK: test_vsubhn_high_s32
+ return vsubhn_high_s32(r, a, b);
+ // CHECK: subhn2 {{v[0-31]+}}.8h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x4_t test_vsubhn_high_s64(int32x2_t r, int64x2_t a, int64x2_t b) {
+ // CHECK: test_vsubhn_high_s64
+ return vsubhn_high_s64(r, a, b);
+ // CHECK: subhn2 {{v[0-31]+}}.4s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+uint8x16_t test_vsubhn_high_u16(uint8x8_t r, uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vsubhn_high_u16
+ return vsubhn_high_u16(r, a, b);
+ // CHECK: subhn2 {{v[0-31]+}}.16b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+uint16x8_t test_vsubhn_high_u32(uint16x4_t r, uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vsubhn_high_u32
+ return vsubhn_high_u32(r, a, b);
+ // CHECK: subhn2 {{v[0-31]+}}.8h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+uint32x4_t test_vsubhn_high_u64(uint32x2_t r, uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vsubhn_high_u64
+ return vsubhn_high_u64(r, a, b);
+ // CHECK: subhn2 {{v[0-31]+}}.4s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+int8x8_t test_vrsubhn_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vrsubhn_s16
+ return vrsubhn_s16(a, b);
+ // CHECK: rsubhn {{v[0-31]+}}.8b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int16x4_t test_vrsubhn_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vrsubhn_s32
+ return vrsubhn_s32(a, b);
+ // CHECK: rsubhn {{v[0-31]+}}.4h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x2_t test_vrsubhn_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vrsubhn_s64
+ return vrsubhn_s64(a, b);
+ // CHECK: rsubhn {{v[0-31]+}}.2s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+uint8x8_t test_vrsubhn_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vrsubhn_u16
+ return vrsubhn_u16(a, b);
+ // CHECK: rsubhn {{v[0-31]+}}.8b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+uint16x4_t test_vrsubhn_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vrsubhn_u32
+ return vrsubhn_u32(a, b);
+ // CHECK: rsubhn {{v[0-31]+}}.4h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+uint32x2_t test_vrsubhn_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vrsubhn_u64
+ return vrsubhn_u64(a, b);
+ // CHECK: rsubhn {{v[0-31]+}}.2s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+int8x16_t test_vrsubhn_high_s16(int8x8_t r, int16x8_t a, int16x8_t b) {
+ // CHECK: test_vrsubhn_high_s16
+ return vrsubhn_high_s16(r, a, b);
+ // CHECK: rsubhn2 {{v[0-31]+}}.16b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int16x8_t test_vrsubhn_high_s32(int16x4_t r, int32x4_t a, int32x4_t b) {
+ // CHECK: test_vrsubhn_high_s32
+ return vrsubhn_high_s32(r, a, b);
+ // CHECK: rsubhn2 {{v[0-31]+}}.8h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x4_t test_vrsubhn_high_s64(int32x2_t r, int64x2_t a, int64x2_t b) {
+ // CHECK: test_vrsubhn_high_s64
+ return vrsubhn_high_s64(r, a, b);
+ // CHECK: rsubhn2 {{v[0-31]+}}.4s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+uint8x16_t test_vrsubhn_high_u16(uint8x8_t r, uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vrsubhn_high_u16
+ return vrsubhn_high_u16(r, a, b);
+ // CHECK: rsubhn2 {{v[0-31]+}}.16b, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+uint16x8_t test_vrsubhn_high_u32(uint16x4_t r, uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vrsubhn_high_u32
+ return vrsubhn_high_u32(r, a, b);
+ // CHECK: rsubhn2 {{v[0-31]+}}.8h, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+uint32x4_t test_vrsubhn_high_u64(uint32x2_t r, uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vrsubhn_high_u64
+ return vrsubhn_high_u64(r, a, b);
+ // CHECK: rsubhn2 {{v[0-31]+}}.4s, {{v[0-31]+}}.2d, {{v[0-31]+}}.2d
+}
+
+int16x8_t test_vabdl_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vabdl_s8
+ return vabdl_s8(a, b);
+ // CHECK: sabdl {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+int32x4_t test_vabdl_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vabdl_s16
+ return vabdl_s16(a, b);
+ // CHECK: sabdl {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+int64x2_t test_vabdl_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vabdl_s32
+ return vabdl_s32(a, b);
+ // CHECK: sabdl {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+uint16x8_t test_vabdl_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vabdl_u8
+ return vabdl_u8(a, b);
+ // CHECK: uabdl {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+uint32x4_t test_vabdl_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vabdl_u16
+ return vabdl_u16(a, b);
+ // CHECK: uabdl {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+uint64x2_t test_vabdl_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vabdl_u32
+ return vabdl_u32(a, b);
+ // CHECK: uabdl {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+int16x8_t test_vabal_s8(int16x8_t a, int8x8_t b, int8x8_t c) {
+ // CHECK: test_vabal_s8
+ return vabal_s8(a, b, c);
+ // CHECK: sabal {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+int32x4_t test_vabal_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ // CHECK: test_vabal_s16
+ return vabal_s16(a, b, c);
+ // CHECK: sabal {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+int64x2_t test_vabal_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ // CHECK: test_vabal_s32
+ return vabal_s32(a, b, c);
+ // CHECK: sabal {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+uint16x8_t test_vabal_u8(uint16x8_t a, uint8x8_t b, uint8x8_t c) {
+ // CHECK: test_vabal_u8
+ return vabal_u8(a, b, c);
+ // CHECK: uabal {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+uint32x4_t test_vabal_u16(uint32x4_t a, uint16x4_t b, uint16x4_t c) {
+ // CHECK: test_vabal_u16
+ return vabal_u16(a, b, c);
+ // CHECK: uabal {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+uint64x2_t test_vabal_u32(uint64x2_t a, uint32x2_t b, uint32x2_t c) {
+ // CHECK: test_vabal_u32
+ return vabal_u32(a, b, c);
+ // CHECK: uabal {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+int16x8_t test_vabdl_high_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vabdl_high_s8
+ return vabdl_high_s8(a, b);
+ // CHECK: sabdl2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+int32x4_t test_vabdl_high_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vabdl_high_s16
+ return vabdl_high_s16(a, b);
+ // CHECK: sabdl2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+int64x2_t test_vabdl_high_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vabdl_high_s32
+ return vabdl_high_s32(a, b);
+ // CHECK: sabdl2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+uint16x8_t test_vabdl_high_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vabdl_high_u8
+ return vabdl_high_u8(a, b);
+ // CHECK: uabdl2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+uint32x4_t test_vabdl_high_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vabdl_high_u16
+ return vabdl_high_u16(a, b);
+ // CHECK: uabdl2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+uint64x2_t test_vabdl_high_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vabdl_high_u32
+ return vabdl_high_u32(a, b);
+ // CHECK: uabdl2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int16x8_t test_vabal_high_s8(int16x8_t a, int8x16_t b, int8x16_t c) {
+ // CHECK: test_vabal_high_s8
+ return vabal_high_s8(a, b, c);
+ // CHECK: sabal2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+int32x4_t test_vabal_high_s16(int32x4_t a, int16x8_t b, int16x8_t c) {
+ // CHECK: test_vabal_high_s16
+ return vabal_high_s16(a, b, c);
+ // CHECK: sabal2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+int64x2_t test_vabal_high_s32(int64x2_t a, int32x4_t b, int32x4_t c) {
+ // CHECK: test_vabal_high_s32
+ return vabal_high_s32(a, b, c);
+ // CHECK: sabal2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+uint16x8_t test_vabal_high_u8(uint16x8_t a, uint8x16_t b, uint8x16_t c) {
+ // CHECK: test_vabal_high_u8
+ return vabal_high_u8(a, b, c);
+ // CHECK: uabal2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+uint32x4_t test_vabal_high_u16(uint32x4_t a, uint16x8_t b, uint16x8_t c) {
+ // CHECK: test_vabal_high_u16
+ return vabal_high_u16(a, b, c);
+ // CHECK: uabal2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+uint64x2_t test_vabal_high_u32(uint64x2_t a, uint32x4_t b, uint32x4_t c) {
+ // CHECK: test_vabal_high_u32
+ return vabal_high_u32(a, b, c);
+ // CHECK: uabal2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int16x8_t test_vmull_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vmull_s8
+ return vmull_s8(a, b);
+ // CHECK: smull {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+int32x4_t test_vmull_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vmull_s16
+ return vmull_s16(a, b);
+ // CHECK: smull {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+int64x2_t test_vmull_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vmull_s32
+ return vmull_s32(a, b);
+ // CHECK: smull {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+uint16x8_t test_vmull_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vmull_u8
+ return vmull_u8(a, b);
+ // CHECK: umull {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+uint32x4_t test_vmull_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vmull_u16
+ return vmull_u16(a, b);
+ // CHECK: umull {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+uint64x2_t test_vmull_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vmull_u32
+ return vmull_u32(a, b);
+ // CHECK: umull {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+int16x8_t test_vmull_high_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vmull_high_s8
+ return vmull_high_s8(a, b);
+ // CHECK: smull2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+int32x4_t test_vmull_high_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vmull_high_s16
+ return vmull_high_s16(a, b);
+ // CHECK: smull2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+int64x2_t test_vmull_high_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vmull_high_s32
+ return vmull_high_s32(a, b);
+ // CHECK: smull2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+uint16x8_t test_vmull_high_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vmull_high_u8
+ return vmull_high_u8(a, b);
+ // CHECK: umull2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+uint32x4_t test_vmull_high_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vmull_high_u16
+ return vmull_high_u16(a, b);
+ // CHECK: umull2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+uint64x2_t test_vmull_high_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vmull_high_u32
+ return vmull_high_u32(a, b);
+ // CHECK: umull2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int16x8_t test_vmlal_s8(int16x8_t a, int8x8_t b, int8x8_t c) {
+ // CHECK: test_vmlal_s8
+ return vmlal_s8(a, b, c);
+ // CHECK: smlal {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+int32x4_t test_vmlal_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ // CHECK: test_vmlal_s16
+ return vmlal_s16(a, b, c);
+ // CHECK: smlal {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+int64x2_t test_vmlal_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ // CHECK: test_vmlal_s32
+ return vmlal_s32(a, b, c);
+ // CHECK: smlal {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+uint16x8_t test_vmlal_u8(uint16x8_t a, uint8x8_t b, uint8x8_t c) {
+ // CHECK: test_vmlal_u8
+ return vmlal_u8(a, b, c);
+ // CHECK: umlal {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+uint32x4_t test_vmlal_u16(uint32x4_t a, uint16x4_t b, uint16x4_t c) {
+ // CHECK: test_vmlal_u16
+ return vmlal_u16(a, b, c);
+ // CHECK: umlal {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+uint64x2_t test_vmlal_u32(uint64x2_t a, uint32x2_t b, uint32x2_t c) {
+ // CHECK: test_vmlal_u32
+ return vmlal_u32(a, b, c);
+ // CHECK: umlal {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+int16x8_t test_vmlal_high_s8(int16x8_t a, int8x16_t b, int8x16_t c) {
+ // CHECK: test_vmlal_high_s8
+ return vmlal_high_s8(a, b, c);
+ // CHECK: smlal2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+int32x4_t test_vmlal_high_s16(int32x4_t a, int16x8_t b, int16x8_t c) {
+ // CHECK: test_vmlal_high_s16
+ return vmlal_high_s16(a, b, c);
+ // CHECK: smlal2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+int64x2_t test_vmlal_high_s32(int64x2_t a, int32x4_t b, int32x4_t c) {
+ // CHECK: test_vmlal_high_s32
+ return vmlal_high_s32(a, b, c);
+ // CHECK: smlal2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+uint16x8_t test_vmlal_high_u8(uint16x8_t a, uint8x16_t b, uint8x16_t c) {
+ // CHECK: test_vmlal_high_u8
+ return vmlal_high_u8(a, b, c);
+ // CHECK: umlal2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+uint32x4_t test_vmlal_high_u16(uint32x4_t a, uint16x8_t b, uint16x8_t c) {
+ // CHECK: test_vmlal_high_u16
+ return vmlal_high_u16(a, b, c);
+ // CHECK: umlal2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+uint64x2_t test_vmlal_high_u32(uint64x2_t a, uint32x4_t b, uint32x4_t c) {
+ // CHECK: test_vmlal_high_u32
+ return vmlal_high_u32(a, b, c);
+ // CHECK: umlal2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int16x8_t test_vmlsl_s8(int16x8_t a, int8x8_t b, int8x8_t c) {
+ // CHECK: test_vmlsl_s8
+ return vmlsl_s8(a, b, c);
+ // CHECK: smlsl {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+int32x4_t test_vmlsl_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ // CHECK: test_vmlsl_s16
+ return vmlsl_s16(a, b, c);
+ // CHECK: smlsl {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+int64x2_t test_vmlsl_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ // CHECK: test_vmlsl_s32
+ return vmlsl_s32(a, b, c);
+ // CHECK: smlsl {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+uint16x8_t test_vmlsl_u8(uint16x8_t a, uint8x8_t b, uint8x8_t c) {
+ // CHECK: test_vmlsl_u8
+ return vmlsl_u8(a, b, c);
+ // CHECK: umlsl {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+uint32x4_t test_vmlsl_u16(uint32x4_t a, uint16x4_t b, uint16x4_t c) {
+ // CHECK: test_vmlsl_u16
+ return vmlsl_u16(a, b, c);
+ // CHECK: umlsl {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+uint64x2_t test_vmlsl_u32(uint64x2_t a, uint32x2_t b, uint32x2_t c) {
+ // CHECK: test_vmlsl_u32
+ return vmlsl_u32(a, b, c);
+ // CHECK: umlsl {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+int16x8_t test_vmlsl_high_s8(int16x8_t a, int8x16_t b, int8x16_t c) {
+ // CHECK: test_vmlsl_high_s8
+ return vmlsl_high_s8(a, b, c);
+ // CHECK: smlsl2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+int32x4_t test_vmlsl_high_s16(int32x4_t a, int16x8_t b, int16x8_t c) {
+ // CHECK: test_vmlsl_high_s16
+ return vmlsl_high_s16(a, b, c);
+ // CHECK: smlsl2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+int64x2_t test_vmlsl_high_s32(int64x2_t a, int32x4_t b, int32x4_t c) {
+ // CHECK: test_vmlsl_high_s32
+ return vmlsl_high_s32(a, b, c);
+ // CHECK: smlsl2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+uint16x8_t test_vmlsl_high_u8(uint16x8_t a, uint8x16_t b, uint8x16_t c) {
+ // CHECK: test_vmlsl_high_u8
+ return vmlsl_high_u8(a, b, c);
+ // CHECK: umlsl2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+uint32x4_t test_vmlsl_high_u16(uint32x4_t a, uint16x8_t b, uint16x8_t c) {
+ // CHECK: test_vmlsl_high_u16
+ return vmlsl_high_u16(a, b, c);
+ // CHECK: umlsl2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+uint64x2_t test_vmlsl_high_u32(uint64x2_t a, uint32x4_t b, uint32x4_t c) {
+ // CHECK: test_vmlsl_high_u32
+ return vmlsl_high_u32(a, b, c);
+ // CHECK: umlsl2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x4_t test_vqdmull_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vqdmull_s16
+ return vqdmull_s16(a, b);
+ // CHECK: sqdmull {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+int64x2_t test_vqdmull_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vqdmull_s32
+ return vqdmull_s32(a, b);
+ // CHECK: sqdmull {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+int32x4_t test_vqdmlal_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ // CHECK: test_vqdmlal_s16
+ return vqdmlal_s16(a, b, c);
+ // CHECK: sqdmlal {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+
+int64x2_t test_vqdmlal_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ // CHECK: test_vqdmlal_s32
+ return vqdmlal_s32(a, b, c);
+ // CHECK: sqdmlal {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+int32x4_t test_vqdmlsl_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ // CHECK: test_vqdmlsl_s16
+ return vqdmlsl_s16(a, b, c);
+ // CHECK: sqdmlsl {{v[0-31]+}}.4s, {{v[0-31]+}}.4h, {{v[0-31]+}}.4h
+}
+
+int64x2_t test_vqdmlsl_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ // CHECK: test_vqdmlsl_s32
+ return vqdmlsl_s32(a, b, c);
+ // CHECK: sqdmlsl {{v[0-31]+}}.2d, {{v[0-31]+}}.2s, {{v[0-31]+}}.2s
+}
+
+int32x4_t test_vqdmull_high_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vqdmull_high_s16
+ return vqdmull_high_s16(a, b);
+ // CHECK: sqdmull2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+int64x2_t test_vqdmull_high_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vqdmull_high_s32
+ return vqdmull_high_s32(a, b);
+ // CHECK: sqdmull2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x4_t test_vqdmlal_high_s16(int32x4_t a, int16x8_t b, int16x8_t c) {
+ // CHECK: test_vqdmlal_high_s16
+ return vqdmlal_high_s16(a, b, c);
+ // CHECK: sqdmlal2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int64x2_t test_vqdmlal_high_s32(int64x2_t a, int32x4_t b, int32x4_t c) {
+ // CHECK: test_vqdmlal_high_s32
+ return vqdmlal_high_s32(a, b, c);
+ // CHECK: sqdmlal2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+int32x4_t test_vqdmlsl_high_s16(int32x4_t a, int16x8_t b, int16x8_t c) {
+ // CHECK: test_vqdmlsl_high_s16
+ return vqdmlsl_high_s16(a, b, c);
+ // CHECK: sqdmlsl2 {{v[0-31]+}}.4s, {{v[0-31]+}}.8h, {{v[0-31]+}}.8h
+}
+
+int64x2_t test_vqdmlsl_high_s32(int64x2_t a, int32x4_t b, int32x4_t c) {
+ // CHECK: test_vqdmlsl_high_s32
+ return vqdmlsl_high_s32(a, b, c);
+ // CHECK: sqdmlsl2 {{v[0-31]+}}.2d, {{v[0-31]+}}.4s, {{v[0-31]+}}.4s
+}
+
+poly16x8_t test_vmull_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vmull_p8
+ return vmull_p8(a, b);
+ // CHECK: pmull {{v[0-31]+}}.8h, {{v[0-31]+}}.8b, {{v[0-31]+}}.8b
+}
+
+poly16x8_t test_vmull_high_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vmull_high_p8
+ return vmull_high_p8(a, b);
+ // CHECK: pmull2 {{v[0-31]+}}.8h, {{v[0-31]+}}.16b, {{v[0-31]+}}.16b
+}
+
+int64_t test_vaddd_s64(int64_t a, int64_t b) {
+// CHECK: test_vaddd_s64
+ return vaddd_s64(a, b);
+// CHECK: add {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint64_t test_vaddd_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vaddd_u64
+ return vaddd_u64(a, b);
+// CHECK: add {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int64_t test_vsubd_s64(int64_t a, int64_t b) {
+// CHECK: test_vsubd_s64
+ return vsubd_s64(a, b);
+// CHECK: sub {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint64_t test_vsubd_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vsubd_u64
+ return vsubd_u64(a, b);
+// CHECK: sub {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int8_t test_vqaddb_s8(int8_t a, int8_t b) {
+// CHECK: test_vqaddb_s8
+ return vqaddb_s8(a, b);
+// CHECK: sqadd {{b[0-9]+}}, {{b[0-9]+}}, {{b[0-9]+}}
+}
+
+int16_t test_vqaddh_s16(int16_t a, int16_t b) {
+// CHECK: test_vqaddh_s16
+ return vqaddh_s16(a, b);
+// CHECK: sqadd {{h[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+}
+
+int32_t test_vqadds_s32(int32_t a, int32_t b) {
+// CHECK: test_vqadds_s32
+ return vqadds_s32(a, b);
+// CHECK: sqadd {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+int64_t test_vqaddd_s64(int64_t a, int64_t b) {
+// CHECK: test_vqaddd_s64
+ return vqaddd_s64(a, b);
+// CHECK: sqadd {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8_t test_vqaddb_u8(uint8_t a, uint8_t b) {
+// CHECK: test_vqaddb_u8
+ return vqaddb_u8(a, b);
+// CHECK: uqadd {{b[0-9]+}}, {{b[0-9]+}}, {{b[0-9]+}}
+}
+
+uint16_t test_vqaddh_u16(uint16_t a, uint16_t b) {
+// CHECK: test_vqaddh_u16
+ return vqaddh_u16(a, b);
+// CHECK: uqadd {{h[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+}
+
+uint32_t test_vqadds_u32(uint32_t a, uint32_t b) {
+// CHECK: test_vqadds_u32
+ return vqadds_u32(a, b);
+// CHECK: uqadd {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+uint64_t test_vqaddd_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vqaddd_u64
+ return vqaddd_u64(a, b);
+// CHECK: uqadd {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int8_t test_vqsubb_s8(int8_t a, int8_t b) {
+// CHECK: test_vqsubb_s8
+ return vqsubb_s8(a, b);
+// CHECK: sqsub {{b[0-9]+}}, {{b[0-9]+}}, {{b[0-9]+}}
+}
+
+int16_t test_vqsubh_s16(int16_t a, int16_t b) {
+// CHECK: test_vqsubh_s16
+ return vqsubh_s16(a, b);
+// CHECK: sqsub {{h[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+}
+
+int32_t test_vqsubs_s32(int32_t a, int32_t b) {
+ // CHECK: test_vqsubs_s32
+ return vqsubs_s32(a, b);
+// CHECK: sqsub {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+int64_t test_vqsubd_s64(int64_t a, int64_t b) {
+// CHECK: test_vqsubd_s64
+ return vqsubd_s64(a, b);
+// CHECK: sqsub {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint8_t test_vqsubb_u8(uint8_t a, uint8_t b) {
+// CHECK: test_vqsubb_u8
+ return vqsubb_u8(a, b);
+// CHECK: uqsub {{b[0-9]+}}, {{b[0-9]+}}, {{b[0-9]+}}
+}
+
+uint16_t test_vqsubh_u16(uint16_t a, uint16_t b) {
+// CHECK: test_vqsubh_u16
+ return vqsubh_u16(a, b);
+// CHECK: uqsub {{h[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+}
+
+uint32_t test_vqsubs_u32(uint32_t a, uint32_t b) {
+// CHECK: test_vqsubs_u32
+ return vqsubs_u32(a, b);
+// CHECK: uqsub {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+uint64_t test_vqsubd_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vqsubd_u64
+ return vqsubd_u64(a, b);
+// CHECK: uqsub {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+int64_t test_vshld_s64(int64_t a, int64_t b) {
+// CHECK: test_vshld_s64
+ return vshld_s64(a, b);
+// CHECK: sshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint64_t test_vshld_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vshld_u64
+ return vshld_u64(a, b);
+// CHECK: ushl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+// CHECK: test_vqshlb_s8
+int8_t test_vqshlb_s8(int8_t a, int8_t b) {
+ return vqshlb_s8(a, b);
+// CHECK: sqshl {{b[0-9]+}}, {{b[0-9]+}}, {{b[0-9]+}}
+}
+
+// CHECK: test_vqshlh_s16
+int16_t test_vqshlh_s16(int16_t a, int16_t b) {
+ return vqshlh_s16(a, b);
+// CHECK: sqshl {{h[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+}
+
+// CHECK: test_vqshls_s32
+int32_t test_vqshls_s32(int32_t a, int32_t b) {
+ return vqshls_s32(a, b);
+// CHECK: sqshl {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+// CHECK: test_vqshld_s64
+int64_t test_vqshld_s64(int64_t a, int64_t b) {
+ return vqshld_s64(a, b);
+// CHECK: sqshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+// CHECK: test_vqshlb_u8
+uint8_t test_vqshlb_u8(uint8_t a, uint8_t b) {
+ return vqshlb_u8(a, b);
+// CHECK: uqshl {{b[0-9]+}}, {{b[0-9]+}}, {{b[0-9]+}}
+}
+
+// CHECK: test_vqshlh_u16
+uint16_t test_vqshlh_u16(uint16_t a, uint16_t b) {
+ return vqshlh_u16(a, b);
+// CHECK: uqshl {{h[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+}
+
+// CHECK: test_vqshls_u32
+uint32_t test_vqshls_u32(uint32_t a, uint32_t b) {
+ return vqshls_u32(a, b);
+// CHECK: uqshl {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+// CHECK: test_vqshld_u64
+uint64_t test_vqshld_u64(uint64_t a, uint64_t b) {
+ return vqshld_u64(a, b);
+// CHECK: uqshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+// CHECK: test_vrshld_s64
+int64_t test_vrshld_s64(int64_t a, int64_t b) {
+ return vrshld_s64(a, b);
+// CHECK: srshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+
+// CHECK: test_vrshld_u64
+uint64_t test_vrshld_u64(uint64_t a, uint64_t b) {
+ return vrshld_u64(a, b);
+// CHECK: urshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+// CHECK: test_vqrshlb_s8
+int8_t test_vqrshlb_s8(int8_t a, int8_t b) {
+ return vqrshlb_s8(a, b);
+// CHECK: sqrshl {{b[0-9]+}}, {{b[0-9]+}}, {{b[0-9]+}}
+}
+
+// CHECK: test_vqrshlh_s16
+int16_t test_vqrshlh_s16(int16_t a, int16_t b) {
+ return vqrshlh_s16(a, b);
+// CHECK: sqrshl {{h[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+}
+
+// CHECK: test_vqrshls_s32
+int32_t test_vqrshls_s32(int32_t a, int32_t b) {
+ return vqrshls_s32(a, b);
+// CHECK: sqrshl {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+// CHECK: test_vqrshld_s64
+int64_t test_vqrshld_s64(int64_t a, int64_t b) {
+ return vqrshld_s64(a, b);
+// CHECK: sqrshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+// CHECK: test_vqrshlb_u8
+uint8_t test_vqrshlb_u8(uint8_t a, uint8_t b) {
+ return vqrshlb_u8(a, b);
+// CHECK: uqrshl {{b[0-9]+}}, {{b[0-9]+}}, {{b[0-9]+}}
+}
+
+// CHECK: test_vqrshlh_u16
+uint16_t test_vqrshlh_u16(uint16_t a, uint16_t b) {
+ return vqrshlh_u16(a, b);
+// CHECK: uqrshl {{h[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+}
+
+// CHECK: test_vqrshls_u32
+uint32_t test_vqrshls_u32(uint32_t a, uint32_t b) {
+ return vqrshls_u32(a, b);
+// CHECK: uqrshl {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+// CHECK: test_vqrshld_u64
+uint64_t test_vqrshld_u64(uint64_t a, uint64_t b) {
+ return vqrshld_u64(a, b);
+// CHECK: uqrshl {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+// CHECK: test_vpaddd_s64
+int64_t test_vpaddd_s64(int64x2_t a) {
+ return vpaddd_s64(a);
+// CHECK: addp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+// CHECK: test_vpadds_f32
+float32_t test_vpadds_f32(float32x2_t a) {
+ return vpadds_f32(a);
+// CHECK: faddp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+// CHECK: test_vpaddd_f64
+float64_t test_vpaddd_f64(float64x2_t a) {
+ return vpaddd_f64(a);
+// CHECK: faddp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+// CHECK: test_vpmaxnms_f32
+float32_t test_vpmaxnms_f32(float32x2_t a) {
+ return vpmaxnms_f32(a);
+// CHECK: fmaxnmp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+// CHECK: test_vpmaxnmqd_f64
+float64_t test_vpmaxnmqd_f64(float64x2_t a) {
+ return vpmaxnmqd_f64(a);
+// CHECK: fmaxnmp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+// CHECK: test_vpmaxs_f32
+float32_t test_vpmaxs_f32(float32x2_t a) {
+ return vpmaxs_f32(a);
+// CHECK: fmaxp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+// CHECK: test_vpmaxqd_f64
+float64_t test_vpmaxqd_f64(float64x2_t a) {
+ return vpmaxqd_f64(a);
+// CHECK: fmaxp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+// CHECK: test_vpminnms_f32
+float32_t test_vpminnms_f32(float32x2_t a) {
+ return vpminnms_f32(a);
+// CHECK: fminnmp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+// CHECK: test_vpminnmqd_f64
+float64_t test_vpminnmqd_f64(float64x2_t a) {
+ return vpminnmqd_f64(a);
+// CHECK: fminnmp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+// CHECK: test_vpmins_f32
+float32_t test_vpmins_f32(float32x2_t a) {
+ return vpmins_f32(a);
+// CHECK: fminp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+// CHECK: test_vpminqd_f64
+float64_t test_vpminqd_f64(float64x2_t a) {
+ return vpminqd_f64(a);
+// CHECK: fminp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+int16_t test_vqdmulhh_s16(int16_t a, int16_t b) {
+// CHECK: test_vqdmulhh_s16
+ return vqdmulhh_s16(a, b);
+// CHECK: sqdmulh {{h[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+}
+
+int32_t test_vqdmulhs_s32(int32_t a, int32_t b) {
+// CHECK: test_vqdmulhs_s32
+ return vqdmulhs_s32(a, b);
+// CHECK: sqdmulh {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+int16_t test_vqrdmulhh_s16(int16_t a, int16_t b) {
+// CHECK: test_vqrdmulhh_s16
+ return vqrdmulhh_s16(a, b);
+// CHECK: sqrdmulh {{h[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+}
+
+int32_t test_vqrdmulhs_s32(int32_t a, int32_t b) {
+// CHECK: test_vqrdmulhs_s32
+ return vqrdmulhs_s32(a, b);
+// CHECK: sqrdmulh {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+float32_t test_vmulxs_f32(float32_t a, float32_t b) {
+// CHECK: test_vmulxs_f32
+ return vmulxs_f32(a, b);
+// CHECK: fmulx {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+float64_t test_vmulxd_f64(float64_t a, float64_t b) {
+// CHECK: test_vmulxd_f64
+ return vmulxd_f64(a, b);
+// CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+float32_t test_vrecpss_f32(float32_t a, float32_t b) {
+// CHECK: test_vrecpss_f32
+ return vrecpss_f32(a, b);
+// CHECK: frecps {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+float64_t test_vrecpsd_f64(float64_t a, float64_t b) {
+// CHECK: test_vrecpsd_f64
+ return vrecpsd_f64(a, b);
+// CHECK: frecps {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+float32_t test_vrsqrtss_f32(float32_t a, float32_t b) {
+// CHECK: test_vrsqrtss_f32
+ return vrsqrtss_f32(a, b);
+// CHECK: frsqrts {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+}
+
+float64_t test_vrsqrtsd_f64(float64_t a, float64_t b) {
+// CHECK: test_vrsqrtsd_f64
+ return vrsqrtsd_f64(a, b);
+// CHECK: frsqrts {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+float32_t test_vcvts_f32_s32(int32_t a) {
+// CHECK: test_vcvts_f32_s32
+// CHECK: scvtf {{s[0-9]+}}, {{s[0-9]+}}
+ return vcvts_f32_s32(a);
+}
+
+float64_t test_vcvtd_f64_s64(int64_t a) {
+// CHECK: test_vcvtd_f64_s64
+// CHECK: scvtf {{d[0-9]+}}, {{d[0-9]+}}
+ return vcvtd_f64_s64(a);
+}
+
+float32_t test_vcvts_f32_u32(uint32_t a) {
+// CHECK: test_vcvts_f32_u32
+// CHECK: ucvtf {{s[0-9]+}}, {{s[0-9]+}}
+ return vcvts_f32_u32(a);
+}
+
+float64_t test_vcvtd_f64_u64(uint64_t a) {
+// CHECK: test_vcvtd_f64_u64
+// CHECK: ucvtf {{d[0-9]+}}, {{d[0-9]+}}
+ return vcvtd_f64_u64(a);
+}
+
+float32_t test_vrecpes_f32(float32_t a) {
+// CHECK: test_vrecpes_f32
+// CHECK: frecpe {{s[0-9]+}}, {{s[0-9]+}}
+ return vrecpes_f32(a);
+}
+
+float64_t test_vrecped_f64(float64_t a) {
+// CHECK: test_vrecped_f64
+// CHECK: frecpe {{d[0-9]+}}, {{d[0-9]+}}
+ return vrecped_f64(a);
+}
+
+float32_t test_vrecpxs_f32(float32_t a) {
+// CHECK: test_vrecpxs_f32
+// CHECK: frecpx {{s[0-9]+}}, {{s[0-9]+}}
+ return vrecpxs_f32(a);
+ }
+
+float64_t test_vrecpxd_f64(float64_t a) {
+// CHECK: test_vrecpxd_f64
+// CHECK: frecpx {{d[0-9]+}}, {{d[0-9]+}}
+ return vrecpxd_f64(a);
+}
+
+float32_t test_vrsqrtes_f32(float32_t a) {
+// CHECK: vrsqrtes_f32
+// CHECK: frsqrte {{s[0-9]+}}, {{s[0-9]+}}
+ return vrsqrtes_f32(a);
+}
+
+float64_t test_vrsqrted_f64(float64_t a) {
+// CHECK: vrsqrted_f64
+// CHECK: frsqrte {{d[0-9]+}}, {{d[0-9]+}}
+ return vrsqrted_f64(a);
+}
+
+uint8x16_t test_vld1q_u8(uint8_t const *a) {
+ // CHECK: test_vld1q_u8
+ return vld1q_u8(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x8_t test_vld1q_u16(uint16_t const *a) {
+ // CHECK: test_vld1q_u16
+ return vld1q_u16(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x4_t test_vld1q_u32(uint32_t const *a) {
+ // CHECK: test_vld1q_u32
+ return vld1q_u32(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x2_t test_vld1q_u64(uint64_t const *a) {
+ // CHECK: test_vld1q_u64
+ return vld1q_u64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+int8x16_t test_vld1q_s8(int8_t const *a) {
+ // CHECK: test_vld1q_s8
+ return vld1q_s8(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+int16x8_t test_vld1q_s16(int16_t const *a) {
+ // CHECK: test_vld1q_s16
+ return vld1q_s16(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+int32x4_t test_vld1q_s32(int32_t const *a) {
+ // CHECK: test_vld1q_s32
+ return vld1q_s32(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+int64x2_t test_vld1q_s64(int64_t const *a) {
+ // CHECK: test_vld1q_s64
+ return vld1q_s64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+float16x8_t test_vld1q_f16(float16_t const *a) {
+ // CHECK: test_vld1q_f16
+ return vld1q_f16(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+float32x4_t test_vld1q_f32(float32_t const *a) {
+ // CHECK: test_vld1q_f32
+ return vld1q_f32(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+float64x2_t test_vld1q_f64(float64_t const *a) {
+ // CHECK: test_vld1q_f64
+ return vld1q_f64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x16_t test_vld1q_p8(poly8_t const *a) {
+ // CHECK: test_vld1q_p8
+ return vld1q_p8(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x8_t test_vld1q_p16(poly16_t const *a) {
+ // CHECK: test_vld1q_p16
+ return vld1q_p16(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint8x8_t test_vld1_u8(uint8_t const *a) {
+ // CHECK: test_vld1_u8
+ return vld1_u8(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x4_t test_vld1_u16(uint16_t const *a) {
+ // CHECK: test_vld1_u16
+ return vld1_u16(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x2_t test_vld1_u32(uint32_t const *a) {
+ // CHECK: test_vld1_u32
+ return vld1_u32(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x1_t test_vld1_u64(uint64_t const *a) {
+ // CHECK: test_vld1_u64
+ return vld1_u64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+int8x8_t test_vld1_s8(int8_t const *a) {
+ // CHECK: test_vld1_s8
+ return vld1_s8(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+int16x4_t test_vld1_s16(int16_t const *a) {
+ // CHECK: test_vld1_s16
+ return vld1_s16(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+int32x2_t test_vld1_s32(int32_t const *a) {
+ // CHECK: test_vld1_s32
+ return vld1_s32(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+int64x1_t test_vld1_s64(int64_t const *a) {
+ // CHECK: test_vld1_s64
+ return vld1_s64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+float16x4_t test_vld1_f16(float16_t const *a) {
+ // CHECK: test_vld1_f16
+ return vld1_f16(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+float32x2_t test_vld1_f32(float32_t const *a) {
+ // CHECK: test_vld1_f32
+ return vld1_f32(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+float64x1_t test_vld1_f64(float64_t const *a) {
+ // CHECK: test_vld1_f64
+ return vld1_f64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x8_t test_vld1_p8(poly8_t const *a) {
+ // CHECK: test_vld1_p8
+ return vld1_p8(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x4_t test_vld1_p16(poly16_t const *a) {
+ // CHECK: test_vld1_p16
+ return vld1_p16(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint8x16x2_t test_vld2q_u8(uint8_t const *a) {
+ // CHECK: test_vld2q_u8
+ return vld2q_u8(a);
+ // CHECK: ld2 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x8x2_t test_vld2q_u16(uint16_t const *a) {
+ // CHECK: test_vld2q_u16
+ return vld2q_u16(a);
+ // CHECK: ld2 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x4x2_t test_vld2q_u32(uint32_t const *a) {
+ // CHECK: test_vld2q_u32
+ return vld2q_u32(a);
+ // CHECK: ld2 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x2x2_t test_vld2q_u64(uint64_t const *a) {
+ // CHECK: test_vld2q_u64
+ return vld2q_u64(a);
+ // CHECK: ld2 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+int8x16x2_t test_vld2q_s8(int8_t const *a) {
+ // CHECK: test_vld2q_s8
+ return vld2q_s8(a);
+ // CHECK: ld2 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+int16x8x2_t test_vld2q_s16(int16_t const *a) {
+ // CHECK: test_vld2q_s16
+ return vld2q_s16(a);
+ // CHECK: ld2 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+int32x4x2_t test_vld2q_s32(int32_t const *a) {
+ // CHECK: test_vld2q_s32
+ return vld2q_s32(a);
+ // CHECK: ld2 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+int64x2x2_t test_vld2q_s64(int64_t const *a) {
+ // CHECK: test_vld2q_s64
+ return vld2q_s64(a);
+ // CHECK: ld2 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+float16x8x2_t test_vld2q_f16(float16_t const *a) {
+ // CHECK: test_vld2q_f16
+ return vld2q_f16(a);
+ // CHECK: ld2 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+float32x4x2_t test_vld2q_f32(float32_t const *a) {
+ // CHECK: test_vld2q_f32
+ return vld2q_f32(a);
+ // CHECK: ld2 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+float64x2x2_t test_vld2q_f64(float64_t const *a) {
+ // CHECK: test_vld2q_f64
+ return vld2q_f64(a);
+ // CHECK: ld2 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x16x2_t test_vld2q_p8(poly8_t const *a) {
+ // CHECK: test_vld2q_p8
+ return vld2q_p8(a);
+ // CHECK: ld2 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x8x2_t test_vld2q_p16(poly16_t const *a) {
+ // CHECK: test_vld2q_p16
+ return vld2q_p16(a);
+ // CHECK: ld2 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint8x8x2_t test_vld2_u8(uint8_t const *a) {
+ // CHECK: test_vld2_u8
+ return vld2_u8(a);
+ // CHECK: ld2 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x4x2_t test_vld2_u16(uint16_t const *a) {
+ // CHECK: test_vld2_u16
+ return vld2_u16(a);
+ // CHECK: ld2 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x2x2_t test_vld2_u32(uint32_t const *a) {
+ // CHECK: test_vld2_u32
+ return vld2_u32(a);
+ // CHECK: ld2 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x1x2_t test_vld2_u64(uint64_t const *a) {
+ // CHECK: test_vld2_u64
+ return vld2_u64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+int8x8x2_t test_vld2_s8(int8_t const *a) {
+ // CHECK: test_vld2_s8
+ return vld2_s8(a);
+ // CHECK: ld2 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+int16x4x2_t test_vld2_s16(int16_t const *a) {
+ // CHECK: test_vld2_s16
+ return vld2_s16(a);
+ // CHECK: ld2 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+int32x2x2_t test_vld2_s32(int32_t const *a) {
+ // CHECK: test_vld2_s32
+ return vld2_s32(a);
+ // CHECK: ld2 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+int64x1x2_t test_vld2_s64(int64_t const *a) {
+ // CHECK: test_vld2_s64
+ return vld2_s64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+float16x4x2_t test_vld2_f16(float16_t const *a) {
+ // CHECK: test_vld2_f16
+ return vld2_f16(a);
+ // CHECK: ld2 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+float32x2x2_t test_vld2_f32(float32_t const *a) {
+ // CHECK: test_vld2_f32
+ return vld2_f32(a);
+ // CHECK: ld2 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+float64x1x2_t test_vld2_f64(float64_t const *a) {
+ // CHECK: test_vld2_f64
+ return vld2_f64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x8x2_t test_vld2_p8(poly8_t const *a) {
+ // CHECK: test_vld2_p8
+ return vld2_p8(a);
+ // CHECK: ld2 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x4x2_t test_vld2_p16(poly16_t const *a) {
+ // CHECK: test_vld2_p16
+ return vld2_p16(a);
+ // CHECK: ld2 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint8x16x3_t test_vld3q_u8(uint8_t const *a) {
+ // CHECK: test_vld3q_u8
+ return vld3q_u8(a);
+ // CHECK: ld3 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint16x8x3_t test_vld3q_u16(uint16_t const *a) {
+ // CHECK: test_vld3q_u16
+ return vld3q_u16(a);
+ // CHECK: ld3 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint32x4x3_t test_vld3q_u32(uint32_t const *a) {
+ // CHECK: test_vld3q_u32
+ return vld3q_u32(a);
+ // CHECK: ld3 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint64x2x3_t test_vld3q_u64(uint64_t const *a) {
+ // CHECK: test_vld3q_u64
+ return vld3q_u64(a);
+ // CHECK: ld3 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+int8x16x3_t test_vld3q_s8(int8_t const *a) {
+ // CHECK: test_vld3q_s8
+ return vld3q_s8(a);
+ // CHECK: ld3 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+int16x8x3_t test_vld3q_s16(int16_t const *a) {
+ // CHECK: test_vld3q_s16
+ return vld3q_s16(a);
+ // CHECK: ld3 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+int32x4x3_t test_vld3q_s32(int32_t const *a) {
+ // CHECK: test_vld3q_s32
+ return vld3q_s32(a);
+ // CHECK: ld3 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+int64x2x3_t test_vld3q_s64(int64_t const *a) {
+ // CHECK: test_vld3q_s64
+ return vld3q_s64(a);
+ // CHECK: ld3 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+float16x8x3_t test_vld3q_f16(float16_t const *a) {
+ // CHECK: test_vld3q_f16
+ return vld3q_f16(a);
+ // CHECK: ld3 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+float32x4x3_t test_vld3q_f32(float32_t const *a) {
+ // CHECK: test_vld3q_f32
+ return vld3q_f32(a);
+ // CHECK: ld3 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+float64x2x3_t test_vld3q_f64(float64_t const *a) {
+ // CHECK: test_vld3q_f64
+ return vld3q_f64(a);
+ // CHECK: ld3 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly8x16x3_t test_vld3q_p8(poly8_t const *a) {
+ // CHECK: test_vld3q_p8
+ return vld3q_p8(a);
+ // CHECK: ld3 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly16x8x3_t test_vld3q_p16(poly16_t const *a) {
+ // CHECK: test_vld3q_p16
+ return vld3q_p16(a);
+ // CHECK: ld3 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint8x8x3_t test_vld3_u8(uint8_t const *a) {
+ // CHECK: test_vld3_u8
+ return vld3_u8(a);
+ // CHECK: ld3 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint16x4x3_t test_vld3_u16(uint16_t const *a) {
+ // CHECK: test_vld3_u16
+ return vld3_u16(a);
+ // CHECK: ld3 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint32x2x3_t test_vld3_u32(uint32_t const *a) {
+ // CHECK: test_vld3_u32
+ return vld3_u32(a);
+ // CHECK: ld3 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint64x1x3_t test_vld3_u64(uint64_t const *a) {
+ // CHECK: test_vld3_u64
+ return vld3_u64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+int8x8x3_t test_vld3_s8(int8_t const *a) {
+ // CHECK: test_vld3_s8
+ return vld3_s8(a);
+ // CHECK: ld3 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+int16x4x3_t test_vld3_s16(int16_t const *a) {
+ // CHECK: test_vld3_s16
+ return vld3_s16(a);
+ // CHECK: ld3 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+int32x2x3_t test_vld3_s32(int32_t const *a) {
+ // CHECK: test_vld3_s32
+ return vld3_s32(a);
+ // CHECK: ld3 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+int64x1x3_t test_vld3_s64(int64_t const *a) {
+ // CHECK: test_vld3_s64
+ return vld3_s64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+float16x4x3_t test_vld3_f16(float16_t const *a) {
+ // CHECK: test_vld3_f16
+ return vld3_f16(a);
+ // CHECK: ld3 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+float32x2x3_t test_vld3_f32(float32_t const *a) {
+ // CHECK: test_vld3_f32
+ return vld3_f32(a);
+ // CHECK: ld3 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+float64x1x3_t test_vld3_f64(float64_t const *a) {
+ // CHECK: test_vld3_f64
+ return vld3_f64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly8x8x3_t test_vld3_p8(poly8_t const *a) {
+ // CHECK: test_vld3_p8
+ return vld3_p8(a);
+ // CHECK: ld3 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly16x4x3_t test_vld3_p16(poly16_t const *a) {
+ // CHECK: test_vld3_p16
+ return vld3_p16(a);
+ // CHECK: ld3 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint8x16x4_t test_vld4q_u8(uint8_t const *a) {
+ // CHECK: test_vld4q_u8
+ return vld4q_u8(a);
+ // CHECK: ld4 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x8x4_t test_vld4q_u16(uint16_t const *a) {
+ // CHECK: test_vld4q_u16
+ return vld4q_u16(a);
+ // CHECK: ld4 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x4x4_t test_vld4q_u32(uint32_t const *a) {
+ // CHECK: test_vld4q_u32
+ return vld4q_u32(a);
+ // CHECK: ld4 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x2x4_t test_vld4q_u64(uint64_t const *a) {
+ // CHECK: test_vld4q_u64
+ return vld4q_u64(a);
+ // CHECK: ld4 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+int8x16x4_t test_vld4q_s8(int8_t const *a) {
+ // CHECK: test_vld4q_s8
+ return vld4q_s8(a);
+ // CHECK: ld4 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+int16x8x4_t test_vld4q_s16(int16_t const *a) {
+ // CHECK: test_vld4q_s16
+ return vld4q_s16(a);
+ // CHECK: ld4 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+int32x4x4_t test_vld4q_s32(int32_t const *a) {
+ // CHECK: test_vld4q_s32
+ return vld4q_s32(a);
+ // CHECK: ld4 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+int64x2x4_t test_vld4q_s64(int64_t const *a) {
+ // CHECK: test_vld4q_s64
+ return vld4q_s64(a);
+ // CHECK: ld4 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+float16x8x4_t test_vld4q_f16(float16_t const *a) {
+ // CHECK: test_vld4q_f16
+ return vld4q_f16(a);
+ // CHECK: ld4 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+float32x4x4_t test_vld4q_f32(float32_t const *a) {
+ // CHECK: test_vld4q_f32
+ return vld4q_f32(a);
+ // CHECK: ld4 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+float64x2x4_t test_vld4q_f64(float64_t const *a) {
+ // CHECK: test_vld4q_f64
+ return vld4q_f64(a);
+ // CHECK: ld4 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+poly8x16x4_t test_vld4q_p8(poly8_t const *a) {
+ // CHECK: test_vld4q_p8
+ return vld4q_p8(a);
+ // CHECK: ld4 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x8x4_t test_vld4q_p16(poly16_t const *a) {
+ // CHECK: test_vld4q_p16
+ return vld4q_p16(a);
+ // CHECK: ld4 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint8x8x4_t test_vld4_u8(uint8_t const *a) {
+ // CHECK: test_vld4_u8
+ return vld4_u8(a);
+ // CHECK: ld4 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x4x4_t test_vld4_u16(uint16_t const *a) {
+ // CHECK: test_vld4_u16
+ return vld4_u16(a);
+ // CHECK: ld4 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x2x4_t test_vld4_u32(uint32_t const *a) {
+ // CHECK: test_vld4_u32
+ return vld4_u32(a);
+ // CHECK: ld4 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x1x4_t test_vld4_u64(uint64_t const *a) {
+ // CHECK: test_vld4_u64
+ return vld4_u64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+int8x8x4_t test_vld4_s8(int8_t const *a) {
+ // CHECK: test_vld4_s8
+ return vld4_s8(a);
+ // CHECK: ld4 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+int16x4x4_t test_vld4_s16(int16_t const *a) {
+ // CHECK: test_vld4_s16
+ return vld4_s16(a);
+ // CHECK: ld4 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+int32x2x4_t test_vld4_s32(int32_t const *a) {
+ // CHECK: test_vld4_s32
+ return vld4_s32(a);
+ // CHECK: ld4 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+int64x1x4_t test_vld4_s64(int64_t const *a) {
+ // CHECK: test_vld4_s64
+ return vld4_s64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+float16x4x4_t test_vld4_f16(float16_t const *a) {
+ // CHECK: test_vld4_f16
+ return vld4_f16(a);
+ // CHECK: ld4 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+float32x2x4_t test_vld4_f32(float32_t const *a) {
+ // CHECK: test_vld4_f32
+ return vld4_f32(a);
+ // CHECK: ld4 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+float64x1x4_t test_vld4_f64(float64_t const *a) {
+ // CHECK: test_vld4_f64
+ return vld4_f64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x8x4_t test_vld4_p8(poly8_t const *a) {
+ // CHECK: test_vld4_p8
+ return vld4_p8(a);
+ // CHECK: ld4 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x4x4_t test_vld4_p16(poly16_t const *a) {
+ // CHECK: test_vld4_p16
+ return vld4_p16(a);
+ // CHECK: ld4 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u8(uint8_t *a, uint8x16_t b) {
+ // CHECK: test_vst1q_u8
+ vst1q_u8(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u16(uint16_t *a, uint16x8_t b) {
+ // CHECK: test_vst1q_u16
+ vst1q_u16(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u32(uint32_t *a, uint32x4_t b) {
+ // CHECK: test_vst1q_u32
+ vst1q_u32(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u64(uint64_t *a, uint64x2_t b) {
+ // CHECK: test_vst1q_u64
+ vst1q_u64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s8(int8_t *a, int8x16_t b) {
+ // CHECK: test_vst1q_s8
+ vst1q_s8(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s16(int16_t *a, int16x8_t b) {
+ // CHECK: test_vst1q_s16
+ vst1q_s16(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s32(int32_t *a, int32x4_t b) {
+ // CHECK: test_vst1q_s32
+ vst1q_s32(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s64(int64_t *a, int64x2_t b) {
+ // CHECK: test_vst1q_s64
+ vst1q_s64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f16(float16_t *a, float16x8_t b) {
+ // CHECK: test_vst1q_f16
+ vst1q_f16(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f32(float32_t *a, float32x4_t b) {
+ // CHECK: test_vst1q_f32
+ vst1q_f32(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f64(float64_t *a, float64x2_t b) {
+ // CHECK: test_vst1q_f64
+ vst1q_f64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p8(poly8_t *a, poly8x16_t b) {
+ // CHECK: test_vst1q_p8
+ vst1q_p8(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p16(poly16_t *a, poly16x8_t b) {
+ // CHECK: test_vst1q_p16
+ vst1q_p16(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u8(uint8_t *a, uint8x8_t b) {
+ // CHECK: test_vst1_u8
+ vst1_u8(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u16(uint16_t *a, uint16x4_t b) {
+ // CHECK: test_vst1_u16
+ vst1_u16(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u32(uint32_t *a, uint32x2_t b) {
+ // CHECK: test_vst1_u32
+ vst1_u32(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u64(uint64_t *a, uint64x1_t b) {
+ // CHECK: test_vst1_u64
+ vst1_u64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s8(int8_t *a, int8x8_t b) {
+ // CHECK: test_vst1_s8
+ vst1_s8(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s16(int16_t *a, int16x4_t b) {
+ // CHECK: test_vst1_s16
+ vst1_s16(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s32(int32_t *a, int32x2_t b) {
+ // CHECK: test_vst1_s32
+ vst1_s32(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s64(int64_t *a, int64x1_t b) {
+ // CHECK: test_vst1_s64
+ vst1_s64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f16(float16_t *a, float16x4_t b) {
+ // CHECK: test_vst1_f16
+ vst1_f16(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f32(float32_t *a, float32x2_t b) {
+ // CHECK: test_vst1_f32
+ vst1_f32(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f64(float64_t *a, float64x1_t b) {
+ // CHECK: test_vst1_f64
+ vst1_f64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p8(poly8_t *a, poly8x8_t b) {
+ // CHECK: test_vst1_p8
+ vst1_p8(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p16(poly16_t *a, poly16x4_t b) {
+ // CHECK: test_vst1_p16
+ vst1_p16(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_u8(uint8_t *a, uint8x16x2_t b) {
+ // CHECK: test_vst2q_u8
+ vst2q_u8(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_u16(uint16_t *a, uint16x8x2_t b) {
+ // CHECK: test_vst2q_u16
+ vst2q_u16(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_u32(uint32_t *a, uint32x4x2_t b) {
+ // CHECK: test_vst2q_u32
+ vst2q_u32(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_u64(uint64_t *a, uint64x2x2_t b) {
+ // CHECK: test_vst2q_u64
+ vst2q_u64(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_s8(int8_t *a, int8x16x2_t b) {
+ // CHECK: test_vst2q_s8
+ vst2q_s8(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_s16(int16_t *a, int16x8x2_t b) {
+ // CHECK: test_vst2q_s16
+ vst2q_s16(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_s32(int32_t *a, int32x4x2_t b) {
+ // CHECK: test_vst2q_s32
+ vst2q_s32(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_s64(int64_t *a, int64x2x2_t b) {
+ // CHECK: test_vst2q_s64
+ vst2q_s64(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_f16(float16_t *a, float16x8x2_t b) {
+ // CHECK: test_vst2q_f16
+ vst2q_f16(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_f32(float32_t *a, float32x4x2_t b) {
+ // CHECK: test_vst2q_f32
+ vst2q_f32(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_f64(float64_t *a, float64x2x2_t b) {
+ // CHECK: test_vst2q_f64
+ vst2q_f64(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_p8(poly8_t *a, poly8x16x2_t b) {
+ // CHECK: test_vst2q_p8
+ vst2q_p8(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_p16(poly16_t *a, poly16x8x2_t b) {
+ // CHECK: test_vst2q_p16
+ vst2q_p16(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_u8(uint8_t *a, uint8x8x2_t b) {
+ // CHECK: test_vst2_u8
+ vst2_u8(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_u16(uint16_t *a, uint16x4x2_t b) {
+ // CHECK: test_vst2_u16
+ vst2_u16(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_u32(uint32_t *a, uint32x2x2_t b) {
+ // CHECK: test_vst2_u32
+ vst2_u32(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_u64(uint64_t *a, uint64x1x2_t b) {
+ // CHECK: test_vst2_u64
+ vst2_u64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_s8(int8_t *a, int8x8x2_t b) {
+ // CHECK: test_vst2_s8
+ vst2_s8(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_s16(int16_t *a, int16x4x2_t b) {
+ // CHECK: test_vst2_s16
+ vst2_s16(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_s32(int32_t *a, int32x2x2_t b) {
+ // CHECK: test_vst2_s32
+ vst2_s32(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_s64(int64_t *a, int64x1x2_t b) {
+ // CHECK: test_vst2_s64
+ vst2_s64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_f16(float16_t *a, float16x4x2_t b) {
+ // CHECK: test_vst2_f16
+ vst2_f16(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_f32(float32_t *a, float32x2x2_t b) {
+ // CHECK: test_vst2_f32
+ vst2_f32(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_f64(float64_t *a, float64x1x2_t b) {
+ // CHECK: test_vst2_f64
+ vst2_f64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_p8(poly8_t *a, poly8x8x2_t b) {
+ // CHECK: test_vst2_p8
+ vst2_p8(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_p16(poly16_t *a, poly16x4x2_t b) {
+ // CHECK: test_vst2_p16
+ vst2_p16(a, b);
+ // CHECK: st2 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_u8(uint8_t *a, uint8x16x3_t b) {
+ // CHECK: test_vst3q_u8
+ vst3q_u8(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_u16(uint16_t *a, uint16x8x3_t b) {
+ // CHECK: test_vst3q_u16
+ vst3q_u16(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_u32(uint32_t *a, uint32x4x3_t b) {
+ // CHECK: test_vst3q_u32
+ vst3q_u32(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_u64(uint64_t *a, uint64x2x3_t b) {
+ // CHECK: test_vst3q_u64
+ vst3q_u64(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_s8(int8_t *a, int8x16x3_t b) {
+ // CHECK: test_vst3q_s8
+ vst3q_s8(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_s16(int16_t *a, int16x8x3_t b) {
+ // CHECK: test_vst3q_s16
+ vst3q_s16(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_s32(int32_t *a, int32x4x3_t b) {
+ // CHECK: test_vst3q_s32
+ vst3q_s32(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_s64(int64_t *a, int64x2x3_t b) {
+ // CHECK: test_vst3q_s64
+ vst3q_s64(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_f16(float16_t *a, float16x8x3_t b) {
+ // CHECK: test_vst3q_f16
+ vst3q_f16(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_f32(float32_t *a, float32x4x3_t b) {
+ // CHECK: test_vst3q_f32
+ vst3q_f32(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_f64(float64_t *a, float64x2x3_t b) {
+ // CHECK: test_vst3q_f64
+ vst3q_f64(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_p8(poly8_t *a, poly8x16x3_t b) {
+ // CHECK: test_vst3q_p8
+ vst3q_p8(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_p16(poly16_t *a, poly16x8x3_t b) {
+ // CHECK: test_vst3q_p16
+ vst3q_p16(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_u8(uint8_t *a, uint8x8x3_t b) {
+ // CHECK: test_vst3_u8
+ vst3_u8(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_u16(uint16_t *a, uint16x4x3_t b) {
+ // CHECK: test_vst3_u16
+ vst3_u16(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_u32(uint32_t *a, uint32x2x3_t b) {
+ // CHECK: test_vst3_u32
+ vst3_u32(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_u64(uint64_t *a, uint64x1x3_t b) {
+ // CHECK: test_vst3_u64
+ vst3_u64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_s8(int8_t *a, int8x8x3_t b) {
+ // CHECK: test_vst3_s8
+ vst3_s8(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_s16(int16_t *a, int16x4x3_t b) {
+ // CHECK: test_vst3_s16
+ vst3_s16(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_s32(int32_t *a, int32x2x3_t b) {
+ // CHECK: test_vst3_s32
+ vst3_s32(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_s64(int64_t *a, int64x1x3_t b) {
+ // CHECK: test_vst3_s64
+ vst3_s64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_f16(float16_t *a, float16x4x3_t b) {
+ // CHECK: test_vst3_f16
+ vst3_f16(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_f32(float32_t *a, float32x2x3_t b) {
+ // CHECK: test_vst3_f32
+ vst3_f32(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_f64(float64_t *a, float64x1x3_t b) {
+ // CHECK: test_vst3_f64
+ vst3_f64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_p8(poly8_t *a, poly8x8x3_t b) {
+ // CHECK: test_vst3_p8
+ vst3_p8(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_p16(poly16_t *a, poly16x4x3_t b) {
+ // CHECK: test_vst3_p16
+ vst3_p16(a, b);
+ // CHECK: st3 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_u8(uint8_t *a, uint8x16x4_t b) {
+ // CHECK: test_vst4q_u8
+ vst4q_u8(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_u16(uint16_t *a, uint16x8x4_t b) {
+ // CHECK: test_vst4q_u16
+ vst4q_u16(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_u32(uint32_t *a, uint32x4x4_t b) {
+ // CHECK: test_vst4q_u32
+ vst4q_u32(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_u64(uint64_t *a, uint64x2x4_t b) {
+ // CHECK: test_vst4q_u64
+ vst4q_u64(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_s8(int8_t *a, int8x16x4_t b) {
+ // CHECK: test_vst4q_s8
+ vst4q_s8(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_s16(int16_t *a, int16x8x4_t b) {
+ // CHECK: test_vst4q_s16
+ vst4q_s16(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_s32(int32_t *a, int32x4x4_t b) {
+ // CHECK: test_vst4q_s32
+ vst4q_s32(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_s64(int64_t *a, int64x2x4_t b) {
+ // CHECK: test_vst4q_s64
+ vst4q_s64(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_f16(float16_t *a, float16x8x4_t b) {
+ // CHECK: test_vst4q_f16
+ vst4q_f16(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_f32(float32_t *a, float32x4x4_t b) {
+ // CHECK: test_vst4q_f32
+ vst4q_f32(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_f64(float64_t *a, float64x2x4_t b) {
+ // CHECK: test_vst4q_f64
+ vst4q_f64(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_p8(poly8_t *a, poly8x16x4_t b) {
+ // CHECK: test_vst4q_p8
+ vst4q_p8(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_p16(poly16_t *a, poly16x8x4_t b) {
+ // CHECK: test_vst4q_p16
+ vst4q_p16(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_u8(uint8_t *a, uint8x8x4_t b) {
+ // CHECK: test_vst4_u8
+ vst4_u8(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_u16(uint16_t *a, uint16x4x4_t b) {
+ // CHECK: test_vst4_u16
+ vst4_u16(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_u32(uint32_t *a, uint32x2x4_t b) {
+ // CHECK: test_vst4_u32
+ vst4_u32(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_u64(uint64_t *a, uint64x1x4_t b) {
+ // CHECK: test_vst4_u64
+ vst4_u64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_s8(int8_t *a, int8x8x4_t b) {
+ // CHECK: test_vst4_s8
+ vst4_s8(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_s16(int16_t *a, int16x4x4_t b) {
+ // CHECK: test_vst4_s16
+ vst4_s16(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_s32(int32_t *a, int32x2x4_t b) {
+ // CHECK: test_vst4_s32
+ vst4_s32(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_s64(int64_t *a, int64x1x4_t b) {
+ // CHECK: test_vst4_s64
+ vst4_s64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_f16(float16_t *a, float16x4x4_t b) {
+ // CHECK: test_vst4_f16
+ vst4_f16(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_f32(float32_t *a, float32x2x4_t b) {
+ // CHECK: test_vst4_f32
+ vst4_f32(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_f64(float64_t *a, float64x1x4_t b) {
+ // CHECK: test_vst4_f64
+ vst4_f64(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_p8(poly8_t *a, poly8x8x4_t b) {
+ // CHECK: test_vst4_p8
+ vst4_p8(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_p16(poly16_t *a, poly16x4x4_t b) {
+ // CHECK: test_vst4_p16
+ vst4_p16(a, b);
+ // CHECK: st4 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint8x16x2_t test_vld1q_u8_x2(uint8_t const *a) {
+ // CHECK-LABEL: test_vld1q_u8_x2
+ return vld1q_u8_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x8x2_t test_vld1q_u16_x2(uint16_t const *a) {
+ // CHECK-LABEL: test_vld1q_u16_x2
+ return vld1q_u16_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x4x2_t test_vld1q_u32_x2(uint32_t const *a) {
+ // CHECK-LABEL: test_vld1q_u32_x2
+ return vld1q_u32_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x2x2_t test_vld1q_u64_x2(uint64_t const *a) {
+ // CHECK-LABEL: test_vld1q_u64_x2
+ return vld1q_u64_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+int8x16x2_t test_vld1q_s8_x2(int8_t const *a) {
+ // CHECK-LABEL: test_vld1q_s8_x2
+ return vld1q_s8_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+int16x8x2_t test_vld1q_s16_x2(int16_t const *a) {
+ // CHECK-LABEL: test_vld1q_s16_x2
+ return vld1q_s16_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+int32x4x2_t test_vld1q_s32_x2(int32_t const *a) {
+ // CHECK-LABEL: test_vld1q_s32_x2
+ return vld1q_s32_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+int64x2x2_t test_vld1q_s64_x2(int64_t const *a) {
+ // CHECK-LABEL: test_vld1q_s64_x2
+ return vld1q_s64_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+float16x8x2_t test_vld1q_f16_x2(float16_t const *a) {
+ // CHECK-LABEL: test_vld1q_f16_x2
+ return vld1q_f16_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+float32x4x2_t test_vld1q_f32_x2(float32_t const *a) {
+ // CHECK-LABEL: test_vld1q_f32_x2
+ return vld1q_f32_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+float64x2x2_t test_vld1q_f64_x2(float64_t const *a) {
+ // CHECK-LABEL: test_vld1q_f64_x2
+ return vld1q_f64_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x16x2_t test_vld1q_p8_x2(poly8_t const *a) {
+ // CHECK-LABEL: test_vld1q_p8_x2
+ return vld1q_p8_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x8x2_t test_vld1q_p16_x2(poly16_t const *a) {
+ // CHECK-LABEL: test_vld1q_p16_x2
+ return vld1q_p16_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+poly64x2x2_t test_vld1q_p64_x2(poly64_t const *a) {
+ // CHECK-LABEL: test_vld1q_p64_x2
+ return vld1q_p64_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+uint8x8x2_t test_vld1_u8_x2(uint8_t const *a) {
+ // CHECK-LABEL: test_vld1_u8_x2
+ return vld1_u8_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x4x2_t test_vld1_u16_x2(uint16_t const *a) {
+ // CHECK-LABEL: test_vld1_u16_x2
+ return vld1_u16_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x2x2_t test_vld1_u32_x2(uint32_t const *a) {
+ // CHECK-LABEL: test_vld1_u32_x2
+ return vld1_u32_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x1x2_t test_vld1_u64_x2(uint64_t const *a) {
+ // CHECK-LABEL: test_vld1_u64_x2
+ return vld1_u64_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+int8x8x2_t test_vld1_s8_x2(int8_t const *a) {
+ // CHECK-LABEL: test_vld1_s8_x2
+ return vld1_s8_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+int16x4x2_t test_vld1_s16_x2(int16_t const *a) {
+ // CHECK-LABEL: test_vld1_s16_x2
+ return vld1_s16_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+int32x2x2_t test_vld1_s32_x2(int32_t const *a) {
+ // CHECK-LABEL: test_vld1_s32_x2
+ return vld1_s32_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+int64x1x2_t test_vld1_s64_x2(int64_t const *a) {
+ // CHECK-LABEL: test_vld1_s64_x2
+ return vld1_s64_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+float16x4x2_t test_vld1_f16_x2(float16_t const *a) {
+ // CHECK-LABEL: test_vld1_f16_x2
+ return vld1_f16_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+float32x2x2_t test_vld1_f32_x2(float32_t const *a) {
+ // CHECK-LABEL: test_vld1_f32_x2
+ return vld1_f32_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+float64x1x2_t test_vld1_f64_x2(float64_t const *a) {
+ // CHECK-LABEL: test_vld1_f64_x2
+ return vld1_f64_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x8x2_t test_vld1_p8_x2(poly8_t const *a) {
+ // CHECK-LABEL: test_vld1_p8_x2
+ return vld1_p8_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x4x2_t test_vld1_p16_x2(poly16_t const *a) {
+ // CHECK-LABEL: test_vld1_p16_x2
+ return vld1_p16_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+poly64x1x2_t test_vld1_p64_x2(poly64_t const *a) {
+ // CHECK-LABEL: test_vld1_p64_x2
+ return vld1_p64_x2(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+uint8x16x3_t test_vld1q_u8_x3(uint8_t const *a) {
+ // CHECK-LABEL: test_vld1q_u8_x3
+ return vld1q_u8_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint16x8x3_t test_vld1q_u16_x3(uint16_t const *a) {
+ // CHECK-LABEL: test_vld1q_u16_x3
+ return vld1q_u16_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint32x4x3_t test_vld1q_u32_x3(uint32_t const *a) {
+ // CHECK-LABEL: test_vld1q_u32_x3
+ return vld1q_u32_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint64x2x3_t test_vld1q_u64_x3(uint64_t const *a) {
+ // CHECK-LABEL: test_vld1q_u64_x3
+ return vld1q_u64_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+int8x16x3_t test_vld1q_s8_x3(int8_t const *a) {
+ // CHECK-LABEL: test_vld1q_s8_x3
+ return vld1q_s8_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+int16x8x3_t test_vld1q_s16_x3(int16_t const *a) {
+ // CHECK-LABEL: test_vld1q_s16_x3
+ return vld1q_s16_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+int32x4x3_t test_vld1q_s32_x3(int32_t const *a) {
+ // CHECK-LABEL: test_vld1q_s32_x3
+ return vld1q_s32_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+int64x2x3_t test_vld1q_s64_x3(int64_t const *a) {
+ // CHECK-LABEL: test_vld1q_s64_x3
+ return vld1q_s64_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+float16x8x3_t test_vld1q_f16_x3(float16_t const *a) {
+ // CHECK-LABEL: test_vld1q_f16_x3
+ return vld1q_f16_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+float32x4x3_t test_vld1q_f32_x3(float32_t const *a) {
+ // CHECK-LABEL: test_vld1q_f32_x3
+ return vld1q_f32_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+float64x2x3_t test_vld1q_f64_x3(float64_t const *a) {
+ // CHECK-LABEL: test_vld1q_f64_x3
+ return vld1q_f64_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly8x16x3_t test_vld1q_p8_x3(poly8_t const *a) {
+ // CHECK-LABEL: test_vld1q_p8_x3
+ return vld1q_p8_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly16x8x3_t test_vld1q_p16_x3(poly16_t const *a) {
+ // CHECK-LABEL: test_vld1q_p16_x3
+ return vld1q_p16_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly64x2x3_t test_vld1q_p64_x3(poly64_t const *a) {
+ // CHECK-LABEL: test_vld1q_p64_x3
+ return vld1q_p64_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint8x8x3_t test_vld1_u8_x3(uint8_t const *a) {
+ // CHECK-LABEL: test_vld1_u8_x3
+ return vld1_u8_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint16x4x3_t test_vld1_u16_x3(uint16_t const *a) {
+ // CHECK-LABEL: test_vld1_u16_x3
+ return vld1_u16_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint32x2x3_t test_vld1_u32_x3(uint32_t const *a) {
+ // CHECK-LABEL: test_vld1_u32_x3
+ return vld1_u32_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint64x1x3_t test_vld1_u64_x3(uint64_t const *a) {
+ // CHECK-LABEL: test_vld1_u64_x3
+ return vld1_u64_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+int8x8x3_t test_vld1_s8_x3(int8_t const *a) {
+ // CHECK-LABEL: test_vld1_s8_x3
+ return vld1_s8_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+int16x4x3_t test_vld1_s16_x3(int16_t const *a) {
+ // CHECK-LABEL: test_vld1_s16_x3
+ return vld1_s16_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+int32x2x3_t test_vld1_s32_x3(int32_t const *a) {
+ // CHECK-LABEL: test_vld1_s32_x3
+ return vld1_s32_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+int64x1x3_t test_vld1_s64_x3(int64_t const *a) {
+ // CHECK-LABEL: test_vld1_s64_x3
+ return vld1_s64_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+float16x4x3_t test_vld1_f16_x3(float16_t const *a) {
+ // CHECK-LABEL: test_vld1_f16_x3
+ return vld1_f16_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+float32x2x3_t test_vld1_f32_x3(float32_t const *a) {
+ // CHECK-LABEL: test_vld1_f32_x3
+ return vld1_f32_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+float64x1x3_t test_vld1_f64_x3(float64_t const *a) {
+ // CHECK-LABEL: test_vld1_f64_x3
+ return vld1_f64_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly8x8x3_t test_vld1_p8_x3(poly8_t const *a) {
+ // CHECK-LABEL: test_vld1_p8_x3
+ return vld1_p8_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly16x4x3_t test_vld1_p16_x3(poly16_t const *a) {
+ // CHECK-LABEL: test_vld1_p16_x3
+ return vld1_p16_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly64x1x3_t test_vld1_p64_x3(poly64_t const *a) {
+ // CHECK-LABEL: test_vld1_p64_x3
+ return vld1_p64_x3(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint8x16x4_t test_vld1q_u8_x4(uint8_t const *a) {
+ // CHECK-LABEL: test_vld1q_u8_x4
+ return vld1q_u8_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x8x4_t test_vld1q_u16_x4(uint16_t const *a) {
+ // CHECK-LABEL: test_vld1q_u16_x4
+ return vld1q_u16_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x4x4_t test_vld1q_u32_x4(uint32_t const *a) {
+ // CHECK-LABEL: test_vld1q_u32_x4
+ return vld1q_u32_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x2x4_t test_vld1q_u64_x4(uint64_t const *a) {
+ // CHECK-LABEL: test_vld1q_u64_x4
+ return vld1q_u64_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+int8x16x4_t test_vld1q_s8_x4(int8_t const *a) {
+ // CHECK-LABEL: test_vld1q_s8_x4
+ return vld1q_s8_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+int16x8x4_t test_vld1q_s16_x4(int16_t const *a) {
+ // CHECK-LABEL: test_vld1q_s16_x4
+ return vld1q_s16_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+int32x4x4_t test_vld1q_s32_x4(int32_t const *a) {
+ // CHECK-LABEL: test_vld1q_s32_x4
+ return vld1q_s32_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+int64x2x4_t test_vld1q_s64_x4(int64_t const *a) {
+ // CHECK-LABEL: test_vld1q_s64_x4
+ return vld1q_s64_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+float16x8x4_t test_vld1q_f16_x4(float16_t const *a) {
+ // CHECK-LABEL: test_vld1q_f16_x4
+ return vld1q_f16_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+float32x4x4_t test_vld1q_f32_x4(float32_t const *a) {
+ // CHECK-LABEL: test_vld1q_f32_x4
+ return vld1q_f32_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+float64x2x4_t test_vld1q_f64_x4(float64_t const *a) {
+ // CHECK-LABEL: test_vld1q_f64_x4
+ return vld1q_f64_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+poly8x16x4_t test_vld1q_p8_x4(poly8_t const *a) {
+ // CHECK-LABEL: test_vld1q_p8_x4
+ return vld1q_p8_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x8x4_t test_vld1q_p16_x4(poly16_t const *a) {
+ // CHECK-LABEL: test_vld1q_p16_x4
+ return vld1q_p16_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+poly64x2x4_t test_vld1q_p64_x4(poly64_t const *a) {
+ // CHECK-LABEL: test_vld1q_p64_x4
+ return vld1q_p64_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+uint8x8x4_t test_vld1_u8_x4(uint8_t const *a) {
+ // CHECK-LABEL: test_vld1_u8_x4
+ return vld1_u8_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x4x4_t test_vld1_u16_x4(uint16_t const *a) {
+ // CHECK-LABEL: test_vld1_u16_x4
+ return vld1_u16_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x2x4_t test_vld1_u32_x4(uint32_t const *a) {
+ // CHECK-LABEL: test_vld1_u32_x4
+ return vld1_u32_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x1x4_t test_vld1_u64_x4(uint64_t const *a) {
+ // CHECK-LABEL: test_vld1_u64_x4
+ return vld1_u64_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+int8x8x4_t test_vld1_s8_x4(int8_t const *a) {
+ // CHECK-LABEL: test_vld1_s8_x4
+ return vld1_s8_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+int16x4x4_t test_vld1_s16_x4(int16_t const *a) {
+ // CHECK-LABEL: test_vld1_s16_x4
+ return vld1_s16_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+int32x2x4_t test_vld1_s32_x4(int32_t const *a) {
+ // CHECK-LABEL: test_vld1_s32_x4
+ return vld1_s32_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+int64x1x4_t test_vld1_s64_x4(int64_t const *a) {
+ // CHECK-LABEL: test_vld1_s64_x4
+ return vld1_s64_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+float16x4x4_t test_vld1_f16_x4(float16_t const *a) {
+ // CHECK-LABEL: test_vld1_f16_x4
+ return vld1_f16_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+float32x2x4_t test_vld1_f32_x4(float32_t const *a) {
+ // CHECK-LABEL: test_vld1_f32_x4
+ return vld1_f32_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+float64x1x4_t test_vld1_f64_x4(float64_t const *a) {
+ // CHECK-LABEL: test_vld1_f64_x4
+ return vld1_f64_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x8x4_t test_vld1_p8_x4(poly8_t const *a) {
+ // CHECK-LABEL: test_vld1_p8_x4
+ return vld1_p8_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x4x4_t test_vld1_p16_x4(poly16_t const *a) {
+ // CHECK-LABEL: test_vld1_p16_x4
+ return vld1_p16_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+poly64x1x4_t test_vld1_p64_x4(poly64_t const *a) {
+ // CHECK-LABEL: test_vld1_p64_x4
+ return vld1_p64_x4(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u8_x2(uint8_t *a, uint8x16x2_t b) {
+ // CHECK: test_vst1q_u8_x2
+ vst1q_u8_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u16_x2(uint16_t *a, uint16x8x2_t b) {
+ // CHECK: test_vst1q_u16_x2
+ vst1q_u16_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u32_x2(uint32_t *a, uint32x4x2_t b) {
+ // CHECK: test_vst1q_u32_x2
+ vst1q_u32_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u64_x2(uint64_t *a, uint64x2x2_t b) {
+ // CHECK: test_vst1q_u64_x2
+ vst1q_u64_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s8_x2(int8_t *a, int8x16x2_t b) {
+ // CHECK: test_vst1q_s8_x2
+ vst1q_s8_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s16_x2(int16_t *a, int16x8x2_t b) {
+ // CHECK: test_vst1q_s16_x2
+ vst1q_s16_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s32_x2(int32_t *a, int32x4x2_t b) {
+ // CHECK: test_vst1q_s32_x2
+ vst1q_s32_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s64_x2(int64_t *a, int64x2x2_t b) {
+ // CHECK: test_vst1q_s64_x2
+ vst1q_s64_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f16_x2(float16_t *a, float16x8x2_t b) {
+ // CHECK: test_vst1q_f16_x2
+ vst1q_f16_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f32_x2(float32_t *a, float32x4x2_t b) {
+ // CHECK: test_vst1q_f32_x2
+ vst1q_f32_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f64_x2(float64_t *a, float64x2x2_t b) {
+ // CHECK: test_vst1q_f64_x2
+ vst1q_f64_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p8_x2(poly8_t *a, poly8x16x2_t b) {
+ // CHECK: test_vst1q_p8_x2
+ vst1q_p8_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p16_x2(poly16_t *a, poly16x8x2_t b) {
+ // CHECK: test_vst1q_p16_x2
+ vst1q_p16_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p64_x2(poly64_t *a, poly64x2x2_t b) {
+ // CHECK: test_vst1q_p64_x2
+ vst1q_p64_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u8_x2(uint8_t *a, uint8x8x2_t b) {
+ // CHECK: test_vst1_u8_x2
+ vst1_u8_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u16_x2(uint16_t *a, uint16x4x2_t b) {
+ // CHECK: test_vst1_u16_x2
+ vst1_u16_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u32_x2(uint32_t *a, uint32x2x2_t b) {
+ // CHECK: test_vst1_u32_x2
+ vst1_u32_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u64_x2(uint64_t *a, uint64x1x2_t b) {
+ // CHECK: test_vst1_u64_x2
+ vst1_u64_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s8_x2(int8_t *a, int8x8x2_t b) {
+ // CHECK: test_vst1_s8_x2
+ vst1_s8_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s16_x2(int16_t *a, int16x4x2_t b) {
+ // CHECK: test_vst1_s16_x2
+ vst1_s16_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s32_x2(int32_t *a, int32x2x2_t b) {
+ // CHECK: test_vst1_s32_x2
+ vst1_s32_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s64_x2(int64_t *a, int64x1x2_t b) {
+ // CHECK: test_vst1_s64_x2
+ vst1_s64_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f16_x2(float16_t *a, float16x4x2_t b) {
+ // CHECK: test_vst1_f16_x2
+ vst1_f16_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f32_x2(float32_t *a, float32x2x2_t b) {
+ // CHECK: test_vst1_f32_x2
+ vst1_f32_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f64_x2(float64_t *a, float64x1x2_t b) {
+ // CHECK: test_vst1_f64_x2
+ vst1_f64_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p8_x2(poly8_t *a, poly8x8x2_t b) {
+ // CHECK: test_vst1_p8_x2
+ vst1_p8_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p16_x2(poly16_t *a, poly16x4x2_t b) {
+ // CHECK: test_vst1_p16_x2
+ vst1_p16_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p64_x2(poly64_t *a, poly64x1x2_t b) {
+ // CHECK: test_vst1_p64_x2
+ vst1_p64_x2(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u8_x3(uint8_t *a, uint8x16x3_t b) {
+ // CHECK: test_vst1q_u8_x3
+ vst1q_u8_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u16_x3(uint16_t *a, uint16x8x3_t b) {
+ // CHECK: test_vst1q_u16_x3
+ vst1q_u16_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u32_x3(uint32_t *a, uint32x4x3_t b) {
+ // CHECK: test_vst1q_u32_x3
+ vst1q_u32_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u64_x3(uint64_t *a, uint64x2x3_t b) {
+ // CHECK: test_vst1q_u64_x3
+ vst1q_u64_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s8_x3(int8_t *a, int8x16x3_t b) {
+ // CHECK: test_vst1q_s8_x3
+ vst1q_s8_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s16_x3(int16_t *a, int16x8x3_t b) {
+ // CHECK: test_vst1q_s16_x3
+ vst1q_s16_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s32_x3(int32_t *a, int32x4x3_t b) {
+ // CHECK: test_vst1q_s32_x3
+ vst1q_s32_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s64_x3(int64_t *a, int64x2x3_t b) {
+ // CHECK: test_vst1q_s64_x3
+ vst1q_s64_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f16_x3(float16_t *a, float16x8x3_t b) {
+ // CHECK: test_vst1q_f16_x3
+ vst1q_f16_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f32_x3(float32_t *a, float32x4x3_t b) {
+ // CHECK: test_vst1q_f32_x3
+ vst1q_f32_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f64_x3(float64_t *a, float64x2x3_t b) {
+ // CHECK: test_vst1q_f64_x3
+ vst1q_f64_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p8_x3(poly8_t *a, poly8x16x3_t b) {
+ // CHECK: test_vst1q_p8_x3
+ vst1q_p8_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p16_x3(poly16_t *a, poly16x8x3_t b) {
+ // CHECK: test_vst1q_p16_x3
+ vst1q_p16_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p64_x3(poly64_t *a, poly64x2x3_t b) {
+ // CHECK: test_vst1q_p64_x3
+ vst1q_p64_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u8_x3(uint8_t *a, uint8x8x3_t b) {
+ // CHECK: test_vst1_u8_x3
+ vst1_u8_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u16_x3(uint16_t *a, uint16x4x3_t b) {
+ // CHECK: test_vst1_u16_x3
+ vst1_u16_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u32_x3(uint32_t *a, uint32x2x3_t b) {
+ // CHECK: test_vst1_u32_x3
+ vst1_u32_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u64_x3(uint64_t *a, uint64x1x3_t b) {
+ // CHECK: test_vst1_u64_x3
+ vst1_u64_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s8_x3(int8_t *a, int8x8x3_t b) {
+ // CHECK: test_vst1_s8_x3
+ vst1_s8_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s16_x3(int16_t *a, int16x4x3_t b) {
+ // CHECK: test_vst1_s16_x3
+ vst1_s16_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s32_x3(int32_t *a, int32x2x3_t b) {
+ // CHECK: test_vst1_s32_x3
+ vst1_s32_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s64_x3(int64_t *a, int64x1x3_t b) {
+ // CHECK: test_vst1_s64_x3
+ vst1_s64_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f16_x3(float16_t *a, float16x4x3_t b) {
+ // CHECK: test_vst1_f16_x3
+ vst1_f16_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f32_x3(float32_t *a, float32x2x3_t b) {
+ // CHECK: test_vst1_f32_x3
+ vst1_f32_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f64_x3(float64_t *a, float64x1x3_t b) {
+ // CHECK: test_vst1_f64_x3
+ vst1_f64_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p8_x3(poly8_t *a, poly8x8x3_t b) {
+ // CHECK: test_vst1_p8_x3
+ vst1_p8_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p16_x3(poly16_t *a, poly16x4x3_t b) {
+ // CHECK: test_vst1_p16_x3
+ vst1_p16_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p64_x3(poly64_t *a, poly64x1x3_t b) {
+ // CHECK: test_vst1_p64_x3
+ vst1_p64_x3(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u8_x4(uint8_t *a, uint8x16x4_t b) {
+ // CHECK: test_vst1q_u8_x4
+ vst1q_u8_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u16_x4(uint16_t *a, uint16x8x4_t b) {
+ // CHECK: test_vst1q_u16_x4
+ vst1q_u16_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u32_x4(uint32_t *a, uint32x4x4_t b) {
+ // CHECK: test_vst1q_u32_x4
+ vst1q_u32_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_u64_x4(uint64_t *a, uint64x2x4_t b) {
+ // CHECK: test_vst1q_u64_x4
+ vst1q_u64_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s8_x4(int8_t *a, int8x16x4_t b) {
+ // CHECK: test_vst1q_s8_x4
+ vst1q_s8_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s16_x4(int16_t *a, int16x8x4_t b) {
+ // CHECK: test_vst1q_s16_x4
+ vst1q_s16_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s32_x4(int32_t *a, int32x4x4_t b) {
+ // CHECK: test_vst1q_s32_x4
+ vst1q_s32_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_s64_x4(int64_t *a, int64x2x4_t b) {
+ // CHECK: test_vst1q_s64_x4
+ vst1q_s64_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f16_x4(float16_t *a, float16x8x4_t b) {
+ // CHECK: test_vst1q_f16_x4
+ vst1q_f16_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f32_x4(float32_t *a, float32x4x4_t b) {
+ // CHECK: test_vst1q_f32_x4
+ vst1q_f32_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_f64_x4(float64_t *a, float64x2x4_t b) {
+ // CHECK: test_vst1q_f64_x4
+ vst1q_f64_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p8_x4(poly8_t *a, poly8x16x4_t b) {
+ // CHECK: test_vst1q_p8_x4
+ vst1q_p8_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p16_x4(poly16_t *a, poly16x8x4_t b) {
+ // CHECK: test_vst1q_p16_x4
+ vst1q_p16_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p64_x4(poly64_t *a, poly64x2x4_t b) {
+ // CHECK: test_vst1q_p64_x4
+ vst1q_p64_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u8_x4(uint8_t *a, uint8x8x4_t b) {
+ // CHECK: test_vst1_u8_x4
+ vst1_u8_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u16_x4(uint16_t *a, uint16x4x4_t b) {
+ // CHECK: test_vst1_u16_x4
+ vst1_u16_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u32_x4(uint32_t *a, uint32x2x4_t b) {
+ // CHECK: test_vst1_u32_x4
+ vst1_u32_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_u64_x4(uint64_t *a, uint64x1x4_t b) {
+ // CHECK: test_vst1_u64_x4
+ vst1_u64_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s8_x4(int8_t *a, int8x8x4_t b) {
+ // CHECK: test_vst1_s8_x4
+ vst1_s8_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s16_x4(int16_t *a, int16x4x4_t b) {
+ // CHECK: test_vst1_s16_x4
+ vst1_s16_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s32_x4(int32_t *a, int32x2x4_t b) {
+ // CHECK: test_vst1_s32_x4
+ vst1_s32_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_s64_x4(int64_t *a, int64x1x4_t b) {
+ // CHECK: test_vst1_s64_x4
+ vst1_s64_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f16_x4(float16_t *a, float16x4x4_t b) {
+ // CHECK: test_vst1_f16_x4
+ vst1_f16_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f32_x4(float32_t *a, float32x2x4_t b) {
+ // CHECK: test_vst1_f32_x4
+ vst1_f32_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_f64_x4(float64_t *a, float64x1x4_t b) {
+ // CHECK: test_vst1_f64_x4
+ vst1_f64_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p8_x4(poly8_t *a, poly8x8x4_t b) {
+ // CHECK: test_vst1_p8_x4
+ vst1_p8_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p16_x4(poly16_t *a, poly16x4x4_t b) {
+ // CHECK: test_vst1_p16_x4
+ vst1_p16_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p64_x4(poly64_t *a, poly64x1x4_t b) {
+ // CHECK: test_vst1_p64_x4
+ vst1_p64_x4(a, b);
+ // CHECK: st1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+int64_t test_vceqd_s64(int64_t a, int64_t b) {
+// CHECK: test_vceqd_s64
+// CHECK: cmeq {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vceqd_s64(a, b);
+}
+
+uint64_t test_vceqd_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vceqd_u64
+// CHECK: cmeq {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vceqd_u64(a, b);
+}
+
+int64_t test_vceqzd_s64(int64_t a) {
+// CHECK: test_vceqzd_s64
+// CHECK: cmeq {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+ return (int64_t)vceqzd_s64(a);
+}
+
+int64_t test_vceqzd_u64(int64_t a) {
+// CHECK: test_vceqzd_u64
+// CHECK: cmeq {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+ return (int64_t)vceqzd_u64(a);
+}
+
+int64_t test_vcged_s64(int64_t a, int64_t b) {
+// CHECK: test_vcged_s64
+// CHECK: cmge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vcged_s64(a, b);
+}
+
+uint64_t test_vcged_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vcged_u64
+// CHECK: cmhs {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcged_u64(a, b);
+}
+
+int64_t test_vcgezd_s64(int64_t a) {
+// CHECK: test_vcgezd_s64
+// CHECK: cmge {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+ return (int64_t)vcgezd_s64(a);
+}
+
+int64_t test_vcgtd_s64(int64_t a, int64_t b) {
+// CHECK: test_vcgtd_s64
+// CHECK: cmgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vcgtd_s64(a, b);
+}
+
+uint64_t test_vcgtd_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vcgtd_u64
+// CHECK: cmhi {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcgtd_u64(a, b);
+}
+
+int64_t test_vcgtzd_s64(int64_t a) {
+// CHECK: test_vcgtzd_s64
+// CHECK: cmgt {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+ return (int64_t)vcgtzd_s64(a);
+}
+
+int64_t test_vcled_s64(int64_t a, int64_t b) {
+// CHECK: test_vcled_s64
+// CHECK: cmge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vcled_s64(a, b);
+}
+
+uint64_t test_vcled_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vcled_u64
+// CHECK: cmhs {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcled_u64(a, 0);
+}
+
+int64_t test_vclezd_s64(int64_t a) {
+// CHECK: test_vclezd_s64
+// CHECK: cmle {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+ return (int64_t)vclezd_s64(a);
+}
+
+int64_t test_vcltd_s64(int64_t a, int64_t b) {
+// CHECK: test_vcltd_s64
+// CHECK: cmgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vcltd_s64(a, b);
+}
+
+uint64_t test_vcltd_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vcltd_u64
+// CHECK: cmhi {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcltd_u64(a, b);
+}
+
+int64_t test_vcltzd_s64(int64_t a) {
+// CHECK: test_vcltzd_s64
+// CHECK: cmlt {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+ return (int64_t)vcltzd_s64(a);
+}
+
+int64_t test_vtstd_s64(int64_t a, int64_t b) {
+// CHECK: test_vtstd_s64
+// CHECK: cmtst {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vtstd_s64(a, b);
+}
+
+uint64_t test_vtstd_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vtstd_u64
+// CHECK: cmtst {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vtstd_u64(a, b);
+}
+
+int64_t test_vabsd_s64(int64_t a) {
+// CHECK: test_vabsd_s64
+// CHECK: abs {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vabsd_s64(a);
+}
+
+int8_t test_vqabsb_s8(int8_t a) {
+// CHECK: test_vqabsb_s8
+// CHECK: sqabs {{b[0-9]+}}, {{b[0-9]+}}
+ return (int8_t)vqabsb_s8(a);
+}
+
+int16_t test_vqabsh_s16(int16_t a) {
+// CHECK: test_vqabsh_s16
+// CHECK: sqabs {{h[0-9]+}}, {{h[0-9]+}}
+ return (int16_t)vqabsh_s16(a);
+}
+
+int32_t test_vqabss_s32(int32_t a) {
+// CHECK: test_vqabss_s32
+// CHECK: sqabs {{s[0-9]+}}, {{s[0-9]+}}
+ return (int32_t)vqabss_s32(a);
+}
+
+int64_t test_vqabsd_s64(int64_t a) {
+// CHECK: test_vqabsd_s64
+// CHECK: sqabs {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vqabsd_s64(a);
+}
+
+int64_t test_vnegd_s64(int64_t a) {
+// CHECK: test_vnegd_s64
+// CHECK: neg {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vnegd_s64(a);
+}
+
+int8_t test_vqnegb_s8(int8_t a) {
+// CHECK: test_vqnegb_s8
+// CHECK: sqneg {{b[0-9]+}}, {{b[0-9]+}}
+ return (int8_t)vqnegb_s8(a);
+}
+
+int16_t test_vqnegh_s16(int16_t a) {
+// CHECK: test_vqnegh_s16
+// CHECK: sqneg {{h[0-9]+}}, {{h[0-9]+}}
+ return (int16_t)vqnegh_s16(a);
+}
+
+int32_t test_vqnegs_s32(int32_t a) {
+// CHECK: test_vqnegs_s32
+// CHECK: sqneg {{s[0-9]+}}, {{s[0-9]+}}
+ return (int32_t)vqnegs_s32(a);
+}
+
+int64_t test_vqnegd_s64(int64_t a) {
+// CHECK: test_vqnegd_s64
+// CHECK: sqneg {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vqnegd_s64(a);
+}
+
+int8_t test_vuqaddb_s8(int8_t a, int8_t b) {
+// CHECK: test_vuqaddb_s8
+// CHECK: suqadd {{b[0-9]+}}, {{b[0-9]+}}
+ return (int8_t)vuqaddb_s8(a, b);
+}
+
+int16_t test_vuqaddh_s16(int16_t a, int16_t b) {
+// CHECK: test_vuqaddh_s16
+// CHECK: suqadd {{h[0-9]+}}, {{h[0-9]+}}
+ return (int16_t)vuqaddh_s16(a, b);
+}
+
+int32_t test_vuqadds_s32(int32_t a, int32_t b) {
+// CHECK: test_vuqadds_s32
+// CHECK: suqadd {{s[0-9]+}}, {{s[0-9]+}}
+ return (int32_t)vuqadds_s32(a, b);
+}
+
+int64_t test_vuqaddd_s64(int64_t a, int64_t b) {
+// CHECK: test_vuqaddd_s64
+// CHECK: suqadd {{d[0-9]+}}, {{d[0-9]+}}
+ return (int64_t)vuqaddd_s64(a, b);
+}
+
+uint8_t test_vsqaddb_u8(uint8_t a, uint8_t b) {
+// CHECK: test_vsqaddb_u8
+// CHECK: usqadd {{b[0-9]+}}, {{b[0-9]+}}
+ return (uint8_t)vsqaddb_u8(a, b);
+}
+
+uint16_t test_vsqaddh_u16(uint16_t a, uint16_t b) {
+// CHECK: test_vsqaddh_u16
+// CHECK: usqadd {{h[0-9]+}}, {{h[0-9]+}}
+ return (uint16_t)vsqaddh_u16(a, b);
+}
+
+uint32_t test_vsqadds_u32(uint32_t a, uint32_t b) {
+// CHECK: test_vsqadds_u32
+// CHECK: usqadd {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vsqadds_u32(a, b);
+}
+
+uint64_t test_vsqaddd_u64(uint64_t a, uint64_t b) {
+// CHECK: test_vsqaddd_u64
+// CHECK: usqadd {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vsqaddd_u64(a, b);
+}
+
+int32_t test_vqdmlalh_s16(int32_t a, int16_t b, int16_t c) {
+// CHECK: test_vqdmlalh_s16
+// CHECK: sqdmlal {{s[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+ return (int32_t)vqdmlalh_s16(a, b, c);
+}
+
+int64_t test_vqdmlals_s32(int64_t a, int32_t b, int32_t c) {
+// CHECK: test_vqdmlals_s32
+// CHECK: sqdmlal {{d[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (int64_t)vqdmlals_s32(a, b, c);
+}
+
+int32_t test_vqdmlslh_s16(int32_t a, int16_t b, int16_t c) {
+// CHECK: test_vqdmlslh_s16
+// CHECK: sqdmlsl {{s[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+ return (int32_t)vqdmlslh_s16(a, b, c);
+}
+
+int64_t test_vqdmlsls_s32(int64_t a, int32_t b, int32_t c) {
+// CHECK: test_vqdmlsls_s32
+// CHECK: sqdmlsl {{d[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (int64_t)vqdmlsls_s32(a, b, c);
+}
+
+int32_t test_vqdmullh_s16(int16_t a, int16_t b) {
+// CHECK: test_vqdmullh_s16
+// CHECK: sqdmull {{s[0-9]+}}, {{h[0-9]+}}, {{h[0-9]+}}
+ return (int32_t)vqdmullh_s16(a, b);
+}
+
+int64_t test_vqdmulls_s32(int32_t a, int32_t b) {
+// CHECK: test_vqdmulls_s32
+// CHECK: sqdmull {{d[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (int64_t)vqdmulls_s32(a, b);
+}
+
+int8_t test_vqmovunh_s16(int16_t a) {
+// CHECK: test_vqmovunh_s16
+// CHECK: sqxtun {{b[0-9]+}}, {{h[0-9]+}}
+ return (int8_t)vqmovunh_s16(a);
+}
+
+int16_t test_vqmovuns_s32(int32_t a) {
+// CHECK: test_vqmovuns_s32
+// CHECK: sqxtun {{h[0-9]+}}, {{s[0-9]+}}
+ return (int16_t)vqmovuns_s32(a);
+}
+
+int32_t test_vqmovund_s64(int64_t a) {
+// CHECK: test_vqmovund_s64
+// CHECK: sqxtun {{s[0-9]+}}, {{d[0-9]+}}
+ return (int32_t)vqmovund_s64(a);
+}
+
+int8_t test_vqmovnh_s16(int16_t a) {
+// CHECK: test_vqmovnh_s16
+// CHECK: sqxtn {{b[0-9]+}}, {{h[0-9]+}}
+ return (int8_t)vqmovnh_s16(a);
+}
+
+int16_t test_vqmovns_s32(int32_t a) {
+// CHECK: test_vqmovns_s32
+// CHECK: sqxtn {{h[0-9]+}}, {{s[0-9]+}}
+ return (int16_t)vqmovns_s32(a);
+}
+
+int32_t test_vqmovnd_s64(int64_t a) {
+// CHECK: test_vqmovnd_s64
+// CHECK: sqxtn {{s[0-9]+}}, {{d[0-9]+}}
+ return (int32_t)vqmovnd_s64(a);
+}
+
+int8_t test_vqmovnh_u16(int16_t a) {
+// CHECK: test_vqmovnh_u16
+// CHECK: uqxtn {{b[0-9]+}}, {{h[0-9]+}}
+ return (int8_t)vqmovnh_u16(a);
+}
+
+int16_t test_vqmovns_u32(int32_t a) {
+// CHECK: test_vqmovns_u32
+// CHECK: uqxtn {{h[0-9]+}}, {{s[0-9]+}}
+ return (int16_t)vqmovns_u32(a);
+}
+
+int32_t test_vqmovnd_u64(int64_t a) {
+// CHECK: test_vqmovnd_u64
+// CHECK: uqxtn {{s[0-9]+}}, {{d[0-9]+}}
+ return (int32_t)vqmovnd_u64(a);
+}
+
+uint32_t test_vceqs_f32(float32_t a, float32_t b) {
+// CHECK: test_vceqs_f32
+// CHECK: fcmeq {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vceqs_f32(a, b);
+}
+
+uint64_t test_vceqd_f64(float64_t a, float64_t b) {
+// CHECK: test_vceqd_f64
+// CHECK: fcmeq {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vceqd_f64(a, b);
+}
+
+uint32_t test_vceqzs_f32(float32_t a) {
+// CHECK: test_vceqzs_f32
+// CHECK: fcmeq {{s[0-9]+}}, {{s[0-9]+}}, #0.0
+ return (uint32_t)vceqzs_f32(a);
+}
+
+uint64_t test_vceqzd_f64(float64_t a) {
+// CHECK: test_vceqzd_f64
+// CHECK: fcmeq {{d[0-9]+}}, {{d[0-9]+}}, #0.0
+ return (uint64_t)vceqzd_f64(a);
+}
+
+uint32_t test_vcges_f32(float32_t a, float32_t b) {
+// CHECK: test_vcges_f32
+// CHECK: fcmge {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcges_f32(a, b);
+}
+
+uint64_t test_vcged_f64(float64_t a, float64_t b) {
+// CHECK: test_vcged_f64
+// CHECK: fcmge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcged_f64(a, b);
+}
+
+uint32_t test_vcgezs_f32(float32_t a) {
+// CHECK: test_vcgezs_f32
+// CHECK: fcmge {{s[0-9]+}}, {{s[0-9]+}}, #0.0
+ return (uint32_t)vcgezs_f32(a);
+}
+
+uint64_t test_vcgezd_f64(float64_t a) {
+// CHECK: test_vcgezd_f64
+// CHECK: fcmge {{d[0-9]+}}, {{d[0-9]+}}, #0.0
+ return (uint64_t)vcgezd_f64(a);
+}
+
+uint32_t test_vcgts_f32(float32_t a, float32_t b) {
+// CHECK: test_vcgts_f32
+// CHECK: fcmgt {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcgts_f32(a, b);
+}
+
+uint64_t test_vcgtd_f64(float64_t a, float64_t b) {
+// CHECK: test_vcgtd_f64
+// CHECK: fcmgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcgtd_f64(a, b);
+}
+
+uint32_t test_vcgtzs_f32(float32_t a) {
+// CHECK: test_vcgtzs_f32
+// CHECK: fcmgt {{s[0-9]+}}, {{s[0-9]+}}, #0.0
+ return (uint32_t)vcgtzs_f32(a);
+}
+
+uint64_t test_vcgtzd_f64(float64_t a) {
+// CHECK: test_vcgtzd_f64
+// CHECK: fcmgt {{d[0-9]+}}, {{d[0-9]+}}, #0.0
+ return (uint64_t)vcgtzd_f64(a);
+}
+
+uint32_t test_vcles_f32(float32_t a, float32_t b) {
+// CHECK: test_vcles_f32
+// CHECK: fcmge {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcles_f32(a, b);
+}
+
+uint64_t test_vcled_f64(float64_t a, float64_t b) {
+// CHECK: test_vcled_f64
+// CHECK: fcmge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcled_f64(a, b);
+}
+
+uint32_t test_vclezs_f32(float32_t a) {
+// CHECK: test_vclezs_f32
+// CHECK: fcmle {{s[0-9]+}}, {{s[0-9]+}}, #0.0
+ return (uint32_t)vclezs_f32(a);
+}
+
+uint64_t test_vclezd_f64(float64_t a) {
+// CHECK: test_vclezd_f64
+// CHECK: fcmle {{d[0-9]+}}, {{d[0-9]+}}, #0.0
+ return (uint64_t)vclezd_f64(a);
+}
+
+uint32_t test_vclts_f32(float32_t a, float32_t b) {
+// CHECK: test_vclts_f32
+// CHECK: fcmgt {{s[0-9]+}}, s1, s0
+ return (uint32_t)vclts_f32(a, b);
+}
+
+uint64_t test_vcltd_f64(float64_t a, float64_t b) {
+// CHECK: test_vcltd_f64
+// CHECK: fcmgt {{d[0-9]+}}, d1, d0
+ return (uint64_t)vcltd_f64(a, b);
+}
+
+uint32_t test_vcltzs_f32(float32_t a) {
+// CHECK: test_vcltzs_f32
+// CHECK: fcmlt {{s[0-9]+}}, {{s[0-9]+}}, #0.0
+ return (uint32_t)vcltzs_f32(a);
+}
+
+uint64_t test_vcltzd_f64(float64_t a) {
+// CHECK: test_vcltzd_f64
+// CHECK: fcmlt {{d[0-9]+}}, {{d[0-9]+}}, #0.0
+ return (uint64_t)vcltzd_f64(a);
+}
+
+uint32_t test_vcages_f32(float32_t a, float32_t b) {
+// CHECK: test_vcages_f32
+// CHECK: facge {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcages_f32(a, b);
+}
+
+uint64_t test_vcaged_f64(float64_t a, float64_t b) {
+// CHECK: test_vcaged_f64
+// CHECK: facge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcaged_f64(a, b);
+}
+
+uint32_t test_vcagts_f32(float32_t a, float32_t b) {
+// CHECK: test_vcagts_f32
+// CHECK: facgt {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcagts_f32(a, b);
+}
+
+uint64_t test_vcagtd_f64(float64_t a, float64_t b) {
+// CHECK: test_vcagtd_f64
+// CHECK: facgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcagtd_f64(a, b);
+}
+
+uint32_t test_vcales_f32(float32_t a, float32_t b) {
+// CHECK: test_vcales_f32
+// CHECK: facge {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcales_f32(a, b);
+}
+
+uint64_t test_vcaled_f64(float64_t a, float64_t b) {
+// CHECK: test_vcaled_f64
+// CHECK: facge {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcaled_f64(a, b);
+}
+
+uint32_t test_vcalts_f32(float32_t a, float32_t b) {
+// CHECK: test_vcalts_f32
+// CHECK: facgt {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return (uint32_t)vcalts_f32(a, b);
+}
+
+uint64_t test_vcaltd_f64(float64_t a, float64_t b) {
+// CHECK: test_vcaltd_f64
+// CHECK: facgt {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return (uint64_t)vcaltd_f64(a, b);
+}
+
+int64_t test_vshrd_n_s64(int64_t a) {
+// CHECK-LABEL: test_vshrd_n_s64
+// CHECK: sshr {{d[0-9]+}}, {{d[0-9]+}}, #1
+ return (int64_t)vshrd_n_s64(a, 1);
+}
+
+int64x1_t test_vshr_n_s64(int64x1_t a) {
+// CHECK-LABEL: test_vshr_n_s64
+// CHECK: sshr {{d[0-9]+}}, {{d[0-9]+}}, #1
+ return vshr_n_s64(a, 1);
+}
+
+uint64_t test_vshrd_n_u64(uint64_t a) {
+// CHECK-LABEL: test_vshrd_n_u64
+// CHECK: ushr {{d[0-9]+}}, {{d[0-9]+}}, #64
+ return (uint64_t)vshrd_n_u64(a, 64);
+}
+
+uint64x1_t test_vshr_n_u64(uint64x1_t a) {
+// CHECK-LABEL: test_vshr_n_u64
+// CHECK: ushr {{d[0-9]+}}, {{d[0-9]+}}, #1
+ return vshr_n_u64(a, 1);
+}
+
+int64_t test_vrshrd_n_s64(int64_t a) {
+// CHECK-LABEL: test_vrshrd_n_s64
+// CHECK: srshr {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (int64_t)vrshrd_n_s64(a, 63);
+}
+
+int64x1_t test_vrshr_n_s64(int64x1_t a) {
+// CHECK: test_vrshr_n_s64
+// CHECK: srshr d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vrshr_n_s64(a, 1);
+}
+
+uint64_t test_vrshrd_n_u64(uint64_t a) {
+// CHECK-LABEL: test_vrshrd_n_u64
+// CHECK: urshr {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (uint64_t)vrshrd_n_u64(a, 63);
+}
+
+uint64x1_t test_vrshr_n_u64(uint64x1_t a) {
+// CHECK: test_vrshr_n_u64
+// CHECK: urshr d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vrshr_n_u64(a, 1);
+}
+
+int64_t test_vsrad_n_s64(int64_t a, int64_t b) {
+// CHECK-LABEL: test_vsrad_n_s64
+// CHECK: ssra {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (int64_t)vsrad_n_s64(a, b, 63);
+}
+
+int64x1_t test_vsra_n_s64(int64x1_t a, int64x1_t b) {
+// CHECK: test_vsra_n_s64
+// CHECK: ssra d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vsra_n_s64(a, b, 1);
+}
+
+uint64_t test_vsrad_n_u64(uint64_t a, uint64_t b) {
+// CHECK-LABEL: test_vsrad_n_u64
+// CHECK: usra {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (uint64_t)vsrad_n_u64(a, b, 63);
+}
+
+uint64x1_t test_vsra_n_u64(uint64x1_t a, uint64x1_t b) {
+// CHECK: test_vsra_n_u64
+// CHECK: usra d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vsra_n_u64(a, b, 1);
+}
+
+int64_t test_vrsrad_n_s64(int64_t a, int64_t b) {
+// CHECK-LABEL: test_vrsrad_n_s64
+// CHECK: srsra {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (int64_t)vrsrad_n_s64(a, b, 63);
+}
+
+int64x1_t test_vrsra_n_s64(int64x1_t a, int64x1_t b) {
+// CHECK: test_vrsra_n_s64
+// CHECK: srsra d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vrsra_n_s64(a, b, 1);
+}
+
+uint64_t test_vrsrad_n_u64(uint64_t a, uint64_t b) {
+// CHECK-LABEL: test_vrsrad_n_u64
+// CHECK: ursra {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (uint64_t)vrsrad_n_u64(a, b, 63);
+}
+
+uint64x1_t test_vrsra_n_u64(uint64x1_t a, uint64x1_t b) {
+// CHECK: test_vrsra_n_u64
+// CHECK: ursra d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vrsra_n_u64(a, b, 1);
+}
+
+int64_t test_vshld_n_s64(int64_t a) {
+// CHECK-LABEL: test_vshld_n_s64
+// CHECK: shl {{d[0-9]+}}, {{d[0-9]+}}, #0
+ return (int64_t)vshld_n_s64(a, 0);
+}
+int64x1_t test_vshl_n_s64(int64x1_t a) {
+// CHECK: test_vshl_n_s64
+// CHECK: shl d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vshl_n_s64(a, 1);
+}
+
+uint64_t test_vshld_n_u64(uint64_t a) {
+// CHECK-LABEL: test_vshld_n_u64
+// CHECK: shl {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (uint64_t)vshld_n_u64(a, 63);
+}
+
+uint64x1_t test_vshl_n_u64(uint64x1_t a) {
+// CHECK: test_vshl_n_u64
+// CHECK: shl d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vshl_n_u64(a, 1);
+}
+
+int8_t test_vqshlb_n_s8(int8_t a) {
+// CHECK-LABEL: test_vqshlb_n_s8
+// CHECK: sqshl {{b[0-9]+}}, {{b[0-9]+}}, #7
+ return (int8_t)vqshlb_n_s8(a, 7);
+}
+
+int16_t test_vqshlh_n_s16(int16_t a) {
+// CHECK-LABEL: test_vqshlh_n_s16
+// CHECK: sqshl {{h[0-9]+}}, {{h[0-9]+}}, #15
+ return (int16_t)vqshlh_n_s16(a, 15);
+}
+
+int32_t test_vqshls_n_s32(int32_t a) {
+// CHECK-LABEL: test_vqshls_n_s32
+// CHECK: sqshl {{s[0-9]+}}, {{s[0-9]+}}, #31
+ return (int32_t)vqshls_n_s32(a, 31);
+}
+
+int64_t test_vqshld_n_s64(int64_t a) {
+// CHECK-LABEL: test_vqshld_n_s64
+// CHECK: sqshl {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (int64_t)vqshld_n_s64(a, 63);
+}
+
+int64x1_t test_vqshl_n_s64(int64x1_t a) {
+// CHECK: test_vqshl_n_s64
+// CHECK: sqshl d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vqshl_n_s64(a, 1);
+}
+
+uint8_t test_vqshlb_n_u8(uint8_t a) {
+// CHECK-LABEL: test_vqshlb_n_u8
+// CHECK: uqshl {{b[0-9]+}}, {{b[0-9]+}}, #7
+ return (uint8_t)vqshlb_n_u8(a, 7);
+}
+
+uint16_t test_vqshlh_n_u16(uint16_t a) {
+// CHECK-LABEL: test_vqshlh_n_u16
+// CHECK: uqshl {{h[0-9]+}}, {{h[0-9]+}}, #15
+ return (uint16_t)vqshlh_n_u16(a, 15);
+}
+
+uint32_t test_vqshls_n_u32(uint32_t a) {
+// CHECK-LABEL: test_vqshls_n_u32
+// CHECK: uqshl {{s[0-9]+}}, {{s[0-9]+}}, #31
+ return (uint32_t)vqshls_n_u32(a, 31);
+}
+
+uint64_t test_vqshld_n_u64(uint64_t a) {
+// CHECK-LABEL: test_vqshld_n_u64
+// CHECK: uqshl {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (uint64_t)vqshld_n_u64(a, 63);
+}
+
+uint64x1_t test_vqshl_n_u64(uint64x1_t a) {
+// CHECK: test_vqshl_n_u64
+// CHECK: uqshl d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vqshl_n_u64(a, 1);
+}
+
+int8_t test_vqshlub_n_s8(int8_t a) {
+// CHECK-LABEL: test_vqshlub_n_s8
+// CHECK: sqshlu {{b[0-9]+}}, {{b[0-9]+}}, #7
+ return (int8_t)vqshlub_n_s8(a, 7);
+}
+
+int16_t test_vqshluh_n_s16(int16_t a) {
+// CHECK-LABEL: test_vqshluh_n_s16
+// CHECK: sqshlu {{h[0-9]+}}, {{h[0-9]+}}, #15
+ return (int16_t)vqshluh_n_s16(a, 15);
+}
+
+int32_t test_vqshlus_n_s32(int32_t a) {
+// CHECK-LABEL: test_vqshlus_n_s32
+// CHECK: sqshlu {{s[0-9]+}}, {{s[0-9]+}}, #31
+ return (int32_t)vqshlus_n_s32(a, 31);
+}
+
+int64_t test_vqshlud_n_s64(int64_t a) {
+// CHECK-LABEL: test_vqshlud_n_s64
+// CHECK: sqshlu {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (int64_t)vqshlud_n_s64(a, 63);
+}
+
+uint64x1_t test_vqshlu_n_s64(int64x1_t a) {
+// CHECK: test_vqshlu_n_s64
+// CHECK: sqshlu d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vqshlu_n_s64(a, 1);
+}
+
+int64_t test_vsrid_n_s64(int64_t a, int64_t b) {
+// CHECK-LABEL: test_vsrid_n_s64
+// CHECK: sri {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (int64_t)vsrid_n_s64(a, b, 63);
+}
+
+int64x1_t test_vsri_n_s64(int64x1_t a, int64x1_t b) {
+// CHECK: test_vsri_n_s64
+// CHECK: sri d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vsri_n_s64(a, b, 1);
+}
+
+uint64_t test_vsrid_n_u64(uint64_t a, uint64_t b) {
+// CHECK-LABEL: test_vsrid_n_u64
+// CHECK: sri {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (uint64_t)vsrid_n_u64(a, b, 63);
+}
+
+uint64x1_t test_vsri_n_u64(uint64x1_t a, uint64x1_t b) {
+// CHECK: test_vsri_n_u64
+// CHECK: sri d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vsri_n_u64(a, b, 1);
+}
+
+int64_t test_vslid_n_s64(int64_t a, int64_t b) {
+// CHECK-LABEL: test_vslid_n_s64
+// CHECK: sli {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (int64_t)vslid_n_s64(a, b, 63);
+}
+
+int64x1_t test_vsli_n_s64(int64x1_t a, int64x1_t b) {
+// CHECK: test_vsli_n_s64
+// CHECK: sli d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vsli_n_s64(a, b, 1);
+}
+
+uint64_t test_vslid_n_u64(uint64_t a, uint64_t b) {
+// CHECK-LABEL: test_vslid_n_u64
+// CHECK: sli {{d[0-9]+}}, {{d[0-9]+}}, #63
+ return (uint64_t)vslid_n_u64(a, b, 63);
+}
+
+uint64x1_t test_vsli_n_u64(uint64x1_t a, uint64x1_t b) {
+// CHECK: test_vsli_n_u64
+// CHECK: sli d{{[0-9]+}}, d{{[0-9]+}}, #1
+ return vsli_n_u64(a, b, 1);
+}
+
+int8_t test_vqshrnh_n_s16(int16_t a) {
+// CHECK-LABEL: test_vqshrnh_n_s16
+// CHECK: sqshrn {{b[0-9]+}}, {{h[0-9]+}}, #8
+ return (int8_t)vqshrnh_n_s16(a, 8);
+}
+
+int16_t test_vqshrns_n_s32(int32_t a) {
+// CHECK-LABEL: test_vqshrns_n_s32
+// CHECK: sqshrn {{h[0-9]+}}, {{s[0-9]+}}, #16
+ return (int16_t)vqshrns_n_s32(a, 16);
+}
+
+int32_t test_vqshrnd_n_s64(int64_t a) {
+// CHECK-LABEL: test_vqshrnd_n_s64
+// CHECK: sqshrn {{s[0-9]+}}, {{d[0-9]+}}, #32
+ return (int32_t)vqshrnd_n_s64(a, 32);
+}
+
+uint8_t test_vqshrnh_n_u16(uint16_t a) {
+// CHECK-LABEL: test_vqshrnh_n_u16
+// CHECK: uqshrn {{b[0-9]+}}, {{h[0-9]+}}, #8
+ return (uint8_t)vqshrnh_n_u16(a, 8);
+}
+
+uint16_t test_vqshrns_n_u32(uint32_t a) {
+// CHECK-LABEL: test_vqshrns_n_u32
+// CHECK: uqshrn {{h[0-9]+}}, {{s[0-9]+}}, #16
+ return (uint16_t)vqshrns_n_u32(a, 16);
+}
+
+uint32_t test_vqshrnd_n_u64(uint64_t a) {
+// CHECK-LABEL: test_vqshrnd_n_u64
+// CHECK: uqshrn {{s[0-9]+}}, {{d[0-9]+}}, #32
+ return (uint32_t)vqshrnd_n_u64(a, 32);
+}
+
+int8_t test_vqrshrnh_n_s16(int16_t a) {
+// CHECK-LABEL: test_vqrshrnh_n_s16
+// CHECK: sqrshrn {{b[0-9]+}}, {{h[0-9]+}}, #8
+ return (int8_t)vqrshrnh_n_s16(a, 8);
+}
+
+int16_t test_vqrshrns_n_s32(int32_t a) {
+// CHECK-LABEL: test_vqrshrns_n_s32
+// CHECK: sqrshrn {{h[0-9]+}}, {{s[0-9]+}}, #16
+ return (int16_t)vqrshrns_n_s32(a, 16);
+}
+
+int32_t test_vqrshrnd_n_s64(int64_t a) {
+// CHECK-LABEL: test_vqrshrnd_n_s64
+// CHECK: sqrshrn {{s[0-9]+}}, {{d[0-9]+}}, #32
+ return (int32_t)vqrshrnd_n_s64(a, 32);
+}
+
+uint8_t test_vqrshrnh_n_u16(uint16_t a) {
+// CHECK-LABEL: test_vqrshrnh_n_u16
+// CHECK: uqrshrn {{b[0-9]+}}, {{h[0-9]+}}, #8
+ return (uint8_t)vqrshrnh_n_u16(a, 8);
+}
+
+uint16_t test_vqrshrns_n_u32(uint32_t a) {
+// CHECK-LABEL: test_vqrshrns_n_u32
+// CHECK: uqrshrn {{h[0-9]+}}, {{s[0-9]+}}, #16
+ return (uint16_t)vqrshrns_n_u32(a, 16);
+}
+
+uint32_t test_vqrshrnd_n_u64(uint64_t a) {
+// CHECK-LABEL: test_vqrshrnd_n_u64
+// CHECK: uqrshrn {{s[0-9]+}}, {{d[0-9]+}}, #32
+ return (uint32_t)vqrshrnd_n_u64(a, 32);
+}
+
+int8_t test_vqshrunh_n_s16(int16_t a) {
+// CHECK-LABEL: test_vqshrunh_n_s16
+// CHECK: sqshrun {{b[0-9]+}}, {{h[0-9]+}}, #8
+ return (int8_t)vqshrunh_n_s16(a, 8);
+}
+
+int16_t test_vqshruns_n_s32(int32_t a) {
+// CHECK-LABEL: test_vqshruns_n_s32
+// CHECK: sqshrun {{h[0-9]+}}, {{s[0-9]+}}, #16
+ return (int16_t)vqshruns_n_s32(a, 16);
+}
+
+int32_t test_vqshrund_n_s64(int64_t a) {
+// CHECK-LABEL: test_vqshrund_n_s64
+// CHECK: sqshrun {{s[0-9]+}}, {{d[0-9]+}}, #32
+ return (int32_t)vqshrund_n_s64(a, 32);
+}
+
+int8_t test_vqrshrunh_n_s16(int16_t a) {
+// CHECK-LABEL: test_vqrshrunh_n_s16
+// CHECK: sqrshrun {{b[0-9]+}}, {{h[0-9]+}}, #8
+ return (int8_t)vqrshrunh_n_s16(a, 8);
+}
+
+int16_t test_vqrshruns_n_s32(int32_t a) {
+// CHECK-LABEL: test_vqrshruns_n_s32
+// CHECK: sqrshrun {{h[0-9]+}}, {{s[0-9]+}}, #16
+ return (int16_t)vqrshruns_n_s32(a, 16);
+}
+
+int32_t test_vqrshrund_n_s64(int64_t a) {
+// CHECK-LABEL: test_vqrshrund_n_s64
+// CHECK: sqrshrun {{s[0-9]+}}, {{d[0-9]+}}, #32
+ return (int32_t)vqrshrund_n_s64(a, 32);
+}
+
+float32_t test_vcvts_n_f32_s32(int32_t a) {
+// CHECK: test_vcvts_n_f32_s32
+// CHECK: scvtf {{s[0-9]+}}, {{s[0-9]+}}, #1
+ return vcvts_n_f32_s32(a, 1);
+}
+
+float64_t test_vcvtd_n_f64_s64(int64_t a) {
+// CHECK: test_vcvtd_n_f64_s64
+// CHECK: scvtf {{d[0-9]+}}, {{d[0-9]+}}, #1
+ return vcvtd_n_f64_s64(a, 1);
+}
+
+float32_t test_vcvts_n_f32_u32(uint32_t a) {
+// CHECK: test_vcvts_n_f32_u32
+// CHECK: ucvtf {{s[0-9]+}}, {{s[0-9]+}}, #32
+ return vcvts_n_f32_u32(a, 32);
+}
+
+float64_t test_vcvtd_n_f64_u64(uint64_t a) {
+// CHECK: test_vcvtd_n_f64_u64
+// CHECK: ucvtf {{d[0-9]+}}, {{d[0-9]+}}, #64
+ return vcvtd_n_f64_u64(a, 64);
+}
+
+int32_t test_vcvts_n_s32_f32(float32_t a) {
+// CHECK: test_vcvts_n_s32_f32
+// CHECK: fcvtzs {{s[0-9]+}}, {{s[0-9]+}}, #1
+ return (int32_t)vcvts_n_s32_f32(a, 1);
+}
+
+int64_t test_vcvtd_n_s64_f64(float64_t a) {
+// CHECK: test_vcvtd_n_s64_f64
+// CHECK: fcvtzs {{d[0-9]+}}, {{d[0-9]+}}, #1
+ return (int64_t)vcvtd_n_s64_f64(a, 1);
+}
+
+uint32_t test_vcvts_n_u32_f32(float32_t a) {
+// CHECK: test_vcvts_n_u32_f32
+// CHECK: fcvtzu {{s[0-9]+}}, {{s[0-9]+}}, #32
+ return (uint32_t)vcvts_n_u32_f32(a, 32);
+}
+
+uint64_t test_vcvtd_n_u64_f64(float64_t a) {
+// CHECK: test_vcvtd_n_u64_f64
+// CHECK: fcvtzu {{d[0-9]+}}, {{d[0-9]+}}, #64
+ return (uint64_t)vcvtd_n_u64_f64(a, 64);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_s16
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_s16(int16x4_t a) {
+ return vreinterpret_s8_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_s32
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_s32(int32x2_t a) {
+ return vreinterpret_s8_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_s64
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_s64(int64x1_t a) {
+ return vreinterpret_s8_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_u8
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_u8(uint8x8_t a) {
+ return vreinterpret_s8_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_u16
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_u16(uint16x4_t a) {
+ return vreinterpret_s8_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_u32
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_u32(uint32x2_t a) {
+ return vreinterpret_s8_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_u64
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_u64(uint64x1_t a) {
+ return vreinterpret_s8_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_f16
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_f16(float16x4_t a) {
+ return vreinterpret_s8_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_f32
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_f32(float32x2_t a) {
+ return vreinterpret_s8_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_f64
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_f64(float64x1_t a) {
+ return vreinterpret_s8_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_p8
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_p8(poly8x8_t a) {
+ return vreinterpret_s8_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_p16
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_p16(poly16x4_t a) {
+ return vreinterpret_s8_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s8_p64
+// CHECK-NEXT: ret
+int8x8_t test_vreinterpret_s8_p64(poly64x1_t a) {
+ return vreinterpret_s8_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_s8
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_s8(int8x8_t a) {
+ return vreinterpret_s16_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_s32
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_s32(int32x2_t a) {
+ return vreinterpret_s16_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_s64
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_s64(int64x1_t a) {
+ return vreinterpret_s16_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_u8
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_u8(uint8x8_t a) {
+ return vreinterpret_s16_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_u16
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_u16(uint16x4_t a) {
+ return vreinterpret_s16_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_u32
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_u32(uint32x2_t a) {
+ return vreinterpret_s16_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_u64
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_u64(uint64x1_t a) {
+ return vreinterpret_s16_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_f16
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_f16(float16x4_t a) {
+ return vreinterpret_s16_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_f32
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_f32(float32x2_t a) {
+ return vreinterpret_s16_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_f64
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_f64(float64x1_t a) {
+ return vreinterpret_s16_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_p8
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_p8(poly8x8_t a) {
+ return vreinterpret_s16_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_p16
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_p16(poly16x4_t a) {
+ return vreinterpret_s16_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s16_p64
+// CHECK-NEXT: ret
+int16x4_t test_vreinterpret_s16_p64(poly64x1_t a) {
+ return vreinterpret_s16_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_s8
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_s8(int8x8_t a) {
+ return vreinterpret_s32_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_s16
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_s16(int16x4_t a) {
+ return vreinterpret_s32_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_s64
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_s64(int64x1_t a) {
+ return vreinterpret_s32_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_u8
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_u8(uint8x8_t a) {
+ return vreinterpret_s32_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_u16
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_u16(uint16x4_t a) {
+ return vreinterpret_s32_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_u32
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_u32(uint32x2_t a) {
+ return vreinterpret_s32_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_u64
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_u64(uint64x1_t a) {
+ return vreinterpret_s32_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_f16
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_f16(float16x4_t a) {
+ return vreinterpret_s32_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_f32
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_f32(float32x2_t a) {
+ return vreinterpret_s32_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_f64
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_f64(float64x1_t a) {
+ return vreinterpret_s32_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_p8
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_p8(poly8x8_t a) {
+ return vreinterpret_s32_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_p16
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_p16(poly16x4_t a) {
+ return vreinterpret_s32_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s32_p64
+// CHECK-NEXT: ret
+int32x2_t test_vreinterpret_s32_p64(poly64x1_t a) {
+ return vreinterpret_s32_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_s8
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_s8(int8x8_t a) {
+ return vreinterpret_s64_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_s16
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_s16(int16x4_t a) {
+ return vreinterpret_s64_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_s32
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_s32(int32x2_t a) {
+ return vreinterpret_s64_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_u8
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_u8(uint8x8_t a) {
+ return vreinterpret_s64_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_u16
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_u16(uint16x4_t a) {
+ return vreinterpret_s64_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_u32
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_u32(uint32x2_t a) {
+ return vreinterpret_s64_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_u64
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_u64(uint64x1_t a) {
+ return vreinterpret_s64_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_f16
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_f16(float16x4_t a) {
+ return vreinterpret_s64_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_f32
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_f32(float32x2_t a) {
+ return vreinterpret_s64_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_f64
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_f64(float64x1_t a) {
+ return vreinterpret_s64_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_p8
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_p8(poly8x8_t a) {
+ return vreinterpret_s64_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_p16
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_p16(poly16x4_t a) {
+ return vreinterpret_s64_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_s64_p64
+// CHECK-NEXT: ret
+int64x1_t test_vreinterpret_s64_p64(poly64x1_t a) {
+ return vreinterpret_s64_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_s8
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_s8(int8x8_t a) {
+ return vreinterpret_u8_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_s16
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_s16(int16x4_t a) {
+ return vreinterpret_u8_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_s32
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_s32(int32x2_t a) {
+ return vreinterpret_u8_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_s64
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_s64(int64x1_t a) {
+ return vreinterpret_u8_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_u16
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_u16(uint16x4_t a) {
+ return vreinterpret_u8_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_u32
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_u32(uint32x2_t a) {
+ return vreinterpret_u8_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_u64
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_u64(uint64x1_t a) {
+ return vreinterpret_u8_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_f16
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_f16(float16x4_t a) {
+ return vreinterpret_u8_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_f32
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_f32(float32x2_t a) {
+ return vreinterpret_u8_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_f64
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_f64(float64x1_t a) {
+ return vreinterpret_u8_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_p8
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_p8(poly8x8_t a) {
+ return vreinterpret_u8_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_p16
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_p16(poly16x4_t a) {
+ return vreinterpret_u8_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u8_p64
+// CHECK-NEXT: ret
+uint8x8_t test_vreinterpret_u8_p64(poly64x1_t a) {
+ return vreinterpret_u8_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_s8
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_s8(int8x8_t a) {
+ return vreinterpret_u16_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_s16
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_s16(int16x4_t a) {
+ return vreinterpret_u16_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_s32
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_s32(int32x2_t a) {
+ return vreinterpret_u16_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_s64
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_s64(int64x1_t a) {
+ return vreinterpret_u16_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_u8
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_u8(uint8x8_t a) {
+ return vreinterpret_u16_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_u32
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_u32(uint32x2_t a) {
+ return vreinterpret_u16_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_u64
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_u64(uint64x1_t a) {
+ return vreinterpret_u16_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_f16
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_f16(float16x4_t a) {
+ return vreinterpret_u16_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_f32
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_f32(float32x2_t a) {
+ return vreinterpret_u16_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_f64
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_f64(float64x1_t a) {
+ return vreinterpret_u16_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_p8
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_p8(poly8x8_t a) {
+ return vreinterpret_u16_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_p16
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_p16(poly16x4_t a) {
+ return vreinterpret_u16_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u16_p64
+// CHECK-NEXT: ret
+uint16x4_t test_vreinterpret_u16_p64(poly64x1_t a) {
+ return vreinterpret_u16_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_s8
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_s8(int8x8_t a) {
+ return vreinterpret_u32_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_s16
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_s16(int16x4_t a) {
+ return vreinterpret_u32_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_s32
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_s32(int32x2_t a) {
+ return vreinterpret_u32_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_s64
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_s64(int64x1_t a) {
+ return vreinterpret_u32_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_u8
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_u8(uint8x8_t a) {
+ return vreinterpret_u32_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_u16
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_u16(uint16x4_t a) {
+ return vreinterpret_u32_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_u64
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_u64(uint64x1_t a) {
+ return vreinterpret_u32_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_f16
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_f16(float16x4_t a) {
+ return vreinterpret_u32_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_f32
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_f32(float32x2_t a) {
+ return vreinterpret_u32_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_f64
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_f64(float64x1_t a) {
+ return vreinterpret_u32_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_p8
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_p8(poly8x8_t a) {
+ return vreinterpret_u32_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_p16
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_p16(poly16x4_t a) {
+ return vreinterpret_u32_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u32_p64
+// CHECK-NEXT: ret
+uint32x2_t test_vreinterpret_u32_p64(poly64x1_t a) {
+ return vreinterpret_u32_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_s8
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_s8(int8x8_t a) {
+ return vreinterpret_u64_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_s16
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_s16(int16x4_t a) {
+ return vreinterpret_u64_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_s32
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_s32(int32x2_t a) {
+ return vreinterpret_u64_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_s64
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_s64(int64x1_t a) {
+ return vreinterpret_u64_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_u8
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_u8(uint8x8_t a) {
+ return vreinterpret_u64_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_u16
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_u16(uint16x4_t a) {
+ return vreinterpret_u64_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_u32
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_u32(uint32x2_t a) {
+ return vreinterpret_u64_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_f16
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_f16(float16x4_t a) {
+ return vreinterpret_u64_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_f32
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_f32(float32x2_t a) {
+ return vreinterpret_u64_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_f64
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_f64(float64x1_t a) {
+ return vreinterpret_u64_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_p8
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_p8(poly8x8_t a) {
+ return vreinterpret_u64_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_p16
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_p16(poly16x4_t a) {
+ return vreinterpret_u64_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_u64_p64
+// CHECK-NEXT: ret
+uint64x1_t test_vreinterpret_u64_p64(poly64x1_t a) {
+ return vreinterpret_u64_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_s8
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_s8(int8x8_t a) {
+ return vreinterpret_f16_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_s16
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_s16(int16x4_t a) {
+ return vreinterpret_f16_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_s32
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_s32(int32x2_t a) {
+ return vreinterpret_f16_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_s64
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_s64(int64x1_t a) {
+ return vreinterpret_f16_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_u8
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_u8(uint8x8_t a) {
+ return vreinterpret_f16_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_u16
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_u16(uint16x4_t a) {
+ return vreinterpret_f16_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_u32
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_u32(uint32x2_t a) {
+ return vreinterpret_f16_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_u64
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_u64(uint64x1_t a) {
+ return vreinterpret_f16_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_f32
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_f32(float32x2_t a) {
+ return vreinterpret_f16_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_f64
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_f64(float64x1_t a) {
+ return vreinterpret_f16_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_p8
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_p8(poly8x8_t a) {
+ return vreinterpret_f16_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_p16
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_p16(poly16x4_t a) {
+ return vreinterpret_f16_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f16_p64
+// CHECK-NEXT: ret
+float16x4_t test_vreinterpret_f16_p64(poly64x1_t a) {
+ return vreinterpret_f16_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_s8
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_s8(int8x8_t a) {
+ return vreinterpret_f32_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_s16
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_s16(int16x4_t a) {
+ return vreinterpret_f32_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_s32
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_s32(int32x2_t a) {
+ return vreinterpret_f32_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_s64
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_s64(int64x1_t a) {
+ return vreinterpret_f32_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_u8
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_u8(uint8x8_t a) {
+ return vreinterpret_f32_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_u16
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_u16(uint16x4_t a) {
+ return vreinterpret_f32_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_u32
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_u32(uint32x2_t a) {
+ return vreinterpret_f32_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_u64
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_u64(uint64x1_t a) {
+ return vreinterpret_f32_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_f16
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_f16(float16x4_t a) {
+ return vreinterpret_f32_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_f64
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_f64(float64x1_t a) {
+ return vreinterpret_f32_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_p8
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_p8(poly8x8_t a) {
+ return vreinterpret_f32_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_p16
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_p16(poly16x4_t a) {
+ return vreinterpret_f32_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f32_p64
+// CHECK-NEXT: ret
+float32x2_t test_vreinterpret_f32_p64(poly64x1_t a) {
+ return vreinterpret_f32_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_s8
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_s8(int8x8_t a) {
+ return vreinterpret_f64_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_s16
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_s16(int16x4_t a) {
+ return vreinterpret_f64_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_s32
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_s32(int32x2_t a) {
+ return vreinterpret_f64_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_s64
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_s64(int64x1_t a) {
+ return vreinterpret_f64_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_u8
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_u8(uint8x8_t a) {
+ return vreinterpret_f64_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_u16
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_u16(uint16x4_t a) {
+ return vreinterpret_f64_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_u32
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_u32(uint32x2_t a) {
+ return vreinterpret_f64_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_u64
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_u64(uint64x1_t a) {
+ return vreinterpret_f64_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_f16
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_f16(float16x4_t a) {
+ return vreinterpret_f64_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_f32
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_f32(float32x2_t a) {
+ return vreinterpret_f64_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_p8
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_p8(poly8x8_t a) {
+ return vreinterpret_f64_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_p16
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_p16(poly16x4_t a) {
+ return vreinterpret_f64_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_f64_p64
+// CHECK-NEXT: ret
+float64x1_t test_vreinterpret_f64_p64(poly64x1_t a) {
+ return vreinterpret_f64_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_s8
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_s8(int8x8_t a) {
+ return vreinterpret_p8_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_s16
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_s16(int16x4_t a) {
+ return vreinterpret_p8_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_s32
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_s32(int32x2_t a) {
+ return vreinterpret_p8_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_s64
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_s64(int64x1_t a) {
+ return vreinterpret_p8_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_u8
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_u8(uint8x8_t a) {
+ return vreinterpret_p8_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_u16
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_u16(uint16x4_t a) {
+ return vreinterpret_p8_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_u32
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_u32(uint32x2_t a) {
+ return vreinterpret_p8_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_u64
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_u64(uint64x1_t a) {
+ return vreinterpret_p8_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_f16
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_f16(float16x4_t a) {
+ return vreinterpret_p8_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_f32
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_f32(float32x2_t a) {
+ return vreinterpret_p8_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_f64
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_f64(float64x1_t a) {
+ return vreinterpret_p8_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_p16
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_p16(poly16x4_t a) {
+ return vreinterpret_p8_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p8_p64
+// CHECK-NEXT: ret
+poly8x8_t test_vreinterpret_p8_p64(poly64x1_t a) {
+ return vreinterpret_p8_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_s8
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_s8(int8x8_t a) {
+ return vreinterpret_p16_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_s16
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_s16(int16x4_t a) {
+ return vreinterpret_p16_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_s32
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_s32(int32x2_t a) {
+ return vreinterpret_p16_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_s64
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_s64(int64x1_t a) {
+ return vreinterpret_p16_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_u8
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_u8(uint8x8_t a) {
+ return vreinterpret_p16_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_u16
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_u16(uint16x4_t a) {
+ return vreinterpret_p16_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_u32
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_u32(uint32x2_t a) {
+ return vreinterpret_p16_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_u64
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_u64(uint64x1_t a) {
+ return vreinterpret_p16_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_f16
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_f16(float16x4_t a) {
+ return vreinterpret_p16_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_f32
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_f32(float32x2_t a) {
+ return vreinterpret_p16_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_f64
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_f64(float64x1_t a) {
+ return vreinterpret_p16_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_p8
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_p8(poly8x8_t a) {
+ return vreinterpret_p16_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p16_p64
+// CHECK-NEXT: ret
+poly16x4_t test_vreinterpret_p16_p64(poly64x1_t a) {
+ return vreinterpret_p16_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_s8
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_s8(int8x8_t a) {
+ return vreinterpret_p64_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_s16
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_s16(int16x4_t a) {
+ return vreinterpret_p64_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_s32
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_s32(int32x2_t a) {
+ return vreinterpret_p64_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_s64
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_s64(int64x1_t a) {
+ return vreinterpret_p64_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_u8
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_u8(uint8x8_t a) {
+ return vreinterpret_p64_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_u16
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_u16(uint16x4_t a) {
+ return vreinterpret_p64_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_u32
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_u32(uint32x2_t a) {
+ return vreinterpret_p64_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_u64
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_u64(uint64x1_t a) {
+ return vreinterpret_p64_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_f16
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_f16(float16x4_t a) {
+ return vreinterpret_p64_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_f32
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_f32(float32x2_t a) {
+ return vreinterpret_p64_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_f64
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_f64(float64x1_t a) {
+ return vreinterpret_p64_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_p8
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_p8(poly8x8_t a) {
+ return vreinterpret_p64_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpret_p64_p16
+// CHECK-NEXT: ret
+poly64x1_t test_vreinterpret_p64_p16(poly16x4_t a) {
+ return vreinterpret_p64_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_s16
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_s16(int16x8_t a) {
+ return vreinterpretq_s8_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_s32
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_s32(int32x4_t a) {
+ return vreinterpretq_s8_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_s64
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_s64(int64x2_t a) {
+ return vreinterpretq_s8_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_u8
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_u8(uint8x16_t a) {
+ return vreinterpretq_s8_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_u16
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_u16(uint16x8_t a) {
+ return vreinterpretq_s8_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_u32
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_u32(uint32x4_t a) {
+ return vreinterpretq_s8_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_u64
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_u64(uint64x2_t a) {
+ return vreinterpretq_s8_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_f16
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_f16(float16x8_t a) {
+ return vreinterpretq_s8_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_f32
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_f32(float32x4_t a) {
+ return vreinterpretq_s8_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_f64
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_f64(float64x2_t a) {
+ return vreinterpretq_s8_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_p8
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_p8(poly8x16_t a) {
+ return vreinterpretq_s8_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_p16
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_p16(poly16x8_t a) {
+ return vreinterpretq_s8_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s8_p64
+// CHECK-NEXT: ret
+int8x16_t test_vreinterpretq_s8_p64(poly64x2_t a) {
+ return vreinterpretq_s8_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_s8
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_s8(int8x16_t a) {
+ return vreinterpretq_s16_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_s32
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_s32(int32x4_t a) {
+ return vreinterpretq_s16_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_s64
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_s64(int64x2_t a) {
+ return vreinterpretq_s16_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_u8
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_u8(uint8x16_t a) {
+ return vreinterpretq_s16_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_u16
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_u16(uint16x8_t a) {
+ return vreinterpretq_s16_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_u32
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_u32(uint32x4_t a) {
+ return vreinterpretq_s16_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_u64
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_u64(uint64x2_t a) {
+ return vreinterpretq_s16_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_f16
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_f16(float16x8_t a) {
+ return vreinterpretq_s16_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_f32
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_f32(float32x4_t a) {
+ return vreinterpretq_s16_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_f64
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_f64(float64x2_t a) {
+ return vreinterpretq_s16_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_p8
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_p8(poly8x16_t a) {
+ return vreinterpretq_s16_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_p16
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_p16(poly16x8_t a) {
+ return vreinterpretq_s16_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s16_p64
+// CHECK-NEXT: ret
+int16x8_t test_vreinterpretq_s16_p64(poly64x2_t a) {
+ return vreinterpretq_s16_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_s8
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_s8(int8x16_t a) {
+ return vreinterpretq_s32_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_s16
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_s16(int16x8_t a) {
+ return vreinterpretq_s32_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_s64
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_s64(int64x2_t a) {
+ return vreinterpretq_s32_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_u8
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_u8(uint8x16_t a) {
+ return vreinterpretq_s32_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_u16
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_u16(uint16x8_t a) {
+ return vreinterpretq_s32_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_u32
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_u32(uint32x4_t a) {
+ return vreinterpretq_s32_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_u64
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_u64(uint64x2_t a) {
+ return vreinterpretq_s32_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_f16
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_f16(float16x8_t a) {
+ return vreinterpretq_s32_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_f32
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_f32(float32x4_t a) {
+ return vreinterpretq_s32_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_f64
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_f64(float64x2_t a) {
+ return vreinterpretq_s32_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_p8
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_p8(poly8x16_t a) {
+ return vreinterpretq_s32_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_p16
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_p16(poly16x8_t a) {
+ return vreinterpretq_s32_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s32_p64
+// CHECK-NEXT: ret
+int32x4_t test_vreinterpretq_s32_p64(poly64x2_t a) {
+ return vreinterpretq_s32_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_s8
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_s8(int8x16_t a) {
+ return vreinterpretq_s64_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_s16
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_s16(int16x8_t a) {
+ return vreinterpretq_s64_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_s32
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_s32(int32x4_t a) {
+ return vreinterpretq_s64_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_u8
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_u8(uint8x16_t a) {
+ return vreinterpretq_s64_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_u16
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_u16(uint16x8_t a) {
+ return vreinterpretq_s64_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_u32
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_u32(uint32x4_t a) {
+ return vreinterpretq_s64_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_u64
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_u64(uint64x2_t a) {
+ return vreinterpretq_s64_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_f16
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_f16(float16x8_t a) {
+ return vreinterpretq_s64_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_f32
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_f32(float32x4_t a) {
+ return vreinterpretq_s64_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_f64
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_f64(float64x2_t a) {
+ return vreinterpretq_s64_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_p8
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_p8(poly8x16_t a) {
+ return vreinterpretq_s64_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_p16
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_p16(poly16x8_t a) {
+ return vreinterpretq_s64_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_s64_p64
+// CHECK-NEXT: ret
+int64x2_t test_vreinterpretq_s64_p64(poly64x2_t a) {
+ return vreinterpretq_s64_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_s8
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_s8(int8x16_t a) {
+ return vreinterpretq_u8_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_s16
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_s16(int16x8_t a) {
+ return vreinterpretq_u8_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_s32
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_s32(int32x4_t a) {
+ return vreinterpretq_u8_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_s64
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_s64(int64x2_t a) {
+ return vreinterpretq_u8_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_u16
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_u16(uint16x8_t a) {
+ return vreinterpretq_u8_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_u32
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_u32(uint32x4_t a) {
+ return vreinterpretq_u8_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_u64
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_u64(uint64x2_t a) {
+ return vreinterpretq_u8_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_f16
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_f16(float16x8_t a) {
+ return vreinterpretq_u8_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_f32
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_f32(float32x4_t a) {
+ return vreinterpretq_u8_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_f64
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_f64(float64x2_t a) {
+ return vreinterpretq_u8_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_p8
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_p8(poly8x16_t a) {
+ return vreinterpretq_u8_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_p16
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_p16(poly16x8_t a) {
+ return vreinterpretq_u8_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u8_p64
+// CHECK-NEXT: ret
+uint8x16_t test_vreinterpretq_u8_p64(poly64x2_t a) {
+ return vreinterpretq_u8_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_s8
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_s8(int8x16_t a) {
+ return vreinterpretq_u16_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_s16
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_s16(int16x8_t a) {
+ return vreinterpretq_u16_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_s32
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_s32(int32x4_t a) {
+ return vreinterpretq_u16_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_s64
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_s64(int64x2_t a) {
+ return vreinterpretq_u16_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_u8
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_u8(uint8x16_t a) {
+ return vreinterpretq_u16_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_u32
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_u32(uint32x4_t a) {
+ return vreinterpretq_u16_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_u64
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_u64(uint64x2_t a) {
+ return vreinterpretq_u16_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_f16
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_f16(float16x8_t a) {
+ return vreinterpretq_u16_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_f32
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_f32(float32x4_t a) {
+ return vreinterpretq_u16_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_f64
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_f64(float64x2_t a) {
+ return vreinterpretq_u16_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_p8
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_p8(poly8x16_t a) {
+ return vreinterpretq_u16_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_p16
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_p16(poly16x8_t a) {
+ return vreinterpretq_u16_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u16_p64
+// CHECK-NEXT: ret
+uint16x8_t test_vreinterpretq_u16_p64(poly64x2_t a) {
+ return vreinterpretq_u16_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_s8
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_s8(int8x16_t a) {
+ return vreinterpretq_u32_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_s16
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_s16(int16x8_t a) {
+ return vreinterpretq_u32_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_s32
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_s32(int32x4_t a) {
+ return vreinterpretq_u32_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_s64
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_s64(int64x2_t a) {
+ return vreinterpretq_u32_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_u8
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_u8(uint8x16_t a) {
+ return vreinterpretq_u32_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_u16
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_u16(uint16x8_t a) {
+ return vreinterpretq_u32_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_u64
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_u64(uint64x2_t a) {
+ return vreinterpretq_u32_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_f16
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_f16(float16x8_t a) {
+ return vreinterpretq_u32_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_f32
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_f32(float32x4_t a) {
+ return vreinterpretq_u32_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_f64
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_f64(float64x2_t a) {
+ return vreinterpretq_u32_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_p8
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_p8(poly8x16_t a) {
+ return vreinterpretq_u32_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_p16
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_p16(poly16x8_t a) {
+ return vreinterpretq_u32_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u32_p64
+// CHECK-NEXT: ret
+uint32x4_t test_vreinterpretq_u32_p64(poly64x2_t a) {
+ return vreinterpretq_u32_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_s8
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_s8(int8x16_t a) {
+ return vreinterpretq_u64_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_s16
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_s16(int16x8_t a) {
+ return vreinterpretq_u64_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_s32
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_s32(int32x4_t a) {
+ return vreinterpretq_u64_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_s64
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_s64(int64x2_t a) {
+ return vreinterpretq_u64_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_u8
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_u8(uint8x16_t a) {
+ return vreinterpretq_u64_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_u16
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_u16(uint16x8_t a) {
+ return vreinterpretq_u64_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_u32
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_u32(uint32x4_t a) {
+ return vreinterpretq_u64_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_f16
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_f16(float16x8_t a) {
+ return vreinterpretq_u64_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_f32
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_f32(float32x4_t a) {
+ return vreinterpretq_u64_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_f64
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_f64(float64x2_t a) {
+ return vreinterpretq_u64_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_p8
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_p8(poly8x16_t a) {
+ return vreinterpretq_u64_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_p16
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_p16(poly16x8_t a) {
+ return vreinterpretq_u64_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_u64_p64
+// CHECK-NEXT: ret
+uint64x2_t test_vreinterpretq_u64_p64(poly64x2_t a) {
+ return vreinterpretq_u64_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_s8
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_s8(int8x16_t a) {
+ return vreinterpretq_f16_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_s16
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_s16(int16x8_t a) {
+ return vreinterpretq_f16_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_s32
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_s32(int32x4_t a) {
+ return vreinterpretq_f16_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_s64
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_s64(int64x2_t a) {
+ return vreinterpretq_f16_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_u8
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_u8(uint8x16_t a) {
+ return vreinterpretq_f16_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_u16
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_u16(uint16x8_t a) {
+ return vreinterpretq_f16_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_u32
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_u32(uint32x4_t a) {
+ return vreinterpretq_f16_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_u64
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_u64(uint64x2_t a) {
+ return vreinterpretq_f16_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_f32
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_f32(float32x4_t a) {
+ return vreinterpretq_f16_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_f64
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_f64(float64x2_t a) {
+ return vreinterpretq_f16_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_p8
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_p8(poly8x16_t a) {
+ return vreinterpretq_f16_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_p16
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_p16(poly16x8_t a) {
+ return vreinterpretq_f16_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f16_p64
+// CHECK-NEXT: ret
+float16x8_t test_vreinterpretq_f16_p64(poly64x2_t a) {
+ return vreinterpretq_f16_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_s8
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_s8(int8x16_t a) {
+ return vreinterpretq_f32_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_s16
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_s16(int16x8_t a) {
+ return vreinterpretq_f32_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_s32
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_s32(int32x4_t a) {
+ return vreinterpretq_f32_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_s64
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_s64(int64x2_t a) {
+ return vreinterpretq_f32_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_u8
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_u8(uint8x16_t a) {
+ return vreinterpretq_f32_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_u16
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_u16(uint16x8_t a) {
+ return vreinterpretq_f32_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_u32
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_u32(uint32x4_t a) {
+ return vreinterpretq_f32_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_u64
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_u64(uint64x2_t a) {
+ return vreinterpretq_f32_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_f16
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_f16(float16x8_t a) {
+ return vreinterpretq_f32_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_f64
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_f64(float64x2_t a) {
+ return vreinterpretq_f32_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_p8
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_p8(poly8x16_t a) {
+ return vreinterpretq_f32_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_p16
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_p16(poly16x8_t a) {
+ return vreinterpretq_f32_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f32_p64
+// CHECK-NEXT: ret
+float32x4_t test_vreinterpretq_f32_p64(poly64x2_t a) {
+ return vreinterpretq_f32_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_s8
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_s8(int8x16_t a) {
+ return vreinterpretq_f64_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_s16
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_s16(int16x8_t a) {
+ return vreinterpretq_f64_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_s32
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_s32(int32x4_t a) {
+ return vreinterpretq_f64_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_s64
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_s64(int64x2_t a) {
+ return vreinterpretq_f64_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_u8
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_u8(uint8x16_t a) {
+ return vreinterpretq_f64_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_u16
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_u16(uint16x8_t a) {
+ return vreinterpretq_f64_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_u32
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_u32(uint32x4_t a) {
+ return vreinterpretq_f64_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_u64
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_u64(uint64x2_t a) {
+ return vreinterpretq_f64_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_f16
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_f16(float16x8_t a) {
+ return vreinterpretq_f64_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_f32
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_f32(float32x4_t a) {
+ return vreinterpretq_f64_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_p8
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_p8(poly8x16_t a) {
+ return vreinterpretq_f64_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_p16
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_p16(poly16x8_t a) {
+ return vreinterpretq_f64_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_f64_p64
+// CHECK-NEXT: ret
+float64x2_t test_vreinterpretq_f64_p64(poly64x2_t a) {
+ return vreinterpretq_f64_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_s8
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_s8(int8x16_t a) {
+ return vreinterpretq_p8_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_s16
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_s16(int16x8_t a) {
+ return vreinterpretq_p8_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_s32
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_s32(int32x4_t a) {
+ return vreinterpretq_p8_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_s64
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_s64(int64x2_t a) {
+ return vreinterpretq_p8_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_u8
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_u8(uint8x16_t a) {
+ return vreinterpretq_p8_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_u16
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_u16(uint16x8_t a) {
+ return vreinterpretq_p8_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_u32
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_u32(uint32x4_t a) {
+ return vreinterpretq_p8_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_u64
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_u64(uint64x2_t a) {
+ return vreinterpretq_p8_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_f16
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_f16(float16x8_t a) {
+ return vreinterpretq_p8_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_f32
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_f32(float32x4_t a) {
+ return vreinterpretq_p8_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_f64
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_f64(float64x2_t a) {
+ return vreinterpretq_p8_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_p16
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_p16(poly16x8_t a) {
+ return vreinterpretq_p8_p16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p8_p64
+// CHECK-NEXT: ret
+poly8x16_t test_vreinterpretq_p8_p64(poly64x2_t a) {
+ return vreinterpretq_p8_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_s8
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_s8(int8x16_t a) {
+ return vreinterpretq_p16_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_s16
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_s16(int16x8_t a) {
+ return vreinterpretq_p16_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_s32
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_s32(int32x4_t a) {
+ return vreinterpretq_p16_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_s64
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_s64(int64x2_t a) {
+ return vreinterpretq_p16_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_u8
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_u8(uint8x16_t a) {
+ return vreinterpretq_p16_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_u16
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_u16(uint16x8_t a) {
+ return vreinterpretq_p16_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_u32
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_u32(uint32x4_t a) {
+ return vreinterpretq_p16_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_u64
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_u64(uint64x2_t a) {
+ return vreinterpretq_p16_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_f16
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_f16(float16x8_t a) {
+ return vreinterpretq_p16_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_f32
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_f32(float32x4_t a) {
+ return vreinterpretq_p16_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_f64
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_f64(float64x2_t a) {
+ return vreinterpretq_p16_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_p8
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_p8(poly8x16_t a) {
+ return vreinterpretq_p16_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p16_p64
+// CHECK-NEXT: ret
+poly16x8_t test_vreinterpretq_p16_p64(poly64x2_t a) {
+ return vreinterpretq_p16_p64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_s8
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_s8(int8x16_t a) {
+ return vreinterpretq_p64_s8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_s16
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_s16(int16x8_t a) {
+ return vreinterpretq_p64_s16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_s32
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_s32(int32x4_t a) {
+ return vreinterpretq_p64_s32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_s64
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_s64(int64x2_t a) {
+ return vreinterpretq_p64_s64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_u8
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_u8(uint8x16_t a) {
+ return vreinterpretq_p64_u8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_u16
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_u16(uint16x8_t a) {
+ return vreinterpretq_p64_u16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_u32
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_u32(uint32x4_t a) {
+ return vreinterpretq_p64_u32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_u64
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_u64(uint64x2_t a) {
+ return vreinterpretq_p64_u64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_f16
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_f16(float16x8_t a) {
+ return vreinterpretq_p64_f16(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_f32
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_f32(float32x4_t a) {
+ return vreinterpretq_p64_f32(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_f64
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_f64(float64x2_t a) {
+ return vreinterpretq_p64_f64(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_p8
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_p8(poly8x16_t a) {
+ return vreinterpretq_p64_p8(a);
+}
+
+// CHECK-LABEL: test_vreinterpretq_p64_p16
+// CHECK-NEXT: ret
+poly64x2_t test_vreinterpretq_p64_p16(poly16x8_t a) {
+ return vreinterpretq_p64_p16(a);
+}
+
+float32_t test_vabds_f32(float32_t a, float32_t b) {
+// CHECK-LABEL: test_vabds_f32
+// CHECK: fabd {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+ return vabds_f32(a, b);
+}
+
+float64_t test_vabdd_f64(float64_t a, float64_t b) {
+// CHECK-LABEL: test_vabdd_f64
+// CHECK: fabd {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+ return vabdd_f64(a, b);
+}
+
+int64x1_t test_vuqadd_s64(int64x1_t a, uint64x1_t b) {
+ // CHECK-LABEL: test_vuqadd_s64
+ return vuqadd_s64(a, b);
+ // CHECK: suqadd d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+uint64x1_t test_vsqadd_u64(uint64x1_t a, int64x1_t b) {
+ // CHECK-LABEL: test_vsqadd_u64
+ return vsqadd_u64(a, b);
+ // CHECK: usqadd d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+int64x1_t test_vabs_s64(int64x1_t a) {
+ // CHECK-LABEL: test_vabs_s64
+ return vabs_s64(a);
+ // CHECK: abs d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+int64x1_t test_vqabs_s64(int64x1_t a) {
+ // CHECK-LABEL: test_vqabs_s64
+ return vqabs_s64(a);
+ // CHECK: sqabs d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+int64x1_t test_vqneg_s64(int64x1_t a) {
+ // CHECK-LABEL: test_vqneg_s64
+ return vqneg_s64(a);
+ // CHECK: sqneg d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+int64x1_t test_vneg_s64(int64x1_t a) {
+ // CHECK-LABEL: test_vneg_s64
+ return vneg_s64(a);
+ // CHECK: neg d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float32_t test_vaddv_f32(float32x2_t a) {
+ // CHECK-LABEL: test_vaddv_f32
+ return vaddv_f32(a);
+ // CHECK: faddp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+float32_t test_vaddvq_f32(float32x4_t a) {
+ // CHECK-LABEL: test_vaddvq_f32
+ return vaddvq_f32(a);
+ // CHECK: faddp {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+ // CHECK: faddp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+float64_t test_vaddvq_f64(float64x2_t a) {
+ // CHECK-LABEL: test_vaddvq_f64
+ return vaddvq_f64(a);
+ // CHECK: faddp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+float32_t test_vmaxv_f32(float32x2_t a) {
+ // CHECK-LABEL: test_vmaxv_f32
+ return vmaxv_f32(a);
+ // CHECK: fmaxp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+float64_t test_vmaxvq_f64(float64x2_t a) {
+ // CHECK-LABEL: test_vmaxvq_f64
+ return vmaxvq_f64(a);
+ // CHECK: fmaxp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+float32_t test_vminv_f32(float32x2_t a) {
+ // CHECK-LABEL: test_vminv_f32
+ return vminv_f32(a);
+ // CHECK: fminp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+float64_t test_vminvq_f64(float64x2_t a) {
+ // CHECK-LABEL: test_vminvq_f64
+ return vminvq_f64(a);
+ // CHECK: fminp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+float64_t test_vmaxnmvq_f64(float64x2_t a) {
+ // CHECK-LABEL: test_vmaxnmvq_f64
+ return vmaxnmvq_f64(a);
+ // CHECK: fmaxnmp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+float32_t test_vmaxnmv_f32(float32x2_t a) {
+ // CHECK-LABEL: test_vmaxnmv_f32
+ return vmaxnmv_f32(a);
+ // CHECK: fmaxnmp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+float64_t test_vminnmvq_f64(float64x2_t a) {
+ // CHECK-LABEL: test_vminnmvq_f64
+ return vminnmvq_f64(a);
+ // CHECK: fminnmp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+float32_t test_vminnmv_f32(float32x2_t a) {
+ // CHECK-LABEL: test_vminnmv_f32
+ return vminnmv_f32(a);
+ // CHECK: fminnmp {{s[0-9]+}}, {{v[0-9]+}}.2s
+}
+
+int64x2_t test_vpaddq_s64(int64x2_t a, int64x2_t b) {
+ // CHECK-LABEL: test_vpaddq_s64
+ return vpaddq_s64(a, b);
+ // CHECK: addp {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint64x2_t test_vpaddq_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK-LABEL: test_vpaddq_u64
+ return vpaddq_u64(a, b);
+ // CHECK: addp {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint64_t test_vpaddd_u64(uint64x2_t a) {
+ // CHECK-LABEL: test_vpaddd_u64
+ return vpaddd_u64(a);
+ // CHECK: addp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+int64_t test_vaddvq_s64(int64x2_t a) {
+ // CHECK-LABEL: test_vaddvq_s64
+ return vaddvq_s64(a);
+ // CHECK: addp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+uint64_t test_vaddvq_u64(uint64x2_t a) {
+ // CHECK-LABEL: test_vaddvq_u64
+ return vaddvq_u64(a);
+ // CHECK: addp {{d[0-9]+}}, {{v[0-9]+}}.2d
+}
+
+float64x1_t test_vadd_f64(float64x1_t a, float64x1_t b) {
+ // CHECK-LABEL: test_vadd_f64
+ return vadd_f64(a, b);
+ // CHECK: fadd d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vmul_f64(float64x1_t a, float64x1_t b) {
+ // CHECK-LABEL: test_vmul_f64
+ return vmul_f64(a, b);
+ // CHECK: fmul d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vdiv_f64(float64x1_t a, float64x1_t b) {
+ // CHECK-LABEL: test_vdiv_f64
+ return vdiv_f64(a, b);
+ // CHECK: fdiv d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vmla_f64(float64x1_t a, float64x1_t b, float64x1_t c) {
+ // CHECK-LABEL: test_vmla_f64
+ return vmla_f64(a, b, c);
+ // CHECK: fmadd d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vmls_f64(float64x1_t a, float64x1_t b, float64x1_t c) {
+ // CHECK-LABEL: test_vmls_f64
+ return vmls_f64(a, b, c);
+ // CHECK: fmsub d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vfma_f64(float64x1_t a, float64x1_t b, float64x1_t c) {
+ // CHECK-LABEL: test_vfma_f64
+ return vfma_f64(a, b, c);
+ // CHECK: fmadd d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vfms_f64(float64x1_t a, float64x1_t b, float64x1_t c) {
+ // CHECK-LABEL: test_vfms_f64
+ return vfms_f64(a, b, c);
+ // CHECK: fmsub d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vsub_f64(float64x1_t a, float64x1_t b) {
+ // CHECK-LABEL: test_vsub_f64
+ return vsub_f64(a, b);
+ // CHECK: fsub d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vabd_f64(float64x1_t a, float64x1_t b) {
+ // CHECK-LABEL: test_vabd_f64
+ return vabd_f64(a, b);
+ // CHECK: fabd d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vmax_f64(float64x1_t a, float64x1_t b) {
+// CHECK-LABEL: test_vmax_f64
+ return vmax_f64(a, b);
+// CHECK: fmax d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vmin_f64(float64x1_t a, float64x1_t b) {
+// CHECK-LABEL: test_vmin_f64
+ return vmin_f64(a, b);
+// CHECK: fmin d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vmaxnm_f64(float64x1_t a, float64x1_t b) {
+// CHECK-LABEL: test_vmaxnm_f64
+ return vmaxnm_f64(a, b);
+// CHECK: fmaxnm d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vminnm_f64(float64x1_t a, float64x1_t b) {
+// CHECK-LABEL: test_vminnm_f64
+ return vminnm_f64(a, b);
+// CHECK: fminnm d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vabs_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vabs_f64
+ return vabs_f64(a);
+ // CHECK: fabs d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vneg_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vneg_f64
+ return vneg_f64(a);
+ // CHECK: fneg d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+int64x1_t test_vcvt_s64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvt_s64_f64
+ return vcvt_s64_f64(a);
+ // CHECK: fcvtzs d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+uint64x1_t test_vcvt_u64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvt_u64_f64
+ return vcvt_u64_f64(a);
+ // CHECK: fcvtzu d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+int64x1_t test_vcvtn_s64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvtn_s64_f64
+ return vcvtn_s64_f64(a);
+ // CHECK: fcvtns d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+uint64x1_t test_vcvtn_u64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvtn_u64_f64
+ return vcvtn_u64_f64(a);
+ // CHECK: fcvtnu d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+int64x1_t test_vcvtp_s64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvtp_s64_f64
+ return vcvtp_s64_f64(a);
+ // CHECK: fcvtps d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+uint64x1_t test_vcvtp_u64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvtp_u64_f64
+ return vcvtp_u64_f64(a);
+ // CHECK: fcvtpu d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+int64x1_t test_vcvtm_s64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvtm_s64_f64
+ return vcvtm_s64_f64(a);
+ // CHECK: fcvtms d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+uint64x1_t test_vcvtm_u64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvtm_u64_f64
+ return vcvtm_u64_f64(a);
+ // CHECK: fcvtmu d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+int64x1_t test_vcvta_s64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvta_s64_f64
+ return vcvta_s64_f64(a);
+ // CHECK: fcvtas d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+uint64x1_t test_vcvta_u64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvta_u64_f64
+ return vcvta_u64_f64(a);
+ // CHECK: fcvtau d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vcvt_f64_s64(int64x1_t a) {
+ // CHECK-LABEL: test_vcvt_f64_s64
+ return vcvt_f64_s64(a);
+ // CHECK: scvtf d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vcvt_f64_u64(uint64x1_t a) {
+ // CHECK-LABEL: test_vcvt_f64_u64
+ return vcvt_f64_u64(a);
+ // CHECK: ucvtf d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+int64x1_t test_vcvt_n_s64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvt_n_s64_f64
+ return vcvt_n_s64_f64(a, 64);
+ // CHECK: fcvtzs d{{[0-9]+}}, d{{[0-9]+}}, #64
+}
+
+uint64x1_t test_vcvt_n_u64_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vcvt_n_u64_f64
+ return vcvt_n_u64_f64(a, 64);
+ // CHECK: fcvtzu d{{[0-9]+}}, d{{[0-9]+}}, #64
+}
+
+float64x1_t test_vcvt_n_f64_s64(int64x1_t a) {
+ // CHECK-LABEL: test_vcvt_n_f64_s64
+ return vcvt_n_f64_s64(a, 64);
+ // CHECK: scvtf d{{[0-9]+}}, d{{[0-9]+}}, #64
+}
+
+float64x1_t test_vcvt_n_f64_u64(uint64x1_t a) {
+ // CHECK-LABEL: test_vcvt_n_f64_u64
+ return vcvt_n_f64_u64(a, 64);
+ // CHECK: ucvtf d{{[0-9]+}}, d{{[0-9]+}}, #64
+}
+
+float64x1_t test_vrndn_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vrndn_f64
+ return vrndn_f64(a);
+ // CHECK: frintn d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vrnda_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vrnda_f64
+ return vrnda_f64(a);
+ // CHECK: frinta d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vrndp_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vrndp_f64
+ return vrndp_f64(a);
+ // CHECK: frintp d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vrndm_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vrndm_f64
+ return vrndm_f64(a);
+ // CHECK: frintm d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vrndx_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vrndx_f64
+ return vrndx_f64(a);
+ // CHECK: frintx d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vrnd_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vrnd_f64
+ return vrnd_f64(a);
+ // CHECK: frintz d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vrndi_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vrndi_f64
+ return vrndi_f64(a);
+ // CHECK: frinti d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vrsqrte_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vrsqrte_f64
+ return vrsqrte_f64(a);
+ // CHECK: frsqrte d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vrecpe_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vrecpe_f64
+ return vrecpe_f64(a);
+ // CHECK: frecpe d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vsqrt_f64(float64x1_t a) {
+ // CHECK-LABEL: test_vsqrt_f64
+ return vsqrt_f64(a);
+ // CHECK: fsqrt d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vrecps_f64(float64x1_t a, float64x1_t b) {
+ // CHECK-LABEL: test_vrecps_f64
+ return vrecps_f64(a, b);
+ // CHECK: frecps d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
+
+float64x1_t test_vrsqrts_f64(float64x1_t a, float64x1_t b) {
+ // CHECK-LABEL: test_vrsqrts_f64
+ return vrsqrts_f64(a, b);
+ // CHECK: frsqrts d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+}
diff --git a/test/CodeGen/aarch64-neon-ldst-one.c b/test/CodeGen/aarch64-neon-ldst-one.c
new file mode 100644
index 000000000000..f629260dc8ee
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-ldst-one.c
@@ -0,0 +1,2047 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+#include <arm_neon.h>
+
+uint8x16_t test_vld1q_dup_u8(uint8_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_u8
+ return vld1q_dup_u8(a);
+ // CHECK: ld1r {v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x8_t test_vld1q_dup_u16(uint16_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_u16
+ return vld1q_dup_u16(a);
+ // CHECK: ld1r {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x4_t test_vld1q_dup_u32(uint32_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_u32
+ return vld1q_dup_u32(a);
+ // CHECK: ld1r {v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x2_t test_vld1q_dup_u64(uint64_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_u64
+ return vld1q_dup_u64(a);
+ // CHECK: ld1r {v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+int8x16_t test_vld1q_dup_s8(int8_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_s8
+ return vld1q_dup_s8(a);
+ // CHECK: ld1r {v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+int16x8_t test_vld1q_dup_s16(int16_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_s16
+ return vld1q_dup_s16(a);
+ // CHECK: ld1r {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+int32x4_t test_vld1q_dup_s32(int32_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_s32
+ return vld1q_dup_s32(a);
+ // CHECK: ld1r {v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+int64x2_t test_vld1q_dup_s64(int64_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_s64
+ return vld1q_dup_s64(a);
+ // CHECK: ld1r {v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+float16x8_t test_vld1q_dup_f16(float16_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_f16
+ return vld1q_dup_f16(a);
+ // CHECK: ld1r {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+float32x4_t test_vld1q_dup_f32(float32_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_f32
+ return vld1q_dup_f32(a);
+ // CHECK: ld1r {v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+float64x2_t test_vld1q_dup_f64(float64_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_f64
+ return vld1q_dup_f64(a);
+ // CHECK: ld1r {v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x16_t test_vld1q_dup_p8(poly8_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_p8
+ return vld1q_dup_p8(a);
+ // CHECK: ld1r {v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x8_t test_vld1q_dup_p16(poly16_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_p16
+ return vld1q_dup_p16(a);
+ // CHECK: ld1r {v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+poly64x2_t test_vld1q_dup_p64(poly64_t const *a) {
+ // CHECK-LABEL: test_vld1q_dup_p64
+ return vld1q_dup_p64(a);
+ // CHECK: ld1r {v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+uint8x8_t test_vld1_dup_u8(uint8_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_u8
+ return vld1_dup_u8(a);
+ // CHECK: ld1r {v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x4_t test_vld1_dup_u16(uint16_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_u16
+ return vld1_dup_u16(a);
+ // CHECK: ld1r {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x2_t test_vld1_dup_u32(uint32_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_u32
+ return vld1_dup_u32(a);
+ // CHECK: ld1r {v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x1_t test_vld1_dup_u64(uint64_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_u64
+ return vld1_dup_u64(a);
+ // CHECK: ld1r {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+int8x8_t test_vld1_dup_s8(int8_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_s8
+ return vld1_dup_s8(a);
+ // CHECK: ld1r {v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+int16x4_t test_vld1_dup_s16(int16_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_s16
+ return vld1_dup_s16(a);
+ // CHECK: ld1r {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+int32x2_t test_vld1_dup_s32(int32_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_s32
+ return vld1_dup_s32(a);
+ // CHECK: ld1r {v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+int64x1_t test_vld1_dup_s64(int64_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_s64
+ return vld1_dup_s64(a);
+ // CHECK: ld1r {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+float16x4_t test_vld1_dup_f16(float16_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_f16
+ return vld1_dup_f16(a);
+ // CHECK: ld1r {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+float32x2_t test_vld1_dup_f32(float32_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_f32
+ return vld1_dup_f32(a);
+ // CHECK: ld1r {v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+float64x1_t test_vld1_dup_f64(float64_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_f64
+ return vld1_dup_f64(a);
+ // CHECK: ld1r {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x8_t test_vld1_dup_p8(poly8_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_p8
+ return vld1_dup_p8(a);
+ // CHECK: ld1r {v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x4_t test_vld1_dup_p16(poly16_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_p16
+ return vld1_dup_p16(a);
+ // CHECK: ld1r {v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+poly64x1_t test_vld1_dup_p64(poly64_t const *a) {
+ // CHECK-LABEL: test_vld1_dup_p64
+ return vld1_dup_p64(a);
+ // CHECK: ld1r {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+uint8x16x2_t test_vld2q_dup_u8(uint8_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_u8
+ return vld2q_dup_u8(a);
+ // CHECK: ld2r {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x8x2_t test_vld2q_dup_u16(uint16_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_u16
+ return vld2q_dup_u16(a);
+ // CHECK: ld2r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x4x2_t test_vld2q_dup_u32(uint32_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_u32
+ return vld2q_dup_u32(a);
+ // CHECK: ld2r {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x2x2_t test_vld2q_dup_u64(uint64_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_u64
+ return vld2q_dup_u64(a);
+ // CHECK: ld2r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+int8x16x2_t test_vld2q_dup_s8(int8_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_s8
+ return vld2q_dup_s8(a);
+ // CHECK: ld2r {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+int16x8x2_t test_vld2q_dup_s16(int16_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_s16
+ return vld2q_dup_s16(a);
+ // CHECK: ld2r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+int32x4x2_t test_vld2q_dup_s32(int32_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_s32
+ return vld2q_dup_s32(a);
+ // CHECK: ld2r {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+int64x2x2_t test_vld2q_dup_s64(int64_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_s64
+ return vld2q_dup_s64(a);
+ // CHECK: ld2r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+float16x8x2_t test_vld2q_dup_f16(float16_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_f16
+ return vld2q_dup_f16(a);
+ // CHECK: ld2r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+float32x4x2_t test_vld2q_dup_f32(float32_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_f32
+ return vld2q_dup_f32(a);
+ // CHECK: ld2r {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+float64x2x2_t test_vld2q_dup_f64(float64_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_f64
+ return vld2q_dup_f64(a);
+ // CHECK: ld2r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x16x2_t test_vld2q_dup_p8(poly8_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_p8
+ return vld2q_dup_p8(a);
+ // CHECK: ld2r {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x8x2_t test_vld2q_dup_p16(poly16_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_p16
+ return vld2q_dup_p16(a);
+ // CHECK: ld2r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+poly64x2x2_t test_vld2q_dup_p64(poly64_t const *a) {
+ // CHECK-LABEL: test_vld2q_dup_p64
+ return vld2q_dup_p64(a);
+ // CHECK: ld2r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+uint8x8x2_t test_vld2_dup_u8(uint8_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_u8
+ return vld2_dup_u8(a);
+ // CHECK: ld2r {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x4x2_t test_vld2_dup_u16(uint16_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_u16
+ return vld2_dup_u16(a);
+ // CHECK: ld2r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x2x2_t test_vld2_dup_u32(uint32_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_u32
+ return vld2_dup_u32(a);
+ // CHECK: ld2r {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x1x2_t test_vld2_dup_u64(uint64_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_u64
+ return vld2_dup_u64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+int8x8x2_t test_vld2_dup_s8(int8_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_s8
+ return vld2_dup_s8(a);
+ // CHECK: ld2r {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+int16x4x2_t test_vld2_dup_s16(int16_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_s16
+ return vld2_dup_s16(a);
+ // CHECK: ld2r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+int32x2x2_t test_vld2_dup_s32(int32_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_s32
+ return vld2_dup_s32(a);
+ // CHECK: ld2r {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+int64x1x2_t test_vld2_dup_s64(int64_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_s64
+ return vld2_dup_s64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+float16x4x2_t test_vld2_dup_f16(float16_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_f16
+ return vld2_dup_f16(a);
+ // CHECK: ld2r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+float32x2x2_t test_vld2_dup_f32(float32_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_f32
+ return vld2_dup_f32(a);
+ // CHECK: ld2r {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+float64x1x2_t test_vld2_dup_f64(float64_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_f64
+ return vld2_dup_f64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x8x2_t test_vld2_dup_p8(poly8_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_p8
+ return vld2_dup_p8(a);
+ // CHECK: ld2r {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x4x2_t test_vld2_dup_p16(poly16_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_p16
+ return vld2_dup_p16(a);
+ // CHECK: ld2r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+poly64x1x2_t test_vld2_dup_p64(poly64_t const *a) {
+ // CHECK-LABEL: test_vld2_dup_p64
+ return vld2_dup_p64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+uint8x16x3_t test_vld3q_dup_u8(uint8_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_u8
+ return vld3q_dup_u8(a);
+ // CHECK: ld3r {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint16x8x3_t test_vld3q_dup_u16(uint16_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_u16
+ return vld3q_dup_u16(a);
+ // CHECK: ld3r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint32x4x3_t test_vld3q_dup_u32(uint32_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_u32
+ return vld3q_dup_u32(a);
+ // CHECK: ld3r {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint64x2x3_t test_vld3q_dup_u64(uint64_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_u64
+ return vld3q_dup_u64(a);
+ // CHECK: ld3r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+int8x16x3_t test_vld3q_dup_s8(int8_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_s8
+ return vld3q_dup_s8(a);
+ // CHECK: ld3r {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+int16x8x3_t test_vld3q_dup_s16(int16_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_s16
+ return vld3q_dup_s16(a);
+ // CHECK: ld3r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+int32x4x3_t test_vld3q_dup_s32(int32_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_s32
+ return vld3q_dup_s32(a);
+ // CHECK: ld3r {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+int64x2x3_t test_vld3q_dup_s64(int64_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_s64
+ return vld3q_dup_s64(a);
+ // CHECK: ld3r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+float16x8x3_t test_vld3q_dup_f16(float16_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_f16
+ return vld3q_dup_f16(a);
+ // CHECK: ld3r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+float32x4x3_t test_vld3q_dup_f32(float32_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_f32
+ return vld3q_dup_f32(a);
+ // CHECK: ld3r {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s},
+ // [{{x[0-9]+|sp}}]
+}
+
+float64x2x3_t test_vld3q_dup_f64(float64_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_f64
+ return vld3q_dup_f64(a);
+ // CHECK: ld3r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly8x16x3_t test_vld3q_dup_p8(poly8_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_p8
+ return vld3q_dup_p8(a);
+ // CHECK: ld3r {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly16x8x3_t test_vld3q_dup_p16(poly16_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_p16
+ return vld3q_dup_p16(a);
+ // CHECK: ld3r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly64x2x3_t test_vld3q_dup_p64(poly64_t const *a) {
+ // CHECK-LABEL: test_vld3q_dup_p64
+ return vld3q_dup_p64(a);
+ // CHECK: ld3r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint8x8x3_t test_vld3_dup_u8(uint8_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_u8
+ return vld3_dup_u8(a);
+ // CHECK: ld3r {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint16x4x3_t test_vld3_dup_u16(uint16_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_u16
+ return vld3_dup_u16(a);
+ // CHECK: ld3r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint32x2x3_t test_vld3_dup_u32(uint32_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_u32
+ return vld3_dup_u32(a);
+ // CHECK: ld3r {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint64x1x3_t test_vld3_dup_u64(uint64_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_u64
+ return vld3_dup_u64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+int8x8x3_t test_vld3_dup_s8(int8_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_s8
+ return vld3_dup_s8(a);
+ // CHECK: ld3r {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+int16x4x3_t test_vld3_dup_s16(int16_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_s16
+ return vld3_dup_s16(a);
+ // CHECK: ld3r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+int32x2x3_t test_vld3_dup_s32(int32_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_s32
+ return vld3_dup_s32(a);
+ // CHECK: ld3r {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+int64x1x3_t test_vld3_dup_s64(int64_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_s64
+ return vld3_dup_s64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+float16x4x3_t test_vld3_dup_f16(float16_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_f16
+ return vld3_dup_f16(a);
+ // CHECK: ld3r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+float32x2x3_t test_vld3_dup_f32(float32_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_f32
+ return vld3_dup_f32(a);
+ // CHECK: ld3r {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s},
+ // [{{x[0-9]+|sp}}]
+}
+
+float64x1x3_t test_vld3_dup_f64(float64_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_f64
+ return vld3_dup_f64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly8x8x3_t test_vld3_dup_p8(poly8_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_p8
+ return vld3_dup_p8(a);
+ // CHECK: ld3r {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly16x4x3_t test_vld3_dup_p16(poly16_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_p16
+ return vld3_dup_p16(a);
+ // CHECK: ld3r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h},
+ // [{{x[0-9]+|sp}}]
+}
+
+poly64x1x3_t test_vld3_dup_p64(poly64_t const *a) {
+ // CHECK-LABEL: test_vld3_dup_p64
+ return vld3_dup_p64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d},
+ // [{{x[0-9]+|sp}}]
+}
+
+uint8x16x4_t test_vld4q_dup_u8(uint8_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_u8
+ return vld4q_dup_u8(a);
+ // CHECK: ld4r {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x8x4_t test_vld4q_dup_u16(uint16_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_u16
+ return vld4q_dup_u16(a);
+ // CHECK: ld4r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x4x4_t test_vld4q_dup_u32(uint32_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_u32
+ return vld4q_dup_u32(a);
+ // CHECK: ld4r {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x2x4_t test_vld4q_dup_u64(uint64_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_u64
+ return vld4q_dup_u64(a);
+ // CHECK: ld4r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+int8x16x4_t test_vld4q_dup_s8(int8_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_s8
+ return vld4q_dup_s8(a);
+ // CHECK: ld4r {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+int16x8x4_t test_vld4q_dup_s16(int16_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_s16
+ return vld4q_dup_s16(a);
+ // CHECK: ld4r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+int32x4x4_t test_vld4q_dup_s32(int32_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_s32
+ return vld4q_dup_s32(a);
+ // CHECK: ld4r {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+int64x2x4_t test_vld4q_dup_s64(int64_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_s64
+ return vld4q_dup_s64(a);
+ // CHECK: ld4r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+float16x8x4_t test_vld4q_dup_f16(float16_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_f16
+ return vld4q_dup_f16(a);
+ // CHECK: ld4r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+float32x4x4_t test_vld4q_dup_f32(float32_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_f32
+ return vld4q_dup_f32(a);
+ // CHECK: ld4r {v{{[0-9]+}}.4s, v{{[0-9]+}}.4s, v{{[0-9]+}}.4s,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+float64x2x4_t test_vld4q_dup_f64(float64_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_f64
+ return vld4q_dup_f64(a);
+ // CHECK: ld4r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.4s}, [{{x[0-9]+|sp}}]
+}
+
+poly8x16x4_t test_vld4q_dup_p8(poly8_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_p8
+ return vld4q_dup_p8(a);
+ // CHECK: ld4r {v{{[0-9]+}}.16b, v{{[0-9]+}}.16b, v{{[0-9]+}}.16b,
+ // v{{[0-9]+}}.16b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x8x4_t test_vld4q_dup_p16(poly16_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_p16
+ return vld4q_dup_p16(a);
+ // CHECK: ld4r {v{{[0-9]+}}.8h, v{{[0-9]+}}.8h, v{{[0-9]+}}.8h,
+ // v{{[0-9]+}}.8h}, [{{x[0-9]+|sp}}]
+}
+
+poly64x2x4_t test_vld4q_dup_p64(poly64_t const *a) {
+ // CHECK-LABEL: test_vld4q_dup_p64
+ return vld4q_dup_p64(a);
+ // CHECK: ld4r {v{{[0-9]+}}.2d, v{{[0-9]+}}.2d, v{{[0-9]+}}.2d,
+ // v{{[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+uint8x8x4_t test_vld4_dup_u8(uint8_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_u8
+ return vld4_dup_u8(a);
+ // CHECK: ld4r {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+uint16x4x4_t test_vld4_dup_u16(uint16_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_u16
+ return vld4_dup_u16(a);
+ // CHECK: ld4r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+uint32x2x4_t test_vld4_dup_u32(uint32_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_u32
+ return vld4_dup_u32(a);
+ // CHECK: ld4r {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+uint64x1x4_t test_vld4_dup_u64(uint64_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_u64
+ return vld4_dup_u64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+int8x8x4_t test_vld4_dup_s8(int8_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_s8
+ return vld4_dup_s8(a);
+ // CHECK: ld4r {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+int16x4x4_t test_vld4_dup_s16(int16_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_s16
+ return vld4_dup_s16(a);
+ // CHECK: ld4r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+int32x2x4_t test_vld4_dup_s32(int32_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_s32
+ return vld4_dup_s32(a);
+ // CHECK: ld4r {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+int64x1x4_t test_vld4_dup_s64(int64_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_s64
+ return vld4_dup_s64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+float16x4x4_t test_vld4_dup_f16(float16_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_f16
+ return vld4_dup_f16(a);
+ // CHECK: ld4r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+float32x2x4_t test_vld4_dup_f32(float32_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_f32
+ return vld4_dup_f32(a);
+ // CHECK: ld4r {v{{[0-9]+}}.2s, v{{[0-9]+}}.2s, v{{[0-9]+}}.2s,
+ // v{{[0-9]+}}.2s}, [{{x[0-9]+|sp}}]
+}
+
+float64x1x4_t test_vld4_dup_f64(float64_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_f64
+ return vld4_dup_f64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x8x4_t test_vld4_dup_p8(poly8_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_p8
+ return vld4_dup_p8(a);
+ // CHECK: ld4r {v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b,
+ // v{{[0-9]+}}.8b}, [{{x[0-9]+|sp}}]
+}
+
+poly16x4x4_t test_vld4_dup_p16(poly16_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_p16
+ return vld4_dup_p16(a);
+ // CHECK: ld4r {v{{[0-9]+}}.4h, v{{[0-9]+}}.4h, v{{[0-9]+}}.4h,
+ // v{{[0-9]+}}.4h}, [{{x[0-9]+|sp}}]
+}
+
+poly64x1x4_t test_vld4_dup_p64(poly64_t const *a) {
+ // CHECK-LABEL: test_vld4_dup_p64
+ return vld4_dup_p64(a);
+ // CHECK: ld1 {v{{[0-9]+}}.1d, v{{[0-9]+}}.1d, v{{[0-9]+}}.1d,
+ // v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+uint8x16_t test_vld1q_lane_u8(uint8_t const *a, uint8x16_t b) {
+ // CHECK-LABEL: test_vld1q_lane_u8
+ return vld1q_lane_u8(a, b, 15);
+ // CHECK: ld1 {v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+uint16x8_t test_vld1q_lane_u16(uint16_t const *a, uint16x8_t b) {
+ // CHECK-LABEL: test_vld1q_lane_u16
+ return vld1q_lane_u16(a, b, 7);
+ // CHECK: ld1 {v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+uint32x4_t test_vld1q_lane_u32(uint32_t const *a, uint32x4_t b) {
+ // CHECK-LABEL: test_vld1q_lane_u32
+ return vld1q_lane_u32(a, b, 3);
+ // CHECK: ld1 {v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+uint64x2_t test_vld1q_lane_u64(uint64_t const *a, uint64x2_t b) {
+ // CHECK-LABEL: test_vld1q_lane_u64
+ return vld1q_lane_u64(a, b, 1);
+ // CHECK: ld1 {v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+int8x16_t test_vld1q_lane_s8(int8_t const *a, int8x16_t b) {
+ // CHECK-LABEL: test_vld1q_lane_s8
+ return vld1q_lane_s8(a, b, 15);
+ // CHECK: ld1 {v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+int16x8_t test_vld1q_lane_s16(int16_t const *a, int16x8_t b) {
+ // CHECK-LABEL: test_vld1q_lane_s16
+ return vld1q_lane_s16(a, b, 7);
+ // CHECK: ld1 {v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+int32x4_t test_vld1q_lane_s32(int32_t const *a, int32x4_t b) {
+ // CHECK-LABEL: test_vld1q_lane_s32
+ return vld1q_lane_s32(a, b, 3);
+ // CHECK: ld1 {v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+int64x2_t test_vld1q_lane_s64(int64_t const *a, int64x2_t b) {
+ // CHECK-LABEL: test_vld1q_lane_s64
+ return vld1q_lane_s64(a, b, 1);
+ // CHECK: ld1 {v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+float16x8_t test_vld1q_lane_f16(float16_t const *a, float16x8_t b) {
+ // CHECK-LABEL: test_vld1q_lane_f16
+ return vld1q_lane_f16(a, b, 7);
+ // CHECK: ld1 {v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+float32x4_t test_vld1q_lane_f32(float32_t const *a, float32x4_t b) {
+ // CHECK-LABEL: test_vld1q_lane_f32
+ return vld1q_lane_f32(a, b, 3);
+ // CHECK: ld1 {v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+float64x2_t test_vld1q_lane_f64(float64_t const *a, float64x2_t b) {
+ // CHECK-LABEL: test_vld1q_lane_f64
+ return vld1q_lane_f64(a, b, 1);
+ // CHECK: ld1 {v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+poly8x16_t test_vld1q_lane_p8(poly8_t const *a, poly8x16_t b) {
+ // CHECK-LABEL: test_vld1q_lane_p8
+ return vld1q_lane_p8(a, b, 15);
+ // CHECK: ld1 {v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+poly16x8_t test_vld1q_lane_p16(poly16_t const *a, poly16x8_t b) {
+ // CHECK-LABEL: test_vld1q_lane_p16
+ return vld1q_lane_p16(a, b, 7);
+ // CHECK: ld1 {v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+poly64x2_t test_vld1q_lane_p64(poly64_t const *a, poly64x2_t b) {
+ // CHECK-LABEL: test_vld1q_lane_p64
+ return vld1q_lane_p64(a, b, 1);
+ // CHECK: ld1 {v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+uint8x8_t test_vld1_lane_u8(uint8_t const *a, uint8x8_t b) {
+ // CHECK-LABEL: test_vld1_lane_u8
+ return vld1_lane_u8(a, b, 7);
+ // CHECK: ld1 {v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+uint16x4_t test_vld1_lane_u16(uint16_t const *a, uint16x4_t b) {
+ // CHECK-LABEL: test_vld1_lane_u16
+ return vld1_lane_u16(a, b, 3);
+ // CHECK: ld1 {v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+uint32x2_t test_vld1_lane_u32(uint32_t const *a, uint32x2_t b) {
+ // CHECK-LABEL: test_vld1_lane_u32
+ return vld1_lane_u32(a, b, 1);
+ // CHECK: ld1 {v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+uint64x1_t test_vld1_lane_u64(uint64_t const *a, uint64x1_t b) {
+ // CHECK-LABEL: test_vld1_lane_u64
+ return vld1_lane_u64(a, b, 0);
+ // CHECK: ld1r {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+int8x8_t test_vld1_lane_s8(int8_t const *a, int8x8_t b) {
+ // CHECK-LABEL: test_vld1_lane_s8
+ return vld1_lane_s8(a, b, 7);
+ // CHECK: ld1 {v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+int16x4_t test_vld1_lane_s16(int16_t const *a, int16x4_t b) {
+ // CHECK-LABEL: test_vld1_lane_s16
+ return vld1_lane_s16(a, b, 3);
+ // CHECK: ld1 {v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+int32x2_t test_vld1_lane_s32(int32_t const *a, int32x2_t b) {
+ // CHECK-LABEL: test_vld1_lane_s32
+ return vld1_lane_s32(a, b, 1);
+ // CHECK: ld1 {v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+int64x1_t test_vld1_lane_s64(int64_t const *a, int64x1_t b) {
+ // CHECK-LABEL: test_vld1_lane_s64
+ return vld1_lane_s64(a, b, 0);
+ // CHECK: ld1r {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+float16x4_t test_vld1_lane_f16(float16_t const *a, float16x4_t b) {
+ // CHECK-LABEL: test_vld1_lane_f16
+ return vld1_lane_f16(a, b, 3);
+ // CHECK: ld1 {v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+float32x2_t test_vld1_lane_f32(float32_t const *a, float32x2_t b) {
+ // CHECK-LABEL: test_vld1_lane_f32
+ return vld1_lane_f32(a, b, 1);
+ // CHECK: ld1 {v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+float64x1_t test_vld1_lane_f64(float64_t const *a, float64x1_t b) {
+ // CHECK-LABEL: test_vld1_lane_f64
+ return vld1_lane_f64(a, b, 0);
+ // CHECK: ld1r {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly8x8_t test_vld1_lane_p8(poly8_t const *a, poly8x8_t b) {
+ // CHECK-LABEL: test_vld1_lane_p8
+ return vld1_lane_p8(a, b, 7);
+ // CHECK: ld1 {v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+poly16x4_t test_vld1_lane_p16(poly16_t const *a, poly16x4_t b) {
+ // CHECK-LABEL: test_vld1_lane_p16
+ return vld1_lane_p16(a, b, 3);
+ // CHECK: ld1 {v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+poly64x1_t test_vld1_lane_p64(poly64_t const *a, poly64x1_t b) {
+ // CHECK-LABEL: test_vld1_lane_p64
+ return vld1_lane_p64(a, b, 0);
+ // CHECK: ld1r {v{{[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+uint16x8x2_t test_vld2q_lane_u16(uint16_t const *a, uint16x8x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_u16
+ return vld2q_lane_u16(a, b, 7);
+ // CHECK: ld2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+uint32x4x2_t test_vld2q_lane_u32(uint32_t const *a, uint32x4x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_u32
+ return vld2q_lane_u32(a, b, 3);
+ // CHECK: ld2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+uint64x2x2_t test_vld2q_lane_u64(uint64_t const *a, uint64x2x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_u64
+ return vld2q_lane_u64(a, b, 1);
+ // CHECK: ld2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+int16x8x2_t test_vld2q_lane_s16(int16_t const *a, int16x8x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_s16
+ return vld2q_lane_s16(a, b, 7);
+ // CHECK: ld2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+int32x4x2_t test_vld2q_lane_s32(int32_t const *a, int32x4x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_s32
+ return vld2q_lane_s32(a, b, 3);
+ // CHECK: ld2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+int64x2x2_t test_vld2q_lane_s64(int64_t const *a, int64x2x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_s64
+ return vld2q_lane_s64(a, b, 1);
+ // CHECK: ld2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+float16x8x2_t test_vld2q_lane_f16(float16_t const *a, float16x8x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_f16
+ return vld2q_lane_f16(a, b, 7);
+ // CHECK: ld2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+float32x4x2_t test_vld2q_lane_f32(float32_t const *a, float32x4x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_f32
+ return vld2q_lane_f32(a, b, 3);
+ // CHECK: ld2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+float64x2x2_t test_vld2q_lane_f64(float64_t const *a, float64x2x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_f64
+ return vld2q_lane_f64(a, b, 1);
+ // CHECK: ld2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+poly16x8x2_t test_vld2q_lane_p16(poly16_t const *a, poly16x8x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_p16
+ return vld2q_lane_p16(a, b, 7);
+ // CHECK: ld2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+poly64x2x2_t test_vld2q_lane_p64(poly64_t const *a, poly64x2x2_t b) {
+ // CHECK-LABEL: test_vld2q_lane_p64
+ return vld2q_lane_p64(a, b, 1);
+ // CHECK: ld2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+uint8x8x2_t test_vld2_lane_u8(uint8_t const *a, uint8x8x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_u8
+ return vld2_lane_u8(a, b, 7);
+ // CHECK: ld2 {v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+uint16x4x2_t test_vld2_lane_u16(uint16_t const *a, uint16x4x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_u16
+ return vld2_lane_u16(a, b, 3);
+ // CHECK: ld2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+uint32x2x2_t test_vld2_lane_u32(uint32_t const *a, uint32x2x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_u32
+ return vld2_lane_u32(a, b, 1);
+ // CHECK: ld2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+uint64x1x2_t test_vld2_lane_u64(uint64_t const *a, uint64x1x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_u64
+ return vld2_lane_u64(a, b, 0);
+ // CHECK: ld2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+int8x8x2_t test_vld2_lane_s8(int8_t const *a, int8x8x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_s8
+ return vld2_lane_s8(a, b, 7);
+ // CHECK: ld2 {v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+int16x4x2_t test_vld2_lane_s16(int16_t const *a, int16x4x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_s16
+ return vld2_lane_s16(a, b, 3);
+ // CHECK: ld2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+int32x2x2_t test_vld2_lane_s32(int32_t const *a, int32x2x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_s32
+ return vld2_lane_s32(a, b, 1);
+ // CHECK: ld2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+int64x1x2_t test_vld2_lane_s64(int64_t const *a, int64x1x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_s64
+ return vld2_lane_s64(a, b, 0);
+ // CHECK: ld2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+float16x4x2_t test_vld2_lane_f16(float16_t const *a, float16x4x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_f16
+ return vld2_lane_f16(a, b, 3);
+ // CHECK: ld2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+float32x2x2_t test_vld2_lane_f32(float32_t const *a, float32x2x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_f32
+ return vld2_lane_f32(a, b, 1);
+ // CHECK: ld2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+float64x1x2_t test_vld2_lane_f64(float64_t const *a, float64x1x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_f64
+ return vld2_lane_f64(a, b, 0);
+ // CHECK: ld2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+poly8x8x2_t test_vld2_lane_p8(poly8_t const *a, poly8x8x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_p8
+ return vld2_lane_p8(a, b, 7);
+ // CHECK: ld2 {v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+poly16x4x2_t test_vld2_lane_p16(poly16_t const *a, poly16x4x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_p16
+ return vld2_lane_p16(a, b, 3);
+ // CHECK: ld2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+poly64x1x2_t test_vld2_lane_p64(poly64_t const *a, poly64x1x2_t b) {
+ // CHECK-LABEL: test_vld2_lane_p64
+ return vld2_lane_p64(a, b, 0);
+ // CHECK: ld2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+uint16x8x3_t test_vld3q_lane_u16(uint16_t const *a, uint16x8x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_u16
+ return vld3q_lane_u16(a, b, 7);
+ // CHECK: ld3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+uint32x4x3_t test_vld3q_lane_u32(uint32_t const *a, uint32x4x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_u32
+ return vld3q_lane_u32(a, b, 3);
+ // CHECK: ld3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+uint64x2x3_t test_vld3q_lane_u64(uint64_t const *a, uint64x2x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_u64
+ return vld3q_lane_u64(a, b, 1);
+ // CHECK: ld3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+int16x8x3_t test_vld3q_lane_s16(int16_t const *a, int16x8x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_s16
+ return vld3q_lane_s16(a, b, 7);
+ // CHECK: ld3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+int32x4x3_t test_vld3q_lane_s32(int32_t const *a, int32x4x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_s32
+ return vld3q_lane_s32(a, b, 3);
+ // CHECK: ld3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+int64x2x3_t test_vld3q_lane_s64(int64_t const *a, int64x2x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_s64
+ return vld3q_lane_s64(a, b, 1);
+ // CHECK: ld3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+float16x8x3_t test_vld3q_lane_f16(float16_t const *a, float16x8x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_f16
+ return vld3q_lane_f16(a, b, 7);
+ // CHECK: ld3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+float32x4x3_t test_vld3q_lane_f32(float32_t const *a, float32x4x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_f32
+ return vld3q_lane_f32(a, b, 3);
+ // CHECK: ld3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+float64x2x3_t test_vld3q_lane_f64(float64_t const *a, float64x2x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_f64
+ return vld3q_lane_f64(a, b, 1);
+ // CHECK: ld3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+poly8x16x3_t test_vld3q_lane_p8(poly8_t const *a, poly8x16x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_p8
+ return vld3q_lane_p8(a, b, 15);
+ // CHECK: ld3 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+poly16x8x3_t test_vld3q_lane_p16(poly16_t const *a, poly16x8x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_p16
+ return vld3q_lane_p16(a, b, 7);
+ // CHECK: ld3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+poly64x2x3_t test_vld3q_lane_p64(poly64_t const *a, poly64x2x3_t b) {
+ // CHECK-LABEL: test_vld3q_lane_p64
+ return vld3q_lane_p64(a, b, 1);
+ // CHECK: ld3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+uint8x8x3_t test_vld3_lane_u8(uint8_t const *a, uint8x8x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_u8
+ return vld3_lane_u8(a, b, 7);
+ // CHECK: ld3 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+uint16x4x3_t test_vld3_lane_u16(uint16_t const *a, uint16x4x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_u16
+ return vld3_lane_u16(a, b, 3);
+ // CHECK: ld3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+uint32x2x3_t test_vld3_lane_u32(uint32_t const *a, uint32x2x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_u32
+ return vld3_lane_u32(a, b, 1);
+ // CHECK: ld3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+uint64x1x3_t test_vld3_lane_u64(uint64_t const *a, uint64x1x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_u64
+ return vld3_lane_u64(a, b, 0);
+ // CHECK: ld3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+int8x8x3_t test_vld3_lane_s8(int8_t const *a, int8x8x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_s8
+ return vld3_lane_s8(a, b, 7);
+ // CHECK: ld3 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+int16x4x3_t test_vld3_lane_s16(int16_t const *a, int16x4x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_s16
+ return vld3_lane_s16(a, b, 3);
+ // CHECK: ld3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+int32x2x3_t test_vld3_lane_s32(int32_t const *a, int32x2x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_s32
+ return vld3_lane_s32(a, b, 1);
+ // CHECK: ld3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+int64x1x3_t test_vld3_lane_s64(int64_t const *a, int64x1x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_s64
+ return vld3_lane_s64(a, b, 0);
+ // CHECK: ld3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+float16x4x3_t test_vld3_lane_f16(float16_t const *a, float16x4x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_f16
+ return vld3_lane_f16(a, b, 3);
+ // CHECK: ld3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+float32x2x3_t test_vld3_lane_f32(float32_t const *a, float32x2x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_f32
+ return vld3_lane_f32(a, b, 1);
+ // CHECK: ld3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+float64x1x3_t test_vld3_lane_f64(float64_t const *a, float64x1x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_f64
+ return vld3_lane_f64(a, b, 0);
+ // CHECK: ld3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+poly8x8x3_t test_vld3_lane_p8(poly8_t const *a, poly8x8x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_p8
+ return vld3_lane_p8(a, b, 7);
+ // CHECK: ld3 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+poly16x4x3_t test_vld3_lane_p16(poly16_t const *a, poly16x4x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_p16
+ return vld3_lane_p16(a, b, 3);
+ // CHECK: ld3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+poly64x1x3_t test_vld3_lane_p64(poly64_t const *a, poly64x1x3_t b) {
+ // CHECK-LABEL: test_vld3_lane_p64
+ return vld3_lane_p64(a, b, 0);
+ // CHECK: ld3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+uint8x16x4_t test_vld4q_lane_u8(uint8_t const *a, uint8x16x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_u8
+ return vld4q_lane_u8(a, b, 15);
+ // CHECK: ld4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+uint16x8x4_t test_vld4q_lane_u16(uint16_t const *a, uint16x8x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_u16
+ return vld4q_lane_u16(a, b, 7);
+ // CHECK: ld4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+uint32x4x4_t test_vld4q_lane_u32(uint32_t const *a, uint32x4x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_u32
+ return vld4q_lane_u32(a, b, 3);
+ // CHECK: ld4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+uint64x2x4_t test_vld4q_lane_u64(uint64_t const *a, uint64x2x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_u64
+ return vld4q_lane_u64(a, b, 1);
+ // CHECK: ld4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+int8x16x4_t test_vld4q_lane_s8(int8_t const *a, int8x16x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_s8
+ return vld4q_lane_s8(a, b, 15);
+ // CHECK: ld4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+int16x8x4_t test_vld4q_lane_s16(int16_t const *a, int16x8x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_s16
+ return vld4q_lane_s16(a, b, 7);
+ // CHECK: ld4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+int32x4x4_t test_vld4q_lane_s32(int32_t const *a, int32x4x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_s32
+ return vld4q_lane_s32(a, b, 3);
+ // CHECK: ld4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+int64x2x4_t test_vld4q_lane_s64(int64_t const *a, int64x2x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_s64
+ return vld4q_lane_s64(a, b, 1);
+ // CHECK: ld4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+float16x8x4_t test_vld4q_lane_f16(float16_t const *a, float16x8x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_f16
+ return vld4q_lane_f16(a, b, 7);
+ // CHECK: ld4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+float32x4x4_t test_vld4q_lane_f32(float32_t const *a, float32x4x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_f32
+ return vld4q_lane_f32(a, b, 3);
+ // CHECK: ld4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+float64x2x4_t test_vld4q_lane_f64(float64_t const *a, float64x2x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_f64
+ return vld4q_lane_f64(a, b, 1);
+ // CHECK: ld4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+poly8x16x4_t test_vld4q_lane_p8(poly8_t const *a, poly8x16x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_p8
+ return vld4q_lane_p8(a, b, 15);
+ // CHECK: ld4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+poly16x8x4_t test_vld4q_lane_p16(poly16_t const *a, poly16x8x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_p16
+ return vld4q_lane_p16(a, b, 7);
+ // CHECK: ld4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+poly64x2x4_t test_vld4q_lane_p64(poly64_t const *a, poly64x2x4_t b) {
+ // CHECK-LABEL: test_vld4q_lane_p64
+ return vld4q_lane_p64(a, b, 1);
+ // CHECK: ld4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+uint8x8x4_t test_vld4_lane_u8(uint8_t const *a, uint8x8x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_u8
+ return vld4_lane_u8(a, b, 7);
+ // CHECK: ld4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+uint16x4x4_t test_vld4_lane_u16(uint16_t const *a, uint16x4x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_u16
+ return vld4_lane_u16(a, b, 3);
+ // CHECK: ld4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+uint32x2x4_t test_vld4_lane_u32(uint32_t const *a, uint32x2x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_u32
+ return vld4_lane_u32(a, b, 1);
+ // CHECK: ld4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+uint64x1x4_t test_vld4_lane_u64(uint64_t const *a, uint64x1x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_u64
+ return vld4_lane_u64(a, b, 0);
+ // CHECK: ld4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+int8x8x4_t test_vld4_lane_s8(int8_t const *a, int8x8x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_s8
+ return vld4_lane_s8(a, b, 7);
+ // CHECK: ld4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+int16x4x4_t test_vld4_lane_s16(int16_t const *a, int16x4x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_s16
+ return vld4_lane_s16(a, b, 3);
+ // CHECK: ld4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+int32x2x4_t test_vld4_lane_s32(int32_t const *a, int32x2x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_s32
+ return vld4_lane_s32(a, b, 1);
+ // CHECK: ld4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+int64x1x4_t test_vld4_lane_s64(int64_t const *a, int64x1x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_s64
+ return vld4_lane_s64(a, b, 0);
+ // CHECK: ld4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+float16x4x4_t test_vld4_lane_f16(float16_t const *a, float16x4x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_f16
+ return vld4_lane_f16(a, b, 3);
+ // CHECK: ld4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+float32x2x4_t test_vld4_lane_f32(float32_t const *a, float32x2x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_f32
+ return vld4_lane_f32(a, b, 1);
+ // CHECK: ld4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+float64x1x4_t test_vld4_lane_f64(float64_t const *a, float64x1x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_f64
+ return vld4_lane_f64(a, b, 0);
+ // CHECK: ld4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+poly8x8x4_t test_vld4_lane_p8(poly8_t const *a, poly8x8x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_p8
+ return vld4_lane_p8(a, b, 7);
+ // CHECK: ld4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+poly16x4x4_t test_vld4_lane_p16(poly16_t const *a, poly16x4x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_p16
+ return vld4_lane_p16(a, b, 3);
+ // CHECK: ld4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+poly64x1x4_t test_vld4_lane_p64(poly64_t const *a, poly64x1x4_t b) {
+ // CHECK-LABEL: test_vld4_lane_p64
+ return vld4_lane_p64(a, b, 0);
+ // CHECK: ld4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_u8(uint8_t const *a, uint8x16_t b) {
+ // CHECK-LABEL: test_vst1q_lane_u8
+ vst1q_lane_u8(a, b, 15);
+ // CHECK: st1 {v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_u16(uint16_t const *a, uint16x8_t b) {
+ // CHECK-LABEL: test_vst1q_lane_u16
+ vst1q_lane_u16(a, b, 7);
+ // CHECK: st1 {v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_u32(uint32_t const *a, uint32x4_t b) {
+ // CHECK-LABEL: test_vst1q_lane_u32
+ vst1q_lane_u32(a, b, 3);
+ // CHECK: st1 {v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_u64(uint64_t const *a, uint64x2_t b) {
+ // CHECK-LABEL: test_vst1q_lane_u64
+ vst1q_lane_u64(a, b, 1);
+ // CHECK: st1 {v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_s8(int8_t const *a, int8x16_t b) {
+ // CHECK-LABEL: test_vst1q_lane_s8
+ vst1q_lane_s8(a, b, 15);
+ // CHECK: st1 {v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_s16(int16_t const *a, int16x8_t b) {
+ // CHECK-LABEL: test_vst1q_lane_s16
+ vst1q_lane_s16(a, b, 7);
+ // CHECK: st1 {v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_s32(int32_t const *a, int32x4_t b) {
+ // CHECK-LABEL: test_vst1q_lane_s32
+ vst1q_lane_s32(a, b, 3);
+ // CHECK: st1 {v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_s64(int64_t const *a, int64x2_t b) {
+ // CHECK-LABEL: test_vst1q_lane_s64
+ vst1q_lane_s64(a, b, 1);
+ // CHECK: st1 {v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_f16(float16_t const *a, float16x8_t b) {
+ // CHECK-LABEL: test_vst1q_lane_f16
+ vst1q_lane_f16(a, b, 7);
+ // CHECK: st1 {v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_f32(float32_t const *a, float32x4_t b) {
+ // CHECK-LABEL: test_vst1q_lane_f32
+ vst1q_lane_f32(a, b, 3);
+ // CHECK: st1 {v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_f64(float64_t const *a, float64x2_t b) {
+ // CHECK-LABEL: test_vst1q_lane_f64
+ vst1q_lane_f64(a, b, 1);
+ // CHECK: st1 {v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+poly8x16_t test_vst1q_lane_p8(poly8_t const *a, poly8x16_t b) {
+ // CHECK-LABEL: test_vst1q_lane_p8
+ vst1q_lane_p8(a, b, 15);
+ // CHECK: st1 {v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_p16(poly16_t const *a, poly16x8_t b) {
+ // CHECK-LABEL: test_vst1q_lane_p16
+ vst1q_lane_p16(a, b, 7);
+ // CHECK: st1 {v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_lane_p64(poly64_t const *a, poly64x2_t b) {
+ // CHECK-LABEL: test_vst1q_lane_p64
+ vst1q_lane_p64(a, b, 1);
+ // CHECK: st1 {v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_u8(uint8_t const *a, uint8x8_t b) {
+ // CHECK-LABEL: test_vst1_lane_u8
+ vst1_lane_u8(a, b, 7);
+ // CHECK: st1 {v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_u16(uint16_t const *a, uint16x4_t b) {
+ // CHECK-LABEL: test_vst1_lane_u16
+ vst1_lane_u16(a, b, 3);
+ // CHECK: st1 {v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_u32(uint32_t const *a, uint32x2_t b) {
+ // CHECK-LABEL: test_vst1_lane_u32
+ vst1_lane_u32(a, b, 1);
+ // CHECK: st1 {v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_u64(uint64_t const *a, uint64x1_t b) {
+ // CHECK-LABEL: test_vst1_lane_u64
+ vst1_lane_u64(a, b, 0);
+ // CHECK: st1 {v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_s8(int8_t const *a, int8x8_t b) {
+ // CHECK-LABEL: test_vst1_lane_s8
+ vst1_lane_s8(a, b, 7);
+ // CHECK: st1 {v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_s16(int16_t const *a, int16x4_t b) {
+ // CHECK-LABEL: test_vst1_lane_s16
+ vst1_lane_s16(a, b, 3);
+ // CHECK: st1 {v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_s32(int32_t const *a, int32x2_t b) {
+ // CHECK-LABEL: test_vst1_lane_s32
+ vst1_lane_s32(a, b, 1);
+ // CHECK: st1 {v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_s64(int64_t const *a, int64x1_t b) {
+ // CHECK-LABEL: test_vst1_lane_s64
+ vst1_lane_s64(a, b, 0);
+ // CHECK: st1 {v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_f16(float16_t const *a, float16x4_t b) {
+ // CHECK-LABEL: test_vst1_lane_f16
+ vst1_lane_f16(a, b, 3);
+ // CHECK: st1 {v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_f32(float32_t const *a, float32x2_t b) {
+ // CHECK-LABEL: test_vst1_lane_f32
+ vst1_lane_f32(a, b, 1);
+ // CHECK: st1 {v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_f64(float64_t const *a, float64x1_t b) {
+ // CHECK-LABEL: test_vst1_lane_f64
+ vst1_lane_f64(a, b, 0);
+ // CHECK: st1 {v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_p8(poly8_t const *a, poly8x8_t b) {
+ // CHECK-LABEL: test_vst1_lane_p8
+ vst1_lane_p8(a, b, 7);
+ // CHECK: st1 {v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_p16(poly16_t const *a, poly16x4_t b) {
+ // CHECK-LABEL: test_vst1_lane_p16
+ vst1_lane_p16(a, b, 3);
+ // CHECK: st1 {v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_lane_p64(poly64_t const *a, poly64x1_t b) {
+ // CHECK-LABEL: test_vst1_lane_p64
+ vst1_lane_p64(a, b, 0);
+ // CHECK: st1 {v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_u8(uint8_t const *a, uint8x16x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_u8
+ vst2q_lane_u8(a, b, 15);
+ // CHECK: st2 {v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_u16(uint16_t const *a, uint16x8x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_u16
+ vst2q_lane_u16(a, b, 7);
+ // CHECK: st2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_u32(uint32_t const *a, uint32x4x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_u32
+ vst2q_lane_u32(a, b, 3);
+ // CHECK: st2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_u64(uint64_t const *a, uint64x2x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_u64
+ vst2q_lane_u64(a, b, 1);
+ // CHECK: st2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_s8(int8_t const *a, int8x16x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_s8
+ vst2q_lane_s8(a, b, 15);
+ // CHECK: st2 {v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_s16(int16_t const *a, int16x8x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_s16
+ vst2q_lane_s16(a, b, 7);
+ // CHECK: st2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_s32(int32_t const *a, int32x4x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_s32
+ vst2q_lane_s32(a, b, 3);
+ // CHECK: st2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_s64(int64_t const *a, int64x2x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_s64
+ vst2q_lane_s64(a, b, 1);
+ // CHECK: st2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_f16(float16_t const *a, float16x8x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_f16
+ vst2q_lane_f16(a, b, 7);
+ // CHECK: st2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_f32(float32_t const *a, float32x4x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_f32
+ vst2q_lane_f32(a, b, 3);
+ // CHECK: st2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_f64(float64_t const *a, float64x2x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_f64
+ vst2q_lane_f64(a, b, 1);
+ // CHECK: st2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_p8(poly8_t const *a, poly8x16x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_p8
+ vst2q_lane_p8(a, b, 15);
+ // CHECK: st2 {v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_p16(poly16_t const *a, poly16x8x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_p16
+ vst2q_lane_p16(a, b, 7);
+ // CHECK: st2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_lane_p64(poly64_t const *a, poly64x2x2_t b) {
+ // CHECK-LABEL: test_vst2q_lane_p64
+ vst2q_lane_p64(a, b, 1);
+ // CHECK: st2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_u8(uint8_t const *a, uint8x8x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_u8
+ vst2_lane_u8(a, b, 7);
+ // CHECK: st2 {v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_u16(uint16_t const *a, uint16x4x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_u16
+ vst2_lane_u16(a, b, 3);
+ // CHECK: st2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_u32(uint32_t const *a, uint32x2x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_u32
+ vst2_lane_u32(a, b, 1);
+ // CHECK: st2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_u64(uint64_t const *a, uint64x1x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_u64
+ vst2_lane_u64(a, b, 0);
+ // CHECK: st2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_s8(int8_t const *a, int8x8x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_s8
+ vst2_lane_s8(a, b, 7);
+ // CHECK: st2 {v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_s16(int16_t const *a, int16x4x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_s16
+ vst2_lane_s16(a, b, 3);
+ // CHECK: st2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_s32(int32_t const *a, int32x2x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_s32
+ vst2_lane_s32(a, b, 1);
+ // CHECK: st2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_s64(int64_t const *a, int64x1x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_s64
+ vst2_lane_s64(a, b, 0);
+ // CHECK: st2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_f16(float16_t const *a, float16x4x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_f16
+ vst2_lane_f16(a, b, 3);
+ // CHECK: st2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_f32(float32_t const *a, float32x2x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_f32
+ vst2_lane_f32(a, b, 1);
+ // CHECK: st2 {v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_f64(float64_t const *a, float64x1x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_f64
+ vst2_lane_f64(a, b, 0);
+ // CHECK: st2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_p8(poly8_t const *a, poly8x8x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_p8
+ vst2_lane_p8(a, b, 7);
+ // CHECK: st2 {v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_p16(poly16_t const *a, poly16x4x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_p16
+ vst2_lane_p16(a, b, 3);
+ // CHECK: st2 {v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_lane_p64(poly64_t const *a, poly64x1x2_t b) {
+ // CHECK-LABEL: test_vst2_lane_p64
+ vst2_lane_p64(a, b, 0);
+ // CHECK: st2 {v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_u8(uint8_t const *a, uint8x16x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_u8
+ vst3q_lane_u8(a, b, 15);
+ // CHECK: st3 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_u16(uint16_t const *a, uint16x8x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_u16
+ vst3q_lane_u16(a, b, 7);
+ // CHECK: st3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_u32(uint32_t const *a, uint32x4x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_u32
+ vst3q_lane_u32(a, b, 3);
+ // CHECK: st3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_u64(uint64_t const *a, uint64x2x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_u64
+ vst3q_lane_u64(a, b, 1);
+ // CHECK: st3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_s8(int8_t const *a, int8x16x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_s8
+ vst3q_lane_s8(a, b, 15);
+ // CHECK: st3 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_s16(int16_t const *a, int16x8x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_s16
+ vst3q_lane_s16(a, b, 7);
+ // CHECK: st3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_s32(int32_t const *a, int32x4x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_s32
+ vst3q_lane_s32(a, b, 3);
+ // CHECK: st3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_s64(int64_t const *a, int64x2x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_s64
+ vst3q_lane_s64(a, b, 1);
+ // CHECK: st3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_f16(float16_t const *a, float16x8x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_f16
+ vst3q_lane_f16(a, b, 7);
+ // CHECK: st3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_f32(float32_t const *a, float32x4x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_f32
+ vst3q_lane_f32(a, b, 3);
+ // CHECK: st3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_f64(float64_t const *a, float64x2x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_f64
+ vst3q_lane_f64(a, b, 1);
+ // CHECK: st3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_p8(poly8_t const *a, poly8x16x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_p8
+ vst3q_lane_p8(a, b, 15);
+ // CHECK: st3 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_p16(poly16_t const *a, poly16x8x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_p16
+ vst3q_lane_p16(a, b, 7);
+ // CHECK: st3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_lane_p64(poly64_t const *a, poly64x2x3_t b) {
+ // CHECK-LABEL: test_vst3q_lane_p64
+ vst3q_lane_p64(a, b, 1);
+ // CHECK: st3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_u8(uint8_t const *a, uint8x8x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_u8
+ vst3_lane_u8(a, b, 7);
+ // CHECK: st3 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_u16(uint16_t const *a, uint16x4x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_u16
+ vst3_lane_u16(a, b, 3);
+ // CHECK: st3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_u32(uint32_t const *a, uint32x2x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_u32
+ vst3_lane_u32(a, b, 1);
+ // CHECK: st3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_u64(uint64_t const *a, uint64x1x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_u64
+ vst3_lane_u64(a, b, 0);
+ // CHECK: st3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_s8(int8_t const *a, int8x8x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_s8
+ vst3_lane_s8(a, b, 7);
+ // CHECK: st3 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_s16(int16_t const *a, int16x4x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_s16
+ vst3_lane_s16(a, b, 3);
+ // CHECK: st3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_s32(int32_t const *a, int32x2x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_s32
+ vst3_lane_s32(a, b, 1);
+ // CHECK: st3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_s64(int64_t const *a, int64x1x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_s64
+ vst3_lane_s64(a, b, 0);
+ // CHECK: st3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_f16(float16_t const *a, float16x4x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_f16
+ vst3_lane_f16(a, b, 3);
+ // CHECK: st3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_f32(float32_t const *a, float32x2x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_f32
+ vst3_lane_f32(a, b, 1);
+ // CHECK: st3 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_f64(float64_t const *a, float64x1x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_f64
+ vst3_lane_f64(a, b, 0);
+ // CHECK: st3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_p8(poly8_t const *a, poly8x8x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_p8
+ vst3_lane_p8(a, b, 7);
+ // CHECK: st3 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_p16(poly16_t const *a, poly16x4x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_p16
+ vst3_lane_p16(a, b, 3);
+ // CHECK: st3 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_lane_p64(poly64_t const *a, poly64x1x3_t b) {
+ // CHECK-LABEL: test_vst3_lane_p64
+ vst3_lane_p64(a, b, 0);
+ // CHECK: st3 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_u8(uint16_t const *a, uint8x16x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_u8
+ vst4q_lane_u8(a, b, 15);
+ // CHECK: st4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_u16(uint16_t const *a, uint16x8x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_u16
+ vst4q_lane_u16(a, b, 7);
+ // CHECK: st4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_u32(uint32_t const *a, uint32x4x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_u32
+ vst4q_lane_u32(a, b, 3);
+ // CHECK: st4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_u64(uint64_t const *a, uint64x2x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_u64
+ vst4q_lane_u64(a, b, 1);
+ // CHECK: st4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_s8(int16_t const *a, int8x16x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_s8
+ vst4q_lane_s8(a, b, 15);
+ // CHECK: st4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_s16(int16_t const *a, int16x8x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_s16
+ vst4q_lane_s16(a, b, 7);
+ // CHECK: st4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_s32(int32_t const *a, int32x4x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_s32
+ vst4q_lane_s32(a, b, 3);
+ // CHECK: st4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_s64(int64_t const *a, int64x2x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_s64
+ vst4q_lane_s64(a, b, 1);
+ // CHECK: st4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_f16(float16_t const *a, float16x8x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_f16
+ vst4q_lane_f16(a, b, 7);
+ // CHECK: st4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_f32(float32_t const *a, float32x4x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_f32
+ vst4q_lane_f32(a, b, 3);
+ // CHECK: st4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_f64(float64_t const *a, float64x2x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_f64
+ vst4q_lane_f64(a, b, 1);
+ // CHECK: st4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_p8(poly16_t const *a, poly8x16x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_p8
+ vst4q_lane_p8(a, b, 15);
+ // CHECK: st4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[15], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_p16(poly16_t const *a, poly16x8x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_p16
+ vst4q_lane_p16(a, b, 7);
+ // CHECK: st4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_lane_p64(poly64_t const *a, poly64x2x4_t b) {
+ // CHECK-LABEL: test_vst4q_lane_p64
+ vst4q_lane_p64(a, b, 1);
+ // CHECK: st4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_u8(uint8_t const *a, uint8x8x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_u8
+ vst4_lane_u8(a, b, 7);
+ // CHECK: st4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_u16(uint16_t const *a, uint16x4x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_u16
+ vst4_lane_u16(a, b, 3);
+ // CHECK: st4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_u32(uint32_t const *a, uint32x2x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_u32
+ vst4_lane_u32(a, b, 1);
+ // CHECK: st4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_u64(uint64_t const *a, uint64x1x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_u64
+ vst4_lane_u64(a, b, 0);
+ // CHECK: st4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_s8(int8_t const *a, int8x8x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_s8
+ vst4_lane_s8(a, b, 7);
+ // CHECK: st4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_s16(int16_t const *a, int16x4x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_s16
+ vst4_lane_s16(a, b, 3);
+ // CHECK: st4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_s32(int32_t const *a, int32x2x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_s32
+ vst4_lane_s32(a, b, 1);
+ // CHECK: st4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_s64(int64_t const *a, int64x1x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_s64
+ vst4_lane_s64(a, b, 0);
+ // CHECK: st4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_f16(float16_t const *a, float16x4x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_f16
+ vst4_lane_f16(a, b, 3);
+ // CHECK: st4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_f32(float32_t const *a, float32x2x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_f32
+ vst4_lane_f32(a, b, 1);
+ // CHECK: st4 {v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s, v{{[0-9]+}}.s}[1], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_f64(float64_t const *a, float64x1x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_f64
+ vst4_lane_f64(a, b, 0);
+ // CHECK: st4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_p8(poly8_t const *a, poly8x8x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_p8
+ vst4_lane_p8(a, b, 7);
+ // CHECK: st4 {v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b, v{{[0-9]+}}.b}[7], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_p16(poly16_t const *a, poly16x4x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_p16
+ vst4_lane_p16(a, b, 3);
+ // CHECK: st4 {v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h, v{{[0-9]+}}.h}[3], [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_lane_p64(poly64_t const *a, poly64x1x4_t b) {
+ // CHECK-LABEL: test_vst4_lane_p64
+ vst4_lane_p64(a, b, 0);
+ // CHECK: st4 {v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d, v{{[0-9]+}}.d}[0], [{{x[0-9]+|sp}}]
+}
diff --git a/test/CodeGen/aarch64-neon-misc.c b/test/CodeGen/aarch64-neon-misc.c
new file mode 100644
index 000000000000..08174d91f8be
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-misc.c
@@ -0,0 +1,2005 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+// CHECK: test_vceqz_s8
+// CHECK: cmeq {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x0
+uint8x8_t test_vceqz_s8(int8x8_t a) {
+ return vceqz_s8(a);
+}
+
+// CHECK: test_vceqz_s16
+// CHECK: cmeq {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #0x0
+uint16x4_t test_vceqz_s16(int16x4_t a) {
+ return vceqz_s16(a);
+}
+
+// CHECK: test_vceqz_s32
+// CHECK: cmeq {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0x0
+uint32x2_t test_vceqz_s32(int32x2_t a) {
+ return vceqz_s32(a);
+}
+
+// CHECK: test_vceqz_s64
+// CHECK: cmeq {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+uint64x1_t test_vceqz_s64(int64x1_t a) {
+ return vceqz_s64(a);
+}
+
+// CHECK: test_vceqz_u64
+// CHECK: cmeq {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+uint64x1_t test_vceqz_u64(uint64x1_t a) {
+ return vceqz_u64(a);
+}
+
+// CHECK: test_vceqz_p64
+// CHECK: cmeq {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+uint64x1_t test_vceqz_p64(poly64x1_t a) {
+ return vceqz_p64(a);
+}
+
+// CHECK: test_vceqzq_s8
+// CHECK: cmeq {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x0
+uint8x16_t test_vceqzq_s8(int8x16_t a) {
+ return vceqzq_s8(a);
+}
+
+// CHECK: test_vceqzq_s16
+// CHECK: cmeq {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #0x0
+uint16x8_t test_vceqzq_s16(int16x8_t a) {
+ return vceqzq_s16(a);
+}
+
+// CHECK: test_vceqzq_s32
+// CHECK: cmeq {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0x0
+uint32x4_t test_vceqzq_s32(int32x4_t a) {
+ return vceqzq_s32(a);
+}
+
+// CHECK: test_vceqzq_s64
+// CHECK: cmeq {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0x0
+uint64x2_t test_vceqzq_s64(int64x2_t a) {
+ return vceqzq_s64(a);
+}
+
+// CHECK: test_vceqz_u8
+// CHECK: cmeq {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x0
+uint8x8_t test_vceqz_u8(uint8x8_t a) {
+ return vceqz_u8(a);
+}
+
+// CHECK: test_vceqz_u16
+// CHECK: cmeq {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #0x0
+uint16x4_t test_vceqz_u16(uint16x4_t a) {
+ return vceqz_u16(a);
+}
+
+// CHECK: test_vceqz_u32
+// CHECK: cmeq {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0x0
+uint32x2_t test_vceqz_u32(uint32x2_t a) {
+ return vceqz_u32(a);
+}
+
+// CHECK: test_vceqzq_u8
+// CHECK: cmeq {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x0
+uint8x16_t test_vceqzq_u8(uint8x16_t a) {
+ return vceqzq_u8(a);
+}
+
+// CHECK: test_vceqzq_u16
+// CHECK: cmeq {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #0x0
+uint16x8_t test_vceqzq_u16(uint16x8_t a) {
+ return vceqzq_u16(a);
+}
+
+// CHECK: test_vceqzq_u32
+// CHECK: cmeq {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0x0
+uint32x4_t test_vceqzq_u32(uint32x4_t a) {
+ return vceqzq_u32(a);
+}
+
+// CHECK: test_vceqzq_u64
+// CHECK: cmeq {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0x0
+uint64x2_t test_vceqzq_u64(uint64x2_t a) {
+ return vceqzq_u64(a);
+}
+
+// CHECK: test_vceqz_f32
+// CHECK: fcmeq {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0
+uint32x2_t test_vceqz_f32(float32x2_t a) {
+ return vceqz_f32(a);
+}
+
+// CHECK: test_vceqz_f64
+// CHECK: fcmeq {{d[0-9]+}}, {{d[0-9]+}}, #0
+uint64x1_t test_vceqz_f64(float64x1_t a) {
+ return vceqz_f64(a);
+}
+
+// CHECK: test_vceqzq_f32
+// CHECK: fcmeq {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0
+uint32x4_t test_vceqzq_f32(float32x4_t a) {
+ return vceqzq_f32(a);
+}
+
+// CHECK: test_vceqz_p16
+// CHECK: cmeq {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #0x0
+uint16x4_t test_vceqz_p16(poly16x4_t a) {
+ return vceqz_p16(a);
+}
+
+// CHECK: test_vceqzq_p16
+// CHECK: cmeq {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #0x0
+uint16x8_t test_vceqzq_p16(poly16x8_t a) {
+ return vceqzq_p16(a);
+}
+
+// CHECK: test_vceqzq_f64
+// CHECK: fcmeq {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0
+uint64x2_t test_vceqzq_f64(float64x2_t a) {
+ return vceqzq_f64(a);
+}
+
+// CHECK: test_vceqzq_p64
+// CHECK: cmeq {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0
+uint64x2_t test_vceqzq_p64(poly64x2_t a) {
+ return vceqzq_p64(a);
+}
+
+// CHECK: test_vcgez_s8
+// CHECK: cmge {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x0
+uint8x8_t test_vcgez_s8(int8x8_t a) {
+ return vcgez_s8(a);
+}
+
+// CHECK: test_vcgez_s16
+// CHECK: cmge {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #0x0
+uint16x4_t test_vcgez_s16(int16x4_t a) {
+ return vcgez_s16(a);
+}
+
+// CHECK: test_vcgez_s32
+// CHECK: cmge {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0x0
+uint32x2_t test_vcgez_s32(int32x2_t a) {
+ return vcgez_s32(a);
+}
+
+// CHECK: test_vcgez_s64
+// CHECK: cmge {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+uint64x1_t test_vcgez_s64(int64x1_t a) {
+ return vcgez_s64(a);
+}
+
+// CHECK: test_vcgezq_s8
+// CHECK: cmge {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x0
+uint8x16_t test_vcgezq_s8(int8x16_t a) {
+ return vcgezq_s8(a);
+}
+
+// CHECK: test_vcgezq_s16
+// CHECK: cmge {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #0x0
+uint16x8_t test_vcgezq_s16(int16x8_t a) {
+ return vcgezq_s16(a);
+}
+
+// CHECK: test_vcgezq_s32
+// CHECK: cmge {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0x0
+uint32x4_t test_vcgezq_s32(int32x4_t a) {
+ return vcgezq_s32(a);
+}
+
+// CHECK: test_vcgezq_s64
+// CHECK: cmge {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0x0
+uint64x2_t test_vcgezq_s64(int64x2_t a) {
+ return vcgezq_s64(a);
+}
+
+// CHECK: test_vcgez_f32
+// CHECK: fcmge {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0
+uint32x2_t test_vcgez_f32(float32x2_t a) {
+ return vcgez_f32(a);
+}
+
+// CHECK: test_vcgezq_f32
+// CHECK: fcmge {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0
+uint32x4_t test_vcgezq_f32(float32x4_t a) {
+ return vcgezq_f32(a);
+}
+
+// CHECK: test_vcgezq_f64
+// CHECK: fcmge {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0
+uint64x2_t test_vcgezq_f64(float64x2_t a) {
+ return vcgezq_f64(a);
+}
+
+// CHECK: test_vclez_s8
+// CHECK: cmle {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x0
+uint8x8_t test_vclez_s8(int8x8_t a) {
+ return vclez_s8(a);
+}
+
+// CHECK: test_vclez_s16
+// CHECK: cmle {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #0x0
+uint16x4_t test_vclez_s16(int16x4_t a) {
+ return vclez_s16(a);
+}
+
+// CHECK: test_vclez_s32
+// CHECK: cmle {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0x0
+uint32x2_t test_vclez_s32(int32x2_t a) {
+ return vclez_s32(a);
+}
+
+// CHECK: test_vclez_s64
+// CHECK: cmle {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+uint64x1_t test_vclez_s64(int64x1_t a) {
+ return vclez_s64(a);
+}
+
+// CHECK: test_vclezq_s8
+// CHECK: cmle {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x0
+uint8x16_t test_vclezq_s8(int8x16_t a) {
+ return vclezq_s8(a);
+}
+
+// CHECK: test_vclezq_s16
+// CHECK: cmle {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #0x0
+uint16x8_t test_vclezq_s16(int16x8_t a) {
+ return vclezq_s16(a);
+}
+
+// CHECK: test_vclezq_s32
+// CHECK: cmle {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0x0
+uint32x4_t test_vclezq_s32(int32x4_t a) {
+ return vclezq_s32(a);
+}
+
+// CHECK: test_vclezq_s64
+// CHECK: cmle {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0x0
+uint64x2_t test_vclezq_s64(int64x2_t a) {
+ return vclezq_s64(a);
+}
+
+// CHECK: test_vclez_f32
+// CHECK: fcmle {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0
+uint32x2_t test_vclez_f32(float32x2_t a) {
+ return vclez_f32(a);
+}
+
+// CHECK: test_vclezq_f32
+// CHECK: fcmle {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0
+uint32x4_t test_vclezq_f32(float32x4_t a) {
+ return vclezq_f32(a);
+}
+
+// CHECK: test_vclezq_f64
+// CHECK: fcmle {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0
+uint64x2_t test_vclezq_f64(float64x2_t a) {
+ return vclezq_f64(a);
+}
+
+// CHECK: test_vcgtz_s8
+// CHECK: cmgt {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0x0
+uint8x8_t test_vcgtz_s8(int8x8_t a) {
+ return vcgtz_s8(a);
+}
+
+// CHECK: test_vcgtz_s16
+// CHECK: cmgt {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #0x0
+uint16x4_t test_vcgtz_s16(int16x4_t a) {
+ return vcgtz_s16(a);
+}
+
+// CHECK: test_vcgtz_s32
+// CHECK: cmgt {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0x0
+uint32x2_t test_vcgtz_s32(int32x2_t a) {
+ return vcgtz_s32(a);
+}
+
+// CHECK: test_vcgtz_s64
+// CHECK: cmgt {{d[0-9]+}}, {{d[0-9]+}}, #0x0
+uint64x1_t test_vcgtz_s64(int64x1_t a) {
+ return vcgtz_s64(a);
+}
+
+// CHECK: test_vcgtzq_s8
+// CHECK: cmgt {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x0
+uint8x16_t test_vcgtzq_s8(int8x16_t a) {
+ return vcgtzq_s8(a);
+}
+
+// CHECK: test_vcgtzq_s16
+// CHECK: cmgt {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #0x0
+uint16x8_t test_vcgtzq_s16(int16x8_t a) {
+ return vcgtzq_s16(a);
+}
+
+// CHECK: test_vcgtzq_s32
+// CHECK: cmgt {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0x0
+uint32x4_t test_vcgtzq_s32(int32x4_t a) {
+ return vcgtzq_s32(a);
+}
+
+// CHECK: test_vcgtzq_s64
+// CHECK: cmgt {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0x0
+uint64x2_t test_vcgtzq_s64(int64x2_t a) {
+ return vcgtzq_s64(a);
+}
+
+// CHECK: test_vcgtz_f32
+// CHECK: fcmgt {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0
+uint32x2_t test_vcgtz_f32(float32x2_t a) {
+ return vcgtz_f32(a);
+}
+
+// CHECK: test_vcgtzq_f32
+// CHECK: fcmgt {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0
+uint32x4_t test_vcgtzq_f32(float32x4_t a) {
+ return vcgtzq_f32(a);
+}
+
+// CHECK: test_vcgtzq_f64
+// CHECK: fcmgt {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0
+uint64x2_t test_vcgtzq_f64(float64x2_t a) {
+ return vcgtzq_f64(a);
+}
+
+// CHECK: test_vcltz_s8
+// CHECK: cmlt {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #0
+uint8x8_t test_vcltz_s8(int8x8_t a) {
+ return vcltz_s8(a);
+}
+
+// CHECK: test_vcltz_s16
+// CHECK: cmlt {{v[0-9]+}}.4h, {{v[0-9]+}}.4h, #0
+uint16x4_t test_vcltz_s16(int16x4_t a) {
+ return vcltz_s16(a);
+}
+
+// CHECK: test_vcltz_s32
+// CHECK: cmlt {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0
+uint32x2_t test_vcltz_s32(int32x2_t a) {
+ return vcltz_s32(a);
+}
+
+// CHECK: test_vcltz_s64
+// CHECK: cmlt {{d[0-9]+}}, {{d[0-9]+}}, #0
+uint64x1_t test_vcltz_s64(int64x1_t a) {
+ return vcltz_s64(a);
+}
+
+// CHECK: test_vcltzq_s8
+// CHECK: cmlt {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0
+uint8x16_t test_vcltzq_s8(int8x16_t a) {
+ return vcltzq_s8(a);
+}
+
+// CHECK: test_vcltzq_s16
+// CHECK: cmlt {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, #0
+uint16x8_t test_vcltzq_s16(int16x8_t a) {
+ return vcltzq_s16(a);
+}
+
+// CHECK: test_vcltzq_s32
+// CHECK: cmlt {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0
+uint32x4_t test_vcltzq_s32(int32x4_t a) {
+ return vcltzq_s32(a);
+}
+
+// CHECK: test_vcltzq_s64
+// CHECK: cmlt {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0
+uint64x2_t test_vcltzq_s64(int64x2_t a) {
+ return vcltzq_s64(a);
+}
+
+// CHECK: test_vcltz_f32
+// CHECK: fcmlt {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, #0
+uint32x2_t test_vcltz_f32(float32x2_t a) {
+ return vcltz_f32(a);
+}
+
+// CHECK: test_vcltzq_f32
+// CHECK: fcmlt {{v[0-9]+}}.4s, {{v[0-9]+}}.4s, #0
+uint32x4_t test_vcltzq_f32(float32x4_t a) {
+ return vcltzq_f32(a);
+}
+
+// CHECK: test_vcltzq_f64
+// CHECK: fcmlt {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #0
+uint64x2_t test_vcltzq_f64(float64x2_t a) {
+ return vcltzq_f64(a);
+}
+
+// CHECK: test_vrev16_s8
+// CHECK: rev16 v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+int8x8_t test_vrev16_s8(int8x8_t a) {
+ return vrev16_s8(a);
+}
+
+// CHECK: test_vrev16_u8
+// CHECK: rev16 v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+uint8x8_t test_vrev16_u8(uint8x8_t a) {
+ return vrev16_u8(a);
+}
+
+// CHECK: test_vrev16_p8
+// CHECK: rev16 v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+poly8x8_t test_vrev16_p8(poly8x8_t a) {
+ return vrev16_p8(a);
+}
+
+// CHECK: test_vrev16q_s8
+// CHECK: rev16 v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+int8x16_t test_vrev16q_s8(int8x16_t a) {
+ return vrev16q_s8(a);
+}
+
+// CHECK: test_vrev16q_u8
+// CHECK: rev16 v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+uint8x16_t test_vrev16q_u8(uint8x16_t a) {
+ return vrev16q_u8(a);
+}
+
+// CHECK: test_vrev16q_p8
+// CHECK: rev16 v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+poly8x16_t test_vrev16q_p8(poly8x16_t a) {
+ return vrev16q_p8(a);
+}
+
+// CHECK: test_vrev32_s8
+// CHECK: rev32 v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+int8x8_t test_vrev32_s8(int8x8_t a) {
+ return vrev32_s8(a);
+}
+
+// CHECK: test_vrev32_s16
+// CHECK: rev32 v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+int16x4_t test_vrev32_s16(int16x4_t a) {
+ return vrev32_s16(a);
+}
+
+// CHECK: test_vrev32_u8
+// CHECK: rev32 v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+uint8x8_t test_vrev32_u8(uint8x8_t a) {
+ return vrev32_u8(a);
+}
+
+// CHECK: test_vrev32_u16
+// CHECK: rev32 v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+uint16x4_t test_vrev32_u16(uint16x4_t a) {
+ return vrev32_u16(a);
+}
+
+// CHECK: test_vrev32_p8
+// CHECK: rev32 v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+poly8x8_t test_vrev32_p8(poly8x8_t a) {
+ return vrev32_p8(a);
+}
+
+// CHECK: test_vrev32_p16
+// CHECK: rev32 v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+poly16x4_t test_vrev32_p16(poly16x4_t a) {
+ return vrev32_p16(a);
+}
+
+// CHECK: test_vrev32q_s8
+// CHECK: rev32 v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+int8x16_t test_vrev32q_s8(int8x16_t a) {
+ return vrev32q_s8(a);
+}
+
+// CHECK: test_vrev32q_s16
+// CHECK: rev32 v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+int16x8_t test_vrev32q_s16(int16x8_t a) {
+ return vrev32q_s16(a);
+}
+
+// CHECK: test_vrev32q_u8
+// CHECK: rev32 v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+uint8x16_t test_vrev32q_u8(uint8x16_t a) {
+ return vrev32q_u8(a);
+}
+
+// CHECK: test_vrev32q_u16
+// CHECK: rev32 v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+uint16x8_t test_vrev32q_u16(uint16x8_t a) {
+ return vrev32q_u16(a);
+}
+
+// CHECK: test_vrev32q_p8
+// CHECK: rev32 v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+poly8x16_t test_vrev32q_p8(poly8x16_t a) {
+ return vrev32q_p8(a);
+}
+
+// CHECK: test_vrev32q_p16
+// CHECK: rev32 v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+poly16x8_t test_vrev32q_p16(poly16x8_t a) {
+ return vrev32q_p16(a);
+}
+
+// CHECK: test_vrev64_s8
+// CHECK: rev64 v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+int8x8_t test_vrev64_s8(int8x8_t a) {
+ return vrev64_s8(a);
+}
+
+// CHECK: test_vrev64_s16
+// CHECK: rev64 v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+int16x4_t test_vrev64_s16(int16x4_t a) {
+ return vrev64_s16(a);
+}
+
+// CHECK: test_vrev64_s32
+// CHECK: rev64 v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+int32x2_t test_vrev64_s32(int32x2_t a) {
+ return vrev64_s32(a);
+}
+
+// CHECK: test_vrev64_u8
+// CHECK: rev64 v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+uint8x8_t test_vrev64_u8(uint8x8_t a) {
+ return vrev64_u8(a);
+}
+
+// CHECK: test_vrev64_u16
+// CHECK: rev64 v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+uint16x4_t test_vrev64_u16(uint16x4_t a) {
+ return vrev64_u16(a);
+}
+
+// CHECK: test_vrev64_u32
+// CHECK: rev64 v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+uint32x2_t test_vrev64_u32(uint32x2_t a) {
+ return vrev64_u32(a);
+}
+
+// CHECK: test_vrev64_p8
+// CHECK: rev64 v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+poly8x8_t test_vrev64_p8(poly8x8_t a) {
+ return vrev64_p8(a);
+}
+
+// CHECK: test_vrev64_p16
+// CHECK: rev64 v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+poly16x4_t test_vrev64_p16(poly16x4_t a) {
+ return vrev64_p16(a);
+}
+
+// CHECK: test_vrev64_f32
+// CHECK: rev64 v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+float32x2_t test_vrev64_f32(float32x2_t a) {
+ return vrev64_f32(a);
+}
+
+// CHECK: test_vrev64q_s8
+// CHECK: rev64 v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+int8x16_t test_vrev64q_s8(int8x16_t a) {
+ return vrev64q_s8(a);
+}
+
+// CHECK: test_vrev64q_s16
+// CHECK: rev64 v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+int16x8_t test_vrev64q_s16(int16x8_t a) {
+ return vrev64q_s16(a);
+}
+
+// CHECK: test_vrev64q_s32
+// CHECK: rev64 v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+int32x4_t test_vrev64q_s32(int32x4_t a) {
+ return vrev64q_s32(a);
+}
+
+// CHECK: test_vrev64q_u8
+// CHECK: rev64 v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+uint8x16_t test_vrev64q_u8(uint8x16_t a) {
+ return vrev64q_u8(a);
+}
+
+// CHECK: test_vrev64q_u16
+// CHECK: rev64 v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+uint16x8_t test_vrev64q_u16(uint16x8_t a) {
+ return vrev64q_u16(a);
+}
+
+// CHECK: test_vrev64q_u32
+// CHECK: rev64 v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+uint32x4_t test_vrev64q_u32(uint32x4_t a) {
+ return vrev64q_u32(a);
+}
+
+// CHECK: test_vrev64q_p8
+// CHECK: rev64 v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+poly8x16_t test_vrev64q_p8(poly8x16_t a) {
+ return vrev64q_p8(a);
+}
+
+// CHECK: test_vrev64q_p16
+// CHECK: rev64 v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+poly16x8_t test_vrev64q_p16(poly16x8_t a) {
+ return vrev64q_p16(a);
+}
+
+// CHECK: test_vrev64q_f32
+// CHECK: rev64 v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+float32x4_t test_vrev64q_f32(float32x4_t a) {
+ return vrev64q_f32(a);
+}
+
+int16x4_t test_vpaddl_s8(int8x8_t a) {
+ // CHECK: test_vpaddl_s8
+ return vpaddl_s8(a);
+ // CHECK: saddlp v{{[0-9]+}}.4h, v{{[0-9]+}}.8b
+}
+
+int32x2_t test_vpaddl_s16(int16x4_t a) {
+ // CHECK: test_vpaddl_s16
+ return vpaddl_s16(a);
+ // CHECK: saddlp v{{[0-9]+}}.2s, v{{[0-9]+}}.4h
+}
+
+int64x1_t test_vpaddl_s32(int32x2_t a) {
+ // CHECK: test_vpaddl_s32
+ return vpaddl_s32(a);
+ // CHECK: saddlp v{{[0-9]+}}.1d, v{{[0-9]+}}.2s
+}
+
+uint16x4_t test_vpaddl_u8(uint8x8_t a) {
+ // CHECK: test_vpaddl_u8
+ return vpaddl_u8(a);
+ // CHECK: uaddlp v{{[0-9]+}}.4h, v{{[0-9]+}}.8b
+}
+
+uint32x2_t test_vpaddl_u16(uint16x4_t a) {
+ // CHECK: test_vpaddl_u16
+ return vpaddl_u16(a);
+ // CHECK: uaddlp v{{[0-9]+}}.2s, v{{[0-9]+}}.4h
+}
+
+uint64x1_t test_vpaddl_u32(uint32x2_t a) {
+ // CHECK: test_vpaddl_u32
+ return vpaddl_u32(a);
+ // CHECK: uaddlp v{{[0-9]+}}.1d, v{{[0-9]+}}.2s
+}
+
+int16x8_t test_vpaddlq_s8(int8x16_t a) {
+ // CHECK: test_vpaddlq_s8
+ return vpaddlq_s8(a);
+ // CHECK: saddlp v{{[0-9]+}}.8h, v{{[0-9]+}}.16b
+}
+
+int32x4_t test_vpaddlq_s16(int16x8_t a) {
+ // CHECK: test_vpaddlq_s16
+ return vpaddlq_s16(a);
+ // CHECK: saddlp v{{[0-9]+}}.4s, v{{[0-9]+}}.8h
+}
+
+int64x2_t test_vpaddlq_s32(int32x4_t a) {
+ // CHECK: test_vpaddlq_s32
+ return vpaddlq_s32(a);
+ // CHECK: saddlp v{{[0-9]+}}.2d, v{{[0-9]+}}.4s
+}
+
+uint16x8_t test_vpaddlq_u8(uint8x16_t a) {
+ // CHECK: test_vpaddlq_u8
+ return vpaddlq_u8(a);
+ // CHECK: uaddlp v{{[0-9]+}}.8h, v{{[0-9]+}}.16b
+}
+
+uint32x4_t test_vpaddlq_u16(uint16x8_t a) {
+ // CHECK: test_vpaddlq_u16
+ return vpaddlq_u16(a);
+ // CHECK: uaddlp v{{[0-9]+}}.4s, v{{[0-9]+}}.8h
+}
+
+uint64x2_t test_vpaddlq_u32(uint32x4_t a) {
+ // CHECK: test_vpaddlq_u32
+ return vpaddlq_u32(a);
+ // CHECK: uaddlp v{{[0-9]+}}.2d, v{{[0-9]+}}.4s
+}
+
+int16x4_t test_vpadal_s8(int16x4_t a, int8x8_t b) {
+ // CHECK: test_vpadal_s8
+ return vpadal_s8(a, b);
+ // CHECK: sadalp v{{[0-9]+}}.4h, v{{[0-9]+}}.8b
+}
+
+int32x2_t test_vpadal_s16(int32x2_t a, int16x4_t b) {
+ // CHECK: test_vpadal_s16
+ return vpadal_s16(a, b);
+ // CHECK: sadalp v{{[0-9]+}}.2s, v{{[0-9]+}}.4h
+}
+
+int64x1_t test_vpadal_s32(int64x1_t a, int32x2_t b) {
+ // CHECK: test_vpadal_s32
+ return vpadal_s32(a, b);
+ // CHECK: sadalp v{{[0-9]+}}.1d, v{{[0-9]+}}.2s
+}
+
+uint16x4_t test_vpadal_u8(uint16x4_t a, uint8x8_t b) {
+ // CHECK: test_vpadal_u8
+ return vpadal_u8(a, b);
+ // CHECK: uadalp v{{[0-9]+}}.4h, v{{[0-9]+}}.8b
+}
+
+uint32x2_t test_vpadal_u16(uint32x2_t a, uint16x4_t b) {
+ // CHECK: test_vpadal_u16
+ return vpadal_u16(a, b);
+ // CHECK: uadalp v{{[0-9]+}}.2s, v{{[0-9]+}}.4h
+}
+
+uint64x1_t test_vpadal_u32(uint64x1_t a, uint32x2_t b) {
+ // CHECK: test_vpadal_u32
+ return vpadal_u32(a, b);
+ // CHECK: uadalp v{{[0-9]+}}.1d, v{{[0-9]+}}.2s
+}
+
+int16x8_t test_vpadalq_s8(int16x8_t a, int8x16_t b) {
+ // CHECK: test_vpadalq_s8
+ return vpadalq_s8(a, b);
+ // CHECK: sadalp v{{[0-9]+}}.8h, v{{[0-9]+}}.16b
+}
+
+int32x4_t test_vpadalq_s16(int32x4_t a, int16x8_t b) {
+ // CHECK: test_vpadalq_s16
+ return vpadalq_s16(a, b);
+ // CHECK: sadalp v{{[0-9]+}}.4s, v{{[0-9]+}}.8h
+}
+
+int64x2_t test_vpadalq_s32(int64x2_t a, int32x4_t b) {
+ // CHECK: test_vpadalq_s32
+ return vpadalq_s32(a, b);
+ // CHECK: sadalp v{{[0-9]+}}.2d, v{{[0-9]+}}.4s
+}
+
+uint16x8_t test_vpadalq_u8(uint16x8_t a, uint8x16_t b) {
+ // CHECK: test_vpadalq_u8
+ return vpadalq_u8(a, b);
+ // CHECK: uadalp v{{[0-9]+}}.8h, v{{[0-9]+}}.16b
+}
+
+uint32x4_t test_vpadalq_u16(uint32x4_t a, uint16x8_t b) {
+ // CHECK: test_vpadalq_u16
+ return vpadalq_u16(a, b);
+ // CHECK: uadalp v{{[0-9]+}}.4s, v{{[0-9]+}}.8h
+}
+
+uint64x2_t test_vpadalq_u32(uint64x2_t a, uint32x4_t b) {
+ // CHECK: test_vpadalq_u32
+ return vpadalq_u32(a, b);
+ // CHECK: uadalp v{{[0-9]+}}.2d, v{{[0-9]+}}.4s
+}
+
+int8x8_t test_vqabs_s8(int8x8_t a) {
+ // CHECK: test_vqabs_s8
+ return vqabs_s8(a);
+ // CHECK: sqabs v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int8x16_t test_vqabsq_s8(int8x16_t a) {
+ // CHECK: test_vqabsq_s8
+ return vqabsq_s8(a);
+ // CHECK: sqabs v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int16x4_t test_vqabs_s16(int16x4_t a) {
+ // CHECK: test_vqabs_s16
+ return vqabs_s16(a);
+ // CHECK: sqabs v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+}
+
+int16x8_t test_vqabsq_s16(int16x8_t a) {
+ // CHECK: test_vqabsq_s16
+ return vqabsq_s16(a);
+ // CHECK: sqabs v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+}
+
+int32x2_t test_vqabs_s32(int32x2_t a) {
+ // CHECK: test_vqabs_s32
+ return vqabs_s32(a);
+ // CHECK: sqabs v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vqabsq_s32(int32x4_t a) {
+ // CHECK: test_vqabsq_s32
+ return vqabsq_s32(a);
+ // CHECK: sqabs v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int64x2_t test_vqabsq_s64(int64x2_t a) {
+ // CHECK: test_vqabsq_s64
+ return vqabsq_s64(a);
+ // CHECK: sqabs v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+int8x8_t test_vqneg_s8(int8x8_t a) {
+ // CHECK: test_vqneg_s8
+ return vqneg_s8(a);
+ // CHECK: sqneg v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int8x16_t test_vqnegq_s8(int8x16_t a) {
+ // CHECK: test_vqnegq_s8
+ return vqnegq_s8(a);
+ // CHECK: sqneg v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int16x4_t test_vqneg_s16(int16x4_t a) {
+ // CHECK: test_vqneg_s16
+ return vqneg_s16(a);
+ // CHECK: sqneg v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+}
+
+int16x8_t test_vqnegq_s16(int16x8_t a) {
+ // CHECK: test_vqnegq_s16
+ return vqnegq_s16(a);
+ // CHECK: sqneg v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+}
+
+int32x2_t test_vqneg_s32(int32x2_t a) {
+ // CHECK: test_vqneg_s32
+ return vqneg_s32(a);
+ // CHECK: sqneg v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vqnegq_s32(int32x4_t a) {
+ // CHECK: test_vqnegq_s32
+ return vqnegq_s32(a);
+ // CHECK: sqneg v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int64x2_t test_vqnegq_s64(int64x2_t a) {
+ // CHECK: test_vqnegq_s64
+ return vqnegq_s64(a);
+ // CHECK: sqneg v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+int8x8_t test_vneg_s8(int8x8_t a) {
+ // CHECK: test_vneg_s8
+ return vneg_s8(a);
+ // CHECK: neg v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int8x16_t test_vnegq_s8(int8x16_t a) {
+ // CHECK: test_vnegq_s8
+ return vnegq_s8(a);
+ // CHECK: neg v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int16x4_t test_vneg_s16(int16x4_t a) {
+ // CHECK: test_vneg_s16
+ return vneg_s16(a);
+ // CHECK: neg v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+}
+
+int16x8_t test_vnegq_s16(int16x8_t a) {
+ // CHECK: test_vnegq_s16
+ return vnegq_s16(a);
+ // CHECK: neg v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+}
+
+int32x2_t test_vneg_s32(int32x2_t a) {
+ // CHECK: test_vneg_s32
+ return vneg_s32(a);
+ // CHECK: neg v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vnegq_s32(int32x4_t a) {
+ // CHECK: test_vnegq_s32
+ return vnegq_s32(a);
+ // CHECK: neg v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int64x2_t test_vnegq_s64(int64x2_t a) {
+ // CHECK: test_vnegq_s64
+ return vnegq_s64(a);
+ // CHECK: neg v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vneg_f32(float32x2_t a) {
+ // CHECK: test_vneg_f32
+ return vneg_f32(a);
+ // CHECK: fneg v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vnegq_f32(float32x4_t a) {
+ // CHECK: test_vnegq_f32
+ return vnegq_f32(a);
+ // CHECK: fneg v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vnegq_f64(float64x2_t a) {
+ // CHECK: test_vnegq_f64
+ return vnegq_f64(a);
+ // CHECK: fneg v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+int8x8_t test_vabs_s8(int8x8_t a) {
+ // CHECK: test_vabs_s8
+ return vabs_s8(a);
+ // CHECK: abs v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int8x16_t test_vabsq_s8(int8x16_t a) {
+ // CHECK: test_vabsq_s8
+ return vabsq_s8(a);
+ // CHECK: abs v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int16x4_t test_vabs_s16(int16x4_t a) {
+ // CHECK: test_vabs_s16
+ return vabs_s16(a);
+ // CHECK: abs v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+}
+
+int16x8_t test_vabsq_s16(int16x8_t a) {
+ // CHECK: test_vabsq_s16
+ return vabsq_s16(a);
+ // CHECK: abs v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+}
+
+int32x2_t test_vabs_s32(int32x2_t a) {
+ // CHECK: test_vabs_s32
+ return vabs_s32(a);
+ // CHECK: abs v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vabsq_s32(int32x4_t a) {
+ // CHECK: test_vabsq_s32
+ return vabsq_s32(a);
+ // CHECK: abs v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int64x2_t test_vabsq_s64(int64x2_t a) {
+ // CHECK: test_vabsq_s64
+ return vabsq_s64(a);
+ // CHECK: abs v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vabs_f32(float32x2_t a) {
+ // CHECK: test_vabs_f32
+ return vabs_f32(a);
+ // CHECK: fabs v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vabsq_f32(float32x4_t a) {
+ // CHECK: test_vabsq_f32
+ return vabsq_f32(a);
+ // CHECK: fabs v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vabsq_f64(float64x2_t a) {
+ // CHECK: test_vabsq_f64
+ return vabsq_f64(a);
+ // CHECK: fabs v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+int8x8_t test_vuqadd_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vuqadd_s8
+ return vuqadd_s8(a, b);
+ // CHECK: suqadd v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int8x16_t test_vuqaddq_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vuqaddq_s8
+ return vuqaddq_s8(a, b);
+ // CHECK: suqadd v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int16x4_t test_vuqadd_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vuqadd_s16
+ return vuqadd_s16(a, b);
+ // CHECK: suqadd v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+}
+
+int16x8_t test_vuqaddq_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vuqaddq_s16
+ return vuqaddq_s16(a, b);
+ // CHECK: suqadd v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+}
+
+int32x2_t test_vuqadd_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vuqadd_s32
+ return vuqadd_s32(a, b);
+ // CHECK: suqadd v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vuqaddq_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vuqaddq_s32
+ return vuqaddq_s32(a, b);
+ // CHECK: suqadd v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int64x2_t test_vuqaddq_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vuqaddq_s64
+ return vuqaddq_s64(a, b);
+ // CHECK: suqadd v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+int8x8_t test_vcls_s8(int8x8_t a) {
+ // CHECK: test_vcls_s8
+ return vcls_s8(a);
+ // CHECK: cls v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int8x16_t test_vclsq_s8(int8x16_t a) {
+ // CHECK: test_vclsq_s8
+ return vclsq_s8(a);
+ // CHECK: cls v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int16x4_t test_vcls_s16(int16x4_t a) {
+ // CHECK: test_vcls_s16
+ return vcls_s16(a);
+ // CHECK: cls v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+}
+
+int16x8_t test_vclsq_s16(int16x8_t a) {
+ // CHECK: test_vclsq_s16
+ return vclsq_s16(a);
+ // CHECK: cls v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+}
+
+int32x2_t test_vcls_s32(int32x2_t a) {
+ // CHECK: test_vcls_s32
+ return vcls_s32(a);
+ // CHECK: cls v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vclsq_s32(int32x4_t a) {
+ // CHECK: test_vclsq_s32
+ return vclsq_s32(a);
+ // CHECK: cls v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int8x8_t test_vclz_s8(int8x8_t a) {
+ // CHECK: test_vclz_s8
+ return vclz_s8(a);
+ // CHECK: clz v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int8x16_t test_vclzq_s8(int8x16_t a) {
+ // CHECK: test_vclzq_s8
+ return vclzq_s8(a);
+ // CHECK: clz v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int16x4_t test_vclz_s16(int16x4_t a) {
+ // CHECK: test_vclz_s16
+ return vclz_s16(a);
+ // CHECK: clz v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+}
+
+int16x8_t test_vclzq_s16(int16x8_t a) {
+ // CHECK: test_vclzq_s16
+ return vclzq_s16(a);
+ // CHECK: clz v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+}
+
+int32x2_t test_vclz_s32(int32x2_t a) {
+ // CHECK: test_vclz_s32
+ return vclz_s32(a);
+ // CHECK: clz v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vclzq_s32(int32x4_t a) {
+ // CHECK: test_vclzq_s32
+ return vclzq_s32(a);
+ // CHECK: clz v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+uint8x8_t test_vclz_u8(uint8x8_t a) {
+ // CHECK: test_vclz_u8
+ return vclz_u8(a);
+ // CHECK: clz v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+uint8x16_t test_vclzq_u8(uint8x16_t a) {
+ // CHECK: test_vclzq_u8
+ return vclzq_u8(a);
+ // CHECK: clz v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+uint16x4_t test_vclz_u16(uint16x4_t a) {
+ // CHECK: test_vclz_u16
+ return vclz_u16(a);
+ // CHECK: clz v{{[0-9]+}}.4h, v{{[0-9]+}}.4h
+}
+
+uint16x8_t test_vclzq_u16(uint16x8_t a) {
+ // CHECK: test_vclzq_u16
+ return vclzq_u16(a);
+ // CHECK: clz v{{[0-9]+}}.8h, v{{[0-9]+}}.8h
+}
+
+uint32x2_t test_vclz_u32(uint32x2_t a) {
+ // CHECK: test_vclz_u32
+ return vclz_u32(a);
+ // CHECK: clz v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+uint32x4_t test_vclzq_u32(uint32x4_t a) {
+ // CHECK: test_vclzq_u32
+ return vclzq_u32(a);
+ // CHECK: clz v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int8x8_t test_vcnt_s8(int8x8_t a) {
+ // CHECK: test_vcnt_s8
+ return vcnt_s8(a);
+ // CHECK: cnt v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int8x16_t test_vcntq_s8(int8x16_t a) {
+ // CHECK: test_vcntq_s8
+ return vcntq_s8(a);
+ // CHECK: cnt v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+uint8x8_t test_vcnt_u8(uint8x8_t a) {
+ // CHECK: test_vcnt_u8
+ return vcnt_u8(a);
+ // CHECK: cnt v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+uint8x16_t test_vcntq_u8(uint8x16_t a) {
+ // CHECK: test_vcntq_u8
+ return vcntq_u8(a);
+ // CHECK: cnt v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+poly8x8_t test_vcnt_p8(poly8x8_t a) {
+ // CHECK: test_vcnt_p8
+ return vcnt_p8(a);
+ // CHECK: cnt v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+poly8x16_t test_vcntq_p8(poly8x16_t a) {
+ // CHECK: test_vcntq_p8
+ return vcntq_p8(a);
+ // CHECK: cnt v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int8x8_t test_vmvn_s8(int8x8_t a) {
+ // CHECK: test_vmvn_s8
+ return vmvn_s8(a);
+ // CHECK: not v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int8x16_t test_vmvnq_s8(int8x16_t a) {
+ // CHECK: test_vmvnq_s8
+ return vmvnq_s8(a);
+ // CHECK: not v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int16x4_t test_vmvn_s16(int16x4_t a) {
+ // CHECK: test_vmvn_s16
+ return vmvn_s16(a);
+ // CHECK: not v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int16x8_t test_vmvnq_s16(int16x8_t a) {
+ // CHECK: test_vmvnq_s16
+ return vmvnq_s16(a);
+ // CHECK: not v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int32x2_t test_vmvn_s32(int32x2_t a) {
+ // CHECK: test_vmvn_s32
+ return vmvn_s32(a);
+ // CHECK: not v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int32x4_t test_vmvnq_s32(int32x4_t a) {
+ // CHECK: test_vmvnq_s32
+ return vmvnq_s32(a);
+ // CHECK: not v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+uint8x8_t test_vmvn_u8(uint8x8_t a) {
+ // CHECK: test_vmvn_u8
+ return vmvn_u8(a);
+ // CHECK: not v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+uint8x16_t test_vmvnq_u8(uint8x16_t a) {
+ // CHECK: test_vmvnq_u8
+ return vmvnq_u8(a);
+ // CHECK: not v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+uint16x4_t test_vmvn_u16(uint16x4_t a) {
+ // CHECK: test_vmvn_u16
+ return vmvn_u16(a);
+ // CHECK: not v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+uint16x8_t test_vmvnq_u16(uint16x8_t a) {
+ // CHECK: test_vmvnq_u16
+ return vmvnq_u16(a);
+ // CHECK: not v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+uint32x2_t test_vmvn_u32(uint32x2_t a) {
+ // CHECK: test_vmvn_u32
+ return vmvn_u32(a);
+ // CHECK: not v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+uint32x4_t test_vmvnq_u32(uint32x4_t a) {
+ // CHECK: test_vmvnq_u32
+ return vmvnq_u32(a);
+ // CHECK: not v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+poly8x8_t test_vmvn_p8(poly8x8_t a) {
+ // CHECK: test_vmvn_p8
+ return vmvn_p8(a);
+ // CHECK: not v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+poly8x16_t test_vmvnq_p8(poly8x16_t a) {
+ // CHECK: test_vmvnq_p8
+ return vmvnq_p8(a);
+ // CHECK: not v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int8x8_t test_vrbit_s8(int8x8_t a) {
+ // CHECK: test_vrbit_s8
+ return vrbit_s8(a);
+ // CHECK: rbit v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+int8x16_t test_vrbitq_s8(int8x16_t a) {
+ // CHECK: test_vrbitq_s8
+ return vrbitq_s8(a);
+ // CHECK: rbit v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+uint8x8_t test_vrbit_u8(uint8x8_t a) {
+ // CHECK: test_vrbit_u8
+ return vrbit_u8(a);
+ // CHECK: rbit v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+uint8x16_t test_vrbitq_u8(uint8x16_t a) {
+ // CHECK: test_vrbitq_u8
+ return vrbitq_u8(a);
+ // CHECK: rbit v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+poly8x8_t test_vrbit_p8(poly8x8_t a) {
+ // CHECK: test_vrbit_p8
+ return vrbit_p8(a);
+ // CHECK: rbit v{{[0-9]+}}.8b, v{{[0-9]+}}.8b
+}
+
+poly8x16_t test_vrbitq_p8(poly8x16_t a) {
+ // CHECK: test_vrbitq_p8
+ return vrbitq_p8(a);
+ // CHECK: rbit v{{[0-9]+}}.16b, v{{[0-9]+}}.16b
+}
+
+int8x8_t test_vmovn_s16(int16x8_t a) {
+ // CHECK: test_vmovn_s16
+ return vmovn_s16(a);
+ // CHECK: xtn v{{[0-9]+}}.8b, v{{[0-9]+}}.8h
+}
+
+int16x4_t test_vmovn_s32(int32x4_t a) {
+ // CHECK: test_vmovn_s32
+ return vmovn_s32(a);
+ // CHECK: xtn v{{[0-9]+}}.4h, v{{[0-9]+}}.4s
+}
+
+int32x2_t test_vmovn_s64(int64x2_t a) {
+ // CHECK: test_vmovn_s64
+ return vmovn_s64(a);
+ // CHECK: xtn v{{[0-9]+}}.2s, v{{[0-9]+}}.2d
+}
+
+uint8x8_t test_vmovn_u16(uint16x8_t a) {
+ // CHECK: test_vmovn_u16
+ return vmovn_u16(a);
+ // CHECK: xtn v{{[0-9]+}}.8b, v{{[0-9]+}}.8h
+}
+
+uint16x4_t test_vmovn_u32(uint32x4_t a) {
+ // CHECK: test_vmovn_u32
+ return vmovn_u32(a);
+ // CHECK: xtn v{{[0-9]+}}.4h, v{{[0-9]+}}.4s
+}
+
+uint32x2_t test_vmovn_u64(uint64x2_t a) {
+ // CHECK: test_vmovn_u64
+ return vmovn_u64(a);
+ // CHECK: xtn v{{[0-9]+}}.2s, v{{[0-9]+}}.2d
+}
+
+int8x16_t test_vmovn_high_s16(int8x8_t a, int16x8_t b) {
+ // CHECK: test_vmovn_high_s16
+ return vmovn_high_s16(a, b);
+ // CHECK: xtn2 v{{[0-9]+}}.16b, v{{[0-9]+}}.8h
+}
+
+int16x8_t test_vmovn_high_s32(int16x4_t a, int32x4_t b) {
+ // CHECK: test_vmovn_high_s32
+ return vmovn_high_s32(a, b);
+ // CHECK: xtn2 v{{[0-9]+}}.8h, v{{[0-9]+}}.4s
+}
+
+int32x4_t test_vmovn_high_s64(int32x2_t a, int64x2_t b) {
+ // CHECK: test_vmovn_high_s64
+ return vmovn_high_s64(a, b);
+ // CHECK: xtn2 v{{[0-9]+}}.4s, v{{[0-9]+}}.2d
+}
+
+int8x16_t test_vmovn_high_u16(int8x8_t a, int16x8_t b) {
+ // CHECK: test_vmovn_high_u16
+ return vmovn_high_u16(a, b);
+ // CHECK: xtn2 v{{[0-9]+}}.16b, v{{[0-9]+}}.8h
+}
+
+int16x8_t test_vmovn_high_u32(int16x4_t a, int32x4_t b) {
+ // CHECK: test_vmovn_high_u32
+ return vmovn_high_u32(a, b);
+ // CHECK: xtn2 v{{[0-9]+}}.8h, v{{[0-9]+}}.4s
+}
+
+int32x4_t test_vmovn_high_u64(int32x2_t a, int64x2_t b) {
+ // CHECK: test_vmovn_high_u64
+ return vmovn_high_u64(a, b);
+ // CHECK: xtn2 v{{[0-9]+}}.4s, v{{[0-9]+}}.2d
+}
+
+int8x8_t test_vqmovun_s16(int16x8_t a) {
+ // CHECK: test_vqmovun_s16
+ return vqmovun_s16(a);
+ // CHECK: sqxtun v{{[0-9]+}}.8b, v{{[0-9]+}}.8h
+}
+
+int16x4_t test_vqmovun_s32(int32x4_t a) {
+ // CHECK: test_vqmovun_s32
+ return vqmovun_s32(a);
+ // CHECK: sqxtun v{{[0-9]+}}.4h, v{{[0-9]+}}.4s
+}
+
+int32x2_t test_vqmovun_s64(int64x2_t a) {
+ // CHECK: test_vqmovun_s64
+ return vqmovun_s64(a);
+ // CHECK: sqxtun v{{[0-9]+}}.2s, v{{[0-9]+}}.2d
+}
+
+int8x16_t test_vqmovun_high_s16(int8x8_t a, int16x8_t b) {
+ // CHECK: test_vqmovun_high_s16
+ return vqmovun_high_s16(a, b);
+ // CHECK: sqxtun2 v{{[0-9]+}}.16b, v{{[0-9]+}}.8h
+}
+
+int16x8_t test_vqmovun_high_s32(int16x4_t a, int32x4_t b) {
+ // CHECK: test_vqmovun_high_s32
+ return vqmovun_high_s32(a, b);
+ // CHECK: sqxtun2 v{{[0-9]+}}.8h, v{{[0-9]+}}.4s
+}
+
+int32x4_t test_vqmovun_high_s64(int32x2_t a, int64x2_t b) {
+ // CHECK: test_vqmovun_high_s64
+ return vqmovun_high_s64(a, b);
+ // CHECK: sqxtun2 v{{[0-9]+}}.4s, v{{[0-9]+}}.2d
+}
+
+int8x8_t test_vqmovn_s16(int16x8_t a) {
+ // CHECK: test_vqmovn_s16
+ return vqmovn_s16(a);
+ // CHECK: sqxtn v{{[0-9]+}}.8b, v{{[0-9]+}}.8h
+}
+
+int16x4_t test_vqmovn_s32(int32x4_t a) {
+ // CHECK: test_vqmovn_s32
+ return vqmovn_s32(a);
+ // CHECK: sqxtn v{{[0-9]+}}.4h, v{{[0-9]+}}.4s
+}
+
+int32x2_t test_vqmovn_s64(int64x2_t a) {
+ // CHECK: test_vqmovn_s64
+ return vqmovn_s64(a);
+ // CHECK: sqxtn v{{[0-9]+}}.2s, v{{[0-9]+}}.2d
+}
+
+int8x16_t test_vqmovn_high_s16(int8x8_t a, int16x8_t b) {
+ // CHECK: test_vqmovn_high_s16
+ return vqmovn_high_s16(a, b);
+ // CHECK: sqxtn2 v{{[0-9]+}}.16b, v{{[0-9]+}}.8h
+}
+
+int16x8_t test_vqmovn_high_s32(int16x4_t a, int32x4_t b) {
+ // CHECK: test_vqmovn_high_s32
+ return vqmovn_high_s32(a, b);
+ // CHECK: sqxtn2 v{{[0-9]+}}.8h, v{{[0-9]+}}.4s
+}
+
+int32x4_t test_vqmovn_high_s64(int32x2_t a, int64x2_t b) {
+ // CHECK: test_vqmovn_high_s64
+ return vqmovn_high_s64(a, b);
+ // CHECK: sqxtn2 v{{[0-9]+}}.4s, v{{[0-9]+}}.2d
+}
+
+uint8x8_t test_vqmovn_u16(uint16x8_t a) {
+ // CHECK: test_vqmovn_u16
+ return vqmovn_u16(a);
+ // CHECK: uqxtn v{{[0-9]+}}.8b, v{{[0-9]+}}.8h
+}
+
+uint16x4_t test_vqmovn_u32(uint32x4_t a) {
+ // CHECK: test_vqmovn_u32
+ return vqmovn_u32(a);
+ // CHECK: uqxtn v{{[0-9]+}}.4h, v{{[0-9]+}}.4s
+}
+
+uint32x2_t test_vqmovn_u64(uint64x2_t a) {
+ // CHECK: test_vqmovn_u64
+ return vqmovn_u64(a);
+ // CHECK: uqxtn v{{[0-9]+}}.2s, v{{[0-9]+}}.2d
+}
+
+uint8x16_t test_vqmovn_high_u16(uint8x8_t a, uint16x8_t b) {
+ // CHECK: test_vqmovn_high_u16
+ return vqmovn_high_u16(a, b);
+ // CHECK: uqxtn2 v{{[0-9]+}}.16b, v{{[0-9]+}}.8h
+}
+
+uint16x8_t test_vqmovn_high_u32(uint16x4_t a, uint32x4_t b) {
+ // CHECK: test_vqmovn_high_u32
+ return vqmovn_high_u32(a, b);
+ // CHECK: uqxtn2 v{{[0-9]+}}.8h, v{{[0-9]+}}.4s
+}
+
+uint32x4_t test_vqmovn_high_u64(uint32x2_t a, uint64x2_t b) {
+ // CHECK: test_vqmovn_high_u64
+ return vqmovn_high_u64(a, b);
+ // CHECK: uqxtn2 v{{[0-9]+}}.4s, v{{[0-9]+}}.2d
+}
+
+int16x8_t test_vshll_n_s8(int8x8_t a) {
+ // CHECK: test_vshll_n_s8
+ return vshll_n_s8(a, 8);
+ // CHECK: shll {{v[0-9]+}}.8h, {{v[0-9]+}}.8b, #8
+}
+
+int32x4_t test_vshll_n_s16(int16x4_t a) {
+ // CHECK: test_vshll_n_s16
+ return vshll_n_s16(a, 16);
+ // CHECK: shll {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, #16
+}
+
+int64x2_t test_vshll_n_s32(int32x2_t a) {
+ // CHECK: test_vshll_n_s32
+ return vshll_n_s32(a, 32);
+ // CHECK: shll {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, #32
+}
+
+uint16x8_t test_vshll_n_u8(uint8x8_t a) {
+ // CHECK: test_vshll_n_u8
+ return vshll_n_u8(a, 8);
+ // CHECK: shll {{v[0-9]+}}.8h, {{v[0-9]+}}.8b, #8
+}
+
+uint32x4_t test_vshll_n_u16(uint16x4_t a) {
+ // CHECK: test_vshll_n_u16
+ return vshll_n_u16(a, 16);
+ // CHECK: shll {{v[0-9]+}}.4s, {{v[0-9]+}}.4h, #16
+}
+
+uint64x2_t test_vshll_n_u32(uint32x2_t a) {
+ // CHECK: test_vshll_n_u32
+ return vshll_n_u32(a, 32);
+ // CHECK: shll {{v[0-9]+}}.2d, {{v[0-9]+}}.2s, #32
+}
+
+int16x8_t test_vshll_high_n_s8(int8x16_t a) {
+ // CHECK: test_vshll_high_n_s8
+ return vshll_high_n_s8(a, 8);
+ // CHECK: shll2 {{v[0-9]+}}.8h, {{v[0-9]+}}.16b, #8
+}
+
+int32x4_t test_vshll_high_n_s16(int16x8_t a) {
+ // CHECK: test_vshll_high_n_s16
+ return vshll_high_n_s16(a, 16);
+ // CHECK: shll2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, #16
+}
+
+int64x2_t test_vshll_high_n_s32(int32x4_t a) {
+ // CHECK: test_vshll_high_n_s32
+ return vshll_high_n_s32(a, 32);
+ // CHECK: shll2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, #32
+}
+
+uint16x8_t test_vshll_high_n_u8(uint8x16_t a) {
+ // CHECK: test_vshll_high_n_u8
+ return vshll_high_n_u8(a, 8);
+ // CHECK: shll2 {{v[0-9]+}}.8h, {{v[0-9]+}}.16b, #8
+}
+
+uint32x4_t test_vshll_high_n_u16(uint16x8_t a) {
+ // CHECK: test_vshll_high_n_u16
+ return vshll_high_n_u16(a, 16);
+ // CHECK: shll2 {{v[0-9]+}}.4s, {{v[0-9]+}}.8h, #16
+}
+
+uint64x2_t test_vshll_high_n_u32(uint32x4_t a) {
+ // CHECK: test_vshll_high_n_u32
+ return vshll_high_n_u32(a, 32);
+ // CHECK: shll2 {{v[0-9]+}}.2d, {{v[0-9]+}}.4s, #32
+}
+
+float16x4_t test_vcvt_f16_f32(float32x4_t a) {
+ //CHECK: test_vcvt_f16_f32
+ return vcvt_f16_f32(a);
+ // CHECK: fcvtn v{{[0-9]+}}.4h, v{{[0-9]+}}.4s
+}
+
+float16x8_t test_vcvt_high_f16_f32(float16x4_t a, float32x4_t b) {
+ //CHECK: test_vcvt_high_f16_f32
+ return vcvt_high_f16_f32(a, b);
+ // CHECK: fcvtn2 v{{[0-9]+}}.8h, v{{[0-9]+}}.4s
+}
+
+float32x2_t test_vcvt_f32_f64(float64x2_t a) {
+ //CHECK: test_vcvt_f32_f64
+ return vcvt_f32_f64(a);
+ // CHECK: fcvtn v{{[0-9]+}}.2s, v{{[0-9]+}}.2d
+}
+
+float32x4_t test_vcvt_high_f32_f64(float32x2_t a, float64x2_t b) {
+ //CHECK: test_vcvt_high_f32_f64
+ return vcvt_high_f32_f64(a, b);
+ // CHECK: fcvtn2 v{{[0-9]+}}.4s, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vcvtx_f32_f64(float64x2_t a) {
+ //CHECK: test_vcvtx_f32_f64
+ return vcvtx_f32_f64(a);
+ // CHECK: fcvtxn v{{[0-9]+}}.2s, v{{[0-9]+}}.2d
+}
+
+float32x4_t test_vcvtx_high_f32_f64(float32x2_t a, float64x2_t b) {
+ //CHECK: test_vcvtx_high_f32_f64
+ return vcvtx_high_f32_f64(a, b);
+ // CHECK: fcvtxn2 v{{[0-9]+}}.4s, v{{[0-9]+}}.2d
+}
+
+float32x4_t test_vcvt_f32_f16(float16x4_t a) {
+ //CHECK: test_vcvt_f32_f16
+ return vcvt_f32_f16(a);
+ // CHECK: fcvtl v{{[0-9]+}}.4s, v{{[0-9]+}}.4h
+}
+
+float32x4_t test_vcvt_high_f32_f16(float16x8_t a) {
+ //CHECK: test_vcvt_high_f32_f16
+ return vcvt_high_f32_f16(a);
+ // CHECK: fcvtl2 v{{[0-9]+}}.4s, v{{[0-9]+}}.8h
+}
+
+float64x2_t test_vcvt_f64_f32(float32x2_t a) {
+ //CHECK: test_vcvt_f64_f32
+ return vcvt_f64_f32(a);
+ // CHECK: fcvtl v{{[0-9]+}}.2d, v{{[0-9]+}}.2s
+}
+
+float64x2_t test_vcvt_high_f64_f32(float32x4_t a) {
+ //CHECK: test_vcvt_high_f64_f32
+ return vcvt_high_f64_f32(a);
+ // CHECK: fcvtl2 v{{[0-9]+}}.2d, v{{[0-9]+}}.4s
+}
+
+float32x2_t test_vrndn_f32(float32x2_t a) {
+ //CHECK: test_vrndn_f32
+ return vrndn_f32(a);
+ // CHECK: frintn v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vrndnq_f32(float32x4_t a) {
+ //CHECK: test_vrndnq_f32
+ return vrndnq_f32(a);
+ // CHECK: frintn v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vrndnq_f64(float64x2_t a) {
+ //CHECK: test_vrndnq_f64
+ return vrndnq_f64(a);
+ // CHECK: frintn v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vrnda_f32(float32x2_t a) {
+ //CHECK: test_vrnda_f32
+ return vrnda_f32(a);
+ // CHECK: frinta v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vrndaq_f32(float32x4_t a) {
+ //CHECK: test_vrndaq_f32
+ return vrndaq_f32(a);
+ // CHECK: frinta v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vrndaq_f64(float64x2_t a) {
+ //CHECK: test_vrndaq_f64
+ return vrndaq_f64(a);
+ // CHECK: frinta v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vrndp_f32(float32x2_t a) {
+ //CHECK: test_vrndp_f32
+ return vrndp_f32(a);
+ // CHECK: frintp v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vrndpq_f32(float32x4_t a) {
+ //CHECK: test_vrndpq_f32
+ return vrndpq_f32(a);
+ // CHECK: frintp v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vrndpq_f64(float64x2_t a) {
+ //CHECK: test_vrndpq_f64
+ return vrndpq_f64(a);
+ // CHECK: frintp v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vrndm_f32(float32x2_t a) {
+ //CHECK: test_vrndm_f32
+ return vrndm_f32(a);
+ // CHECK: frintm v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vrndmq_f32(float32x4_t a) {
+ //CHECK: test_vrndmq_f32
+ return vrndmq_f32(a);
+ // CHECK: frintm v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vrndmq_f64(float64x2_t a) {
+ //CHECK: test_vrndmq_f64
+ return vrndmq_f64(a);
+ // CHECK: frintm v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vrndx_f32(float32x2_t a) {
+ //CHECK: test_vrndx_f32
+ return vrndx_f32(a);
+ // CHECK: frintx v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vrndxq_f32(float32x4_t a) {
+ //CHECK: test_vrndxq_f32
+ return vrndxq_f32(a);
+ // CHECK: frintx v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vrndxq_f64(float64x2_t a) {
+ //CHECK: test_vrndxq_f64
+ return vrndxq_f64(a);
+ // CHECK: frintx v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vrnd_f32(float32x2_t a) {
+ //CHECK: test_vrnd_f32
+ return vrnd_f32(a);
+ // CHECK: frintz v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vrndq_f32(float32x4_t a) {
+ //CHECK: test_vrndq_f32
+ return vrndq_f32(a);
+ // CHECK: frintz v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vrndq_f64(float64x2_t a) {
+ //CHECK: test_vrndq_f64
+ return vrndq_f64(a);
+ // CHECK: frintz v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vrndi_f32(float32x2_t a) {
+ //CHECK: test_vrndi_f32
+ return vrndi_f32(a);
+ // CHECK: frinti v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vrndiq_f32(float32x4_t a) {
+ //CHECK: test_vrndiq_f32
+ return vrndiq_f32(a);
+ // CHECK: frinti v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vrndiq_f64(float64x2_t a) {
+ //CHECK: test_vrndiq_f64
+ return vrndiq_f64(a);
+ // CHECK: frinti v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+int32x2_t test_vcvt_s32_f32(float32x2_t a) {
+ //CHECK: test_vcvt_s32_f32
+ return vcvt_s32_f32(a);
+ // CHECK: fcvtzs v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vcvtq_s32_f32(float32x4_t a) {
+ //CHECK: test_vcvtq_s32_f32
+ return vcvtq_s32_f32(a);
+ // CHECK: fcvtzs v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int64x2_t test_vcvtq_s64_f64(float64x2_t a) {
+ //CHECK: test_vcvtq_s64_f64
+ return vcvtq_s64_f64(a);
+ // CHECK: fcvtzs v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+uint32x2_t test_vcvt_u32_f32(float32x2_t a) {
+ //CHECK: test_vcvt_u32_f32
+ return vcvt_u32_f32(a);
+ // CHECK: fcvtzu v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+uint32x4_t test_vcvtq_u32_f32(float32x4_t a) {
+ //CHECK: test_vcvtq_u32_f32
+ return vcvtq_u32_f32(a);
+ // CHECK: fcvtzu v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+uint64x2_t test_vcvtq_u64_f64(float64x2_t a) {
+ //CHECK: test_vcvtq_u64_f64
+ return vcvtq_u64_f64(a);
+ // CHECK: fcvtzu v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+int32x2_t test_vcvtn_s32_f32(float32x2_t a) {
+ //CHECK: test_vcvtn_s32_f32
+ return vcvtn_s32_f32(a);
+ // CHECK: fcvtns v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vcvtnq_s32_f32(float32x4_t a) {
+ //CHECK: test_vcvtnq_s32_f32
+ return vcvtnq_s32_f32(a);
+ // CHECK: fcvtns v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int64x2_t test_vcvtnq_s64_f64(float64x2_t a) {
+ //CHECK: test_vcvtnq_s64_f64
+ return vcvtnq_s64_f64(a);
+ // CHECK: fcvtns v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+uint32x2_t test_vcvtn_u32_f32(float32x2_t a) {
+ //CHECK: test_vcvtn_u32_f32
+ return vcvtn_u32_f32(a);
+ // CHECK: fcvtnu v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+uint32x4_t test_vcvtnq_u32_f32(float32x4_t a) {
+ //CHECK: test_vcvtnq_u32_f32
+ return vcvtnq_u32_f32(a);
+ // CHECK: fcvtnu v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+uint64x2_t test_vcvtnq_u64_f64(float64x2_t a) {
+ //CHECK: test_vcvtnq_u64_f64
+ return vcvtnq_u64_f64(a);
+ // CHECK: fcvtnu v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+int32x2_t test_vcvtp_s32_f32(float32x2_t a) {
+ //CHECK: test_vcvtp_s32_f32
+ return vcvtp_s32_f32(a);
+ // CHECK: fcvtps v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vcvtpq_s32_f32(float32x4_t a) {
+ //CHECK: test_vcvtpq_s32_f32
+ return vcvtpq_s32_f32(a);
+ // CHECK: fcvtps v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int64x2_t test_vcvtpq_s64_f64(float64x2_t a) {
+ //CHECK: test_vcvtpq_s64_f64
+ return vcvtpq_s64_f64(a);
+ // CHECK: fcvtps v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+uint32x2_t test_vcvtp_u32_f32(float32x2_t a) {
+ //CHECK: test_vcvtp_u32_f32
+ return vcvtp_u32_f32(a);
+ // CHECK: fcvtpu v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+uint32x4_t test_vcvtpq_u32_f32(float32x4_t a) {
+ //CHECK: test_vcvtpq_u32_f32
+ return vcvtpq_u32_f32(a);
+ // CHECK: fcvtpu v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+uint64x2_t test_vcvtpq_u64_f64(float64x2_t a) {
+ //CHECK: test_vcvtpq_u64_f64
+ return vcvtpq_u64_f64(a);
+ // CHECK: fcvtpu v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+int32x2_t test_vcvtm_s32_f32(float32x2_t a) {
+ //CHECK: test_vcvtm_s32_f32
+ return vcvtm_s32_f32(a);
+ // CHECK: fcvtms v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vcvtmq_s32_f32(float32x4_t a) {
+ //CHECK: test_vcvtmq_s32_f32
+ return vcvtmq_s32_f32(a);
+ // CHECK: fcvtms v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int64x2_t test_vcvtmq_s64_f64(float64x2_t a) {
+ //CHECK: test_vcvtmq_s64_f64
+ return vcvtmq_s64_f64(a);
+ // CHECK: fcvtms v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+uint32x2_t test_vcvtm_u32_f32(float32x2_t a) {
+ //CHECK: test_vcvtm_u32_f32
+ return vcvtm_u32_f32(a);
+ // CHECK: fcvtmu v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+uint32x4_t test_vcvtmq_u32_f32(float32x4_t a) {
+ //CHECK: test_vcvtmq_u32_f32
+ return vcvtmq_u32_f32(a);
+ // CHECK: fcvtmu v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+uint64x2_t test_vcvtmq_u64_f64(float64x2_t a) {
+ //CHECK: test_vcvtmq_u64_f64
+ return vcvtmq_u64_f64(a);
+ // CHECK: fcvtmu v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+int32x2_t test_vcvta_s32_f32(float32x2_t a) {
+ //CHECK: test_vcvta_s32_f32
+ return vcvta_s32_f32(a);
+ // CHECK: fcvtas v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+int32x4_t test_vcvtaq_s32_f32(float32x4_t a) {
+ //CHECK: test_vcvtaq_s32_f32
+ return vcvtaq_s32_f32(a);
+ // CHECK: fcvtas v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+int64x2_t test_vcvtaq_s64_f64(float64x2_t a) {
+ //CHECK: test_vcvtaq_s64_f64
+ return vcvtaq_s64_f64(a);
+ // CHECK: fcvtas v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+uint32x2_t test_vcvta_u32_f32(float32x2_t a) {
+ //CHECK: test_vcvta_u32_f32
+ return vcvta_u32_f32(a);
+ // CHECK: fcvtau v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+uint32x4_t test_vcvtaq_u32_f32(float32x4_t a) {
+ //CHECK: test_vcvtaq_u32_f32
+ return vcvtaq_u32_f32(a);
+ // CHECK: fcvtau v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+uint64x2_t test_vcvtaq_u64_f64(float64x2_t a) {
+ //CHECK: test_vcvtaq_u64_f64
+ return vcvtaq_u64_f64(a);
+ // CHECK: fcvtau v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vrsqrte_f32(float32x2_t a) {
+ //CHECK: test_vrsqrte_f32
+ return vrsqrte_f32(a);
+ // CHECK: frsqrte v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vrsqrteq_f32(float32x4_t a) {
+ //CHECK: test_vrsqrteq_f32
+ return vrsqrteq_f32(a);
+ // CHECK: frsqrte v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vrsqrteq_f64(float64x2_t a) {
+ //CHECK: test_vrsqrteq_f64
+ return vrsqrteq_f64(a);
+ // CHECK: frsqrte v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vrecpe_f32(float32x2_t a) {
+ //CHECK: test_vrecpe_f32
+ return vrecpe_f32(a);
+ // CHECK: frecpe v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vrecpeq_f32(float32x4_t a) {
+ //CHECK: test_vrecpeq_f32
+ return vrecpeq_f32(a);
+ // CHECK: frecpe v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vrecpeq_f64(float64x2_t a) {
+ //CHECK: test_vrecpeq_f64
+ return vrecpeq_f64(a);
+ // CHECK: frecpe v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+uint32x2_t test_vrecpe_u32(uint32x2_t a) {
+ //CHECK: test_vrecpe_u32
+ return vrecpe_u32(a);
+ // CHECK: urecpe v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+uint32x4_t test_vrecpeq_u32(uint32x4_t a) {
+ //CHECK: test_vrecpeq_u32
+ return vrecpeq_u32(a);
+ // CHECK: urecpe v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float32x2_t test_vsqrt_f32(float32x2_t a) {
+ //CHECK: test_vsqrt_f32
+ return vsqrt_f32(a);
+ // CHECK: fsqrt v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vsqrtq_f32(float32x4_t a) {
+ //CHECK: test_vsqrtq_f32
+ return vsqrtq_f32(a);
+ // CHECK: fsqrt v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vsqrtq_f64(float64x2_t a) {
+ //CHECK: test_vsqrtq_f64
+ return vsqrtq_f64(a);
+ // CHECK: fsqrt v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float32x2_t test_vcvt_f32_s32(int32x2_t a) {
+ //CHECK: test_vcvt_f32_s32
+ return vcvt_f32_s32(a);
+ //CHECK: scvtf v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x2_t test_vcvt_f32_u32(uint32x2_t a) {
+ //CHECK: test_vcvt_f32_u32
+ return vcvt_f32_u32(a);
+ //CHECK: ucvtf v{{[0-9]+}}.2s, v{{[0-9]+}}.2s
+}
+
+float32x4_t test_vcvtq_f32_s32(int32x4_t a) {
+ //CHECK: test_vcvtq_f32_s32
+ return vcvtq_f32_s32(a);
+ //CHECK: scvtf v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float32x4_t test_vcvtq_f32_u32(uint32x4_t a) {
+ //CHECK: test_vcvtq_f32_u32
+ return vcvtq_f32_u32(a);
+ //CHECK: ucvtf v{{[0-9]+}}.4s, v{{[0-9]+}}.4s
+}
+
+float64x2_t test_vcvtq_f64_s64(int64x2_t a) {
+ //CHECK: test_vcvtq_f64_s64
+ return vcvtq_f64_s64(a);
+ //CHECK: scvtf v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
+
+float64x2_t test_vcvtq_f64_u64(uint64x2_t a) {
+ //CHECK: test_vcvtq_f64_u64
+ return vcvtq_f64_u64(a);
+ //CHECK: ucvtf v{{[0-9]+}}.2d, v{{[0-9]+}}.2d
+}
diff --git a/test/CodeGen/aarch64-neon-perm.c b/test/CodeGen/aarch64-neon-perm.c
new file mode 100644
index 000000000000..903570b9954a
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-perm.c
@@ -0,0 +1,1093 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+int8x8_t test_vuzp1_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vuzp1_s8
+ return vuzp1_s8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x16_t test_vuzp1q_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vuzp1q_s8
+ return vuzp1q_s8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x4_t test_vuzp1_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vuzp1_s16
+ return vuzp1_s16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int16x8_t test_vuzp1q_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vuzp1q_s16
+ return vuzp1q_s16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x2_t test_vuzp1_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vuzp1_s32
+ return vuzp1_s32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vuzp1q_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vuzp1q_s32
+ return vuzp1q_s32(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vuzp1q_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vuzp1q_s64
+ return vuzp1q_s64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+uint8x8_t test_vuzp1_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vuzp1_u8
+ return vuzp1_u8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint8x16_t test_vuzp1q_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vuzp1q_u8
+ return vuzp1q_u8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x4_t test_vuzp1_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vuzp1_u16
+ return vuzp1_u16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint16x8_t test_vuzp1q_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vuzp1q_u16
+ return vuzp1q_u16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x2_t test_vuzp1_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vuzp1_u32
+ return vuzp1_u32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vuzp1q_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vuzp1q_u32
+ return vuzp1q_u32(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vuzp1q_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vuzp1q_u64
+ return vuzp1q_u64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+float32x2_t test_vuzp1_f32(float32x2_t a, float32x2_t b) {
+ // CHECK: test_vuzp1_f32
+ return vuzp1_f32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vuzp1q_f32(float32x4_t a, float32x4_t b) {
+ // CHECK: test_vuzp1q_f32
+ return vuzp1q_f32(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vuzp1q_f64(float64x2_t a, float64x2_t b) {
+ // CHECK: test_vuzp1q_f64
+ return vuzp1q_f64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+poly8x8_t test_vuzp1_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vuzp1_p8
+ return vuzp1_p8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly8x16_t test_vuzp1q_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vuzp1q_p8
+ return vuzp1q_p8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+poly16x4_t test_vuzp1_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vuzp1_p16
+ return vuzp1_p16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+poly16x8_t test_vuzp1q_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vuzp1q_p16
+ return vuzp1q_p16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int8x8_t test_vuzp2_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vuzp2_s8
+ return vuzp2_s8(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x16_t test_vuzp2q_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vuzp2q_s8
+ return vuzp2q_s8(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x4_t test_vuzp2_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vuzp2_s16
+ return vuzp2_s16(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int16x8_t test_vuzp2q_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vuzp2q_s16
+ return vuzp2q_s16(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x2_t test_vuzp2_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vuzp2_s32
+ return vuzp2_s32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vuzp2q_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vuzp2q_s32
+ return vuzp2q_s32(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vuzp2q_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vuzp2q_s64
+ return vuzp2q_s64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+uint8x8_t test_vuzp2_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vuzp2_u8
+ return vuzp2_u8(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint8x16_t test_vuzp2q_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vuzp2q_u8
+ return vuzp2q_u8(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x4_t test_vuzp2_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vuzp2_u16
+ return vuzp2_u16(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint16x8_t test_vuzp2q_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vuzp2q_u16
+ return vuzp2q_u16(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x2_t test_vuzp2_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vuzp2_u32
+ return vuzp2_u32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+uint32x4_t test_vuzp2q_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vuzp2q_u32
+ return vuzp2q_u32(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vuzp2q_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vuzp2q_u64
+ return vuzp2q_u64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+float32x2_t test_vuzp2_f32(float32x2_t a, float32x2_t b) {
+ // CHECK: test_vuzp2_f32
+ return vuzp2_f32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+float32x4_t test_vuzp2q_f32(float32x4_t a, float32x4_t b) {
+ // CHECK: test_vuzp2q_f32
+ return vuzp2q_f32(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vuzp2q_f64(float64x2_t a, float64x2_t b) {
+ // CHECK: test_vuzp2q_f64
+ return vuzp2q_f64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+poly8x8_t test_vuzp2_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vuzp2_p8
+ return vuzp2_p8(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly8x16_t test_vuzp2q_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vuzp2q_p8
+ return vuzp2q_p8(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+poly16x4_t test_vuzp2_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vuzp2_p16
+ return vuzp2_p16(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+poly16x8_t test_vuzp2q_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vuzp2q_p16
+ return vuzp2q_p16(a, b);
+ // CHECK: uzp2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int8x8_t test_vzip1_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vzip1_s8
+ return vzip1_s8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x16_t test_vzip1q_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vzip1q_s8
+ return vzip1q_s8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x4_t test_vzip1_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vzip1_s16
+ return vzip1_s16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int16x8_t test_vzip1q_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vzip1q_s16
+ return vzip1q_s16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x2_t test_vzip1_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vzip1_s32
+ return vzip1_s32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vzip1q_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vzip1q_s32
+ return vzip1q_s32(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vzip1q_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vzip1q_s64
+ return vzip1q_s64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+uint8x8_t test_vzip1_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vzip1_u8
+ return vzip1_u8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint8x16_t test_vzip1q_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vzip1q_u8
+ return vzip1q_u8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x4_t test_vzip1_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vzip1_u16
+ return vzip1_u16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint16x8_t test_vzip1q_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vzip1q_u16
+ return vzip1q_u16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x2_t test_vzip1_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vzip1_u32
+ return vzip1_u32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vzip1q_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vzip1q_u32
+ return vzip1q_u32(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vzip1q_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vzip1q_u64
+ return vzip1q_u64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+float32x2_t test_vzip1_f32(float32x2_t a, float32x2_t b) {
+ // CHECK: test_vzip1_f32
+ return vzip1_f32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vzip1q_f32(float32x4_t a, float32x4_t b) {
+ // CHECK: test_vzip1q_f32
+ return vzip1q_f32(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vzip1q_f64(float64x2_t a, float64x2_t b) {
+ // CHECK: test_vzip1q_f64
+ return vzip1q_f64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+poly8x8_t test_vzip1_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vzip1_p8
+ return vzip1_p8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly8x16_t test_vzip1q_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vzip1q_p8
+ return vzip1q_p8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+poly16x4_t test_vzip1_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vzip1_p16
+ return vzip1_p16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+poly16x8_t test_vzip1q_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vzip1q_p16
+ return vzip1q_p16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int8x8_t test_vzip2_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vzip2_s8
+ return vzip2_s8(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x16_t test_vzip2q_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vzip2q_s8
+ return vzip2q_s8(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x4_t test_vzip2_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vzip2_s16
+ return vzip2_s16(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int16x8_t test_vzip2q_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vzip2q_s16
+ return vzip2q_s16(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x2_t test_vzip2_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vzip2_s32
+ return vzip2_s32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vzip2q_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vzip2q_s32
+ return vzip2q_s32(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vzip2q_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vzip2q_s64
+ return vzip2q_s64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+uint8x8_t test_vzip2_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vzip2_u8
+ return vzip2_u8(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint8x16_t test_vzip2q_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vzip2q_u8
+ return vzip2q_u8(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x4_t test_vzip2_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vzip2_u16
+ return vzip2_u16(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint16x8_t test_vzip2q_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vzip2q_u16
+ return vzip2q_u16(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x2_t test_vzip2_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vzip2_u32
+ return vzip2_u32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+uint32x4_t test_vzip2q_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vzip2q_u32
+ return vzip2q_u32(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vzip2q_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vzip2q_u64
+ return vzip2q_u64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+float32x2_t test_vzip2_f32(float32x2_t a, float32x2_t b) {
+ // CHECK: test_vzip2_f32
+ return vzip2_f32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+float32x4_t test_vzip2q_f32(float32x4_t a, float32x4_t b) {
+ // CHECK: test_vzip2q_f32
+ return vzip2q_f32(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vzip2q_f64(float64x2_t a, float64x2_t b) {
+ // CHECK: test_vzip2q_f64
+ return vzip2q_f64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+poly8x8_t test_vzip2_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vzip2_p8
+ return vzip2_p8(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly8x16_t test_vzip2q_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vzip2q_p8
+ return vzip2q_p8(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+poly16x4_t test_vzip2_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vzip2_p16
+ return vzip2_p16(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+poly16x8_t test_vzip2q_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vzip2q_p16
+ return vzip2q_p16(a, b);
+ // CHECK: zip2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int8x8_t test_vtrn1_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vtrn1_s8
+ return vtrn1_s8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x16_t test_vtrn1q_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vtrn1q_s8
+ return vtrn1q_s8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x4_t test_vtrn1_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vtrn1_s16
+ return vtrn1_s16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int16x8_t test_vtrn1q_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vtrn1q_s16
+ return vtrn1q_s16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x2_t test_vtrn1_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vtrn1_s32
+ return vtrn1_s32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+int32x4_t test_vtrn1q_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vtrn1q_s32
+ return vtrn1q_s32(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vtrn1q_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vtrn1q_s64
+ return vtrn1q_s64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+uint8x8_t test_vtrn1_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vtrn1_u8
+ return vtrn1_u8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint8x16_t test_vtrn1q_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vtrn1q_u8
+ return vtrn1q_u8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x4_t test_vtrn1_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vtrn1_u16
+ return vtrn1_u16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint16x8_t test_vtrn1q_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vtrn1q_u16
+ return vtrn1q_u16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x2_t test_vtrn1_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vtrn1_u32
+ return vtrn1_u32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+uint32x4_t test_vtrn1q_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vtrn1q_u32
+ return vtrn1q_u32(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vtrn1q_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vtrn1q_u64
+ return vtrn1q_u64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+float32x2_t test_vtrn1_f32(float32x2_t a, float32x2_t b) {
+ // CHECK: test_vtrn1_f32
+ return vtrn1_f32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+}
+
+float32x4_t test_vtrn1q_f32(float32x4_t a, float32x4_t b) {
+ // CHECK: test_vtrn1q_f32
+ return vtrn1q_f32(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vtrn1q_f64(float64x2_t a, float64x2_t b) {
+ // CHECK: test_vtrn1q_f64
+ return vtrn1q_f64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+poly8x8_t test_vtrn1_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vtrn1_p8
+ return vtrn1_p8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly8x16_t test_vtrn1q_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vtrn1q_p8
+ return vtrn1q_p8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+poly16x4_t test_vtrn1_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vtrn1_p16
+ return vtrn1_p16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+poly16x8_t test_vtrn1q_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vtrn1q_p16
+ return vtrn1q_p16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int8x8_t test_vtrn2_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vtrn2_s8
+ return vtrn2_s8(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x16_t test_vtrn2q_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vtrn2q_s8
+ return vtrn2q_s8(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+int16x4_t test_vtrn2_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vtrn2_s16
+ return vtrn2_s16(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+int16x8_t test_vtrn2q_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vtrn2q_s16
+ return vtrn2q_s16(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int32x2_t test_vtrn2_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vtrn2_s32
+ return vtrn2_s32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+int32x4_t test_vtrn2q_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vtrn2q_s32
+ return vtrn2q_s32(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+int64x2_t test_vtrn2q_s64(int64x2_t a, int64x2_t b) {
+ // CHECK: test_vtrn2q_s64
+ return vtrn2q_s64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+uint8x8_t test_vtrn2_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vtrn2_u8
+ return vtrn2_u8(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint8x16_t test_vtrn2q_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vtrn2q_u8
+ return vtrn2q_u8(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+uint16x4_t test_vtrn2_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vtrn2_u16
+ return vtrn2_u16(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+uint16x8_t test_vtrn2q_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vtrn2q_u16
+ return vtrn2q_u16(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+uint32x2_t test_vtrn2_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vtrn2_u32
+ return vtrn2_u32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+uint32x4_t test_vtrn2q_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vtrn2q_u32
+ return vtrn2q_u32(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+uint64x2_t test_vtrn2q_u64(uint64x2_t a, uint64x2_t b) {
+ // CHECK: test_vtrn2q_u64
+ return vtrn2q_u64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+float32x2_t test_vtrn2_f32(float32x2_t a, float32x2_t b) {
+ // CHECK: test_vtrn2_f32
+ return vtrn2_f32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+
+float32x4_t test_vtrn2q_f32(float32x4_t a, float32x4_t b) {
+ // CHECK: test_vtrn2q_f32
+ return vtrn2q_f32(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+
+float64x2_t test_vtrn2q_f64(float64x2_t a, float64x2_t b) {
+ // CHECK: test_vtrn2q_f64
+ return vtrn2q_f64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+poly8x8_t test_vtrn2_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vtrn2_p8
+ return vtrn2_p8(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly8x16_t test_vtrn2q_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vtrn2q_p8
+ return vtrn2q_p8(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+poly16x4_t test_vtrn2_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vtrn2_p16
+ return vtrn2_p16(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+
+poly16x8_t test_vtrn2q_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vtrn2q_p16
+ return vtrn2q_p16(a, b);
+ // CHECK: trn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int8x8x2_t test_vuzp_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vuzp_s8
+ return vuzp_s8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: uzp2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4x2_t test_vuzp_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vuzp_s16
+ return vuzp_s16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+ // CHECK: uzp2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+int32x2x2_t test_vuzp_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vuzp_s32
+ return vuzp_s32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+uint8x8x2_t test_vuzp_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vuzp_u8
+ return vuzp_u8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: uzp2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+uint16x4x2_t test_vuzp_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vuzp_u16
+ return vuzp_u16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+ // CHECK: uzp2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+uint32x2x2_t test_vuzp_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vuzp_u32
+ return vuzp_u32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+float32x2x2_t test_vuzp_f32(float32x2_t a, float32x2_t b) {
+ // CHECK: test_vuzp_f32
+ return vuzp_f32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+poly8x8x2_t test_vuzp_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vuzp_p8
+ return vuzp_p8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: uzp2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+poly16x4x2_t test_vuzp_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vuzp_p16
+ return vuzp_p16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+ // CHECK: uzp2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+int8x16x2_t test_vuzpq_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vuzpq_s8
+ return vuzpq_s8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+ // CHECK: uzp2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+int16x8x2_t test_vuzpq_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vuzpq_s16
+ return vuzpq_s16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+ // CHECK: uzp2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+int32x4x2_t test_vuzpq_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vuzpq_s32
+ return vuzpq_s32(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+ // CHECK: uzp2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+uint8x16x2_t test_vuzpq_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vuzpq_u8
+ return vuzpq_u8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+ // CHECK: uzp2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+uint16x8x2_t test_vuzpq_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vuzpq_u16
+ return vuzpq_u16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+ // CHECK: uzp2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+uint32x4x2_t test_vuzpq_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vuzpq_u32
+ return vuzpq_u32(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+ // CHECK: uzp2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+float32x4x2_t test_vuzpq_f32(float32x4_t a, float32x4_t b) {
+ // CHECK: test_vuzpq_f32
+ return vuzpq_f32(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+ // CHECK: uzp2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+poly8x16x2_t test_vuzpq_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vuzpq_p8
+ return vuzpq_p8(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+ // CHECK: uzp2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+poly16x8x2_t test_vuzpq_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vuzpq_p16
+ return vuzpq_p16(a, b);
+ // CHECK: uzp1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+ // CHECK: uzp2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int8x8x2_t test_vzip_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vzip_s8
+ return vzip_s8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: zip2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4x2_t test_vzip_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vzip_s16
+ return vzip_s16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+ // CHECK: zip2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+int32x2x2_t test_vzip_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vzip_s32
+ return vzip_s32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+uint8x8x2_t test_vzip_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vzip_u8
+ return vzip_u8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: zip2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+uint16x4x2_t test_vzip_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vzip_u16
+ return vzip_u16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+ // CHECK: zip2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+uint32x2x2_t test_vzip_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vzip_u32
+ return vzip_u32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+float32x2x2_t test_vzip_f32(float32x2_t a, float32x2_t b) {
+ // CHECK: test_vzip_f32
+ return vzip_f32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+poly8x8x2_t test_vzip_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vzip_p8
+ return vzip_p8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: zip2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+poly16x4x2_t test_vzip_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vzip_p16
+ return vzip_p16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+ // CHECK: zip2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+int8x16x2_t test_vzipq_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vzipq_s8
+ return vzipq_s8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+ // CHECK: zip2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+int16x8x2_t test_vzipq_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vzipq_s16
+ return vzipq_s16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+ // CHECK: zip2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+int32x4x2_t test_vzipq_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vzipq_s32
+ return vzipq_s32(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+ // CHECK: zip2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+uint8x16x2_t test_vzipq_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vzipq_u8
+ return vzipq_u8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+ // CHECK: zip2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+uint16x8x2_t test_vzipq_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vzipq_u16
+ return vzipq_u16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+ // CHECK: zip2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+uint32x4x2_t test_vzipq_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vzipq_u32
+ return vzipq_u32(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+ // CHECK: zip2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+float32x4x2_t test_vzipq_f32(float32x4_t a, float32x4_t b) {
+ // CHECK: test_vzipq_f32
+ return vzipq_f32(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+ // CHECK: zip2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+poly8x16x2_t test_vzipq_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vzipq_p8
+ return vzipq_p8(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+ // CHECK: zip2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+poly16x8x2_t test_vzipq_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vzipq_p16
+ return vzipq_p16(a, b);
+ // CHECK: zip1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+ // CHECK: zip2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+
+int8x8x2_t test_vtrn_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vtrn_s8
+ return vtrn_s8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: trn2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int16x4x2_t test_vtrn_s16(int16x4_t a, int16x4_t b) {
+ // CHECK: test_vtrn_s16
+ return vtrn_s16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+ // CHECK: trn2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+int32x2x2_t test_vtrn_s32(int32x2_t a, int32x2_t b) {
+ // CHECK: test_vtrn_s32
+ return vtrn_s32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+uint8x8x2_t test_vtrn_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vtrn_u8
+ return vtrn_u8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: trn2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+uint16x4x2_t test_vtrn_u16(uint16x4_t a, uint16x4_t b) {
+ // CHECK: test_vtrn_u16
+ return vtrn_u16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+ // CHECK: trn2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+uint32x2x2_t test_vtrn_u32(uint32x2_t a, uint32x2_t b) {
+ // CHECK: test_vtrn_u32
+ return vtrn_u32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+float32x2x2_t test_vtrn_f32(float32x2_t a, float32x2_t b) {
+ // CHECK: test_vtrn_f32
+ return vtrn_f32(a, b);
+ // CHECK: ins {{v[0-9]+}}.s[1], {{v[0-9]+}}.s[0]
+ // CHECK: ins {{v[0-9]+}}.s[0], {{v[0-9]+}}.s[1]
+}
+poly8x8x2_t test_vtrn_p8(poly8x8_t a, poly8x8_t b) {
+ // CHECK: test_vtrn_p8
+ return vtrn_p8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: trn2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+poly16x4x2_t test_vtrn_p16(poly16x4_t a, poly16x4_t b) {
+ // CHECK: test_vtrn_p16
+ return vtrn_p16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+ // CHECK: trn2 {{v[0-9]+}}.4h, {{v[0-9]+}}.4h
+}
+int8x16x2_t test_vtrnq_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vtrnq_s8
+ return vtrnq_s8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+ // CHECK: trn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+int16x8x2_t test_vtrnq_s16(int16x8_t a, int16x8_t b) {
+ // CHECK: test_vtrnq_s16
+ return vtrnq_s16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+ // CHECK: trn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+int32x4x2_t test_vtrnq_s32(int32x4_t a, int32x4_t b) {
+ // CHECK: test_vtrnq_s32
+ return vtrnq_s32(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+ // CHECK: trn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+uint8x16x2_t test_vtrnq_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vtrnq_u8
+ return vtrnq_u8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+ // CHECK: trn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+uint16x8x2_t test_vtrnq_u16(uint16x8_t a, uint16x8_t b) {
+ // CHECK: test_vtrnq_u16
+ return vtrnq_u16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+ // CHECK: trn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
+uint32x4x2_t test_vtrnq_u32(uint32x4_t a, uint32x4_t b) {
+ // CHECK: test_vtrnq_u32
+ return vtrnq_u32(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+ // CHECK: trn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+float32x4x2_t test_vtrnq_f32(float32x4_t a, float32x4_t b) {
+ // CHECK: test_vtrnq_f32
+ return vtrnq_f32(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+ // CHECK: trn2 {{v[0-9]+}}.4s, {{v[0-9]+}}.4s
+}
+poly8x16x2_t test_vtrnq_p8(poly8x16_t a, poly8x16_t b) {
+ // CHECK: test_vtrnq_p8
+ return vtrnq_p8(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+ // CHECK: trn2 {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+poly16x8x2_t test_vtrnq_p16(poly16x8_t a, poly16x8_t b) {
+ // CHECK: test_vtrnq_p16
+ return vtrnq_p16(a, b);
+ // CHECK: trn1 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+ // CHECK: trn2 {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
+}
diff --git a/test/CodeGen/aarch64-neon-scalar-copy.c b/test/CodeGen/aarch64-neon-scalar-copy.c
new file mode 100644
index 000000000000..33e97c792fb1
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-scalar-copy.c
@@ -0,0 +1,173 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+
+#include <arm_neon.h>
+
+// CHECK: test_vdups_lane_f32
+float32_t test_vdups_lane_f32(float32x2_t a) {
+ return vdups_lane_f32(a, 1);
+// CHECK: ret
+// CHECK-NOT: dup {{s[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+
+// CHECK: test_vdupd_lane_f64
+float64_t test_vdupd_lane_f64(float64x1_t a) {
+ return vdupd_lane_f64(a, 0);
+// CHECK: ret
+// CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+
+// CHECK: test_vdups_laneq_f32
+float32_t test_vdups_laneq_f32(float32x4_t a) {
+ return vdups_laneq_f32(a, 3);
+// CHECK: ret
+// CHECK-NOT: dup {{s[0-9]+}}, {{v[0-9]+}}.s[3]
+}
+
+
+// CHECK: test_vdupd_laneq_f64
+float64_t test_vdupd_laneq_f64(float64x2_t a) {
+ return vdupd_laneq_f64(a, 1);
+// CHECK: ret
+// CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+
+// CHECK: test_vdupb_lane_s8
+int8_t test_vdupb_lane_s8(int8x8_t a) {
+ return vdupb_lane_s8(a, 7);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[7]
+}
+
+
+// CHECK: test_vduph_lane_s16
+int16_t test_vduph_lane_s16(int16x4_t a) {
+ return vduph_lane_s16(a, 3);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+
+// CHECK: test_vdups_lane_s32
+int32_t test_vdups_lane_s32(int32x2_t a) {
+ return vdups_lane_s32(a, 1);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+
+// CHECK: test_vdupd_lane_s64
+int64_t test_vdupd_lane_s64(int64x1_t a) {
+ return vdupd_lane_s64(a, 0);
+// CHECK: fmov {{x[0-9]+}}, {{d[0-9]+}}
+}
+
+
+// CHECK: test_vdupb_lane_u8
+uint8_t test_vdupb_lane_u8(uint8x8_t a) {
+ return vdupb_lane_u8(a, 7);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[7]
+}
+
+
+// CHECK: test_vduph_lane_u16
+uint16_t test_vduph_lane_u16(uint16x4_t a) {
+ return vduph_lane_u16(a, 3);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+
+// CHECK: test_vdups_lane_u32
+uint32_t test_vdups_lane_u32(uint32x2_t a) {
+ return vdups_lane_u32(a, 1);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+
+// CHECK: test_vdupd_lane_u64
+uint64_t test_vdupd_lane_u64(uint64x1_t a) {
+ return vdupd_lane_u64(a, 0);
+// CHECK: fmov {{x[0-9]+}}, {{d[0-9]+}}
+}
+
+// CHECK: test_vdupb_laneq_s8
+int8_t test_vdupb_laneq_s8(int8x16_t a) {
+ return vdupb_laneq_s8(a, 15);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[15]
+}
+
+
+// CHECK: test_vduph_laneq_s16
+int16_t test_vduph_laneq_s16(int16x8_t a) {
+ return vduph_laneq_s16(a, 7);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[7]
+}
+
+
+// CHECK: test_vdups_laneq_s32
+int32_t test_vdups_laneq_s32(int32x4_t a) {
+ return vdups_laneq_s32(a, 3);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.s[3]
+}
+
+
+// CHECK: test_vdupd_laneq_s64
+int64_t test_vdupd_laneq_s64(int64x2_t a) {
+ return vdupd_laneq_s64(a, 1);
+// CHECK: umov {{x[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+
+// CHECK: test_vdupb_laneq_u8
+uint8_t test_vdupb_laneq_u8(uint8x16_t a) {
+ return vdupb_laneq_u8(a, 15);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[15]
+}
+
+
+// CHECK: test_vduph_laneq_u16
+uint16_t test_vduph_laneq_u16(uint16x8_t a) {
+ return vduph_laneq_u16(a, 7);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[7]
+}
+
+
+// CHECK: test_vdups_laneq_u32
+uint32_t test_vdups_laneq_u32(uint32x4_t a) {
+ return vdups_laneq_u32(a, 3);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.s[3]
+}
+
+
+// CHECK: test_vdupd_laneq_u64
+uint64_t test_vdupd_laneq_u64(uint64x2_t a) {
+ return vdupd_laneq_u64(a, 1);
+// CHECK: umov {{x[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+// CHECK: test_vdupb_lane_p8
+poly8_t test_vdupb_lane_p8(poly8x8_t a) {
+ return vdupb_lane_p8(a, 7);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[7]
+}
+
+// CHECK: test_vduph_lane_p16
+poly16_t test_vduph_lane_p16(poly16x4_t a) {
+ return vduph_lane_p16(a, 3);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+// CHECK: test_vdupb_laneq_p8
+poly8_t test_vdupb_laneq_p8(poly8x16_t a) {
+ return vdupb_laneq_p8(a, 15);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.b[15]
+}
+
+// CHECK: test_vduph_laneq_p16
+poly16_t test_vduph_laneq_p16(poly16x8_t a) {
+ return vduph_laneq_p16(a, 7);
+// CHECK: umov {{w[0-9]+}}, {{v[0-9]+}}.h[7]
+}
+
diff --git a/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c b/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c
new file mode 100644
index 000000000000..4f0771ad276e
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c
@@ -0,0 +1,255 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+
+float32_t test_vmuls_lane_f32(float32_t a, float32x2_t b) {
+ // CHECK: test_vmuls_lane_f32
+ return vmuls_lane_f32(a, b, 1);
+ // CHECK: fmul {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+float64_t test_vmuld_lane_f64(float64_t a, float64x1_t b) {
+ // CHECK: test_vmuld_lane_f64
+ return vmuld_lane_f64(a, b, 0);
+ // CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+float32_t test_vmuls_laneq_f32(float32_t a, float32x4_t b) {
+ // CHECK: test_vmuls_laneq_f32
+ return vmuls_laneq_f32(a, b, 3);
+ // CHECK: fmul {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
+}
+
+float64_t test_vmuld_laneq_f64(float64_t a, float64x2_t b) {
+ // CHECK: test_vmuld_laneq_f64
+ return vmuld_laneq_f64(a, b, 1);
+ // CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+float64x1_t test_vmul_n_f64(float64x1_t a, float64_t b) {
+ // CHECK: test_vmul_n_f64
+ return vmul_n_f64(a, b);
+ // CHECK: fmul {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+float32_t test_vmulxs_lane_f32(float32_t a, float32x2_t b) {
+// CHECK: test_vmulxs_lane_f32
+ return vmulxs_lane_f32(a, b, 1);
+// CHECK: fmulx {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+float32_t test_vmulxs_laneq_f32(float32_t a, float32x4_t b) {
+// CHECK: test_vmulxs_laneq_f32
+ return vmulxs_laneq_f32(a, b, 3);
+// CHECK: fmulx {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
+}
+
+float64_t test_vmulxd_lane_f64(float64_t a, float64x1_t b) {
+// CHECK: test_vmulxd_lane_f64
+ return vmulxd_lane_f64(a, b, 0);
+// CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+float64_t test_vmulxd_laneq_f64(float64_t a, float64x2_t b) {
+// CHECK: test_vmulxd_laneq_f64
+ return vmulxd_laneq_f64(a, b, 1);
+// CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+// CHECK: test_vmulx_lane_f64
+float64x1_t test_vmulx_lane_f64(float64x1_t a, float64x1_t b) {
+ return vmulx_lane_f64(a, b, 0);
+ // CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+
+// CHECK: test_vmulx_laneq_f64_0
+float64x1_t test_vmulx_laneq_f64_0(float64x1_t a, float64x2_t b) {
+ return vmulx_laneq_f64(a, b, 0);
+ // CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vmulx_laneq_f64_1
+float64x1_t test_vmulx_laneq_f64_1(float64x1_t a, float64x2_t b) {
+ return vmulx_laneq_f64(a, b, 1);
+ // CHECK: fmulx {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+
+// CHECK: test_vfmas_lane_f32
+float32_t test_vfmas_lane_f32(float32_t a, float32_t b, float32x2_t c) {
+ return vfmas_lane_f32(a, b, c, 1);
+ // CHECK: fmla {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+// CHECK: test_vfmad_lane_f64
+float64_t test_vfmad_lane_f64(float64_t a, float64_t b, float64x1_t c) {
+ return vfmad_lane_f64(a, b, c, 0);
+ // CHECK: fmla {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vfmad_laneq_f64
+float64_t test_vfmad_laneq_f64(float64_t a, float64_t b, float64x2_t c) {
+ return vfmad_laneq_f64(a, b, c, 1);
+ // CHECK: fmla {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+// CHECK: test_vfmss_lane_f32
+float32_t test_vfmss_lane_f32(float32_t a, float32_t b, float32x2_t c) {
+ return vfmss_lane_f32(a, b, c, 1);
+ // CHECK: fmls {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+// CHECK: test_vfma_lane_f64
+float64x1_t test_vfma_lane_f64(float64x1_t a, float64x1_t b, float64x1_t v) {
+ return vfma_lane_f64(a, b, v, 0);
+ // CHECK: fmla {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vfms_lane_f64
+float64x1_t test_vfms_lane_f64(float64x1_t a, float64x1_t b, float64x1_t v) {
+ return vfms_lane_f64(a, b, v, 0);
+ // CHECK: fmls {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vfma_laneq_f64
+float64x1_t test_vfma_laneq_f64(float64x1_t a, float64x1_t b, float64x2_t v) {
+ return vfma_laneq_f64(a, b, v, 0);
+ // CHECK: fmla {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vfms_laneq_f64
+float64x1_t test_vfms_laneq_f64(float64x1_t a, float64x1_t b, float64x2_t v) {
+ return vfms_laneq_f64(a, b, v, 0);
+ // CHECK: fmls {{d[0-9]+}}, {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vqdmullh_lane_s16
+int32_t test_vqdmullh_lane_s16(int16_t a, int16x4_t b) {
+ return vqdmullh_lane_s16(a, b, 3);
+ // CHECK: sqdmull {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+// CHECK: test_vqdmulls_lane_s32
+int64_t test_vqdmulls_lane_s32(int32_t a, int32x2_t b) {
+ return vqdmulls_lane_s32(a, b, 1);
+ // CHECK: sqdmull {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+// CHECK: test_vqdmullh_laneq_s16
+int32_t test_vqdmullh_laneq_s16(int16_t a, int16x8_t b) {
+ return vqdmullh_laneq_s16(a, b, 7);
+ // CHECK: sqdmull {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[7]
+}
+
+// CHECK: test_vqdmulls_laneq_s32
+int64_t test_vqdmulls_laneq_s32(int32_t a, int32x4_t b) {
+ return vqdmulls_laneq_s32(a, b, 3);
+ // CHECK: sqdmull {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
+}
+
+// CHECK: test_vqdmulhh_lane_s16
+int16_t test_vqdmulhh_lane_s16(int16_t a, int16x4_t b) {
+ return vqdmulhh_lane_s16(a, b, 3);
+// CHECK: sqdmulh {{h[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+// CHECK: test_vqdmulhs_lane_s32
+int32_t test_vqdmulhs_lane_s32(int32_t a, int32x2_t b) {
+ return vqdmulhs_lane_s32(a, b, 1);
+// CHECK: sqdmulh {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+
+// CHECK: test_vqdmulhh_laneq_s16
+int16_t test_vqdmulhh_laneq_s16(int16_t a, int16x8_t b) {
+ return vqdmulhh_laneq_s16(a, b, 7);
+// CHECK: sqdmulh {{h[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[7]
+}
+
+
+// CHECK: test_vqdmulhs_laneq_s32
+int32_t test_vqdmulhs_laneq_s32(int32_t a, int32x4_t b) {
+ return vqdmulhs_laneq_s32(a, b, 3);
+// CHECK: sqdmulh {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
+}
+
+// CHECK: test_vqrdmulhh_lane_s16
+int16_t test_vqrdmulhh_lane_s16(int16_t a, int16x4_t b) {
+ return vqrdmulhh_lane_s16(a, b, 3);
+// CHECK: sqrdmulh {{h[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+// CHECK: test_vqrdmulhs_lane_s32
+int32_t test_vqrdmulhs_lane_s32(int32_t a, int32x2_t b) {
+ return vqrdmulhs_lane_s32(a, b, 1);
+// CHECK: sqrdmulh {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+
+// CHECK: test_vqrdmulhh_laneq_s16
+int16_t test_vqrdmulhh_laneq_s16(int16_t a, int16x8_t b) {
+ return vqrdmulhh_laneq_s16(a, b, 7);
+// CHECK: sqrdmulh {{h[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[7]
+}
+
+
+// CHECK: test_vqrdmulhs_laneq_s32
+int32_t test_vqrdmulhs_laneq_s32(int32_t a, int32x4_t b) {
+ return vqrdmulhs_laneq_s32(a, b, 3);
+// CHECK: sqrdmulh {{s[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
+}
+
+// CHECK: test_vqdmlalh_lane_s16
+int32_t test_vqdmlalh_lane_s16(int32_t a, int16_t b, int16x4_t c) {
+ return vqdmlalh_lane_s16(a, b, c, 3);
+// CHECK: sqdmlal {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+// CHECK: test_vqdmlals_lane_s32
+int64_t test_vqdmlals_lane_s32(int64_t a, int32_t b, int32x2_t c) {
+ return vqdmlals_lane_s32(a, b, c, 1);
+// CHECK: sqdmlal {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+// CHECK: test_vqdmlalh_laneq_s16
+int32_t test_vqdmlalh_laneq_s16(int32_t a, int16_t b, int16x8_t c) {
+ return vqdmlalh_laneq_s16(a, b, c, 7);
+// CHECK: sqdmlal {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[7]
+}
+
+// CHECK: test_vqdmlals_laneq_s32
+int64_t test_vqdmlals_laneq_s32(int64_t a, int32_t b, int32x4_t c) {
+ return vqdmlals_laneq_s32(a, b, c, 3);
+// CHECK: sqdmlal {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
+}
+
+// CHECK: test_vqdmlslh_lane_s16
+int32_t test_vqdmlslh_lane_s16(int32_t a, int16_t b, int16x4_t c) {
+ return vqdmlslh_lane_s16(a, b, c, 3);
+// CHECK: sqdmlsl {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[3]
+}
+
+// CHECK: test_vqdmlsls_lane_s32
+int64_t test_vqdmlsls_lane_s32(int64_t a, int32_t b, int32x2_t c) {
+ return vqdmlsls_lane_s32(a, b, c, 1);
+// CHECK: sqdmlsl {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[1]
+}
+
+// CHECK: test_vqdmlslh_laneq_s16
+int32_t test_vqdmlslh_laneq_s16(int32_t a, int16_t b, int16x8_t c) {
+ return vqdmlslh_laneq_s16(a, b, c, 7);
+// CHECK: sqdmlsl {{s[0-9]+}}, {{h[0-9]+}}, {{v[0-9]+}}.h[7]
+}
+
+// CHECK: test_vqdmlsls_laneq_s32
+int64_t test_vqdmlsls_laneq_s32(int64_t a, int32_t b, int32x4_t c) {
+ return vqdmlsls_laneq_s32(a, b, c, 3);
+// CHECK: sqdmlsl {{d[0-9]+}}, {{s[0-9]+}}, {{v[0-9]+}}.s[3]
+}
+
diff --git a/test/CodeGen/aarch64-neon-shifts.c b/test/CodeGen/aarch64-neon-shifts.c
new file mode 100644
index 000000000000..4777f18aae7f
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-shifts.c
@@ -0,0 +1,43 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -emit-llvm -O1 -o - %s | FileCheck %s
+
+#include <arm_neon.h>
+
+uint8x8_t test_shift_vshr(uint8x8_t a) {
+ // CHECK-LABEL: test_shift_vshr
+ // CHECK: %{{.*}} = lshr <8 x i8> %a, <i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5>
+ return vshr_n_u8(a, 5);
+}
+
+int8x8_t test_shift_vshr_smax(int8x8_t a) {
+ // CHECK-LABEL: test_shift_vshr_smax
+ // CHECK: %{{.*}} = ashr <8 x i8> %a, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
+ return vshr_n_s8(a, 8);
+}
+
+uint8x8_t test_shift_vshr_umax(uint8x8_t a) {
+ // CHECK-LABEL: test_shift_vshr_umax
+ // CHECK: ret <8 x i8> zeroinitializer
+ return vshr_n_u8(a, 8);
+}
+
+uint8x8_t test_shift_vsra(uint8x8_t a, uint8x8_t b) {
+ // CHECK-LABEL: test_shift_vsra
+ // CHECK: %[[SHR:.*]] = lshr <8 x i8> %b, <i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5>
+ // CHECK: %{{.*}} = add <8 x i8> %[[SHR]], %a
+ return vsra_n_u8(a, b, 5);
+}
+
+int8x8_t test_shift_vsra_smax(int8x8_t a, int8x8_t b) {
+ // CHECK-LABEL: test_shift_vsra_smax
+ // CHECK: %[[SHR:.*]] = ashr <8 x i8> %b, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
+ // CHECK: %{{.*}} = add <8 x i8> %[[SHR]], %a
+ return vsra_n_s8(a, b, 8);
+}
+
+uint8x8_t test_shift_vsra_umax(uint8x8_t a, uint8x8_t b) {
+ // CHECK-LABEL: test_shift_vsra_umax
+ // CHECK: ret <8 x i8> %a
+ return vsra_n_u8(a, b, 8);
+}
diff --git a/test/CodeGen/aarch64-neon-tbl.c b/test/CodeGen/aarch64-neon-tbl.c
new file mode 100644
index 000000000000..db78a7aa7037
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-tbl.c
@@ -0,0 +1,463 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+int8x8_t test_vtbl1_s8(int8x8_t a, int8x8_t b) {
+ // CHECK: test_vtbl1_s8
+ return vtbl1_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vqtbl1_s8(int8x16_t a, int8x8_t b) {
+ // CHECK: test_vqtbl1_s8
+ return vqtbl1_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vtbl2_s8(int8x8x2_t a, int8x8_t b) {
+ // CHECK: test_vtbl2_s8
+ return vtbl2_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vqtbl2_s8(int8x16x2_t a, int8x8_t b) {
+ // CHECK: test_vqtbl2_s8
+ return vqtbl2_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vtbl3_s8(int8x8x3_t a, int8x8_t b) {
+ // CHECK: test_vtbl3_s8
+ return vtbl3_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vqtbl3_s8(int8x16x3_t a, int8x8_t b) {
+ // CHECK: test_vqtbl3_s8
+ return vqtbl3_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vtbl4_s8(int8x8x4_t a, int8x8_t b) {
+ // CHECK: test_vtbl4_s8
+ return vtbl4_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vqtbl4_s8(int8x16x4_t a, int8x8_t b) {
+ // CHECK: test_vqtbl4_s8
+ return vqtbl4_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x16_t test_vqtbl1q_s8(int8x16_t a, int8x16_t b) {
+ // CHECK: test_vqtbl1q_s8
+ return vqtbl1q_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+int8x16_t test_vqtbl2q_s8(int8x16x2_t a, int8x16_t b) {
+ // CHECK: test_vqtbl2q_s8
+ return vqtbl2q_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+int8x16_t test_vqtbl3q_s8(int8x16x3_t a, int8x16_t b) {
+ // CHECK: test_vqtbl3q_s8
+ return vqtbl3q_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+int8x16_t test_vqtbl4q_s8(int8x16x4_t a, int8x16_t b) {
+ // CHECK: test_vqtbl4q_s8
+ return vqtbl4q_s8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+int8x8_t test_vtbx1_s8(int8x8_t a, int8x8_t b, int8x8_t c) {
+ // CHECK: test_vtbx1_s8
+ return vtbx1_s8(a, b, c);
+ // CHECK: movi {{v[0-9]+}}.8b, #0
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+ // CHECK: cmhs {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vtbx2_s8(int8x8_t a, int8x8x2_t b, int8x8_t c) {
+ // CHECK: test_vtbx2_s8
+ return vtbx2_s8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vtbx3_s8(int8x8_t a, int8x8x3_t b, int8x8_t c) {
+ // CHECK: test_vtbx3_s8
+ return vtbx3_s8(a, b, c);
+ // CHECK: movi {{v[0-9]+}}.8b, #0
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+ // CHECK: cmhs {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vtbx4_s8(int8x8_t a, int8x8x4_t b, int8x8_t c) {
+ // CHECK: test_vtbx4_s8
+ return vtbx4_s8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vqtbx1_s8(int8x8_t a, int8x16_t b, int8x8_t c) {
+ // CHECK: test_vqtbx1_s8
+ return vqtbx1_s8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vqtbx2_s8(int8x8_t a, int8x16x2_t b, int8x8_t c) {
+ // CHECK: test_vqtbx2_s8
+ return vqtbx2_s8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vqtbx3_s8(int8x8_t a, int8x16x3_t b, int8x8_t c) {
+ // CHECK: test_vqtbx3_s8
+ return vqtbx3_s8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x8_t test_vqtbx4_s8(int8x8_t a, int8x16x4_t b, int8x8_t c) {
+ // CHECK: test_vqtbx4_s8
+ return vqtbx4_s8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+int8x16_t test_vqtbx1q_s8(int8x16_t a, int8x16_t b, int8x16_t c) {
+ // CHECK: test_vqtbx1q_s8
+ return vqtbx1q_s8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+int8x16_t test_vqtbx2q_s8(int8x16_t a, int8x16x2_t b, int8x16_t c) {
+ // CHECK: test_vqtbx2q_s8
+ return vqtbx2q_s8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+int8x16_t test_vqtbx3q_s8(int8x16_t a, int8x16x3_t b, int8x16_t c) {
+ // CHECK: test_vqtbx3q_s8
+ return vqtbx3q_s8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+int8x16_t test_vqtbx4q_s8(int8x16_t a, int8x16x4_t b, int8x16_t c) {
+ // CHECK: test_vqtbx4q_s8
+ return vqtbx4q_s8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+uint8x8_t test_vtbl1_u8(uint8x8_t a, uint8x8_t b) {
+ // CHECK: test_vtbl1_u8
+ return vtbl1_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vqtbl1_u8(uint8x16_t a, uint8x8_t b) {
+ // CHECK: test_vqtbl1_u8
+ return vqtbl1_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vtbl2_u8(uint8x8x2_t a, uint8x8_t b) {
+ // CHECK: test_vtbl2_u8
+ return vtbl2_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vqtbl2_u8(uint8x16x2_t a, uint8x8_t b) {
+ // CHECK: test_vqtbl2_u8
+ return vqtbl2_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vtbl3_u8(uint8x8x3_t a, uint8x8_t b) {
+ // CHECK: test_vtbl3_u8
+ return vtbl3_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vqtbl3_u8(uint8x16x3_t a, uint8x8_t b) {
+ // CHECK: test_vqtbl3_u8
+ return vqtbl3_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vtbl4_u8(uint8x8x4_t a, uint8x8_t b) {
+ // CHECK: test_vtbl4_u8
+ return vtbl4_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vqtbl4_u8(uint8x16x4_t a, uint8x8_t b) {
+ // CHECK: test_vqtbl4_u8
+ return vqtbl4_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x16_t test_vqtbl1q_u8(uint8x16_t a, uint8x16_t b) {
+ // CHECK: test_vqtbl1q_u8
+ return vqtbl1q_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+uint8x16_t test_vqtbl2q_u8(uint8x16x2_t a, uint8x16_t b) {
+ // CHECK: test_vqtbl2q_u8
+ return vqtbl2q_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+uint8x16_t test_vqtbl3q_u8(uint8x16x3_t a, uint8x16_t b) {
+ // CHECK: test_vqtbl3q_u8
+ return vqtbl3q_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+uint8x16_t test_vqtbl4q_u8(uint8x16x4_t a, uint8x16_t b) {
+ // CHECK: test_vqtbl4q_u8
+ return vqtbl4q_u8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+uint8x8_t test_vtbx1_u8(uint8x8_t a, uint8x8_t b, uint8x8_t c) {
+ // CHECK: test_vtbx1_u8
+ return vtbx1_u8(a, b, c);
+ // CHECK: movi {{v[0-9]+}}.8b, #0
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+ // CHECK: cmhs {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vtbx2_u8(uint8x8_t a, uint8x8x2_t b, uint8x8_t c) {
+ // CHECK: test_vtbx2_u8
+ return vtbx2_u8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vtbx3_u8(uint8x8_t a, uint8x8x3_t b, uint8x8_t c) {
+ // CHECK: test_vtbx3_u8
+ return vtbx3_u8(a, b, c);
+ // CHECK: movi {{v[0-9]+}}.8b, #0
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+ // CHECK: cmhs {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vtbx4_u8(uint8x8_t a, uint8x8x4_t b, uint8x8_t c) {
+ // CHECK: test_vtbx4_u8
+ return vtbx4_u8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vqtbx1_u8(uint8x8_t a, uint8x16_t b, uint8x8_t c) {
+ // CHECK: test_vqtbx1_u8
+ return vqtbx1_u8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vqtbx2_u8(uint8x8_t a, uint8x16x2_t b, uint8x8_t c) {
+ // CHECK: test_vqtbx2_u8
+ return vqtbx2_u8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vqtbx3_u8(uint8x8_t a, uint8x16x3_t b, uint8x8_t c) {
+ // CHECK: test_vqtbx3_u8
+ return vqtbx3_u8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x8_t test_vqtbx4_u8(uint8x8_t a, uint8x16x4_t b, uint8x8_t c) {
+ // CHECK: test_vqtbx4_u8
+ return vqtbx4_u8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+uint8x16_t test_vqtbx1q_u8(uint8x16_t a, uint8x16_t b, uint8x16_t c) {
+ // CHECK: test_vqtbx1q_u8
+ return vqtbx1q_u8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+uint8x16_t test_vqtbx2q_u8(uint8x16_t a, uint8x16x2_t b, uint8x16_t c) {
+ // CHECK: test_vqtbx2q_u8
+ return vqtbx2q_u8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+uint8x16_t test_vqtbx3q_u8(uint8x16_t a, uint8x16x3_t b, uint8x16_t c) {
+ // CHECK: test_vqtbx3q_u8
+ return vqtbx3q_u8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+uint8x16_t test_vqtbx4q_u8(uint8x16_t a, uint8x16x4_t b, uint8x16_t c) {
+ // CHECK: test_vqtbx4q_u8
+ return vqtbx4q_u8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+poly8x8_t test_vtbl1_p8(poly8x8_t a, uint8x8_t b) {
+ // CHECK: test_vtbl1_p8
+ return vtbl1_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vqtbl1_p8(poly8x16_t a, uint8x8_t b) {
+ // CHECK: test_vqtbl1_p8
+ return vqtbl1_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vtbl2_p8(poly8x8x2_t a, uint8x8_t b) {
+ // CHECK: test_vtbl2_p8
+ return vtbl2_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vqtbl2_p8(poly8x16x2_t a, uint8x8_t b) {
+ // CHECK: test_vqtbl2_p8
+ return vqtbl2_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vtbl3_p8(poly8x8x3_t a, uint8x8_t b) {
+ // CHECK: test_vtbl3_p8
+ return vtbl3_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vqtbl3_p8(poly8x16x3_t a, uint8x8_t b) {
+ // CHECK: test_vqtbl3_p8
+ return vqtbl3_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vtbl4_p8(poly8x8x4_t a, uint8x8_t b) {
+ // CHECK: test_vtbl4_p8
+ return vtbl4_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vqtbl4_p8(poly8x16x4_t a, uint8x8_t b) {
+ // CHECK: test_vqtbl4_p8
+ return vqtbl4_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x16_t test_vqtbl1q_p8(poly8x16_t a, uint8x16_t b) {
+ // CHECK: test_vqtbl1q_p8
+ return vqtbl1q_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+poly8x16_t test_vqtbl2q_p8(poly8x16x2_t a, uint8x16_t b) {
+ // CHECK: test_vqtbl2q_p8
+ return vqtbl2q_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+poly8x16_t test_vqtbl3q_p8(poly8x16x3_t a, uint8x16_t b) {
+ // CHECK: test_vqtbl3q_p8
+ return vqtbl3q_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+poly8x16_t test_vqtbl4q_p8(poly8x16x4_t a, uint8x16_t b) {
+ // CHECK: test_vqtbl4q_p8
+ return vqtbl4q_p8(a, b);
+ // CHECK: tbl {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+poly8x8_t test_vtbx1_p8(poly8x8_t a, poly8x8_t b, uint8x8_t c) {
+ // CHECK: test_vtbx1_p8
+ return vtbx1_p8(a, b, c);
+ // CHECK: movi {{v[0-9]+}}.8b, #0
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+ // CHECK: cmhs {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vtbx2_p8(poly8x8_t a, poly8x8x2_t b, uint8x8_t c) {
+ // CHECK: test_vtbx2_p8
+ return vtbx2_p8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vtbx3_p8(poly8x8_t a, poly8x8x3_t b, uint8x8_t c) {
+ // CHECK: test_vtbx3_p8
+ return vtbx3_p8(a, b, c);
+ // CHECK: movi {{v[0-9]+}}.8b, #0
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+ // CHECK: tbl {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+ // CHECK: cmhs {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vtbx4_p8(poly8x8_t a, poly8x8x4_t b, uint8x8_t c) {
+ // CHECK: test_vtbx4_p8
+ return vtbx4_p8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vqtbx1_p8(poly8x8_t a, uint8x16_t b, uint8x8_t c) {
+ // CHECK: test_vqtbx1_p8
+ return vqtbx1_p8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vqtbx2_p8(poly8x8_t a, poly8x16x2_t b, uint8x8_t c) {
+ // CHECK: test_vqtbx2_p8
+ return vqtbx2_p8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vqtbx3_p8(poly8x8_t a, poly8x16x3_t b, uint8x8_t c) {
+ // CHECK: test_vqtbx3_p8
+ return vqtbx3_p8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x8_t test_vqtbx4_p8(poly8x8_t a, poly8x16x4_t b, uint8x8_t c) {
+ // CHECK: test_vqtbx4_p8
+ return vqtbx4_p8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.8b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.8b
+}
+
+poly8x16_t test_vqtbx1q_p8(poly8x16_t a, uint8x16_t b, uint8x16_t c) {
+ // CHECK: test_vqtbx1q_p8
+ return vqtbx1q_p8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+poly8x16_t test_vqtbx2q_p8(poly8x16_t a, poly8x16x2_t b, uint8x16_t c) {
+ // CHECK: test_vqtbx2q_p8
+ return vqtbx2q_p8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+poly8x16_t test_vqtbx3q_p8(poly8x16_t a, poly8x16x3_t b, uint8x16_t c) {
+ // CHECK: test_vqtbx3q_p8
+ return vqtbx3q_p8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
+
+poly8x16_t test_vqtbx4q_p8(poly8x16_t a, poly8x16x4_t b, uint8x16_t c) {
+ // CHECK: test_vqtbx4q_p8
+ return vqtbx4q_p8(a, b, c);
+ // CHECK: tbx {{v[0-9]+}}.16b, {{{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b}, {{v[0-9]+}}.16b
+}
diff --git a/test/CodeGen/aarch64-neon-vcombine.c b/test/CodeGen/aarch64-neon-vcombine.c
new file mode 100644
index 000000000000..3e170c8c4c9f
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-vcombine.c
@@ -0,0 +1,91 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+int8x16_t test_vcombine_s8(int8x8_t low, int8x8_t high) {
+ // CHECK-LABEL: test_vcombine_s8:
+ return vcombine_s8(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+int16x8_t test_vcombine_s16(int16x4_t low, int16x4_t high) {
+ // CHECK-LABEL: test_vcombine_s16:
+ return vcombine_s16(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+int32x4_t test_vcombine_s32(int32x2_t low, int32x2_t high) {
+ // CHECK-LABEL: test_vcombine_s32:
+ return vcombine_s32(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+int64x2_t test_vcombine_s64(int64x1_t low, int64x1_t high) {
+ // CHECK-LABEL: test_vcombine_s64:
+ return vcombine_s64(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+uint8x16_t test_vcombine_u8(uint8x8_t low, uint8x8_t high) {
+ // CHECK-LABEL: test_vcombine_u8:
+ return vcombine_u8(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+uint16x8_t test_vcombine_u16(uint16x4_t low, uint16x4_t high) {
+ // CHECK-LABEL: test_vcombine_u16:
+ return vcombine_u16(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+uint32x4_t test_vcombine_u32(uint32x2_t low, uint32x2_t high) {
+ // CHECK-LABEL: test_vcombine_u32:
+ return vcombine_u32(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+uint64x2_t test_vcombine_u64(uint64x1_t low, uint64x1_t high) {
+ // CHECK-LABEL: test_vcombine_u64:
+ return vcombine_u64(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+poly64x2_t test_vcombine_p64(poly64x1_t low, poly64x1_t high) {
+ // CHECK-LABEL: test_vcombine_p64:
+ return vcombine_p64(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+float16x8_t test_vcombine_f16(float16x4_t low, float16x4_t high) {
+ // CHECK-LABEL: test_vcombine_f16:
+ return vcombine_f16(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+float32x4_t test_vcombine_f32(float32x2_t low, float32x2_t high) {
+ // CHECK-LABEL: test_vcombine_f32:
+ return vcombine_f32(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+poly8x16_t test_vcombine_p8(poly8x8_t low, poly8x8_t high) {
+ // CHECK-LABEL: test_vcombine_p8:
+ return vcombine_p8(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+poly16x8_t test_vcombine_p16(poly16x4_t low, poly16x4_t high) {
+ // CHECK-LABEL: test_vcombine_p16:
+ return vcombine_p16(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
+
+float64x2_t test_vcombine_f64(float64x1_t low, float64x1_t high) {
+ // CHECK-LABEL: test_vcombine_f64:
+ return vcombine_f64(low, high);
+ // CHECK: ins v0.d[1], v1.d[0]
+}
diff --git a/test/CodeGen/aarch64-neon-vget-hilo.c b/test/CodeGen/aarch64-neon-vget-hilo.c
new file mode 100644
index 000000000000..012b0bbb964a
--- /dev/null
+++ b/test/CodeGen/aarch64-neon-vget-hilo.c
@@ -0,0 +1,176 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics and types
+
+#include <arm_neon.h>
+
+int8x8_t test_vget_high_s8(int8x16_t a) {
+ // CHECK-LABEL: test_vget_high_s8:
+ return vget_high_s8(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+int16x4_t test_vget_high_s16(int16x8_t a) {
+ // CHECK-LABEL: test_vget_high_s16:
+ return vget_high_s16(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+int32x2_t test_vget_high_s32(int32x4_t a) {
+ // CHECK-LABEL: test_vget_high_s32:
+ return vget_high_s32(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+int64x1_t test_vget_high_s64(int64x2_t a) {
+ // CHECK-LABEL: test_vget_high_s64:
+ return vget_high_s64(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+uint8x8_t test_vget_high_u8(uint8x16_t a) {
+ // CHECK-LABEL: test_vget_high_u8:
+ return vget_high_u8(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+uint16x4_t test_vget_high_u16(uint16x8_t a) {
+ // CHECK-LABEL: test_vget_high_u16:
+ return vget_high_u16(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+uint32x2_t test_vget_high_u32(uint32x4_t a) {
+ // CHECK-LABEL: test_vget_high_u32:
+ return vget_high_u32(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+uint64x1_t test_vget_high_u64(uint64x2_t a) {
+ // CHECK-LABEL: test_vget_high_u64:
+ return vget_high_u64(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+poly64x1_t test_vget_high_p64(poly64x2_t a) {
+ // CHECK-LABEL: test_vget_high_p64:
+ return vget_high_p64(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+float16x4_t test_vget_high_f16(float16x8_t a) {
+ // CHECK-LABEL: test_vget_high_f16:
+ return vget_high_f16(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+float32x2_t test_vget_high_f32(float32x4_t a) {
+ // CHECK-LABEL: test_vget_high_f32:
+ return vget_high_f32(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+poly8x8_t test_vget_high_p8(poly8x16_t a) {
+ // CHECK-LABEL: test_vget_high_p8:
+ return vget_high_p8(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+poly16x4_t test_vget_high_p16(poly16x8_t a) {
+ // CHECK-LABEL: test_vget_high_p16
+ return vget_high_p16(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+float64x1_t test_vget_high_f64(float64x2_t a) {
+ // CHECK-LABEL: test_vget_high_f64
+ return vget_high_f64(a);
+ // CHECK: dup d0, {{v[0-9]+}}.d[1]
+}
+
+int8x8_t test_vget_low_s8(int8x16_t a) {
+ // CHECK-LABEL: test_vget_low_s8:
+ return vget_low_s8(a);
+ // CHECK-NEXT: ret
+}
+
+int16x4_t test_vget_low_s16(int16x8_t a) {
+ // CHECK-LABEL: test_vget_low_s16:
+ return vget_low_s16(a);
+ // CHECK-NEXT: ret
+}
+
+int32x2_t test_vget_low_s32(int32x4_t a) {
+ // CHECK-LABEL: test_vget_low_s32:
+ return vget_low_s32(a);
+ // CHECK-NEXT: ret
+}
+
+int64x1_t test_vget_low_s64(int64x2_t a) {
+ // CHECK-LABEL: test_vget_low_s64:
+ return vget_low_s64(a);
+ // CHECK-NEXT: ret
+}
+
+uint8x8_t test_vget_low_u8(uint8x16_t a) {
+ // CHECK-LABEL: test_vget_low_u8:
+ return vget_low_u8(a);
+ // CHECK-NEXT: ret
+}
+
+uint16x4_t test_vget_low_u16(uint16x8_t a) {
+ // CHECK-LABEL: test_vget_low_u16:
+ return vget_low_u16(a);
+ // CHECK-NEXT: ret
+}
+
+uint32x2_t test_vget_low_u32(uint32x4_t a) {
+ // CHECK-LABEL: test_vget_low_u32:
+ return vget_low_u32(a);
+ // CHECK-NEXT: ret
+}
+
+uint64x1_t test_vget_low_u64(uint64x2_t a) {
+ // CHECK-LABEL: test_vget_low_u64:
+ return vget_low_u64(a);
+ // CHECK-NEXT: ret
+}
+
+poly64x1_t test_vget_low_p64(poly64x2_t a) {
+ // CHECK-LABEL: test_vget_low_p64:
+ return vget_low_p64(a);
+ // CHECK-NEXT: ret
+}
+
+float16x4_t test_vget_low_f16(float16x8_t a) {
+ // CHECK-LABEL: test_vget_low_f16:
+ return vget_low_f16(a);
+ // CHECK-NEXT: ret
+}
+
+float32x2_t test_vget_low_f32(float32x4_t a) {
+ // CHECK-LABEL: test_vget_low_f32:
+ return vget_low_f32(a);
+ // CHECK-NEXT: ret
+}
+
+poly8x8_t test_vget_low_p8(poly8x16_t a) {
+ // CHECK-LABEL: test_vget_low_p8:
+ return vget_low_p8(a);
+ // CHECK-NEXT: ret
+}
+
+poly16x4_t test_vget_low_p16(poly16x8_t a) {
+ // CHECK-LABEL: test_vget_low_p16:
+ return vget_low_p16(a);
+ // CHECK-NEXT: ret
+}
+
+float64x1_t test_vget_low_f64(float64x2_t a) {
+ // CHECK-LABEL: test_vget_low_f64:
+ return vget_low_f64(a);
+ // CHECK-NEXT: ret
+}
+
diff --git a/test/CodeGen/aarch64-poly64.c b/test/CodeGen/aarch64-poly64.c
new file mode 100644
index 000000000000..3e195019cd0a
--- /dev/null
+++ b/test/CodeGen/aarch64-poly64.c
@@ -0,0 +1,283 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test new aarch64 intrinsics with poly64
+
+#include <arm_neon.h>
+
+uint64x1_t test_vceq_p64(poly64x1_t a, poly64x1_t b) {
+ // CHECK: test_vceq_p64
+ return vceq_p64(a, b);
+ // CHECK: cmeq {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint64x2_t test_vceqq_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vceqq_p64
+ return vceqq_p64(a, b);
+ // CHECK: cmeq {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+uint64x1_t test_vtst_p64(poly64x1_t a, poly64x1_t b) {
+ // CHECK: test_vtst_p64
+ return vtst_p64(a, b);
+ // CHECK: cmtst {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+uint64x2_t test_vtstq_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vtstq_p64
+ return vtstq_p64(a, b);
+ // CHECK: cmtst {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d
+}
+
+poly64x1_t test_vbsl_p64(poly64x1_t a, poly64x1_t b, poly64x1_t c) {
+ // CHECK: test_vbsl_p64
+ return vbsl_p64(a, b, c);
+ // CHECK: bsl {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b
+}
+
+poly64x2_t test_vbslq_p64(poly64x2_t a, poly64x2_t b, poly64x2_t c) {
+ // CHECK: test_vbslq_p64
+ return vbslq_p64(a, b, c);
+ // CHECK: bsl {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b
+}
+
+poly64_t test_vget_lane_p64(poly64x1_t v) {
+ // CHECK: test_vget_lane_p64
+ return vget_lane_p64(v, 0);
+ // CHECK: fmov {{x[0-9]+}}, {{d[0-9]+}}
+}
+
+poly64_t test_vgetq_lane_p64(poly64x2_t v) {
+ // CHECK: test_vgetq_lane_p64
+ return vgetq_lane_p64(v, 1);
+ // CHECK: umov {{x[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+poly64x1_t test_vset_lane_p64(poly64_t a, poly64x1_t v) {
+ // CHECK: test_vset_lane_p64
+ return vset_lane_p64(a, v, 0);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+poly64x2_t test_vsetq_lane_p64(poly64_t a, poly64x2_t v) {
+ // CHECK: test_vsetq_lane_p64
+ return vsetq_lane_p64(a, v, 1);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{x[0-9]+}}
+}
+
+poly64x1_t test_vcopy_lane_p64(poly64x1_t a, poly64x1_t b) {
+ // CHECK: test_vcopy_lane_p64
+ return vcopy_lane_p64(a, 0, b, 0);
+ // CHECK: fmov {{d[0-9]+}}, {{d[0-9]+}}
+}
+
+poly64x2_t test_vcopyq_lane_p64(poly64x2_t a, poly64x1_t b) {
+ // CHECK: test_vcopyq_lane_p64
+ return vcopyq_lane_p64(a, 1, b, 0);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+poly64x2_t test_vcopyq_laneq_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vcopyq_laneq_p64
+ return vcopyq_laneq_p64(a, 1, b, 1);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[1]
+}
+
+poly64x1_t test_vcreate_p64(uint64_t a) {
+ // CHECK: test_vcreate_p64
+ return vcreate_p64(a);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+
+poly64x1_t test_vdup_n_p64(poly64_t a) {
+ // CHECK: test_vdup_n_p64
+ return vdup_n_p64(a);
+ // CHECK: fmov {{d[0-9]+}}, {{x[0-9]+}}
+}
+poly64x2_t test_vdupq_n_p64(poly64_t a) {
+ // CHECK: test_vdup_n_p64
+ return vdupq_n_p64(a);
+ // CHECK: dup {{v[0-9]+}}.2d, {{x[0-9]+}}
+}
+
+poly64x1_t test_vdup_lane_p64(poly64x1_t vec) {
+ // CHECK: test_vdup_lane_p64
+ return vdup_lane_p64(vec, 0);
+ // CHECK: ret
+}
+
+poly64x2_t test_vdupq_lane_p64(poly64x1_t vec) {
+ // CHECK: test_vdupq_lane_p64
+ return vdupq_lane_p64(vec, 0);
+ // CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
+}
+
+poly64x2_t test_vdupq_laneq_p64(poly64x2_t vec) {
+ // CHECK: test_vdupq_laneq_p64
+ return vdupq_laneq_p64(vec, 1);
+ // CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[1]
+}
+
+poly64x2_t test_vcombine_p64(poly64x1_t low, poly64x1_t high) {
+ // CHECK: test_vcombine_p64
+ return vcombine_p64(low, high);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+poly64x1_t test_vld1_p64(poly64_t const * ptr) {
+ // CHECK: test_vld1_p64
+ return vld1_p64(ptr);
+ // CHECK: ld1 {{{v[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly64x2_t test_vld1q_p64(poly64_t const * ptr) {
+ // CHECK: test_vld1q_p64
+ return vld1q_p64(ptr);
+ // CHECK: ld1 {{{v[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1_p64(poly64_t * ptr, poly64x1_t val) {
+ // CHECK: test_vst1_p64
+ return vst1_p64(ptr, val);
+ // CHECK: st1 {{{v[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst1q_p64(poly64_t * ptr, poly64x2_t val) {
+ // CHECK: test_vst1q_p64
+ return vst1q_p64(ptr, val);
+ // CHECK: st1 {{{v[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+poly64x1x2_t test_vld2_p64(poly64_t const * ptr) {
+ // CHECK: test_vld2_p64
+ return vld2_p64(ptr);
+ // CHECK: ld1 {{{v[0-9]+}}.1d, {{v[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly64x2x2_t test_vld2q_p64(poly64_t const * ptr) {
+ // CHECK: test_vld2q_p64
+ return vld2q_p64(ptr);
+ // CHECK: ld2 {{{v[0-9]+}}.2d, {{v[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+poly64x1x3_t test_vld3_p64(poly64_t const * ptr) {
+ // CHECK: test_vld3_p64
+ return vld3_p64(ptr);
+ // CHECK: ld1 {{{v[0-9]+}}.1d, {{v[0-9]+}}.1d, {{v[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly64x2x3_t test_vld3q_p64(poly64_t const * ptr) {
+ // CHECK: test_vld3q_p64
+ return vld3q_p64(ptr);
+ // CHECK: ld3 {{{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+poly64x1x4_t test_vld4_p64(poly64_t const * ptr) {
+ // CHECK: test_vld4_p64
+ return vld4_p64(ptr);
+ // CHECK: ld1 {{{v[0-9]+}}.1d, {{v[0-9]+}}.1d, {{v[0-9]+}}.1d, {{v[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+poly64x2x4_t test_vld4q_p64(poly64_t const * ptr) {
+ // CHECK: test_vld4q_p64
+ return vld4q_p64(ptr);
+ // CHECK: ld4 {{{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2_p64(poly64_t * ptr, poly64x1x2_t val) {
+ // CHECK: test_vst2_p64
+ return vst2_p64(ptr, val);
+ // CHECK: st1 {{{v[0-9]+}}.1d, {{v[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst2q_p64(poly64_t * ptr, poly64x2x2_t val) {
+ // CHECK: test_vst2q_p64
+ return vst2q_p64(ptr, val);
+ // CHECK: st2 {{{v[0-9]+}}.2d, {{v[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst3_p64(poly64_t * ptr, poly64x1x3_t val) {
+ // CHECK: test_vst3_p64
+ return vst3_p64(ptr, val);
+ // CHECK: st1 {{{v[0-9]+}}.1d, {{v[0-9]+}}.1d, {{v[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst3q_p64(poly64_t * ptr, poly64x2x3_t val) {
+ // CHECK: test_vst3q_p64
+ return vst3q_p64(ptr, val);
+ // CHECK: st3 {{{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4_p64(poly64_t * ptr, poly64x1x4_t val) {
+ // CHECK: test_vst4_p64
+ return vst4_p64(ptr, val);
+ // CHECK: st1 {{{v[0-9]+}}.1d, {{v[0-9]+}}.1d, {{v[0-9]+}}.1d, {{v[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
+
+void test_vst4q_p64(poly64_t * ptr, poly64x2x4_t val) {
+ // CHECK: test_vst4q_p64
+ return vst4q_p64(ptr, val);
+ // CHECK: st4 {{{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, {{v[0-9]+}}.2d}, [{{x[0-9]+|sp}}]
+}
+
+poly64x1_t test_vext_p64(poly64x1_t a, poly64x1_t b) {
+ // CHECK: test_vext_p64
+ return vext_u64(a, b, 0);
+
+}
+
+poly64x2_t test_vextq_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vextq_p64
+ return vextq_p64(a, b, 1);
+ // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #0x8
+}
+
+poly64x2_t test_vzip1q_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vzip1q_p64
+ return vzip1q_p64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+poly64x2_t test_vzip2q_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vzip2q_p64
+ return vzip2q_u64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+poly64x2_t test_vuzp1q_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vuzp1q_p64
+ return vuzp1q_p64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+poly64x2_t test_vuzp2q_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vuzp2q_p64
+ return vuzp2q_u64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+poly64x2_t test_vtrn1q_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vtrn1q_p64
+ return vtrn1q_p64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[0]
+}
+
+poly64x2_t test_vtrn2q_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vtrn2q_p64
+ return vtrn2q_u64(a, b);
+ // CHECK: ins {{v[0-9]+}}.d[0], {{v[0-9]+}}.d[1]
+}
+
+poly64x1_t test_vsri_n_p64(poly64x1_t a, poly64x1_t b) {
+ // CHECK: test_vsri_n_p64
+ return vsri_n_p64(a, b, 33);
+ // CHECK: sri {{d[0-9]+}}, {{d[0-9]+}}, #33
+}
+
+poly64x2_t test_vsriq_n_p64(poly64x2_t a, poly64x2_t b) {
+ // CHECK: test_vsriq_n_p64
+ return vsriq_n_p64(a, b, 64);
+ // CHECK: sri {{v[0-9]+}}.2d, {{v[0-9]+}}.2d, #64
+}
+
diff --git a/test/CodeGen/aarch64-varargs.c b/test/CodeGen/aarch64-varargs.c
index 324a0708271f..3d9cd866e872 100644
--- a/test/CodeGen/aarch64-varargs.c
+++ b/test/CodeGen/aarch64-varargs.c
@@ -7,7 +7,7 @@
va_list the_list;
int simple_int(void) {
-// CHECK: define i32 @simple_int
+// CHECK-LABEL: define i32 @simple_int
return va_arg(the_list, int);
// CHECK: [[GR_OFFS:%[a-z_0-9]+]] = load i32* getelementptr inbounds (%struct.__va_list* @the_list, i32 0, i32 3)
// CHECK: [[EARLY_ONSTACK:%[a-z_0-9]+]] = icmp sge i32 [[GR_OFFS]], 0
@@ -39,7 +39,7 @@ int simple_int(void) {
}
__int128 aligned_int(void) {
-// CHECK: define i128 @aligned_int
+// CHECK-LABEL: define i128 @aligned_int
return va_arg(the_list, __int128);
// CHECK: [[GR_OFFS:%[a-z_0-9]+]] = load i32* getelementptr inbounds (%struct.__va_list* @the_list, i32 0, i32 3)
// CHECK: [[EARLY_ONSTACK:%[a-z_0-9]+]] = icmp sge i32 [[GR_OFFS]], 0
@@ -81,7 +81,7 @@ struct bigstruct {
};
struct bigstruct simple_indirect(void) {
-// CHECK: define void @simple_indirect
+// CHECK-LABEL: define void @simple_indirect
return va_arg(the_list, struct bigstruct);
// CHECK: [[GR_OFFS:%[a-z_0-9]+]] = load i32* getelementptr inbounds (%struct.__va_list* @the_list, i32 0, i32 3)
// CHECK: [[EARLY_ONSTACK:%[a-z_0-9]+]] = icmp sge i32 [[GR_OFFS]], 0
@@ -119,7 +119,7 @@ struct aligned_bigstruct {
};
struct aligned_bigstruct simple_aligned_indirect(void) {
-// CHECK: define void @simple_aligned_indirect
+// CHECK-LABEL: define void @simple_aligned_indirect
return va_arg(the_list, struct aligned_bigstruct);
// CHECK: [[GR_OFFS:%[a-z_0-9]+]] = load i32* getelementptr inbounds (%struct.__va_list* @the_list, i32 0, i32 3)
// CHECK: [[EARLY_ONSTACK:%[a-z_0-9]+]] = icmp sge i32 [[GR_OFFS]], 0
@@ -150,7 +150,7 @@ struct aligned_bigstruct simple_aligned_indirect(void) {
}
double simple_double(void) {
-// CHECK: define double @simple_double
+// CHECK-LABEL: define double @simple_double
return va_arg(the_list, double);
// CHECK: [[VR_OFFS:%[a-z_0-9]+]] = load i32* getelementptr inbounds (%struct.__va_list* @the_list, i32 0, i32 4)
// CHECK: [[EARLY_ONSTACK:%[a-z_0-9]+]] = icmp sge i32 [[VR_OFFS]], 0
@@ -186,7 +186,7 @@ struct hfa {
};
struct hfa simple_hfa(void) {
-// CHECK: define %struct.hfa @simple_hfa
+// CHECK-LABEL: define %struct.hfa @simple_hfa
return va_arg(the_list, struct hfa);
// CHECK: [[VR_OFFS:%[a-z_0-9]+]] = load i32* getelementptr inbounds (%struct.__va_list* @the_list, i32 0, i32 4)
// CHECK: [[EARLY_ONSTACK:%[a-z_0-9]+]] = icmp sge i32 [[VR_OFFS]], 0
@@ -226,7 +226,7 @@ struct hfa simple_hfa(void) {
}
void check_start(int n, ...) {
-// CHECK: define void @check_start(i32 %n, ...)
+// CHECK-LABEL: define void @check_start(i32 %n, ...)
va_list the_list;
va_start(the_list, n);
diff --git a/test/CodeGen/address-space.c b/test/CodeGen/address-space.c
index 9de0670b1024..3e865fd3b775 100644
--- a/test/CodeGen/address-space.c
+++ b/test/CodeGen/address-space.c
@@ -9,11 +9,11 @@ int foo __attribute__((address_space(1)));
// CHECK: @ban = common addrspace(1) global
int ban[10] __attribute__((address_space(1)));
-// CHECK: define i32 @test1()
+// CHECK-LABEL: define i32 @test1()
// CHECK: load i32 addrspace(1)* @foo
int test1() { return foo; }
-// CHECK: define i32 @test2(i32 %i)
+// CHECK-LABEL: define i32 @test2(i32 %i)
// CHECK: load i32 addrspace(1)*
// CHECK-NEXT: ret i32
int test2(int i) { return ban[i]; }
@@ -21,7 +21,7 @@ int test2(int i) { return ban[i]; }
// Both A and B point into addrspace(2).
__attribute__((address_space(2))) int *A, *B;
-// CHECK: define void @test3()
+// CHECK-LABEL: define void @test3()
// CHECK: load i32 addrspace(2)** @B
// CHECK: load i32 addrspace(2)*
// CHECK: load i32 addrspace(2)** @A
@@ -35,7 +35,7 @@ typedef struct {
float aData[1];
} MyStruct;
-// CHECK: define void @test4(
+// CHECK-LABEL: define void @test4(
// CHECK: call void @llvm.memcpy.p0i8.p2i8
// CHECK: call void @llvm.memcpy.p2i8.p0i8
void test4(MyStruct __attribute__((address_space(2))) *pPtr) {
diff --git a/test/CodeGen/alias.c b/test/CodeGen/alias.c
index a8380a37c583..efa94b340bbd 100644
--- a/test/CodeGen/alias.c
+++ b/test/CodeGen/alias.c
@@ -8,18 +8,18 @@ static int bar1 = 42;
extern int g1;
extern int g1 __attribute((alias("g0")));
-// CHECKBASIC: @g1 = alias i32* @g0
+// CHECKBASIC-DAG: @g1 = alias i32* @g0
void f0(void) { }
extern void f1(void);
extern void f1(void) __attribute((alias("f0")));
-// CHECKBASIC: @f1 = alias void ()* @f0
+// CHECKBASIC-DAG: @f1 = alias void ()* @f0
// CHECKBASIC: define void @f0() [[NUW:#[0-9]+]] {
// Make sure that aliases cause referenced values to be emitted.
// PR3200
static inline int foo1() { return 0; }
-// CHECKBASIC: define internal i32 @foo1()
+// CHECKBASIC-LABEL: define internal i32 @foo1()
int foo() __attribute__((alias("foo1")));
int bar() __attribute__((alias("bar1")));
diff --git a/test/CodeGen/align-param.c b/test/CodeGen/align-param.c
index 8907f66409a1..78e57b5b1f8c 100644
--- a/test/CodeGen/align-param.c
+++ b/test/CodeGen/align-param.c
@@ -5,7 +5,7 @@
int test (long long x) {
return (int)x;
}
-// CHECK: define i32 @test
+// CHECK-LABEL: define i32 @test
// CHECK: alloca i64, align 8
@@ -14,5 +14,5 @@ struct X { int x,y,z,a; };
int test2(struct X x __attribute((aligned(16)))) {
return x.z;
}
-// CHECK: define i32 @test2
+// CHECK-LABEL: define i32 @test2
// CHECK: alloca %struct.X, align 16
diff --git a/test/CodeGen/align-x68_64.c b/test/CodeGen/align-x68_64.c
new file mode 100644
index 000000000000..cf128b43433e
--- /dev/null
+++ b/test/CodeGen/align-x68_64.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s
+// PR5599
+
+void test1_f(void *);
+
+void test1_g(void) {
+ float x[4];
+ test1_f(x);
+}
+// CHECK: @test1_g
+// CHECK: alloca [4 x float], align 16
diff --git a/test/CodeGen/alignment.c b/test/CodeGen/alignment.c
index 98ea01be0920..04d6aaccc219 100644
--- a/test/CodeGen/alignment.c
+++ b/test/CodeGen/alignment.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s
__attribute((aligned(16))) float a[128];
union {int a[4]; __attribute((aligned(16))) float b[4];} b;
@@ -6,7 +6,8 @@ union {int a[4]; __attribute((aligned(16))) float b[4];} b;
// CHECK: @a = {{.*}}zeroinitializer, align 16
// CHECK: @b = {{.*}}zeroinitializer, align 16
-
+long long int test5[1024];
+// CHECK-DAG: @test5 = common global [1024 x i64] zeroinitializer, align 8
// PR5279 - Reduced alignment on typedef.
typedef int myint __attribute__((aligned(1)));
diff --git a/test/CodeGen/annotations-var.c b/test/CodeGen/annotations-var.c
index b8ada9fc0f3e..da9e0b63eca3 100644
--- a/test/CodeGen/annotations-var.c
+++ b/test/CodeGen/annotations-var.c
@@ -31,7 +31,7 @@ int foo(int v __attribute__((annotate("param_ann_0"))) __attribute__((annotate("
void local(void) {
int localvar __attribute__((annotate("localvar_ann_0"))) __attribute__((annotate("localvar_ann_1"))) = 3;
-// LOCAL: define void @local()
+// LOCAL-LABEL: define void @local()
// LOCAL: [[LOCALVAR:%.*]] = alloca i32,
// LOCAL-NEXT: [[T0:%.*]] = bitcast i32* [[LOCALVAR]] to i8*
// LOCAL-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 33)
@@ -41,7 +41,7 @@ void local(void) {
void undef(void) {
int undefvar __attribute__((annotate("undefvar_ann_0")));
-// UNDEF: define void @undef()
+// UNDEF-LABEL: define void @undef()
// UNDEF: [[UNDEFVAR:%.*]] = alloca i32,
// UNDEF-NEXT: [[T0:%.*]] = bitcast i32* [[UNDEFVAR]] to i8*
// UNDEF-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 43)
diff --git a/test/CodeGen/arm-aapcs-vfp.c b/test/CodeGen/arm-aapcs-vfp.c
index 7210229f377b..0e102f35ed05 100644
--- a/test/CodeGen/arm-aapcs-vfp.c
+++ b/test/CodeGen/arm-aapcs-vfp.c
@@ -95,6 +95,6 @@ void test_neon(struct neon_struct arg) {
neon_callee(arg);
}
-// CHECK: define arm_aapcs_vfpcc void @f33(%struct.s33* byval %s)
+// CHECK-LABEL: define arm_aapcs_vfpcc void @f33(%struct.s33* byval %s)
struct s33 { char buf[32*32]; };
void f33(struct s33 s) { }
diff --git a/test/CodeGen/arm-arguments.c b/test/CodeGen/arm-arguments.c
index 63ecd4c5990b..b6bac9ac44af 100644
--- a/test/CodeGen/arm-arguments.c
+++ b/test/CodeGen/arm-arguments.c
@@ -1,78 +1,78 @@
// REQUIRES: arm-registered-target
-// RUN: %clang_cc1 -triple armv7-apple-darwin9 -target-abi apcs-gnu -emit-llvm -w -o - %s | FileCheck -check-prefix=APCS-GNU %s
-// RUN: %clang_cc1 -triple armv7-apple-darwin9 -target-abi aapcs -emit-llvm -w -o - %s | FileCheck -check-prefix=AAPCS %s
+// RUN: %clang_cc1 -triple armv7-apple-darwin9 -target-feature +neon -target-abi apcs-gnu -emit-llvm -w -o - %s | FileCheck -check-prefix=APCS-GNU %s
+// RUN: %clang_cc1 -triple armv7-apple-darwin9 -target-feature +neon -target-abi aapcs -emit-llvm -w -o - %s | FileCheck -check-prefix=AAPCS %s
-// APCS-GNU: define signext i8 @f0()
-// AAPCS: define arm_aapcscc signext i8 @f0()
+// APCS-GNU-LABEL: define signext i8 @f0()
+// AAPCS-LABEL: define arm_aapcscc signext i8 @f0()
char f0(void) {
return 0;
}
-// APCS-GNU: define i8 @f1()
-// AAPCS: define arm_aapcscc i8 @f1()
+// APCS-GNU-LABEL: define i8 @f1()
+// AAPCS-LABEL: define arm_aapcscc i8 @f1()
struct s1 { char f0; };
struct s1 f1(void) {}
-// APCS-GNU: define i16 @f2()
-// AAPCS: define arm_aapcscc i16 @f2()
+// APCS-GNU-LABEL: define i16 @f2()
+// AAPCS-LABEL: define arm_aapcscc i16 @f2()
struct s2 { short f0; };
struct s2 f2(void) {}
-// APCS-GNU: define i32 @f3()
-// AAPCS: define arm_aapcscc i32 @f3()
+// APCS-GNU-LABEL: define i32 @f3()
+// AAPCS-LABEL: define arm_aapcscc i32 @f3()
struct s3 { int f0; };
struct s3 f3(void) {}
-// APCS-GNU: define i32 @f4()
-// AAPCS: define arm_aapcscc i32 @f4()
+// APCS-GNU-LABEL: define i32 @f4()
+// AAPCS-LABEL: define arm_aapcscc i32 @f4()
struct s4 { struct s4_0 { int f0; } f0; };
struct s4 f4(void) {}
-// APCS-GNU: define void @f5(
+// APCS-GNU-LABEL: define void @f5(
// APCS-GNU: struct.s5* noalias sret
-// AAPCS: define arm_aapcscc i32 @f5()
+// AAPCS-LABEL: define arm_aapcscc i32 @f5()
struct s5 { struct { } f0; int f1; };
struct s5 f5(void) {}
-// APCS-GNU: define void @f6(
+// APCS-GNU-LABEL: define void @f6(
// APCS-GNU: struct.s6* noalias sret
-// AAPCS: define arm_aapcscc i32 @f6()
+// AAPCS-LABEL: define arm_aapcscc i32 @f6()
struct s6 { int f0[1]; };
struct s6 f6(void) {}
-// APCS-GNU: define void @f7()
-// AAPCS: define arm_aapcscc void @f7()
+// APCS-GNU-LABEL: define void @f7()
+// AAPCS-LABEL: define arm_aapcscc void @f7()
struct s7 { struct { int : 0; } f0; };
struct s7 f7(void) {}
-// APCS-GNU: define void @f8(
+// APCS-GNU-LABEL: define void @f8(
// APCS-GNU: struct.s8* noalias sret
-// AAPCS: define arm_aapcscc void @f8()
+// AAPCS-LABEL: define arm_aapcscc void @f8()
struct s8 { struct { int : 0; } f0[1]; };
struct s8 f8(void) {}
-// APCS-GNU: define i32 @f9()
-// AAPCS: define arm_aapcscc i32 @f9()
+// APCS-GNU-LABEL: define i32 @f9()
+// AAPCS-LABEL: define arm_aapcscc i32 @f9()
struct s9 { int f0; int : 0; };
struct s9 f9(void) {}
-// APCS-GNU: define i32 @f10()
-// AAPCS: define arm_aapcscc i32 @f10()
+// APCS-GNU-LABEL: define i32 @f10()
+// AAPCS-LABEL: define arm_aapcscc i32 @f10()
struct s10 { int f0; int : 0; int : 0; };
struct s10 f10(void) {}
-// APCS-GNU: define void @f11(
+// APCS-GNU-LABEL: define void @f11(
// APCS-GNU: struct.s11* noalias sret
-// AAPCS: define arm_aapcscc i32 @f11()
+// AAPCS-LABEL: define arm_aapcscc i32 @f11()
struct s11 { int : 0; int f0; };
struct s11 f11(void) {}
-// APCS-GNU: define i32 @f12()
-// AAPCS: define arm_aapcscc i32 @f12()
+// APCS-GNU-LABEL: define i32 @f12()
+// AAPCS-LABEL: define arm_aapcscc i32 @f12()
union u12 { char f0; short f1; int f2; };
union u12 f12(void) {}
-// APCS-GNU: define void @f13(
+// APCS-GNU-LABEL: define void @f13(
// APCS-GNU: struct.s13* noalias sret
// FIXME: This should return a float.
@@ -80,55 +80,55 @@ union u12 f12(void) {}
struct s13 { float f0; };
struct s13 f13(void) {}
-// APCS-GNU: define void @f14(
+// APCS-GNU-LABEL: define void @f14(
// APCS-GNU: union.u14* noalias sret
-// AAPCS: define arm_aapcscc i32 @f14()
+// AAPCS-LABEL: define arm_aapcscc i32 @f14()
union u14 { float f0; };
union u14 f14(void) {}
-// APCS-GNU: define void @f15()
-// AAPCS: define arm_aapcscc void @f15()
+// APCS-GNU-LABEL: define void @f15()
+// AAPCS-LABEL: define arm_aapcscc void @f15()
void f15(struct s7 a0) {}
-// APCS-GNU: define void @f16()
-// AAPCS: define arm_aapcscc void @f16()
+// APCS-GNU-LABEL: define void @f16()
+// AAPCS-LABEL: define arm_aapcscc void @f16()
void f16(struct s8 a0) {}
-// APCS-GNU: define i32 @f17()
-// AAPCS: define arm_aapcscc i32 @f17()
+// APCS-GNU-LABEL: define i32 @f17()
+// AAPCS-LABEL: define arm_aapcscc i32 @f17()
struct s17 { short f0 : 13; char f1 : 4; };
struct s17 f17(void) {}
-// APCS-GNU: define i32 @f18()
-// AAPCS: define arm_aapcscc i32 @f18()
+// APCS-GNU-LABEL: define i32 @f18()
+// AAPCS-LABEL: define arm_aapcscc i32 @f18()
struct s18 { short f0; char f1 : 4; };
struct s18 f18(void) {}
-// APCS-GNU: define void @f19(
+// APCS-GNU-LABEL: define void @f19(
// APCS-GNU: struct.s19* noalias sret
-// AAPCS: define arm_aapcscc i32 @f19()
+// AAPCS-LABEL: define arm_aapcscc i32 @f19()
struct s19 { int f0; struct s8 f1; };
struct s19 f19(void) {}
-// APCS-GNU: define void @f20(
+// APCS-GNU-LABEL: define void @f20(
// APCS-GNU: struct.s20* noalias sret
-// AAPCS: define arm_aapcscc i32 @f20()
+// AAPCS-LABEL: define arm_aapcscc i32 @f20()
struct s20 { struct s8 f1; int f0; };
struct s20 f20(void) {}
-// APCS-GNU: define i8 @f21()
-// AAPCS: define arm_aapcscc i32 @f21()
+// APCS-GNU-LABEL: define i8 @f21()
+// AAPCS-LABEL: define arm_aapcscc i32 @f21()
struct s21 { struct {} f1; int f0 : 4; };
struct s21 f21(void) {}
-// APCS-GNU: define i16 @f22()
-// APCS-GNU: define i32 @f23()
-// APCS-GNU: define i64 @f24()
-// APCS-GNU: define i128 @f25()
-// APCS-GNU: define i64 @f26()
-// APCS-GNU: define i128 @f27()
-// AAPCS: define arm_aapcscc i16 @f22()
-// AAPCS: define arm_aapcscc i32 @f23()
+// APCS-GNU-LABEL: define i16 @f22()
+// APCS-GNU-LABEL: define i32 @f23()
+// APCS-GNU-LABEL: define i64 @f24()
+// APCS-GNU-LABEL: define i128 @f25()
+// APCS-GNU-LABEL: define i64 @f26()
+// APCS-GNU-LABEL: define i128 @f27()
+// AAPCS-LABEL: define arm_aapcscc i16 @f22()
+// AAPCS-LABEL: define arm_aapcscc i32 @f23()
// AAPCS: define arm_aapcscc void @f24({{.*}} noalias sret
// AAPCS: define arm_aapcscc void @f25({{.*}} noalias sret
// AAPCS: define arm_aapcscc void @f26({{.*}} noalias sret
@@ -140,13 +140,13 @@ _Complex long long f25(void) {}
_Complex float f26(void) {}
_Complex double f27(void) {}
-// APCS-GNU: define i16 @f28()
-// AAPCS: define arm_aapcscc i16 @f28()
+// APCS-GNU-LABEL: define i16 @f28()
+// AAPCS-LABEL: define arm_aapcscc i16 @f28()
struct s28 { _Complex char f0; };
struct s28 f28() {}
-// APCS-GNU: define i32 @f29()
-// AAPCS: define arm_aapcscc i32 @f29()
+// APCS-GNU-LABEL: define i32 @f29()
+// AAPCS-LABEL: define arm_aapcscc i32 @f29()
struct s29 { _Complex short f0; };
struct s29 f29() {}
@@ -176,8 +176,8 @@ void f32(struct s32 s) { }
// PR13350
struct s33 { char buf[32*32]; };
void f33(struct s33 s) { }
-// APCS-GNU: define void @f33(%struct.s33* byval %s)
-// AAPCS: define arm_aapcscc void @f33(%struct.s33* byval %s)
+// APCS-GNU-LABEL: define void @f33(%struct.s33* byval %s)
+// AAPCS-LABEL: define arm_aapcscc void @f33(%struct.s33* byval %s)
// PR14048
struct s34 { char c; };
@@ -209,14 +209,14 @@ float32x4_t f35(int i, s35_with_align s1, s35_with_align s2) {
*(float32x4_t *)&s2);
return v;
}
-// APCS-GNU: define <4 x float> @f35(i32 %i, %struct.s35* byval, %struct.s35* byval)
+// APCS-GNU-LABEL: define <4 x float> @f35(i32 %i, %struct.s35* byval, %struct.s35* byval)
// APCS-GNU: %[[a:.*]] = alloca %struct.s35, align 16
// APCS-GNU: %[[b:.*]] = bitcast %struct.s35* %[[a]] to i8*
// APCS-GNU: %[[c:.*]] = bitcast %struct.s35* %0 to i8*
// APCS-GNU: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[b]], i8* %[[c]]
// APCS-GNU: %[[d:.*]] = bitcast %struct.s35* %[[a]] to <4 x float>*
// APCS-GNU: load <4 x float>* %[[d]], align 16
-// AAPCS: define arm_aapcscc <4 x float> @f35(i32 %i, %struct.s35* byval, %struct.s35* byval)
+// AAPCS-LABEL: define arm_aapcscc <4 x float> @f35(i32 %i, %struct.s35* byval, %struct.s35* byval)
// AAPCS: %[[a:.*]] = alloca %struct.s35, align 16
// AAPCS: %[[b:.*]] = bitcast %struct.s35* %[[a]] to i8*
// AAPCS: %[[c:.*]] = bitcast %struct.s35* %0 to i8*
diff --git a/test/CodeGen/arm-asm-diag.c b/test/CodeGen/arm-asm-diag.c
index eea7920b1062..944a271e6cba 100644
--- a/test/CodeGen/arm-asm-diag.c
+++ b/test/CodeGen/arm-asm-diag.c
@@ -1,5 +1,5 @@
// REQUIRES: arm-registered-target
-// RUN: %clang_cc1 -triple armv7 %s -S -o /dev/null 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple armv7 -target-feature +neon %s -S -o /dev/null 2>&1 | FileCheck %s
// rdar://13446483
typedef __attribute__((neon_vector_type(2))) long long int64x2_t;
@@ -9,10 +9,10 @@ typedef struct int64x2x4_t {
int64x2x4_t t1(const long long a[]) {
int64x2x4_t r;
__asm__("vldm %[a], { %q[r0], %q[r1], %q[r2], %q[r3] }"
- : [r0] "=r"(r.val[0]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
- [r1] "=r"(r.val[1]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
- [r2] "=r"(r.val[2]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
- [r3] "=r"(r.val[3]) // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
+ : [r0] "=r"(r.val[0]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+ [r1] "=r"(r.val[1]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+ [r2] "=r"(r.val[2]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+ [r3] "=r"(r.val[3]) // expected-warning {{value size does not match register size specified by the constraint and modifier}}
: [a] "r"(a));
return r;
}
diff --git a/test/CodeGen/arm-asm-warn.c b/test/CodeGen/arm-asm-warn.c
index 9b52dd695a51..a580700661e4 100644
--- a/test/CodeGen/arm-asm-warn.c
+++ b/test/CodeGen/arm-asm-warn.c
@@ -1,5 +1,5 @@
// REQUIRES: arm-registered-target
-// RUN: %clang_cc1 -triple armv7 %s -emit-llvm -o /dev/null
+// RUN: %clang_cc1 -triple armv7 -target-feature +neon %s -emit-llvm -o /dev/null
char bar();
@@ -12,6 +12,7 @@ void t1(int x, char y) {
: "+r" (x),
"+r" (y)
:);
+ __asm__ volatile("ldrb %0, [%1]" : "=r" (y) : "r" (x)); // no warning
}
// <rdar://problem/12284092>
@@ -22,10 +23,10 @@ typedef struct int64x2x4_t {
int64x2x4_t t2(const long long a[]) {
int64x2x4_t r;
__asm__("vldm %[a], { %q[r0], %q[r1], %q[r2], %q[r3] }"
- : [r0] "=r"(r.val[0]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
- [r1] "=r"(r.val[1]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
- [r2] "=r"(r.val[2]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
- [r3] "=r"(r.val[3]) // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
+ : [r0] "=r"(r.val[0]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+ [r1] "=r"(r.val[1]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+ [r2] "=r"(r.val[2]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+ [r3] "=r"(r.val[3]) // expected-warning {{value size does not match register size specified by the constraint and modifier}}
: [a] "r"(a));
return r;
}
diff --git a/test/CodeGen/arm-cc.c b/test/CodeGen/arm-cc.c
index 80ebe687c11b..8e6aae78b66d 100644
--- a/test/CodeGen/arm-cc.c
+++ b/test/CodeGen/arm-cc.c
@@ -5,13 +5,13 @@
// RUN: %clang_cc1 -triple arm-none-linux-gnueabi -target-abi aapcs -emit-llvm -w -o - %s | FileCheck -check-prefix=LINUX-AAPCS %s
-// DARWIN-APCS: define void @f()
+// DARWIN-APCS-LABEL: define void @f()
// DARWIN-APCS: call void @g
-// DARWIN-AAPCS: define arm_aapcscc void @f()
+// DARWIN-AAPCS-LABEL: define arm_aapcscc void @f()
// DARWIN-AAPCS: call arm_aapcscc void @g
-// LINUX-APCS: define arm_apcscc void @f()
+// LINUX-APCS-LABEL: define arm_apcscc void @f()
// LINUX-APCS: call arm_apcscc void @g
-// LINUX-AAPCS: define void @f()
+// LINUX-AAPCS-LABEL: define void @f()
// LINUX-AAPCS: call void @g
void g(void);
void f(void) {
diff --git a/test/CodeGen/arm-clear.c b/test/CodeGen/arm-clear.c
index 51506dfed10d..8ef3675641f8 100644
--- a/test/CodeGen/arm-clear.c
+++ b/test/CodeGen/arm-clear.c
@@ -1,21 +1,8 @@
// REQUIRES: arm-registered-target
// RUN: %clang_cc1 -triple armv7-apple-darwin9 -emit-llvm -w -o - %s | FileCheck %s
-void clear0(void *ptr) {
- // CHECK: clear0
- // CHECK-NOT: load i8**
- __clear_cache();
-}
-
-void clear1(void *ptr) {
- // CHECK: clear1
- // CHECK: load i8**
- // CHECK-NOT: load i8**
- __clear_cache(ptr);
-}
-
-void clear2(void *ptr, void *ptr2) {
- // CHECK: clear2
+void clear(void *ptr, void *ptr2) {
+ // CHECK: clear
// CHECK: load i8**
// CHECK: load i8**
__clear_cache(ptr, ptr2);
diff --git a/test/CodeGen/arm-crc32.c b/test/CodeGen/arm-crc32.c
new file mode 100644
index 000000000000..d49f20eac74c
--- /dev/null
+++ b/test/CodeGen/arm-crc32.c
@@ -0,0 +1,63 @@
+// REQUIRES: arm-registered-target
+// RUN: %clang_cc1 -triple armv8-none-linux-gnueabi \
+// RUN: -O3 -S -emit-llvm -o - %s | FileCheck %s
+
+int crc32b(int a, char b)
+{
+ return __builtin_arm_crc32b(a,b);
+// CHECK: [[T0:%[0-9]+]] = zext i8 %b to i32
+// CHECK: call i32 @llvm.arm.crc32b(i32 %a, i32 [[T0]])
+}
+
+int crc32cb(int a, char b)
+{
+ return __builtin_arm_crc32cb(a,b);
+// CHECK: [[T0:%[0-9]+]] = zext i8 %b to i32
+// CHECK: call i32 @llvm.arm.crc32cb(i32 %a, i32 [[T0]])
+}
+
+int crc32h(int a, short b)
+{
+ return __builtin_arm_crc32h(a,b);
+// CHECK: [[T0:%[0-9]+]] = zext i16 %b to i32
+// CHECK: call i32 @llvm.arm.crc32h(i32 %a, i32 [[T0]])
+}
+
+int crc32ch(int a, short b)
+{
+ return __builtin_arm_crc32ch(a,b);
+// CHECK: [[T0:%[0-9]+]] = zext i16 %b to i32
+// CHECK: call i32 @llvm.arm.crc32ch(i32 %a, i32 [[T0]])
+}
+
+int crc32w(int a, int b)
+{
+ return __builtin_arm_crc32w(a,b);
+// CHECK: call i32 @llvm.arm.crc32w(i32 %a, i32 %b)
+}
+
+int crc32cw(int a, int b)
+{
+ return __builtin_arm_crc32cw(a,b);
+// CHECK: call i32 @llvm.arm.crc32cw(i32 %a, i32 %b)
+}
+
+int crc32d(int a, long long b)
+{
+ return __builtin_arm_crc32d(a,b);
+// CHECK: [[T0:%[0-9]+]] = trunc i64 %b to i32
+// CHECK: [[T1:%[0-9]+]] = lshr i64 %b, 32
+// CHECK: [[T2:%[0-9]+]] = trunc i64 [[T1]] to i32
+// CHECK: [[T3:%[0-9]+]] = tail call i32 @llvm.arm.crc32w(i32 %a, i32 [[T0]])
+// CHECK: call i32 @llvm.arm.crc32w(i32 [[T3]], i32 [[T2]])
+}
+
+int crc32cd(int a, long long b)
+{
+ return __builtin_arm_crc32cd(a,b);
+// CHECK: [[T0:%[0-9]+]] = trunc i64 %b to i32
+// CHECK: [[T1:%[0-9]+]] = lshr i64 %b, 32
+// CHECK: [[T2:%[0-9]+]] = trunc i64 [[T1]] to i32
+// CHECK: [[T3:%[0-9]+]] = tail call i32 @llvm.arm.crc32cw(i32 %a, i32 [[T0]])
+// CHECK: call i32 @llvm.arm.crc32cw(i32 [[T3]], i32 [[T2]])
+}
diff --git a/test/CodeGen/arm-interrupt-attr.c b/test/CodeGen/arm-interrupt-attr.c
new file mode 100644
index 000000000000..73f1cfee0502
--- /dev/null
+++ b/test/CodeGen/arm-interrupt-attr.c
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple thumb-apple-darwin -target-abi aapcs -target-cpu cortex-m3 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm-apple-darwin -target-abi apcs-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-APCS
+
+__attribute__((interrupt)) void test_generic_interrupt() {
+ // CHECK: define arm_aapcscc void @test_generic_interrupt() [[GENERIC_ATTR:#[0-9]+]]
+
+ // CHECK-APCS: define void @test_generic_interrupt() [[GENERIC_ATTR:#[0-9]+]]
+}
+
+__attribute__((interrupt("IRQ"))) void test_irq_interrupt() {
+ // CHECK: define arm_aapcscc void @test_irq_interrupt() [[IRQ_ATTR:#[0-9]+]]
+}
+
+__attribute__((interrupt("FIQ"))) void test_fiq_interrupt() {
+ // CHECK: define arm_aapcscc void @test_fiq_interrupt() [[FIQ_ATTR:#[0-9]+]]
+}
+
+__attribute__((interrupt("SWI"))) void test_swi_interrupt() {
+ // CHECK: define arm_aapcscc void @test_swi_interrupt() [[SWI_ATTR:#[0-9]+]]
+}
+
+__attribute__((interrupt("ABORT"))) void test_abort_interrupt() {
+ // CHECK: define arm_aapcscc void @test_abort_interrupt() [[ABORT_ATTR:#[0-9]+]]
+}
+
+
+__attribute__((interrupt("UNDEF"))) void test_undef_interrupt() {
+ // CHECK: define arm_aapcscc void @test_undef_interrupt() [[UNDEF_ATTR:#[0-9]+]]
+}
+
+// CHECK: attributes [[GENERIC_ATTR]] = { nounwind alignstack=8 {{"interrupt"[^=]}}
+// CHECK: attributes [[IRQ_ATTR]] = { nounwind alignstack=8 "interrupt"="IRQ"
+// CHECK: attributes [[FIQ_ATTR]] = { nounwind alignstack=8 "interrupt"="FIQ"
+// CHECK: attributes [[SWI_ATTR]] = { nounwind alignstack=8 "interrupt"="SWI"
+// CHECK: attributes [[ABORT_ATTR]] = { nounwind alignstack=8 "interrupt"="ABORT"
+// CHECK: attributes [[UNDEF_ATTR]] = { nounwind alignstack=8 "interrupt"="UNDEF"
+
+// CHECK-APCS: attributes [[GENERIC_ATTR]] = { nounwind "interrupt"
diff --git a/test/CodeGen/arm-neon-shifts.c b/test/CodeGen/arm-neon-shifts.c
new file mode 100644
index 000000000000..7acfb894e976
--- /dev/null
+++ b/test/CodeGen/arm-neon-shifts.c
@@ -0,0 +1,45 @@
+// REQUIRES: arm-registered-target
+// RUN: %clang_cc1 -triple thumbv7-apple-darwin \
+// RUN: -target-cpu cortex-a8 \
+// RUN: -ffreestanding \
+// RUN: -emit-llvm -w -O1 -o - %s | FileCheck %s
+
+#include <arm_neon.h>
+
+uint8x8_t test_shift_vshr(uint8x8_t a) {
+ // CHECK-LABEL: test_shift_vshr
+ // CHECK: %{{.*}} = lshr <8 x i8> %a, <i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5>
+ return vshr_n_u8(a, 5);
+}
+
+int8x8_t test_shift_vshr_smax(int8x8_t a) {
+ // CHECK-LABEL: test_shift_vshr_smax
+ // CHECK: %{{.*}} = ashr <8 x i8> %a, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
+ return vshr_n_s8(a, 8);
+}
+
+uint8x8_t test_shift_vshr_umax(uint8x8_t a) {
+ // CHECK-LABEL: test_shift_vshr_umax
+ // CHECK: ret <8 x i8> zeroinitializer
+ return vshr_n_u8(a, 8);
+}
+
+uint8x8_t test_shift_vsra(uint8x8_t a, uint8x8_t b) {
+ // CHECK-LABEL: test_shift_vsra
+ // CHECK: %[[SHR:.*]] = lshr <8 x i8> %b, <i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5>
+ // CHECK: %{{.*}} = add <8 x i8> %[[SHR]], %a
+ return vsra_n_u8(a, b, 5);
+}
+
+int8x8_t test_shift_vsra_smax(int8x8_t a, int8x8_t b) {
+ // CHECK-LABEL: test_shift_vsra_smax
+ // CHECK: %[[SHR:.*]] = ashr <8 x i8> %b, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
+ // CHECK: %{{.*}} = add <8 x i8> %[[SHR]], %a
+ return vsra_n_s8(a, b, 8);
+}
+
+uint8x8_t test_shift_vsra_umax(uint8x8_t a, uint8x8_t b) {
+ // CHECK-LABEL: test_shift_vsra_umax
+ // CHECK: ret <8 x i8> %a
+ return vsra_n_u8(a, b, 8);
+}
diff --git a/test/CodeGen/arm-neon-vget.c b/test/CodeGen/arm-neon-vget.c
new file mode 100644
index 000000000000..4a710a2ad8e4
--- /dev/null
+++ b/test/CodeGen/arm-neon-vget.c
@@ -0,0 +1,124 @@
+// REQUIRES: arm-registered-target
+// RUN: %clang_cc1 -triple thumbv7-apple-darwin \
+// RUN: -target-abi apcs-gnu \
+// RUN: -target-cpu cortex-a8 \
+// RUN: -mfloat-abi soft \
+// RUN: -target-feature +soft-float-abi \
+// RUN: -ffreestanding \
+// RUN: -emit-llvm -w -O1 -o - %s | FileCheck %s
+
+#include <arm_neon.h>
+
+// Check that the vget_low/vget_high intrinsics generate a single shuffle
+// without any bitcasting.
+int8x8_t low_s8(int8x16_t a) {
+// CHECK: shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+ return vget_low_s8(a);
+}
+
+uint8x8_t low_u8 (uint8x16_t a) {
+// CHECK: shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+ return vget_low_u8(a);
+}
+
+int16x4_t low_s16( int16x8_t a) {
+// CHECK: shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
+ return vget_low_s16(a);
+}
+
+uint16x4_t low_u16(uint16x8_t a) {
+// CHECK: shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
+ return vget_low_u16(a);
+}
+
+int32x2_t low_s32( int32x4_t a) {
+// CHECK: shufflevector <4 x i32> %a, <4 x i32> undef, <2 x i32> <i32 0, i32 1>
+ return vget_low_s32(a);
+}
+
+uint32x2_t low_u32(uint32x4_t a) {
+// CHECK: shufflevector <4 x i32> %a, <4 x i32> undef, <2 x i32> <i32 0, i32 1>
+ return vget_low_u32(a);
+}
+
+int64x1_t low_s64( int64x2_t a) {
+// CHECK: shufflevector <2 x i64> %a, <2 x i64> undef, <1 x i32> zeroinitializer
+ return vget_low_s64(a);
+}
+
+uint64x1_t low_u64(uint64x2_t a) {
+// CHECK: shufflevector <2 x i64> %a, <2 x i64> undef, <1 x i32> zeroinitializer
+ return vget_low_u64(a);
+}
+
+poly8x8_t low_p8 (poly8x16_t a) {
+// CHECK: shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
+ return vget_low_p8(a);
+}
+
+poly16x4_t low_p16(poly16x8_t a) {
+// CHECK: shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
+ return vget_low_p16(a);
+}
+
+float32x2_t low_f32(float32x4_t a) {
+// CHECK: shufflevector <4 x float> %a, <4 x float> undef, <2 x i32> <i32 0, i32 1>
+ return vget_low_f32(a);
+}
+
+
+int8x8_t high_s8(int8x16_t a) {
+// CHECK: shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
+ return vget_high_s8(a);
+}
+
+uint8x8_t high_u8 (uint8x16_t a) {
+// CHECK: shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
+ return vget_high_u8(a);
+}
+
+int16x4_t high_s16( int16x8_t a) {
+// CHECK: shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
+ return vget_high_s16(a);
+}
+
+uint16x4_t high_u16(uint16x8_t a) {
+// CHECK: shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
+ return vget_high_u16(a);
+}
+
+int32x2_t high_s32( int32x4_t a) {
+// CHECK: shufflevector <4 x i32> %a, <4 x i32> undef, <2 x i32> <i32 2, i32 3>
+ return vget_high_s32(a);
+}
+
+uint32x2_t high_u32(uint32x4_t a) {
+// CHECK: shufflevector <4 x i32> %a, <4 x i32> undef, <2 x i32> <i32 2, i32 3>
+ return vget_high_u32(a);
+}
+
+int64x1_t high_s64( int64x2_t a) {
+// CHECK: shufflevector <2 x i64> %a, <2 x i64> undef, <1 x i32> <i32 1>
+ return vget_high_s64(a);
+}
+
+uint64x1_t high_u64(uint64x2_t a) {
+// CHECK: shufflevector <2 x i64> %a, <2 x i64> undef, <1 x i32> <i32 1>
+ return vget_high_u64(a);
+}
+
+poly8x8_t high_p8 (poly8x16_t a) {
+// CHECK: shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
+ return vget_high_p8(a);
+}
+
+poly16x4_t high_p16(poly16x8_t a) {
+// CHECK: shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
+ return vget_high_p16(a);
+}
+
+float32x2_t high_f32(float32x4_t a) {
+// CHECK: shufflevector <4 x float> %a, <4 x float> undef, <2 x i32> <i32 2, i32 3>
+ return vget_high_f32(a);
+}
+
diff --git a/test/CodeGen/arm-pcs.c b/test/CodeGen/arm-pcs.c
index fc658c3bef6f..269f01e77de1 100644
--- a/test/CodeGen/arm-pcs.c
+++ b/test/CodeGen/arm-pcs.c
@@ -6,7 +6,7 @@ typedef int __attribute__((pcs("aapcs-vfp"))) (*aapcs_vfp_fn)(void);
aapcs_fn bar;
int foo(aapcs_vfp_fn baz) {
-// CHECK: define i32 @foo
+// CHECK-LABEL: define i32 @foo
// CHECK: call arm_aapcscc
// CHECK: call arm_aapcs_vfpcc
return bar() + baz();
diff --git a/test/CodeGen/arm-pnaclcall.c b/test/CodeGen/arm-pnaclcall.c
index 50259957eb15..2faac1c676b9 100644
--- a/test/CodeGen/arm-pnaclcall.c
+++ b/test/CodeGen/arm-pnaclcall.c
@@ -9,10 +9,10 @@ typedef struct {
int a;
int b;
} s1;
-// CHECK: define i32 @f48(%struct.s1* byval %s)
+// CHECK-LABEL: define i32 @f48(%struct.s1* byval %s)
int __attribute__((pnaclcall)) f48(s1 s) { return s.a; }
-// CHECK: define void @f49(%struct.s1* noalias sret %agg.result)
+// CHECK-LABEL: define void @f49(%struct.s1* noalias sret %agg.result)
s1 __attribute__((pnaclcall)) f49() { s1 s; s.a = s.b = 1; return s; }
union simple_union {
@@ -20,7 +20,7 @@ union simple_union {
char b;
};
// Unions should be passed as byval structs
-// CHECK: define void @f50(%union.simple_union* byval %s)
+// CHECK-LABEL: define void @f50(%union.simple_union* byval %s)
void __attribute__((pnaclcall)) f50(union simple_union s) {}
typedef struct {
@@ -29,5 +29,5 @@ typedef struct {
int b8 : 8;
} bitfield1;
// Bitfields should be passed as byval structs
-// CHECK: define void @f51(%struct.bitfield1* byval %bf1)
+// CHECK-LABEL: define void @f51(%struct.bitfield1* byval %bf1)
void __attribute__((pnaclcall)) f51(bitfield1 bf1) {}
diff --git a/test/CodeGen/arm_neon_intrinsics.c b/test/CodeGen/arm_neon_intrinsics.c
new file mode 100644
index 000000000000..1d76e8a57546
--- /dev/null
+++ b/test/CodeGen/arm_neon_intrinsics.c
@@ -0,0 +1,11636 @@
+// RUN: %clang_cc1 -triple thumbv7s-apple-darwin -target-abi apcs-gnu\
+// RUN: -target-cpu swift -ffreestanding -Os -S -o - %s\
+// RUN: | FileCheck %s
+
+// REQUIRES: long_tests
+
+#include <arm_neon.h>
+
+// CHECK: test_vaba_s8
+// CHECK: vaba.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vaba_s8(int8x8_t a, int8x8_t b, int8x8_t c) {
+ return vaba_s8(a, b, c);
+}
+
+// CHECK: test_vaba_s16
+// CHECK: vaba.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vaba_s16(int16x4_t a, int16x4_t b, int16x4_t c) {
+ return vaba_s16(a, b, c);
+}
+
+// CHECK: test_vaba_s32
+// CHECK: vaba.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vaba_s32(int32x2_t a, int32x2_t b, int32x2_t c) {
+ return vaba_s32(a, b, c);
+}
+
+// CHECK: test_vaba_u8
+// CHECK: vaba.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vaba_u8(uint8x8_t a, uint8x8_t b, uint8x8_t c) {
+ return vaba_u8(a, b, c);
+}
+
+// CHECK: test_vaba_u16
+// CHECK: vaba.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vaba_u16(uint16x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vaba_u16(a, b, c);
+}
+
+// CHECK: test_vaba_u32
+// CHECK: vaba.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vaba_u32(uint32x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vaba_u32(a, b, c);
+}
+
+// CHECK: test_vabaq_s8
+// CHECK: vaba.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vabaq_s8(int8x16_t a, int8x16_t b, int8x16_t c) {
+ return vabaq_s8(a, b, c);
+}
+
+// CHECK: test_vabaq_s16
+// CHECK: vaba.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vabaq_s16(int16x8_t a, int16x8_t b, int16x8_t c) {
+ return vabaq_s16(a, b, c);
+}
+
+// CHECK: test_vabaq_s32
+// CHECK: vaba.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vabaq_s32(int32x4_t a, int32x4_t b, int32x4_t c) {
+ return vabaq_s32(a, b, c);
+}
+
+// CHECK: test_vabaq_u8
+// CHECK: vaba.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vabaq_u8(uint8x16_t a, uint8x16_t b, uint8x16_t c) {
+ return vabaq_u8(a, b, c);
+}
+
+// CHECK: test_vabaq_u16
+// CHECK: vaba.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vabaq_u16(uint16x8_t a, uint16x8_t b, uint16x8_t c) {
+ return vabaq_u16(a, b, c);
+}
+
+// CHECK: test_vabaq_u32
+// CHECK: vaba.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vabaq_u32(uint32x4_t a, uint32x4_t b, uint32x4_t c) {
+ return vabaq_u32(a, b, c);
+}
+
+
+// CHECK: test_vabal_s8
+// CHECK: vabal.s8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x8_t test_vabal_s8(int16x8_t a, int8x8_t b, int8x8_t c) {
+ return vabal_s8(a, b, c);
+}
+
+// CHECK: test_vabal_s16
+// CHECK: vabal.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vabal_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ return vabal_s16(a, b, c);
+}
+
+// CHECK: test_vabal_s32
+// CHECK: vabal.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vabal_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ return vabal_s32(a, b, c);
+}
+
+// CHECK: test_vabal_u8
+// CHECK: vabal.u8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x8_t test_vabal_u8(uint16x8_t a, uint8x8_t b, uint8x8_t c) {
+ return vabal_u8(a, b, c);
+}
+
+// CHECK: test_vabal_u16
+// CHECK: vabal.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vabal_u16(uint32x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vabal_u16(a, b, c);
+}
+
+// CHECK: test_vabal_u32
+// CHECK: vabal.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vabal_u32(uint64x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vabal_u32(a, b, c);
+}
+
+
+// CHECK: test_vabd_s8
+// CHECK: vabd.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vabd_s8(int8x8_t a, int8x8_t b) {
+ return vabd_s8(a, b);
+}
+
+// CHECK: test_vabd_s16
+// CHECK: vabd.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vabd_s16(int16x4_t a, int16x4_t b) {
+ return vabd_s16(a, b);
+}
+
+// CHECK: test_vabd_s32
+// CHECK: vabd.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vabd_s32(int32x2_t a, int32x2_t b) {
+ return vabd_s32(a, b);
+}
+
+// CHECK: test_vabd_u8
+// CHECK: vabd.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vabd_u8(uint8x8_t a, uint8x8_t b) {
+ return vabd_u8(a, b);
+}
+
+// CHECK: test_vabd_u16
+// CHECK: vabd.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vabd_u16(uint16x4_t a, uint16x4_t b) {
+ return vabd_u16(a, b);
+}
+
+// CHECK: test_vabd_u32
+// CHECK: vabd.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vabd_u32(uint32x2_t a, uint32x2_t b) {
+ return vabd_u32(a, b);
+}
+
+// CHECK: test_vabd_f32
+// CHECK: vabd.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vabd_f32(float32x2_t a, float32x2_t b) {
+ return vabd_f32(a, b);
+}
+
+// CHECK: test_vabdq_s8
+// CHECK: vabd.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vabdq_s8(int8x16_t a, int8x16_t b) {
+ return vabdq_s8(a, b);
+}
+
+// CHECK: test_vabdq_s16
+// CHECK: vabd.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vabdq_s16(int16x8_t a, int16x8_t b) {
+ return vabdq_s16(a, b);
+}
+
+// CHECK: test_vabdq_s32
+// CHECK: vabd.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vabdq_s32(int32x4_t a, int32x4_t b) {
+ return vabdq_s32(a, b);
+}
+
+// CHECK: test_vabdq_u8
+// CHECK: vabd.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vabdq_u8(uint8x16_t a, uint8x16_t b) {
+ return vabdq_u8(a, b);
+}
+
+// CHECK: test_vabdq_u16
+// CHECK: vabd.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vabdq_u16(uint16x8_t a, uint16x8_t b) {
+ return vabdq_u16(a, b);
+}
+
+// CHECK: test_vabdq_u32
+// CHECK: vabd.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vabdq_u32(uint32x4_t a, uint32x4_t b) {
+ return vabdq_u32(a, b);
+}
+
+// CHECK: test_vabdq_f32
+// CHECK: vabd.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vabdq_f32(float32x4_t a, float32x4_t b) {
+ return vabdq_f32(a, b);
+}
+
+
+// CHECK: test_vabdl_s8
+// CHECK: vabdl.s8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x8_t test_vabdl_s8(int8x8_t a, int8x8_t b) {
+ return vabdl_s8(a, b);
+}
+
+// CHECK: test_vabdl_s16
+// CHECK: vabdl.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vabdl_s16(int16x4_t a, int16x4_t b) {
+ return vabdl_s16(a, b);
+}
+
+// CHECK: test_vabdl_s32
+// CHECK: vabdl.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vabdl_s32(int32x2_t a, int32x2_t b) {
+ return vabdl_s32(a, b);
+}
+
+// CHECK: test_vabdl_u8
+// CHECK: vabdl.u8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x8_t test_vabdl_u8(uint8x8_t a, uint8x8_t b) {
+ return vabdl_u8(a, b);
+}
+
+// CHECK: test_vabdl_u16
+// CHECK: vabdl.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vabdl_u16(uint16x4_t a, uint16x4_t b) {
+ return vabdl_u16(a, b);
+}
+
+// CHECK: test_vabdl_u32
+// CHECK: vabdl.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vabdl_u32(uint32x2_t a, uint32x2_t b) {
+ return vabdl_u32(a, b);
+}
+
+
+// CHECK: test_vabs_s8
+// CHECK: vabs.s8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vabs_s8(int8x8_t a) {
+ return vabs_s8(a);
+}
+
+// CHECK: test_vabs_s16
+// CHECK: vabs.s16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vabs_s16(int16x4_t a) {
+ return vabs_s16(a);
+}
+
+// CHECK: test_vabs_s32
+// CHECK: vabs.s32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vabs_s32(int32x2_t a) {
+ return vabs_s32(a);
+}
+
+// CHECK: test_vabs_f32
+// CHECK: vabs.f32 d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vabs_f32(float32x2_t a) {
+ return vabs_f32(a);
+}
+
+// CHECK: test_vabsq_s8
+// CHECK: vabs.s8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vabsq_s8(int8x16_t a) {
+ return vabsq_s8(a);
+}
+
+// CHECK: test_vabsq_s16
+// CHECK: vabs.s16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vabsq_s16(int16x8_t a) {
+ return vabsq_s16(a);
+}
+
+// CHECK: test_vabsq_s32
+// CHECK: vabs.s32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vabsq_s32(int32x4_t a) {
+ return vabsq_s32(a);
+}
+
+// CHECK: test_vabsq_f32
+// CHECK: vabs.f32 q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vabsq_f32(float32x4_t a) {
+ return vabsq_f32(a);
+}
+
+
+// CHECK: test_vadd_s8
+// CHECK: vadd.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vadd_s8(int8x8_t a, int8x8_t b) {
+ return vadd_s8(a, b);
+}
+
+// CHECK: test_vadd_s16
+// CHECK: vadd.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vadd_s16(int16x4_t a, int16x4_t b) {
+ return vadd_s16(a, b);
+}
+
+// CHECK: test_vadd_s32
+// CHECK: vadd.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vadd_s32(int32x2_t a, int32x2_t b) {
+ return vadd_s32(a, b);
+}
+
+// CHECK: test_vadd_s64
+// CHECK: vadd.i64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vadd_s64(int64x1_t a, int64x1_t b) {
+ return vadd_s64(a, b);
+}
+
+// CHECK: test_vadd_f32
+// CHECK: vadd.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vadd_f32(float32x2_t a, float32x2_t b) {
+ return vadd_f32(a, b);
+}
+
+// CHECK: test_vadd_u8
+// CHECK: vadd.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vadd_u8(uint8x8_t a, uint8x8_t b) {
+ return vadd_u8(a, b);
+}
+
+// CHECK: test_vadd_u16
+// CHECK: vadd.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vadd_u16(uint16x4_t a, uint16x4_t b) {
+ return vadd_u16(a, b);
+}
+
+// CHECK: test_vadd_u32
+// CHECK: vadd.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vadd_u32(uint32x2_t a, uint32x2_t b) {
+ return vadd_u32(a, b);
+}
+
+// CHECK: test_vadd_u64
+// CHECK: vadd.i64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vadd_u64(uint64x1_t a, uint64x1_t b) {
+ return vadd_u64(a, b);
+}
+
+// CHECK: test_vaddq_s8
+// CHECK: vadd.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vaddq_s8(int8x16_t a, int8x16_t b) {
+ return vaddq_s8(a, b);
+}
+
+// CHECK: test_vaddq_s16
+// CHECK: vadd.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vaddq_s16(int16x8_t a, int16x8_t b) {
+ return vaddq_s16(a, b);
+}
+
+// CHECK: test_vaddq_s32
+// CHECK: vadd.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vaddq_s32(int32x4_t a, int32x4_t b) {
+ return vaddq_s32(a, b);
+}
+
+// CHECK: test_vaddq_s64
+// CHECK: vadd.i64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vaddq_s64(int64x2_t a, int64x2_t b) {
+ return vaddq_s64(a, b);
+}
+
+// CHECK: test_vaddq_f32
+// CHECK: vadd.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vaddq_f32(float32x4_t a, float32x4_t b) {
+ return vaddq_f32(a, b);
+}
+
+// CHECK: test_vaddq_u8
+// CHECK: vadd.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vaddq_u8(uint8x16_t a, uint8x16_t b) {
+ return vaddq_u8(a, b);
+}
+
+// CHECK: test_vaddq_u16
+// CHECK: vadd.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vaddq_u16(uint16x8_t a, uint16x8_t b) {
+ return vaddq_u16(a, b);
+}
+
+// CHECK: test_vaddq_u32
+// CHECK: vadd.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vaddq_u32(uint32x4_t a, uint32x4_t b) {
+ return vaddq_u32(a, b);
+}
+
+// CHECK: test_vaddq_u64
+// CHECK: vadd.i64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vaddq_u64(uint64x2_t a, uint64x2_t b) {
+ return vaddq_u64(a, b);
+}
+
+
+// CHECK: test_vaddhn_s16
+// CHECK: vaddhn.i16 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x8_t test_vaddhn_s16(int16x8_t a, int16x8_t b) {
+ return vaddhn_s16(a, b);
+}
+
+// CHECK: test_vaddhn_s32
+// CHECK: vaddhn.i32 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x4_t test_vaddhn_s32(int32x4_t a, int32x4_t b) {
+ return vaddhn_s32(a, b);
+}
+
+// CHECK: test_vaddhn_s64
+// CHECK: vaddhn.i64 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x2_t test_vaddhn_s64(int64x2_t a, int64x2_t b) {
+ return vaddhn_s64(a, b);
+}
+
+// CHECK: test_vaddhn_u16
+// CHECK: vaddhn.i16 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x8_t test_vaddhn_u16(uint16x8_t a, uint16x8_t b) {
+ return vaddhn_u16(a, b);
+}
+
+// CHECK: test_vaddhn_u32
+// CHECK: vaddhn.i32 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x4_t test_vaddhn_u32(uint32x4_t a, uint32x4_t b) {
+ return vaddhn_u32(a, b);
+}
+
+// CHECK: test_vaddhn_u64
+// CHECK: vaddhn.i64 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x2_t test_vaddhn_u64(uint64x2_t a, uint64x2_t b) {
+ return vaddhn_u64(a, b);
+}
+
+
+// CHECK: test_vaddl_s8
+// CHECK: vaddl.s8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x8_t test_vaddl_s8(int8x8_t a, int8x8_t b) {
+ return vaddl_s8(a, b);
+}
+
+// CHECK: test_vaddl_s16
+// CHECK: vaddl.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vaddl_s16(int16x4_t a, int16x4_t b) {
+ return vaddl_s16(a, b);
+}
+
+// CHECK: test_vaddl_s32
+// CHECK: vaddl.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vaddl_s32(int32x2_t a, int32x2_t b) {
+ return vaddl_s32(a, b);
+}
+
+// CHECK: test_vaddl_u8
+// CHECK: vaddl.u8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x8_t test_vaddl_u8(uint8x8_t a, uint8x8_t b) {
+ return vaddl_u8(a, b);
+}
+
+// CHECK: test_vaddl_u16
+// CHECK: vaddl.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vaddl_u16(uint16x4_t a, uint16x4_t b) {
+ return vaddl_u16(a, b);
+}
+
+// CHECK: test_vaddl_u32
+// CHECK: vaddl.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vaddl_u32(uint32x2_t a, uint32x2_t b) {
+ return vaddl_u32(a, b);
+}
+
+
+// CHECK: test_vaddw_s8
+// CHECK: vaddw.s8 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+int16x8_t test_vaddw_s8(int16x8_t a, int8x8_t b) {
+ return vaddw_s8(a, b);
+}
+
+// CHECK: test_vaddw_s16
+// CHECK: vaddw.s16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vaddw_s16(int32x4_t a, int16x4_t b) {
+ return vaddw_s16(a, b);
+}
+
+// CHECK: test_vaddw_s32
+// CHECK: vaddw.s32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vaddw_s32(int64x2_t a, int32x2_t b) {
+ return vaddw_s32(a, b);
+}
+
+// CHECK: test_vaddw_u8
+// CHECK: vaddw.u8 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+uint16x8_t test_vaddw_u8(uint16x8_t a, uint8x8_t b) {
+ return vaddw_u8(a, b);
+}
+
+// CHECK: test_vaddw_u16
+// CHECK: vaddw.u16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vaddw_u16(uint32x4_t a, uint16x4_t b) {
+ return vaddw_u16(a, b);
+}
+
+// CHECK: test_vaddw_u32
+// CHECK: vaddw.u32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vaddw_u32(uint64x2_t a, uint32x2_t b) {
+ return vaddw_u32(a, b);
+}
+
+
+// CHECK: test_vand_s8
+// CHECK: vand d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vand_s8(int8x8_t a, int8x8_t b) {
+ return vand_s8(a, b);
+}
+
+// CHECK: test_vand_s16
+// CHECK: vand d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vand_s16(int16x4_t a, int16x4_t b) {
+ return vand_s16(a, b);
+}
+
+// CHECK: test_vand_s32
+// CHECK: vand d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vand_s32(int32x2_t a, int32x2_t b) {
+ return vand_s32(a, b);
+}
+
+// CHECK: test_vand_s64
+// CHECK: vand d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vand_s64(int64x1_t a, int64x1_t b) {
+ return vand_s64(a, b);
+}
+
+// CHECK: test_vand_u8
+// CHECK: vand d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vand_u8(uint8x8_t a, uint8x8_t b) {
+ return vand_u8(a, b);
+}
+
+// CHECK: test_vand_u16
+// CHECK: vand d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vand_u16(uint16x4_t a, uint16x4_t b) {
+ return vand_u16(a, b);
+}
+
+// CHECK: test_vand_u32
+// CHECK: vand d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vand_u32(uint32x2_t a, uint32x2_t b) {
+ return vand_u32(a, b);
+}
+
+// CHECK: test_vand_u64
+// CHECK: vand d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vand_u64(uint64x1_t a, uint64x1_t b) {
+ return vand_u64(a, b);
+}
+
+// CHECK: test_vandq_s8
+// CHECK: vand q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vandq_s8(int8x16_t a, int8x16_t b) {
+ return vandq_s8(a, b);
+}
+
+// CHECK: test_vandq_s16
+// CHECK: vand q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vandq_s16(int16x8_t a, int16x8_t b) {
+ return vandq_s16(a, b);
+}
+
+// CHECK: test_vandq_s32
+// CHECK: vand q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vandq_s32(int32x4_t a, int32x4_t b) {
+ return vandq_s32(a, b);
+}
+
+// CHECK: test_vandq_s64
+// CHECK: vand q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vandq_s64(int64x2_t a, int64x2_t b) {
+ return vandq_s64(a, b);
+}
+
+// CHECK: test_vandq_u8
+// CHECK: vand q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vandq_u8(uint8x16_t a, uint8x16_t b) {
+ return vandq_u8(a, b);
+}
+
+// CHECK: test_vandq_u16
+// CHECK: vand q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vandq_u16(uint16x8_t a, uint16x8_t b) {
+ return vandq_u16(a, b);
+}
+
+// CHECK: test_vandq_u32
+// CHECK: vand q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vandq_u32(uint32x4_t a, uint32x4_t b) {
+ return vandq_u32(a, b);
+}
+
+// CHECK: test_vandq_u64
+// CHECK: vand q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vandq_u64(uint64x2_t a, uint64x2_t b) {
+ return vandq_u64(a, b);
+}
+
+
+// CHECK: test_vbic_s8
+// CHECK: vbic d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vbic_s8(int8x8_t a, int8x8_t b) {
+ return vbic_s8(a, b);
+}
+
+// CHECK: test_vbic_s16
+// CHECK: vbic d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vbic_s16(int16x4_t a, int16x4_t b) {
+ return vbic_s16(a, b);
+}
+
+// CHECK: test_vbic_s32
+// CHECK: vbic d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vbic_s32(int32x2_t a, int32x2_t b) {
+ return vbic_s32(a, b);
+}
+
+// CHECK: test_vbic_s64
+// CHECK: vbic d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vbic_s64(int64x1_t a, int64x1_t b) {
+ return vbic_s64(a, b);
+}
+
+// CHECK: test_vbic_u8
+// CHECK: vbic d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vbic_u8(uint8x8_t a, uint8x8_t b) {
+ return vbic_u8(a, b);
+}
+
+// CHECK: test_vbic_u16
+// CHECK: vbic d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vbic_u16(uint16x4_t a, uint16x4_t b) {
+ return vbic_u16(a, b);
+}
+
+// CHECK: test_vbic_u32
+// CHECK: vbic d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vbic_u32(uint32x2_t a, uint32x2_t b) {
+ return vbic_u32(a, b);
+}
+
+// CHECK: test_vbic_u64
+// CHECK: vbic d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vbic_u64(uint64x1_t a, uint64x1_t b) {
+ return vbic_u64(a, b);
+}
+
+// CHECK: test_vbicq_s8
+// CHECK: vbic q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vbicq_s8(int8x16_t a, int8x16_t b) {
+ return vbicq_s8(a, b);
+}
+
+// CHECK: test_vbicq_s16
+// CHECK: vbic q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vbicq_s16(int16x8_t a, int16x8_t b) {
+ return vbicq_s16(a, b);
+}
+
+// CHECK: test_vbicq_s32
+// CHECK: vbic q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vbicq_s32(int32x4_t a, int32x4_t b) {
+ return vbicq_s32(a, b);
+}
+
+// CHECK: test_vbicq_s64
+// CHECK: vbic q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vbicq_s64(int64x2_t a, int64x2_t b) {
+ return vbicq_s64(a, b);
+}
+
+// CHECK: test_vbicq_u8
+// CHECK: vbic q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vbicq_u8(uint8x16_t a, uint8x16_t b) {
+ return vbicq_u8(a, b);
+}
+
+// CHECK: test_vbicq_u16
+// CHECK: vbic q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vbicq_u16(uint16x8_t a, uint16x8_t b) {
+ return vbicq_u16(a, b);
+}
+
+// CHECK: test_vbicq_u32
+// CHECK: vbic q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vbicq_u32(uint32x4_t a, uint32x4_t b) {
+ return vbicq_u32(a, b);
+}
+
+// CHECK: test_vbicq_u64
+// CHECK: vbic q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vbicq_u64(uint64x2_t a, uint64x2_t b) {
+ return vbicq_u64(a, b);
+}
+
+
+// CHECK: test_vbsl_s8
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vbsl_s8(uint8x8_t a, int8x8_t b, int8x8_t c) {
+ return vbsl_s8(a, b, c);
+}
+
+// CHECK: test_vbsl_s16
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vbsl_s16(uint16x4_t a, int16x4_t b, int16x4_t c) {
+ return vbsl_s16(a, b, c);
+}
+
+// CHECK: test_vbsl_s32
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vbsl_s32(uint32x2_t a, int32x2_t b, int32x2_t c) {
+ return vbsl_s32(a, b, c);
+}
+
+// CHECK: test_vbsl_s64
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vbsl_s64(uint64x1_t a, int64x1_t b, int64x1_t c) {
+ return vbsl_s64(a, b, c);
+}
+
+// CHECK: test_vbsl_u8
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vbsl_u8(uint8x8_t a, uint8x8_t b, uint8x8_t c) {
+ return vbsl_u8(a, b, c);
+}
+
+// CHECK: test_vbsl_u16
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vbsl_u16(uint16x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vbsl_u16(a, b, c);
+}
+
+// CHECK: test_vbsl_u32
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vbsl_u32(uint32x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vbsl_u32(a, b, c);
+}
+
+// CHECK: test_vbsl_u64
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vbsl_u64(uint64x1_t a, uint64x1_t b, uint64x1_t c) {
+ return vbsl_u64(a, b, c);
+}
+
+// CHECK: test_vbsl_f32
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vbsl_f32(uint32x2_t a, float32x2_t b, float32x2_t c) {
+ return vbsl_f32(a, b, c);
+}
+
+// CHECK: test_vbsl_p8
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+poly8x8_t test_vbsl_p8(uint8x8_t a, poly8x8_t b, poly8x8_t c) {
+ return vbsl_p8(a, b, c);
+}
+
+// CHECK: test_vbsl_p16
+// CHECK: vbsl d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+poly16x4_t test_vbsl_p16(uint16x4_t a, poly16x4_t b, poly16x4_t c) {
+ return vbsl_p16(a, b, c);
+}
+
+// CHECK: test_vbslq_s8
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vbslq_s8(uint8x16_t a, int8x16_t b, int8x16_t c) {
+ return vbslq_s8(a, b, c);
+}
+
+// CHECK: test_vbslq_s16
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vbslq_s16(uint16x8_t a, int16x8_t b, int16x8_t c) {
+ return vbslq_s16(a, b, c);
+}
+
+// CHECK: test_vbslq_s32
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vbslq_s32(uint32x4_t a, int32x4_t b, int32x4_t c) {
+ return vbslq_s32(a, b, c);
+}
+
+// CHECK: test_vbslq_s64
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vbslq_s64(uint64x2_t a, int64x2_t b, int64x2_t c) {
+ return vbslq_s64(a, b, c);
+}
+
+// CHECK: test_vbslq_u8
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vbslq_u8(uint8x16_t a, uint8x16_t b, uint8x16_t c) {
+ return vbslq_u8(a, b, c);
+}
+
+// CHECK: test_vbslq_u16
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vbslq_u16(uint16x8_t a, uint16x8_t b, uint16x8_t c) {
+ return vbslq_u16(a, b, c);
+}
+
+// CHECK: test_vbslq_u32
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vbslq_u32(uint32x4_t a, uint32x4_t b, uint32x4_t c) {
+ return vbslq_u32(a, b, c);
+}
+
+// CHECK: test_vbslq_u64
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vbslq_u64(uint64x2_t a, uint64x2_t b, uint64x2_t c) {
+ return vbslq_u64(a, b, c);
+}
+
+// CHECK: test_vbslq_f32
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vbslq_f32(uint32x4_t a, float32x4_t b, float32x4_t c) {
+ return vbslq_f32(a, b, c);
+}
+
+// CHECK: test_vbslq_p8
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+poly8x16_t test_vbslq_p8(uint8x16_t a, poly8x16_t b, poly8x16_t c) {
+ return vbslq_p8(a, b, c);
+}
+
+// CHECK: test_vbslq_p16
+// CHECK: vbsl q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+poly16x8_t test_vbslq_p16(uint16x8_t a, poly16x8_t b, poly16x8_t c) {
+ return vbslq_p16(a, b, c);
+}
+
+
+// CHECK: test_vcage_f32
+// CHECK: vacge.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcage_f32(float32x2_t a, float32x2_t b) {
+ return vcage_f32(a, b);
+}
+
+// CHECK: test_vcageq_f32
+// CHECK: vacge.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcageq_f32(float32x4_t a, float32x4_t b) {
+ return vcageq_f32(a, b);
+}
+
+
+// CHECK: test_vcagt_f32
+// CHECK: vacgt.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcagt_f32(float32x2_t a, float32x2_t b) {
+ return vcagt_f32(a, b);
+}
+
+// CHECK: test_vcagtq_f32
+// CHECK: vacgt.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcagtq_f32(float32x4_t a, float32x4_t b) {
+ return vcagtq_f32(a, b);
+}
+
+
+// CHECK: test_vcale_f32
+// CHECK: vacge.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcale_f32(float32x2_t a, float32x2_t b) {
+ return vcale_f32(a, b);
+}
+
+// CHECK: test_vcaleq_f32
+// CHECK: vacge.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcaleq_f32(float32x4_t a, float32x4_t b) {
+ return vcaleq_f32(a, b);
+}
+
+
+// CHECK: test_vcalt_f32
+// CHECK: vacgt.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcalt_f32(float32x2_t a, float32x2_t b) {
+ return vcalt_f32(a, b);
+}
+
+// CHECK: test_vcaltq_f32
+// CHECK: vacgt.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcaltq_f32(float32x4_t a, float32x4_t b) {
+ return vcaltq_f32(a, b);
+}
+
+
+// CHECK: test_vceq_s8
+// CHECK: vceq.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vceq_s8(int8x8_t a, int8x8_t b) {
+ return vceq_s8(a, b);
+}
+
+// CHECK: test_vceq_s16
+// CHECK: vceq.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vceq_s16(int16x4_t a, int16x4_t b) {
+ return vceq_s16(a, b);
+}
+
+// CHECK: test_vceq_s32
+// CHECK: vceq.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vceq_s32(int32x2_t a, int32x2_t b) {
+ return vceq_s32(a, b);
+}
+
+// CHECK: test_vceq_f32
+// CHECK: vceq.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vceq_f32(float32x2_t a, float32x2_t b) {
+ return vceq_f32(a, b);
+}
+
+// CHECK: test_vceq_u8
+// CHECK: vceq.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vceq_u8(uint8x8_t a, uint8x8_t b) {
+ return vceq_u8(a, b);
+}
+
+// CHECK: test_vceq_u16
+// CHECK: vceq.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vceq_u16(uint16x4_t a, uint16x4_t b) {
+ return vceq_u16(a, b);
+}
+
+// CHECK: test_vceq_u32
+// CHECK: vceq.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vceq_u32(uint32x2_t a, uint32x2_t b) {
+ return vceq_u32(a, b);
+}
+
+// CHECK: test_vceq_p8
+// CHECK: vceq.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vceq_p8(poly8x8_t a, poly8x8_t b) {
+ return vceq_p8(a, b);
+}
+
+// CHECK: test_vceqq_s8
+// CHECK: vceq.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vceqq_s8(int8x16_t a, int8x16_t b) {
+ return vceqq_s8(a, b);
+}
+
+// CHECK: test_vceqq_s16
+// CHECK: vceq.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vceqq_s16(int16x8_t a, int16x8_t b) {
+ return vceqq_s16(a, b);
+}
+
+// CHECK: test_vceqq_s32
+// CHECK: vceq.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vceqq_s32(int32x4_t a, int32x4_t b) {
+ return vceqq_s32(a, b);
+}
+
+// CHECK: test_vceqq_f32
+// CHECK: vceq.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vceqq_f32(float32x4_t a, float32x4_t b) {
+ return vceqq_f32(a, b);
+}
+
+// CHECK: test_vceqq_u8
+// CHECK: vceq.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vceqq_u8(uint8x16_t a, uint8x16_t b) {
+ return vceqq_u8(a, b);
+}
+
+// CHECK: test_vceqq_u16
+// CHECK: vceq.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vceqq_u16(uint16x8_t a, uint16x8_t b) {
+ return vceqq_u16(a, b);
+}
+
+// CHECK: test_vceqq_u32
+// CHECK: vceq.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vceqq_u32(uint32x4_t a, uint32x4_t b) {
+ return vceqq_u32(a, b);
+}
+
+// CHECK: test_vceqq_p8
+// CHECK: vceq.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vceqq_p8(poly8x16_t a, poly8x16_t b) {
+ return vceqq_p8(a, b);
+}
+
+
+// CHECK: test_vcge_s8
+// CHECK: vcge.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vcge_s8(int8x8_t a, int8x8_t b) {
+ return vcge_s8(a, b);
+}
+
+// CHECK: test_vcge_s16
+// CHECK: vcge.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vcge_s16(int16x4_t a, int16x4_t b) {
+ return vcge_s16(a, b);
+}
+
+// CHECK: test_vcge_s32
+// CHECK: vcge.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcge_s32(int32x2_t a, int32x2_t b) {
+ return vcge_s32(a, b);
+}
+
+// CHECK: test_vcge_f32
+// CHECK: vcge.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcge_f32(float32x2_t a, float32x2_t b) {
+ return vcge_f32(a, b);
+}
+
+// CHECK: test_vcge_u8
+// CHECK: vcge.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vcge_u8(uint8x8_t a, uint8x8_t b) {
+ return vcge_u8(a, b);
+}
+
+// CHECK: test_vcge_u16
+// CHECK: vcge.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vcge_u16(uint16x4_t a, uint16x4_t b) {
+ return vcge_u16(a, b);
+}
+
+// CHECK: test_vcge_u32
+// CHECK: vcge.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcge_u32(uint32x2_t a, uint32x2_t b) {
+ return vcge_u32(a, b);
+}
+
+// CHECK: test_vcgeq_s8
+// CHECK: vcge.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vcgeq_s8(int8x16_t a, int8x16_t b) {
+ return vcgeq_s8(a, b);
+}
+
+// CHECK: test_vcgeq_s16
+// CHECK: vcge.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vcgeq_s16(int16x8_t a, int16x8_t b) {
+ return vcgeq_s16(a, b);
+}
+
+// CHECK: test_vcgeq_s32
+// CHECK: vcge.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcgeq_s32(int32x4_t a, int32x4_t b) {
+ return vcgeq_s32(a, b);
+}
+
+// CHECK: test_vcgeq_f32
+// CHECK: vcge.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcgeq_f32(float32x4_t a, float32x4_t b) {
+ return vcgeq_f32(a, b);
+}
+
+// CHECK: test_vcgeq_u8
+// CHECK: vcge.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vcgeq_u8(uint8x16_t a, uint8x16_t b) {
+ return vcgeq_u8(a, b);
+}
+
+// CHECK: test_vcgeq_u16
+// CHECK: vcge.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vcgeq_u16(uint16x8_t a, uint16x8_t b) {
+ return vcgeq_u16(a, b);
+}
+
+// CHECK: test_vcgeq_u32
+// CHECK: vcge.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcgeq_u32(uint32x4_t a, uint32x4_t b) {
+ return vcgeq_u32(a, b);
+}
+
+
+// CHECK: test_vcgt_s8
+// CHECK: vcgt.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vcgt_s8(int8x8_t a, int8x8_t b) {
+ return vcgt_s8(a, b);
+}
+
+// CHECK: test_vcgt_s16
+// CHECK: vcgt.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vcgt_s16(int16x4_t a, int16x4_t b) {
+ return vcgt_s16(a, b);
+}
+
+// CHECK: test_vcgt_s32
+// CHECK: vcgt.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcgt_s32(int32x2_t a, int32x2_t b) {
+ return vcgt_s32(a, b);
+}
+
+// CHECK: test_vcgt_f32
+// CHECK: vcgt.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcgt_f32(float32x2_t a, float32x2_t b) {
+ return vcgt_f32(a, b);
+}
+
+// CHECK: test_vcgt_u8
+// CHECK: vcgt.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vcgt_u8(uint8x8_t a, uint8x8_t b) {
+ return vcgt_u8(a, b);
+}
+
+// CHECK: test_vcgt_u16
+// CHECK: vcgt.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vcgt_u16(uint16x4_t a, uint16x4_t b) {
+ return vcgt_u16(a, b);
+}
+
+// CHECK: test_vcgt_u32
+// CHECK: vcgt.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcgt_u32(uint32x2_t a, uint32x2_t b) {
+ return vcgt_u32(a, b);
+}
+
+// CHECK: test_vcgtq_s8
+// CHECK: vcgt.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vcgtq_s8(int8x16_t a, int8x16_t b) {
+ return vcgtq_s8(a, b);
+}
+
+// CHECK: test_vcgtq_s16
+// CHECK: vcgt.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vcgtq_s16(int16x8_t a, int16x8_t b) {
+ return vcgtq_s16(a, b);
+}
+
+// CHECK: test_vcgtq_s32
+// CHECK: vcgt.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcgtq_s32(int32x4_t a, int32x4_t b) {
+ return vcgtq_s32(a, b);
+}
+
+// CHECK: test_vcgtq_f32
+// CHECK: vcgt.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcgtq_f32(float32x4_t a, float32x4_t b) {
+ return vcgtq_f32(a, b);
+}
+
+// CHECK: test_vcgtq_u8
+// CHECK: vcgt.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vcgtq_u8(uint8x16_t a, uint8x16_t b) {
+ return vcgtq_u8(a, b);
+}
+
+// CHECK: test_vcgtq_u16
+// CHECK: vcgt.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vcgtq_u16(uint16x8_t a, uint16x8_t b) {
+ return vcgtq_u16(a, b);
+}
+
+// CHECK: test_vcgtq_u32
+// CHECK: vcgt.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcgtq_u32(uint32x4_t a, uint32x4_t b) {
+ return vcgtq_u32(a, b);
+}
+
+
+// CHECK: test_vcle_s8
+// CHECK: vcge.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vcle_s8(int8x8_t a, int8x8_t b) {
+ return vcle_s8(a, b);
+}
+
+// CHECK: test_vcle_s16
+// CHECK: vcge.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vcle_s16(int16x4_t a, int16x4_t b) {
+ return vcle_s16(a, b);
+}
+
+// CHECK: test_vcle_s32
+// CHECK: vcge.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcle_s32(int32x2_t a, int32x2_t b) {
+ return vcle_s32(a, b);
+}
+
+// CHECK: test_vcle_f32
+// CHECK: vcge.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcle_f32(float32x2_t a, float32x2_t b) {
+ return vcle_f32(a, b);
+}
+
+// CHECK: test_vcle_u8
+// CHECK: vcge.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vcle_u8(uint8x8_t a, uint8x8_t b) {
+ return vcle_u8(a, b);
+}
+
+// CHECK: test_vcle_u16
+// CHECK: vcge.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vcle_u16(uint16x4_t a, uint16x4_t b) {
+ return vcle_u16(a, b);
+}
+
+// CHECK: test_vcle_u32
+// CHECK: vcge.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcle_u32(uint32x2_t a, uint32x2_t b) {
+ return vcle_u32(a, b);
+}
+
+// CHECK: test_vcleq_s8
+// CHECK: vcge.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vcleq_s8(int8x16_t a, int8x16_t b) {
+ return vcleq_s8(a, b);
+}
+
+// CHECK: test_vcleq_s16
+// CHECK: vcge.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vcleq_s16(int16x8_t a, int16x8_t b) {
+ return vcleq_s16(a, b);
+}
+
+// CHECK: test_vcleq_s32
+// CHECK: vcge.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcleq_s32(int32x4_t a, int32x4_t b) {
+ return vcleq_s32(a, b);
+}
+
+// CHECK: test_vcleq_f32
+// CHECK: vcge.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcleq_f32(float32x4_t a, float32x4_t b) {
+ return vcleq_f32(a, b);
+}
+
+// CHECK: test_vcleq_u8
+// CHECK: vcge.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vcleq_u8(uint8x16_t a, uint8x16_t b) {
+ return vcleq_u8(a, b);
+}
+
+// CHECK: test_vcleq_u16
+// CHECK: vcge.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vcleq_u16(uint16x8_t a, uint16x8_t b) {
+ return vcleq_u16(a, b);
+}
+
+// CHECK: test_vcleq_u32
+// CHECK: vcge.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcleq_u32(uint32x4_t a, uint32x4_t b) {
+ return vcleq_u32(a, b);
+}
+
+
+// CHECK: test_vcls_s8
+// CHECK: vcls.s8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vcls_s8(int8x8_t a) {
+ return vcls_s8(a);
+}
+
+// CHECK: test_vcls_s16
+// CHECK: vcls.s16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vcls_s16(int16x4_t a) {
+ return vcls_s16(a);
+}
+
+// CHECK: test_vcls_s32
+// CHECK: vcls.s32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vcls_s32(int32x2_t a) {
+ return vcls_s32(a);
+}
+
+// CHECK: test_vclsq_s8
+// CHECK: vcls.s8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vclsq_s8(int8x16_t a) {
+ return vclsq_s8(a);
+}
+
+// CHECK: test_vclsq_s16
+// CHECK: vcls.s16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vclsq_s16(int16x8_t a) {
+ return vclsq_s16(a);
+}
+
+// CHECK: test_vclsq_s32
+// CHECK: vcls.s32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vclsq_s32(int32x4_t a) {
+ return vclsq_s32(a);
+}
+
+
+// CHECK: test_vclt_s8
+// CHECK: vcgt.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vclt_s8(int8x8_t a, int8x8_t b) {
+ return vclt_s8(a, b);
+}
+
+// CHECK: test_vclt_s16
+// CHECK: vcgt.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vclt_s16(int16x4_t a, int16x4_t b) {
+ return vclt_s16(a, b);
+}
+
+// CHECK: test_vclt_s32
+// CHECK: vcgt.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vclt_s32(int32x2_t a, int32x2_t b) {
+ return vclt_s32(a, b);
+}
+
+// CHECK: test_vclt_f32
+// CHECK: vcgt.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vclt_f32(float32x2_t a, float32x2_t b) {
+ return vclt_f32(a, b);
+}
+
+// CHECK: test_vclt_u8
+// CHECK: vcgt.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vclt_u8(uint8x8_t a, uint8x8_t b) {
+ return vclt_u8(a, b);
+}
+
+// CHECK: test_vclt_u16
+// CHECK: vcgt.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vclt_u16(uint16x4_t a, uint16x4_t b) {
+ return vclt_u16(a, b);
+}
+
+// CHECK: test_vclt_u32
+// CHECK: vcgt.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vclt_u32(uint32x2_t a, uint32x2_t b) {
+ return vclt_u32(a, b);
+}
+
+// CHECK: test_vcltq_s8
+// CHECK: vcgt.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vcltq_s8(int8x16_t a, int8x16_t b) {
+ return vcltq_s8(a, b);
+}
+
+// CHECK: test_vcltq_s16
+// CHECK: vcgt.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vcltq_s16(int16x8_t a, int16x8_t b) {
+ return vcltq_s16(a, b);
+}
+
+// CHECK: test_vcltq_s32
+// CHECK: vcgt.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcltq_s32(int32x4_t a, int32x4_t b) {
+ return vcltq_s32(a, b);
+}
+
+// CHECK: test_vcltq_f32
+// CHECK: vcgt.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcltq_f32(float32x4_t a, float32x4_t b) {
+ return vcltq_f32(a, b);
+}
+
+// CHECK: test_vcltq_u8
+// CHECK: vcgt.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vcltq_u8(uint8x16_t a, uint8x16_t b) {
+ return vcltq_u8(a, b);
+}
+
+// CHECK: test_vcltq_u16
+// CHECK: vcgt.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vcltq_u16(uint16x8_t a, uint16x8_t b) {
+ return vcltq_u16(a, b);
+}
+
+// CHECK: test_vcltq_u32
+// CHECK: vcgt.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcltq_u32(uint32x4_t a, uint32x4_t b) {
+ return vcltq_u32(a, b);
+}
+
+
+// CHECK: test_vclz_s8
+// CHECK: vclz.i8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vclz_s8(int8x8_t a) {
+ return vclz_s8(a);
+}
+
+// CHECK: test_vclz_s16
+// CHECK: vclz.i16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vclz_s16(int16x4_t a) {
+ return vclz_s16(a);
+}
+
+// CHECK: test_vclz_s32
+// CHECK: vclz.i32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vclz_s32(int32x2_t a) {
+ return vclz_s32(a);
+}
+
+// CHECK: test_vclz_u8
+// CHECK: vclz.i8 d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vclz_u8(uint8x8_t a) {
+ return vclz_u8(a);
+}
+
+// CHECK: test_vclz_u16
+// CHECK: vclz.i16 d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vclz_u16(uint16x4_t a) {
+ return vclz_u16(a);
+}
+
+// CHECK: test_vclz_u32
+// CHECK: vclz.i32 d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vclz_u32(uint32x2_t a) {
+ return vclz_u32(a);
+}
+
+// CHECK: test_vclzq_s8
+// CHECK: vclz.i8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vclzq_s8(int8x16_t a) {
+ return vclzq_s8(a);
+}
+
+// CHECK: test_vclzq_s16
+// CHECK: vclz.i16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vclzq_s16(int16x8_t a) {
+ return vclzq_s16(a);
+}
+
+// CHECK: test_vclzq_s32
+// CHECK: vclz.i32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vclzq_s32(int32x4_t a) {
+ return vclzq_s32(a);
+}
+
+// CHECK: test_vclzq_u8
+// CHECK: vclz.i8 q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vclzq_u8(uint8x16_t a) {
+ return vclzq_u8(a);
+}
+
+// CHECK: test_vclzq_u16
+// CHECK: vclz.i16 q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vclzq_u16(uint16x8_t a) {
+ return vclzq_u16(a);
+}
+
+// CHECK: test_vclzq_u32
+// CHECK: vclz.i32 q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vclzq_u32(uint32x4_t a) {
+ return vclzq_u32(a);
+}
+
+
+// CHECK: test_vcnt_u8
+// CHECK: vcnt.8 d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vcnt_u8(uint8x8_t a) {
+ return vcnt_u8(a);
+}
+
+// CHECK: test_vcnt_s8
+// CHECK: vcnt.8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vcnt_s8(int8x8_t a) {
+ return vcnt_s8(a);
+}
+
+// CHECK: test_vcnt_p8
+// CHECK: vcnt.8 d{{[0-9]+}}, d{{[0-9]+}}
+poly8x8_t test_vcnt_p8(poly8x8_t a) {
+ return vcnt_p8(a);
+}
+
+// CHECK: test_vcntq_u8
+// CHECK: vcnt.8 q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vcntq_u8(uint8x16_t a) {
+ return vcntq_u8(a);
+}
+
+// CHECK: test_vcntq_s8
+// CHECK: vcnt.8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vcntq_s8(int8x16_t a) {
+ return vcntq_s8(a);
+}
+
+// CHECK: test_vcntq_p8
+// CHECK: vcnt.8 q{{[0-9]+}}, q{{[0-9]+}}
+poly8x16_t test_vcntq_p8(poly8x16_t a) {
+ return vcntq_p8(a);
+}
+
+
+// CHECK: test_vcombine_s8
+int8x16_t test_vcombine_s8(int8x8_t a, int8x8_t b) {
+ return vcombine_s8(a, b);
+}
+
+// CHECK: test_vcombine_s16
+int16x8_t test_vcombine_s16(int16x4_t a, int16x4_t b) {
+ return vcombine_s16(a, b);
+}
+
+// CHECK: test_vcombine_s32
+int32x4_t test_vcombine_s32(int32x2_t a, int32x2_t b) {
+ return vcombine_s32(a, b);
+}
+
+// CHECK: test_vcombine_s64
+int64x2_t test_vcombine_s64(int64x1_t a, int64x1_t b) {
+ return vcombine_s64(a, b);
+}
+
+// CHECK: test_vcombine_f16
+float16x8_t test_vcombine_f16(float16x4_t a, float16x4_t b) {
+ return vcombine_f16(a, b);
+}
+
+// CHECK: test_vcombine_f32
+float32x4_t test_vcombine_f32(float32x2_t a, float32x2_t b) {
+ return vcombine_f32(a, b);
+}
+
+// CHECK: test_vcombine_u8
+uint8x16_t test_vcombine_u8(uint8x8_t a, uint8x8_t b) {
+ return vcombine_u8(a, b);
+}
+
+// CHECK: test_vcombine_u16
+uint16x8_t test_vcombine_u16(uint16x4_t a, uint16x4_t b) {
+ return vcombine_u16(a, b);
+}
+
+// CHECK: test_vcombine_u32
+uint32x4_t test_vcombine_u32(uint32x2_t a, uint32x2_t b) {
+ return vcombine_u32(a, b);
+}
+
+// CHECK: test_vcombine_u64
+uint64x2_t test_vcombine_u64(uint64x1_t a, uint64x1_t b) {
+ return vcombine_u64(a, b);
+}
+
+// CHECK: test_vcombine_p8
+poly8x16_t test_vcombine_p8(poly8x8_t a, poly8x8_t b) {
+ return vcombine_p8(a, b);
+}
+
+// CHECK: test_vcombine_p16
+poly16x8_t test_vcombine_p16(poly16x4_t a, poly16x4_t b) {
+ return vcombine_p16(a, b);
+}
+
+
+// CHECK: test_vcreate_s8
+int8x8_t test_vcreate_s8(uint64_t a) {
+ return vcreate_s8(a);
+}
+
+// CHECK: test_vcreate_s16
+int16x4_t test_vcreate_s16(uint64_t a) {
+ return vcreate_s16(a);
+}
+
+// CHECK: test_vcreate_s32
+int32x2_t test_vcreate_s32(uint64_t a) {
+ return vcreate_s32(a);
+}
+
+// CHECK: test_vcreate_f16
+float16x4_t test_vcreate_f16(uint64_t a) {
+ return vcreate_f16(a);
+}
+
+// CHECK: test_vcreate_f32
+float32x2_t test_vcreate_f32(uint64_t a) {
+ return vcreate_f32(a);
+}
+
+// CHECK: test_vcreate_u8
+uint8x8_t test_vcreate_u8(uint64_t a) {
+ return vcreate_u8(a);
+}
+
+// CHECK: test_vcreate_u16
+uint16x4_t test_vcreate_u16(uint64_t a) {
+ return vcreate_u16(a);
+}
+
+// CHECK: test_vcreate_u32
+uint32x2_t test_vcreate_u32(uint64_t a) {
+ return vcreate_u32(a);
+}
+
+// CHECK: test_vcreate_u64
+uint64x1_t test_vcreate_u64(uint64_t a) {
+ return vcreate_u64(a);
+}
+
+// CHECK: test_vcreate_p8
+poly8x8_t test_vcreate_p8(uint64_t a) {
+ return vcreate_p8(a);
+}
+
+// CHECK: test_vcreate_p16
+poly16x4_t test_vcreate_p16(uint64_t a) {
+ return vcreate_p16(a);
+}
+
+// CHECK: test_vcreate_s64
+int64x1_t test_vcreate_s64(uint64_t a) {
+ return vcreate_s64(a);
+}
+
+
+// CHECK: test_vcvt_f16_f32
+// CHECK: vcvt.f16.f32 d{{[0-9]+}}, q{{[0-9]+}}
+float16x4_t test_vcvt_f16_f32(float32x4_t a) {
+ return vcvt_f16_f32(a);
+}
+
+
+// CHECK: test_vcvt_f32_s32
+// CHECK: vcvt.f32.s32 d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vcvt_f32_s32(int32x2_t a) {
+ return vcvt_f32_s32(a);
+}
+
+// CHECK: test_vcvt_f32_u32
+// CHECK: vcvt.f32.u32 d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vcvt_f32_u32(uint32x2_t a) {
+ return vcvt_f32_u32(a);
+}
+
+// CHECK: test_vcvtq_f32_s32
+// CHECK: vcvt.f32.s32 q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vcvtq_f32_s32(int32x4_t a) {
+ return vcvtq_f32_s32(a);
+}
+
+// CHECK: test_vcvtq_f32_u32
+// CHECK: vcvt.f32.u32 q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vcvtq_f32_u32(uint32x4_t a) {
+ return vcvtq_f32_u32(a);
+}
+
+
+// CHECK: test_vcvt_f32_f16
+// CHECK: vcvt.f32.f16
+float32x4_t test_vcvt_f32_f16(float16x4_t a) {
+ return vcvt_f32_f16(a);
+}
+
+
+// CHECK: test_vcvt_n_f32_s32
+// CHECK: vcvt.f32.s32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+float32x2_t test_vcvt_n_f32_s32(int32x2_t a) {
+ return vcvt_n_f32_s32(a, 1);
+}
+
+// CHECK: test_vcvt_n_f32_u32
+// CHECK: vcvt.f32.u32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+float32x2_t test_vcvt_n_f32_u32(uint32x2_t a) {
+ return vcvt_n_f32_u32(a, 1);
+}
+
+// CHECK: test_vcvtq_n_f32_s32
+// CHECK: vcvt.f32.s32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+float32x4_t test_vcvtq_n_f32_s32(int32x4_t a) {
+ return vcvtq_n_f32_s32(a, 3);
+}
+
+// CHECK: test_vcvtq_n_f32_u32
+// CHECK: vcvt.f32.u32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+float32x4_t test_vcvtq_n_f32_u32(uint32x4_t a) {
+ return vcvtq_n_f32_u32(a, 3);
+}
+
+
+// CHECK: test_vcvt_n_s32_f32
+// CHECK: vcvt.s32.f32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vcvt_n_s32_f32(float32x2_t a) {
+ return vcvt_n_s32_f32(a, 1);
+}
+
+// CHECK: test_vcvtq_n_s32_f32
+// CHECK: vcvt.s32.f32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vcvtq_n_s32_f32(float32x4_t a) {
+ return vcvtq_n_s32_f32(a, 3);
+}
+
+
+// CHECK: test_vcvt_n_u32_f32
+// CHECK: vcvt.u32.f32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vcvt_n_u32_f32(float32x2_t a) {
+ return vcvt_n_u32_f32(a, 1);
+}
+
+// CHECK: test_vcvtq_n_u32_f32
+// CHECK: vcvt.u32.f32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vcvtq_n_u32_f32(float32x4_t a) {
+ return vcvtq_n_u32_f32(a, 3);
+}
+
+
+// CHECK: test_vcvt_s32_f32
+// CHECK: vcvt.s32.f32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vcvt_s32_f32(float32x2_t a) {
+ return vcvt_s32_f32(a);
+}
+
+// CHECK: test_vcvtq_s32_f32
+// CHECK: vcvt.s32.f32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vcvtq_s32_f32(float32x4_t a) {
+ return vcvtq_s32_f32(a);
+}
+
+
+// CHECK: test_vcvt_u32_f32
+// CHECK: vcvt.u32.f32 d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vcvt_u32_f32(float32x2_t a) {
+ return vcvt_u32_f32(a);
+}
+
+// CHECK: test_vcvtq_u32_f32
+// CHECK: vcvt.u32.f32 q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vcvtq_u32_f32(float32x4_t a) {
+ return vcvtq_u32_f32(a);
+}
+
+
+// CHECK: test_vdup_lane_u8
+// CHECK: vdup.8 d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint8x8_t test_vdup_lane_u8(uint8x8_t a) {
+ return vdup_lane_u8(a, 7);
+}
+
+// CHECK: test_vdup_lane_u16
+// CHECK: vdup.16 d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint16x4_t test_vdup_lane_u16(uint16x4_t a) {
+ return vdup_lane_u16(a, 3);
+}
+
+// CHECK: test_vdup_lane_u32
+// CHECK: vdup.32 d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x2_t test_vdup_lane_u32(uint32x2_t a) {
+ return vdup_lane_u32(a, 1);
+}
+
+// CHECK: test_vdup_lane_s8
+// CHECK: vdup.8 d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int8x8_t test_vdup_lane_s8(int8x8_t a) {
+ return vdup_lane_s8(a, 7);
+}
+
+// CHECK: test_vdup_lane_s16
+// CHECK: vdup.16 d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x4_t test_vdup_lane_s16(int16x4_t a) {
+ return vdup_lane_s16(a, 3);
+}
+
+// CHECK: test_vdup_lane_s32
+// CHECK: vdup.32 d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x2_t test_vdup_lane_s32(int32x2_t a) {
+ return vdup_lane_s32(a, 1);
+}
+
+// CHECK: test_vdup_lane_p8
+// CHECK: vdup.8 d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+poly8x8_t test_vdup_lane_p8(poly8x8_t a) {
+ return vdup_lane_p8(a, 7);
+}
+
+// CHECK: test_vdup_lane_p16
+// CHECK: vdup.16 d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+poly16x4_t test_vdup_lane_p16(poly16x4_t a) {
+ return vdup_lane_p16(a, 3);
+}
+
+// CHECK: test_vdup_lane_f32
+// CHECK: vdup.32 d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+float32x2_t test_vdup_lane_f32(float32x2_t a) {
+ return vdup_lane_f32(a, 1);
+}
+
+// CHECK: test_vdupq_lane_u8
+// CHECK: vdup.8 q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint8x16_t test_vdupq_lane_u8(uint8x8_t a) {
+ return vdupq_lane_u8(a, 7);
+}
+
+// CHECK: test_vdupq_lane_u16
+// CHECK: vdup.16 q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint16x8_t test_vdupq_lane_u16(uint16x4_t a) {
+ return vdupq_lane_u16(a, 3);
+}
+
+// CHECK: test_vdupq_lane_u32
+// CHECK: vdup.32 q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x4_t test_vdupq_lane_u32(uint32x2_t a) {
+ return vdupq_lane_u32(a, 1);
+}
+
+// CHECK: test_vdupq_lane_s8
+// CHECK: vdup.8 q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int8x16_t test_vdupq_lane_s8(int8x8_t a) {
+ return vdupq_lane_s8(a, 7);
+}
+
+// CHECK: test_vdupq_lane_s16
+// CHECK: vdup.16 q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x8_t test_vdupq_lane_s16(int16x4_t a) {
+ return vdupq_lane_s16(a, 3);
+}
+
+// CHECK: test_vdupq_lane_s32
+// CHECK: vdup.32 q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vdupq_lane_s32(int32x2_t a) {
+ return vdupq_lane_s32(a, 1);
+}
+
+// CHECK: test_vdupq_lane_p8
+// CHECK: vdup.8 q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+poly8x16_t test_vdupq_lane_p8(poly8x8_t a) {
+ return vdupq_lane_p8(a, 7);
+}
+
+// CHECK: test_vdupq_lane_p16
+// CHECK: vdup.16 q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+poly16x8_t test_vdupq_lane_p16(poly16x4_t a) {
+ return vdupq_lane_p16(a, 3);
+}
+
+// CHECK: test_vdupq_lane_f32
+// CHECK: vdup.32 q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+float32x4_t test_vdupq_lane_f32(float32x2_t a) {
+ return vdupq_lane_f32(a, 1);
+}
+
+// CHECK: test_vdup_lane_s64
+int64x1_t test_vdup_lane_s64(int64x1_t a) {
+ return vdup_lane_s64(a, 0);
+}
+
+// CHECK: test_vdup_lane_u64
+uint64x1_t test_vdup_lane_u64(uint64x1_t a) {
+ return vdup_lane_u64(a, 0);
+}
+
+// CHECK: test_vdupq_lane_s64
+// CHECK: {{vmov|vdup}}
+int64x2_t test_vdupq_lane_s64(int64x1_t a) {
+ return vdupq_lane_s64(a, 0);
+}
+
+// CHECK: test_vdupq_lane_u64
+// CHECK: {{vmov|vdup}}
+uint64x2_t test_vdupq_lane_u64(uint64x1_t a) {
+ return vdupq_lane_u64(a, 0);
+}
+
+
+// CHECK: test_vdup_n_u8
+// CHECK: vmov
+uint8x8_t test_vdup_n_u8(uint8_t a) {
+ return vdup_n_u8(a);
+}
+
+// CHECK: test_vdup_n_u16
+// CHECK: vmov
+uint16x4_t test_vdup_n_u16(uint16_t a) {
+ return vdup_n_u16(a);
+}
+
+// CHECK: test_vdup_n_u32
+// CHECK: vmov
+uint32x2_t test_vdup_n_u32(uint32_t a) {
+ return vdup_n_u32(a);
+}
+
+// CHECK: test_vdup_n_s8
+// CHECK: vmov
+int8x8_t test_vdup_n_s8(int8_t a) {
+ return vdup_n_s8(a);
+}
+
+// CHECK: test_vdup_n_s16
+// CHECK: vmov
+int16x4_t test_vdup_n_s16(int16_t a) {
+ return vdup_n_s16(a);
+}
+
+// CHECK: test_vdup_n_s32
+// CHECK: vmov
+int32x2_t test_vdup_n_s32(int32_t a) {
+ return vdup_n_s32(a);
+}
+
+// CHECK: test_vdup_n_p8
+// CHECK: vmov
+poly8x8_t test_vdup_n_p8(poly8_t a) {
+ return vdup_n_p8(a);
+}
+
+// CHECK: test_vdup_n_p16
+// CHECK: vmov
+poly16x4_t test_vdup_n_p16(poly16_t a) {
+ return vdup_n_p16(a);
+}
+
+// CHECK: test_vdup_n_f32
+// CHECK: vmov
+float32x2_t test_vdup_n_f32(float32_t a) {
+ return vdup_n_f32(a);
+}
+
+// CHECK: test_vdupq_n_u8
+// CHECK: vmov
+uint8x16_t test_vdupq_n_u8(uint8_t a) {
+ return vdupq_n_u8(a);
+}
+
+// CHECK: test_vdupq_n_u16
+// CHECK: vmov
+uint16x8_t test_vdupq_n_u16(uint16_t a) {
+ return vdupq_n_u16(a);
+}
+
+// CHECK: test_vdupq_n_u32
+// CHECK: vmov
+uint32x4_t test_vdupq_n_u32(uint32_t a) {
+ return vdupq_n_u32(a);
+}
+
+// CHECK: test_vdupq_n_s8
+// CHECK: vmov
+int8x16_t test_vdupq_n_s8(int8_t a) {
+ return vdupq_n_s8(a);
+}
+
+// CHECK: test_vdupq_n_s16
+// CHECK: vmov
+int16x8_t test_vdupq_n_s16(int16_t a) {
+ return vdupq_n_s16(a);
+}
+
+// CHECK: test_vdupq_n_s32
+// CHECK: vmov
+int32x4_t test_vdupq_n_s32(int32_t a) {
+ return vdupq_n_s32(a);
+}
+
+// CHECK: test_vdupq_n_p8
+// CHECK: vmov
+poly8x16_t test_vdupq_n_p8(poly8_t a) {
+ return vdupq_n_p8(a);
+}
+
+// CHECK: test_vdupq_n_p16
+// CHECK: vmov
+poly16x8_t test_vdupq_n_p16(poly16_t a) {
+ return vdupq_n_p16(a);
+}
+
+// CHECK: test_vdupq_n_f32
+// CHECK: vmov
+float32x4_t test_vdupq_n_f32(float32_t a) {
+ return vdupq_n_f32(a);
+}
+
+// CHECK: test_vdup_n_s64
+// CHECK: vmov
+int64x1_t test_vdup_n_s64(int64_t a) {
+ return vdup_n_s64(a);
+}
+
+// CHECK: test_vdup_n_u64
+// CHECK: vmov
+uint64x1_t test_vdup_n_u64(uint64_t a) {
+ return vdup_n_u64(a);
+}
+
+// CHECK: test_vdupq_n_s64
+// CHECK: vmov
+int64x2_t test_vdupq_n_s64(int64_t a) {
+ return vdupq_n_s64(a);
+}
+
+// CHECK: test_vdupq_n_u64
+// CHECK: vmov
+uint64x2_t test_vdupq_n_u64(uint64_t a) {
+ return vdupq_n_u64(a);
+}
+
+
+// CHECK: test_veor_s8
+// CHECK: veor d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_veor_s8(int8x8_t a, int8x8_t b) {
+ return veor_s8(a, b);
+}
+
+// CHECK: test_veor_s16
+// CHECK: veor d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_veor_s16(int16x4_t a, int16x4_t b) {
+ return veor_s16(a, b);
+}
+
+// CHECK: test_veor_s32
+// CHECK: veor d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_veor_s32(int32x2_t a, int32x2_t b) {
+ return veor_s32(a, b);
+}
+
+// CHECK: test_veor_s64
+// CHECK: veor d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_veor_s64(int64x1_t a, int64x1_t b) {
+ return veor_s64(a, b);
+}
+
+// CHECK: test_veor_u8
+// CHECK: veor d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_veor_u8(uint8x8_t a, uint8x8_t b) {
+ return veor_u8(a, b);
+}
+
+// CHECK: test_veor_u16
+// CHECK: veor d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_veor_u16(uint16x4_t a, uint16x4_t b) {
+ return veor_u16(a, b);
+}
+
+// CHECK: test_veor_u32
+// CHECK: veor d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_veor_u32(uint32x2_t a, uint32x2_t b) {
+ return veor_u32(a, b);
+}
+
+// CHECK: test_veor_u64
+// CHECK: veor d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_veor_u64(uint64x1_t a, uint64x1_t b) {
+ return veor_u64(a, b);
+}
+
+// CHECK: test_veorq_s8
+// CHECK: veor q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_veorq_s8(int8x16_t a, int8x16_t b) {
+ return veorq_s8(a, b);
+}
+
+// CHECK: test_veorq_s16
+// CHECK: veor q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_veorq_s16(int16x8_t a, int16x8_t b) {
+ return veorq_s16(a, b);
+}
+
+// CHECK: test_veorq_s32
+// CHECK: veor q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_veorq_s32(int32x4_t a, int32x4_t b) {
+ return veorq_s32(a, b);
+}
+
+// CHECK: test_veorq_s64
+// CHECK: veor q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_veorq_s64(int64x2_t a, int64x2_t b) {
+ return veorq_s64(a, b);
+}
+
+// CHECK: test_veorq_u8
+// CHECK: veor q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_veorq_u8(uint8x16_t a, uint8x16_t b) {
+ return veorq_u8(a, b);
+}
+
+// CHECK: test_veorq_u16
+// CHECK: veor q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_veorq_u16(uint16x8_t a, uint16x8_t b) {
+ return veorq_u16(a, b);
+}
+
+// CHECK: test_veorq_u32
+// CHECK: veor q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_veorq_u32(uint32x4_t a, uint32x4_t b) {
+ return veorq_u32(a, b);
+}
+
+// CHECK: test_veorq_u64
+// CHECK: veor q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_veorq_u64(uint64x2_t a, uint64x2_t b) {
+ return veorq_u64(a, b);
+}
+
+
+// CHECK: test_vext_s8
+// CHECK: vext.8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vext_s8(int8x8_t a, int8x8_t b) {
+ return vext_s8(a, b, 7);
+}
+
+// CHECK: test_vext_u8
+// CHECK: vext.8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vext_u8(uint8x8_t a, uint8x8_t b) {
+ return vext_u8(a, b, 7);
+}
+
+// CHECK: test_vext_p8
+// CHECK: vext.8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+poly8x8_t test_vext_p8(poly8x8_t a, poly8x8_t b) {
+ return vext_p8(a, b, 7);
+}
+
+// CHECK: test_vext_s16
+// CHECK: vext.16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vext_s16(int16x4_t a, int16x4_t b) {
+ return vext_s16(a, b, 3);
+}
+
+// CHECK: test_vext_u16
+// CHECK: vext.16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vext_u16(uint16x4_t a, uint16x4_t b) {
+ return vext_u16(a, b, 3);
+}
+
+// CHECK: test_vext_p16
+// CHECK: vext.16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+poly16x4_t test_vext_p16(poly16x4_t a, poly16x4_t b) {
+ return vext_p16(a, b, 3);
+}
+
+// CHECK: test_vext_s32
+// CHECK: vext.32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vext_s32(int32x2_t a, int32x2_t b) {
+ return vext_s32(a, b, 1);
+}
+
+// CHECK: test_vext_u32
+// CHECK: vext.32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vext_u32(uint32x2_t a, uint32x2_t b) {
+ return vext_u32(a, b, 1);
+}
+
+// CHECK: test_vext_s64
+int64x1_t test_vext_s64(int64x1_t a, int64x1_t b) {
+ return vext_s64(a, b, 0);
+}
+
+// CHECK: test_vext_u64
+uint64x1_t test_vext_u64(uint64x1_t a, uint64x1_t b) {
+ return vext_u64(a, b, 0);
+}
+
+// CHECK: test_vext_f32
+// CHECK: vext.32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+float32x2_t test_vext_f32(float32x2_t a, float32x2_t b) {
+ return vext_f32(a, b, 1);
+}
+
+// CHECK: test_vextq_s8
+// CHECK: vext.8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x16_t test_vextq_s8(int8x16_t a, int8x16_t b) {
+ return vextq_s8(a, b, 15);
+}
+
+// CHECK: test_vextq_u8
+// CHECK: vext.8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x16_t test_vextq_u8(uint8x16_t a, uint8x16_t b) {
+ return vextq_u8(a, b, 15);
+}
+
+// CHECK: test_vextq_p8
+// CHECK: vext.8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+poly8x16_t test_vextq_p8(poly8x16_t a, poly8x16_t b) {
+ return vextq_p8(a, b, 15);
+}
+
+// CHECK: test_vextq_s16
+// CHECK: vext.16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x8_t test_vextq_s16(int16x8_t a, int16x8_t b) {
+ return vextq_s16(a, b, 7);
+}
+
+// CHECK: test_vextq_u16
+// CHECK: vext.16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vextq_u16(uint16x8_t a, uint16x8_t b) {
+ return vextq_u16(a, b, 7);
+}
+
+// CHECK: test_vextq_p16
+// CHECK: vext.16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+poly16x8_t test_vextq_p16(poly16x8_t a, poly16x8_t b) {
+ return vextq_p16(a, b, 7);
+}
+
+// CHECK: test_vextq_s32
+// CHECK: vext.32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vextq_s32(int32x4_t a, int32x4_t b) {
+ return vextq_s32(a, b, 3);
+}
+
+// CHECK: test_vextq_u32
+// CHECK: vext.32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vextq_u32(uint32x4_t a, uint32x4_t b) {
+ return vextq_u32(a, b, 3);
+}
+
+// CHECK: test_vextq_s64
+// CHECK: {{vmov|vdup}}
+int64x2_t test_vextq_s64(int64x2_t a, int64x2_t b) {
+ return vextq_s64(a, b, 1);
+}
+
+// CHECK: test_vextq_u64
+// CHECK: {{vmov|vdup}}
+uint64x2_t test_vextq_u64(uint64x2_t a, uint64x2_t b) {
+ return vextq_u64(a, b, 1);
+}
+
+// CHECK: test_vextq_f32
+// CHECK: vext.32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+float32x4_t test_vextq_f32(float32x4_t a, float32x4_t b) {
+ return vextq_f32(a, b, 3);
+}
+
+
+// CHECK: test_vfma_f32
+// CHECK: vfma.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vfma_f32(float32x2_t a, float32x2_t b, float32x2_t c) {
+ return vfma_f32(a, b, c);
+}
+
+// CHECK: test_vfmaq_f32
+// CHECK: vfma.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vfmaq_f32(float32x4_t a, float32x4_t b, float32x4_t c) {
+ return vfmaq_f32(a, b, c);
+}
+
+
+// CHECK: test_vget_high_s8
+int8x8_t test_vget_high_s8(int8x16_t a) {
+ return vget_high_s8(a);
+}
+
+// CHECK: test_vget_high_s16
+int16x4_t test_vget_high_s16(int16x8_t a) {
+ return vget_high_s16(a);
+}
+
+// CHECK: test_vget_high_s32
+int32x2_t test_vget_high_s32(int32x4_t a) {
+ return vget_high_s32(a);
+}
+
+// CHECK: test_vget_high_s64
+int64x1_t test_vget_high_s64(int64x2_t a) {
+ return vget_high_s64(a);
+}
+
+// CHECK: test_vget_high_f16
+float16x4_t test_vget_high_f16(float16x8_t a) {
+ return vget_high_f16(a);
+}
+
+// CHECK: test_vget_high_f32
+float32x2_t test_vget_high_f32(float32x4_t a) {
+ return vget_high_f32(a);
+}
+
+// CHECK: test_vget_high_u8
+uint8x8_t test_vget_high_u8(uint8x16_t a) {
+ return vget_high_u8(a);
+}
+
+// CHECK: test_vget_high_u16
+uint16x4_t test_vget_high_u16(uint16x8_t a) {
+ return vget_high_u16(a);
+}
+
+// CHECK: test_vget_high_u32
+uint32x2_t test_vget_high_u32(uint32x4_t a) {
+ return vget_high_u32(a);
+}
+
+// CHECK: test_vget_high_u64
+uint64x1_t test_vget_high_u64(uint64x2_t a) {
+ return vget_high_u64(a);
+}
+
+// CHECK: test_vget_high_p8
+poly8x8_t test_vget_high_p8(poly8x16_t a) {
+ return vget_high_p8(a);
+}
+
+// CHECK: test_vget_high_p16
+poly16x4_t test_vget_high_p16(poly16x8_t a) {
+ return vget_high_p16(a);
+}
+
+
+// CHECK: test_vget_lane_u8
+// CHECK: vmov
+uint8_t test_vget_lane_u8(uint8x8_t a) {
+ return vget_lane_u8(a, 7);
+}
+
+// CHECK: test_vget_lane_u16
+// CHECK: vmov
+uint16_t test_vget_lane_u16(uint16x4_t a) {
+ return vget_lane_u16(a, 3);
+}
+
+// CHECK: test_vget_lane_u32
+// CHECK: vmov
+uint32_t test_vget_lane_u32(uint32x2_t a) {
+ return vget_lane_u32(a, 1);
+}
+
+// CHECK: test_vget_lane_s8
+// CHECK: vmov
+int8_t test_vget_lane_s8(int8x8_t a) {
+ return vget_lane_s8(a, 7);
+}
+
+// CHECK: test_vget_lane_s16
+// CHECK: vmov
+int16_t test_vget_lane_s16(int16x4_t a) {
+ return vget_lane_s16(a, 3);
+}
+
+// CHECK: test_vget_lane_s32
+// CHECK: vmov
+int32_t test_vget_lane_s32(int32x2_t a) {
+ return vget_lane_s32(a, 1);
+}
+
+// CHECK: test_vget_lane_p8
+// CHECK: vmov
+poly8_t test_vget_lane_p8(poly8x8_t a) {
+ return vget_lane_p8(a, 7);
+}
+
+// CHECK: test_vget_lane_p16
+// CHECK: vmov
+poly16_t test_vget_lane_p16(poly16x4_t a) {
+ return vget_lane_p16(a, 3);
+}
+
+// CHECK: test_vget_lane_f32
+// CHECK: vmov
+float32_t test_vget_lane_f32(float32x2_t a) {
+ return vget_lane_f32(a, 1);
+}
+
+// CHECK: test_vgetq_lane_u8
+// CHECK: vmov
+uint8_t test_vgetq_lane_u8(uint8x16_t a) {
+ return vgetq_lane_u8(a, 15);
+}
+
+// CHECK: test_vgetq_lane_u16
+// CHECK: vmov
+uint16_t test_vgetq_lane_u16(uint16x8_t a) {
+ return vgetq_lane_u16(a, 7);
+}
+
+// CHECK: test_vgetq_lane_u32
+// CHECK: vmov
+uint32_t test_vgetq_lane_u32(uint32x4_t a) {
+ return vgetq_lane_u32(a, 3);
+}
+
+// CHECK: test_vgetq_lane_s8
+// CHECK: vmov
+int8_t test_vgetq_lane_s8(int8x16_t a) {
+ return vgetq_lane_s8(a, 15);
+}
+
+// CHECK: test_vgetq_lane_s16
+// CHECK: vmov
+int16_t test_vgetq_lane_s16(int16x8_t a) {
+ return vgetq_lane_s16(a, 7);
+}
+
+// CHECK: test_vgetq_lane_s32
+// CHECK: vmov
+int32_t test_vgetq_lane_s32(int32x4_t a) {
+ return vgetq_lane_s32(a, 3);
+}
+
+// CHECK: test_vgetq_lane_p8
+// CHECK: vmov
+poly8_t test_vgetq_lane_p8(poly8x16_t a) {
+ return vgetq_lane_p8(a, 15);
+}
+
+// CHECK: test_vgetq_lane_p16
+// CHECK: vmov
+poly16_t test_vgetq_lane_p16(poly16x8_t a) {
+ return vgetq_lane_p16(a, 7);
+}
+
+// CHECK: test_vgetq_lane_f32
+// CHECK: vmov
+float32_t test_vgetq_lane_f32(float32x4_t a) {
+ return vgetq_lane_f32(a, 3);
+}
+
+// CHECK: test_vget_lane_s64
+// CHECK: vmov
+int64_t test_vget_lane_s64(int64x1_t a) {
+ return vget_lane_s64(a, 0);
+}
+
+// CHECK: test_vget_lane_u64
+// CHECK: vmov
+uint64_t test_vget_lane_u64(uint64x1_t a) {
+ return vget_lane_u64(a, 0);
+}
+
+// CHECK: test_vgetq_lane_s64
+// CHECK: vmov
+int64_t test_vgetq_lane_s64(int64x2_t a) {
+ return vgetq_lane_s64(a, 1);
+}
+
+// CHECK: test_vgetq_lane_u64
+// CHECK: vmov
+uint64_t test_vgetq_lane_u64(uint64x2_t a) {
+ return vgetq_lane_u64(a, 1);
+}
+
+
+// CHECK: test_vget_low_s8
+int8x8_t test_vget_low_s8(int8x16_t a) {
+ return vget_low_s8(a);
+}
+
+// CHECK: test_vget_low_s16
+int16x4_t test_vget_low_s16(int16x8_t a) {
+ return vget_low_s16(a);
+}
+
+// CHECK: test_vget_low_s32
+int32x2_t test_vget_low_s32(int32x4_t a) {
+ return vget_low_s32(a);
+}
+
+// CHECK: test_vget_low_s64
+int64x1_t test_vget_low_s64(int64x2_t a) {
+ return vget_low_s64(a);
+}
+
+// CHECK: test_vget_low_f16
+float16x4_t test_vget_low_f16(float16x8_t a) {
+ return vget_low_f16(a);
+}
+
+// CHECK: test_vget_low_f32
+float32x2_t test_vget_low_f32(float32x4_t a) {
+ return vget_low_f32(a);
+}
+
+// CHECK: test_vget_low_u8
+uint8x8_t test_vget_low_u8(uint8x16_t a) {
+ return vget_low_u8(a);
+}
+
+// CHECK: test_vget_low_u16
+uint16x4_t test_vget_low_u16(uint16x8_t a) {
+ return vget_low_u16(a);
+}
+
+// CHECK: test_vget_low_u32
+uint32x2_t test_vget_low_u32(uint32x4_t a) {
+ return vget_low_u32(a);
+}
+
+// CHECK: test_vget_low_u64
+uint64x1_t test_vget_low_u64(uint64x2_t a) {
+ return vget_low_u64(a);
+}
+
+// CHECK: test_vget_low_p8
+poly8x8_t test_vget_low_p8(poly8x16_t a) {
+ return vget_low_p8(a);
+}
+
+// CHECK: test_vget_low_p16
+poly16x4_t test_vget_low_p16(poly16x8_t a) {
+ return vget_low_p16(a);
+}
+
+
+// CHECK: test_vhadd_s8
+// CHECK: vhadd.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vhadd_s8(int8x8_t a, int8x8_t b) {
+ return vhadd_s8(a, b);
+}
+
+// CHECK: test_vhadd_s16
+// CHECK: vhadd.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vhadd_s16(int16x4_t a, int16x4_t b) {
+ return vhadd_s16(a, b);
+}
+
+// CHECK: test_vhadd_s32
+// CHECK: vhadd.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vhadd_s32(int32x2_t a, int32x2_t b) {
+ return vhadd_s32(a, b);
+}
+
+// CHECK: test_vhadd_u8
+// CHECK: vhadd.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vhadd_u8(uint8x8_t a, uint8x8_t b) {
+ return vhadd_u8(a, b);
+}
+
+// CHECK: test_vhadd_u16
+// CHECK: vhadd.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vhadd_u16(uint16x4_t a, uint16x4_t b) {
+ return vhadd_u16(a, b);
+}
+
+// CHECK: test_vhadd_u32
+// CHECK: vhadd.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vhadd_u32(uint32x2_t a, uint32x2_t b) {
+ return vhadd_u32(a, b);
+}
+
+// CHECK: test_vhaddq_s8
+// CHECK: vhadd.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vhaddq_s8(int8x16_t a, int8x16_t b) {
+ return vhaddq_s8(a, b);
+}
+
+// CHECK: test_vhaddq_s16
+// CHECK: vhadd.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vhaddq_s16(int16x8_t a, int16x8_t b) {
+ return vhaddq_s16(a, b);
+}
+
+// CHECK: test_vhaddq_s32
+// CHECK: vhadd.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vhaddq_s32(int32x4_t a, int32x4_t b) {
+ return vhaddq_s32(a, b);
+}
+
+// CHECK: test_vhaddq_u8
+// CHECK: vhadd.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vhaddq_u8(uint8x16_t a, uint8x16_t b) {
+ return vhaddq_u8(a, b);
+}
+
+// CHECK: test_vhaddq_u16
+// CHECK: vhadd.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vhaddq_u16(uint16x8_t a, uint16x8_t b) {
+ return vhaddq_u16(a, b);
+}
+
+// CHECK: test_vhaddq_u32
+// CHECK: vhadd.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vhaddq_u32(uint32x4_t a, uint32x4_t b) {
+ return vhaddq_u32(a, b);
+}
+
+
+// CHECK: test_vhsub_s8
+// CHECK: vhsub.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vhsub_s8(int8x8_t a, int8x8_t b) {
+ return vhsub_s8(a, b);
+}
+
+// CHECK: test_vhsub_s16
+// CHECK: vhsub.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vhsub_s16(int16x4_t a, int16x4_t b) {
+ return vhsub_s16(a, b);
+}
+
+// CHECK: test_vhsub_s32
+// CHECK: vhsub.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vhsub_s32(int32x2_t a, int32x2_t b) {
+ return vhsub_s32(a, b);
+}
+
+// CHECK: test_vhsub_u8
+// CHECK: vhsub.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vhsub_u8(uint8x8_t a, uint8x8_t b) {
+ return vhsub_u8(a, b);
+}
+
+// CHECK: test_vhsub_u16
+// CHECK: vhsub.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vhsub_u16(uint16x4_t a, uint16x4_t b) {
+ return vhsub_u16(a, b);
+}
+
+// CHECK: test_vhsub_u32
+// CHECK: vhsub.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vhsub_u32(uint32x2_t a, uint32x2_t b) {
+ return vhsub_u32(a, b);
+}
+
+// CHECK: test_vhsubq_s8
+// CHECK: vhsub.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vhsubq_s8(int8x16_t a, int8x16_t b) {
+ return vhsubq_s8(a, b);
+}
+
+// CHECK: test_vhsubq_s16
+// CHECK: vhsub.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vhsubq_s16(int16x8_t a, int16x8_t b) {
+ return vhsubq_s16(a, b);
+}
+
+// CHECK: test_vhsubq_s32
+// CHECK: vhsub.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vhsubq_s32(int32x4_t a, int32x4_t b) {
+ return vhsubq_s32(a, b);
+}
+
+// CHECK: test_vhsubq_u8
+// CHECK: vhsub.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vhsubq_u8(uint8x16_t a, uint8x16_t b) {
+ return vhsubq_u8(a, b);
+}
+
+// CHECK: test_vhsubq_u16
+// CHECK: vhsub.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vhsubq_u16(uint16x8_t a, uint16x8_t b) {
+ return vhsubq_u16(a, b);
+}
+
+// CHECK: test_vhsubq_u32
+// CHECK: vhsub.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vhsubq_u32(uint32x4_t a, uint32x4_t b) {
+ return vhsubq_u32(a, b);
+}
+
+
+// CHECK: test_vld1q_u8
+// CHECK: vld1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint8x16_t test_vld1q_u8(uint8_t const * a) {
+ return vld1q_u8(a);
+}
+
+// CHECK: test_vld1q_u16
+// CHECK: vld1.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint16x8_t test_vld1q_u16(uint16_t const * a) {
+ return vld1q_u16(a);
+}
+
+// CHECK: test_vld1q_u32
+// CHECK: vld1.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint32x4_t test_vld1q_u32(uint32_t const * a) {
+ return vld1q_u32(a);
+}
+
+// CHECK: test_vld1q_u64
+// CHECK: vld1.64 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint64x2_t test_vld1q_u64(uint64_t const * a) {
+ return vld1q_u64(a);
+}
+
+// CHECK: test_vld1q_s8
+// CHECK: vld1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int8x16_t test_vld1q_s8(int8_t const * a) {
+ return vld1q_s8(a);
+}
+
+// CHECK: test_vld1q_s16
+// CHECK: vld1.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int16x8_t test_vld1q_s16(int16_t const * a) {
+ return vld1q_s16(a);
+}
+
+// CHECK: test_vld1q_s32
+// CHECK: vld1.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int32x4_t test_vld1q_s32(int32_t const * a) {
+ return vld1q_s32(a);
+}
+
+// CHECK: test_vld1q_s64
+// CHECK: vld1.64 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int64x2_t test_vld1q_s64(int64_t const * a) {
+ return vld1q_s64(a);
+}
+
+// CHECK: test_vld1q_f16
+// CHECK: vld1.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+float16x8_t test_vld1q_f16(float16_t const * a) {
+ return vld1q_f16(a);
+}
+
+// CHECK: test_vld1q_f32
+// CHECK: vld1.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+float32x4_t test_vld1q_f32(float32_t const * a) {
+ return vld1q_f32(a);
+}
+
+// CHECK: test_vld1q_p8
+// CHECK: vld1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly8x16_t test_vld1q_p8(poly8_t const * a) {
+ return vld1q_p8(a);
+}
+
+// CHECK: test_vld1q_p16
+// CHECK: vld1.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly16x8_t test_vld1q_p16(poly16_t const * a) {
+ return vld1q_p16(a);
+}
+
+// CHECK: test_vld1_u8
+// CHECK: vld1.8 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint8x8_t test_vld1_u8(uint8_t const * a) {
+ return vld1_u8(a);
+}
+
+// CHECK: test_vld1_u16
+// CHECK: vld1.16 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint16x4_t test_vld1_u16(uint16_t const * a) {
+ return vld1_u16(a);
+}
+
+// CHECK: test_vld1_u32
+// CHECK: vld1.32 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint32x2_t test_vld1_u32(uint32_t const * a) {
+ return vld1_u32(a);
+}
+
+// CHECK: test_vld1_u64
+// CHECK: vld1.64 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint64x1_t test_vld1_u64(uint64_t const * a) {
+ return vld1_u64(a);
+}
+
+// CHECK: test_vld1_s8
+// CHECK: vld1.8 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+int8x8_t test_vld1_s8(int8_t const * a) {
+ return vld1_s8(a);
+}
+
+// CHECK: test_vld1_s16
+// CHECK: vld1.16 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+int16x4_t test_vld1_s16(int16_t const * a) {
+ return vld1_s16(a);
+}
+
+// CHECK: test_vld1_s32
+// CHECK: vld1.32 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+int32x2_t test_vld1_s32(int32_t const * a) {
+ return vld1_s32(a);
+}
+
+// CHECK: test_vld1_s64
+// CHECK: vld1.64 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+int64x1_t test_vld1_s64(int64_t const * a) {
+ return vld1_s64(a);
+}
+
+// CHECK: test_vld1_f16
+// CHECK: vld1.16 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+float16x4_t test_vld1_f16(float16_t const * a) {
+ return vld1_f16(a);
+}
+
+// CHECK: test_vld1_f32
+// CHECK: vld1.32 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+float32x2_t test_vld1_f32(float32_t const * a) {
+ return vld1_f32(a);
+}
+
+// CHECK: test_vld1_p8
+// CHECK: vld1.8 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly8x8_t test_vld1_p8(poly8_t const * a) {
+ return vld1_p8(a);
+}
+
+// CHECK: test_vld1_p16
+// CHECK: vld1.16 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly16x4_t test_vld1_p16(poly16_t const * a) {
+ return vld1_p16(a);
+}
+
+
+// CHECK: test_vld1q_dup_u8
+// CHECK: vld1.8 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint8x16_t test_vld1q_dup_u8(uint8_t const * a) {
+ return vld1q_dup_u8(a);
+}
+
+// CHECK: test_vld1q_dup_u16
+// CHECK: vld1.16 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}:16]
+uint16x8_t test_vld1q_dup_u16(uint16_t const * a) {
+ return vld1q_dup_u16(a);
+}
+
+// CHECK: test_vld1q_dup_u32
+// CHECK: vld1.32 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}:32]
+uint32x4_t test_vld1q_dup_u32(uint32_t const * a) {
+ return vld1q_dup_u32(a);
+}
+
+// CHECK: test_vld1q_dup_u64
+// CHECK: {{ldr|vldr|vmov}}
+uint64x2_t test_vld1q_dup_u64(uint64_t const * a) {
+ return vld1q_dup_u64(a);
+}
+
+// CHECK: test_vld1q_dup_s8
+// CHECK: vld1.8 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int8x16_t test_vld1q_dup_s8(int8_t const * a) {
+ return vld1q_dup_s8(a);
+}
+
+// CHECK: test_vld1q_dup_s16
+// CHECK: vld1.16 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}:16]
+int16x8_t test_vld1q_dup_s16(int16_t const * a) {
+ return vld1q_dup_s16(a);
+}
+
+// CHECK: test_vld1q_dup_s32
+// CHECK: vld1.32 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}:32]
+int32x4_t test_vld1q_dup_s32(int32_t const * a) {
+ return vld1q_dup_s32(a);
+}
+
+// CHECK: test_vld1q_dup_s64
+// CHECK: {{ldr|vldr|vmov}}
+int64x2_t test_vld1q_dup_s64(int64_t const * a) {
+ return vld1q_dup_s64(a);
+}
+
+// CHECK: test_vld1q_dup_f16
+// CHECK: vld1.16 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}:16]
+float16x8_t test_vld1q_dup_f16(float16_t const * a) {
+ return vld1q_dup_f16(a);
+}
+
+// CHECK: test_vld1q_dup_f32
+// CHECK: vld1.32 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}:32]
+float32x4_t test_vld1q_dup_f32(float32_t const * a) {
+ return vld1q_dup_f32(a);
+}
+
+// CHECK: test_vld1q_dup_p8
+// CHECK: vld1.8 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+poly8x16_t test_vld1q_dup_p8(poly8_t const * a) {
+ return vld1q_dup_p8(a);
+}
+
+// CHECK: test_vld1q_dup_p16
+// CHECK: vld1.16 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}:16]
+poly16x8_t test_vld1q_dup_p16(poly16_t const * a) {
+ return vld1q_dup_p16(a);
+}
+
+// CHECK: test_vld1_dup_u8
+// CHECK: vld1.8 {d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint8x8_t test_vld1_dup_u8(uint8_t const * a) {
+ return vld1_dup_u8(a);
+}
+
+// CHECK: test_vld1_dup_u16
+// CHECK: vld1.16 {d{{[0-9]+}}[]}, [r{{[0-9]+}}:16]
+uint16x4_t test_vld1_dup_u16(uint16_t const * a) {
+ return vld1_dup_u16(a);
+}
+
+// CHECK: test_vld1_dup_u32
+// CHECK: vld1.32 {d{{[0-9]+}}[]}, [r{{[0-9]+}}:32]
+uint32x2_t test_vld1_dup_u32(uint32_t const * a) {
+ return vld1_dup_u32(a);
+}
+
+// CHECK: test_vld1_dup_u64
+// CHECK: {{ldr|vldr|vmov}}
+uint64x1_t test_vld1_dup_u64(uint64_t const * a) {
+ return vld1_dup_u64(a);
+}
+
+// CHECK: test_vld1_dup_s8
+// CHECK: vld1.8 {d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int8x8_t test_vld1_dup_s8(int8_t const * a) {
+ return vld1_dup_s8(a);
+}
+
+// CHECK: test_vld1_dup_s16
+// CHECK: vld1.16 {d{{[0-9]+}}[]}, [r{{[0-9]+}}:16]
+int16x4_t test_vld1_dup_s16(int16_t const * a) {
+ return vld1_dup_s16(a);
+}
+
+// CHECK: test_vld1_dup_s32
+// CHECK: vld1.32 {d{{[0-9]+}}[]}, [r{{[0-9]+}}:32]
+int32x2_t test_vld1_dup_s32(int32_t const * a) {
+ return vld1_dup_s32(a);
+}
+
+// CHECK: test_vld1_dup_s64
+// CHECK: {{ldr|vldr|vmov}}
+int64x1_t test_vld1_dup_s64(int64_t const * a) {
+ return vld1_dup_s64(a);
+}
+
+// CHECK: test_vld1_dup_f16
+// CHECK: vld1.16 {d{{[0-9]+}}[]}, [r{{[0-9]+}}:16]
+float16x4_t test_vld1_dup_f16(float16_t const * a) {
+ return vld1_dup_f16(a);
+}
+
+// CHECK: test_vld1_dup_f32
+// CHECK: vld1.32 {d{{[0-9]+}}[]}, [r{{[0-9]+}}:32]
+float32x2_t test_vld1_dup_f32(float32_t const * a) {
+ return vld1_dup_f32(a);
+}
+
+// CHECK: test_vld1_dup_p8
+// CHECK: vld1.8 {d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+poly8x8_t test_vld1_dup_p8(poly8_t const * a) {
+ return vld1_dup_p8(a);
+}
+
+// CHECK: test_vld1_dup_p16
+// CHECK: vld1.16 {d{{[0-9]+}}[]}, [r{{[0-9]+}}:16]
+poly16x4_t test_vld1_dup_p16(poly16_t const * a) {
+ return vld1_dup_p16(a);
+}
+
+
+// CHECK: test_vld1q_lane_u8
+// CHECK: vld1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint8x16_t test_vld1q_lane_u8(uint8_t const * a, uint8x16_t b) {
+ return vld1q_lane_u8(a, b, 15);
+}
+
+// CHECK: test_vld1q_lane_u16
+// CHECK: vld1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+uint16x8_t test_vld1q_lane_u16(uint16_t const * a, uint16x8_t b) {
+ return vld1q_lane_u16(a, b, 7);
+}
+
+// CHECK: test_vld1q_lane_u32
+// CHECK: vld1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+uint32x4_t test_vld1q_lane_u32(uint32_t const * a, uint32x4_t b) {
+ return vld1q_lane_u32(a, b, 3);
+}
+
+// CHECK: test_vld1q_lane_u64
+// CHECK: {{ldr|vldr|vmov}}
+uint64x2_t test_vld1q_lane_u64(uint64_t const * a, uint64x2_t b) {
+ return vld1q_lane_u64(a, b, 1);
+}
+
+// CHECK: test_vld1q_lane_s8
+// CHECK: vld1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int8x16_t test_vld1q_lane_s8(int8_t const * a, int8x16_t b) {
+ return vld1q_lane_s8(a, b, 15);
+}
+
+// CHECK: test_vld1q_lane_s16
+// CHECK: vld1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+int16x8_t test_vld1q_lane_s16(int16_t const * a, int16x8_t b) {
+ return vld1q_lane_s16(a, b, 7);
+}
+
+// CHECK: test_vld1q_lane_s32
+// CHECK: vld1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+int32x4_t test_vld1q_lane_s32(int32_t const * a, int32x4_t b) {
+ return vld1q_lane_s32(a, b, 3);
+}
+
+// CHECK: test_vld1q_lane_s64
+// CHECK: {{ldr|vldr|vmov}}
+int64x2_t test_vld1q_lane_s64(int64_t const * a, int64x2_t b) {
+ return vld1q_lane_s64(a, b, 1);
+}
+
+// CHECK: test_vld1q_lane_f16
+// CHECK: vld1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+float16x8_t test_vld1q_lane_f16(float16_t const * a, float16x8_t b) {
+ return vld1q_lane_f16(a, b, 7);
+}
+
+// CHECK: test_vld1q_lane_f32
+// CHECK: vld1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+float32x4_t test_vld1q_lane_f32(float32_t const * a, float32x4_t b) {
+ return vld1q_lane_f32(a, b, 3);
+}
+
+// CHECK: test_vld1q_lane_p8
+// CHECK: vld1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+poly8x16_t test_vld1q_lane_p8(poly8_t const * a, poly8x16_t b) {
+ return vld1q_lane_p8(a, b, 15);
+}
+
+// CHECK: test_vld1q_lane_p16
+// CHECK: vld1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+poly16x8_t test_vld1q_lane_p16(poly16_t const * a, poly16x8_t b) {
+ return vld1q_lane_p16(a, b, 7);
+}
+
+// CHECK: test_vld1_lane_u8
+// CHECK: vld1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint8x8_t test_vld1_lane_u8(uint8_t const * a, uint8x8_t b) {
+ return vld1_lane_u8(a, b, 7);
+}
+
+// CHECK: test_vld1_lane_u16
+// CHECK: vld1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+uint16x4_t test_vld1_lane_u16(uint16_t const * a, uint16x4_t b) {
+ return vld1_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vld1_lane_u32
+// CHECK: vld1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+uint32x2_t test_vld1_lane_u32(uint32_t const * a, uint32x2_t b) {
+ return vld1_lane_u32(a, b, 1);
+}
+
+// CHECK: test_vld1_lane_u64
+// CHECK: {{ldr|vldr|vmov}}
+uint64x1_t test_vld1_lane_u64(uint64_t const * a, uint64x1_t b) {
+ return vld1_lane_u64(a, b, 0);
+}
+
+// CHECK: test_vld1_lane_s8
+// CHECK: vld1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int8x8_t test_vld1_lane_s8(int8_t const * a, int8x8_t b) {
+ return vld1_lane_s8(a, b, 7);
+}
+
+// CHECK: test_vld1_lane_s16
+// CHECK: vld1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+int16x4_t test_vld1_lane_s16(int16_t const * a, int16x4_t b) {
+ return vld1_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vld1_lane_s32
+// CHECK: vld1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+int32x2_t test_vld1_lane_s32(int32_t const * a, int32x2_t b) {
+ return vld1_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vld1_lane_s64
+// CHECK: {{ldr|vldr|vmov}}
+int64x1_t test_vld1_lane_s64(int64_t const * a, int64x1_t b) {
+ return vld1_lane_s64(a, b, 0);
+}
+
+// CHECK: test_vld1_lane_f16
+// CHECK: vld1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+float16x4_t test_vld1_lane_f16(float16_t const * a, float16x4_t b) {
+ return vld1_lane_f16(a, b, 3);
+}
+
+// CHECK: test_vld1_lane_f32
+// CHECK: vld1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+float32x2_t test_vld1_lane_f32(float32_t const * a, float32x2_t b) {
+ return vld1_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vld1_lane_p8
+// CHECK: vld1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+poly8x8_t test_vld1_lane_p8(poly8_t const * a, poly8x8_t b) {
+ return vld1_lane_p8(a, b, 7);
+}
+
+// CHECK: test_vld1_lane_p16
+// CHECK: vld1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+poly16x4_t test_vld1_lane_p16(poly16_t const * a, poly16x4_t b) {
+ return vld1_lane_p16(a, b, 3);
+}
+
+
+// CHECK: test_vld2q_u8
+// CHECK: vld2.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint8x16x2_t test_vld2q_u8(uint8_t const * a) {
+ return vld2q_u8(a);
+}
+
+// CHECK: test_vld2q_u16
+// CHECK: vld2.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint16x8x2_t test_vld2q_u16(uint16_t const * a) {
+ return vld2q_u16(a);
+}
+
+// CHECK: test_vld2q_u32
+// CHECK: vld2.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint32x4x2_t test_vld2q_u32(uint32_t const * a) {
+ return vld2q_u32(a);
+}
+
+// CHECK: test_vld2q_s8
+// CHECK: vld2.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int8x16x2_t test_vld2q_s8(int8_t const * a) {
+ return vld2q_s8(a);
+}
+
+// CHECK: test_vld2q_s16
+// CHECK: vld2.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int16x8x2_t test_vld2q_s16(int16_t const * a) {
+ return vld2q_s16(a);
+}
+
+// CHECK: test_vld2q_s32
+// CHECK: vld2.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int32x4x2_t test_vld2q_s32(int32_t const * a) {
+ return vld2q_s32(a);
+}
+
+// CHECK: test_vld2q_f16
+// CHECK: vld2.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+float16x8x2_t test_vld2q_f16(float16_t const * a) {
+ return vld2q_f16(a);
+}
+
+// CHECK: test_vld2q_f32
+// CHECK: vld2.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+float32x4x2_t test_vld2q_f32(float32_t const * a) {
+ return vld2q_f32(a);
+}
+
+// CHECK: test_vld2q_p8
+// CHECK: vld2.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly8x16x2_t test_vld2q_p8(poly8_t const * a) {
+ return vld2q_p8(a);
+}
+
+// CHECK: test_vld2q_p16
+// CHECK: vld2.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly16x8x2_t test_vld2q_p16(poly16_t const * a) {
+ return vld2q_p16(a);
+}
+
+// CHECK: test_vld2_u8
+// CHECK: vld2.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint8x8x2_t test_vld2_u8(uint8_t const * a) {
+ return vld2_u8(a);
+}
+
+// CHECK: test_vld2_u16
+// CHECK: vld2.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint16x4x2_t test_vld2_u16(uint16_t const * a) {
+ return vld2_u16(a);
+}
+
+// CHECK: test_vld2_u32
+// CHECK: vld2.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint32x2x2_t test_vld2_u32(uint32_t const * a) {
+ return vld2_u32(a);
+}
+
+// CHECK: test_vld2_u64
+// CHECK: vld1.64
+uint64x1x2_t test_vld2_u64(uint64_t const * a) {
+ return vld2_u64(a);
+}
+
+// CHECK: test_vld2_s8
+// CHECK: vld2.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int8x8x2_t test_vld2_s8(int8_t const * a) {
+ return vld2_s8(a);
+}
+
+// CHECK: test_vld2_s16
+// CHECK: vld2.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int16x4x2_t test_vld2_s16(int16_t const * a) {
+ return vld2_s16(a);
+}
+
+// CHECK: test_vld2_s32
+// CHECK: vld2.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int32x2x2_t test_vld2_s32(int32_t const * a) {
+ return vld2_s32(a);
+}
+
+// CHECK: test_vld2_s64
+// CHECK: vld1.64
+int64x1x2_t test_vld2_s64(int64_t const * a) {
+ return vld2_s64(a);
+}
+
+// CHECK: test_vld2_f16
+// CHECK: vld2.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+float16x4x2_t test_vld2_f16(float16_t const * a) {
+ return vld2_f16(a);
+}
+
+// CHECK: test_vld2_f32
+// CHECK: vld2.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+float32x2x2_t test_vld2_f32(float32_t const * a) {
+ return vld2_f32(a);
+}
+
+// CHECK: test_vld2_p8
+// CHECK: vld2.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly8x8x2_t test_vld2_p8(poly8_t const * a) {
+ return vld2_p8(a);
+}
+
+// CHECK: test_vld2_p16
+// CHECK: vld2.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly16x4x2_t test_vld2_p16(poly16_t const * a) {
+ return vld2_p16(a);
+}
+
+
+// CHECK: test_vld2_dup_u8
+// CHECK: vld2.8 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint8x8x2_t test_vld2_dup_u8(uint8_t const * a) {
+ return vld2_dup_u8(a);
+}
+
+// CHECK: test_vld2_dup_u16
+// CHECK: vld2.16 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint16x4x2_t test_vld2_dup_u16(uint16_t const * a) {
+ return vld2_dup_u16(a);
+}
+
+// CHECK: test_vld2_dup_u32
+// CHECK: vld2.32 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint32x2x2_t test_vld2_dup_u32(uint32_t const * a) {
+ return vld2_dup_u32(a);
+}
+
+// CHECK: test_vld2_dup_u64
+// CHECK: vld1.64
+uint64x1x2_t test_vld2_dup_u64(uint64_t const * a) {
+ return vld2_dup_u64(a);
+}
+
+// CHECK: test_vld2_dup_s8
+// CHECK: vld2.8 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int8x8x2_t test_vld2_dup_s8(int8_t const * a) {
+ return vld2_dup_s8(a);
+}
+
+// CHECK: test_vld2_dup_s16
+// CHECK: vld2.16 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int16x4x2_t test_vld2_dup_s16(int16_t const * a) {
+ return vld2_dup_s16(a);
+}
+
+// CHECK: test_vld2_dup_s32
+// CHECK: vld2.32 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int32x2x2_t test_vld2_dup_s32(int32_t const * a) {
+ return vld2_dup_s32(a);
+}
+
+// CHECK: test_vld2_dup_s64
+// CHECK: vld1.64
+int64x1x2_t test_vld2_dup_s64(int64_t const * a) {
+ return vld2_dup_s64(a);
+}
+
+// CHECK: test_vld2_dup_f16
+// CHECK: vld2.16 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+float16x4x2_t test_vld2_dup_f16(float16_t const * a) {
+ return vld2_dup_f16(a);
+}
+
+// CHECK: test_vld2_dup_f32
+// CHECK: vld2.32 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+float32x2x2_t test_vld2_dup_f32(float32_t const * a) {
+ return vld2_dup_f32(a);
+}
+
+// CHECK: test_vld2_dup_p8
+// CHECK: vld2.8 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+poly8x8x2_t test_vld2_dup_p8(poly8_t const * a) {
+ return vld2_dup_p8(a);
+}
+
+// CHECK: test_vld2_dup_p16
+// CHECK: vld2.16 {d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+poly16x4x2_t test_vld2_dup_p16(poly16_t const * a) {
+ return vld2_dup_p16(a);
+}
+
+
+// CHECK: test_vld2q_lane_u16
+// CHECK: vld2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint16x8x2_t test_vld2q_lane_u16(uint16_t const * a, uint16x8x2_t b) {
+ return vld2q_lane_u16(a, b, 7);
+}
+
+// CHECK: test_vld2q_lane_u32
+// CHECK: vld2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint32x4x2_t test_vld2q_lane_u32(uint32_t const * a, uint32x4x2_t b) {
+ return vld2q_lane_u32(a, b, 3);
+}
+
+// CHECK: test_vld2q_lane_s16
+// CHECK: vld2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int16x8x2_t test_vld2q_lane_s16(int16_t const * a, int16x8x2_t b) {
+ return vld2q_lane_s16(a, b, 7);
+}
+
+// CHECK: test_vld2q_lane_s32
+// CHECK: vld2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int32x4x2_t test_vld2q_lane_s32(int32_t const * a, int32x4x2_t b) {
+ return vld2q_lane_s32(a, b, 3);
+}
+
+// CHECK: test_vld2q_lane_f16
+// CHECK: vld2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+float16x8x2_t test_vld2q_lane_f16(float16_t const * a, float16x8x2_t b) {
+ return vld2q_lane_f16(a, b, 7);
+}
+
+// CHECK: test_vld2q_lane_f32
+// CHECK: vld2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+float32x4x2_t test_vld2q_lane_f32(float32_t const * a, float32x4x2_t b) {
+ return vld2q_lane_f32(a, b, 3);
+}
+
+// CHECK: test_vld2q_lane_p16
+// CHECK: vld2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+poly16x8x2_t test_vld2q_lane_p16(poly16_t const * a, poly16x8x2_t b) {
+ return vld2q_lane_p16(a, b, 7);
+}
+
+// CHECK: test_vld2_lane_u8
+// CHECK: vld2.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint8x8x2_t test_vld2_lane_u8(uint8_t const * a, uint8x8x2_t b) {
+ return vld2_lane_u8(a, b, 7);
+}
+
+// CHECK: test_vld2_lane_u16
+// CHECK: vld2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint16x4x2_t test_vld2_lane_u16(uint16_t const * a, uint16x4x2_t b) {
+ return vld2_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vld2_lane_u32
+// CHECK: vld2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint32x2x2_t test_vld2_lane_u32(uint32_t const * a, uint32x2x2_t b) {
+ return vld2_lane_u32(a, b, 1);
+}
+
+// CHECK: test_vld2_lane_s8
+// CHECK: vld2.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int8x8x2_t test_vld2_lane_s8(int8_t const * a, int8x8x2_t b) {
+ return vld2_lane_s8(a, b, 7);
+}
+
+// CHECK: test_vld2_lane_s16
+// CHECK: vld2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int16x4x2_t test_vld2_lane_s16(int16_t const * a, int16x4x2_t b) {
+ return vld2_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vld2_lane_s32
+// CHECK: vld2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int32x2x2_t test_vld2_lane_s32(int32_t const * a, int32x2x2_t b) {
+ return vld2_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vld2_lane_f16
+// CHECK: vld2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+float16x4x2_t test_vld2_lane_f16(float16_t const * a, float16x4x2_t b) {
+ return vld2_lane_f16(a, b, 3);
+}
+
+// CHECK: test_vld2_lane_f32
+// CHECK: vld2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+float32x2x2_t test_vld2_lane_f32(float32_t const * a, float32x2x2_t b) {
+ return vld2_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vld2_lane_p8
+// CHECK: vld2.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+poly8x8x2_t test_vld2_lane_p8(poly8_t const * a, poly8x8x2_t b) {
+ return vld2_lane_p8(a, b, 7);
+}
+
+// CHECK: test_vld2_lane_p16
+// CHECK: vld2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+poly16x4x2_t test_vld2_lane_p16(poly16_t const * a, poly16x4x2_t b) {
+ return vld2_lane_p16(a, b, 3);
+}
+
+
+// CHECK: test_vld3q_u8
+// CHECK: vld3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+uint8x16x3_t test_vld3q_u8(uint8_t const * a) {
+ return vld3q_u8(a);
+}
+
+// CHECK: test_vld3q_u16
+// CHECK: vld3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+uint16x8x3_t test_vld3q_u16(uint16_t const * a) {
+ return vld3q_u16(a);
+}
+
+// CHECK: test_vld3q_u32
+// CHECK: vld3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+uint32x4x3_t test_vld3q_u32(uint32_t const * a) {
+ return vld3q_u32(a);
+}
+
+// CHECK: test_vld3q_s8
+// CHECK: vld3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+int8x16x3_t test_vld3q_s8(int8_t const * a) {
+ return vld3q_s8(a);
+}
+
+// CHECK: test_vld3q_s16
+// CHECK: vld3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+int16x8x3_t test_vld3q_s16(int16_t const * a) {
+ return vld3q_s16(a);
+}
+
+// CHECK: test_vld3q_s32
+// CHECK: vld3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+int32x4x3_t test_vld3q_s32(int32_t const * a) {
+ return vld3q_s32(a);
+}
+
+// CHECK: test_vld3q_f16
+// CHECK: vld3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+float16x8x3_t test_vld3q_f16(float16_t const * a) {
+ return vld3q_f16(a);
+}
+
+// CHECK: test_vld3q_f32
+// CHECK: vld3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+float32x4x3_t test_vld3q_f32(float32_t const * a) {
+ return vld3q_f32(a);
+}
+
+// CHECK: test_vld3q_p8
+// CHECK: vld3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+poly8x16x3_t test_vld3q_p8(poly8_t const * a) {
+ return vld3q_p8(a);
+}
+
+// CHECK: test_vld3q_p16
+// CHECK: vld3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+poly16x8x3_t test_vld3q_p16(poly16_t const * a) {
+ return vld3q_p16(a);
+}
+
+// CHECK: test_vld3_u8
+// CHECK: vld3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint8x8x3_t test_vld3_u8(uint8_t const * a) {
+ return vld3_u8(a);
+}
+
+// CHECK: test_vld3_u16
+// CHECK: vld3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint16x4x3_t test_vld3_u16(uint16_t const * a) {
+ return vld3_u16(a);
+}
+
+// CHECK: test_vld3_u32
+// CHECK: vld3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint32x2x3_t test_vld3_u32(uint32_t const * a) {
+ return vld3_u32(a);
+}
+
+// CHECK: test_vld3_u64
+// CHECK: vld1.64
+uint64x1x3_t test_vld3_u64(uint64_t const * a) {
+ return vld3_u64(a);
+}
+
+// CHECK: test_vld3_s8
+// CHECK: vld3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int8x8x3_t test_vld3_s8(int8_t const * a) {
+ return vld3_s8(a);
+}
+
+// CHECK: test_vld3_s16
+// CHECK: vld3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int16x4x3_t test_vld3_s16(int16_t const * a) {
+ return vld3_s16(a);
+}
+
+// CHECK: test_vld3_s32
+// CHECK: vld3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int32x2x3_t test_vld3_s32(int32_t const * a) {
+ return vld3_s32(a);
+}
+
+// CHECK: test_vld3_s64
+// CHECK: vld1.64
+int64x1x3_t test_vld3_s64(int64_t const * a) {
+ return vld3_s64(a);
+}
+
+// CHECK: test_vld3_f16
+// CHECK: vld3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+float16x4x3_t test_vld3_f16(float16_t const * a) {
+ return vld3_f16(a);
+}
+
+// CHECK: test_vld3_f32
+// CHECK: vld3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+float32x2x3_t test_vld3_f32(float32_t const * a) {
+ return vld3_f32(a);
+}
+
+// CHECK: test_vld3_p8
+// CHECK: vld3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly8x8x3_t test_vld3_p8(poly8_t const * a) {
+ return vld3_p8(a);
+}
+
+// CHECK: test_vld3_p16
+// CHECK: vld3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly16x4x3_t test_vld3_p16(poly16_t const * a) {
+ return vld3_p16(a);
+}
+
+
+// CHECK: test_vld3_dup_u8
+// CHECK: vld3.8 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint8x8x3_t test_vld3_dup_u8(uint8_t const * a) {
+ return vld3_dup_u8(a);
+}
+
+// CHECK: test_vld3_dup_u16
+// CHECK: vld3.16 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint16x4x3_t test_vld3_dup_u16(uint16_t const * a) {
+ return vld3_dup_u16(a);
+}
+
+// CHECK: test_vld3_dup_u32
+// CHECK: vld3.32 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint32x2x3_t test_vld3_dup_u32(uint32_t const * a) {
+ return vld3_dup_u32(a);
+}
+
+// CHECK: test_vld3_dup_u64
+// CHECK: vld1.64
+uint64x1x3_t test_vld3_dup_u64(uint64_t const * a) {
+ return vld3_dup_u64(a);
+}
+
+// CHECK: test_vld3_dup_s8
+// CHECK: vld3.8 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int8x8x3_t test_vld3_dup_s8(int8_t const * a) {
+ return vld3_dup_s8(a);
+}
+
+// CHECK: test_vld3_dup_s16
+// CHECK: vld3.16 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int16x4x3_t test_vld3_dup_s16(int16_t const * a) {
+ return vld3_dup_s16(a);
+}
+
+// CHECK: test_vld3_dup_s32
+// CHECK: vld3.32 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int32x2x3_t test_vld3_dup_s32(int32_t const * a) {
+ return vld3_dup_s32(a);
+}
+
+// CHECK: test_vld3_dup_s64
+// CHECK: vld1.64
+int64x1x3_t test_vld3_dup_s64(int64_t const * a) {
+ return vld3_dup_s64(a);
+}
+
+// CHECK: test_vld3_dup_f16
+// CHECK: vld3.16 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+float16x4x3_t test_vld3_dup_f16(float16_t const * a) {
+ return vld3_dup_f16(a);
+}
+
+// CHECK: test_vld3_dup_f32
+// CHECK: vld3.32 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+float32x2x3_t test_vld3_dup_f32(float32_t const * a) {
+ return vld3_dup_f32(a);
+}
+
+// CHECK: test_vld3_dup_p8
+// CHECK: vld3.8 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+poly8x8x3_t test_vld3_dup_p8(poly8_t const * a) {
+ return vld3_dup_p8(a);
+}
+
+// CHECK: test_vld3_dup_p16
+// CHECK: vld3.16 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+poly16x4x3_t test_vld3_dup_p16(poly16_t const * a) {
+ return vld3_dup_p16(a);
+}
+
+
+// CHECK: test_vld3q_lane_u16
+// CHECK: vld3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+uint16x8x3_t test_vld3q_lane_u16(uint16_t const * a, uint16x8x3_t b) {
+ return vld3q_lane_u16(a, b, 7);
+}
+
+// CHECK: test_vld3q_lane_u32
+// CHECK: vld3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+uint32x4x3_t test_vld3q_lane_u32(uint32_t const * a, uint32x4x3_t b) {
+ return vld3q_lane_u32(a, b, 3);
+}
+
+// CHECK: test_vld3q_lane_s16
+// CHECK: vld3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+int16x8x3_t test_vld3q_lane_s16(int16_t const * a, int16x8x3_t b) {
+ return vld3q_lane_s16(a, b, 7);
+}
+
+// CHECK: test_vld3q_lane_s32
+// CHECK: vld3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+int32x4x3_t test_vld3q_lane_s32(int32_t const * a, int32x4x3_t b) {
+ return vld3q_lane_s32(a, b, 3);
+}
+
+// CHECK: test_vld3q_lane_f16
+// CHECK: vld3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+float16x8x3_t test_vld3q_lane_f16(float16_t const * a, float16x8x3_t b) {
+ return vld3q_lane_f16(a, b, 7);
+}
+
+// CHECK: test_vld3q_lane_f32
+// CHECK: vld3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+float32x4x3_t test_vld3q_lane_f32(float32_t const * a, float32x4x3_t b) {
+ return vld3q_lane_f32(a, b, 3);
+}
+
+// CHECK: test_vld3q_lane_p16
+// CHECK: vld3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+poly16x8x3_t test_vld3q_lane_p16(poly16_t const * a, poly16x8x3_t b) {
+ return vld3q_lane_p16(a, b, 7);
+}
+
+// CHECK: test_vld3_lane_u8
+// CHECK: vld3.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint8x8x3_t test_vld3_lane_u8(uint8_t const * a, uint8x8x3_t b) {
+ return vld3_lane_u8(a, b, 7);
+}
+
+// CHECK: test_vld3_lane_u16
+// CHECK: vld3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint16x4x3_t test_vld3_lane_u16(uint16_t const * a, uint16x4x3_t b) {
+ return vld3_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vld3_lane_u32
+// CHECK: vld3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint32x2x3_t test_vld3_lane_u32(uint32_t const * a, uint32x2x3_t b) {
+ return vld3_lane_u32(a, b, 1);
+}
+
+// CHECK: test_vld3_lane_s8
+// CHECK: vld3.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int8x8x3_t test_vld3_lane_s8(int8_t const * a, int8x8x3_t b) {
+ return vld3_lane_s8(a, b, 7);
+}
+
+// CHECK: test_vld3_lane_s16
+// CHECK: vld3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int16x4x3_t test_vld3_lane_s16(int16_t const * a, int16x4x3_t b) {
+ return vld3_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vld3_lane_s32
+// CHECK: vld3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int32x2x3_t test_vld3_lane_s32(int32_t const * a, int32x2x3_t b) {
+ return vld3_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vld3_lane_f16
+// CHECK: vld3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+float16x4x3_t test_vld3_lane_f16(float16_t const * a, float16x4x3_t b) {
+ return vld3_lane_f16(a, b, 3);
+}
+
+// CHECK: test_vld3_lane_f32
+// CHECK: vld3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+float32x2x3_t test_vld3_lane_f32(float32_t const * a, float32x2x3_t b) {
+ return vld3_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vld3_lane_p8
+// CHECK: vld3.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+poly8x8x3_t test_vld3_lane_p8(poly8_t const * a, poly8x8x3_t b) {
+ return vld3_lane_p8(a, b, 7);
+}
+
+// CHECK: test_vld3_lane_p16
+// CHECK: vld3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+poly16x4x3_t test_vld3_lane_p16(poly16_t const * a, poly16x4x3_t b) {
+ return vld3_lane_p16(a, b, 3);
+}
+
+
+// CHECK: test_vld4q_u8
+// CHECK: vld4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+uint8x16x4_t test_vld4q_u8(uint8_t const * a) {
+ return vld4q_u8(a);
+}
+
+// CHECK: test_vld4q_u16
+// CHECK: vld4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+uint16x8x4_t test_vld4q_u16(uint16_t const * a) {
+ return vld4q_u16(a);
+}
+
+// CHECK: test_vld4q_u32
+// CHECK: vld4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+uint32x4x4_t test_vld4q_u32(uint32_t const * a) {
+ return vld4q_u32(a);
+}
+
+// CHECK: test_vld4q_s8
+// CHECK: vld4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+int8x16x4_t test_vld4q_s8(int8_t const * a) {
+ return vld4q_s8(a);
+}
+
+// CHECK: test_vld4q_s16
+// CHECK: vld4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+int16x8x4_t test_vld4q_s16(int16_t const * a) {
+ return vld4q_s16(a);
+}
+
+// CHECK: test_vld4q_s32
+// CHECK: vld4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+int32x4x4_t test_vld4q_s32(int32_t const * a) {
+ return vld4q_s32(a);
+}
+
+// CHECK: test_vld4q_f16
+// CHECK: vld4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+float16x8x4_t test_vld4q_f16(float16_t const * a) {
+ return vld4q_f16(a);
+}
+
+// CHECK: test_vld4q_f32
+// CHECK: vld4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+float32x4x4_t test_vld4q_f32(float32_t const * a) {
+ return vld4q_f32(a);
+}
+
+// CHECK: test_vld4q_p8
+// CHECK: vld4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+poly8x16x4_t test_vld4q_p8(poly8_t const * a) {
+ return vld4q_p8(a);
+}
+
+// CHECK: test_vld4q_p16
+// CHECK: vld4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+poly16x8x4_t test_vld4q_p16(poly16_t const * a) {
+ return vld4q_p16(a);
+}
+
+// CHECK: test_vld4_u8
+// CHECK: vld4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint8x8x4_t test_vld4_u8(uint8_t const * a) {
+ return vld4_u8(a);
+}
+
+// CHECK: test_vld4_u16
+// CHECK: vld4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint16x4x4_t test_vld4_u16(uint16_t const * a) {
+ return vld4_u16(a);
+}
+
+// CHECK: test_vld4_u32
+// CHECK: vld4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+uint32x2x4_t test_vld4_u32(uint32_t const * a) {
+ return vld4_u32(a);
+}
+
+// CHECK: test_vld4_u64
+// CHECK: vld1.64
+uint64x1x4_t test_vld4_u64(uint64_t const * a) {
+ return vld4_u64(a);
+}
+
+// CHECK: test_vld4_s8
+// CHECK: vld4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int8x8x4_t test_vld4_s8(int8_t const * a) {
+ return vld4_s8(a);
+}
+
+// CHECK: test_vld4_s16
+// CHECK: vld4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int16x4x4_t test_vld4_s16(int16_t const * a) {
+ return vld4_s16(a);
+}
+
+// CHECK: test_vld4_s32
+// CHECK: vld4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+int32x2x4_t test_vld4_s32(int32_t const * a) {
+ return vld4_s32(a);
+}
+
+// CHECK: test_vld4_s64
+// CHECK: vld1.64
+int64x1x4_t test_vld4_s64(int64_t const * a) {
+ return vld4_s64(a);
+}
+
+// CHECK: test_vld4_f16
+// CHECK: vld4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+float16x4x4_t test_vld4_f16(float16_t const * a) {
+ return vld4_f16(a);
+}
+
+// CHECK: test_vld4_f32
+// CHECK: vld4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+float32x2x4_t test_vld4_f32(float32_t const * a) {
+ return vld4_f32(a);
+}
+
+// CHECK: test_vld4_p8
+// CHECK: vld4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly8x8x4_t test_vld4_p8(poly8_t const * a) {
+ return vld4_p8(a);
+}
+
+// CHECK: test_vld4_p16
+// CHECK: vld4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+poly16x4x4_t test_vld4_p16(poly16_t const * a) {
+ return vld4_p16(a);
+}
+
+
+// CHECK: test_vld4_dup_u8
+// CHECK: vld4.8 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint8x8x4_t test_vld4_dup_u8(uint8_t const * a) {
+ return vld4_dup_u8(a);
+}
+
+// CHECK: test_vld4_dup_u16
+// CHECK: vld4.16 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint16x4x4_t test_vld4_dup_u16(uint16_t const * a) {
+ return vld4_dup_u16(a);
+}
+
+// CHECK: test_vld4_dup_u32
+// CHECK: vld4.32 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+uint32x2x4_t test_vld4_dup_u32(uint32_t const * a) {
+ return vld4_dup_u32(a);
+}
+
+// CHECK: test_vld4_dup_u64
+// CHECK: vld1.64
+uint64x1x4_t test_vld4_dup_u64(uint64_t const * a) {
+ return vld4_dup_u64(a);
+}
+
+// CHECK: test_vld4_dup_s8
+// CHECK: vld4.8 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int8x8x4_t test_vld4_dup_s8(int8_t const * a) {
+ return vld4_dup_s8(a);
+}
+
+// CHECK: test_vld4_dup_s16
+// CHECK: vld4.16 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int16x4x4_t test_vld4_dup_s16(int16_t const * a) {
+ return vld4_dup_s16(a);
+}
+
+// CHECK: test_vld4_dup_s32
+// CHECK: vld4.32 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+int32x2x4_t test_vld4_dup_s32(int32_t const * a) {
+ return vld4_dup_s32(a);
+}
+
+// CHECK: test_vld4_dup_s64
+// CHECK: vld1.64
+int64x1x4_t test_vld4_dup_s64(int64_t const * a) {
+ return vld4_dup_s64(a);
+}
+
+// CHECK: test_vld4_dup_f16
+// CHECK: vld4.16 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+float16x4x4_t test_vld4_dup_f16(float16_t const * a) {
+ return vld4_dup_f16(a);
+}
+
+// CHECK: test_vld4_dup_f32
+// CHECK: vld4.32 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+float32x2x4_t test_vld4_dup_f32(float32_t const * a) {
+ return vld4_dup_f32(a);
+}
+
+// CHECK: test_vld4_dup_p8
+// CHECK: vld4.8 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+poly8x8x4_t test_vld4_dup_p8(poly8_t const * a) {
+ return vld4_dup_p8(a);
+}
+
+// CHECK: test_vld4_dup_p16
+// CHECK: vld4.16 {d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[], d{{[0-9]+}}[]}, [r{{[0-9]+}}]
+poly16x4x4_t test_vld4_dup_p16(poly16_t const * a) {
+ return vld4_dup_p16(a);
+}
+
+
+// CHECK: test_vld4q_lane_u16
+// CHECK: vld4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+uint16x8x4_t test_vld4q_lane_u16(uint16_t const * a, uint16x8x4_t b) {
+ return vld4q_lane_u16(a, b, 7);
+}
+
+// CHECK: test_vld4q_lane_u32
+// CHECK: vld4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+uint32x4x4_t test_vld4q_lane_u32(uint32_t const * a, uint32x4x4_t b) {
+ return vld4q_lane_u32(a, b, 3);
+}
+
+// CHECK: test_vld4q_lane_s16
+// CHECK: vld4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+int16x8x4_t test_vld4q_lane_s16(int16_t const * a, int16x8x4_t b) {
+ return vld4q_lane_s16(a, b, 7);
+}
+
+// CHECK: test_vld4q_lane_s32
+// CHECK: vld4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+int32x4x4_t test_vld4q_lane_s32(int32_t const * a, int32x4x4_t b) {
+ return vld4q_lane_s32(a, b, 3);
+}
+
+// CHECK: test_vld4q_lane_f16
+// CHECK: vld4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+float16x8x4_t test_vld4q_lane_f16(float16_t const * a, float16x8x4_t b) {
+ return vld4q_lane_f16(a, b, 7);
+}
+
+// CHECK: test_vld4q_lane_f32
+// CHECK: vld4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+float32x4x4_t test_vld4q_lane_f32(float32_t const * a, float32x4x4_t b) {
+ return vld4q_lane_f32(a, b, 3);
+}
+
+// CHECK: test_vld4q_lane_p16
+// CHECK: vld4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+poly16x8x4_t test_vld4q_lane_p16(poly16_t const * a, poly16x8x4_t b) {
+ return vld4q_lane_p16(a, b, 7);
+}
+
+// CHECK: test_vld4_lane_u8
+// CHECK: vld4.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint8x8x4_t test_vld4_lane_u8(uint8_t const * a, uint8x8x4_t b) {
+ return vld4_lane_u8(a, b, 7);
+}
+
+// CHECK: test_vld4_lane_u16
+// CHECK: vld4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint16x4x4_t test_vld4_lane_u16(uint16_t const * a, uint16x4x4_t b) {
+ return vld4_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vld4_lane_u32
+// CHECK: vld4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+uint32x2x4_t test_vld4_lane_u32(uint32_t const * a, uint32x2x4_t b) {
+ return vld4_lane_u32(a, b, 1);
+}
+
+// CHECK: test_vld4_lane_s8
+// CHECK: vld4.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int8x8x4_t test_vld4_lane_s8(int8_t const * a, int8x8x4_t b) {
+ return vld4_lane_s8(a, b, 7);
+}
+
+// CHECK: test_vld4_lane_s16
+// CHECK: vld4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int16x4x4_t test_vld4_lane_s16(int16_t const * a, int16x4x4_t b) {
+ return vld4_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vld4_lane_s32
+// CHECK: vld4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+int32x2x4_t test_vld4_lane_s32(int32_t const * a, int32x2x4_t b) {
+ return vld4_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vld4_lane_f16
+// CHECK: vld4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+float16x4x4_t test_vld4_lane_f16(float16_t const * a, float16x4x4_t b) {
+ return vld4_lane_f16(a, b, 3);
+}
+
+// CHECK: test_vld4_lane_f32
+// CHECK: vld4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+float32x2x4_t test_vld4_lane_f32(float32_t const * a, float32x2x4_t b) {
+ return vld4_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vld4_lane_p8
+// CHECK: vld4.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+poly8x8x4_t test_vld4_lane_p8(poly8_t const * a, poly8x8x4_t b) {
+ return vld4_lane_p8(a, b, 7);
+}
+
+// CHECK: test_vld4_lane_p16
+// CHECK: vld4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+poly16x4x4_t test_vld4_lane_p16(poly16_t const * a, poly16x4x4_t b) {
+ return vld4_lane_p16(a, b, 3);
+}
+
+
+// CHECK: test_vmax_s8
+// CHECK: vmax.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vmax_s8(int8x8_t a, int8x8_t b) {
+ return vmax_s8(a, b);
+}
+
+// CHECK: test_vmax_s16
+// CHECK: vmax.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vmax_s16(int16x4_t a, int16x4_t b) {
+ return vmax_s16(a, b);
+}
+
+// CHECK: test_vmax_s32
+// CHECK: vmax.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vmax_s32(int32x2_t a, int32x2_t b) {
+ return vmax_s32(a, b);
+}
+
+// CHECK: test_vmax_u8
+// CHECK: vmax.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vmax_u8(uint8x8_t a, uint8x8_t b) {
+ return vmax_u8(a, b);
+}
+
+// CHECK: test_vmax_u16
+// CHECK: vmax.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vmax_u16(uint16x4_t a, uint16x4_t b) {
+ return vmax_u16(a, b);
+}
+
+// CHECK: test_vmax_u32
+// CHECK: vmax.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vmax_u32(uint32x2_t a, uint32x2_t b) {
+ return vmax_u32(a, b);
+}
+
+// CHECK: test_vmax_f32
+// CHECK: vmax.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vmax_f32(float32x2_t a, float32x2_t b) {
+ return vmax_f32(a, b);
+}
+
+// CHECK: test_vmaxq_s8
+// CHECK: vmax.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vmaxq_s8(int8x16_t a, int8x16_t b) {
+ return vmaxq_s8(a, b);
+}
+
+// CHECK: test_vmaxq_s16
+// CHECK: vmax.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vmaxq_s16(int16x8_t a, int16x8_t b) {
+ return vmaxq_s16(a, b);
+}
+
+// CHECK: test_vmaxq_s32
+// CHECK: vmax.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vmaxq_s32(int32x4_t a, int32x4_t b) {
+ return vmaxq_s32(a, b);
+}
+
+// CHECK: test_vmaxq_u8
+// CHECK: vmax.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vmaxq_u8(uint8x16_t a, uint8x16_t b) {
+ return vmaxq_u8(a, b);
+}
+
+// CHECK: test_vmaxq_u16
+// CHECK: vmax.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vmaxq_u16(uint16x8_t a, uint16x8_t b) {
+ return vmaxq_u16(a, b);
+}
+
+// CHECK: test_vmaxq_u32
+// CHECK: vmax.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vmaxq_u32(uint32x4_t a, uint32x4_t b) {
+ return vmaxq_u32(a, b);
+}
+
+// CHECK: test_vmaxq_f32
+// CHECK: vmax.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vmaxq_f32(float32x4_t a, float32x4_t b) {
+ return vmaxq_f32(a, b);
+}
+
+
+// CHECK: test_vmin_s8
+// CHECK: vmin.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vmin_s8(int8x8_t a, int8x8_t b) {
+ return vmin_s8(a, b);
+}
+
+// CHECK: test_vmin_s16
+// CHECK: vmin.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vmin_s16(int16x4_t a, int16x4_t b) {
+ return vmin_s16(a, b);
+}
+
+// CHECK: test_vmin_s32
+// CHECK: vmin.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vmin_s32(int32x2_t a, int32x2_t b) {
+ return vmin_s32(a, b);
+}
+
+// CHECK: test_vmin_u8
+// CHECK: vmin.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vmin_u8(uint8x8_t a, uint8x8_t b) {
+ return vmin_u8(a, b);
+}
+
+// CHECK: test_vmin_u16
+// CHECK: vmin.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vmin_u16(uint16x4_t a, uint16x4_t b) {
+ return vmin_u16(a, b);
+}
+
+// CHECK: test_vmin_u32
+// CHECK: vmin.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vmin_u32(uint32x2_t a, uint32x2_t b) {
+ return vmin_u32(a, b);
+}
+
+// CHECK: test_vmin_f32
+// CHECK: vmin.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vmin_f32(float32x2_t a, float32x2_t b) {
+ return vmin_f32(a, b);
+}
+
+// CHECK: test_vminq_s8
+// CHECK: vmin.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vminq_s8(int8x16_t a, int8x16_t b) {
+ return vminq_s8(a, b);
+}
+
+// CHECK: test_vminq_s16
+// CHECK: vmin.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vminq_s16(int16x8_t a, int16x8_t b) {
+ return vminq_s16(a, b);
+}
+
+// CHECK: test_vminq_s32
+// CHECK: vmin.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vminq_s32(int32x4_t a, int32x4_t b) {
+ return vminq_s32(a, b);
+}
+
+// CHECK: test_vminq_u8
+// CHECK: vmin.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vminq_u8(uint8x16_t a, uint8x16_t b) {
+ return vminq_u8(a, b);
+}
+
+// CHECK: test_vminq_u16
+// CHECK: vmin.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vminq_u16(uint16x8_t a, uint16x8_t b) {
+ return vminq_u16(a, b);
+}
+
+// CHECK: test_vminq_u32
+// CHECK: vmin.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vminq_u32(uint32x4_t a, uint32x4_t b) {
+ return vminq_u32(a, b);
+}
+
+// CHECK: test_vminq_f32
+// CHECK: vmin.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vminq_f32(float32x4_t a, float32x4_t b) {
+ return vminq_f32(a, b);
+}
+
+
+// CHECK: test_vmla_s8
+// CHECK: vmla.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vmla_s8(int8x8_t a, int8x8_t b, int8x8_t c) {
+ return vmla_s8(a, b, c);
+}
+
+// CHECK: test_vmla_s16
+// CHECK: vmla.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vmla_s16(int16x4_t a, int16x4_t b, int16x4_t c) {
+ return vmla_s16(a, b, c);
+}
+
+// CHECK: test_vmla_s32
+// CHECK: vmla.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vmla_s32(int32x2_t a, int32x2_t b, int32x2_t c) {
+ return vmla_s32(a, b, c);
+}
+
+// CHECK: test_vmla_f32
+// CHECK: vmul.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+// CHECK: vadd.f32
+float32x2_t test_vmla_f32(float32x2_t a, float32x2_t b, float32x2_t c) {
+ return vmla_f32(a, b, c);
+}
+
+// CHECK: test_vmla_u8
+// CHECK: vmla.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vmla_u8(uint8x8_t a, uint8x8_t b, uint8x8_t c) {
+ return vmla_u8(a, b, c);
+}
+
+// CHECK: test_vmla_u16
+// CHECK: vmla.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vmla_u16(uint16x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vmla_u16(a, b, c);
+}
+
+// CHECK: test_vmla_u32
+// CHECK: vmla.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vmla_u32(uint32x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vmla_u32(a, b, c);
+}
+
+// CHECK: test_vmlaq_s8
+// CHECK: vmla.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vmlaq_s8(int8x16_t a, int8x16_t b, int8x16_t c) {
+ return vmlaq_s8(a, b, c);
+}
+
+// CHECK: test_vmlaq_s16
+// CHECK: vmla.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vmlaq_s16(int16x8_t a, int16x8_t b, int16x8_t c) {
+ return vmlaq_s16(a, b, c);
+}
+
+// CHECK: test_vmlaq_s32
+// CHECK: vmla.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vmlaq_s32(int32x4_t a, int32x4_t b, int32x4_t c) {
+ return vmlaq_s32(a, b, c);
+}
+
+// CHECK: test_vmlaq_f32
+// CHECK: vmul.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+// CHECK: vadd.f32
+float32x4_t test_vmlaq_f32(float32x4_t a, float32x4_t b, float32x4_t c) {
+ return vmlaq_f32(a, b, c);
+}
+
+// CHECK: test_vmlaq_u8
+// CHECK: vmla.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vmlaq_u8(uint8x16_t a, uint8x16_t b, uint8x16_t c) {
+ return vmlaq_u8(a, b, c);
+}
+
+// CHECK: test_vmlaq_u16
+// CHECK: vmla.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vmlaq_u16(uint16x8_t a, uint16x8_t b, uint16x8_t c) {
+ return vmlaq_u16(a, b, c);
+}
+
+// CHECK: test_vmlaq_u32
+// CHECK: vmla.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vmlaq_u32(uint32x4_t a, uint32x4_t b, uint32x4_t c) {
+ return vmlaq_u32(a, b, c);
+}
+
+
+// CHECK: test_vmlal_s8
+// CHECK: vmlal.s8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x8_t test_vmlal_s8(int16x8_t a, int8x8_t b, int8x8_t c) {
+ return vmlal_s8(a, b, c);
+}
+
+// CHECK: test_vmlal_s16
+// CHECK: vmlal.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vmlal_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ return vmlal_s16(a, b, c);
+}
+
+// CHECK: test_vmlal_s32
+// CHECK: vmlal.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vmlal_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ return vmlal_s32(a, b, c);
+}
+
+// CHECK: test_vmlal_u8
+// CHECK: vmlal.u8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x8_t test_vmlal_u8(uint16x8_t a, uint8x8_t b, uint8x8_t c) {
+ return vmlal_u8(a, b, c);
+}
+
+// CHECK: test_vmlal_u16
+// CHECK: vmlal.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vmlal_u16(uint32x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vmlal_u16(a, b, c);
+}
+
+// CHECK: test_vmlal_u32
+// CHECK: vmlal.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vmlal_u32(uint64x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vmlal_u32(a, b, c);
+}
+
+
+// CHECK: test_vmlal_lane_s16
+// CHECK: vmlal.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vmlal_lane_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ return vmlal_lane_s16(a, b, c, 3);
+}
+
+// CHECK: test_vmlal_lane_s32
+// CHECK: vmlal.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int64x2_t test_vmlal_lane_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ return vmlal_lane_s32(a, b, c, 1);
+}
+
+// CHECK: test_vmlal_lane_u16
+// CHECK: vmlal.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x4_t test_vmlal_lane_u16(uint32x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vmlal_lane_u16(a, b, c, 3);
+}
+
+// CHECK: test_vmlal_lane_u32
+// CHECK: vmlal.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint64x2_t test_vmlal_lane_u32(uint64x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vmlal_lane_u32(a, b, c, 1);
+}
+
+
+// CHECK: test_vmlal_n_s16
+// CHECK: vmlal.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vmlal_n_s16(int32x4_t a, int16x4_t b, int16_t c) {
+ return vmlal_n_s16(a, b, c);
+}
+
+// CHECK: test_vmlal_n_s32
+// CHECK: vmlal.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vmlal_n_s32(int64x2_t a, int32x2_t b, int32_t c) {
+ return vmlal_n_s32(a, b, c);
+}
+
+// CHECK: test_vmlal_n_u16
+// CHECK: vmlal.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vmlal_n_u16(uint32x4_t a, uint16x4_t b, uint16_t c) {
+ return vmlal_n_u16(a, b, c);
+}
+
+// CHECK: test_vmlal_n_u32
+// CHECK: vmlal.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vmlal_n_u32(uint64x2_t a, uint32x2_t b, uint32_t c) {
+ return vmlal_n_u32(a, b, c);
+}
+
+
+// CHECK: test_vmla_lane_s16
+// CHECK: vmla.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x4_t test_vmla_lane_s16(int16x4_t a, int16x4_t b, int16x4_t c) {
+ return vmla_lane_s16(a, b, c, 3);
+}
+
+// CHECK: test_vmla_lane_s32
+// CHECK: vmla.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x2_t test_vmla_lane_s32(int32x2_t a, int32x2_t b, int32x2_t c) {
+ return vmla_lane_s32(a, b, c, 1);
+}
+
+// CHECK: test_vmla_lane_u16
+// CHECK: vmla.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint16x4_t test_vmla_lane_u16(uint16x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vmla_lane_u16(a, b, c, 3);
+}
+
+// CHECK: test_vmla_lane_u32
+// CHECK: vmla.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x2_t test_vmla_lane_u32(uint32x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vmla_lane_u32(a, b, c, 1);
+}
+
+// CHECK: test_vmla_lane_f32
+// CHECK: vmul.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+// CHECK: vadd.f32
+float32x2_t test_vmla_lane_f32(float32x2_t a, float32x2_t b, float32x2_t c) {
+ return vmla_lane_f32(a, b, c, 1);
+}
+
+// CHECK: test_vmlaq_lane_s16
+// CHECK: vmla.i16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x8_t test_vmlaq_lane_s16(int16x8_t a, int16x8_t b, int16x4_t c) {
+ return vmlaq_lane_s16(a, b, c, 3);
+}
+
+// CHECK: test_vmlaq_lane_s32
+// CHECK: vmla.i32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vmlaq_lane_s32(int32x4_t a, int32x4_t b, int32x2_t c) {
+ return vmlaq_lane_s32(a, b, c, 1);
+}
+
+// CHECK: test_vmlaq_lane_u16
+// CHECK: vmla.i16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint16x8_t test_vmlaq_lane_u16(uint16x8_t a, uint16x8_t b, uint16x4_t c) {
+ return vmlaq_lane_u16(a, b, c, 3);
+}
+
+// CHECK: test_vmlaq_lane_u32
+// CHECK: vmla.i32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x4_t test_vmlaq_lane_u32(uint32x4_t a, uint32x4_t b, uint32x2_t c) {
+ return vmlaq_lane_u32(a, b, c, 1);
+}
+
+// CHECK: test_vmlaq_lane_f32
+// CHECK: vmul.f32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+// CHECK: vadd.f32
+float32x4_t test_vmlaq_lane_f32(float32x4_t a, float32x4_t b, float32x2_t c) {
+ return vmlaq_lane_f32(a, b, c, 1);
+}
+
+
+// CHECK: test_vmla_n_s16
+// CHECK: vmla.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vmla_n_s16(int16x4_t a, int16x4_t b, int16_t c) {
+ return vmla_n_s16(a, b, c);
+}
+
+// CHECK: test_vmla_n_s32
+// CHECK: vmla.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vmla_n_s32(int32x2_t a, int32x2_t b, int32_t c) {
+ return vmla_n_s32(a, b, c);
+}
+
+// CHECK: test_vmla_n_u16
+// CHECK: vmla.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vmla_n_u16(uint16x4_t a, uint16x4_t b, uint16_t c) {
+ return vmla_n_u16(a, b, c);
+}
+
+// CHECK: test_vmla_n_u32
+// CHECK: vmla.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vmla_n_u32(uint32x2_t a, uint32x2_t b, uint32_t c) {
+ return vmla_n_u32(a, b, c);
+}
+
+// CHECK: test_vmla_n_f32
+// CHECK: vmul.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+// CHECK: vadd.f32
+float32x2_t test_vmla_n_f32(float32x2_t a, float32x2_t b, float32_t c) {
+ return vmla_n_f32(a, b, c);
+}
+
+// CHECK: test_vmlaq_n_s16
+// CHECK: vmla.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vmlaq_n_s16(int16x8_t a, int16x8_t b, int16_t c) {
+ return vmlaq_n_s16(a, b, c);
+}
+
+// CHECK: test_vmlaq_n_s32
+// CHECK: vmla.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vmlaq_n_s32(int32x4_t a, int32x4_t b, int32_t c) {
+ return vmlaq_n_s32(a, b, c);
+}
+
+// CHECK: test_vmlaq_n_u16
+// CHECK: vmla.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vmlaq_n_u16(uint16x8_t a, uint16x8_t b, uint16_t c) {
+ return vmlaq_n_u16(a, b, c);
+}
+
+// CHECK: test_vmlaq_n_u32
+// CHECK: vmla.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vmlaq_n_u32(uint32x4_t a, uint32x4_t b, uint32_t c) {
+ return vmlaq_n_u32(a, b, c);
+}
+
+// CHECK: test_vmlaq_n_f32
+// CHECK: vmul.f32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[0]
+// CHECK: vadd.f32
+float32x4_t test_vmlaq_n_f32(float32x4_t a, float32x4_t b, float32_t c) {
+ return vmlaq_n_f32(a, b, c);
+}
+
+
+// CHECK: test_vmls_s8
+// CHECK: vmls.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vmls_s8(int8x8_t a, int8x8_t b, int8x8_t c) {
+ return vmls_s8(a, b, c);
+}
+
+// CHECK: test_vmls_s16
+// CHECK: vmls.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vmls_s16(int16x4_t a, int16x4_t b, int16x4_t c) {
+ return vmls_s16(a, b, c);
+}
+
+// CHECK: test_vmls_s32
+// CHECK: vmls.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vmls_s32(int32x2_t a, int32x2_t b, int32x2_t c) {
+ return vmls_s32(a, b, c);
+}
+
+// CHECK: test_vmls_f32
+// CHECK: vmul.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+// CHECK: vsub.f32
+float32x2_t test_vmls_f32(float32x2_t a, float32x2_t b, float32x2_t c) {
+ return vmls_f32(a, b, c);
+}
+
+// CHECK: test_vmls_u8
+// CHECK: vmls.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vmls_u8(uint8x8_t a, uint8x8_t b, uint8x8_t c) {
+ return vmls_u8(a, b, c);
+}
+
+// CHECK: test_vmls_u16
+// CHECK: vmls.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vmls_u16(uint16x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vmls_u16(a, b, c);
+}
+
+// CHECK: test_vmls_u32
+// CHECK: vmls.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vmls_u32(uint32x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vmls_u32(a, b, c);
+}
+
+// CHECK: test_vmlsq_s8
+// CHECK: vmls.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vmlsq_s8(int8x16_t a, int8x16_t b, int8x16_t c) {
+ return vmlsq_s8(a, b, c);
+}
+
+// CHECK: test_vmlsq_s16
+// CHECK: vmls.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vmlsq_s16(int16x8_t a, int16x8_t b, int16x8_t c) {
+ return vmlsq_s16(a, b, c);
+}
+
+// CHECK: test_vmlsq_s32
+// CHECK: vmls.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vmlsq_s32(int32x4_t a, int32x4_t b, int32x4_t c) {
+ return vmlsq_s32(a, b, c);
+}
+
+// CHECK: test_vmlsq_f32
+// CHECK: vmul.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+// CHECK: vsub.f32
+float32x4_t test_vmlsq_f32(float32x4_t a, float32x4_t b, float32x4_t c) {
+ return vmlsq_f32(a, b, c);
+}
+
+// CHECK: test_vmlsq_u8
+// CHECK: vmls.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vmlsq_u8(uint8x16_t a, uint8x16_t b, uint8x16_t c) {
+ return vmlsq_u8(a, b, c);
+}
+
+// CHECK: test_vmlsq_u16
+// CHECK: vmls.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vmlsq_u16(uint16x8_t a, uint16x8_t b, uint16x8_t c) {
+ return vmlsq_u16(a, b, c);
+}
+
+// CHECK: test_vmlsq_u32
+// CHECK: vmls.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vmlsq_u32(uint32x4_t a, uint32x4_t b, uint32x4_t c) {
+ return vmlsq_u32(a, b, c);
+}
+
+
+// CHECK: test_vmlsl_s8
+// CHECK: vmlsl.s8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x8_t test_vmlsl_s8(int16x8_t a, int8x8_t b, int8x8_t c) {
+ return vmlsl_s8(a, b, c);
+}
+
+// CHECK: test_vmlsl_s16
+// CHECK: vmlsl.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vmlsl_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ return vmlsl_s16(a, b, c);
+}
+
+// CHECK: test_vmlsl_s32
+// CHECK: vmlsl.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vmlsl_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ return vmlsl_s32(a, b, c);
+}
+
+// CHECK: test_vmlsl_u8
+// CHECK: vmlsl.u8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x8_t test_vmlsl_u8(uint16x8_t a, uint8x8_t b, uint8x8_t c) {
+ return vmlsl_u8(a, b, c);
+}
+
+// CHECK: test_vmlsl_u16
+// CHECK: vmlsl.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vmlsl_u16(uint32x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vmlsl_u16(a, b, c);
+}
+
+// CHECK: test_vmlsl_u32
+// CHECK: vmlsl.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vmlsl_u32(uint64x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vmlsl_u32(a, b, c);
+}
+
+
+// CHECK: test_vmlsl_lane_s16
+// CHECK: vmlsl.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vmlsl_lane_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ return vmlsl_lane_s16(a, b, c, 3);
+}
+
+// CHECK: test_vmlsl_lane_s32
+// CHECK: vmlsl.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int64x2_t test_vmlsl_lane_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ return vmlsl_lane_s32(a, b, c, 1);
+}
+
+// CHECK: test_vmlsl_lane_u16
+// CHECK: vmlsl.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x4_t test_vmlsl_lane_u16(uint32x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vmlsl_lane_u16(a, b, c, 3);
+}
+
+// CHECK: test_vmlsl_lane_u32
+// CHECK: vmlsl.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint64x2_t test_vmlsl_lane_u32(uint64x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vmlsl_lane_u32(a, b, c, 1);
+}
+
+
+// CHECK: test_vmlsl_n_s16
+// CHECK: vmlsl.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vmlsl_n_s16(int32x4_t a, int16x4_t b, int16_t c) {
+ return vmlsl_n_s16(a, b, c);
+}
+
+// CHECK: test_vmlsl_n_s32
+// CHECK: vmlsl.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vmlsl_n_s32(int64x2_t a, int32x2_t b, int32_t c) {
+ return vmlsl_n_s32(a, b, c);
+}
+
+// CHECK: test_vmlsl_n_u16
+// CHECK: vmlsl.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vmlsl_n_u16(uint32x4_t a, uint16x4_t b, uint16_t c) {
+ return vmlsl_n_u16(a, b, c);
+}
+
+// CHECK: test_vmlsl_n_u32
+// CHECK: vmlsl.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vmlsl_n_u32(uint64x2_t a, uint32x2_t b, uint32_t c) {
+ return vmlsl_n_u32(a, b, c);
+}
+
+
+// CHECK: test_vmls_lane_s16
+// CHECK: vmls.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x4_t test_vmls_lane_s16(int16x4_t a, int16x4_t b, int16x4_t c) {
+ return vmls_lane_s16(a, b, c, 3);
+}
+
+// CHECK: test_vmls_lane_s32
+// CHECK: vmls.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x2_t test_vmls_lane_s32(int32x2_t a, int32x2_t b, int32x2_t c) {
+ return vmls_lane_s32(a, b, c, 1);
+}
+
+// CHECK: test_vmls_lane_u16
+// CHECK: vmls.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint16x4_t test_vmls_lane_u16(uint16x4_t a, uint16x4_t b, uint16x4_t c) {
+ return vmls_lane_u16(a, b, c, 3);
+}
+
+// CHECK: test_vmls_lane_u32
+// CHECK: vmls.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x2_t test_vmls_lane_u32(uint32x2_t a, uint32x2_t b, uint32x2_t c) {
+ return vmls_lane_u32(a, b, c, 1);
+}
+
+// CHECK: test_vmls_lane_f32
+// CHECK: vmul.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+// CHECK: vsub.f32
+float32x2_t test_vmls_lane_f32(float32x2_t a, float32x2_t b, float32x2_t c) {
+ return vmls_lane_f32(a, b, c, 1);
+}
+
+// CHECK: test_vmlsq_lane_s16
+// CHECK: vmls.i16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x8_t test_vmlsq_lane_s16(int16x8_t a, int16x8_t b, int16x4_t c) {
+ return vmlsq_lane_s16(a, b, c, 3);
+}
+
+// CHECK: test_vmlsq_lane_s32
+// CHECK: vmls.i32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vmlsq_lane_s32(int32x4_t a, int32x4_t b, int32x2_t c) {
+ return vmlsq_lane_s32(a, b, c, 1);
+}
+
+// CHECK: test_vmlsq_lane_u16
+// CHECK: vmls.i16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint16x8_t test_vmlsq_lane_u16(uint16x8_t a, uint16x8_t b, uint16x4_t c) {
+ return vmlsq_lane_u16(a, b, c, 3);
+}
+
+// CHECK: test_vmlsq_lane_u32
+// CHECK: vmls.i32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x4_t test_vmlsq_lane_u32(uint32x4_t a, uint32x4_t b, uint32x2_t c) {
+ return vmlsq_lane_u32(a, b, c, 1);
+}
+
+// CHECK: test_vmlsq_lane_f32
+// CHECK: vmul.f32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+// CHECK: vsub.f32
+float32x4_t test_vmlsq_lane_f32(float32x4_t a, float32x4_t b, float32x2_t c) {
+ return vmlsq_lane_f32(a, b, c, 1);
+}
+
+
+// CHECK: test_vmls_n_s16
+// CHECK: vmls.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vmls_n_s16(int16x4_t a, int16x4_t b, int16_t c) {
+ return vmls_n_s16(a, b, c);
+}
+
+// CHECK: test_vmls_n_s32
+// CHECK: vmls.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vmls_n_s32(int32x2_t a, int32x2_t b, int32_t c) {
+ return vmls_n_s32(a, b, c);
+}
+
+// CHECK: test_vmls_n_u16
+// CHECK: vmls.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vmls_n_u16(uint16x4_t a, uint16x4_t b, uint16_t c) {
+ return vmls_n_u16(a, b, c);
+}
+
+// CHECK: test_vmls_n_u32
+// CHECK: vmls.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vmls_n_u32(uint32x2_t a, uint32x2_t b, uint32_t c) {
+ return vmls_n_u32(a, b, c);
+}
+
+// CHECK: test_vmls_n_f32
+// CHECK: vmul.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+// CHECK: vsub.f32
+float32x2_t test_vmls_n_f32(float32x2_t a, float32x2_t b, float32_t c) {
+ return vmls_n_f32(a, b, c);
+}
+
+// CHECK: test_vmlsq_n_s16
+// CHECK: vmls.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vmlsq_n_s16(int16x8_t a, int16x8_t b, int16_t c) {
+ return vmlsq_n_s16(a, b, c);
+}
+
+// CHECK: test_vmlsq_n_s32
+// CHECK: vmls.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vmlsq_n_s32(int32x4_t a, int32x4_t b, int32_t c) {
+ return vmlsq_n_s32(a, b, c);
+}
+
+// CHECK: test_vmlsq_n_u16
+// CHECK: vmls.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vmlsq_n_u16(uint16x8_t a, uint16x8_t b, uint16_t c) {
+ return vmlsq_n_u16(a, b, c);
+}
+
+// CHECK: test_vmlsq_n_u32
+// CHECK: vmls.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vmlsq_n_u32(uint32x4_t a, uint32x4_t b, uint32_t c) {
+ return vmlsq_n_u32(a, b, c);
+}
+
+// CHECK: test_vmlsq_n_f32
+// CHECK: vmul.f32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[0]
+// CHECK: vsub.f32
+float32x4_t test_vmlsq_n_f32(float32x4_t a, float32x4_t b, float32_t c) {
+ return vmlsq_n_f32(a, b, c);
+}
+
+
+// CHECK: test_vmovl_s8
+// CHECK: vmovl.s8 q{{[0-9]+}}, d{{[0-9]+}}
+int16x8_t test_vmovl_s8(int8x8_t a) {
+ return vmovl_s8(a);
+}
+
+// CHECK: test_vmovl_s16
+// CHECK: vmovl.s16 q{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vmovl_s16(int16x4_t a) {
+ return vmovl_s16(a);
+}
+
+// CHECK: test_vmovl_s32
+// CHECK: vmovl.s32 q{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vmovl_s32(int32x2_t a) {
+ return vmovl_s32(a);
+}
+
+// CHECK: test_vmovl_u8
+// CHECK: vmovl.u8 q{{[0-9]+}}, d{{[0-9]+}}
+uint16x8_t test_vmovl_u8(uint8x8_t a) {
+ return vmovl_u8(a);
+}
+
+// CHECK: test_vmovl_u16
+// CHECK: vmovl.u16 q{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vmovl_u16(uint16x4_t a) {
+ return vmovl_u16(a);
+}
+
+// CHECK: test_vmovl_u32
+// CHECK: vmovl.u32 q{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vmovl_u32(uint32x2_t a) {
+ return vmovl_u32(a);
+}
+
+
+// CHECK: test_vmovn_s16
+// CHECK: vmovn.i16 d{{[0-9]+}}, q{{[0-9]+}}
+int8x8_t test_vmovn_s16(int16x8_t a) {
+ return vmovn_s16(a);
+}
+
+// CHECK: test_vmovn_s32
+// CHECK: vmovn.i32 d{{[0-9]+}}, q{{[0-9]+}}
+int16x4_t test_vmovn_s32(int32x4_t a) {
+ return vmovn_s32(a);
+}
+
+// CHECK: test_vmovn_s64
+// CHECK: vmovn.i64 d{{[0-9]+}}, q{{[0-9]+}}
+int32x2_t test_vmovn_s64(int64x2_t a) {
+ return vmovn_s64(a);
+}
+
+// CHECK: test_vmovn_u16
+// CHECK: vmovn.i16 d{{[0-9]+}}, q{{[0-9]+}}
+uint8x8_t test_vmovn_u16(uint16x8_t a) {
+ return vmovn_u16(a);
+}
+
+// CHECK: test_vmovn_u32
+// CHECK: vmovn.i32 d{{[0-9]+}}, q{{[0-9]+}}
+uint16x4_t test_vmovn_u32(uint32x4_t a) {
+ return vmovn_u32(a);
+}
+
+// CHECK: test_vmovn_u64
+// CHECK: vmovn.i64 d{{[0-9]+}}, q{{[0-9]+}}
+uint32x2_t test_vmovn_u64(uint64x2_t a) {
+ return vmovn_u64(a);
+}
+
+
+// CHECK: test_vmov_n_u8
+// CHECK: vmov
+uint8x8_t test_vmov_n_u8(uint8_t a) {
+ return vmov_n_u8(a);
+}
+
+// CHECK: test_vmov_n_u16
+// CHECK: vmov
+uint16x4_t test_vmov_n_u16(uint16_t a) {
+ return vmov_n_u16(a);
+}
+
+// CHECK: test_vmov_n_u32
+// CHECK: vmov
+uint32x2_t test_vmov_n_u32(uint32_t a) {
+ return vmov_n_u32(a);
+}
+
+// CHECK: test_vmov_n_s8
+// CHECK: vmov
+int8x8_t test_vmov_n_s8(int8_t a) {
+ return vmov_n_s8(a);
+}
+
+// CHECK: test_vmov_n_s16
+// CHECK: vmov
+int16x4_t test_vmov_n_s16(int16_t a) {
+ return vmov_n_s16(a);
+}
+
+// CHECK: test_vmov_n_s32
+// CHECK: vmov
+int32x2_t test_vmov_n_s32(int32_t a) {
+ return vmov_n_s32(a);
+}
+
+// CHECK: test_vmov_n_p8
+// CHECK: vmov
+poly8x8_t test_vmov_n_p8(poly8_t a) {
+ return vmov_n_p8(a);
+}
+
+// CHECK: test_vmov_n_p16
+// CHECK: vmov
+poly16x4_t test_vmov_n_p16(poly16_t a) {
+ return vmov_n_p16(a);
+}
+
+// CHECK: test_vmov_n_f32
+// CHECK: vmov
+float32x2_t test_vmov_n_f32(float32_t a) {
+ return vmov_n_f32(a);
+}
+
+// CHECK: test_vmovq_n_u8
+// CHECK: vmov
+uint8x16_t test_vmovq_n_u8(uint8_t a) {
+ return vmovq_n_u8(a);
+}
+
+// CHECK: test_vmovq_n_u16
+// CHECK: vmov
+uint16x8_t test_vmovq_n_u16(uint16_t a) {
+ return vmovq_n_u16(a);
+}
+
+// CHECK: test_vmovq_n_u32
+// CHECK: vmov
+uint32x4_t test_vmovq_n_u32(uint32_t a) {
+ return vmovq_n_u32(a);
+}
+
+// CHECK: test_vmovq_n_s8
+// CHECK: vmov
+int8x16_t test_vmovq_n_s8(int8_t a) {
+ return vmovq_n_s8(a);
+}
+
+// CHECK: test_vmovq_n_s16
+// CHECK: vmov
+int16x8_t test_vmovq_n_s16(int16_t a) {
+ return vmovq_n_s16(a);
+}
+
+// CHECK: test_vmovq_n_s32
+// CHECK: vmov
+int32x4_t test_vmovq_n_s32(int32_t a) {
+ return vmovq_n_s32(a);
+}
+
+// CHECK: test_vmovq_n_p8
+// CHECK: vmov
+poly8x16_t test_vmovq_n_p8(poly8_t a) {
+ return vmovq_n_p8(a);
+}
+
+// CHECK: test_vmovq_n_p16
+// CHECK: vmov
+poly16x8_t test_vmovq_n_p16(poly16_t a) {
+ return vmovq_n_p16(a);
+}
+
+// CHECK: test_vmovq_n_f32
+// CHECK: vmov
+float32x4_t test_vmovq_n_f32(float32_t a) {
+ return vmovq_n_f32(a);
+}
+
+// CHECK: test_vmov_n_s64
+// CHECK: vmov
+int64x1_t test_vmov_n_s64(int64_t a) {
+ return vmov_n_s64(a);
+}
+
+// CHECK: test_vmov_n_u64
+// CHECK: vmov
+uint64x1_t test_vmov_n_u64(uint64_t a) {
+ return vmov_n_u64(a);
+}
+
+// CHECK: test_vmovq_n_s64
+// CHECK: vmov
+int64x2_t test_vmovq_n_s64(int64_t a) {
+ return vmovq_n_s64(a);
+}
+
+// CHECK: test_vmovq_n_u64
+// CHECK: vmov
+uint64x2_t test_vmovq_n_u64(uint64_t a) {
+ return vmovq_n_u64(a);
+}
+
+
+// CHECK: test_vmul_s8
+// CHECK: vmul.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vmul_s8(int8x8_t a, int8x8_t b) {
+ return vmul_s8(a, b);
+}
+
+// CHECK: test_vmul_s16
+// CHECK: vmul.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vmul_s16(int16x4_t a, int16x4_t b) {
+ return vmul_s16(a, b);
+}
+
+// CHECK: test_vmul_s32
+// CHECK: vmul.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vmul_s32(int32x2_t a, int32x2_t b) {
+ return vmul_s32(a, b);
+}
+
+// CHECK: test_vmul_f32
+// CHECK: vmul.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vmul_f32(float32x2_t a, float32x2_t b) {
+ return vmul_f32(a, b);
+}
+
+// CHECK: test_vmul_u8
+// CHECK: vmul.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vmul_u8(uint8x8_t a, uint8x8_t b) {
+ return vmul_u8(a, b);
+}
+
+// CHECK: test_vmul_u16
+// CHECK: vmul.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vmul_u16(uint16x4_t a, uint16x4_t b) {
+ return vmul_u16(a, b);
+}
+
+// CHECK: test_vmul_u32
+// CHECK: vmul.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vmul_u32(uint32x2_t a, uint32x2_t b) {
+ return vmul_u32(a, b);
+}
+
+// CHECK: test_vmulq_s8
+// CHECK: vmul.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vmulq_s8(int8x16_t a, int8x16_t b) {
+ return vmulq_s8(a, b);
+}
+
+// CHECK: test_vmulq_s16
+// CHECK: vmul.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vmulq_s16(int16x8_t a, int16x8_t b) {
+ return vmulq_s16(a, b);
+}
+
+// CHECK: test_vmulq_s32
+// CHECK: vmul.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vmulq_s32(int32x4_t a, int32x4_t b) {
+ return vmulq_s32(a, b);
+}
+
+// CHECK: test_vmulq_f32
+// CHECK: vmul.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vmulq_f32(float32x4_t a, float32x4_t b) {
+ return vmulq_f32(a, b);
+}
+
+// CHECK: test_vmulq_u8
+// CHECK: vmul.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vmulq_u8(uint8x16_t a, uint8x16_t b) {
+ return vmulq_u8(a, b);
+}
+
+// CHECK: test_vmulq_u16
+// CHECK: vmul.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vmulq_u16(uint16x8_t a, uint16x8_t b) {
+ return vmulq_u16(a, b);
+}
+
+// CHECK: test_vmulq_u32
+// CHECK: vmul.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vmulq_u32(uint32x4_t a, uint32x4_t b) {
+ return vmulq_u32(a, b);
+}
+
+
+// CHECK: test_vmull_s8
+// CHECK: vmull.s8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x8_t test_vmull_s8(int8x8_t a, int8x8_t b) {
+ return vmull_s8(a, b);
+}
+
+// CHECK: test_vmull_s16
+// CHECK: vmull.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vmull_s16(int16x4_t a, int16x4_t b) {
+ return vmull_s16(a, b);
+}
+
+// CHECK: test_vmull_s32
+// CHECK: vmull.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vmull_s32(int32x2_t a, int32x2_t b) {
+ return vmull_s32(a, b);
+}
+
+// CHECK: test_vmull_u8
+// CHECK: vmull.u8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x8_t test_vmull_u8(uint8x8_t a, uint8x8_t b) {
+ return vmull_u8(a, b);
+}
+
+// CHECK: test_vmull_u16
+// CHECK: vmull.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vmull_u16(uint16x4_t a, uint16x4_t b) {
+ return vmull_u16(a, b);
+}
+
+// CHECK: test_vmull_u32
+// CHECK: vmull.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vmull_u32(uint32x2_t a, uint32x2_t b) {
+ return vmull_u32(a, b);
+}
+
+// CHECK: test_vmull_p8
+// CHECK: vmull.p8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+poly16x8_t test_vmull_p8(poly8x8_t a, poly8x8_t b) {
+ return vmull_p8(a, b);
+}
+
+
+// CHECK: test_vmull_lane_s16
+// CHECK: vmull.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vmull_lane_s16(int16x4_t a, int16x4_t b) {
+ return vmull_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vmull_lane_s32
+// CHECK: vmull.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int64x2_t test_vmull_lane_s32(int32x2_t a, int32x2_t b) {
+ return vmull_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vmull_lane_u16
+// CHECK: vmull.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x4_t test_vmull_lane_u16(uint16x4_t a, uint16x4_t b) {
+ return vmull_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vmull_lane_u32
+// CHECK: vmull.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint64x2_t test_vmull_lane_u32(uint32x2_t a, uint32x2_t b) {
+ return vmull_lane_u32(a, b, 1);
+}
+
+
+// CHECK: test_vmull_n_s16
+// CHECK: vmull.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vmull_n_s16(int16x4_t a, int16_t b) {
+ return vmull_n_s16(a, b);
+}
+
+// CHECK: test_vmull_n_s32
+// CHECK: vmull.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vmull_n_s32(int32x2_t a, int32_t b) {
+ return vmull_n_s32(a, b);
+}
+
+// CHECK: test_vmull_n_u16
+// CHECK: vmull.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vmull_n_u16(uint16x4_t a, uint16_t b) {
+ return vmull_n_u16(a, b);
+}
+
+// CHECK: test_vmull_n_u32
+// CHECK: vmull.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vmull_n_u32(uint32x2_t a, uint32_t b) {
+ return vmull_n_u32(a, b);
+}
+
+
+// CHECK: test_vmul_p8
+// CHECK: vmul.p8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+poly8x8_t test_vmul_p8(poly8x8_t a, poly8x8_t b) {
+ return vmul_p8(a, b);
+}
+
+// CHECK: test_vmulq_p8
+// CHECK: vmul.p8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+poly8x16_t test_vmulq_p8(poly8x16_t a, poly8x16_t b) {
+ return vmulq_p8(a, b);
+}
+
+
+// CHECK: test_vmul_lane_s16
+// CHECK: vmul.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x4_t test_vmul_lane_s16(int16x4_t a, int16x4_t b) {
+ return vmul_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vmul_lane_s32
+// CHECK: vmul.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x2_t test_vmul_lane_s32(int32x2_t a, int32x2_t b) {
+ return vmul_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vmul_lane_f32
+// CHECK: vmul.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+float32x2_t test_vmul_lane_f32(float32x2_t a, float32x2_t b) {
+ return vmul_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vmul_lane_u16
+// CHECK: vmul.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint16x4_t test_vmul_lane_u16(uint16x4_t a, uint16x4_t b) {
+ return vmul_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vmul_lane_u32
+// CHECK: vmul.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x2_t test_vmul_lane_u32(uint32x2_t a, uint32x2_t b) {
+ return vmul_lane_u32(a, b, 1);
+}
+
+// CHECK: test_vmulq_lane_s16
+// CHECK: vmul.i16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x8_t test_vmulq_lane_s16(int16x8_t a, int16x4_t b) {
+ return vmulq_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vmulq_lane_s32
+// CHECK: vmul.i32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vmulq_lane_s32(int32x4_t a, int32x2_t b) {
+ return vmulq_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vmulq_lane_f32
+// CHECK: vmul.f32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+float32x4_t test_vmulq_lane_f32(float32x4_t a, float32x2_t b) {
+ return vmulq_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vmulq_lane_u16
+// CHECK: vmul.i16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint16x8_t test_vmulq_lane_u16(uint16x8_t a, uint16x4_t b) {
+ return vmulq_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vmulq_lane_u32
+// CHECK: vmul.i32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+uint32x4_t test_vmulq_lane_u32(uint32x4_t a, uint32x2_t b) {
+ return vmulq_lane_u32(a, b, 1);
+}
+
+
+// CHECK: test_vmul_n_s16
+// CHECK: vmul.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vmul_n_s16(int16x4_t a, int16_t b) {
+ return vmul_n_s16(a, b);
+}
+
+// CHECK: test_vmul_n_s32
+// CHECK: vmul.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vmul_n_s32(int32x2_t a, int32_t b) {
+ return vmul_n_s32(a, b);
+}
+
+// CHECK: test_vmul_n_f32
+// CHECK: vmul.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vmul_n_f32(float32x2_t a, float32_t b) {
+ return vmul_n_f32(a, b);
+}
+
+// CHECK: test_vmul_n_u16
+// CHECK: vmul.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vmul_n_u16(uint16x4_t a, uint16_t b) {
+ return vmul_n_u16(a, b);
+}
+
+// CHECK: test_vmul_n_u32
+// CHECK: vmul.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vmul_n_u32(uint32x2_t a, uint32_t b) {
+ return vmul_n_u32(a, b);
+}
+
+// CHECK: test_vmulq_n_s16
+// CHECK: vmul.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vmulq_n_s16(int16x8_t a, int16_t b) {
+ return vmulq_n_s16(a, b);
+}
+
+// CHECK: test_vmulq_n_s32
+// CHECK: vmul.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vmulq_n_s32(int32x4_t a, int32_t b) {
+ return vmulq_n_s32(a, b);
+}
+
+// CHECK: test_vmulq_n_f32
+// CHECK: vmul.f32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[0]
+float32x4_t test_vmulq_n_f32(float32x4_t a, float32_t b) {
+ return vmulq_n_f32(a, b);
+}
+
+// CHECK: test_vmulq_n_u16
+// CHECK: vmul.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vmulq_n_u16(uint16x8_t a, uint16_t b) {
+ return vmulq_n_u16(a, b);
+}
+
+// CHECK: test_vmulq_n_u32
+// CHECK: vmul.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vmulq_n_u32(uint32x4_t a, uint32_t b) {
+ return vmulq_n_u32(a, b);
+}
+
+
+// CHECK: test_vmvn_s8
+// CHECK: vmvn d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vmvn_s8(int8x8_t a) {
+ return vmvn_s8(a);
+}
+
+// CHECK: test_vmvn_s16
+// CHECK: vmvn d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vmvn_s16(int16x4_t a) {
+ return vmvn_s16(a);
+}
+
+// CHECK: test_vmvn_s32
+// CHECK: vmvn d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vmvn_s32(int32x2_t a) {
+ return vmvn_s32(a);
+}
+
+// CHECK: test_vmvn_u8
+// CHECK: vmvn d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vmvn_u8(uint8x8_t a) {
+ return vmvn_u8(a);
+}
+
+// CHECK: test_vmvn_u16
+// CHECK: vmvn d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vmvn_u16(uint16x4_t a) {
+ return vmvn_u16(a);
+}
+
+// CHECK: test_vmvn_u32
+// CHECK: vmvn d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vmvn_u32(uint32x2_t a) {
+ return vmvn_u32(a);
+}
+
+// CHECK: test_vmvn_p8
+// CHECK: vmvn d{{[0-9]+}}, d{{[0-9]+}}
+poly8x8_t test_vmvn_p8(poly8x8_t a) {
+ return vmvn_p8(a);
+}
+
+// CHECK: test_vmvnq_s8
+// CHECK: vmvn q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vmvnq_s8(int8x16_t a) {
+ return vmvnq_s8(a);
+}
+
+// CHECK: test_vmvnq_s16
+// CHECK: vmvn q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vmvnq_s16(int16x8_t a) {
+ return vmvnq_s16(a);
+}
+
+// CHECK: test_vmvnq_s32
+// CHECK: vmvn q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vmvnq_s32(int32x4_t a) {
+ return vmvnq_s32(a);
+}
+
+// CHECK: test_vmvnq_u8
+// CHECK: vmvn q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vmvnq_u8(uint8x16_t a) {
+ return vmvnq_u8(a);
+}
+
+// CHECK: test_vmvnq_u16
+// CHECK: vmvn q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vmvnq_u16(uint16x8_t a) {
+ return vmvnq_u16(a);
+}
+
+// CHECK: test_vmvnq_u32
+// CHECK: vmvn q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vmvnq_u32(uint32x4_t a) {
+ return vmvnq_u32(a);
+}
+
+// CHECK: test_vmvnq_p8
+// CHECK: vmvn q{{[0-9]+}}, q{{[0-9]+}}
+poly8x16_t test_vmvnq_p8(poly8x16_t a) {
+ return vmvnq_p8(a);
+}
+
+
+// CHECK: test_vneg_s8
+// CHECK: vneg.s8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vneg_s8(int8x8_t a) {
+ return vneg_s8(a);
+}
+
+// CHECK: test_vneg_s16
+// CHECK: vneg.s16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vneg_s16(int16x4_t a) {
+ return vneg_s16(a);
+}
+
+// CHECK: test_vneg_s32
+// CHECK: vneg.s32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vneg_s32(int32x2_t a) {
+ return vneg_s32(a);
+}
+
+// CHECK: test_vneg_f32
+// CHECK: vneg.f32 d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vneg_f32(float32x2_t a) {
+ return vneg_f32(a);
+}
+
+// CHECK: test_vnegq_s8
+// CHECK: vneg.s8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vnegq_s8(int8x16_t a) {
+ return vnegq_s8(a);
+}
+
+// CHECK: test_vnegq_s16
+// CHECK: vneg.s16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vnegq_s16(int16x8_t a) {
+ return vnegq_s16(a);
+}
+
+// CHECK: test_vnegq_s32
+// CHECK: vneg.s32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vnegq_s32(int32x4_t a) {
+ return vnegq_s32(a);
+}
+
+// CHECK: test_vnegq_f32
+// CHECK: vneg.f32 q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vnegq_f32(float32x4_t a) {
+ return vnegq_f32(a);
+}
+
+
+// CHECK: test_vorn_s8
+// CHECK: vorn d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vorn_s8(int8x8_t a, int8x8_t b) {
+ return vorn_s8(a, b);
+}
+
+// CHECK: test_vorn_s16
+// CHECK: vorn d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vorn_s16(int16x4_t a, int16x4_t b) {
+ return vorn_s16(a, b);
+}
+
+// CHECK: test_vorn_s32
+// CHECK: vorn d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vorn_s32(int32x2_t a, int32x2_t b) {
+ return vorn_s32(a, b);
+}
+
+// CHECK: test_vorn_s64
+// CHECK: vorn d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vorn_s64(int64x1_t a, int64x1_t b) {
+ return vorn_s64(a, b);
+}
+
+// CHECK: test_vorn_u8
+// CHECK: vorn d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vorn_u8(uint8x8_t a, uint8x8_t b) {
+ return vorn_u8(a, b);
+}
+
+// CHECK: test_vorn_u16
+// CHECK: vorn d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vorn_u16(uint16x4_t a, uint16x4_t b) {
+ return vorn_u16(a, b);
+}
+
+// CHECK: test_vorn_u32
+// CHECK: vorn d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vorn_u32(uint32x2_t a, uint32x2_t b) {
+ return vorn_u32(a, b);
+}
+
+// CHECK: test_vorn_u64
+// CHECK: vorn d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vorn_u64(uint64x1_t a, uint64x1_t b) {
+ return vorn_u64(a, b);
+}
+
+// CHECK: test_vornq_s8
+// CHECK: vorn q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vornq_s8(int8x16_t a, int8x16_t b) {
+ return vornq_s8(a, b);
+}
+
+// CHECK: test_vornq_s16
+// CHECK: vorn q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vornq_s16(int16x8_t a, int16x8_t b) {
+ return vornq_s16(a, b);
+}
+
+// CHECK: test_vornq_s32
+// CHECK: vorn q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vornq_s32(int32x4_t a, int32x4_t b) {
+ return vornq_s32(a, b);
+}
+
+// CHECK: test_vornq_s64
+// CHECK: vorn q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vornq_s64(int64x2_t a, int64x2_t b) {
+ return vornq_s64(a, b);
+}
+
+// CHECK: test_vornq_u8
+// CHECK: vorn q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vornq_u8(uint8x16_t a, uint8x16_t b) {
+ return vornq_u8(a, b);
+}
+
+// CHECK: test_vornq_u16
+// CHECK: vorn q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vornq_u16(uint16x8_t a, uint16x8_t b) {
+ return vornq_u16(a, b);
+}
+
+// CHECK: test_vornq_u32
+// CHECK: vorn q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vornq_u32(uint32x4_t a, uint32x4_t b) {
+ return vornq_u32(a, b);
+}
+
+// CHECK: test_vornq_u64
+// CHECK: vorn q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vornq_u64(uint64x2_t a, uint64x2_t b) {
+ return vornq_u64(a, b);
+}
+
+
+// CHECK: test_vorr_s8
+// CHECK: vorr d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vorr_s8(int8x8_t a, int8x8_t b) {
+ return vorr_s8(a, b);
+}
+
+// CHECK: test_vorr_s16
+// CHECK: vorr d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vorr_s16(int16x4_t a, int16x4_t b) {
+ return vorr_s16(a, b);
+}
+
+// CHECK: test_vorr_s32
+// CHECK: vorr d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vorr_s32(int32x2_t a, int32x2_t b) {
+ return vorr_s32(a, b);
+}
+
+// CHECK: test_vorr_s64
+// CHECK: vorr d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vorr_s64(int64x1_t a, int64x1_t b) {
+ return vorr_s64(a, b);
+}
+
+// CHECK: test_vorr_u8
+// CHECK: vorr d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vorr_u8(uint8x8_t a, uint8x8_t b) {
+ return vorr_u8(a, b);
+}
+
+// CHECK: test_vorr_u16
+// CHECK: vorr d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vorr_u16(uint16x4_t a, uint16x4_t b) {
+ return vorr_u16(a, b);
+}
+
+// CHECK: test_vorr_u32
+// CHECK: vorr d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vorr_u32(uint32x2_t a, uint32x2_t b) {
+ return vorr_u32(a, b);
+}
+
+// CHECK: test_vorr_u64
+// CHECK: vorr d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vorr_u64(uint64x1_t a, uint64x1_t b) {
+ return vorr_u64(a, b);
+}
+
+// CHECK: test_vorrq_s8
+// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vorrq_s8(int8x16_t a, int8x16_t b) {
+ return vorrq_s8(a, b);
+}
+
+// CHECK: test_vorrq_s16
+// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vorrq_s16(int16x8_t a, int16x8_t b) {
+ return vorrq_s16(a, b);
+}
+
+// CHECK: test_vorrq_s32
+// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vorrq_s32(int32x4_t a, int32x4_t b) {
+ return vorrq_s32(a, b);
+}
+
+// CHECK: test_vorrq_s64
+// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vorrq_s64(int64x2_t a, int64x2_t b) {
+ return vorrq_s64(a, b);
+}
+
+// CHECK: test_vorrq_u8
+// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vorrq_u8(uint8x16_t a, uint8x16_t b) {
+ return vorrq_u8(a, b);
+}
+
+// CHECK: test_vorrq_u16
+// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vorrq_u16(uint16x8_t a, uint16x8_t b) {
+ return vorrq_u16(a, b);
+}
+
+// CHECK: test_vorrq_u32
+// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vorrq_u32(uint32x4_t a, uint32x4_t b) {
+ return vorrq_u32(a, b);
+}
+
+// CHECK: test_vorrq_u64
+// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vorrq_u64(uint64x2_t a, uint64x2_t b) {
+ return vorrq_u64(a, b);
+}
+
+
+// CHECK: test_vpadal_s8
+// CHECK: vpadal.s8 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vpadal_s8(int16x4_t a, int8x8_t b) {
+ return vpadal_s8(a, b);
+}
+
+// CHECK: test_vpadal_s16
+// CHECK: vpadal.s16 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vpadal_s16(int32x2_t a, int16x4_t b) {
+ return vpadal_s16(a, b);
+}
+
+// CHECK: test_vpadal_s32
+// CHECK: vpadal.s32 d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vpadal_s32(int64x1_t a, int32x2_t b) {
+ return vpadal_s32(a, b);
+}
+
+// CHECK: test_vpadal_u8
+// CHECK: vpadal.u8 d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vpadal_u8(uint16x4_t a, uint8x8_t b) {
+ return vpadal_u8(a, b);
+}
+
+// CHECK: test_vpadal_u16
+// CHECK: vpadal.u16 d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vpadal_u16(uint32x2_t a, uint16x4_t b) {
+ return vpadal_u16(a, b);
+}
+
+// CHECK: test_vpadal_u32
+// CHECK: vpadal.u32 d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vpadal_u32(uint64x1_t a, uint32x2_t b) {
+ return vpadal_u32(a, b);
+}
+
+// CHECK: test_vpadalq_s8
+// CHECK: vpadal.s8 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vpadalq_s8(int16x8_t a, int8x16_t b) {
+ return vpadalq_s8(a, b);
+}
+
+// CHECK: test_vpadalq_s16
+// CHECK: vpadal.s16 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vpadalq_s16(int32x4_t a, int16x8_t b) {
+ return vpadalq_s16(a, b);
+}
+
+// CHECK: test_vpadalq_s32
+// CHECK: vpadal.s32 q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vpadalq_s32(int64x2_t a, int32x4_t b) {
+ return vpadalq_s32(a, b);
+}
+
+// CHECK: test_vpadalq_u8
+// CHECK: vpadal.u8 q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vpadalq_u8(uint16x8_t a, uint8x16_t b) {
+ return vpadalq_u8(a, b);
+}
+
+// CHECK: test_vpadalq_u16
+// CHECK: vpadal.u16 q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vpadalq_u16(uint32x4_t a, uint16x8_t b) {
+ return vpadalq_u16(a, b);
+}
+
+// CHECK: test_vpadalq_u32
+// CHECK: vpadal.u32 q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vpadalq_u32(uint64x2_t a, uint32x4_t b) {
+ return vpadalq_u32(a, b);
+}
+
+
+// CHECK: test_vpadd_s8
+// CHECK: vpadd.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vpadd_s8(int8x8_t a, int8x8_t b) {
+ return vpadd_s8(a, b);
+}
+
+// CHECK: test_vpadd_s16
+// CHECK: vpadd.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vpadd_s16(int16x4_t a, int16x4_t b) {
+ return vpadd_s16(a, b);
+}
+
+// CHECK: test_vpadd_s32
+// CHECK: vpadd.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vpadd_s32(int32x2_t a, int32x2_t b) {
+ return vpadd_s32(a, b);
+}
+
+// CHECK: test_vpadd_u8
+// CHECK: vpadd.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vpadd_u8(uint8x8_t a, uint8x8_t b) {
+ return vpadd_u8(a, b);
+}
+
+// CHECK: test_vpadd_u16
+// CHECK: vpadd.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vpadd_u16(uint16x4_t a, uint16x4_t b) {
+ return vpadd_u16(a, b);
+}
+
+// CHECK: test_vpadd_u32
+// CHECK: vpadd.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vpadd_u32(uint32x2_t a, uint32x2_t b) {
+ return vpadd_u32(a, b);
+}
+
+// CHECK: test_vpadd_f32
+// CHECK: vpadd.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vpadd_f32(float32x2_t a, float32x2_t b) {
+ return vpadd_f32(a, b);
+}
+
+
+// CHECK: test_vpaddl_s8
+// CHECK: vpaddl.s8 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vpaddl_s8(int8x8_t a) {
+ return vpaddl_s8(a);
+}
+
+// CHECK: test_vpaddl_s16
+// CHECK: vpaddl.s16 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vpaddl_s16(int16x4_t a) {
+ return vpaddl_s16(a);
+}
+
+// CHECK: test_vpaddl_s32
+// CHECK: vpaddl.s32 d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vpaddl_s32(int32x2_t a) {
+ return vpaddl_s32(a);
+}
+
+// CHECK: test_vpaddl_u8
+// CHECK: vpaddl.u8 d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vpaddl_u8(uint8x8_t a) {
+ return vpaddl_u8(a);
+}
+
+// CHECK: test_vpaddl_u16
+// CHECK: vpaddl.u16 d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vpaddl_u16(uint16x4_t a) {
+ return vpaddl_u16(a);
+}
+
+// CHECK: test_vpaddl_u32
+// CHECK: vpaddl.u32 d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vpaddl_u32(uint32x2_t a) {
+ return vpaddl_u32(a);
+}
+
+// CHECK: test_vpaddlq_s8
+// CHECK: vpaddl.s8 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vpaddlq_s8(int8x16_t a) {
+ return vpaddlq_s8(a);
+}
+
+// CHECK: test_vpaddlq_s16
+// CHECK: vpaddl.s16 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vpaddlq_s16(int16x8_t a) {
+ return vpaddlq_s16(a);
+}
+
+// CHECK: test_vpaddlq_s32
+// CHECK: vpaddl.s32 q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vpaddlq_s32(int32x4_t a) {
+ return vpaddlq_s32(a);
+}
+
+// CHECK: test_vpaddlq_u8
+// CHECK: vpaddl.u8 q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vpaddlq_u8(uint8x16_t a) {
+ return vpaddlq_u8(a);
+}
+
+// CHECK: test_vpaddlq_u16
+// CHECK: vpaddl.u16 q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vpaddlq_u16(uint16x8_t a) {
+ return vpaddlq_u16(a);
+}
+
+// CHECK: test_vpaddlq_u32
+// CHECK: vpaddl.u32 q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vpaddlq_u32(uint32x4_t a) {
+ return vpaddlq_u32(a);
+}
+
+
+// CHECK: test_vpmax_s8
+// CHECK: vpmax.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vpmax_s8(int8x8_t a, int8x8_t b) {
+ return vpmax_s8(a, b);
+}
+
+// CHECK: test_vpmax_s16
+// CHECK: vpmax.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vpmax_s16(int16x4_t a, int16x4_t b) {
+ return vpmax_s16(a, b);
+}
+
+// CHECK: test_vpmax_s32
+// CHECK: vpmax.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vpmax_s32(int32x2_t a, int32x2_t b) {
+ return vpmax_s32(a, b);
+}
+
+// CHECK: test_vpmax_u8
+// CHECK: vpmax.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vpmax_u8(uint8x8_t a, uint8x8_t b) {
+ return vpmax_u8(a, b);
+}
+
+// CHECK: test_vpmax_u16
+// CHECK: vpmax.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vpmax_u16(uint16x4_t a, uint16x4_t b) {
+ return vpmax_u16(a, b);
+}
+
+// CHECK: test_vpmax_u32
+// CHECK: vpmax.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vpmax_u32(uint32x2_t a, uint32x2_t b) {
+ return vpmax_u32(a, b);
+}
+
+// CHECK: test_vpmax_f32
+// CHECK: vpmax.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vpmax_f32(float32x2_t a, float32x2_t b) {
+ return vpmax_f32(a, b);
+}
+
+
+// CHECK: test_vpmin_s8
+// CHECK: vpmin.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vpmin_s8(int8x8_t a, int8x8_t b) {
+ return vpmin_s8(a, b);
+}
+
+// CHECK: test_vpmin_s16
+// CHECK: vpmin.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vpmin_s16(int16x4_t a, int16x4_t b) {
+ return vpmin_s16(a, b);
+}
+
+// CHECK: test_vpmin_s32
+// CHECK: vpmin.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vpmin_s32(int32x2_t a, int32x2_t b) {
+ return vpmin_s32(a, b);
+}
+
+// CHECK: test_vpmin_u8
+// CHECK: vpmin.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vpmin_u8(uint8x8_t a, uint8x8_t b) {
+ return vpmin_u8(a, b);
+}
+
+// CHECK: test_vpmin_u16
+// CHECK: vpmin.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vpmin_u16(uint16x4_t a, uint16x4_t b) {
+ return vpmin_u16(a, b);
+}
+
+// CHECK: test_vpmin_u32
+// CHECK: vpmin.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vpmin_u32(uint32x2_t a, uint32x2_t b) {
+ return vpmin_u32(a, b);
+}
+
+// CHECK: test_vpmin_f32
+// CHECK: vpmin.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vpmin_f32(float32x2_t a, float32x2_t b) {
+ return vpmin_f32(a, b);
+}
+
+
+// CHECK: test_vqabs_s8
+// CHECK: vqabs.s8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vqabs_s8(int8x8_t a) {
+ return vqabs_s8(a);
+}
+
+// CHECK: test_vqabs_s16
+// CHECK: vqabs.s16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vqabs_s16(int16x4_t a) {
+ return vqabs_s16(a);
+}
+
+// CHECK: test_vqabs_s32
+// CHECK: vqabs.s32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vqabs_s32(int32x2_t a) {
+ return vqabs_s32(a);
+}
+
+// CHECK: test_vqabsq_s8
+// CHECK: vqabs.s8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vqabsq_s8(int8x16_t a) {
+ return vqabsq_s8(a);
+}
+
+// CHECK: test_vqabsq_s16
+// CHECK: vqabs.s16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vqabsq_s16(int16x8_t a) {
+ return vqabsq_s16(a);
+}
+
+// CHECK: test_vqabsq_s32
+// CHECK: vqabs.s32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vqabsq_s32(int32x4_t a) {
+ return vqabsq_s32(a);
+}
+
+
+// CHECK: test_vqadd_s8
+// CHECK: vqadd.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vqadd_s8(int8x8_t a, int8x8_t b) {
+ return vqadd_s8(a, b);
+}
+
+// CHECK: test_vqadd_s16
+// CHECK: vqadd.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vqadd_s16(int16x4_t a, int16x4_t b) {
+ return vqadd_s16(a, b);
+}
+
+// CHECK: test_vqadd_s32
+// CHECK: vqadd.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vqadd_s32(int32x2_t a, int32x2_t b) {
+ return vqadd_s32(a, b);
+}
+
+// CHECK: test_vqadd_s64
+// CHECK: vqadd.s64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vqadd_s64(int64x1_t a, int64x1_t b) {
+ return vqadd_s64(a, b);
+}
+
+// CHECK: test_vqadd_u8
+// CHECK: vqadd.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vqadd_u8(uint8x8_t a, uint8x8_t b) {
+ return vqadd_u8(a, b);
+}
+
+// CHECK: test_vqadd_u16
+// CHECK: vqadd.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vqadd_u16(uint16x4_t a, uint16x4_t b) {
+ return vqadd_u16(a, b);
+}
+
+// CHECK: test_vqadd_u32
+// CHECK: vqadd.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vqadd_u32(uint32x2_t a, uint32x2_t b) {
+ return vqadd_u32(a, b);
+}
+
+// CHECK: test_vqadd_u64
+// CHECK: vqadd.u64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vqadd_u64(uint64x1_t a, uint64x1_t b) {
+ return vqadd_u64(a, b);
+}
+
+// CHECK: test_vqaddq_s8
+// CHECK: vqadd.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vqaddq_s8(int8x16_t a, int8x16_t b) {
+ return vqaddq_s8(a, b);
+}
+
+// CHECK: test_vqaddq_s16
+// CHECK: vqadd.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vqaddq_s16(int16x8_t a, int16x8_t b) {
+ return vqaddq_s16(a, b);
+}
+
+// CHECK: test_vqaddq_s32
+// CHECK: vqadd.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vqaddq_s32(int32x4_t a, int32x4_t b) {
+ return vqaddq_s32(a, b);
+}
+
+// CHECK: test_vqaddq_s64
+// CHECK: vqadd.s64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vqaddq_s64(int64x2_t a, int64x2_t b) {
+ return vqaddq_s64(a, b);
+}
+
+// CHECK: test_vqaddq_u8
+// CHECK: vqadd.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vqaddq_u8(uint8x16_t a, uint8x16_t b) {
+ return vqaddq_u8(a, b);
+}
+
+// CHECK: test_vqaddq_u16
+// CHECK: vqadd.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vqaddq_u16(uint16x8_t a, uint16x8_t b) {
+ return vqaddq_u16(a, b);
+}
+
+// CHECK: test_vqaddq_u32
+// CHECK: vqadd.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vqaddq_u32(uint32x4_t a, uint32x4_t b) {
+ return vqaddq_u32(a, b);
+}
+
+// CHECK: test_vqaddq_u64
+// CHECK: vqadd.u64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vqaddq_u64(uint64x2_t a, uint64x2_t b) {
+ return vqaddq_u64(a, b);
+}
+
+
+// CHECK: test_vqdmlal_s16
+// CHECK: vqdmlal.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vqdmlal_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ return vqdmlal_s16(a, b, c);
+}
+
+// CHECK: test_vqdmlal_s32
+// CHECK: vqdmlal.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vqdmlal_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ return vqdmlal_s32(a, b, c);
+}
+
+
+// CHECK: test_vqdmlal_lane_s16
+// CHECK: vqdmlal.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vqdmlal_lane_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ return vqdmlal_lane_s16(a, b, c, 3);
+}
+
+// CHECK: test_vqdmlal_lane_s32
+// CHECK: vqdmlal.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int64x2_t test_vqdmlal_lane_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ return vqdmlal_lane_s32(a, b, c, 1);
+}
+
+
+// CHECK: test_vqdmlal_n_s16
+// CHECK: vqdmlal.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vqdmlal_n_s16(int32x4_t a, int16x4_t b, int16_t c) {
+ return vqdmlal_n_s16(a, b, c);
+}
+
+// CHECK: test_vqdmlal_n_s32
+// CHECK: vqdmlal.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vqdmlal_n_s32(int64x2_t a, int32x2_t b, int32_t c) {
+ return vqdmlal_n_s32(a, b, c);
+}
+
+
+// CHECK: test_vqdmlsl_s16
+// CHECK: vqdmlsl.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vqdmlsl_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ return vqdmlsl_s16(a, b, c);
+}
+
+// CHECK: test_vqdmlsl_s32
+// CHECK: vqdmlsl.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vqdmlsl_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ return vqdmlsl_s32(a, b, c);
+}
+
+
+// CHECK: test_vqdmlsl_lane_s16
+// CHECK: vqdmlsl.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vqdmlsl_lane_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
+ return vqdmlsl_lane_s16(a, b, c, 3);
+}
+
+// CHECK: test_vqdmlsl_lane_s32
+// CHECK: vqdmlsl.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int64x2_t test_vqdmlsl_lane_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
+ return vqdmlsl_lane_s32(a, b, c, 1);
+}
+
+
+// CHECK: test_vqdmlsl_n_s16
+// CHECK: vqdmlsl.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vqdmlsl_n_s16(int32x4_t a, int16x4_t b, int16_t c) {
+ return vqdmlsl_n_s16(a, b, c);
+}
+
+// CHECK: test_vqdmlsl_n_s32
+// CHECK: vqdmlsl.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vqdmlsl_n_s32(int64x2_t a, int32x2_t b, int32_t c) {
+ return vqdmlsl_n_s32(a, b, c);
+}
+
+
+// CHECK: test_vqdmulh_s16
+// CHECK: vqdmulh.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vqdmulh_s16(int16x4_t a, int16x4_t b) {
+ return vqdmulh_s16(a, b);
+}
+
+// CHECK: test_vqdmulh_s32
+// CHECK: vqdmulh.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vqdmulh_s32(int32x2_t a, int32x2_t b) {
+ return vqdmulh_s32(a, b);
+}
+
+// CHECK: test_vqdmulhq_s16
+// CHECK: vqdmulh.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vqdmulhq_s16(int16x8_t a, int16x8_t b) {
+ return vqdmulhq_s16(a, b);
+}
+
+// CHECK: test_vqdmulhq_s32
+// CHECK: vqdmulh.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vqdmulhq_s32(int32x4_t a, int32x4_t b) {
+ return vqdmulhq_s32(a, b);
+}
+
+
+// CHECK: test_vqdmulh_lane_s16
+// CHECK: vqdmulh.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x4_t test_vqdmulh_lane_s16(int16x4_t a, int16x4_t b) {
+ return vqdmulh_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vqdmulh_lane_s32
+// CHECK: vqdmulh.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x2_t test_vqdmulh_lane_s32(int32x2_t a, int32x2_t b) {
+ return vqdmulh_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vqdmulhq_lane_s16
+// CHECK: vqdmulh.s16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x8_t test_vqdmulhq_lane_s16(int16x8_t a, int16x4_t b) {
+ return vqdmulhq_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vqdmulhq_lane_s32
+// CHECK: vqdmulh.s32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vqdmulhq_lane_s32(int32x4_t a, int32x2_t b) {
+ return vqdmulhq_lane_s32(a, b, 1);
+}
+
+
+// CHECK: test_vqdmulh_n_s16
+// CHECK: vqdmulh.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vqdmulh_n_s16(int16x4_t a, int16_t b) {
+ return vqdmulh_n_s16(a, b);
+}
+
+// CHECK: test_vqdmulh_n_s32
+// CHECK: vqdmulh.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vqdmulh_n_s32(int32x2_t a, int32_t b) {
+ return vqdmulh_n_s32(a, b);
+}
+
+// CHECK: test_vqdmulhq_n_s16
+// CHECK: vqdmulh.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vqdmulhq_n_s16(int16x8_t a, int16_t b) {
+ return vqdmulhq_n_s16(a, b);
+}
+
+// CHECK: test_vqdmulhq_n_s32
+// CHECK: vqdmulh.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vqdmulhq_n_s32(int32x4_t a, int32_t b) {
+ return vqdmulhq_n_s32(a, b);
+}
+
+
+// CHECK: test_vqdmull_s16
+// CHECK: vqdmull.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vqdmull_s16(int16x4_t a, int16x4_t b) {
+ return vqdmull_s16(a, b);
+}
+
+// CHECK: test_vqdmull_s32
+// CHECK: vqdmull.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vqdmull_s32(int32x2_t a, int32x2_t b) {
+ return vqdmull_s32(a, b);
+}
+
+
+// CHECK: test_vqdmull_lane_s16
+// CHECK: vqdmull.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vqdmull_lane_s16(int16x4_t a, int16x4_t b) {
+ return vqdmull_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vqdmull_lane_s32
+// CHECK: vqdmull.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int64x2_t test_vqdmull_lane_s32(int32x2_t a, int32x2_t b) {
+ return vqdmull_lane_s32(a, b, 1);
+}
+
+
+// CHECK: test_vqdmull_n_s16
+// CHECK: vqdmull.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vqdmull_n_s16(int16x4_t a, int16_t b) {
+ return vqdmull_n_s16(a, b);
+}
+
+// CHECK: test_vqdmull_n_s32
+// CHECK: vqdmull.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vqdmull_n_s32(int32x2_t a, int32_t b) {
+ return vqdmull_n_s32(a, b);
+}
+
+
+// CHECK: test_vqmovn_s16
+// CHECK: vqmovn.s16 d{{[0-9]+}}, q{{[0-9]+}}
+int8x8_t test_vqmovn_s16(int16x8_t a) {
+ return vqmovn_s16(a);
+}
+
+// CHECK: test_vqmovn_s32
+// CHECK: vqmovn.s32 d{{[0-9]+}}, q{{[0-9]+}}
+int16x4_t test_vqmovn_s32(int32x4_t a) {
+ return vqmovn_s32(a);
+}
+
+// CHECK: test_vqmovn_s64
+// CHECK: vqmovn.s64 d{{[0-9]+}}, q{{[0-9]+}}
+int32x2_t test_vqmovn_s64(int64x2_t a) {
+ return vqmovn_s64(a);
+}
+
+// CHECK: test_vqmovn_u16
+// CHECK: vqmovn.u16 d{{[0-9]+}}, q{{[0-9]+}}
+uint8x8_t test_vqmovn_u16(uint16x8_t a) {
+ return vqmovn_u16(a);
+}
+
+// CHECK: test_vqmovn_u32
+// CHECK: vqmovn.u32 d{{[0-9]+}}, q{{[0-9]+}}
+uint16x4_t test_vqmovn_u32(uint32x4_t a) {
+ return vqmovn_u32(a);
+}
+
+// CHECK: test_vqmovn_u64
+// CHECK: vqmovn.u64 d{{[0-9]+}}, q{{[0-9]+}}
+uint32x2_t test_vqmovn_u64(uint64x2_t a) {
+ return vqmovn_u64(a);
+}
+
+
+// CHECK: test_vqmovun_s16
+// CHECK: vqmovun.s16 d{{[0-9]+}}, q{{[0-9]+}}
+uint8x8_t test_vqmovun_s16(int16x8_t a) {
+ return vqmovun_s16(a);
+}
+
+// CHECK: test_vqmovun_s32
+// CHECK: vqmovun.s32 d{{[0-9]+}}, q{{[0-9]+}}
+uint16x4_t test_vqmovun_s32(int32x4_t a) {
+ return vqmovun_s32(a);
+}
+
+// CHECK: test_vqmovun_s64
+// CHECK: vqmovun.s64 d{{[0-9]+}}, q{{[0-9]+}}
+uint32x2_t test_vqmovun_s64(int64x2_t a) {
+ return vqmovun_s64(a);
+}
+
+
+// CHECK: test_vqneg_s8
+// CHECK: vqneg.s8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vqneg_s8(int8x8_t a) {
+ return vqneg_s8(a);
+}
+
+// CHECK: test_vqneg_s16
+// CHECK: vqneg.s16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vqneg_s16(int16x4_t a) {
+ return vqneg_s16(a);
+}
+
+// CHECK: test_vqneg_s32
+// CHECK: vqneg.s32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vqneg_s32(int32x2_t a) {
+ return vqneg_s32(a);
+}
+
+// CHECK: test_vqnegq_s8
+// CHECK: vqneg.s8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vqnegq_s8(int8x16_t a) {
+ return vqnegq_s8(a);
+}
+
+// CHECK: test_vqnegq_s16
+// CHECK: vqneg.s16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vqnegq_s16(int16x8_t a) {
+ return vqnegq_s16(a);
+}
+
+// CHECK: test_vqnegq_s32
+// CHECK: vqneg.s32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vqnegq_s32(int32x4_t a) {
+ return vqnegq_s32(a);
+}
+
+
+// CHECK: test_vqrdmulh_s16
+// CHECK: vqrdmulh.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vqrdmulh_s16(int16x4_t a, int16x4_t b) {
+ return vqrdmulh_s16(a, b);
+}
+
+// CHECK: test_vqrdmulh_s32
+// CHECK: vqrdmulh.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vqrdmulh_s32(int32x2_t a, int32x2_t b) {
+ return vqrdmulh_s32(a, b);
+}
+
+// CHECK: test_vqrdmulhq_s16
+// CHECK: vqrdmulh.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vqrdmulhq_s16(int16x8_t a, int16x8_t b) {
+ return vqrdmulhq_s16(a, b);
+}
+
+// CHECK: test_vqrdmulhq_s32
+// CHECK: vqrdmulh.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vqrdmulhq_s32(int32x4_t a, int32x4_t b) {
+ return vqrdmulhq_s32(a, b);
+}
+
+
+// CHECK: test_vqrdmulh_lane_s16
+// CHECK: vqrdmulh.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x4_t test_vqrdmulh_lane_s16(int16x4_t a, int16x4_t b) {
+ return vqrdmulh_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vqrdmulh_lane_s32
+// CHECK: vqrdmulh.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x2_t test_vqrdmulh_lane_s32(int32x2_t a, int32x2_t b) {
+ return vqrdmulh_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vqrdmulhq_lane_s16
+// CHECK: vqrdmulh.s16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int16x8_t test_vqrdmulhq_lane_s16(int16x8_t a, int16x4_t b) {
+ return vqrdmulhq_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vqrdmulhq_lane_s32
+// CHECK: vqrdmulh.s32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}[{{[0-9]}}]
+int32x4_t test_vqrdmulhq_lane_s32(int32x4_t a, int32x2_t b) {
+ return vqrdmulhq_lane_s32(a, b, 1);
+}
+
+
+// CHECK: test_vqrdmulh_n_s16
+// CHECK: vqrdmulh.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vqrdmulh_n_s16(int16x4_t a, int16_t b) {
+ return vqrdmulh_n_s16(a, b);
+}
+
+// CHECK: test_vqrdmulh_n_s32
+// CHECK: vqrdmulh.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vqrdmulh_n_s32(int32x2_t a, int32_t b) {
+ return vqrdmulh_n_s32(a, b);
+}
+
+// CHECK: test_vqrdmulhq_n_s16
+// CHECK: vqrdmulh.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vqrdmulhq_n_s16(int16x8_t a, int16_t b) {
+ return vqrdmulhq_n_s16(a, b);
+}
+
+// CHECK: test_vqrdmulhq_n_s32
+// CHECK: vqrdmulh.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vqrdmulhq_n_s32(int32x4_t a, int32_t b) {
+ return vqrdmulhq_n_s32(a, b);
+}
+
+
+// CHECK: test_vqrshl_s8
+// CHECK: vqrshl.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vqrshl_s8(int8x8_t a, int8x8_t b) {
+ return vqrshl_s8(a, b);
+}
+
+// CHECK: test_vqrshl_s16
+// CHECK: vqrshl.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vqrshl_s16(int16x4_t a, int16x4_t b) {
+ return vqrshl_s16(a, b);
+}
+
+// CHECK: test_vqrshl_s32
+// CHECK: vqrshl.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vqrshl_s32(int32x2_t a, int32x2_t b) {
+ return vqrshl_s32(a, b);
+}
+
+// CHECK: test_vqrshl_s64
+// CHECK: vqrshl.s64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vqrshl_s64(int64x1_t a, int64x1_t b) {
+ return vqrshl_s64(a, b);
+}
+
+// CHECK: test_vqrshl_u8
+// CHECK: vqrshl.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vqrshl_u8(uint8x8_t a, int8x8_t b) {
+ return vqrshl_u8(a, b);
+}
+
+// CHECK: test_vqrshl_u16
+// CHECK: vqrshl.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vqrshl_u16(uint16x4_t a, int16x4_t b) {
+ return vqrshl_u16(a, b);
+}
+
+// CHECK: test_vqrshl_u32
+// CHECK: vqrshl.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vqrshl_u32(uint32x2_t a, int32x2_t b) {
+ return vqrshl_u32(a, b);
+}
+
+// CHECK: test_vqrshl_u64
+// CHECK: vqrshl.u64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vqrshl_u64(uint64x1_t a, int64x1_t b) {
+ return vqrshl_u64(a, b);
+}
+
+// CHECK: test_vqrshlq_s8
+// CHECK: vqrshl.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vqrshlq_s8(int8x16_t a, int8x16_t b) {
+ return vqrshlq_s8(a, b);
+}
+
+// CHECK: test_vqrshlq_s16
+// CHECK: vqrshl.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vqrshlq_s16(int16x8_t a, int16x8_t b) {
+ return vqrshlq_s16(a, b);
+}
+
+// CHECK: test_vqrshlq_s32
+// CHECK: vqrshl.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vqrshlq_s32(int32x4_t a, int32x4_t b) {
+ return vqrshlq_s32(a, b);
+}
+
+// CHECK: test_vqrshlq_s64
+// CHECK: vqrshl.s64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vqrshlq_s64(int64x2_t a, int64x2_t b) {
+ return vqrshlq_s64(a, b);
+}
+
+// CHECK: test_vqrshlq_u8
+// CHECK: vqrshl.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vqrshlq_u8(uint8x16_t a, int8x16_t b) {
+ return vqrshlq_u8(a, b);
+}
+
+// CHECK: test_vqrshlq_u16
+// CHECK: vqrshl.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vqrshlq_u16(uint16x8_t a, int16x8_t b) {
+ return vqrshlq_u16(a, b);
+}
+
+// CHECK: test_vqrshlq_u32
+// CHECK: vqrshl.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vqrshlq_u32(uint32x4_t a, int32x4_t b) {
+ return vqrshlq_u32(a, b);
+}
+
+// CHECK: test_vqrshlq_u64
+// CHECK: vqrshl.u64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vqrshlq_u64(uint64x2_t a, int64x2_t b) {
+ return vqrshlq_u64(a, b);
+}
+
+
+// CHECK: test_vqrshrn_n_s16
+// CHECK: vqrshrn.s16 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vqrshrn_n_s16(int16x8_t a) {
+ return vqrshrn_n_s16(a, 1);
+}
+
+// CHECK: test_vqrshrn_n_s32
+// CHECK: vqrshrn.s32 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vqrshrn_n_s32(int32x4_t a) {
+ return vqrshrn_n_s32(a, 1);
+}
+
+// CHECK: test_vqrshrn_n_s64
+// CHECK: vqrshrn.s64 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vqrshrn_n_s64(int64x2_t a) {
+ return vqrshrn_n_s64(a, 1);
+}
+
+// CHECK: test_vqrshrn_n_u16
+// CHECK: vqrshrn.u16 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vqrshrn_n_u16(uint16x8_t a) {
+ return vqrshrn_n_u16(a, 1);
+}
+
+// CHECK: test_vqrshrn_n_u32
+// CHECK: vqrshrn.u32 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vqrshrn_n_u32(uint32x4_t a) {
+ return vqrshrn_n_u32(a, 1);
+}
+
+// CHECK: test_vqrshrn_n_u64
+// CHECK: vqrshrn.u64 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vqrshrn_n_u64(uint64x2_t a) {
+ return vqrshrn_n_u64(a, 1);
+}
+
+
+// CHECK: test_vqrshrun_n_s16
+// CHECK: vqrshrun.s16 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vqrshrun_n_s16(int16x8_t a) {
+ return vqrshrun_n_s16(a, 1);
+}
+
+// CHECK: test_vqrshrun_n_s32
+// CHECK: vqrshrun.s32 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vqrshrun_n_s32(int32x4_t a) {
+ return vqrshrun_n_s32(a, 1);
+}
+
+// CHECK: test_vqrshrun_n_s64
+// CHECK: vqrshrun.s64 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vqrshrun_n_s64(int64x2_t a) {
+ return vqrshrun_n_s64(a, 1);
+}
+
+
+// CHECK: test_vqshl_s8
+// CHECK: vqshl.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vqshl_s8(int8x8_t a, int8x8_t b) {
+ return vqshl_s8(a, b);
+}
+
+// CHECK: test_vqshl_s16
+// CHECK: vqshl.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vqshl_s16(int16x4_t a, int16x4_t b) {
+ return vqshl_s16(a, b);
+}
+
+// CHECK: test_vqshl_s32
+// CHECK: vqshl.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vqshl_s32(int32x2_t a, int32x2_t b) {
+ return vqshl_s32(a, b);
+}
+
+// CHECK: test_vqshl_s64
+// CHECK: vqshl.s64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vqshl_s64(int64x1_t a, int64x1_t b) {
+ return vqshl_s64(a, b);
+}
+
+// CHECK: test_vqshl_u8
+// CHECK: vqshl.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vqshl_u8(uint8x8_t a, int8x8_t b) {
+ return vqshl_u8(a, b);
+}
+
+// CHECK: test_vqshl_u16
+// CHECK: vqshl.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vqshl_u16(uint16x4_t a, int16x4_t b) {
+ return vqshl_u16(a, b);
+}
+
+// CHECK: test_vqshl_u32
+// CHECK: vqshl.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vqshl_u32(uint32x2_t a, int32x2_t b) {
+ return vqshl_u32(a, b);
+}
+
+// CHECK: test_vqshl_u64
+// CHECK: vqshl.u64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vqshl_u64(uint64x1_t a, int64x1_t b) {
+ return vqshl_u64(a, b);
+}
+
+// CHECK: test_vqshlq_s8
+// CHECK: vqshl.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vqshlq_s8(int8x16_t a, int8x16_t b) {
+ return vqshlq_s8(a, b);
+}
+
+// CHECK: test_vqshlq_s16
+// CHECK: vqshl.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vqshlq_s16(int16x8_t a, int16x8_t b) {
+ return vqshlq_s16(a, b);
+}
+
+// CHECK: test_vqshlq_s32
+// CHECK: vqshl.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vqshlq_s32(int32x4_t a, int32x4_t b) {
+ return vqshlq_s32(a, b);
+}
+
+// CHECK: test_vqshlq_s64
+// CHECK: vqshl.s64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vqshlq_s64(int64x2_t a, int64x2_t b) {
+ return vqshlq_s64(a, b);
+}
+
+// CHECK: test_vqshlq_u8
+// CHECK: vqshl.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vqshlq_u8(uint8x16_t a, int8x16_t b) {
+ return vqshlq_u8(a, b);
+}
+
+// CHECK: test_vqshlq_u16
+// CHECK: vqshl.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vqshlq_u16(uint16x8_t a, int16x8_t b) {
+ return vqshlq_u16(a, b);
+}
+
+// CHECK: test_vqshlq_u32
+// CHECK: vqshl.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vqshlq_u32(uint32x4_t a, int32x4_t b) {
+ return vqshlq_u32(a, b);
+}
+
+// CHECK: test_vqshlq_u64
+// CHECK: vqshl.u64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vqshlq_u64(uint64x2_t a, int64x2_t b) {
+ return vqshlq_u64(a, b);
+}
+
+
+// CHECK: test_vqshlu_n_s8
+// CHECK: vqshlu.s8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vqshlu_n_s8(int8x8_t a) {
+ return vqshlu_n_s8(a, 1);
+}
+
+// CHECK: test_vqshlu_n_s16
+// CHECK: vqshlu.s16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vqshlu_n_s16(int16x4_t a) {
+ return vqshlu_n_s16(a, 1);
+}
+
+// CHECK: test_vqshlu_n_s32
+// CHECK: vqshlu.s32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vqshlu_n_s32(int32x2_t a) {
+ return vqshlu_n_s32(a, 1);
+}
+
+// CHECK: test_vqshlu_n_s64
+// CHECK: vqshlu.s64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint64x1_t test_vqshlu_n_s64(int64x1_t a) {
+ return vqshlu_n_s64(a, 1);
+}
+
+// CHECK: test_vqshluq_n_s8
+// CHECK: vqshlu.s8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x16_t test_vqshluq_n_s8(int8x16_t a) {
+ return vqshluq_n_s8(a, 1);
+}
+
+// CHECK: test_vqshluq_n_s16
+// CHECK: vqshlu.s16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vqshluq_n_s16(int16x8_t a) {
+ return vqshluq_n_s16(a, 1);
+}
+
+// CHECK: test_vqshluq_n_s32
+// CHECK: vqshlu.s32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vqshluq_n_s32(int32x4_t a) {
+ return vqshluq_n_s32(a, 1);
+}
+
+// CHECK: test_vqshluq_n_s64
+// CHECK: vqshlu.s64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint64x2_t test_vqshluq_n_s64(int64x2_t a) {
+ return vqshluq_n_s64(a, 1);
+}
+
+
+// CHECK: test_vqshl_n_s8
+// CHECK: vqshl.s8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vqshl_n_s8(int8x8_t a) {
+ return vqshl_n_s8(a, 1);
+}
+
+// CHECK: test_vqshl_n_s16
+// CHECK: vqshl.s16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vqshl_n_s16(int16x4_t a) {
+ return vqshl_n_s16(a, 1);
+}
+
+// CHECK: test_vqshl_n_s32
+// CHECK: vqshl.s32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vqshl_n_s32(int32x2_t a) {
+ return vqshl_n_s32(a, 1);
+}
+
+// CHECK: test_vqshl_n_s64
+// CHECK: vqshl.s64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int64x1_t test_vqshl_n_s64(int64x1_t a) {
+ return vqshl_n_s64(a, 1);
+}
+
+// CHECK: test_vqshl_n_u8
+// CHECK: vqshl.u8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vqshl_n_u8(uint8x8_t a) {
+ return vqshl_n_u8(a, 1);
+}
+
+// CHECK: test_vqshl_n_u16
+// CHECK: vqshl.u16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vqshl_n_u16(uint16x4_t a) {
+ return vqshl_n_u16(a, 1);
+}
+
+// CHECK: test_vqshl_n_u32
+// CHECK: vqshl.u32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vqshl_n_u32(uint32x2_t a) {
+ return vqshl_n_u32(a, 1);
+}
+
+// CHECK: test_vqshl_n_u64
+// CHECK: vqshl.u64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint64x1_t test_vqshl_n_u64(uint64x1_t a) {
+ return vqshl_n_u64(a, 1);
+}
+
+// CHECK: test_vqshlq_n_s8
+// CHECK: vqshl.s8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x16_t test_vqshlq_n_s8(int8x16_t a) {
+ return vqshlq_n_s8(a, 1);
+}
+
+// CHECK: test_vqshlq_n_s16
+// CHECK: vqshl.s16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x8_t test_vqshlq_n_s16(int16x8_t a) {
+ return vqshlq_n_s16(a, 1);
+}
+
+// CHECK: test_vqshlq_n_s32
+// CHECK: vqshl.s32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vqshlq_n_s32(int32x4_t a) {
+ return vqshlq_n_s32(a, 1);
+}
+
+// CHECK: test_vqshlq_n_s64
+// CHECK: vqshl.s64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int64x2_t test_vqshlq_n_s64(int64x2_t a) {
+ return vqshlq_n_s64(a, 1);
+}
+
+// CHECK: test_vqshlq_n_u8
+// CHECK: vqshl.u8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x16_t test_vqshlq_n_u8(uint8x16_t a) {
+ return vqshlq_n_u8(a, 1);
+}
+
+// CHECK: test_vqshlq_n_u16
+// CHECK: vqshl.u16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vqshlq_n_u16(uint16x8_t a) {
+ return vqshlq_n_u16(a, 1);
+}
+
+// CHECK: test_vqshlq_n_u32
+// CHECK: vqshl.u32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vqshlq_n_u32(uint32x4_t a) {
+ return vqshlq_n_u32(a, 1);
+}
+
+// CHECK: test_vqshlq_n_u64
+// CHECK: vqshl.u64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint64x2_t test_vqshlq_n_u64(uint64x2_t a) {
+ return vqshlq_n_u64(a, 1);
+}
+
+
+// CHECK: test_vqshrn_n_s16
+// CHECK: vqshrn.s16 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vqshrn_n_s16(int16x8_t a) {
+ return vqshrn_n_s16(a, 1);
+}
+
+// CHECK: test_vqshrn_n_s32
+// CHECK: vqshrn.s32 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vqshrn_n_s32(int32x4_t a) {
+ return vqshrn_n_s32(a, 1);
+}
+
+// CHECK: test_vqshrn_n_s64
+// CHECK: vqshrn.s64 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vqshrn_n_s64(int64x2_t a) {
+ return vqshrn_n_s64(a, 1);
+}
+
+// CHECK: test_vqshrn_n_u16
+// CHECK: vqshrn.u16 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vqshrn_n_u16(uint16x8_t a) {
+ return vqshrn_n_u16(a, 1);
+}
+
+// CHECK: test_vqshrn_n_u32
+// CHECK: vqshrn.u32 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vqshrn_n_u32(uint32x4_t a) {
+ return vqshrn_n_u32(a, 1);
+}
+
+// CHECK: test_vqshrn_n_u64
+// CHECK: vqshrn.u64 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vqshrn_n_u64(uint64x2_t a) {
+ return vqshrn_n_u64(a, 1);
+}
+
+
+// CHECK: test_vqshrun_n_s16
+// CHECK: vqshrun.s16 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vqshrun_n_s16(int16x8_t a) {
+ return vqshrun_n_s16(a, 1);
+}
+
+// CHECK: test_vqshrun_n_s32
+// CHECK: vqshrun.s32 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vqshrun_n_s32(int32x4_t a) {
+ return vqshrun_n_s32(a, 1);
+}
+
+// CHECK: test_vqshrun_n_s64
+// CHECK: vqshrun.s64 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vqshrun_n_s64(int64x2_t a) {
+ return vqshrun_n_s64(a, 1);
+}
+
+
+// CHECK: test_vqsub_s8
+// CHECK: vqsub.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vqsub_s8(int8x8_t a, int8x8_t b) {
+ return vqsub_s8(a, b);
+}
+
+// CHECK: test_vqsub_s16
+// CHECK: vqsub.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vqsub_s16(int16x4_t a, int16x4_t b) {
+ return vqsub_s16(a, b);
+}
+
+// CHECK: test_vqsub_s32
+// CHECK: vqsub.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vqsub_s32(int32x2_t a, int32x2_t b) {
+ return vqsub_s32(a, b);
+}
+
+// CHECK: test_vqsub_s64
+// CHECK: vqsub.s64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vqsub_s64(int64x1_t a, int64x1_t b) {
+ return vqsub_s64(a, b);
+}
+
+// CHECK: test_vqsub_u8
+// CHECK: vqsub.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vqsub_u8(uint8x8_t a, uint8x8_t b) {
+ return vqsub_u8(a, b);
+}
+
+// CHECK: test_vqsub_u16
+// CHECK: vqsub.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vqsub_u16(uint16x4_t a, uint16x4_t b) {
+ return vqsub_u16(a, b);
+}
+
+// CHECK: test_vqsub_u32
+// CHECK: vqsub.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vqsub_u32(uint32x2_t a, uint32x2_t b) {
+ return vqsub_u32(a, b);
+}
+
+// CHECK: test_vqsub_u64
+// CHECK: vqsub.u64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vqsub_u64(uint64x1_t a, uint64x1_t b) {
+ return vqsub_u64(a, b);
+}
+
+// CHECK: test_vqsubq_s8
+// CHECK: vqsub.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vqsubq_s8(int8x16_t a, int8x16_t b) {
+ return vqsubq_s8(a, b);
+}
+
+// CHECK: test_vqsubq_s16
+// CHECK: vqsub.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vqsubq_s16(int16x8_t a, int16x8_t b) {
+ return vqsubq_s16(a, b);
+}
+
+// CHECK: test_vqsubq_s32
+// CHECK: vqsub.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vqsubq_s32(int32x4_t a, int32x4_t b) {
+ return vqsubq_s32(a, b);
+}
+
+// CHECK: test_vqsubq_s64
+// CHECK: vqsub.s64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vqsubq_s64(int64x2_t a, int64x2_t b) {
+ return vqsubq_s64(a, b);
+}
+
+// CHECK: test_vqsubq_u8
+// CHECK: vqsub.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vqsubq_u8(uint8x16_t a, uint8x16_t b) {
+ return vqsubq_u8(a, b);
+}
+
+// CHECK: test_vqsubq_u16
+// CHECK: vqsub.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vqsubq_u16(uint16x8_t a, uint16x8_t b) {
+ return vqsubq_u16(a, b);
+}
+
+// CHECK: test_vqsubq_u32
+// CHECK: vqsub.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vqsubq_u32(uint32x4_t a, uint32x4_t b) {
+ return vqsubq_u32(a, b);
+}
+
+// CHECK: test_vqsubq_u64
+// CHECK: vqsub.u64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vqsubq_u64(uint64x2_t a, uint64x2_t b) {
+ return vqsubq_u64(a, b);
+}
+
+
+// CHECK: test_vraddhn_s16
+// CHECK: vraddhn.i16 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x8_t test_vraddhn_s16(int16x8_t a, int16x8_t b) {
+ return vraddhn_s16(a, b);
+}
+
+// CHECK: test_vraddhn_s32
+// CHECK: vraddhn.i32 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x4_t test_vraddhn_s32(int32x4_t a, int32x4_t b) {
+ return vraddhn_s32(a, b);
+}
+
+// CHECK: test_vraddhn_s64
+// CHECK: vraddhn.i64 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x2_t test_vraddhn_s64(int64x2_t a, int64x2_t b) {
+ return vraddhn_s64(a, b);
+}
+
+// CHECK: test_vraddhn_u16
+// CHECK: vraddhn.i16 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x8_t test_vraddhn_u16(uint16x8_t a, uint16x8_t b) {
+ return vraddhn_u16(a, b);
+}
+
+// CHECK: test_vraddhn_u32
+// CHECK: vraddhn.i32 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x4_t test_vraddhn_u32(uint32x4_t a, uint32x4_t b) {
+ return vraddhn_u32(a, b);
+}
+
+// CHECK: test_vraddhn_u64
+// CHECK: vraddhn.i64 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x2_t test_vraddhn_u64(uint64x2_t a, uint64x2_t b) {
+ return vraddhn_u64(a, b);
+}
+
+
+// CHECK: test_vrecpe_f32
+// CHECK: vrecpe.f32 d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vrecpe_f32(float32x2_t a) {
+ return vrecpe_f32(a);
+}
+
+// CHECK: test_vrecpe_u32
+// CHECK: vrecpe.u32 d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vrecpe_u32(uint32x2_t a) {
+ return vrecpe_u32(a);
+}
+
+// CHECK: test_vrecpeq_f32
+// CHECK: vrecpe.f32 q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vrecpeq_f32(float32x4_t a) {
+ return vrecpeq_f32(a);
+}
+
+// CHECK: test_vrecpeq_u32
+// CHECK: vrecpe.u32 q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vrecpeq_u32(uint32x4_t a) {
+ return vrecpeq_u32(a);
+}
+
+
+// CHECK: test_vrecps_f32
+// CHECK: vrecps.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vrecps_f32(float32x2_t a, float32x2_t b) {
+ return vrecps_f32(a, b);
+}
+
+// CHECK: test_vrecpsq_f32
+// CHECK: vrecps.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vrecpsq_f32(float32x4_t a, float32x4_t b) {
+ return vrecpsq_f32(a, b);
+}
+
+
+// CHECK: test_vreinterpret_s8_s16
+int8x8_t test_vreinterpret_s8_s16(int16x4_t a) {
+ return vreinterpret_s8_s16(a);
+}
+
+// CHECK: test_vreinterpret_s8_s32
+int8x8_t test_vreinterpret_s8_s32(int32x2_t a) {
+ return vreinterpret_s8_s32(a);
+}
+
+// CHECK: test_vreinterpret_s8_s64
+int8x8_t test_vreinterpret_s8_s64(int64x1_t a) {
+ return vreinterpret_s8_s64(a);
+}
+
+// CHECK: test_vreinterpret_s8_u8
+int8x8_t test_vreinterpret_s8_u8(uint8x8_t a) {
+ return vreinterpret_s8_u8(a);
+}
+
+// CHECK: test_vreinterpret_s8_u16
+int8x8_t test_vreinterpret_s8_u16(uint16x4_t a) {
+ return vreinterpret_s8_u16(a);
+}
+
+// CHECK: test_vreinterpret_s8_u32
+int8x8_t test_vreinterpret_s8_u32(uint32x2_t a) {
+ return vreinterpret_s8_u32(a);
+}
+
+// CHECK: test_vreinterpret_s8_u64
+int8x8_t test_vreinterpret_s8_u64(uint64x1_t a) {
+ return vreinterpret_s8_u64(a);
+}
+
+// CHECK: test_vreinterpret_s8_f16
+int8x8_t test_vreinterpret_s8_f16(float16x4_t a) {
+ return vreinterpret_s8_f16(a);
+}
+
+// CHECK: test_vreinterpret_s8_f32
+int8x8_t test_vreinterpret_s8_f32(float32x2_t a) {
+ return vreinterpret_s8_f32(a);
+}
+
+// CHECK: test_vreinterpret_s8_p8
+int8x8_t test_vreinterpret_s8_p8(poly8x8_t a) {
+ return vreinterpret_s8_p8(a);
+}
+
+// CHECK: test_vreinterpret_s8_p16
+int8x8_t test_vreinterpret_s8_p16(poly16x4_t a) {
+ return vreinterpret_s8_p16(a);
+}
+
+// CHECK: test_vreinterpret_s16_s8
+int16x4_t test_vreinterpret_s16_s8(int8x8_t a) {
+ return vreinterpret_s16_s8(a);
+}
+
+// CHECK: test_vreinterpret_s16_s32
+int16x4_t test_vreinterpret_s16_s32(int32x2_t a) {
+ return vreinterpret_s16_s32(a);
+}
+
+// CHECK: test_vreinterpret_s16_s64
+int16x4_t test_vreinterpret_s16_s64(int64x1_t a) {
+ return vreinterpret_s16_s64(a);
+}
+
+// CHECK: test_vreinterpret_s16_u8
+int16x4_t test_vreinterpret_s16_u8(uint8x8_t a) {
+ return vreinterpret_s16_u8(a);
+}
+
+// CHECK: test_vreinterpret_s16_u16
+int16x4_t test_vreinterpret_s16_u16(uint16x4_t a) {
+ return vreinterpret_s16_u16(a);
+}
+
+// CHECK: test_vreinterpret_s16_u32
+int16x4_t test_vreinterpret_s16_u32(uint32x2_t a) {
+ return vreinterpret_s16_u32(a);
+}
+
+// CHECK: test_vreinterpret_s16_u64
+int16x4_t test_vreinterpret_s16_u64(uint64x1_t a) {
+ return vreinterpret_s16_u64(a);
+}
+
+// CHECK: test_vreinterpret_s16_f16
+int16x4_t test_vreinterpret_s16_f16(float16x4_t a) {
+ return vreinterpret_s16_f16(a);
+}
+
+// CHECK: test_vreinterpret_s16_f32
+int16x4_t test_vreinterpret_s16_f32(float32x2_t a) {
+ return vreinterpret_s16_f32(a);
+}
+
+// CHECK: test_vreinterpret_s16_p8
+int16x4_t test_vreinterpret_s16_p8(poly8x8_t a) {
+ return vreinterpret_s16_p8(a);
+}
+
+// CHECK: test_vreinterpret_s16_p16
+int16x4_t test_vreinterpret_s16_p16(poly16x4_t a) {
+ return vreinterpret_s16_p16(a);
+}
+
+// CHECK: test_vreinterpret_s32_s8
+int32x2_t test_vreinterpret_s32_s8(int8x8_t a) {
+ return vreinterpret_s32_s8(a);
+}
+
+// CHECK: test_vreinterpret_s32_s16
+int32x2_t test_vreinterpret_s32_s16(int16x4_t a) {
+ return vreinterpret_s32_s16(a);
+}
+
+// CHECK: test_vreinterpret_s32_s64
+int32x2_t test_vreinterpret_s32_s64(int64x1_t a) {
+ return vreinterpret_s32_s64(a);
+}
+
+// CHECK: test_vreinterpret_s32_u8
+int32x2_t test_vreinterpret_s32_u8(uint8x8_t a) {
+ return vreinterpret_s32_u8(a);
+}
+
+// CHECK: test_vreinterpret_s32_u16
+int32x2_t test_vreinterpret_s32_u16(uint16x4_t a) {
+ return vreinterpret_s32_u16(a);
+}
+
+// CHECK: test_vreinterpret_s32_u32
+int32x2_t test_vreinterpret_s32_u32(uint32x2_t a) {
+ return vreinterpret_s32_u32(a);
+}
+
+// CHECK: test_vreinterpret_s32_u64
+int32x2_t test_vreinterpret_s32_u64(uint64x1_t a) {
+ return vreinterpret_s32_u64(a);
+}
+
+// CHECK: test_vreinterpret_s32_f16
+int32x2_t test_vreinterpret_s32_f16(float16x4_t a) {
+ return vreinterpret_s32_f16(a);
+}
+
+// CHECK: test_vreinterpret_s32_f32
+int32x2_t test_vreinterpret_s32_f32(float32x2_t a) {
+ return vreinterpret_s32_f32(a);
+}
+
+// CHECK: test_vreinterpret_s32_p8
+int32x2_t test_vreinterpret_s32_p8(poly8x8_t a) {
+ return vreinterpret_s32_p8(a);
+}
+
+// CHECK: test_vreinterpret_s32_p16
+int32x2_t test_vreinterpret_s32_p16(poly16x4_t a) {
+ return vreinterpret_s32_p16(a);
+}
+
+// CHECK: test_vreinterpret_s64_s8
+int64x1_t test_vreinterpret_s64_s8(int8x8_t a) {
+ return vreinterpret_s64_s8(a);
+}
+
+// CHECK: test_vreinterpret_s64_s16
+int64x1_t test_vreinterpret_s64_s16(int16x4_t a) {
+ return vreinterpret_s64_s16(a);
+}
+
+// CHECK: test_vreinterpret_s64_s32
+int64x1_t test_vreinterpret_s64_s32(int32x2_t a) {
+ return vreinterpret_s64_s32(a);
+}
+
+// CHECK: test_vreinterpret_s64_u8
+int64x1_t test_vreinterpret_s64_u8(uint8x8_t a) {
+ return vreinterpret_s64_u8(a);
+}
+
+// CHECK: test_vreinterpret_s64_u16
+int64x1_t test_vreinterpret_s64_u16(uint16x4_t a) {
+ return vreinterpret_s64_u16(a);
+}
+
+// CHECK: test_vreinterpret_s64_u32
+int64x1_t test_vreinterpret_s64_u32(uint32x2_t a) {
+ return vreinterpret_s64_u32(a);
+}
+
+// CHECK: test_vreinterpret_s64_u64
+int64x1_t test_vreinterpret_s64_u64(uint64x1_t a) {
+ return vreinterpret_s64_u64(a);
+}
+
+// CHECK: test_vreinterpret_s64_f16
+int64x1_t test_vreinterpret_s64_f16(float16x4_t a) {
+ return vreinterpret_s64_f16(a);
+}
+
+// CHECK: test_vreinterpret_s64_f32
+int64x1_t test_vreinterpret_s64_f32(float32x2_t a) {
+ return vreinterpret_s64_f32(a);
+}
+
+// CHECK: test_vreinterpret_s64_p8
+int64x1_t test_vreinterpret_s64_p8(poly8x8_t a) {
+ return vreinterpret_s64_p8(a);
+}
+
+// CHECK: test_vreinterpret_s64_p16
+int64x1_t test_vreinterpret_s64_p16(poly16x4_t a) {
+ return vreinterpret_s64_p16(a);
+}
+
+// CHECK: test_vreinterpret_u8_s8
+uint8x8_t test_vreinterpret_u8_s8(int8x8_t a) {
+ return vreinterpret_u8_s8(a);
+}
+
+// CHECK: test_vreinterpret_u8_s16
+uint8x8_t test_vreinterpret_u8_s16(int16x4_t a) {
+ return vreinterpret_u8_s16(a);
+}
+
+// CHECK: test_vreinterpret_u8_s32
+uint8x8_t test_vreinterpret_u8_s32(int32x2_t a) {
+ return vreinterpret_u8_s32(a);
+}
+
+// CHECK: test_vreinterpret_u8_s64
+uint8x8_t test_vreinterpret_u8_s64(int64x1_t a) {
+ return vreinterpret_u8_s64(a);
+}
+
+// CHECK: test_vreinterpret_u8_u16
+uint8x8_t test_vreinterpret_u8_u16(uint16x4_t a) {
+ return vreinterpret_u8_u16(a);
+}
+
+// CHECK: test_vreinterpret_u8_u32
+uint8x8_t test_vreinterpret_u8_u32(uint32x2_t a) {
+ return vreinterpret_u8_u32(a);
+}
+
+// CHECK: test_vreinterpret_u8_u64
+uint8x8_t test_vreinterpret_u8_u64(uint64x1_t a) {
+ return vreinterpret_u8_u64(a);
+}
+
+// CHECK: test_vreinterpret_u8_f16
+uint8x8_t test_vreinterpret_u8_f16(float16x4_t a) {
+ return vreinterpret_u8_f16(a);
+}
+
+// CHECK: test_vreinterpret_u8_f32
+uint8x8_t test_vreinterpret_u8_f32(float32x2_t a) {
+ return vreinterpret_u8_f32(a);
+}
+
+// CHECK: test_vreinterpret_u8_p8
+uint8x8_t test_vreinterpret_u8_p8(poly8x8_t a) {
+ return vreinterpret_u8_p8(a);
+}
+
+// CHECK: test_vreinterpret_u8_p16
+uint8x8_t test_vreinterpret_u8_p16(poly16x4_t a) {
+ return vreinterpret_u8_p16(a);
+}
+
+// CHECK: test_vreinterpret_u16_s8
+uint16x4_t test_vreinterpret_u16_s8(int8x8_t a) {
+ return vreinterpret_u16_s8(a);
+}
+
+// CHECK: test_vreinterpret_u16_s16
+uint16x4_t test_vreinterpret_u16_s16(int16x4_t a) {
+ return vreinterpret_u16_s16(a);
+}
+
+// CHECK: test_vreinterpret_u16_s32
+uint16x4_t test_vreinterpret_u16_s32(int32x2_t a) {
+ return vreinterpret_u16_s32(a);
+}
+
+// CHECK: test_vreinterpret_u16_s64
+uint16x4_t test_vreinterpret_u16_s64(int64x1_t a) {
+ return vreinterpret_u16_s64(a);
+}
+
+// CHECK: test_vreinterpret_u16_u8
+uint16x4_t test_vreinterpret_u16_u8(uint8x8_t a) {
+ return vreinterpret_u16_u8(a);
+}
+
+// CHECK: test_vreinterpret_u16_u32
+uint16x4_t test_vreinterpret_u16_u32(uint32x2_t a) {
+ return vreinterpret_u16_u32(a);
+}
+
+// CHECK: test_vreinterpret_u16_u64
+uint16x4_t test_vreinterpret_u16_u64(uint64x1_t a) {
+ return vreinterpret_u16_u64(a);
+}
+
+// CHECK: test_vreinterpret_u16_f16
+uint16x4_t test_vreinterpret_u16_f16(float16x4_t a) {
+ return vreinterpret_u16_f16(a);
+}
+
+// CHECK: test_vreinterpret_u16_f32
+uint16x4_t test_vreinterpret_u16_f32(float32x2_t a) {
+ return vreinterpret_u16_f32(a);
+}
+
+// CHECK: test_vreinterpret_u16_p8
+uint16x4_t test_vreinterpret_u16_p8(poly8x8_t a) {
+ return vreinterpret_u16_p8(a);
+}
+
+// CHECK: test_vreinterpret_u16_p16
+uint16x4_t test_vreinterpret_u16_p16(poly16x4_t a) {
+ return vreinterpret_u16_p16(a);
+}
+
+// CHECK: test_vreinterpret_u32_s8
+uint32x2_t test_vreinterpret_u32_s8(int8x8_t a) {
+ return vreinterpret_u32_s8(a);
+}
+
+// CHECK: test_vreinterpret_u32_s16
+uint32x2_t test_vreinterpret_u32_s16(int16x4_t a) {
+ return vreinterpret_u32_s16(a);
+}
+
+// CHECK: test_vreinterpret_u32_s32
+uint32x2_t test_vreinterpret_u32_s32(int32x2_t a) {
+ return vreinterpret_u32_s32(a);
+}
+
+// CHECK: test_vreinterpret_u32_s64
+uint32x2_t test_vreinterpret_u32_s64(int64x1_t a) {
+ return vreinterpret_u32_s64(a);
+}
+
+// CHECK: test_vreinterpret_u32_u8
+uint32x2_t test_vreinterpret_u32_u8(uint8x8_t a) {
+ return vreinterpret_u32_u8(a);
+}
+
+// CHECK: test_vreinterpret_u32_u16
+uint32x2_t test_vreinterpret_u32_u16(uint16x4_t a) {
+ return vreinterpret_u32_u16(a);
+}
+
+// CHECK: test_vreinterpret_u32_u64
+uint32x2_t test_vreinterpret_u32_u64(uint64x1_t a) {
+ return vreinterpret_u32_u64(a);
+}
+
+// CHECK: test_vreinterpret_u32_f16
+uint32x2_t test_vreinterpret_u32_f16(float16x4_t a) {
+ return vreinterpret_u32_f16(a);
+}
+
+// CHECK: test_vreinterpret_u32_f32
+uint32x2_t test_vreinterpret_u32_f32(float32x2_t a) {
+ return vreinterpret_u32_f32(a);
+}
+
+// CHECK: test_vreinterpret_u32_p8
+uint32x2_t test_vreinterpret_u32_p8(poly8x8_t a) {
+ return vreinterpret_u32_p8(a);
+}
+
+// CHECK: test_vreinterpret_u32_p16
+uint32x2_t test_vreinterpret_u32_p16(poly16x4_t a) {
+ return vreinterpret_u32_p16(a);
+}
+
+// CHECK: test_vreinterpret_u64_s8
+uint64x1_t test_vreinterpret_u64_s8(int8x8_t a) {
+ return vreinterpret_u64_s8(a);
+}
+
+// CHECK: test_vreinterpret_u64_s16
+uint64x1_t test_vreinterpret_u64_s16(int16x4_t a) {
+ return vreinterpret_u64_s16(a);
+}
+
+// CHECK: test_vreinterpret_u64_s32
+uint64x1_t test_vreinterpret_u64_s32(int32x2_t a) {
+ return vreinterpret_u64_s32(a);
+}
+
+// CHECK: test_vreinterpret_u64_s64
+uint64x1_t test_vreinterpret_u64_s64(int64x1_t a) {
+ return vreinterpret_u64_s64(a);
+}
+
+// CHECK: test_vreinterpret_u64_u8
+uint64x1_t test_vreinterpret_u64_u8(uint8x8_t a) {
+ return vreinterpret_u64_u8(a);
+}
+
+// CHECK: test_vreinterpret_u64_u16
+uint64x1_t test_vreinterpret_u64_u16(uint16x4_t a) {
+ return vreinterpret_u64_u16(a);
+}
+
+// CHECK: test_vreinterpret_u64_u32
+uint64x1_t test_vreinterpret_u64_u32(uint32x2_t a) {
+ return vreinterpret_u64_u32(a);
+}
+
+// CHECK: test_vreinterpret_u64_f16
+uint64x1_t test_vreinterpret_u64_f16(float16x4_t a) {
+ return vreinterpret_u64_f16(a);
+}
+
+// CHECK: test_vreinterpret_u64_f32
+uint64x1_t test_vreinterpret_u64_f32(float32x2_t a) {
+ return vreinterpret_u64_f32(a);
+}
+
+// CHECK: test_vreinterpret_u64_p8
+uint64x1_t test_vreinterpret_u64_p8(poly8x8_t a) {
+ return vreinterpret_u64_p8(a);
+}
+
+// CHECK: test_vreinterpret_u64_p16
+uint64x1_t test_vreinterpret_u64_p16(poly16x4_t a) {
+ return vreinterpret_u64_p16(a);
+}
+
+// CHECK: test_vreinterpret_f16_s8
+float16x4_t test_vreinterpret_f16_s8(int8x8_t a) {
+ return vreinterpret_f16_s8(a);
+}
+
+// CHECK: test_vreinterpret_f16_s16
+float16x4_t test_vreinterpret_f16_s16(int16x4_t a) {
+ return vreinterpret_f16_s16(a);
+}
+
+// CHECK: test_vreinterpret_f16_s32
+float16x4_t test_vreinterpret_f16_s32(int32x2_t a) {
+ return vreinterpret_f16_s32(a);
+}
+
+// CHECK: test_vreinterpret_f16_s64
+float16x4_t test_vreinterpret_f16_s64(int64x1_t a) {
+ return vreinterpret_f16_s64(a);
+}
+
+// CHECK: test_vreinterpret_f16_u8
+float16x4_t test_vreinterpret_f16_u8(uint8x8_t a) {
+ return vreinterpret_f16_u8(a);
+}
+
+// CHECK: test_vreinterpret_f16_u16
+float16x4_t test_vreinterpret_f16_u16(uint16x4_t a) {
+ return vreinterpret_f16_u16(a);
+}
+
+// CHECK: test_vreinterpret_f16_u32
+float16x4_t test_vreinterpret_f16_u32(uint32x2_t a) {
+ return vreinterpret_f16_u32(a);
+}
+
+// CHECK: test_vreinterpret_f16_u64
+float16x4_t test_vreinterpret_f16_u64(uint64x1_t a) {
+ return vreinterpret_f16_u64(a);
+}
+
+// CHECK: test_vreinterpret_f16_f32
+float16x4_t test_vreinterpret_f16_f32(float32x2_t a) {
+ return vreinterpret_f16_f32(a);
+}
+
+// CHECK: test_vreinterpret_f16_p8
+float16x4_t test_vreinterpret_f16_p8(poly8x8_t a) {
+ return vreinterpret_f16_p8(a);
+}
+
+// CHECK: test_vreinterpret_f16_p16
+float16x4_t test_vreinterpret_f16_p16(poly16x4_t a) {
+ return vreinterpret_f16_p16(a);
+}
+
+// CHECK: test_vreinterpret_f32_s8
+float32x2_t test_vreinterpret_f32_s8(int8x8_t a) {
+ return vreinterpret_f32_s8(a);
+}
+
+// CHECK: test_vreinterpret_f32_s16
+float32x2_t test_vreinterpret_f32_s16(int16x4_t a) {
+ return vreinterpret_f32_s16(a);
+}
+
+// CHECK: test_vreinterpret_f32_s32
+float32x2_t test_vreinterpret_f32_s32(int32x2_t a) {
+ return vreinterpret_f32_s32(a);
+}
+
+// CHECK: test_vreinterpret_f32_s64
+float32x2_t test_vreinterpret_f32_s64(int64x1_t a) {
+ return vreinterpret_f32_s64(a);
+}
+
+// CHECK: test_vreinterpret_f32_u8
+float32x2_t test_vreinterpret_f32_u8(uint8x8_t a) {
+ return vreinterpret_f32_u8(a);
+}
+
+// CHECK: test_vreinterpret_f32_u16
+float32x2_t test_vreinterpret_f32_u16(uint16x4_t a) {
+ return vreinterpret_f32_u16(a);
+}
+
+// CHECK: test_vreinterpret_f32_u32
+float32x2_t test_vreinterpret_f32_u32(uint32x2_t a) {
+ return vreinterpret_f32_u32(a);
+}
+
+// CHECK: test_vreinterpret_f32_u64
+float32x2_t test_vreinterpret_f32_u64(uint64x1_t a) {
+ return vreinterpret_f32_u64(a);
+}
+
+// CHECK: test_vreinterpret_f32_f16
+float32x2_t test_vreinterpret_f32_f16(float16x4_t a) {
+ return vreinterpret_f32_f16(a);
+}
+
+// CHECK: test_vreinterpret_f32_p8
+float32x2_t test_vreinterpret_f32_p8(poly8x8_t a) {
+ return vreinterpret_f32_p8(a);
+}
+
+// CHECK: test_vreinterpret_f32_p16
+float32x2_t test_vreinterpret_f32_p16(poly16x4_t a) {
+ return vreinterpret_f32_p16(a);
+}
+
+// CHECK: test_vreinterpret_p8_s8
+poly8x8_t test_vreinterpret_p8_s8(int8x8_t a) {
+ return vreinterpret_p8_s8(a);
+}
+
+// CHECK: test_vreinterpret_p8_s16
+poly8x8_t test_vreinterpret_p8_s16(int16x4_t a) {
+ return vreinterpret_p8_s16(a);
+}
+
+// CHECK: test_vreinterpret_p8_s32
+poly8x8_t test_vreinterpret_p8_s32(int32x2_t a) {
+ return vreinterpret_p8_s32(a);
+}
+
+// CHECK: test_vreinterpret_p8_s64
+poly8x8_t test_vreinterpret_p8_s64(int64x1_t a) {
+ return vreinterpret_p8_s64(a);
+}
+
+// CHECK: test_vreinterpret_p8_u8
+poly8x8_t test_vreinterpret_p8_u8(uint8x8_t a) {
+ return vreinterpret_p8_u8(a);
+}
+
+// CHECK: test_vreinterpret_p8_u16
+poly8x8_t test_vreinterpret_p8_u16(uint16x4_t a) {
+ return vreinterpret_p8_u16(a);
+}
+
+// CHECK: test_vreinterpret_p8_u32
+poly8x8_t test_vreinterpret_p8_u32(uint32x2_t a) {
+ return vreinterpret_p8_u32(a);
+}
+
+// CHECK: test_vreinterpret_p8_u64
+poly8x8_t test_vreinterpret_p8_u64(uint64x1_t a) {
+ return vreinterpret_p8_u64(a);
+}
+
+// CHECK: test_vreinterpret_p8_f16
+poly8x8_t test_vreinterpret_p8_f16(float16x4_t a) {
+ return vreinterpret_p8_f16(a);
+}
+
+// CHECK: test_vreinterpret_p8_f32
+poly8x8_t test_vreinterpret_p8_f32(float32x2_t a) {
+ return vreinterpret_p8_f32(a);
+}
+
+// CHECK: test_vreinterpret_p8_p16
+poly8x8_t test_vreinterpret_p8_p16(poly16x4_t a) {
+ return vreinterpret_p8_p16(a);
+}
+
+// CHECK: test_vreinterpret_p16_s8
+poly16x4_t test_vreinterpret_p16_s8(int8x8_t a) {
+ return vreinterpret_p16_s8(a);
+}
+
+// CHECK: test_vreinterpret_p16_s16
+poly16x4_t test_vreinterpret_p16_s16(int16x4_t a) {
+ return vreinterpret_p16_s16(a);
+}
+
+// CHECK: test_vreinterpret_p16_s32
+poly16x4_t test_vreinterpret_p16_s32(int32x2_t a) {
+ return vreinterpret_p16_s32(a);
+}
+
+// CHECK: test_vreinterpret_p16_s64
+poly16x4_t test_vreinterpret_p16_s64(int64x1_t a) {
+ return vreinterpret_p16_s64(a);
+}
+
+// CHECK: test_vreinterpret_p16_u8
+poly16x4_t test_vreinterpret_p16_u8(uint8x8_t a) {
+ return vreinterpret_p16_u8(a);
+}
+
+// CHECK: test_vreinterpret_p16_u16
+poly16x4_t test_vreinterpret_p16_u16(uint16x4_t a) {
+ return vreinterpret_p16_u16(a);
+}
+
+// CHECK: test_vreinterpret_p16_u32
+poly16x4_t test_vreinterpret_p16_u32(uint32x2_t a) {
+ return vreinterpret_p16_u32(a);
+}
+
+// CHECK: test_vreinterpret_p16_u64
+poly16x4_t test_vreinterpret_p16_u64(uint64x1_t a) {
+ return vreinterpret_p16_u64(a);
+}
+
+// CHECK: test_vreinterpret_p16_f16
+poly16x4_t test_vreinterpret_p16_f16(float16x4_t a) {
+ return vreinterpret_p16_f16(a);
+}
+
+// CHECK: test_vreinterpret_p16_f32
+poly16x4_t test_vreinterpret_p16_f32(float32x2_t a) {
+ return vreinterpret_p16_f32(a);
+}
+
+// CHECK: test_vreinterpret_p16_p8
+poly16x4_t test_vreinterpret_p16_p8(poly8x8_t a) {
+ return vreinterpret_p16_p8(a);
+}
+
+// CHECK: test_vreinterpretq_s8_s16
+int8x16_t test_vreinterpretq_s8_s16(int16x8_t a) {
+ return vreinterpretq_s8_s16(a);
+}
+
+// CHECK: test_vreinterpretq_s8_s32
+int8x16_t test_vreinterpretq_s8_s32(int32x4_t a) {
+ return vreinterpretq_s8_s32(a);
+}
+
+// CHECK: test_vreinterpretq_s8_s64
+int8x16_t test_vreinterpretq_s8_s64(int64x2_t a) {
+ return vreinterpretq_s8_s64(a);
+}
+
+// CHECK: test_vreinterpretq_s8_u8
+int8x16_t test_vreinterpretq_s8_u8(uint8x16_t a) {
+ return vreinterpretq_s8_u8(a);
+}
+
+// CHECK: test_vreinterpretq_s8_u16
+int8x16_t test_vreinterpretq_s8_u16(uint16x8_t a) {
+ return vreinterpretq_s8_u16(a);
+}
+
+// CHECK: test_vreinterpretq_s8_u32
+int8x16_t test_vreinterpretq_s8_u32(uint32x4_t a) {
+ return vreinterpretq_s8_u32(a);
+}
+
+// CHECK: test_vreinterpretq_s8_u64
+int8x16_t test_vreinterpretq_s8_u64(uint64x2_t a) {
+ return vreinterpretq_s8_u64(a);
+}
+
+// CHECK: test_vreinterpretq_s8_f16
+int8x16_t test_vreinterpretq_s8_f16(float16x8_t a) {
+ return vreinterpretq_s8_f16(a);
+}
+
+// CHECK: test_vreinterpretq_s8_f32
+int8x16_t test_vreinterpretq_s8_f32(float32x4_t a) {
+ return vreinterpretq_s8_f32(a);
+}
+
+// CHECK: test_vreinterpretq_s8_p8
+int8x16_t test_vreinterpretq_s8_p8(poly8x16_t a) {
+ return vreinterpretq_s8_p8(a);
+}
+
+// CHECK: test_vreinterpretq_s8_p16
+int8x16_t test_vreinterpretq_s8_p16(poly16x8_t a) {
+ return vreinterpretq_s8_p16(a);
+}
+
+// CHECK: test_vreinterpretq_s16_s8
+int16x8_t test_vreinterpretq_s16_s8(int8x16_t a) {
+ return vreinterpretq_s16_s8(a);
+}
+
+// CHECK: test_vreinterpretq_s16_s32
+int16x8_t test_vreinterpretq_s16_s32(int32x4_t a) {
+ return vreinterpretq_s16_s32(a);
+}
+
+// CHECK: test_vreinterpretq_s16_s64
+int16x8_t test_vreinterpretq_s16_s64(int64x2_t a) {
+ return vreinterpretq_s16_s64(a);
+}
+
+// CHECK: test_vreinterpretq_s16_u8
+int16x8_t test_vreinterpretq_s16_u8(uint8x16_t a) {
+ return vreinterpretq_s16_u8(a);
+}
+
+// CHECK: test_vreinterpretq_s16_u16
+int16x8_t test_vreinterpretq_s16_u16(uint16x8_t a) {
+ return vreinterpretq_s16_u16(a);
+}
+
+// CHECK: test_vreinterpretq_s16_u32
+int16x8_t test_vreinterpretq_s16_u32(uint32x4_t a) {
+ return vreinterpretq_s16_u32(a);
+}
+
+// CHECK: test_vreinterpretq_s16_u64
+int16x8_t test_vreinterpretq_s16_u64(uint64x2_t a) {
+ return vreinterpretq_s16_u64(a);
+}
+
+// CHECK: test_vreinterpretq_s16_f16
+int16x8_t test_vreinterpretq_s16_f16(float16x8_t a) {
+ return vreinterpretq_s16_f16(a);
+}
+
+// CHECK: test_vreinterpretq_s16_f32
+int16x8_t test_vreinterpretq_s16_f32(float32x4_t a) {
+ return vreinterpretq_s16_f32(a);
+}
+
+// CHECK: test_vreinterpretq_s16_p8
+int16x8_t test_vreinterpretq_s16_p8(poly8x16_t a) {
+ return vreinterpretq_s16_p8(a);
+}
+
+// CHECK: test_vreinterpretq_s16_p16
+int16x8_t test_vreinterpretq_s16_p16(poly16x8_t a) {
+ return vreinterpretq_s16_p16(a);
+}
+
+// CHECK: test_vreinterpretq_s32_s8
+int32x4_t test_vreinterpretq_s32_s8(int8x16_t a) {
+ return vreinterpretq_s32_s8(a);
+}
+
+// CHECK: test_vreinterpretq_s32_s16
+int32x4_t test_vreinterpretq_s32_s16(int16x8_t a) {
+ return vreinterpretq_s32_s16(a);
+}
+
+// CHECK: test_vreinterpretq_s32_s64
+int32x4_t test_vreinterpretq_s32_s64(int64x2_t a) {
+ return vreinterpretq_s32_s64(a);
+}
+
+// CHECK: test_vreinterpretq_s32_u8
+int32x4_t test_vreinterpretq_s32_u8(uint8x16_t a) {
+ return vreinterpretq_s32_u8(a);
+}
+
+// CHECK: test_vreinterpretq_s32_u16
+int32x4_t test_vreinterpretq_s32_u16(uint16x8_t a) {
+ return vreinterpretq_s32_u16(a);
+}
+
+// CHECK: test_vreinterpretq_s32_u32
+int32x4_t test_vreinterpretq_s32_u32(uint32x4_t a) {
+ return vreinterpretq_s32_u32(a);
+}
+
+// CHECK: test_vreinterpretq_s32_u64
+int32x4_t test_vreinterpretq_s32_u64(uint64x2_t a) {
+ return vreinterpretq_s32_u64(a);
+}
+
+// CHECK: test_vreinterpretq_s32_f16
+int32x4_t test_vreinterpretq_s32_f16(float16x8_t a) {
+ return vreinterpretq_s32_f16(a);
+}
+
+// CHECK: test_vreinterpretq_s32_f32
+int32x4_t test_vreinterpretq_s32_f32(float32x4_t a) {
+ return vreinterpretq_s32_f32(a);
+}
+
+// CHECK: test_vreinterpretq_s32_p8
+int32x4_t test_vreinterpretq_s32_p8(poly8x16_t a) {
+ return vreinterpretq_s32_p8(a);
+}
+
+// CHECK: test_vreinterpretq_s32_p16
+int32x4_t test_vreinterpretq_s32_p16(poly16x8_t a) {
+ return vreinterpretq_s32_p16(a);
+}
+
+// CHECK: test_vreinterpretq_s64_s8
+int64x2_t test_vreinterpretq_s64_s8(int8x16_t a) {
+ return vreinterpretq_s64_s8(a);
+}
+
+// CHECK: test_vreinterpretq_s64_s16
+int64x2_t test_vreinterpretq_s64_s16(int16x8_t a) {
+ return vreinterpretq_s64_s16(a);
+}
+
+// CHECK: test_vreinterpretq_s64_s32
+int64x2_t test_vreinterpretq_s64_s32(int32x4_t a) {
+ return vreinterpretq_s64_s32(a);
+}
+
+// CHECK: test_vreinterpretq_s64_u8
+int64x2_t test_vreinterpretq_s64_u8(uint8x16_t a) {
+ return vreinterpretq_s64_u8(a);
+}
+
+// CHECK: test_vreinterpretq_s64_u16
+int64x2_t test_vreinterpretq_s64_u16(uint16x8_t a) {
+ return vreinterpretq_s64_u16(a);
+}
+
+// CHECK: test_vreinterpretq_s64_u32
+int64x2_t test_vreinterpretq_s64_u32(uint32x4_t a) {
+ return vreinterpretq_s64_u32(a);
+}
+
+// CHECK: test_vreinterpretq_s64_u64
+int64x2_t test_vreinterpretq_s64_u64(uint64x2_t a) {
+ return vreinterpretq_s64_u64(a);
+}
+
+// CHECK: test_vreinterpretq_s64_f16
+int64x2_t test_vreinterpretq_s64_f16(float16x8_t a) {
+ return vreinterpretq_s64_f16(a);
+}
+
+// CHECK: test_vreinterpretq_s64_f32
+int64x2_t test_vreinterpretq_s64_f32(float32x4_t a) {
+ return vreinterpretq_s64_f32(a);
+}
+
+// CHECK: test_vreinterpretq_s64_p8
+int64x2_t test_vreinterpretq_s64_p8(poly8x16_t a) {
+ return vreinterpretq_s64_p8(a);
+}
+
+// CHECK: test_vreinterpretq_s64_p16
+int64x2_t test_vreinterpretq_s64_p16(poly16x8_t a) {
+ return vreinterpretq_s64_p16(a);
+}
+
+// CHECK: test_vreinterpretq_u8_s8
+uint8x16_t test_vreinterpretq_u8_s8(int8x16_t a) {
+ return vreinterpretq_u8_s8(a);
+}
+
+// CHECK: test_vreinterpretq_u8_s16
+uint8x16_t test_vreinterpretq_u8_s16(int16x8_t a) {
+ return vreinterpretq_u8_s16(a);
+}
+
+// CHECK: test_vreinterpretq_u8_s32
+uint8x16_t test_vreinterpretq_u8_s32(int32x4_t a) {
+ return vreinterpretq_u8_s32(a);
+}
+
+// CHECK: test_vreinterpretq_u8_s64
+uint8x16_t test_vreinterpretq_u8_s64(int64x2_t a) {
+ return vreinterpretq_u8_s64(a);
+}
+
+// CHECK: test_vreinterpretq_u8_u16
+uint8x16_t test_vreinterpretq_u8_u16(uint16x8_t a) {
+ return vreinterpretq_u8_u16(a);
+}
+
+// CHECK: test_vreinterpretq_u8_u32
+uint8x16_t test_vreinterpretq_u8_u32(uint32x4_t a) {
+ return vreinterpretq_u8_u32(a);
+}
+
+// CHECK: test_vreinterpretq_u8_u64
+uint8x16_t test_vreinterpretq_u8_u64(uint64x2_t a) {
+ return vreinterpretq_u8_u64(a);
+}
+
+// CHECK: test_vreinterpretq_u8_f16
+uint8x16_t test_vreinterpretq_u8_f16(float16x8_t a) {
+ return vreinterpretq_u8_f16(a);
+}
+
+// CHECK: test_vreinterpretq_u8_f32
+uint8x16_t test_vreinterpretq_u8_f32(float32x4_t a) {
+ return vreinterpretq_u8_f32(a);
+}
+
+// CHECK: test_vreinterpretq_u8_p8
+uint8x16_t test_vreinterpretq_u8_p8(poly8x16_t a) {
+ return vreinterpretq_u8_p8(a);
+}
+
+// CHECK: test_vreinterpretq_u8_p16
+uint8x16_t test_vreinterpretq_u8_p16(poly16x8_t a) {
+ return vreinterpretq_u8_p16(a);
+}
+
+// CHECK: test_vreinterpretq_u16_s8
+uint16x8_t test_vreinterpretq_u16_s8(int8x16_t a) {
+ return vreinterpretq_u16_s8(a);
+}
+
+// CHECK: test_vreinterpretq_u16_s16
+uint16x8_t test_vreinterpretq_u16_s16(int16x8_t a) {
+ return vreinterpretq_u16_s16(a);
+}
+
+// CHECK: test_vreinterpretq_u16_s32
+uint16x8_t test_vreinterpretq_u16_s32(int32x4_t a) {
+ return vreinterpretq_u16_s32(a);
+}
+
+// CHECK: test_vreinterpretq_u16_s64
+uint16x8_t test_vreinterpretq_u16_s64(int64x2_t a) {
+ return vreinterpretq_u16_s64(a);
+}
+
+// CHECK: test_vreinterpretq_u16_u8
+uint16x8_t test_vreinterpretq_u16_u8(uint8x16_t a) {
+ return vreinterpretq_u16_u8(a);
+}
+
+// CHECK: test_vreinterpretq_u16_u32
+uint16x8_t test_vreinterpretq_u16_u32(uint32x4_t a) {
+ return vreinterpretq_u16_u32(a);
+}
+
+// CHECK: test_vreinterpretq_u16_u64
+uint16x8_t test_vreinterpretq_u16_u64(uint64x2_t a) {
+ return vreinterpretq_u16_u64(a);
+}
+
+// CHECK: test_vreinterpretq_u16_f16
+uint16x8_t test_vreinterpretq_u16_f16(float16x8_t a) {
+ return vreinterpretq_u16_f16(a);
+}
+
+// CHECK: test_vreinterpretq_u16_f32
+uint16x8_t test_vreinterpretq_u16_f32(float32x4_t a) {
+ return vreinterpretq_u16_f32(a);
+}
+
+// CHECK: test_vreinterpretq_u16_p8
+uint16x8_t test_vreinterpretq_u16_p8(poly8x16_t a) {
+ return vreinterpretq_u16_p8(a);
+}
+
+// CHECK: test_vreinterpretq_u16_p16
+uint16x8_t test_vreinterpretq_u16_p16(poly16x8_t a) {
+ return vreinterpretq_u16_p16(a);
+}
+
+// CHECK: test_vreinterpretq_u32_s8
+uint32x4_t test_vreinterpretq_u32_s8(int8x16_t a) {
+ return vreinterpretq_u32_s8(a);
+}
+
+// CHECK: test_vreinterpretq_u32_s16
+uint32x4_t test_vreinterpretq_u32_s16(int16x8_t a) {
+ return vreinterpretq_u32_s16(a);
+}
+
+// CHECK: test_vreinterpretq_u32_s32
+uint32x4_t test_vreinterpretq_u32_s32(int32x4_t a) {
+ return vreinterpretq_u32_s32(a);
+}
+
+// CHECK: test_vreinterpretq_u32_s64
+uint32x4_t test_vreinterpretq_u32_s64(int64x2_t a) {
+ return vreinterpretq_u32_s64(a);
+}
+
+// CHECK: test_vreinterpretq_u32_u8
+uint32x4_t test_vreinterpretq_u32_u8(uint8x16_t a) {
+ return vreinterpretq_u32_u8(a);
+}
+
+// CHECK: test_vreinterpretq_u32_u16
+uint32x4_t test_vreinterpretq_u32_u16(uint16x8_t a) {
+ return vreinterpretq_u32_u16(a);
+}
+
+// CHECK: test_vreinterpretq_u32_u64
+uint32x4_t test_vreinterpretq_u32_u64(uint64x2_t a) {
+ return vreinterpretq_u32_u64(a);
+}
+
+// CHECK: test_vreinterpretq_u32_f16
+uint32x4_t test_vreinterpretq_u32_f16(float16x8_t a) {
+ return vreinterpretq_u32_f16(a);
+}
+
+// CHECK: test_vreinterpretq_u32_f32
+uint32x4_t test_vreinterpretq_u32_f32(float32x4_t a) {
+ return vreinterpretq_u32_f32(a);
+}
+
+// CHECK: test_vreinterpretq_u32_p8
+uint32x4_t test_vreinterpretq_u32_p8(poly8x16_t a) {
+ return vreinterpretq_u32_p8(a);
+}
+
+// CHECK: test_vreinterpretq_u32_p16
+uint32x4_t test_vreinterpretq_u32_p16(poly16x8_t a) {
+ return vreinterpretq_u32_p16(a);
+}
+
+// CHECK: test_vreinterpretq_u64_s8
+uint64x2_t test_vreinterpretq_u64_s8(int8x16_t a) {
+ return vreinterpretq_u64_s8(a);
+}
+
+// CHECK: test_vreinterpretq_u64_s16
+uint64x2_t test_vreinterpretq_u64_s16(int16x8_t a) {
+ return vreinterpretq_u64_s16(a);
+}
+
+// CHECK: test_vreinterpretq_u64_s32
+uint64x2_t test_vreinterpretq_u64_s32(int32x4_t a) {
+ return vreinterpretq_u64_s32(a);
+}
+
+// CHECK: test_vreinterpretq_u64_s64
+uint64x2_t test_vreinterpretq_u64_s64(int64x2_t a) {
+ return vreinterpretq_u64_s64(a);
+}
+
+// CHECK: test_vreinterpretq_u64_u8
+uint64x2_t test_vreinterpretq_u64_u8(uint8x16_t a) {
+ return vreinterpretq_u64_u8(a);
+}
+
+// CHECK: test_vreinterpretq_u64_u16
+uint64x2_t test_vreinterpretq_u64_u16(uint16x8_t a) {
+ return vreinterpretq_u64_u16(a);
+}
+
+// CHECK: test_vreinterpretq_u64_u32
+uint64x2_t test_vreinterpretq_u64_u32(uint32x4_t a) {
+ return vreinterpretq_u64_u32(a);
+}
+
+// CHECK: test_vreinterpretq_u64_f16
+uint64x2_t test_vreinterpretq_u64_f16(float16x8_t a) {
+ return vreinterpretq_u64_f16(a);
+}
+
+// CHECK: test_vreinterpretq_u64_f32
+uint64x2_t test_vreinterpretq_u64_f32(float32x4_t a) {
+ return vreinterpretq_u64_f32(a);
+}
+
+// CHECK: test_vreinterpretq_u64_p8
+uint64x2_t test_vreinterpretq_u64_p8(poly8x16_t a) {
+ return vreinterpretq_u64_p8(a);
+}
+
+// CHECK: test_vreinterpretq_u64_p16
+uint64x2_t test_vreinterpretq_u64_p16(poly16x8_t a) {
+ return vreinterpretq_u64_p16(a);
+}
+
+// CHECK: test_vreinterpretq_f16_s8
+float16x8_t test_vreinterpretq_f16_s8(int8x16_t a) {
+ return vreinterpretq_f16_s8(a);
+}
+
+// CHECK: test_vreinterpretq_f16_s16
+float16x8_t test_vreinterpretq_f16_s16(int16x8_t a) {
+ return vreinterpretq_f16_s16(a);
+}
+
+// CHECK: test_vreinterpretq_f16_s32
+float16x8_t test_vreinterpretq_f16_s32(int32x4_t a) {
+ return vreinterpretq_f16_s32(a);
+}
+
+// CHECK: test_vreinterpretq_f16_s64
+float16x8_t test_vreinterpretq_f16_s64(int64x2_t a) {
+ return vreinterpretq_f16_s64(a);
+}
+
+// CHECK: test_vreinterpretq_f16_u8
+float16x8_t test_vreinterpretq_f16_u8(uint8x16_t a) {
+ return vreinterpretq_f16_u8(a);
+}
+
+// CHECK: test_vreinterpretq_f16_u16
+float16x8_t test_vreinterpretq_f16_u16(uint16x8_t a) {
+ return vreinterpretq_f16_u16(a);
+}
+
+// CHECK: test_vreinterpretq_f16_u32
+float16x8_t test_vreinterpretq_f16_u32(uint32x4_t a) {
+ return vreinterpretq_f16_u32(a);
+}
+
+// CHECK: test_vreinterpretq_f16_u64
+float16x8_t test_vreinterpretq_f16_u64(uint64x2_t a) {
+ return vreinterpretq_f16_u64(a);
+}
+
+// CHECK: test_vreinterpretq_f16_f32
+float16x8_t test_vreinterpretq_f16_f32(float32x4_t a) {
+ return vreinterpretq_f16_f32(a);
+}
+
+// CHECK: test_vreinterpretq_f16_p8
+float16x8_t test_vreinterpretq_f16_p8(poly8x16_t a) {
+ return vreinterpretq_f16_p8(a);
+}
+
+// CHECK: test_vreinterpretq_f16_p16
+float16x8_t test_vreinterpretq_f16_p16(poly16x8_t a) {
+ return vreinterpretq_f16_p16(a);
+}
+
+// CHECK: test_vreinterpretq_f32_s8
+float32x4_t test_vreinterpretq_f32_s8(int8x16_t a) {
+ return vreinterpretq_f32_s8(a);
+}
+
+// CHECK: test_vreinterpretq_f32_s16
+float32x4_t test_vreinterpretq_f32_s16(int16x8_t a) {
+ return vreinterpretq_f32_s16(a);
+}
+
+// CHECK: test_vreinterpretq_f32_s32
+float32x4_t test_vreinterpretq_f32_s32(int32x4_t a) {
+ return vreinterpretq_f32_s32(a);
+}
+
+// CHECK: test_vreinterpretq_f32_s64
+float32x4_t test_vreinterpretq_f32_s64(int64x2_t a) {
+ return vreinterpretq_f32_s64(a);
+}
+
+// CHECK: test_vreinterpretq_f32_u8
+float32x4_t test_vreinterpretq_f32_u8(uint8x16_t a) {
+ return vreinterpretq_f32_u8(a);
+}
+
+// CHECK: test_vreinterpretq_f32_u16
+float32x4_t test_vreinterpretq_f32_u16(uint16x8_t a) {
+ return vreinterpretq_f32_u16(a);
+}
+
+// CHECK: test_vreinterpretq_f32_u32
+float32x4_t test_vreinterpretq_f32_u32(uint32x4_t a) {
+ return vreinterpretq_f32_u32(a);
+}
+
+// CHECK: test_vreinterpretq_f32_u64
+float32x4_t test_vreinterpretq_f32_u64(uint64x2_t a) {
+ return vreinterpretq_f32_u64(a);
+}
+
+// CHECK: test_vreinterpretq_f32_f16
+float32x4_t test_vreinterpretq_f32_f16(float16x8_t a) {
+ return vreinterpretq_f32_f16(a);
+}
+
+// CHECK: test_vreinterpretq_f32_p8
+float32x4_t test_vreinterpretq_f32_p8(poly8x16_t a) {
+ return vreinterpretq_f32_p8(a);
+}
+
+// CHECK: test_vreinterpretq_f32_p16
+float32x4_t test_vreinterpretq_f32_p16(poly16x8_t a) {
+ return vreinterpretq_f32_p16(a);
+}
+
+// CHECK: test_vreinterpretq_p8_s8
+poly8x16_t test_vreinterpretq_p8_s8(int8x16_t a) {
+ return vreinterpretq_p8_s8(a);
+}
+
+// CHECK: test_vreinterpretq_p8_s16
+poly8x16_t test_vreinterpretq_p8_s16(int16x8_t a) {
+ return vreinterpretq_p8_s16(a);
+}
+
+// CHECK: test_vreinterpretq_p8_s32
+poly8x16_t test_vreinterpretq_p8_s32(int32x4_t a) {
+ return vreinterpretq_p8_s32(a);
+}
+
+// CHECK: test_vreinterpretq_p8_s64
+poly8x16_t test_vreinterpretq_p8_s64(int64x2_t a) {
+ return vreinterpretq_p8_s64(a);
+}
+
+// CHECK: test_vreinterpretq_p8_u8
+poly8x16_t test_vreinterpretq_p8_u8(uint8x16_t a) {
+ return vreinterpretq_p8_u8(a);
+}
+
+// CHECK: test_vreinterpretq_p8_u16
+poly8x16_t test_vreinterpretq_p8_u16(uint16x8_t a) {
+ return vreinterpretq_p8_u16(a);
+}
+
+// CHECK: test_vreinterpretq_p8_u32
+poly8x16_t test_vreinterpretq_p8_u32(uint32x4_t a) {
+ return vreinterpretq_p8_u32(a);
+}
+
+// CHECK: test_vreinterpretq_p8_u64
+poly8x16_t test_vreinterpretq_p8_u64(uint64x2_t a) {
+ return vreinterpretq_p8_u64(a);
+}
+
+// CHECK: test_vreinterpretq_p8_f16
+poly8x16_t test_vreinterpretq_p8_f16(float16x8_t a) {
+ return vreinterpretq_p8_f16(a);
+}
+
+// CHECK: test_vreinterpretq_p8_f32
+poly8x16_t test_vreinterpretq_p8_f32(float32x4_t a) {
+ return vreinterpretq_p8_f32(a);
+}
+
+// CHECK: test_vreinterpretq_p8_p16
+poly8x16_t test_vreinterpretq_p8_p16(poly16x8_t a) {
+ return vreinterpretq_p8_p16(a);
+}
+
+// CHECK: test_vreinterpretq_p16_s8
+poly16x8_t test_vreinterpretq_p16_s8(int8x16_t a) {
+ return vreinterpretq_p16_s8(a);
+}
+
+// CHECK: test_vreinterpretq_p16_s16
+poly16x8_t test_vreinterpretq_p16_s16(int16x8_t a) {
+ return vreinterpretq_p16_s16(a);
+}
+
+// CHECK: test_vreinterpretq_p16_s32
+poly16x8_t test_vreinterpretq_p16_s32(int32x4_t a) {
+ return vreinterpretq_p16_s32(a);
+}
+
+// CHECK: test_vreinterpretq_p16_s64
+poly16x8_t test_vreinterpretq_p16_s64(int64x2_t a) {
+ return vreinterpretq_p16_s64(a);
+}
+
+// CHECK: test_vreinterpretq_p16_u8
+poly16x8_t test_vreinterpretq_p16_u8(uint8x16_t a) {
+ return vreinterpretq_p16_u8(a);
+}
+
+// CHECK: test_vreinterpretq_p16_u16
+poly16x8_t test_vreinterpretq_p16_u16(uint16x8_t a) {
+ return vreinterpretq_p16_u16(a);
+}
+
+// CHECK: test_vreinterpretq_p16_u32
+poly16x8_t test_vreinterpretq_p16_u32(uint32x4_t a) {
+ return vreinterpretq_p16_u32(a);
+}
+
+// CHECK: test_vreinterpretq_p16_u64
+poly16x8_t test_vreinterpretq_p16_u64(uint64x2_t a) {
+ return vreinterpretq_p16_u64(a);
+}
+
+// CHECK: test_vreinterpretq_p16_f16
+poly16x8_t test_vreinterpretq_p16_f16(float16x8_t a) {
+ return vreinterpretq_p16_f16(a);
+}
+
+// CHECK: test_vreinterpretq_p16_f32
+poly16x8_t test_vreinterpretq_p16_f32(float32x4_t a) {
+ return vreinterpretq_p16_f32(a);
+}
+
+// CHECK: test_vreinterpretq_p16_p8
+poly16x8_t test_vreinterpretq_p16_p8(poly8x16_t a) {
+ return vreinterpretq_p16_p8(a);
+}
+
+
+// CHECK: test_vrev16_s8
+// CHECK: vrev16.8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vrev16_s8(int8x8_t a) {
+ return vrev16_s8(a);
+}
+
+// CHECK: test_vrev16_u8
+// CHECK: vrev16.8 d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vrev16_u8(uint8x8_t a) {
+ return vrev16_u8(a);
+}
+
+// CHECK: test_vrev16_p8
+// CHECK: vrev16.8 d{{[0-9]+}}, d{{[0-9]+}}
+poly8x8_t test_vrev16_p8(poly8x8_t a) {
+ return vrev16_p8(a);
+}
+
+// CHECK: test_vrev16q_s8
+// CHECK: vrev16.8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vrev16q_s8(int8x16_t a) {
+ return vrev16q_s8(a);
+}
+
+// CHECK: test_vrev16q_u8
+// CHECK: vrev16.8 q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vrev16q_u8(uint8x16_t a) {
+ return vrev16q_u8(a);
+}
+
+// CHECK: test_vrev16q_p8
+// CHECK: vrev16.8 q{{[0-9]+}}, q{{[0-9]+}}
+poly8x16_t test_vrev16q_p8(poly8x16_t a) {
+ return vrev16q_p8(a);
+}
+
+
+// CHECK: test_vrev32_s8
+// CHECK: vrev32.8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vrev32_s8(int8x8_t a) {
+ return vrev32_s8(a);
+}
+
+// CHECK: test_vrev32_s16
+// CHECK: vrev32.16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vrev32_s16(int16x4_t a) {
+ return vrev32_s16(a);
+}
+
+// CHECK: test_vrev32_u8
+// CHECK: vrev32.8 d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vrev32_u8(uint8x8_t a) {
+ return vrev32_u8(a);
+}
+
+// CHECK: test_vrev32_u16
+// CHECK: vrev32.16 d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vrev32_u16(uint16x4_t a) {
+ return vrev32_u16(a);
+}
+
+// CHECK: test_vrev32_p8
+// CHECK: vrev32.8 d{{[0-9]+}}, d{{[0-9]+}}
+poly8x8_t test_vrev32_p8(poly8x8_t a) {
+ return vrev32_p8(a);
+}
+
+// CHECK: test_vrev32_p16
+// CHECK: vrev32.16 d{{[0-9]+}}, d{{[0-9]+}}
+poly16x4_t test_vrev32_p16(poly16x4_t a) {
+ return vrev32_p16(a);
+}
+
+// CHECK: test_vrev32q_s8
+// CHECK: vrev32.8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vrev32q_s8(int8x16_t a) {
+ return vrev32q_s8(a);
+}
+
+// CHECK: test_vrev32q_s16
+// CHECK: vrev32.16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vrev32q_s16(int16x8_t a) {
+ return vrev32q_s16(a);
+}
+
+// CHECK: test_vrev32q_u8
+// CHECK: vrev32.8 q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vrev32q_u8(uint8x16_t a) {
+ return vrev32q_u8(a);
+}
+
+// CHECK: test_vrev32q_u16
+// CHECK: vrev32.16 q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vrev32q_u16(uint16x8_t a) {
+ return vrev32q_u16(a);
+}
+
+// CHECK: test_vrev32q_p8
+// CHECK: vrev32.8 q{{[0-9]+}}, q{{[0-9]+}}
+poly8x16_t test_vrev32q_p8(poly8x16_t a) {
+ return vrev32q_p8(a);
+}
+
+// CHECK: test_vrev32q_p16
+// CHECK: vrev32.16 q{{[0-9]+}}, q{{[0-9]+}}
+poly16x8_t test_vrev32q_p16(poly16x8_t a) {
+ return vrev32q_p16(a);
+}
+
+
+// CHECK: test_vrev64_s8
+// CHECK: vrev64.8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vrev64_s8(int8x8_t a) {
+ return vrev64_s8(a);
+}
+
+// CHECK: test_vrev64_s16
+// CHECK: vrev64.16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vrev64_s16(int16x4_t a) {
+ return vrev64_s16(a);
+}
+
+// CHECK: test_vrev64_s32
+// CHECK: vrev64.32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vrev64_s32(int32x2_t a) {
+ return vrev64_s32(a);
+}
+
+// CHECK: test_vrev64_u8
+// CHECK: vrev64.8 d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vrev64_u8(uint8x8_t a) {
+ return vrev64_u8(a);
+}
+
+// CHECK: test_vrev64_u16
+// CHECK: vrev64.16 d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vrev64_u16(uint16x4_t a) {
+ return vrev64_u16(a);
+}
+
+// CHECK: test_vrev64_u32
+// CHECK: vrev64.32 d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vrev64_u32(uint32x2_t a) {
+ return vrev64_u32(a);
+}
+
+// CHECK: test_vrev64_p8
+// CHECK: vrev64.8 d{{[0-9]+}}, d{{[0-9]+}}
+poly8x8_t test_vrev64_p8(poly8x8_t a) {
+ return vrev64_p8(a);
+}
+
+// CHECK: test_vrev64_p16
+// CHECK: vrev64.16 d{{[0-9]+}}, d{{[0-9]+}}
+poly16x4_t test_vrev64_p16(poly16x4_t a) {
+ return vrev64_p16(a);
+}
+
+// CHECK: test_vrev64_f32
+// CHECK: vrev64.32 d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vrev64_f32(float32x2_t a) {
+ return vrev64_f32(a);
+}
+
+// CHECK: test_vrev64q_s8
+// CHECK: vrev64.8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vrev64q_s8(int8x16_t a) {
+ return vrev64q_s8(a);
+}
+
+// CHECK: test_vrev64q_s16
+// CHECK: vrev64.16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vrev64q_s16(int16x8_t a) {
+ return vrev64q_s16(a);
+}
+
+// CHECK: test_vrev64q_s32
+// CHECK: vrev64.32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vrev64q_s32(int32x4_t a) {
+ return vrev64q_s32(a);
+}
+
+// CHECK: test_vrev64q_u8
+// CHECK: vrev64.8 q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vrev64q_u8(uint8x16_t a) {
+ return vrev64q_u8(a);
+}
+
+// CHECK: test_vrev64q_u16
+// CHECK: vrev64.16 q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vrev64q_u16(uint16x8_t a) {
+ return vrev64q_u16(a);
+}
+
+// CHECK: test_vrev64q_u32
+// CHECK: vrev64.32 q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vrev64q_u32(uint32x4_t a) {
+ return vrev64q_u32(a);
+}
+
+// CHECK: test_vrev64q_p8
+// CHECK: vrev64.8 q{{[0-9]+}}, q{{[0-9]+}}
+poly8x16_t test_vrev64q_p8(poly8x16_t a) {
+ return vrev64q_p8(a);
+}
+
+// CHECK: test_vrev64q_p16
+// CHECK: vrev64.16 q{{[0-9]+}}, q{{[0-9]+}}
+poly16x8_t test_vrev64q_p16(poly16x8_t a) {
+ return vrev64q_p16(a);
+}
+
+// CHECK: test_vrev64q_f32
+// CHECK: vrev64.32 q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vrev64q_f32(float32x4_t a) {
+ return vrev64q_f32(a);
+}
+
+
+// CHECK: test_vrhadd_s8
+// CHECK: vrhadd.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vrhadd_s8(int8x8_t a, int8x8_t b) {
+ return vrhadd_s8(a, b);
+}
+
+// CHECK: test_vrhadd_s16
+// CHECK: vrhadd.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vrhadd_s16(int16x4_t a, int16x4_t b) {
+ return vrhadd_s16(a, b);
+}
+
+// CHECK: test_vrhadd_s32
+// CHECK: vrhadd.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vrhadd_s32(int32x2_t a, int32x2_t b) {
+ return vrhadd_s32(a, b);
+}
+
+// CHECK: test_vrhadd_u8
+// CHECK: vrhadd.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vrhadd_u8(uint8x8_t a, uint8x8_t b) {
+ return vrhadd_u8(a, b);
+}
+
+// CHECK: test_vrhadd_u16
+// CHECK: vrhadd.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vrhadd_u16(uint16x4_t a, uint16x4_t b) {
+ return vrhadd_u16(a, b);
+}
+
+// CHECK: test_vrhadd_u32
+// CHECK: vrhadd.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vrhadd_u32(uint32x2_t a, uint32x2_t b) {
+ return vrhadd_u32(a, b);
+}
+
+// CHECK: test_vrhaddq_s8
+// CHECK: vrhadd.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vrhaddq_s8(int8x16_t a, int8x16_t b) {
+ return vrhaddq_s8(a, b);
+}
+
+// CHECK: test_vrhaddq_s16
+// CHECK: vrhadd.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vrhaddq_s16(int16x8_t a, int16x8_t b) {
+ return vrhaddq_s16(a, b);
+}
+
+// CHECK: test_vrhaddq_s32
+// CHECK: vrhadd.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vrhaddq_s32(int32x4_t a, int32x4_t b) {
+ return vrhaddq_s32(a, b);
+}
+
+// CHECK: test_vrhaddq_u8
+// CHECK: vrhadd.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vrhaddq_u8(uint8x16_t a, uint8x16_t b) {
+ return vrhaddq_u8(a, b);
+}
+
+// CHECK: test_vrhaddq_u16
+// CHECK: vrhadd.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vrhaddq_u16(uint16x8_t a, uint16x8_t b) {
+ return vrhaddq_u16(a, b);
+}
+
+// CHECK: test_vrhaddq_u32
+// CHECK: vrhadd.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vrhaddq_u32(uint32x4_t a, uint32x4_t b) {
+ return vrhaddq_u32(a, b);
+}
+
+
+// CHECK: test_vrshl_s8
+// CHECK: vrshl.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vrshl_s8(int8x8_t a, int8x8_t b) {
+ return vrshl_s8(a, b);
+}
+
+// CHECK: test_vrshl_s16
+// CHECK: vrshl.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vrshl_s16(int16x4_t a, int16x4_t b) {
+ return vrshl_s16(a, b);
+}
+
+// CHECK: test_vrshl_s32
+// CHECK: vrshl.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vrshl_s32(int32x2_t a, int32x2_t b) {
+ return vrshl_s32(a, b);
+}
+
+// CHECK: test_vrshl_s64
+// CHECK: vrshl.s64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vrshl_s64(int64x1_t a, int64x1_t b) {
+ return vrshl_s64(a, b);
+}
+
+// CHECK: test_vrshl_u8
+// CHECK: vrshl.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vrshl_u8(uint8x8_t a, int8x8_t b) {
+ return vrshl_u8(a, b);
+}
+
+// CHECK: test_vrshl_u16
+// CHECK: vrshl.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vrshl_u16(uint16x4_t a, int16x4_t b) {
+ return vrshl_u16(a, b);
+}
+
+// CHECK: test_vrshl_u32
+// CHECK: vrshl.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vrshl_u32(uint32x2_t a, int32x2_t b) {
+ return vrshl_u32(a, b);
+}
+
+// CHECK: test_vrshl_u64
+// CHECK: vrshl.u64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vrshl_u64(uint64x1_t a, int64x1_t b) {
+ return vrshl_u64(a, b);
+}
+
+// CHECK: test_vrshlq_s8
+// CHECK: vrshl.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vrshlq_s8(int8x16_t a, int8x16_t b) {
+ return vrshlq_s8(a, b);
+}
+
+// CHECK: test_vrshlq_s16
+// CHECK: vrshl.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vrshlq_s16(int16x8_t a, int16x8_t b) {
+ return vrshlq_s16(a, b);
+}
+
+// CHECK: test_vrshlq_s32
+// CHECK: vrshl.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vrshlq_s32(int32x4_t a, int32x4_t b) {
+ return vrshlq_s32(a, b);
+}
+
+// CHECK: test_vrshlq_s64
+// CHECK: vrshl.s64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vrshlq_s64(int64x2_t a, int64x2_t b) {
+ return vrshlq_s64(a, b);
+}
+
+// CHECK: test_vrshlq_u8
+// CHECK: vrshl.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vrshlq_u8(uint8x16_t a, int8x16_t b) {
+ return vrshlq_u8(a, b);
+}
+
+// CHECK: test_vrshlq_u16
+// CHECK: vrshl.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vrshlq_u16(uint16x8_t a, int16x8_t b) {
+ return vrshlq_u16(a, b);
+}
+
+// CHECK: test_vrshlq_u32
+// CHECK: vrshl.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vrshlq_u32(uint32x4_t a, int32x4_t b) {
+ return vrshlq_u32(a, b);
+}
+
+// CHECK: test_vrshlq_u64
+// CHECK: vrshl.u64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vrshlq_u64(uint64x2_t a, int64x2_t b) {
+ return vrshlq_u64(a, b);
+}
+
+
+// CHECK: test_vrshrn_n_s16
+// CHECK: vrshrn.i16 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vrshrn_n_s16(int16x8_t a) {
+ return vrshrn_n_s16(a, 1);
+}
+
+// CHECK: test_vrshrn_n_s32
+// CHECK: vrshrn.i32 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vrshrn_n_s32(int32x4_t a) {
+ return vrshrn_n_s32(a, 1);
+}
+
+// CHECK: test_vrshrn_n_s64
+// CHECK: vrshrn.i64 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vrshrn_n_s64(int64x2_t a) {
+ return vrshrn_n_s64(a, 1);
+}
+
+// CHECK: test_vrshrn_n_u16
+// CHECK: vrshrn.i16 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vrshrn_n_u16(uint16x8_t a) {
+ return vrshrn_n_u16(a, 1);
+}
+
+// CHECK: test_vrshrn_n_u32
+// CHECK: vrshrn.i32 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vrshrn_n_u32(uint32x4_t a) {
+ return vrshrn_n_u32(a, 1);
+}
+
+// CHECK: test_vrshrn_n_u64
+// CHECK: vrshrn.i64 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vrshrn_n_u64(uint64x2_t a) {
+ return vrshrn_n_u64(a, 1);
+}
+
+
+// CHECK: test_vrshr_n_s8
+// CHECK: vrshr.s8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vrshr_n_s8(int8x8_t a) {
+ return vrshr_n_s8(a, 1);
+}
+
+// CHECK: test_vrshr_n_s16
+// CHECK: vrshr.s16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vrshr_n_s16(int16x4_t a) {
+ return vrshr_n_s16(a, 1);
+}
+
+// CHECK: test_vrshr_n_s32
+// CHECK: vrshr.s32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vrshr_n_s32(int32x2_t a) {
+ return vrshr_n_s32(a, 1);
+}
+
+// CHECK: test_vrshr_n_s64
+// CHECK: vrshr.s64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int64x1_t test_vrshr_n_s64(int64x1_t a) {
+ return vrshr_n_s64(a, 1);
+}
+
+// CHECK: test_vrshr_n_u8
+// CHECK: vrshr.u8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vrshr_n_u8(uint8x8_t a) {
+ return vrshr_n_u8(a, 1);
+}
+
+// CHECK: test_vrshr_n_u16
+// CHECK: vrshr.u16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vrshr_n_u16(uint16x4_t a) {
+ return vrshr_n_u16(a, 1);
+}
+
+// CHECK: test_vrshr_n_u32
+// CHECK: vrshr.u32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vrshr_n_u32(uint32x2_t a) {
+ return vrshr_n_u32(a, 1);
+}
+
+// CHECK: test_vrshr_n_u64
+// CHECK: vrshr.u64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint64x1_t test_vrshr_n_u64(uint64x1_t a) {
+ return vrshr_n_u64(a, 1);
+}
+
+// CHECK: test_vrshrq_n_s8
+// CHECK: vrshr.s8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x16_t test_vrshrq_n_s8(int8x16_t a) {
+ return vrshrq_n_s8(a, 1);
+}
+
+// CHECK: test_vrshrq_n_s16
+// CHECK: vrshr.s16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x8_t test_vrshrq_n_s16(int16x8_t a) {
+ return vrshrq_n_s16(a, 1);
+}
+
+// CHECK: test_vrshrq_n_s32
+// CHECK: vrshr.s32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vrshrq_n_s32(int32x4_t a) {
+ return vrshrq_n_s32(a, 1);
+}
+
+// CHECK: test_vrshrq_n_s64
+// CHECK: vrshr.s64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int64x2_t test_vrshrq_n_s64(int64x2_t a) {
+ return vrshrq_n_s64(a, 1);
+}
+
+// CHECK: test_vrshrq_n_u8
+// CHECK: vrshr.u8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x16_t test_vrshrq_n_u8(uint8x16_t a) {
+ return vrshrq_n_u8(a, 1);
+}
+
+// CHECK: test_vrshrq_n_u16
+// CHECK: vrshr.u16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vrshrq_n_u16(uint16x8_t a) {
+ return vrshrq_n_u16(a, 1);
+}
+
+// CHECK: test_vrshrq_n_u32
+// CHECK: vrshr.u32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vrshrq_n_u32(uint32x4_t a) {
+ return vrshrq_n_u32(a, 1);
+}
+
+// CHECK: test_vrshrq_n_u64
+// CHECK: vrshr.u64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint64x2_t test_vrshrq_n_u64(uint64x2_t a) {
+ return vrshrq_n_u64(a, 1);
+}
+
+
+// CHECK: test_vrsqrte_f32
+// CHECK: vrsqrte.f32 d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vrsqrte_f32(float32x2_t a) {
+ return vrsqrte_f32(a);
+}
+
+// CHECK: test_vrsqrte_u32
+// CHECK: vrsqrte.u32 d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vrsqrte_u32(uint32x2_t a) {
+ return vrsqrte_u32(a);
+}
+
+// CHECK: test_vrsqrteq_f32
+// CHECK: vrsqrte.f32 q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vrsqrteq_f32(float32x4_t a) {
+ return vrsqrteq_f32(a);
+}
+
+// CHECK: test_vrsqrteq_u32
+// CHECK: vrsqrte.u32 q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vrsqrteq_u32(uint32x4_t a) {
+ return vrsqrteq_u32(a);
+}
+
+
+// CHECK: test_vrsqrts_f32
+// CHECK: vrsqrts.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vrsqrts_f32(float32x2_t a, float32x2_t b) {
+ return vrsqrts_f32(a, b);
+}
+
+// CHECK: test_vrsqrtsq_f32
+// CHECK: vrsqrts.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vrsqrtsq_f32(float32x4_t a, float32x4_t b) {
+ return vrsqrtsq_f32(a, b);
+}
+
+
+// CHECK: test_vrsra_n_s8
+// CHECK: vrsra.s8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vrsra_n_s8(int8x8_t a, int8x8_t b) {
+ return vrsra_n_s8(a, b, 1);
+}
+
+// CHECK: test_vrsra_n_s16
+// CHECK: vrsra.s16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vrsra_n_s16(int16x4_t a, int16x4_t b) {
+ return vrsra_n_s16(a, b, 1);
+}
+
+// CHECK: test_vrsra_n_s32
+// CHECK: vrsra.s32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vrsra_n_s32(int32x2_t a, int32x2_t b) {
+ return vrsra_n_s32(a, b, 1);
+}
+
+// CHECK: test_vrsra_n_s64
+// CHECK: vrsra.s64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int64x1_t test_vrsra_n_s64(int64x1_t a, int64x1_t b) {
+ return vrsra_n_s64(a, b, 1);
+}
+
+// CHECK: test_vrsra_n_u8
+// CHECK: vrsra.u8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vrsra_n_u8(uint8x8_t a, uint8x8_t b) {
+ return vrsra_n_u8(a, b, 1);
+}
+
+// CHECK: test_vrsra_n_u16
+// CHECK: vrsra.u16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vrsra_n_u16(uint16x4_t a, uint16x4_t b) {
+ return vrsra_n_u16(a, b, 1);
+}
+
+// CHECK: test_vrsra_n_u32
+// CHECK: vrsra.u32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vrsra_n_u32(uint32x2_t a, uint32x2_t b) {
+ return vrsra_n_u32(a, b, 1);
+}
+
+// CHECK: test_vrsra_n_u64
+// CHECK: vrsra.u64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint64x1_t test_vrsra_n_u64(uint64x1_t a, uint64x1_t b) {
+ return vrsra_n_u64(a, b, 1);
+}
+
+// CHECK: test_vrsraq_n_s8
+// CHECK: vrsra.s8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x16_t test_vrsraq_n_s8(int8x16_t a, int8x16_t b) {
+ return vrsraq_n_s8(a, b, 1);
+}
+
+// CHECK: test_vrsraq_n_s16
+// CHECK: vrsra.s16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x8_t test_vrsraq_n_s16(int16x8_t a, int16x8_t b) {
+ return vrsraq_n_s16(a, b, 1);
+}
+
+// CHECK: test_vrsraq_n_s32
+// CHECK: vrsra.s32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vrsraq_n_s32(int32x4_t a, int32x4_t b) {
+ return vrsraq_n_s32(a, b, 1);
+}
+
+// CHECK: test_vrsraq_n_s64
+// CHECK: vrsra.s64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int64x2_t test_vrsraq_n_s64(int64x2_t a, int64x2_t b) {
+ return vrsraq_n_s64(a, b, 1);
+}
+
+// CHECK: test_vrsraq_n_u8
+// CHECK: vrsra.u8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x16_t test_vrsraq_n_u8(uint8x16_t a, uint8x16_t b) {
+ return vrsraq_n_u8(a, b, 1);
+}
+
+// CHECK: test_vrsraq_n_u16
+// CHECK: vrsra.u16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vrsraq_n_u16(uint16x8_t a, uint16x8_t b) {
+ return vrsraq_n_u16(a, b, 1);
+}
+
+// CHECK: test_vrsraq_n_u32
+// CHECK: vrsra.u32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vrsraq_n_u32(uint32x4_t a, uint32x4_t b) {
+ return vrsraq_n_u32(a, b, 1);
+}
+
+// CHECK: test_vrsraq_n_u64
+// CHECK: vrsra.u64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint64x2_t test_vrsraq_n_u64(uint64x2_t a, uint64x2_t b) {
+ return vrsraq_n_u64(a, b, 1);
+}
+
+
+// CHECK: test_vrsubhn_s16
+// CHECK: vrsubhn.i16 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x8_t test_vrsubhn_s16(int16x8_t a, int16x8_t b) {
+ return vrsubhn_s16(a, b);
+}
+
+// CHECK: test_vrsubhn_s32
+// CHECK: vrsubhn.i32 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x4_t test_vrsubhn_s32(int32x4_t a, int32x4_t b) {
+ return vrsubhn_s32(a, b);
+}
+
+// CHECK: test_vrsubhn_s64
+// CHECK: vrsubhn.i64 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x2_t test_vrsubhn_s64(int64x2_t a, int64x2_t b) {
+ return vrsubhn_s64(a, b);
+}
+
+// CHECK: test_vrsubhn_u16
+// CHECK: vrsubhn.i16 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x8_t test_vrsubhn_u16(uint16x8_t a, uint16x8_t b) {
+ return vrsubhn_u16(a, b);
+}
+
+// CHECK: test_vrsubhn_u32
+// CHECK: vrsubhn.i32 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x4_t test_vrsubhn_u32(uint32x4_t a, uint32x4_t b) {
+ return vrsubhn_u32(a, b);
+}
+
+// CHECK: test_vrsubhn_u64
+// CHECK: vrsubhn.i64 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x2_t test_vrsubhn_u64(uint64x2_t a, uint64x2_t b) {
+ return vrsubhn_u64(a, b);
+}
+
+
+// CHECK: test_vset_lane_u8
+// CHECK: vmov
+uint8x8_t test_vset_lane_u8(uint8_t a, uint8x8_t b) {
+ return vset_lane_u8(a, b, 7);
+}
+
+// CHECK: test_vset_lane_u16
+// CHECK: vmov
+uint16x4_t test_vset_lane_u16(uint16_t a, uint16x4_t b) {
+ return vset_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vset_lane_u32
+// CHECK: vmov
+uint32x2_t test_vset_lane_u32(uint32_t a, uint32x2_t b) {
+ return vset_lane_u32(a, b, 1);
+}
+
+// CHECK: test_vset_lane_s8
+// CHECK: vmov
+int8x8_t test_vset_lane_s8(int8_t a, int8x8_t b) {
+ return vset_lane_s8(a, b, 7);
+}
+
+// CHECK: test_vset_lane_s16
+// CHECK: vmov
+int16x4_t test_vset_lane_s16(int16_t a, int16x4_t b) {
+ return vset_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vset_lane_s32
+// CHECK: vmov
+int32x2_t test_vset_lane_s32(int32_t a, int32x2_t b) {
+ return vset_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vset_lane_p8
+// CHECK: vmov
+poly8x8_t test_vset_lane_p8(poly8_t a, poly8x8_t b) {
+ return vset_lane_p8(a, b, 7);
+}
+
+// CHECK: test_vset_lane_p16
+// CHECK: vmov
+poly16x4_t test_vset_lane_p16(poly16_t a, poly16x4_t b) {
+ return vset_lane_p16(a, b, 3);
+}
+
+// CHECK: test_vset_lane_f32
+// CHECK: vmov
+float32x2_t test_vset_lane_f32(float32_t a, float32x2_t b) {
+ return vset_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vsetq_lane_u8
+// CHECK: vmov
+uint8x16_t test_vsetq_lane_u8(uint8_t a, uint8x16_t b) {
+ return vsetq_lane_u8(a, b, 15);
+}
+
+// CHECK: test_vsetq_lane_u16
+// CHECK: vmov
+uint16x8_t test_vsetq_lane_u16(uint16_t a, uint16x8_t b) {
+ return vsetq_lane_u16(a, b, 7);
+}
+
+// CHECK: test_vsetq_lane_u32
+// CHECK: vmov
+uint32x4_t test_vsetq_lane_u32(uint32_t a, uint32x4_t b) {
+ return vsetq_lane_u32(a, b, 3);
+}
+
+// CHECK: test_vsetq_lane_s8
+// CHECK: vmov
+int8x16_t test_vsetq_lane_s8(int8_t a, int8x16_t b) {
+ return vsetq_lane_s8(a, b, 15);
+}
+
+// CHECK: test_vsetq_lane_s16
+// CHECK: vmov
+int16x8_t test_vsetq_lane_s16(int16_t a, int16x8_t b) {
+ return vsetq_lane_s16(a, b, 7);
+}
+
+// CHECK: test_vsetq_lane_s32
+// CHECK: vmov
+int32x4_t test_vsetq_lane_s32(int32_t a, int32x4_t b) {
+ return vsetq_lane_s32(a, b, 3);
+}
+
+// CHECK: test_vsetq_lane_p8
+// CHECK: vmov
+poly8x16_t test_vsetq_lane_p8(poly8_t a, poly8x16_t b) {
+ return vsetq_lane_p8(a, b, 15);
+}
+
+// CHECK: test_vsetq_lane_p16
+// CHECK: vmov
+poly16x8_t test_vsetq_lane_p16(poly16_t a, poly16x8_t b) {
+ return vsetq_lane_p16(a, b, 7);
+}
+
+// CHECK: test_vsetq_lane_f32
+// CHECK: vmov
+float32x4_t test_vsetq_lane_f32(float32_t a, float32x4_t b) {
+ return vsetq_lane_f32(a, b, 3);
+}
+
+// CHECK: test_vset_lane_s64
+// CHECK: vmov
+int64x1_t test_vset_lane_s64(int64_t a, int64x1_t b) {
+ return vset_lane_s64(a, b, 0);
+}
+
+// CHECK: test_vset_lane_u64
+// CHECK: vmov
+uint64x1_t test_vset_lane_u64(uint64_t a, uint64x1_t b) {
+ return vset_lane_u64(a, b, 0);
+}
+
+// CHECK: test_vsetq_lane_s64
+// CHECK: vmov
+int64x2_t test_vsetq_lane_s64(int64_t a, int64x2_t b) {
+ return vsetq_lane_s64(a, b, 1);
+}
+
+// CHECK: test_vsetq_lane_u64
+// CHECK: vmov
+uint64x2_t test_vsetq_lane_u64(uint64_t a, uint64x2_t b) {
+ return vsetq_lane_u64(a, b, 1);
+}
+
+
+// CHECK: test_vshl_s8
+// CHECK: vshl.s8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vshl_s8(int8x8_t a, int8x8_t b) {
+ return vshl_s8(a, b);
+}
+
+// CHECK: test_vshl_s16
+// CHECK: vshl.s16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vshl_s16(int16x4_t a, int16x4_t b) {
+ return vshl_s16(a, b);
+}
+
+// CHECK: test_vshl_s32
+// CHECK: vshl.s32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vshl_s32(int32x2_t a, int32x2_t b) {
+ return vshl_s32(a, b);
+}
+
+// CHECK: test_vshl_s64
+// CHECK: vshl.s64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vshl_s64(int64x1_t a, int64x1_t b) {
+ return vshl_s64(a, b);
+}
+
+// CHECK: test_vshl_u8
+// CHECK: vshl.u8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vshl_u8(uint8x8_t a, int8x8_t b) {
+ return vshl_u8(a, b);
+}
+
+// CHECK: test_vshl_u16
+// CHECK: vshl.u16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vshl_u16(uint16x4_t a, int16x4_t b) {
+ return vshl_u16(a, b);
+}
+
+// CHECK: test_vshl_u32
+// CHECK: vshl.u32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vshl_u32(uint32x2_t a, int32x2_t b) {
+ return vshl_u32(a, b);
+}
+
+// CHECK: test_vshl_u64
+// CHECK: vshl.u64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vshl_u64(uint64x1_t a, int64x1_t b) {
+ return vshl_u64(a, b);
+}
+
+// CHECK: test_vshlq_s8
+// CHECK: vshl.s8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vshlq_s8(int8x16_t a, int8x16_t b) {
+ return vshlq_s8(a, b);
+}
+
+// CHECK: test_vshlq_s16
+// CHECK: vshl.s16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vshlq_s16(int16x8_t a, int16x8_t b) {
+ return vshlq_s16(a, b);
+}
+
+// CHECK: test_vshlq_s32
+// CHECK: vshl.s32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vshlq_s32(int32x4_t a, int32x4_t b) {
+ return vshlq_s32(a, b);
+}
+
+// CHECK: test_vshlq_s64
+// CHECK: vshl.s64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vshlq_s64(int64x2_t a, int64x2_t b) {
+ return vshlq_s64(a, b);
+}
+
+// CHECK: test_vshlq_u8
+// CHECK: vshl.u8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vshlq_u8(uint8x16_t a, int8x16_t b) {
+ return vshlq_u8(a, b);
+}
+
+// CHECK: test_vshlq_u16
+// CHECK: vshl.u16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vshlq_u16(uint16x8_t a, int16x8_t b) {
+ return vshlq_u16(a, b);
+}
+
+// CHECK: test_vshlq_u32
+// CHECK: vshl.u32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vshlq_u32(uint32x4_t a, int32x4_t b) {
+ return vshlq_u32(a, b);
+}
+
+// CHECK: test_vshlq_u64
+// CHECK: vshl.u64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vshlq_u64(uint64x2_t a, int64x2_t b) {
+ return vshlq_u64(a, b);
+}
+
+
+// CHECK: test_vshll_n_s8
+// CHECK: vshll.s8 q{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int16x8_t test_vshll_n_s8(int8x8_t a) {
+ return vshll_n_s8(a, 1);
+}
+
+// CHECK: test_vshll_n_s16
+// CHECK: vshll.s16 q{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vshll_n_s16(int16x4_t a) {
+ return vshll_n_s16(a, 1);
+}
+
+// CHECK: test_vshll_n_s32
+// CHECK: vshll.s32 q{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int64x2_t test_vshll_n_s32(int32x2_t a) {
+ return vshll_n_s32(a, 1);
+}
+
+// CHECK: test_vshll_n_u8
+// CHECK: vshll.u8 q{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vshll_n_u8(uint8x8_t a) {
+ return vshll_n_u8(a, 1);
+}
+
+// CHECK: test_vshll_n_u16
+// CHECK: vshll.u16 q{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vshll_n_u16(uint16x4_t a) {
+ return vshll_n_u16(a, 1);
+}
+
+// CHECK: test_vshll_n_u32
+// CHECK: vshll.u32 q{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint64x2_t test_vshll_n_u32(uint32x2_t a) {
+ return vshll_n_u32(a, 1);
+}
+
+
+// CHECK: test_vshl_n_s8
+// CHECK: vshl.i8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vshl_n_s8(int8x8_t a) {
+ return vshl_n_s8(a, 1);
+}
+
+// CHECK: test_vshl_n_s16
+// CHECK: vshl.i16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vshl_n_s16(int16x4_t a) {
+ return vshl_n_s16(a, 1);
+}
+
+// CHECK: test_vshl_n_s32
+// CHECK: vshl.i32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vshl_n_s32(int32x2_t a) {
+ return vshl_n_s32(a, 1);
+}
+
+// CHECK: test_vshl_n_s64
+// CHECK: vshl.i64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int64x1_t test_vshl_n_s64(int64x1_t a) {
+ return vshl_n_s64(a, 1);
+}
+
+// CHECK: test_vshl_n_u8
+// CHECK: vshl.i8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vshl_n_u8(uint8x8_t a) {
+ return vshl_n_u8(a, 1);
+}
+
+// CHECK: test_vshl_n_u16
+// CHECK: vshl.i16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vshl_n_u16(uint16x4_t a) {
+ return vshl_n_u16(a, 1);
+}
+
+// CHECK: test_vshl_n_u32
+// CHECK: vshl.i32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vshl_n_u32(uint32x2_t a) {
+ return vshl_n_u32(a, 1);
+}
+
+// CHECK: test_vshl_n_u64
+// CHECK: vshl.i64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint64x1_t test_vshl_n_u64(uint64x1_t a) {
+ return vshl_n_u64(a, 1);
+}
+
+// CHECK: test_vshlq_n_s8
+// CHECK: vshl.i8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x16_t test_vshlq_n_s8(int8x16_t a) {
+ return vshlq_n_s8(a, 1);
+}
+
+// CHECK: test_vshlq_n_s16
+// CHECK: vshl.i16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x8_t test_vshlq_n_s16(int16x8_t a) {
+ return vshlq_n_s16(a, 1);
+}
+
+// CHECK: test_vshlq_n_s32
+// CHECK: vshl.i32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vshlq_n_s32(int32x4_t a) {
+ return vshlq_n_s32(a, 1);
+}
+
+// CHECK: test_vshlq_n_s64
+// CHECK: vshl.i64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int64x2_t test_vshlq_n_s64(int64x2_t a) {
+ return vshlq_n_s64(a, 1);
+}
+
+// CHECK: test_vshlq_n_u8
+// CHECK: vshl.i8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x16_t test_vshlq_n_u8(uint8x16_t a) {
+ return vshlq_n_u8(a, 1);
+}
+
+// CHECK: test_vshlq_n_u16
+// CHECK: vshl.i16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vshlq_n_u16(uint16x8_t a) {
+ return vshlq_n_u16(a, 1);
+}
+
+// CHECK: test_vshlq_n_u32
+// CHECK: vshl.i32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vshlq_n_u32(uint32x4_t a) {
+ return vshlq_n_u32(a, 1);
+}
+
+// CHECK: test_vshlq_n_u64
+// CHECK: vshl.i64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint64x2_t test_vshlq_n_u64(uint64x2_t a) {
+ return vshlq_n_u64(a, 1);
+}
+
+
+// CHECK: test_vshrn_n_s16
+// CHECK: vshrn.i16 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vshrn_n_s16(int16x8_t a) {
+ return vshrn_n_s16(a, 1);
+}
+
+// CHECK: test_vshrn_n_s32
+// CHECK: vshrn.i32 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vshrn_n_s32(int32x4_t a) {
+ return vshrn_n_s32(a, 1);
+}
+
+// CHECK: test_vshrn_n_s64
+// CHECK: vshrn.i64 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vshrn_n_s64(int64x2_t a) {
+ return vshrn_n_s64(a, 1);
+}
+
+// CHECK: test_vshrn_n_u16
+// CHECK: vshrn.i16 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vshrn_n_u16(uint16x8_t a) {
+ return vshrn_n_u16(a, 1);
+}
+
+// CHECK: test_vshrn_n_u32
+// CHECK: vshrn.i32 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vshrn_n_u32(uint32x4_t a) {
+ return vshrn_n_u32(a, 1);
+}
+
+// CHECK: test_vshrn_n_u64
+// CHECK: vshrn.i64 d{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vshrn_n_u64(uint64x2_t a) {
+ return vshrn_n_u64(a, 1);
+}
+
+
+// CHECK: test_vshr_n_s8
+// CHECK: vshr.s8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vshr_n_s8(int8x8_t a) {
+ return vshr_n_s8(a, 1);
+}
+
+// CHECK: test_vshr_n_s16
+// CHECK: vshr.s16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vshr_n_s16(int16x4_t a) {
+ return vshr_n_s16(a, 1);
+}
+
+// CHECK: test_vshr_n_s32
+// CHECK: vshr.s32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vshr_n_s32(int32x2_t a) {
+ return vshr_n_s32(a, 1);
+}
+
+// CHECK: test_vshr_n_s64
+// CHECK: vshr.s64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int64x1_t test_vshr_n_s64(int64x1_t a) {
+ return vshr_n_s64(a, 1);
+}
+
+// CHECK: test_vshr_n_u8
+// CHECK: vshr.u8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vshr_n_u8(uint8x8_t a) {
+ return vshr_n_u8(a, 1);
+}
+
+// CHECK: test_vshr_n_u16
+// CHECK: vshr.u16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vshr_n_u16(uint16x4_t a) {
+ return vshr_n_u16(a, 1);
+}
+
+// CHECK: test_vshr_n_u32
+// CHECK: vshr.u32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vshr_n_u32(uint32x2_t a) {
+ return vshr_n_u32(a, 1);
+}
+
+// CHECK: test_vshr_n_u64
+// CHECK: vshr.u64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint64x1_t test_vshr_n_u64(uint64x1_t a) {
+ return vshr_n_u64(a, 1);
+}
+
+// CHECK: test_vshrq_n_s8
+// CHECK: vshr.s8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x16_t test_vshrq_n_s8(int8x16_t a) {
+ return vshrq_n_s8(a, 1);
+}
+
+// CHECK: test_vshrq_n_s16
+// CHECK: vshr.s16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x8_t test_vshrq_n_s16(int16x8_t a) {
+ return vshrq_n_s16(a, 1);
+}
+
+// CHECK: test_vshrq_n_s32
+// CHECK: vshr.s32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vshrq_n_s32(int32x4_t a) {
+ return vshrq_n_s32(a, 1);
+}
+
+// CHECK: test_vshrq_n_s64
+// CHECK: vshr.s64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int64x2_t test_vshrq_n_s64(int64x2_t a) {
+ return vshrq_n_s64(a, 1);
+}
+
+// CHECK: test_vshrq_n_u8
+// CHECK: vshr.u8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x16_t test_vshrq_n_u8(uint8x16_t a) {
+ return vshrq_n_u8(a, 1);
+}
+
+// CHECK: test_vshrq_n_u16
+// CHECK: vshr.u16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vshrq_n_u16(uint16x8_t a) {
+ return vshrq_n_u16(a, 1);
+}
+
+// CHECK: test_vshrq_n_u32
+// CHECK: vshr.u32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vshrq_n_u32(uint32x4_t a) {
+ return vshrq_n_u32(a, 1);
+}
+
+// CHECK: test_vshrq_n_u64
+// CHECK: vshr.u64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint64x2_t test_vshrq_n_u64(uint64x2_t a) {
+ return vshrq_n_u64(a, 1);
+}
+
+
+// CHECK: test_vsli_n_s8
+// CHECK: vsli.8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vsli_n_s8(int8x8_t a, int8x8_t b) {
+ return vsli_n_s8(a, b, 1);
+}
+
+// CHECK: test_vsli_n_s16
+// CHECK: vsli.16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vsli_n_s16(int16x4_t a, int16x4_t b) {
+ return vsli_n_s16(a, b, 1);
+}
+
+// CHECK: test_vsli_n_s32
+// CHECK: vsli.32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vsli_n_s32(int32x2_t a, int32x2_t b) {
+ return vsli_n_s32(a, b, 1);
+}
+
+// CHECK: test_vsli_n_s64
+// CHECK: vsli.64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int64x1_t test_vsli_n_s64(int64x1_t a, int64x1_t b) {
+ return vsli_n_s64(a, b, 1);
+}
+
+// CHECK: test_vsli_n_u8
+// CHECK: vsli.8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vsli_n_u8(uint8x8_t a, uint8x8_t b) {
+ return vsli_n_u8(a, b, 1);
+}
+
+// CHECK: test_vsli_n_u16
+// CHECK: vsli.16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vsli_n_u16(uint16x4_t a, uint16x4_t b) {
+ return vsli_n_u16(a, b, 1);
+}
+
+// CHECK: test_vsli_n_u32
+// CHECK: vsli.32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vsli_n_u32(uint32x2_t a, uint32x2_t b) {
+ return vsli_n_u32(a, b, 1);
+}
+
+// CHECK: test_vsli_n_u64
+// CHECK: vsli.64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint64x1_t test_vsli_n_u64(uint64x1_t a, uint64x1_t b) {
+ return vsli_n_u64(a, b, 1);
+}
+
+// CHECK: test_vsli_n_p8
+// CHECK: vsli.8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+poly8x8_t test_vsli_n_p8(poly8x8_t a, poly8x8_t b) {
+ return vsli_n_p8(a, b, 1);
+}
+
+// CHECK: test_vsli_n_p16
+// CHECK: vsli.16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+poly16x4_t test_vsli_n_p16(poly16x4_t a, poly16x4_t b) {
+ return vsli_n_p16(a, b, 1);
+}
+
+// CHECK: test_vsliq_n_s8
+// CHECK: vsli.8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x16_t test_vsliq_n_s8(int8x16_t a, int8x16_t b) {
+ return vsliq_n_s8(a, b, 1);
+}
+
+// CHECK: test_vsliq_n_s16
+// CHECK: vsli.16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x8_t test_vsliq_n_s16(int16x8_t a, int16x8_t b) {
+ return vsliq_n_s16(a, b, 1);
+}
+
+// CHECK: test_vsliq_n_s32
+// CHECK: vsli.32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vsliq_n_s32(int32x4_t a, int32x4_t b) {
+ return vsliq_n_s32(a, b, 1);
+}
+
+// CHECK: test_vsliq_n_s64
+// CHECK: vsli.64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int64x2_t test_vsliq_n_s64(int64x2_t a, int64x2_t b) {
+ return vsliq_n_s64(a, b, 1);
+}
+
+// CHECK: test_vsliq_n_u8
+// CHECK: vsli.8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x16_t test_vsliq_n_u8(uint8x16_t a, uint8x16_t b) {
+ return vsliq_n_u8(a, b, 1);
+}
+
+// CHECK: test_vsliq_n_u16
+// CHECK: vsli.16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vsliq_n_u16(uint16x8_t a, uint16x8_t b) {
+ return vsliq_n_u16(a, b, 1);
+}
+
+// CHECK: test_vsliq_n_u32
+// CHECK: vsli.32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vsliq_n_u32(uint32x4_t a, uint32x4_t b) {
+ return vsliq_n_u32(a, b, 1);
+}
+
+// CHECK: test_vsliq_n_u64
+// CHECK: vsli.64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint64x2_t test_vsliq_n_u64(uint64x2_t a, uint64x2_t b) {
+ return vsliq_n_u64(a, b, 1);
+}
+
+// CHECK: test_vsliq_n_p8
+// CHECK: vsli.8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+poly8x16_t test_vsliq_n_p8(poly8x16_t a, poly8x16_t b) {
+ return vsliq_n_p8(a, b, 1);
+}
+
+// CHECK: test_vsliq_n_p16
+// CHECK: vsli.16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+poly16x8_t test_vsliq_n_p16(poly16x8_t a, poly16x8_t b) {
+ return vsliq_n_p16(a, b, 1);
+}
+
+
+// CHECK: test_vsra_n_s8
+// CHECK: vsra.s8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vsra_n_s8(int8x8_t a, int8x8_t b) {
+ return vsra_n_s8(a, b, 1);
+}
+
+// CHECK: test_vsra_n_s16
+// CHECK: vsra.s16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vsra_n_s16(int16x4_t a, int16x4_t b) {
+ return vsra_n_s16(a, b, 1);
+}
+
+// CHECK: test_vsra_n_s32
+// CHECK: vsra.s32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vsra_n_s32(int32x2_t a, int32x2_t b) {
+ return vsra_n_s32(a, b, 1);
+}
+
+// CHECK: test_vsra_n_s64
+// CHECK: vsra.s64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int64x1_t test_vsra_n_s64(int64x1_t a, int64x1_t b) {
+ return vsra_n_s64(a, b, 1);
+}
+
+// CHECK: test_vsra_n_u8
+// CHECK: vsra.u8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vsra_n_u8(uint8x8_t a, uint8x8_t b) {
+ return vsra_n_u8(a, b, 1);
+}
+
+// CHECK: test_vsra_n_u16
+// CHECK: vsra.u16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vsra_n_u16(uint16x4_t a, uint16x4_t b) {
+ return vsra_n_u16(a, b, 1);
+}
+
+// CHECK: test_vsra_n_u32
+// CHECK: vsra.u32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vsra_n_u32(uint32x2_t a, uint32x2_t b) {
+ return vsra_n_u32(a, b, 1);
+}
+
+// CHECK: test_vsra_n_u64
+// CHECK: vsra.u64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint64x1_t test_vsra_n_u64(uint64x1_t a, uint64x1_t b) {
+ return vsra_n_u64(a, b, 1);
+}
+
+// CHECK: test_vsraq_n_s8
+// CHECK: vsra.s8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x16_t test_vsraq_n_s8(int8x16_t a, int8x16_t b) {
+ return vsraq_n_s8(a, b, 1);
+}
+
+// CHECK: test_vsraq_n_s16
+// CHECK: vsra.s16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x8_t test_vsraq_n_s16(int16x8_t a, int16x8_t b) {
+ return vsraq_n_s16(a, b, 1);
+}
+
+// CHECK: test_vsraq_n_s32
+// CHECK: vsra.s32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vsraq_n_s32(int32x4_t a, int32x4_t b) {
+ return vsraq_n_s32(a, b, 1);
+}
+
+// CHECK: test_vsraq_n_s64
+// CHECK: vsra.s64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int64x2_t test_vsraq_n_s64(int64x2_t a, int64x2_t b) {
+ return vsraq_n_s64(a, b, 1);
+}
+
+// CHECK: test_vsraq_n_u8
+// CHECK: vsra.u8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x16_t test_vsraq_n_u8(uint8x16_t a, uint8x16_t b) {
+ return vsraq_n_u8(a, b, 1);
+}
+
+// CHECK: test_vsraq_n_u16
+// CHECK: vsra.u16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vsraq_n_u16(uint16x8_t a, uint16x8_t b) {
+ return vsraq_n_u16(a, b, 1);
+}
+
+// CHECK: test_vsraq_n_u32
+// CHECK: vsra.u32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vsraq_n_u32(uint32x4_t a, uint32x4_t b) {
+ return vsraq_n_u32(a, b, 1);
+}
+
+// CHECK: test_vsraq_n_u64
+// CHECK: vsra.u64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint64x2_t test_vsraq_n_u64(uint64x2_t a, uint64x2_t b) {
+ return vsraq_n_u64(a, b, 1);
+}
+
+
+// CHECK: test_vsri_n_s8
+// CHECK: vsri.8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int8x8_t test_vsri_n_s8(int8x8_t a, int8x8_t b) {
+ return vsri_n_s8(a, b, 1);
+}
+
+// CHECK: test_vsri_n_s16
+// CHECK: vsri.16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int16x4_t test_vsri_n_s16(int16x4_t a, int16x4_t b) {
+ return vsri_n_s16(a, b, 1);
+}
+
+// CHECK: test_vsri_n_s32
+// CHECK: vsri.32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int32x2_t test_vsri_n_s32(int32x2_t a, int32x2_t b) {
+ return vsri_n_s32(a, b, 1);
+}
+
+// CHECK: test_vsri_n_s64
+// CHECK: vsri.64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+int64x1_t test_vsri_n_s64(int64x1_t a, int64x1_t b) {
+ return vsri_n_s64(a, b, 1);
+}
+
+// CHECK: test_vsri_n_u8
+// CHECK: vsri.8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint8x8_t test_vsri_n_u8(uint8x8_t a, uint8x8_t b) {
+ return vsri_n_u8(a, b, 1);
+}
+
+// CHECK: test_vsri_n_u16
+// CHECK: vsri.16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint16x4_t test_vsri_n_u16(uint16x4_t a, uint16x4_t b) {
+ return vsri_n_u16(a, b, 1);
+}
+
+// CHECK: test_vsri_n_u32
+// CHECK: vsri.32 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint32x2_t test_vsri_n_u32(uint32x2_t a, uint32x2_t b) {
+ return vsri_n_u32(a, b, 1);
+}
+
+// CHECK: test_vsri_n_u64
+// CHECK: vsri.64 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+uint64x1_t test_vsri_n_u64(uint64x1_t a, uint64x1_t b) {
+ return vsri_n_u64(a, b, 1);
+}
+
+// CHECK: test_vsri_n_p8
+// CHECK: vsri.8 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+poly8x8_t test_vsri_n_p8(poly8x8_t a, poly8x8_t b) {
+ return vsri_n_p8(a, b, 1);
+}
+
+// CHECK: test_vsri_n_p16
+// CHECK: vsri.16 d{{[0-9]+}}, d{{[0-9]+}}, #{{[0-9]+}}
+poly16x4_t test_vsri_n_p16(poly16x4_t a, poly16x4_t b) {
+ return vsri_n_p16(a, b, 1);
+}
+
+// CHECK: test_vsriq_n_s8
+// CHECK: vsri.8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int8x16_t test_vsriq_n_s8(int8x16_t a, int8x16_t b) {
+ return vsriq_n_s8(a, b, 1);
+}
+
+// CHECK: test_vsriq_n_s16
+// CHECK: vsri.16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int16x8_t test_vsriq_n_s16(int16x8_t a, int16x8_t b) {
+ return vsriq_n_s16(a, b, 1);
+}
+
+// CHECK: test_vsriq_n_s32
+// CHECK: vsri.32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int32x4_t test_vsriq_n_s32(int32x4_t a, int32x4_t b) {
+ return vsriq_n_s32(a, b, 1);
+}
+
+// CHECK: test_vsriq_n_s64
+// CHECK: vsri.64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+int64x2_t test_vsriq_n_s64(int64x2_t a, int64x2_t b) {
+ return vsriq_n_s64(a, b, 1);
+}
+
+// CHECK: test_vsriq_n_u8
+// CHECK: vsri.8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint8x16_t test_vsriq_n_u8(uint8x16_t a, uint8x16_t b) {
+ return vsriq_n_u8(a, b, 1);
+}
+
+// CHECK: test_vsriq_n_u16
+// CHECK: vsri.16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint16x8_t test_vsriq_n_u16(uint16x8_t a, uint16x8_t b) {
+ return vsriq_n_u16(a, b, 1);
+}
+
+// CHECK: test_vsriq_n_u32
+// CHECK: vsri.32 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint32x4_t test_vsriq_n_u32(uint32x4_t a, uint32x4_t b) {
+ return vsriq_n_u32(a, b, 1);
+}
+
+// CHECK: test_vsriq_n_u64
+// CHECK: vsri.64 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+uint64x2_t test_vsriq_n_u64(uint64x2_t a, uint64x2_t b) {
+ return vsriq_n_u64(a, b, 1);
+}
+
+// CHECK: test_vsriq_n_p8
+// CHECK: vsri.8 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+poly8x16_t test_vsriq_n_p8(poly8x16_t a, poly8x16_t b) {
+ return vsriq_n_p8(a, b, 1);
+}
+
+// CHECK: test_vsriq_n_p16
+// CHECK: vsri.16 q{{[0-9]+}}, q{{[0-9]+}}, #{{[0-9]+}}
+poly16x8_t test_vsriq_n_p16(poly16x8_t a, poly16x8_t b) {
+ return vsriq_n_p16(a, b, 1);
+}
+
+
+// CHECK: test_vst1q_u8
+// CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_u8(uint8_t * a, uint8x16_t b) {
+ vst1q_u8(a, b);
+}
+
+// CHECK: test_vst1q_u16
+// CHECK: vst1.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_u16(uint16_t * a, uint16x8_t b) {
+ vst1q_u16(a, b);
+}
+
+// CHECK: test_vst1q_u32
+// CHECK: vst1.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_u32(uint32_t * a, uint32x4_t b) {
+ vst1q_u32(a, b);
+}
+
+// CHECK: test_vst1q_u64
+// CHECK: vst1.64 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_u64(uint64_t * a, uint64x2_t b) {
+ vst1q_u64(a, b);
+}
+
+// CHECK: test_vst1q_s8
+// CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_s8(int8_t * a, int8x16_t b) {
+ vst1q_s8(a, b);
+}
+
+// CHECK: test_vst1q_s16
+// CHECK: vst1.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_s16(int16_t * a, int16x8_t b) {
+ vst1q_s16(a, b);
+}
+
+// CHECK: test_vst1q_s32
+// CHECK: vst1.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_s32(int32_t * a, int32x4_t b) {
+ vst1q_s32(a, b);
+}
+
+// CHECK: test_vst1q_s64
+// CHECK: vst1.64 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_s64(int64_t * a, int64x2_t b) {
+ vst1q_s64(a, b);
+}
+
+// CHECK: test_vst1q_f16
+// CHECK: vst1.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_f16(float16_t * a, float16x8_t b) {
+ vst1q_f16(a, b);
+}
+
+// CHECK: test_vst1q_f32
+// CHECK: vst1.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_f32(float32_t * a, float32x4_t b) {
+ vst1q_f32(a, b);
+}
+
+// CHECK: test_vst1q_p8
+// CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_p8(poly8_t * a, poly8x16_t b) {
+ vst1q_p8(a, b);
+}
+
+// CHECK: test_vst1q_p16
+// CHECK: vst1.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1q_p16(poly16_t * a, poly16x8_t b) {
+ vst1q_p16(a, b);
+}
+
+// CHECK: test_vst1_u8
+// CHECK: vst1.8 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_u8(uint8_t * a, uint8x8_t b) {
+ vst1_u8(a, b);
+}
+
+// CHECK: test_vst1_u16
+// CHECK: vst1.16 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_u16(uint16_t * a, uint16x4_t b) {
+ vst1_u16(a, b);
+}
+
+// CHECK: test_vst1_u32
+// CHECK: vst1.32 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_u32(uint32_t * a, uint32x2_t b) {
+ vst1_u32(a, b);
+}
+
+// CHECK: test_vst1_u64
+// CHECK: vst1.64 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_u64(uint64_t * a, uint64x1_t b) {
+ vst1_u64(a, b);
+}
+
+// CHECK: test_vst1_s8
+// CHECK: vst1.8 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_s8(int8_t * a, int8x8_t b) {
+ vst1_s8(a, b);
+}
+
+// CHECK: test_vst1_s16
+// CHECK: vst1.16 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_s16(int16_t * a, int16x4_t b) {
+ vst1_s16(a, b);
+}
+
+// CHECK: test_vst1_s32
+// CHECK: vst1.32 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_s32(int32_t * a, int32x2_t b) {
+ vst1_s32(a, b);
+}
+
+// CHECK: test_vst1_s64
+// CHECK: vst1.64 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_s64(int64_t * a, int64x1_t b) {
+ vst1_s64(a, b);
+}
+
+// CHECK: test_vst1_f16
+// CHECK: vst1.16 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_f16(float16_t * a, float16x4_t b) {
+ vst1_f16(a, b);
+}
+
+// CHECK: test_vst1_f32
+// CHECK: vst1.32 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_f32(float32_t * a, float32x2_t b) {
+ vst1_f32(a, b);
+}
+
+// CHECK: test_vst1_p8
+// CHECK: vst1.8 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_p8(poly8_t * a, poly8x8_t b) {
+ vst1_p8(a, b);
+}
+
+// CHECK: test_vst1_p16
+// CHECK: vst1.16 {d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst1_p16(poly16_t * a, poly16x4_t b) {
+ vst1_p16(a, b);
+}
+
+
+// CHECK: test_vst1q_lane_u8
+// CHECK: vst1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst1q_lane_u8(uint8_t * a, uint8x16_t b) {
+ vst1q_lane_u8(a, b, 15);
+}
+
+// CHECK: test_vst1q_lane_u16
+// CHECK: vst1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+void test_vst1q_lane_u16(uint16_t * a, uint16x8_t b) {
+ vst1q_lane_u16(a, b, 7);
+}
+
+// CHECK: test_vst1q_lane_u32
+// CHECK: vst1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+void test_vst1q_lane_u32(uint32_t * a, uint32x4_t b) {
+ vst1q_lane_u32(a, b, 3);
+}
+
+// CHECK: test_vst1q_lane_u64
+// CHECK: {{str|vstr|vmov}}
+void test_vst1q_lane_u64(uint64_t * a, uint64x2_t b) {
+ vst1q_lane_u64(a, b, 1);
+}
+
+// CHECK: test_vst1q_lane_s8
+// CHECK: vst1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst1q_lane_s8(int8_t * a, int8x16_t b) {
+ vst1q_lane_s8(a, b, 15);
+}
+
+// CHECK: test_vst1q_lane_s16
+// CHECK: vst1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+void test_vst1q_lane_s16(int16_t * a, int16x8_t b) {
+ vst1q_lane_s16(a, b, 7);
+}
+
+// CHECK: test_vst1q_lane_s32
+// CHECK: vst1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+void test_vst1q_lane_s32(int32_t * a, int32x4_t b) {
+ vst1q_lane_s32(a, b, 3);
+}
+
+// CHECK: test_vst1q_lane_s64
+// CHECK: {{str|vstr|vmov}}
+void test_vst1q_lane_s64(int64_t * a, int64x2_t b) {
+ vst1q_lane_s64(a, b, 1);
+}
+
+// CHECK: test_vst1q_lane_f16
+// CHECK: vst1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+void test_vst1q_lane_f16(float16_t * a, float16x8_t b) {
+ vst1q_lane_f16(a, b, 7);
+}
+
+// CHECK: test_vst1q_lane_f32
+// CHECK: vst1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+void test_vst1q_lane_f32(float32_t * a, float32x4_t b) {
+ vst1q_lane_f32(a, b, 3);
+}
+
+// CHECK: test_vst1q_lane_p8
+// CHECK: vst1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst1q_lane_p8(poly8_t * a, poly8x16_t b) {
+ vst1q_lane_p8(a, b, 15);
+}
+
+// CHECK: test_vst1q_lane_p16
+// CHECK: vst1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+void test_vst1q_lane_p16(poly16_t * a, poly16x8_t b) {
+ vst1q_lane_p16(a, b, 7);
+}
+
+// CHECK: test_vst1_lane_u8
+// CHECK: vst1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst1_lane_u8(uint8_t * a, uint8x8_t b) {
+ vst1_lane_u8(a, b, 7);
+}
+
+// CHECK: test_vst1_lane_u16
+// CHECK: vst1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+void test_vst1_lane_u16(uint16_t * a, uint16x4_t b) {
+ vst1_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vst1_lane_u32
+// CHECK: vst1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+void test_vst1_lane_u32(uint32_t * a, uint32x2_t b) {
+ vst1_lane_u32(a, b, 1);
+}
+
+// CHECK: test_vst1_lane_u64
+// CHECK: {{str|vstr|vmov}}
+void test_vst1_lane_u64(uint64_t * a, uint64x1_t b) {
+ vst1_lane_u64(a, b, 0);
+}
+
+// CHECK: test_vst1_lane_s8
+// CHECK: vst1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst1_lane_s8(int8_t * a, int8x8_t b) {
+ vst1_lane_s8(a, b, 7);
+}
+
+// CHECK: test_vst1_lane_s16
+// CHECK: vst1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+void test_vst1_lane_s16(int16_t * a, int16x4_t b) {
+ vst1_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vst1_lane_s32
+// CHECK: vst1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+void test_vst1_lane_s32(int32_t * a, int32x2_t b) {
+ vst1_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vst1_lane_s64
+// CHECK: {{str|vstr|vmov}}
+void test_vst1_lane_s64(int64_t * a, int64x1_t b) {
+ vst1_lane_s64(a, b, 0);
+}
+
+// CHECK: test_vst1_lane_f16
+// CHECK: vst1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+void test_vst1_lane_f16(float16_t * a, float16x4_t b) {
+ vst1_lane_f16(a, b, 3);
+}
+
+// CHECK: test_vst1_lane_f32
+// CHECK: vst1.32 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:32]
+void test_vst1_lane_f32(float32_t * a, float32x2_t b) {
+ vst1_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vst1_lane_p8
+// CHECK: vst1.8 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst1_lane_p8(poly8_t * a, poly8x8_t b) {
+ vst1_lane_p8(a, b, 7);
+}
+
+// CHECK: test_vst1_lane_p16
+// CHECK: vst1.16 {d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}:16]
+void test_vst1_lane_p16(poly16_t * a, poly16x4_t b) {
+ vst1_lane_p16(a, b, 3);
+}
+
+
+// CHECK: test_vst2q_u8
+// CHECK: vst2.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2q_u8(uint8_t * a, uint8x16x2_t b) {
+ vst2q_u8(a, b);
+}
+
+// CHECK: test_vst2q_u16
+// CHECK: vst2.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2q_u16(uint16_t * a, uint16x8x2_t b) {
+ vst2q_u16(a, b);
+}
+
+// CHECK: test_vst2q_u32
+// CHECK: vst2.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2q_u32(uint32_t * a, uint32x4x2_t b) {
+ vst2q_u32(a, b);
+}
+
+// CHECK: test_vst2q_s8
+// CHECK: vst2.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2q_s8(int8_t * a, int8x16x2_t b) {
+ vst2q_s8(a, b);
+}
+
+// CHECK: test_vst2q_s16
+// CHECK: vst2.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2q_s16(int16_t * a, int16x8x2_t b) {
+ vst2q_s16(a, b);
+}
+
+// CHECK: test_vst2q_s32
+// CHECK: vst2.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2q_s32(int32_t * a, int32x4x2_t b) {
+ vst2q_s32(a, b);
+}
+
+// CHECK: test_vst2q_f16
+// CHECK: vst2.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2q_f16(float16_t * a, float16x8x2_t b) {
+ vst2q_f16(a, b);
+}
+
+// CHECK: test_vst2q_f32
+// CHECK: vst2.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2q_f32(float32_t * a, float32x4x2_t b) {
+ vst2q_f32(a, b);
+}
+
+// CHECK: test_vst2q_p8
+// CHECK: vst2.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2q_p8(poly8_t * a, poly8x16x2_t b) {
+ vst2q_p8(a, b);
+}
+
+// CHECK: test_vst2q_p16
+// CHECK: vst2.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2q_p16(poly16_t * a, poly16x8x2_t b) {
+ vst2q_p16(a, b);
+}
+
+// CHECK: test_vst2_u8
+// CHECK: vst2.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2_u8(uint8_t * a, uint8x8x2_t b) {
+ vst2_u8(a, b);
+}
+
+// CHECK: test_vst2_u16
+// CHECK: vst2.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2_u16(uint16_t * a, uint16x4x2_t b) {
+ vst2_u16(a, b);
+}
+
+// CHECK: test_vst2_u32
+// CHECK: vst2.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2_u32(uint32_t * a, uint32x2x2_t b) {
+ vst2_u32(a, b);
+}
+
+// CHECK: test_vst2_u64
+// CHECK: vst1.64
+void test_vst2_u64(uint64_t * a, uint64x1x2_t b) {
+ vst2_u64(a, b);
+}
+
+// CHECK: test_vst2_s8
+// CHECK: vst2.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2_s8(int8_t * a, int8x8x2_t b) {
+ vst2_s8(a, b);
+}
+
+// CHECK: test_vst2_s16
+// CHECK: vst2.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2_s16(int16_t * a, int16x4x2_t b) {
+ vst2_s16(a, b);
+}
+
+// CHECK: test_vst2_s32
+// CHECK: vst2.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2_s32(int32_t * a, int32x2x2_t b) {
+ vst2_s32(a, b);
+}
+
+// CHECK: test_vst2_s64
+// CHECK: vst1.64
+void test_vst2_s64(int64_t * a, int64x1x2_t b) {
+ vst2_s64(a, b);
+}
+
+// CHECK: test_vst2_f16
+// CHECK: vst2.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2_f16(float16_t * a, float16x4x2_t b) {
+ vst2_f16(a, b);
+}
+
+// CHECK: test_vst2_f32
+// CHECK: vst2.32 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2_f32(float32_t * a, float32x2x2_t b) {
+ vst2_f32(a, b);
+}
+
+// CHECK: test_vst2_p8
+// CHECK: vst2.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2_p8(poly8_t * a, poly8x8x2_t b) {
+ vst2_p8(a, b);
+}
+
+// CHECK: test_vst2_p16
+// CHECK: vst2.16 {d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst2_p16(poly16_t * a, poly16x4x2_t b) {
+ vst2_p16(a, b);
+}
+
+
+// CHECK: test_vst2q_lane_u16
+// CHECK: vst2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2q_lane_u16(uint16_t * a, uint16x8x2_t b) {
+ vst2q_lane_u16(a, b, 7);
+}
+
+// CHECK: test_vst2q_lane_u32
+// CHECK: vst2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2q_lane_u32(uint32_t * a, uint32x4x2_t b) {
+ vst2q_lane_u32(a, b, 3);
+}
+
+// CHECK: test_vst2q_lane_s16
+// CHECK: vst2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2q_lane_s16(int16_t * a, int16x8x2_t b) {
+ vst2q_lane_s16(a, b, 7);
+}
+
+// CHECK: test_vst2q_lane_s32
+// CHECK: vst2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2q_lane_s32(int32_t * a, int32x4x2_t b) {
+ vst2q_lane_s32(a, b, 3);
+}
+
+// CHECK: test_vst2q_lane_f16
+// CHECK: vst2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2q_lane_f16(float16_t * a, float16x8x2_t b) {
+ vst2q_lane_f16(a, b, 7);
+}
+
+// CHECK: test_vst2q_lane_f32
+// CHECK: vst2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2q_lane_f32(float32_t * a, float32x4x2_t b) {
+ vst2q_lane_f32(a, b, 3);
+}
+
+// CHECK: test_vst2q_lane_p16
+// CHECK: vst2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2q_lane_p16(poly16_t * a, poly16x8x2_t b) {
+ vst2q_lane_p16(a, b, 7);
+}
+
+// CHECK: test_vst2_lane_u8
+// CHECK: vst2.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2_lane_u8(uint8_t * a, uint8x8x2_t b) {
+ vst2_lane_u8(a, b, 7);
+}
+
+// CHECK: test_vst2_lane_u16
+// CHECK: vst2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2_lane_u16(uint16_t * a, uint16x4x2_t b) {
+ vst2_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vst2_lane_u32
+// CHECK: vst2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2_lane_u32(uint32_t * a, uint32x2x2_t b) {
+ vst2_lane_u32(a, b, 1);
+}
+
+// CHECK: test_vst2_lane_s8
+// CHECK: vst2.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2_lane_s8(int8_t * a, int8x8x2_t b) {
+ vst2_lane_s8(a, b, 7);
+}
+
+// CHECK: test_vst2_lane_s16
+// CHECK: vst2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2_lane_s16(int16_t * a, int16x4x2_t b) {
+ vst2_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vst2_lane_s32
+// CHECK: vst2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2_lane_s32(int32_t * a, int32x2x2_t b) {
+ vst2_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vst2_lane_f16
+// CHECK: vst2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2_lane_f16(float16_t * a, float16x4x2_t b) {
+ vst2_lane_f16(a, b, 3);
+}
+
+// CHECK: test_vst2_lane_f32
+// CHECK: vst2.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2_lane_f32(float32_t * a, float32x2x2_t b) {
+ vst2_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vst2_lane_p8
+// CHECK: vst2.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2_lane_p8(poly8_t * a, poly8x8x2_t b) {
+ vst2_lane_p8(a, b, 7);
+}
+
+// CHECK: test_vst2_lane_p16
+// CHECK: vst2.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst2_lane_p16(poly16_t * a, poly16x4x2_t b) {
+ vst2_lane_p16(a, b, 3);
+}
+
+
+// CHECK: test_vst3q_u8
+// CHECK: vst3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst3q_u8(uint8_t * a, uint8x16x3_t b) {
+ vst3q_u8(a, b);
+}
+
+// CHECK: test_vst3q_u16
+// CHECK: vst3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst3q_u16(uint16_t * a, uint16x8x3_t b) {
+ vst3q_u16(a, b);
+}
+
+// CHECK: test_vst3q_u32
+// CHECK: vst3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst3q_u32(uint32_t * a, uint32x4x3_t b) {
+ vst3q_u32(a, b);
+}
+
+// CHECK: test_vst3q_s8
+// CHECK: vst3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst3q_s8(int8_t * a, int8x16x3_t b) {
+ vst3q_s8(a, b);
+}
+
+// CHECK: test_vst3q_s16
+// CHECK: vst3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst3q_s16(int16_t * a, int16x8x3_t b) {
+ vst3q_s16(a, b);
+}
+
+// CHECK: test_vst3q_s32
+// CHECK: vst3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst3q_s32(int32_t * a, int32x4x3_t b) {
+ vst3q_s32(a, b);
+}
+
+// CHECK: test_vst3q_f16
+// CHECK: vst3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst3q_f16(float16_t * a, float16x8x3_t b) {
+ vst3q_f16(a, b);
+}
+
+// CHECK: test_vst3q_f32
+// CHECK: vst3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst3q_f32(float32_t * a, float32x4x3_t b) {
+ vst3q_f32(a, b);
+}
+
+// CHECK: test_vst3q_p8
+// CHECK: vst3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst3q_p8(poly8_t * a, poly8x16x3_t b) {
+ vst3q_p8(a, b);
+}
+
+// CHECK: test_vst3q_p16
+// CHECK: vst3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst3q_p16(poly16_t * a, poly16x8x3_t b) {
+ vst3q_p16(a, b);
+}
+
+// CHECK: test_vst3_u8
+// CHECK: vst3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst3_u8(uint8_t * a, uint8x8x3_t b) {
+ vst3_u8(a, b);
+}
+
+// CHECK: test_vst3_u16
+// CHECK: vst3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst3_u16(uint16_t * a, uint16x4x3_t b) {
+ vst3_u16(a, b);
+}
+
+// CHECK: test_vst3_u32
+// CHECK: vst3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst3_u32(uint32_t * a, uint32x2x3_t b) {
+ vst3_u32(a, b);
+}
+
+// CHECK: test_vst3_u64
+// CHECK: vst1.64
+void test_vst3_u64(uint64_t * a, uint64x1x3_t b) {
+ vst3_u64(a, b);
+}
+
+// CHECK: test_vst3_s8
+// CHECK: vst3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst3_s8(int8_t * a, int8x8x3_t b) {
+ vst3_s8(a, b);
+}
+
+// CHECK: test_vst3_s16
+// CHECK: vst3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst3_s16(int16_t * a, int16x4x3_t b) {
+ vst3_s16(a, b);
+}
+
+// CHECK: test_vst3_s32
+// CHECK: vst3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst3_s32(int32_t * a, int32x2x3_t b) {
+ vst3_s32(a, b);
+}
+
+// CHECK: test_vst3_s64
+// CHECK: vst1.64
+void test_vst3_s64(int64_t * a, int64x1x3_t b) {
+ vst3_s64(a, b);
+}
+
+// CHECK: test_vst3_f16
+// CHECK: vst3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst3_f16(float16_t * a, float16x4x3_t b) {
+ vst3_f16(a, b);
+}
+
+// CHECK: test_vst3_f32
+// CHECK: vst3.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst3_f32(float32_t * a, float32x2x3_t b) {
+ vst3_f32(a, b);
+}
+
+// CHECK: test_vst3_p8
+// CHECK: vst3.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst3_p8(poly8_t * a, poly8x8x3_t b) {
+ vst3_p8(a, b);
+}
+
+// CHECK: test_vst3_p16
+// CHECK: vst3.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst3_p16(poly16_t * a, poly16x4x3_t b) {
+ vst3_p16(a, b);
+}
+
+
+// CHECK: test_vst3q_lane_u16
+// CHECK: vst3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst3q_lane_u16(uint16_t * a, uint16x8x3_t b) {
+ vst3q_lane_u16(a, b, 7);
+}
+
+// CHECK: test_vst3q_lane_u32
+// CHECK: vst3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst3q_lane_u32(uint32_t * a, uint32x4x3_t b) {
+ vst3q_lane_u32(a, b, 3);
+}
+
+// CHECK: test_vst3q_lane_s16
+// CHECK: vst3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst3q_lane_s16(int16_t * a, int16x8x3_t b) {
+ vst3q_lane_s16(a, b, 7);
+}
+
+// CHECK: test_vst3q_lane_s32
+// CHECK: vst3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst3q_lane_s32(int32_t * a, int32x4x3_t b) {
+ vst3q_lane_s32(a, b, 3);
+}
+
+// CHECK: test_vst3q_lane_f16
+// CHECK: vst3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst3q_lane_f16(float16_t * a, float16x8x3_t b) {
+ vst3q_lane_f16(a, b, 7);
+}
+
+// CHECK: test_vst3q_lane_f32
+// CHECK: vst3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst3q_lane_f32(float32_t * a, float32x4x3_t b) {
+ vst3q_lane_f32(a, b, 3);
+}
+
+// CHECK: test_vst3q_lane_p16
+// CHECK: vst3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst3q_lane_p16(poly16_t * a, poly16x8x3_t b) {
+ vst3q_lane_p16(a, b, 7);
+}
+
+// CHECK: test_vst3_lane_u8
+// CHECK: vst3.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst3_lane_u8(uint8_t * a, uint8x8x3_t b) {
+ vst3_lane_u8(a, b, 7);
+}
+
+// CHECK: test_vst3_lane_u16
+// CHECK: vst3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst3_lane_u16(uint16_t * a, uint16x4x3_t b) {
+ vst3_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vst3_lane_u32
+// CHECK: vst3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst3_lane_u32(uint32_t * a, uint32x2x3_t b) {
+ vst3_lane_u32(a, b, 1);
+}
+
+// CHECK: test_vst3_lane_s8
+// CHECK: vst3.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst3_lane_s8(int8_t * a, int8x8x3_t b) {
+ vst3_lane_s8(a, b, 7);
+}
+
+// CHECK: test_vst3_lane_s16
+// CHECK: vst3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst3_lane_s16(int16_t * a, int16x4x3_t b) {
+ vst3_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vst3_lane_s32
+// CHECK: vst3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst3_lane_s32(int32_t * a, int32x2x3_t b) {
+ vst3_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vst3_lane_f16
+// CHECK: vst3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst3_lane_f16(float16_t * a, float16x4x3_t b) {
+ vst3_lane_f16(a, b, 3);
+}
+
+// CHECK: test_vst3_lane_f32
+// CHECK: vst3.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst3_lane_f32(float32_t * a, float32x2x3_t b) {
+ vst3_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vst3_lane_p8
+// CHECK: vst3.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst3_lane_p8(poly8_t * a, poly8x8x3_t b) {
+ vst3_lane_p8(a, b, 7);
+}
+
+// CHECK: test_vst3_lane_p16
+// CHECK: vst3.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst3_lane_p16(poly16_t * a, poly16x4x3_t b) {
+ vst3_lane_p16(a, b, 3);
+}
+
+
+// CHECK: test_vst4q_u8
+// CHECK: vst4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst4q_u8(uint8_t * a, uint8x16x4_t b) {
+ vst4q_u8(a, b);
+}
+
+// CHECK: test_vst4q_u16
+// CHECK: vst4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst4q_u16(uint16_t * a, uint16x8x4_t b) {
+ vst4q_u16(a, b);
+}
+
+// CHECK: test_vst4q_u32
+// CHECK: vst4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst4q_u32(uint32_t * a, uint32x4x4_t b) {
+ vst4q_u32(a, b);
+}
+
+// CHECK: test_vst4q_s8
+// CHECK: vst4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst4q_s8(int8_t * a, int8x16x4_t b) {
+ vst4q_s8(a, b);
+}
+
+// CHECK: test_vst4q_s16
+// CHECK: vst4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst4q_s16(int16_t * a, int16x8x4_t b) {
+ vst4q_s16(a, b);
+}
+
+// CHECK: test_vst4q_s32
+// CHECK: vst4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst4q_s32(int32_t * a, int32x4x4_t b) {
+ vst4q_s32(a, b);
+}
+
+// CHECK: test_vst4q_f16
+// CHECK: vst4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst4q_f16(float16_t * a, float16x8x4_t b) {
+ vst4q_f16(a, b);
+}
+
+// CHECK: test_vst4q_f32
+// CHECK: vst4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst4q_f32(float32_t * a, float32x4x4_t b) {
+ vst4q_f32(a, b);
+}
+
+// CHECK: test_vst4q_p8
+// CHECK: vst4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst4q_p8(poly8_t * a, poly8x16x4_t b) {
+ vst4q_p8(a, b);
+}
+
+// CHECK: test_vst4q_p16
+// CHECK: vst4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}
+void test_vst4q_p16(poly16_t * a, poly16x8x4_t b) {
+ vst4q_p16(a, b);
+}
+
+// CHECK: test_vst4_u8
+// CHECK: vst4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst4_u8(uint8_t * a, uint8x8x4_t b) {
+ vst4_u8(a, b);
+}
+
+// CHECK: test_vst4_u16
+// CHECK: vst4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst4_u16(uint16_t * a, uint16x4x4_t b) {
+ vst4_u16(a, b);
+}
+
+// CHECK: test_vst4_u32
+// CHECK: vst4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst4_u32(uint32_t * a, uint32x2x4_t b) {
+ vst4_u32(a, b);
+}
+
+// CHECK: test_vst4_u64
+// CHECK: vst1.64
+void test_vst4_u64(uint64_t * a, uint64x1x4_t b) {
+ vst4_u64(a, b);
+}
+
+// CHECK: test_vst4_s8
+// CHECK: vst4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst4_s8(int8_t * a, int8x8x4_t b) {
+ vst4_s8(a, b);
+}
+
+// CHECK: test_vst4_s16
+// CHECK: vst4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst4_s16(int16_t * a, int16x4x4_t b) {
+ vst4_s16(a, b);
+}
+
+// CHECK: test_vst4_s32
+// CHECK: vst4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst4_s32(int32_t * a, int32x2x4_t b) {
+ vst4_s32(a, b);
+}
+
+// CHECK: test_vst4_s64
+// CHECK: vst1.64
+void test_vst4_s64(int64_t * a, int64x1x4_t b) {
+ vst4_s64(a, b);
+}
+
+// CHECK: test_vst4_f16
+// CHECK: vst4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst4_f16(float16_t * a, float16x4x4_t b) {
+ vst4_f16(a, b);
+}
+
+// CHECK: test_vst4_f32
+// CHECK: vst4.32 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst4_f32(float32_t * a, float32x2x4_t b) {
+ vst4_f32(a, b);
+}
+
+// CHECK: test_vst4_p8
+// CHECK: vst4.8 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst4_p8(poly8_t * a, poly8x8x4_t b) {
+ vst4_p8(a, b);
+}
+
+// CHECK: test_vst4_p16
+// CHECK: vst4.16 {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, [r{{[0-9]+}}]
+void test_vst4_p16(poly16_t * a, poly16x4x4_t b) {
+ vst4_p16(a, b);
+}
+
+
+// CHECK: test_vst4q_lane_u16
+// CHECK: vst4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst4q_lane_u16(uint16_t * a, uint16x8x4_t b) {
+ vst4q_lane_u16(a, b, 7);
+}
+
+// CHECK: test_vst4q_lane_u32
+// CHECK: vst4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst4q_lane_u32(uint32_t * a, uint32x4x4_t b) {
+ vst4q_lane_u32(a, b, 3);
+}
+
+// CHECK: test_vst4q_lane_s16
+// CHECK: vst4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst4q_lane_s16(int16_t * a, int16x8x4_t b) {
+ vst4q_lane_s16(a, b, 7);
+}
+
+// CHECK: test_vst4q_lane_s32
+// CHECK: vst4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst4q_lane_s32(int32_t * a, int32x4x4_t b) {
+ vst4q_lane_s32(a, b, 3);
+}
+
+// CHECK: test_vst4q_lane_f16
+// CHECK: vst4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst4q_lane_f16(float16_t * a, float16x8x4_t b) {
+ vst4q_lane_f16(a, b, 7);
+}
+
+// CHECK: test_vst4q_lane_f32
+// CHECK: vst4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst4q_lane_f32(float32_t * a, float32x4x4_t b) {
+ vst4q_lane_f32(a, b, 3);
+}
+
+// CHECK: test_vst4q_lane_p16
+// CHECK: vst4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}
+void test_vst4q_lane_p16(poly16_t * a, poly16x8x4_t b) {
+ vst4q_lane_p16(a, b, 7);
+}
+
+// CHECK: test_vst4_lane_u8
+// CHECK: vst4.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst4_lane_u8(uint8_t * a, uint8x8x4_t b) {
+ vst4_lane_u8(a, b, 7);
+}
+
+// CHECK: test_vst4_lane_u16
+// CHECK: vst4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst4_lane_u16(uint16_t * a, uint16x4x4_t b) {
+ vst4_lane_u16(a, b, 3);
+}
+
+// CHECK: test_vst4_lane_u32
+// CHECK: vst4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst4_lane_u32(uint32_t * a, uint32x2x4_t b) {
+ vst4_lane_u32(a, b, 1);
+}
+
+// CHECK: test_vst4_lane_s8
+// CHECK: vst4.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst4_lane_s8(int8_t * a, int8x8x4_t b) {
+ vst4_lane_s8(a, b, 7);
+}
+
+// CHECK: test_vst4_lane_s16
+// CHECK: vst4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst4_lane_s16(int16_t * a, int16x4x4_t b) {
+ vst4_lane_s16(a, b, 3);
+}
+
+// CHECK: test_vst4_lane_s32
+// CHECK: vst4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst4_lane_s32(int32_t * a, int32x2x4_t b) {
+ vst4_lane_s32(a, b, 1);
+}
+
+// CHECK: test_vst4_lane_f16
+// CHECK: vst4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst4_lane_f16(float16_t * a, float16x4x4_t b) {
+ vst4_lane_f16(a, b, 3);
+}
+
+// CHECK: test_vst4_lane_f32
+// CHECK: vst4.32 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst4_lane_f32(float32_t * a, float32x2x4_t b) {
+ vst4_lane_f32(a, b, 1);
+}
+
+// CHECK: test_vst4_lane_p8
+// CHECK: vst4.8 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst4_lane_p8(poly8_t * a, poly8x8x4_t b) {
+ vst4_lane_p8(a, b, 7);
+}
+
+// CHECK: test_vst4_lane_p16
+// CHECK: vst4.16 {d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}], d{{[0-9]+}}[{{[0-9]+}}]}, [r{{[0-9]+}}]
+void test_vst4_lane_p16(poly16_t * a, poly16x4x4_t b) {
+ vst4_lane_p16(a, b, 3);
+}
+
+
+// CHECK: test_vsub_s8
+// CHECK: vsub.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int8x8_t test_vsub_s8(int8x8_t a, int8x8_t b) {
+ return vsub_s8(a, b);
+}
+
+// CHECK: test_vsub_s16
+// CHECK: vsub.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x4_t test_vsub_s16(int16x4_t a, int16x4_t b) {
+ return vsub_s16(a, b);
+}
+
+// CHECK: test_vsub_s32
+// CHECK: vsub.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x2_t test_vsub_s32(int32x2_t a, int32x2_t b) {
+ return vsub_s32(a, b);
+}
+
+// CHECK: test_vsub_s64
+// CHECK: vsub.i64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x1_t test_vsub_s64(int64x1_t a, int64x1_t b) {
+ return vsub_s64(a, b);
+}
+
+// CHECK: test_vsub_f32
+// CHECK: vsub.f32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+float32x2_t test_vsub_f32(float32x2_t a, float32x2_t b) {
+ return vsub_f32(a, b);
+}
+
+// CHECK: test_vsub_u8
+// CHECK: vsub.i8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vsub_u8(uint8x8_t a, uint8x8_t b) {
+ return vsub_u8(a, b);
+}
+
+// CHECK: test_vsub_u16
+// CHECK: vsub.i16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vsub_u16(uint16x4_t a, uint16x4_t b) {
+ return vsub_u16(a, b);
+}
+
+// CHECK: test_vsub_u32
+// CHECK: vsub.i32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vsub_u32(uint32x2_t a, uint32x2_t b) {
+ return vsub_u32(a, b);
+}
+
+// CHECK: test_vsub_u64
+// CHECK: vsub.i64 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x1_t test_vsub_u64(uint64x1_t a, uint64x1_t b) {
+ return vsub_u64(a, b);
+}
+
+// CHECK: test_vsubq_s8
+// CHECK: vsub.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x16_t test_vsubq_s8(int8x16_t a, int8x16_t b) {
+ return vsubq_s8(a, b);
+}
+
+// CHECK: test_vsubq_s16
+// CHECK: vsub.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x8_t test_vsubq_s16(int16x8_t a, int16x8_t b) {
+ return vsubq_s16(a, b);
+}
+
+// CHECK: test_vsubq_s32
+// CHECK: vsub.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x4_t test_vsubq_s32(int32x4_t a, int32x4_t b) {
+ return vsubq_s32(a, b);
+}
+
+// CHECK: test_vsubq_s64
+// CHECK: vsub.i64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int64x2_t test_vsubq_s64(int64x2_t a, int64x2_t b) {
+ return vsubq_s64(a, b);
+}
+
+// CHECK: test_vsubq_f32
+// CHECK: vsub.f32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+float32x4_t test_vsubq_f32(float32x4_t a, float32x4_t b) {
+ return vsubq_f32(a, b);
+}
+
+// CHECK: test_vsubq_u8
+// CHECK: vsub.i8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vsubq_u8(uint8x16_t a, uint8x16_t b) {
+ return vsubq_u8(a, b);
+}
+
+// CHECK: test_vsubq_u16
+// CHECK: vsub.i16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vsubq_u16(uint16x8_t a, uint16x8_t b) {
+ return vsubq_u16(a, b);
+}
+
+// CHECK: test_vsubq_u32
+// CHECK: vsub.i32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vsubq_u32(uint32x4_t a, uint32x4_t b) {
+ return vsubq_u32(a, b);
+}
+
+// CHECK: test_vsubq_u64
+// CHECK: vsub.i64 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint64x2_t test_vsubq_u64(uint64x2_t a, uint64x2_t b) {
+ return vsubq_u64(a, b);
+}
+
+
+// CHECK: test_vsubhn_s16
+// CHECK: vsubhn.i16 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int8x8_t test_vsubhn_s16(int16x8_t a, int16x8_t b) {
+ return vsubhn_s16(a, b);
+}
+
+// CHECK: test_vsubhn_s32
+// CHECK: vsubhn.i32 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int16x4_t test_vsubhn_s32(int32x4_t a, int32x4_t b) {
+ return vsubhn_s32(a, b);
+}
+
+// CHECK: test_vsubhn_s64
+// CHECK: vsubhn.i64 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+int32x2_t test_vsubhn_s64(int64x2_t a, int64x2_t b) {
+ return vsubhn_s64(a, b);
+}
+
+// CHECK: test_vsubhn_u16
+// CHECK: vsubhn.i16 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x8_t test_vsubhn_u16(uint16x8_t a, uint16x8_t b) {
+ return vsubhn_u16(a, b);
+}
+
+// CHECK: test_vsubhn_u32
+// CHECK: vsubhn.i32 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x4_t test_vsubhn_u32(uint32x4_t a, uint32x4_t b) {
+ return vsubhn_u32(a, b);
+}
+
+// CHECK: test_vsubhn_u64
+// CHECK: vsubhn.i64 d{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x2_t test_vsubhn_u64(uint64x2_t a, uint64x2_t b) {
+ return vsubhn_u64(a, b);
+}
+
+
+// CHECK: test_vsubl_s8
+// CHECK: vsubl.s8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int16x8_t test_vsubl_s8(int8x8_t a, int8x8_t b) {
+ return vsubl_s8(a, b);
+}
+
+// CHECK: test_vsubl_s16
+// CHECK: vsubl.s16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vsubl_s16(int16x4_t a, int16x4_t b) {
+ return vsubl_s16(a, b);
+}
+
+// CHECK: test_vsubl_s32
+// CHECK: vsubl.s32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vsubl_s32(int32x2_t a, int32x2_t b) {
+ return vsubl_s32(a, b);
+}
+
+// CHECK: test_vsubl_u8
+// CHECK: vsubl.u8 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x8_t test_vsubl_u8(uint8x8_t a, uint8x8_t b) {
+ return vsubl_u8(a, b);
+}
+
+// CHECK: test_vsubl_u16
+// CHECK: vsubl.u16 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vsubl_u16(uint16x4_t a, uint16x4_t b) {
+ return vsubl_u16(a, b);
+}
+
+// CHECK: test_vsubl_u32
+// CHECK: vsubl.u32 q{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vsubl_u32(uint32x2_t a, uint32x2_t b) {
+ return vsubl_u32(a, b);
+}
+
+
+// CHECK: test_vsubw_s8
+// CHECK: vsubw.s8 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+int16x8_t test_vsubw_s8(int16x8_t a, int8x8_t b) {
+ return vsubw_s8(a, b);
+}
+
+// CHECK: test_vsubw_s16
+// CHECK: vsubw.s16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+int32x4_t test_vsubw_s16(int32x4_t a, int16x4_t b) {
+ return vsubw_s16(a, b);
+}
+
+// CHECK: test_vsubw_s32
+// CHECK: vsubw.s32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+int64x2_t test_vsubw_s32(int64x2_t a, int32x2_t b) {
+ return vsubw_s32(a, b);
+}
+
+// CHECK: test_vsubw_u8
+// CHECK: vsubw.u8 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+uint16x8_t test_vsubw_u8(uint16x8_t a, uint8x8_t b) {
+ return vsubw_u8(a, b);
+}
+
+// CHECK: test_vsubw_u16
+// CHECK: vsubw.u16 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+uint32x4_t test_vsubw_u16(uint32x4_t a, uint16x4_t b) {
+ return vsubw_u16(a, b);
+}
+
+// CHECK: test_vsubw_u32
+// CHECK: vsubw.u32 q{{[0-9]+}}, q{{[0-9]+}}, d{{[0-9]+}}
+uint64x2_t test_vsubw_u32(uint64x2_t a, uint32x2_t b) {
+ return vsubw_u32(a, b);
+}
+
+
+// CHECK: test_vtbl1_u8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}}, d{{[0-9]+}}
+uint8x8_t test_vtbl1_u8(uint8x8_t a, uint8x8_t b) {
+ return vtbl1_u8(a, b);
+}
+
+// CHECK: test_vtbl1_s8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}}, d{{[0-9]+}}
+int8x8_t test_vtbl1_s8(int8x8_t a, int8x8_t b) {
+ return vtbl1_s8(a, b);
+}
+
+// CHECK: test_vtbl1_p8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}}, d{{[0-9]+}}
+poly8x8_t test_vtbl1_p8(poly8x8_t a, uint8x8_t b) {
+ return vtbl1_p8(a, b);
+}
+
+
+// CHECK: test_vtbl2_u8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+uint8x8_t test_vtbl2_u8(uint8x8x2_t a, uint8x8_t b) {
+ return vtbl2_u8(a, b);
+}
+
+// CHECK: test_vtbl2_s8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+int8x8_t test_vtbl2_s8(int8x8x2_t a, int8x8_t b) {
+ return vtbl2_s8(a, b);
+}
+
+// CHECK: test_vtbl2_p8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+poly8x8_t test_vtbl2_p8(poly8x8x2_t a, uint8x8_t b) {
+ return vtbl2_p8(a, b);
+}
+
+
+// CHECK: test_vtbl3_u8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+uint8x8_t test_vtbl3_u8(uint8x8x3_t a, uint8x8_t b) {
+ return vtbl3_u8(a, b);
+}
+
+// CHECK: test_vtbl3_s8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+int8x8_t test_vtbl3_s8(int8x8x3_t a, int8x8_t b) {
+ return vtbl3_s8(a, b);
+}
+
+// CHECK: test_vtbl3_p8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+poly8x8_t test_vtbl3_p8(poly8x8x3_t a, uint8x8_t b) {
+ return vtbl3_p8(a, b);
+}
+
+
+// CHECK: test_vtbl4_u8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+uint8x8_t test_vtbl4_u8(uint8x8x4_t a, uint8x8_t b) {
+ return vtbl4_u8(a, b);
+}
+
+// CHECK: test_vtbl4_s8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+int8x8_t test_vtbl4_s8(int8x8x4_t a, int8x8_t b) {
+ return vtbl4_s8(a, b);
+}
+
+// CHECK: test_vtbl4_p8
+// CHECK: vtbl.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+poly8x8_t test_vtbl4_p8(poly8x8x4_t a, uint8x8_t b) {
+ return vtbl4_p8(a, b);
+}
+
+
+// CHECK: test_vtbx1_u8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}}, d{{[0-9]+}}
+uint8x8_t test_vtbx1_u8(uint8x8_t a, uint8x8_t b, uint8x8_t c) {
+ return vtbx1_u8(a, b, c);
+}
+
+// CHECK: test_vtbx1_s8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}}, d{{[0-9]+}}
+int8x8_t test_vtbx1_s8(int8x8_t a, int8x8_t b, int8x8_t c) {
+ return vtbx1_s8(a, b, c);
+}
+
+// CHECK: test_vtbx1_p8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}}, d{{[0-9]+}}
+poly8x8_t test_vtbx1_p8(poly8x8_t a, poly8x8_t b, uint8x8_t c) {
+ return vtbx1_p8(a, b, c);
+}
+
+
+// CHECK: test_vtbx2_u8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+uint8x8_t test_vtbx2_u8(uint8x8_t a, uint8x8x2_t b, uint8x8_t c) {
+ return vtbx2_u8(a, b, c);
+}
+
+// CHECK: test_vtbx2_s8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+int8x8_t test_vtbx2_s8(int8x8_t a, int8x8x2_t b, int8x8_t c) {
+ return vtbx2_s8(a, b, c);
+}
+
+// CHECK: test_vtbx2_p8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+poly8x8_t test_vtbx2_p8(poly8x8_t a, poly8x8x2_t b, uint8x8_t c) {
+ return vtbx2_p8(a, b, c);
+}
+
+
+// CHECK: test_vtbx3_u8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+uint8x8_t test_vtbx3_u8(uint8x8_t a, uint8x8x3_t b, uint8x8_t c) {
+ return vtbx3_u8(a, b, c);
+}
+
+// CHECK: test_vtbx3_s8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+int8x8_t test_vtbx3_s8(int8x8_t a, int8x8x3_t b, int8x8_t c) {
+ return vtbx3_s8(a, b, c);
+}
+
+// CHECK: test_vtbx3_p8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+poly8x8_t test_vtbx3_p8(poly8x8_t a, poly8x8x3_t b, uint8x8_t c) {
+ return vtbx3_p8(a, b, c);
+}
+
+
+// CHECK: test_vtbx4_u8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+uint8x8_t test_vtbx4_u8(uint8x8_t a, uint8x8x4_t b, uint8x8_t c) {
+ return vtbx4_u8(a, b, c);
+}
+
+// CHECK: test_vtbx4_s8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+int8x8_t test_vtbx4_s8(int8x8_t a, int8x8x4_t b, int8x8_t c) {
+ return vtbx4_s8(a, b, c);
+}
+
+// CHECK: test_vtbx4_p8
+// CHECK: vtbx.8 d{{[0-9]+}}, {d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}}, d{{[0-9]+}}
+poly8x8_t test_vtbx4_p8(poly8x8_t a, poly8x8x4_t b, uint8x8_t c) {
+ return vtbx4_p8(a, b, c);
+}
+
+
+// CHECK: test_vtrn_s8
+// CHECK: vtrn.8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8x2_t test_vtrn_s8(int8x8_t a, int8x8_t b) {
+ return vtrn_s8(a, b);
+}
+
+// CHECK: test_vtrn_s16
+// CHECK: vtrn.16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4x2_t test_vtrn_s16(int16x4_t a, int16x4_t b) {
+ return vtrn_s16(a, b);
+}
+
+// CHECK: test_vtrn_s32
+// CHECK: vtrn.32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2x2_t test_vtrn_s32(int32x2_t a, int32x2_t b) {
+ return vtrn_s32(a, b);
+}
+
+// CHECK: test_vtrn_u8
+// CHECK: vtrn.8 d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8x2_t test_vtrn_u8(uint8x8_t a, uint8x8_t b) {
+ return vtrn_u8(a, b);
+}
+
+// CHECK: test_vtrn_u16
+// CHECK: vtrn.16 d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4x2_t test_vtrn_u16(uint16x4_t a, uint16x4_t b) {
+ return vtrn_u16(a, b);
+}
+
+// CHECK: test_vtrn_u32
+// CHECK: vtrn.32 d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2x2_t test_vtrn_u32(uint32x2_t a, uint32x2_t b) {
+ return vtrn_u32(a, b);
+}
+
+// CHECK: test_vtrn_f32
+// CHECK: vtrn.32 d{{[0-9]+}}, d{{[0-9]+}}
+float32x2x2_t test_vtrn_f32(float32x2_t a, float32x2_t b) {
+ return vtrn_f32(a, b);
+}
+
+// CHECK: test_vtrn_p8
+// CHECK: vtrn.8 d{{[0-9]+}}, d{{[0-9]+}}
+poly8x8x2_t test_vtrn_p8(poly8x8_t a, poly8x8_t b) {
+ return vtrn_p8(a, b);
+}
+
+// CHECK: test_vtrn_p16
+// CHECK: vtrn.16 d{{[0-9]+}}, d{{[0-9]+}}
+poly16x4x2_t test_vtrn_p16(poly16x4_t a, poly16x4_t b) {
+ return vtrn_p16(a, b);
+}
+
+// CHECK: test_vtrnq_s8
+// CHECK: vtrn.8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16x2_t test_vtrnq_s8(int8x16_t a, int8x16_t b) {
+ return vtrnq_s8(a, b);
+}
+
+// CHECK: test_vtrnq_s16
+// CHECK: vtrn.16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8x2_t test_vtrnq_s16(int16x8_t a, int16x8_t b) {
+ return vtrnq_s16(a, b);
+}
+
+// CHECK: test_vtrnq_s32
+// CHECK: vtrn.32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4x2_t test_vtrnq_s32(int32x4_t a, int32x4_t b) {
+ return vtrnq_s32(a, b);
+}
+
+// CHECK: test_vtrnq_u8
+// CHECK: vtrn.8 q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16x2_t test_vtrnq_u8(uint8x16_t a, uint8x16_t b) {
+ return vtrnq_u8(a, b);
+}
+
+// CHECK: test_vtrnq_u16
+// CHECK: vtrn.16 q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8x2_t test_vtrnq_u16(uint16x8_t a, uint16x8_t b) {
+ return vtrnq_u16(a, b);
+}
+
+// CHECK: test_vtrnq_u32
+// CHECK: vtrn.32 q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4x2_t test_vtrnq_u32(uint32x4_t a, uint32x4_t b) {
+ return vtrnq_u32(a, b);
+}
+
+// CHECK: test_vtrnq_f32
+// CHECK: vtrn.32 q{{[0-9]+}}, q{{[0-9]+}}
+float32x4x2_t test_vtrnq_f32(float32x4_t a, float32x4_t b) {
+ return vtrnq_f32(a, b);
+}
+
+// CHECK: test_vtrnq_p8
+// CHECK: vtrn.8 q{{[0-9]+}}, q{{[0-9]+}}
+poly8x16x2_t test_vtrnq_p8(poly8x16_t a, poly8x16_t b) {
+ return vtrnq_p8(a, b);
+}
+
+// CHECK: test_vtrnq_p16
+// CHECK: vtrn.16 q{{[0-9]+}}, q{{[0-9]+}}
+poly16x8x2_t test_vtrnq_p16(poly16x8_t a, poly16x8_t b) {
+ return vtrnq_p16(a, b);
+}
+
+
+// CHECK: test_vtst_s8
+// CHECK: vtst.8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vtst_s8(int8x8_t a, int8x8_t b) {
+ return vtst_s8(a, b);
+}
+
+// CHECK: test_vtst_s16
+// CHECK: vtst.16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vtst_s16(int16x4_t a, int16x4_t b) {
+ return vtst_s16(a, b);
+}
+
+// CHECK: test_vtst_s32
+// CHECK: vtst.32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vtst_s32(int32x2_t a, int32x2_t b) {
+ return vtst_s32(a, b);
+}
+
+// CHECK: test_vtst_u8
+// CHECK: vtst.8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vtst_u8(uint8x8_t a, uint8x8_t b) {
+ return vtst_u8(a, b);
+}
+
+// CHECK: test_vtst_u16
+// CHECK: vtst.16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vtst_u16(uint16x4_t a, uint16x4_t b) {
+ return vtst_u16(a, b);
+}
+
+// CHECK: test_vtst_u32
+// CHECK: vtst.32 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2_t test_vtst_u32(uint32x2_t a, uint32x2_t b) {
+ return vtst_u32(a, b);
+}
+
+// CHECK: test_vtst_p8
+// CHECK: vtst.8 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8_t test_vtst_p8(poly8x8_t a, poly8x8_t b) {
+ return vtst_p8(a, b);
+}
+
+// CHECK: test_vtst_p16
+// CHECK: vtst.16 d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4_t test_vtst_p16(poly16x4_t a, poly16x4_t b) {
+ return vtst_p16(a, b);
+}
+
+// CHECK: test_vtstq_s8
+// CHECK: vtst.8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vtstq_s8(int8x16_t a, int8x16_t b) {
+ return vtstq_s8(a, b);
+}
+
+// CHECK: test_vtstq_s16
+// CHECK: vtst.16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vtstq_s16(int16x8_t a, int16x8_t b) {
+ return vtstq_s16(a, b);
+}
+
+// CHECK: test_vtstq_s32
+// CHECK: vtst.32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vtstq_s32(int32x4_t a, int32x4_t b) {
+ return vtstq_s32(a, b);
+}
+
+// CHECK: test_vtstq_u8
+// CHECK: vtst.8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vtstq_u8(uint8x16_t a, uint8x16_t b) {
+ return vtstq_u8(a, b);
+}
+
+// CHECK: test_vtstq_u16
+// CHECK: vtst.16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vtstq_u16(uint16x8_t a, uint16x8_t b) {
+ return vtstq_u16(a, b);
+}
+
+// CHECK: test_vtstq_u32
+// CHECK: vtst.32 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4_t test_vtstq_u32(uint32x4_t a, uint32x4_t b) {
+ return vtstq_u32(a, b);
+}
+
+// CHECK: test_vtstq_p8
+// CHECK: vtst.8 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16_t test_vtstq_p8(poly8x16_t a, poly8x16_t b) {
+ return vtstq_p8(a, b);
+}
+
+// CHECK: test_vtstq_p16
+// CHECK: vtst.16 q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8_t test_vtstq_p16(poly16x8_t a, poly16x8_t b) {
+ return vtstq_p16(a, b);
+}
+
+
+// CHECK: test_vuzp_s8
+// CHECK: vuzp.8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8x2_t test_vuzp_s8(int8x8_t a, int8x8_t b) {
+ return vuzp_s8(a, b);
+}
+
+// CHECK: test_vuzp_s16
+// CHECK: vuzp.16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4x2_t test_vuzp_s16(int16x4_t a, int16x4_t b) {
+ return vuzp_s16(a, b);
+}
+
+// CHECK: test_vuzp_s32
+// CHECK: {{vtrn|vuzp}}.32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2x2_t test_vuzp_s32(int32x2_t a, int32x2_t b) {
+ return vuzp_s32(a, b);
+}
+
+// CHECK: test_vuzp_u8
+// CHECK: vuzp.8 d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8x2_t test_vuzp_u8(uint8x8_t a, uint8x8_t b) {
+ return vuzp_u8(a, b);
+}
+
+// CHECK: test_vuzp_u16
+// CHECK: vuzp.16 d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4x2_t test_vuzp_u16(uint16x4_t a, uint16x4_t b) {
+ return vuzp_u16(a, b);
+}
+
+// CHECK: test_vuzp_u32
+// CHECK: {{vtrn|vuzp}}.32 d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2x2_t test_vuzp_u32(uint32x2_t a, uint32x2_t b) {
+ return vuzp_u32(a, b);
+}
+
+// CHECK: test_vuzp_f32
+// CHECK: {{vtrn|vuzp}}.32 d{{[0-9]+}}, d{{[0-9]+}}
+float32x2x2_t test_vuzp_f32(float32x2_t a, float32x2_t b) {
+ return vuzp_f32(a, b);
+}
+
+// CHECK: test_vuzp_p8
+// CHECK: vuzp.8 d{{[0-9]+}}, d{{[0-9]+}}
+poly8x8x2_t test_vuzp_p8(poly8x8_t a, poly8x8_t b) {
+ return vuzp_p8(a, b);
+}
+
+// CHECK: test_vuzp_p16
+// CHECK: vuzp.16 d{{[0-9]+}}, d{{[0-9]+}}
+poly16x4x2_t test_vuzp_p16(poly16x4_t a, poly16x4_t b) {
+ return vuzp_p16(a, b);
+}
+
+// CHECK: test_vuzpq_s8
+// CHECK: vuzp.8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16x2_t test_vuzpq_s8(int8x16_t a, int8x16_t b) {
+ return vuzpq_s8(a, b);
+}
+
+// CHECK: test_vuzpq_s16
+// CHECK: vuzp.16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8x2_t test_vuzpq_s16(int16x8_t a, int16x8_t b) {
+ return vuzpq_s16(a, b);
+}
+
+// CHECK: test_vuzpq_s32
+// CHECK: {{vtrn|vuzp}}.32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4x2_t test_vuzpq_s32(int32x4_t a, int32x4_t b) {
+ return vuzpq_s32(a, b);
+}
+
+// CHECK: test_vuzpq_u8
+// CHECK: vuzp.8 q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16x2_t test_vuzpq_u8(uint8x16_t a, uint8x16_t b) {
+ return vuzpq_u8(a, b);
+}
+
+// CHECK: test_vuzpq_u16
+// CHECK: vuzp.16 q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8x2_t test_vuzpq_u16(uint16x8_t a, uint16x8_t b) {
+ return vuzpq_u16(a, b);
+}
+
+// CHECK: test_vuzpq_u32
+// CHECK: {{vtrn|vuzp}}.32 q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4x2_t test_vuzpq_u32(uint32x4_t a, uint32x4_t b) {
+ return vuzpq_u32(a, b);
+}
+
+// CHECK: test_vuzpq_f32
+// CHECK: {{vtrn|vuzp}}.32 q{{[0-9]+}}, q{{[0-9]+}}
+float32x4x2_t test_vuzpq_f32(float32x4_t a, float32x4_t b) {
+ return vuzpq_f32(a, b);
+}
+
+// CHECK: test_vuzpq_p8
+// CHECK: vuzp.8 q{{[0-9]+}}, q{{[0-9]+}}
+poly8x16x2_t test_vuzpq_p8(poly8x16_t a, poly8x16_t b) {
+ return vuzpq_p8(a, b);
+}
+
+// CHECK: test_vuzpq_p16
+// CHECK: vuzp.16 q{{[0-9]+}}, q{{[0-9]+}}
+poly16x8x2_t test_vuzpq_p16(poly16x8_t a, poly16x8_t b) {
+ return vuzpq_p16(a, b);
+}
+
+
+// CHECK: test_vzip_s8
+// CHECK: vzip.8 d{{[0-9]+}}, d{{[0-9]+}}
+int8x8x2_t test_vzip_s8(int8x8_t a, int8x8_t b) {
+ return vzip_s8(a, b);
+}
+
+// CHECK: test_vzip_s16
+// CHECK: vzip.16 d{{[0-9]+}}, d{{[0-9]+}}
+int16x4x2_t test_vzip_s16(int16x4_t a, int16x4_t b) {
+ return vzip_s16(a, b);
+}
+
+// CHECK: test_vzip_s32
+// CHECK: {{vtrn|vzip}}.32 d{{[0-9]+}}, d{{[0-9]+}}
+int32x2x2_t test_vzip_s32(int32x2_t a, int32x2_t b) {
+ return vzip_s32(a, b);
+}
+
+// CHECK: test_vzip_u8
+// CHECK: vzip.8 d{{[0-9]+}}, d{{[0-9]+}}
+uint8x8x2_t test_vzip_u8(uint8x8_t a, uint8x8_t b) {
+ return vzip_u8(a, b);
+}
+
+// CHECK: test_vzip_u16
+// CHECK: vzip.16 d{{[0-9]+}}, d{{[0-9]+}}
+uint16x4x2_t test_vzip_u16(uint16x4_t a, uint16x4_t b) {
+ return vzip_u16(a, b);
+}
+
+// CHECK: test_vzip_u32
+// CHECK: {{vtrn|vzip}}.32 d{{[0-9]+}}, d{{[0-9]+}}
+uint32x2x2_t test_vzip_u32(uint32x2_t a, uint32x2_t b) {
+ return vzip_u32(a, b);
+}
+
+// CHECK: test_vzip_f32
+// CHECK: {{vtrn|vzip}}.32 d{{[0-9]+}}, d{{[0-9]+}}
+float32x2x2_t test_vzip_f32(float32x2_t a, float32x2_t b) {
+ return vzip_f32(a, b);
+}
+
+// CHECK: test_vzip_p8
+// CHECK: vzip.8 d{{[0-9]+}}, d{{[0-9]+}}
+poly8x8x2_t test_vzip_p8(poly8x8_t a, poly8x8_t b) {
+ return vzip_p8(a, b);
+}
+
+// CHECK: test_vzip_p16
+// CHECK: vzip.16 d{{[0-9]+}}, d{{[0-9]+}}
+poly16x4x2_t test_vzip_p16(poly16x4_t a, poly16x4_t b) {
+ return vzip_p16(a, b);
+}
+
+// CHECK: test_vzipq_s8
+// CHECK: vzip.8 q{{[0-9]+}}, q{{[0-9]+}}
+int8x16x2_t test_vzipq_s8(int8x16_t a, int8x16_t b) {
+ return vzipq_s8(a, b);
+}
+
+// CHECK: test_vzipq_s16
+// CHECK: vzip.16 q{{[0-9]+}}, q{{[0-9]+}}
+int16x8x2_t test_vzipq_s16(int16x8_t a, int16x8_t b) {
+ return vzipq_s16(a, b);
+}
+
+// CHECK: test_vzipq_s32
+// CHECK: {{vtrn|vzip}}.32 q{{[0-9]+}}, q{{[0-9]+}}
+int32x4x2_t test_vzipq_s32(int32x4_t a, int32x4_t b) {
+ return vzipq_s32(a, b);
+}
+
+// CHECK: test_vzipq_u8
+// CHECK: vzip.8 q{{[0-9]+}}, q{{[0-9]+}}
+uint8x16x2_t test_vzipq_u8(uint8x16_t a, uint8x16_t b) {
+ return vzipq_u8(a, b);
+}
+
+// CHECK: test_vzipq_u16
+// CHECK: vzip.16 q{{[0-9]+}}, q{{[0-9]+}}
+uint16x8x2_t test_vzipq_u16(uint16x8_t a, uint16x8_t b) {
+ return vzipq_u16(a, b);
+}
+
+// CHECK: test_vzipq_u32
+// CHECK: {{vtrn|vzip}}.32 q{{[0-9]+}}, q{{[0-9]+}}
+uint32x4x2_t test_vzipq_u32(uint32x4_t a, uint32x4_t b) {
+ return vzipq_u32(a, b);
+}
+
+// CHECK: test_vzipq_f32
+// CHECK: {{vtrn|vzip}}.32 q{{[0-9]+}}, q{{[0-9]+}}
+float32x4x2_t test_vzipq_f32(float32x4_t a, float32x4_t b) {
+ return vzipq_f32(a, b);
+}
+
+// CHECK: test_vzipq_p8
+// CHECK: vzip.8 q{{[0-9]+}}, q{{[0-9]+}}
+poly8x16x2_t test_vzipq_p8(poly8x16_t a, poly8x16_t b) {
+ return vzipq_p8(a, b);
+}
+
+// CHECK: test_vzipq_p16
+// CHECK: vzip.16 q{{[0-9]+}}, q{{[0-9]+}}
+poly16x8x2_t test_vzipq_p16(poly16x8_t a, poly16x8_t b) {
+ return vzipq_p16(a, b);
+}
+
+
diff --git a/test/CodeGen/asm-label.c b/test/CodeGen/asm-label.c
index c06f11fd2d24..f944d368f8b3 100644
--- a/test/CodeGen/asm-label.c
+++ b/test/CodeGen/asm-label.c
@@ -17,3 +17,15 @@ int *test(void) {
// DARWIN: @"\01bar" = internal global i32 0
// DARWIN: @"\01foo" = common global i32 0
// DARWIN: declare i8* @"\01alias"(i32)
+
+// PR7887
+int pr7887_1 asm("");
+extern int pr7887_2 asm("");
+int pr7887_3 () asm("");
+
+int pt7887_4 () {
+ static int y asm("");
+ y = pr7887_3();
+ pr7887_2 = 1;
+ return pr7887_1;
+}
diff --git a/test/CodeGen/assign.c b/test/CodeGen/assign.c
index fc008963c317..b2702f096601 100644
--- a/test/CodeGen/assign.c
+++ b/test/CodeGen/assign.c
@@ -2,7 +2,7 @@
// Check that we don't generate unnecessary reloads.
//
-// CHECK: define void @f0()
+// CHECK-LABEL: define void @f0()
// CHECK: [[x_0:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[y_0:%.*]] = alloca i32, align 4
// CHECK-NEXT: store i32 1, i32* [[x_0]]
@@ -18,7 +18,7 @@ void f0() {
// This used to test that we generate reloads for volatile access,
// but that does not appear to be correct behavior for C.
//
-// CHECK: define void @f1()
+// CHECK-LABEL: define void @f1()
// CHECK: [[x_1:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[y_1:%.*]] = alloca i32, align 4
// CHECK-NEXT: store volatile i32 1, i32* [[x_1]]
diff --git a/test/CodeGen/atomic-ops.c b/test/CodeGen/atomic-ops.c
index d79f40522344..830f21a569aa 100644
--- a/test/CodeGen/atomic-ops.c
+++ b/test/CodeGen/atomic-ops.c
@@ -246,9 +246,6 @@ _Atomic(struct foo) bigAtomic;
void structAtomicStore() {
// CHECK: @structAtomicStore
struct foo f = {0};
- __c11_atomic_store(&bigAtomic, f, 5);
- // CHECK: call void @__atomic_store(i32 512, i8* bitcast ({{.*}} @bigAtomic to i8*),
-
struct bar b = {0};
__atomic_store(&smallThing, &b, 5);
// CHECK: call void @__atomic_store(i32 3, i8* {{.*}} @smallThing
@@ -258,13 +255,11 @@ void structAtomicStore() {
}
void structAtomicLoad() {
// CHECK: @structAtomicLoad
- struct foo f = __c11_atomic_load(&bigAtomic, 5);
- // CHECK: call void @__atomic_load(i32 512, i8* bitcast ({{.*}} @bigAtomic to i8*),
-
struct bar b;
__atomic_load(&smallThing, &b, 5);
// CHECK: call void @__atomic_load(i32 3, i8* {{.*}} @smallThing
+ struct foo f = {0};
__atomic_load(&bigThing, &f, 5);
// CHECK: call void @__atomic_load(i32 512, i8* {{.*}} @bigThing
}
diff --git a/test/CodeGen/atomics-inlining.c b/test/CodeGen/atomics-inlining.c
index 9b0d4135fc14..6456e74a94ec 100644
--- a/test/CodeGen/atomics-inlining.c
+++ b/test/CodeGen/atomics-inlining.c
@@ -1,3 +1,4 @@
+// RUN: %clang_cc1 -triple arm-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=ARM
// RUN: %clang_cc1 -triple powerpc-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=PPC32
// RUN: %clang_cc1 -triple powerpc64-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=PPC64
// RUN: %clang_cc1 -triple mipsel-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=MIPS32
@@ -7,6 +8,7 @@ unsigned char c1, c2;
unsigned short s1, s2;
unsigned int i1, i2;
unsigned long long ll1, ll2;
+unsigned char a1[100], a2[100];
enum memory_order {
memory_order_relaxed,
@@ -19,31 +21,73 @@ enum memory_order {
void test1(void) {
(void)__atomic_load(&c1, &c2, memory_order_seq_cst);
+ (void)__atomic_store(&c1, &c2, memory_order_seq_cst);
(void)__atomic_load(&s1, &s2, memory_order_seq_cst);
+ (void)__atomic_store(&s1, &s2, memory_order_seq_cst);
(void)__atomic_load(&i1, &i2, memory_order_seq_cst);
+ (void)__atomic_store(&i1, &i2, memory_order_seq_cst);
(void)__atomic_load(&ll1, &ll2, memory_order_seq_cst);
+ (void)__atomic_store(&ll1, &ll2, memory_order_seq_cst);
+ (void)__atomic_load(&a1, &a2, memory_order_seq_cst);
+ (void)__atomic_store(&a1, &a2, memory_order_seq_cst);
-// PPC32: define void @test1
-// PPC32: load atomic i8* @c1 seq_cst
-// PPC32: load atomic i16* @s1 seq_cst
-// PPC32: load atomic i32* @i1 seq_cst
-// PPC32: call void @__atomic_load(i32 8, i8* bitcast (i64* @ll1 to i8*)
-
-// PPC64: define void @test1
-// PPC64: load atomic i8* @c1 seq_cst
-// PPC64: load atomic i16* @s1 seq_cst
-// PPC64: load atomic i32* @i1 seq_cst
-// PPC64: load atomic i64* @ll1 seq_cst
-
-// MIPS32: define void @test1
-// MIPS32: load atomic i8* @c1 seq_cst
-// MIPS32: load atomic i16* @s1 seq_cst
-// MIPS32: load atomic i32* @i1 seq_cst
-// MIPS32: call void @__atomic_load(i32 8, i8* bitcast (i64* @ll1 to i8*)
-
-// MIPS64: define void @test1
-// MIPS64: load atomic i8* @c1 seq_cst
-// MIPS64: load atomic i16* @s1 seq_cst
-// MIPS64: load atomic i32* @i1 seq_cst
-// MIPS64: load atomic i64* @ll1 seq_cst
+// ARM-LABEL: define arm_aapcscc void @test1
+// ARM: = call arm_aapcscc zeroext i8 @__atomic_load_1(i8* @c1
+// ARM: call arm_aapcscc void @__atomic_store_1(i8* @c1, i8 zeroext
+// ARM: = call arm_aapcscc zeroext i16 @__atomic_load_2(i8* bitcast (i16* @s1 to i8*)
+// ARM: call arm_aapcscc void @__atomic_store_2(i8* bitcast (i16* @s1 to i8*), i16 zeroext
+// ARM: = call arm_aapcscc i32 @__atomic_load_4(i8* bitcast (i32* @i1 to i8*)
+// ARM: call arm_aapcscc void @__atomic_store_4(i8* bitcast (i32* @i1 to i8*), i32
+// ARM: = call arm_aapcscc i64 @__atomic_load_8(i8* bitcast (i64* @ll1 to i8*)
+// ARM: call arm_aapcscc void @__atomic_store_8(i8* bitcast (i64* @ll1 to i8*), i64
+// ARM: call arm_aapcscc void @__atomic_load(i32 100, i8* getelementptr inbounds ([100 x i8]* @a1, i32 0, i32 0), i8* getelementptr inbounds ([100 x i8]* @a2, i32 0, i32 0)
+// ARM: call arm_aapcscc void @__atomic_store(i32 100, i8* getelementptr inbounds ([100 x i8]* @a1, i32 0, i32 0), i8* getelementptr inbounds ([100 x i8]* @a2, i32 0, i32 0)
+
+// PPC32-LABEL: define void @test1
+// PPC32: = load atomic i8* @c1 seq_cst
+// PPC32: store atomic i8 {{.*}}, i8* @c1 seq_cst
+// PPC32: = load atomic i16* @s1 seq_cst
+// PPC32: store atomic i16 {{.*}}, i16* @s1 seq_cst
+// PPC32: = load atomic i32* @i1 seq_cst
+// PPC32: store atomic i32 {{.*}}, i32* @i1 seq_cst
+// PPC32: = call i64 @__atomic_load_8(i8* bitcast (i64* @ll1 to i8*)
+// PPC32: call void @__atomic_store_8(i8* bitcast (i64* @ll1 to i8*), i64
+// PPC32: call void @__atomic_load(i32 100, i8* getelementptr inbounds ([100 x i8]* @a1, i32 0, i32 0), i8* getelementptr inbounds ([100 x i8]* @a2, i32 0, i32 0)
+// PPC32: call void @__atomic_store(i32 100, i8* getelementptr inbounds ([100 x i8]* @a1, i32 0, i32 0), i8* getelementptr inbounds ([100 x i8]* @a2, i32 0, i32 0)
+
+// PPC64-LABEL: define void @test1
+// PPC64: = load atomic i8* @c1 seq_cst
+// PPC64: store atomic i8 {{.*}}, i8* @c1 seq_cst
+// PPC64: = load atomic i16* @s1 seq_cst
+// PPC64: store atomic i16 {{.*}}, i16* @s1 seq_cst
+// PPC64: = load atomic i32* @i1 seq_cst
+// PPC64: store atomic i32 {{.*}}, i32* @i1 seq_cst
+// PPC64: = load atomic i64* @ll1 seq_cst
+// PPC64: store atomic i64 {{.*}}, i64* @ll1 seq_cst
+// PPC64: call void @__atomic_load(i64 100, i8* getelementptr inbounds ([100 x i8]* @a1, i32 0, i32 0), i8* getelementptr inbounds ([100 x i8]* @a2, i32 0, i32 0)
+// PPC64: call void @__atomic_store(i64 100, i8* getelementptr inbounds ([100 x i8]* @a1, i32 0, i32 0), i8* getelementptr inbounds ([100 x i8]* @a2, i32 0, i32 0)
+
+// MIPS32-LABEL: define void @test1
+// MIPS32: = load atomic i8* @c1 seq_cst
+// MIPS32: store atomic i8 {{.*}}, i8* @c1 seq_cst
+// MIPS32: = load atomic i16* @s1 seq_cst
+// MIPS32: store atomic i16 {{.*}}, i16* @s1 seq_cst
+// MIPS32: = load atomic i32* @i1 seq_cst
+// MIPS32: store atomic i32 {{.*}}, i32* @i1 seq_cst
+// MIPS32: call i64 @__atomic_load_8(i8* bitcast (i64* @ll1 to i8*)
+// MIPS32: call void @__atomic_store_8(i8* bitcast (i64* @ll1 to i8*), i64
+// MIPS32: call void @__atomic_load(i32 100, i8* getelementptr inbounds ([100 x i8]* @a1, i32 0, i32 0), i8* getelementptr inbounds ([100 x i8]* @a2, i32 0, i32 0)
+// MIPS32: call void @__atomic_store(i32 100, i8* getelementptr inbounds ([100 x i8]* @a1, i32 0, i32 0), i8* getelementptr inbounds ([100 x i8]* @a2, i32 0, i32 0)
+
+// MIPS64-LABEL: define void @test1
+// MIPS64: = load atomic i8* @c1 seq_cst
+// MIPS64: store atomic i8 {{.*}}, i8* @c1 seq_cst
+// MIPS64: = load atomic i16* @s1 seq_cst
+// MIPS64: store atomic i16 {{.*}}, i16* @s1 seq_cst
+// MIPS64: = load atomic i32* @i1 seq_cst
+// MIPS64: store atomic i32 {{.*}}, i32* @i1 seq_cst
+// MIPS64: = load atomic i64* @ll1 seq_cst
+// MIPS64: store atomic i64 {{.*}}, i64* @ll1 seq_cst
+// MIPS64: call void @__atomic_load(i64 100, i8* getelementptr inbounds ([100 x i8]* @a1, i32 0, i32 0)
+// MIPS64: call void @__atomic_store(i64 100, i8* getelementptr inbounds ([100 x i8]* @a1, i32 0, i32 0), i8* getelementptr inbounds ([100 x i8]* @a2, i32 0, i32 0)
}
diff --git a/test/CodeGen/attr-availability.c b/test/CodeGen/attr-availability.c
index 6f9c045a3f17..ccbbb62f8c1f 100644
--- a/test/CodeGen/attr-availability.c
+++ b/test/CodeGen/attr-availability.c
@@ -2,15 +2,15 @@
// RUN: %clang_cc1 -fvisibility hidden "-triple" "x86_64-apple-darwin9.0.0" -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-10_5 %s
// RUN: %clang_cc1 -fvisibility hidden "-triple" "x86_64-apple-darwin10.0.0" -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-10_6 %s
-// CHECK-10_4: define hidden void @f2
-// CHECK-10_5: define hidden void @f2
-// CHECK-10_6: define hidden void @f2
+// CHECK-10_4-LABEL: define hidden void @f2
+// CHECK-10_5-LABEL: define hidden void @f2
+// CHECK-10_6-LABEL: define hidden void @f2
void f2();
void f2() { }
-// CHECK-10_4: define void @f3
-// CHECK-10_5: define void @f3
-// CHECK-10_6: define void @f3
+// CHECK-10_4-LABEL: define void @f3
+// CHECK-10_5-LABEL: define void @f3
+// CHECK-10_6-LABEL: define void @f3
void f3() __attribute__((availability(macosx,introduced=10.5)));
void f3() { }
diff --git a/test/CodeGen/attr-coldhot.c b/test/CodeGen/attr-coldhot.c
index a27711970842..ec54edde9d77 100644
--- a/test/CodeGen/attr-coldhot.c
+++ b/test/CodeGen/attr-coldhot.c
@@ -8,4 +8,4 @@ int test1() __attribute__((__cold__)) {
// CHECK: ret
}
-// CHECK: attributes [[ATTR]] = { {{.*}}optsize{{.*}} }
+// CHECK: attributes [[ATTR]] = { {{.*}}cold{{.*}}optsize{{.*}} }
diff --git a/test/CodeGen/attr-minsize.cpp b/test/CodeGen/attr-minsize.cpp
index 997194df7f90..0f07725fe8d8 100644
--- a/test/CodeGen/attr-minsize.cpp
+++ b/test/CodeGen/attr-minsize.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -Oz -emit-llvm %s -o - | FileCheck %s -check-prefix=Oz
-// RUN: %clang_cc1 -O0 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
// RUN: %clang_cc1 -O1 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
// RUN: %clang_cc1 -O2 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
// RUN: %clang_cc1 -O3 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
diff --git a/test/CodeGen/attr-weakref.c b/test/CodeGen/attr-weakref.c
index 560d39141ca9..248860d5bcd3 100644
--- a/test/CodeGen/attr-weakref.c
+++ b/test/CodeGen/attr-weakref.c
@@ -8,7 +8,7 @@ void test1_h(void) {
test1_g();
}
-// CHECK: define void @test2_f()
+// CHECK-LABEL: define void @test2_f()
void test2_f(void) {}
static void test2_g(void) __attribute__((weakref("test2_f")));
void test2_h(void) {
@@ -25,7 +25,7 @@ void test3_h(void) {
test3_g();
}
-// CHECK: define void @test4_f()
+// CHECK-LABEL: define void @test4_f()
void test4_f(void);
static void test4_g(void) __attribute__((weakref("test4_f")));
void test4_h(void) {
diff --git a/test/CodeGen/available-externally-suppress.c b/test/CodeGen/available-externally-suppress.c
index 46b6e742f35e..390d2017884a 100644
--- a/test/CodeGen/available-externally-suppress.c
+++ b/test/CodeGen/available-externally-suppress.c
@@ -1,11 +1,11 @@
-// RUN: %clang_cc1 -emit-llvm -o - -O0 -triple x86_64-apple-darwin10 %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-apple-darwin10 %s | FileCheck %s
// Ensure that we don't emit available_externally functions at -O0.
int x;
inline void f0(int y) { x = y; }
-// CHECK: define void @test()
+// CHECK-LABEL: define void @test()
// CHECK: declare void @f0(i32)
void test() {
f0(17);
diff --git a/test/CodeGen/avx-builtins.c b/test/CodeGen/avx-builtins.c
index 0e5a741bcf67..c88946fe8567 100644
--- a/test/CodeGen/avx-builtins.c
+++ b/test/CodeGen/avx-builtins.c
@@ -93,3 +93,21 @@ int test_mm_cmpistrz(__m128i A, __m128i B) {
// CHECK: @llvm.x86.sse42.pcmpistriz128
return _mm_cmpistrz(A, B, 7);
}
+
+int test_extract_epi32(__m256i __a) {
+ // CHECK-LABEL: @test_extract_epi32
+ // CHECK: extractelement <8 x i32> %{{.*}}, i32 0
+ return _mm256_extract_epi32(__a, 8);
+}
+
+int test_extract_epi16(__m256i __a) {
+ // CHECK-LABEL: @test_extract_epi16
+ // CHECK: extractelement <16 x i16> %{{.*}}, i32 0
+ return _mm256_extract_epi16(__a, 16);
+}
+
+int test_extract_epi8(__m256i __a) {
+ // CHECK-LABEL: @test_extract_epi8
+ // CHECK: extractelement <32 x i8> %{{.*}}, i32 0
+ return _mm256_extract_epi8(__a, 32);
+}
diff --git a/test/CodeGen/avx-cmp-builtins.c b/test/CodeGen/avx-cmp-builtins.c
index 1ac1c31e2ad0..5b205d79d0c6 100644
--- a/test/CodeGen/avx-cmp-builtins.c
+++ b/test/CodeGen/avx-cmp-builtins.c
@@ -44,3 +44,51 @@ __m128d test_cmp_ss(__m128 a, __m128 b) {
// CHECK: @llvm.x86.sse.cmp.ss({{.*}}, i8 13)
return _mm_cmp_ss(a, b, _CMP_GE_OS);
}
+
+__m128 test_cmpgt_ss(__m128 a, __m128 b) {
+ // CHECK: @llvm.x86.sse.cmp.ss({{.*}}, i8 1)
+ // CHECK: shufflevector <{{.*}}, <4 x i32> <i32 4, i32 1, i32 2, i32 3>
+ return _mm_cmpgt_ss(a, b);
+}
+
+__m128 test_cmpge_ss(__m128 a, __m128 b) {
+ // CHECK: @llvm.x86.sse.cmp.ss({{.*}}, i8 2)
+ // CHECK: shufflevector <{{.*}}, <4 x i32> <i32 4, i32 1, i32 2, i32 3>
+ return _mm_cmpge_ss(a, b);
+}
+
+__m128 test_cmpngt_ss(__m128 a, __m128 b) {
+ // CHECK: @llvm.x86.sse.cmp.ss({{.*}}, i8 5)
+ // CHECK: shufflevector <{{.*}}, <4 x i32> <i32 4, i32 1, i32 2, i32 3>
+ return _mm_cmpngt_ss(a, b);
+}
+
+__m128 test_cmpnge_ss(__m128 a, __m128 b) {
+ // CHECK: @llvm.x86.sse.cmp.ss({{.*}}, i8 6)
+ // CHECK: shufflevector <{{.*}}, <4 x i32> <i32 4, i32 1, i32 2, i32 3>
+ return _mm_cmpnge_ss(a, b);
+}
+
+__m128d test_cmpgt_sd(__m128d a, __m128d b) {
+ // CHECK: @llvm.x86.sse2.cmp.sd({{.*}}, i8 1)
+ // CHECK: shufflevector <{{.*}}, <2 x i32> <i32 0, i32 3>
+ return _mm_cmpgt_sd(a, b);
+}
+
+__m128d test_cmpge_sd(__m128d a, __m128d b) {
+ // CHECK: @llvm.x86.sse2.cmp.sd({{.*}}, i8 2)
+ // CHECK: shufflevector <{{.*}}, <2 x i32> <i32 0, i32 3>
+ return _mm_cmpge_sd(a, b);
+}
+
+__m128d test_cmpngt_sd(__m128d a, __m128d b) {
+ // CHECK: @llvm.x86.sse2.cmp.sd({{.*}}, i8 5)
+ // CHECK: shufflevector <{{.*}}, <2 x i32> <i32 0, i32 3>
+ return _mm_cmpngt_sd(a, b);
+}
+
+__m128d test_cmpnge_sd(__m128d a, __m128d b) {
+ // CHECK: @llvm.x86.sse2.cmp.sd({{.*}}, i8 6)
+ // CHECK: shufflevector <{{.*}}, <2 x i32> <i32 0, i32 3>
+ return _mm_cmpnge_sd(a, b);
+}
diff --git a/test/CodeGen/avx2-builtins.c b/test/CodeGen/avx2-builtins.c
index b5bc60503173..5024d94e7185 100644
--- a/test/CodeGen/avx2-builtins.c
+++ b/test/CodeGen/avx2-builtins.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +avx2 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +avx2 -emit-llvm -o - -Werror | FileCheck %s
// Don't include mm_malloc.h, it's system specific.
#define __MM_MALLOC_H
@@ -606,9 +606,9 @@ __m256d test_mm256_broadcastsd_pd(__m128d a) {
return _mm256_broadcastsd_pd(a);
}
-__m256i test_mm_broadcastsi128_si256(__m128i *a) {
+__m256i test_mm256_broadcastsi128_si256(__m128i a) {
// CHECK: @llvm.x86.avx2.vbroadcasti128
- return _mm_broadcastsi128_si256(a);
+ return _mm256_broadcastsi128_si256(a);
}
__m128i test_mm_blend_epi32(__m128i a, __m128i b) {
@@ -850,22 +850,22 @@ __m128i test_mm256_mask_i64gather_epi32(__m128i a, int const *b, __m256i c,
return _mm256_mask_i64gather_epi32(a, b, c, d, 2);
}
-__m128i test_mm_mask_i32gather_epi64(__m128i a, int const *b, __m128i c,
+__m128i test_mm_mask_i32gather_epi64(__m128i a, long long const *b, __m128i c,
__m128i d) {
// CHECK: @llvm.x86.avx2.gather.d.q
return _mm_mask_i32gather_epi64(a, b, c, d, 2);
}
-__m256i test_mm256_mask_i32gather_epi64(__m256i a, int const *b, __m128i c,
+__m256i test_mm256_mask_i32gather_epi64(__m256i a, long long const *b, __m128i c,
__m256i d) {
// CHECK: @llvm.x86.avx2.gather.d.q.256
return _mm256_mask_i32gather_epi64(a, b, c, d, 2);
}
-__m128i test_mm_mask_i64gather_epi64(__m128i a, int const *b, __m128i c,
+__m128i test_mm_mask_i64gather_epi64(__m128i a, long long const *b, __m128i c,
__m128i d) {
// CHECK: @llvm.x86.avx2.gather.q.q
return _mm_mask_i64gather_epi64(a, b, c, d, 2);
}
-__m256i test_mm256_mask_i64gather_epi64(__m256i a, int const *b, __m256i c,
+__m256i test_mm256_mask_i64gather_epi64(__m256i a, long long const *b, __m256i c,
__m256i d) {
// CHECK: @llvm.x86.avx2.gather.q.q.256
return _mm256_mask_i64gather_epi64(a, b, c, d, 2);
@@ -920,19 +920,19 @@ __m128i test_mm256_i64gather_epi32(int const *b, __m256i c) {
// CHECK: @llvm.x86.avx2.gather.q.d.256
return _mm256_i64gather_epi32(b, c, 2);
}
-__m128i test_mm_i32gather_epi64(int const *b, __m128i c) {
+__m128i test_mm_i32gather_epi64(long long const *b, __m128i c) {
// CHECK: @llvm.x86.avx2.gather.d.q
return _mm_i32gather_epi64(b, c, 2);
}
-__m256i test_mm256_i32gather_epi64(int const *b, __m128i c) {
+__m256i test_mm256_i32gather_epi64(long long const *b, __m128i c) {
// CHECK: @llvm.x86.avx2.gather.d.q.256
return _mm256_i32gather_epi64(b, c, 2);
}
-__m128i test_mm_i64gather_epi64(int const *b, __m128i c) {
+__m128i test_mm_i64gather_epi64(long long const *b, __m128i c) {
// CHECK: @llvm.x86.avx2.gather.q.q
return _mm_i64gather_epi64(b, c, 2);
}
-__m256i test_mm256_i64gather_epi64(int const *b, __m256i c) {
+__m256i test_mm256_i64gather_epi64(long long const *b, __m256i c) {
// CHECK: @llvm.x86.avx2.gather.q.q.256
return _mm256_i64gather_epi64(b, c, 2);
}
diff --git a/test/CodeGen/big-atomic-ops.c b/test/CodeGen/big-atomic-ops.c
new file mode 100644
index 000000000000..b09aededcdea
--- /dev/null
+++ b/test/CodeGen/big-atomic-ops.c
@@ -0,0 +1,323 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-macosx10.9.0 | FileCheck %s
+
+// Also test serialization of atomic operations here, to avoid duplicating the
+// test.
+// RUN: %clang_cc1 %s -emit-pch -o %t -triple=x86_64-apple-macosx10.9.0
+// RUN: %clang_cc1 %s -include-pch %t -triple=x86_64-apple-macosx10.9.0 -emit-llvm -o - | FileCheck %s
+#ifndef ALREADY_INCLUDED
+#define ALREADY_INCLUDED
+
+// Basic IRGen tests for __c11_atomic_* and GNU __atomic_*
+
+typedef enum memory_order {
+ memory_order_relaxed, memory_order_consume, memory_order_acquire,
+ memory_order_release, memory_order_acq_rel, memory_order_seq_cst
+} memory_order;
+
+int fi1(_Atomic(int) *i) {
+ // CHECK: @fi1
+ // CHECK: load atomic i32* {{.*}} seq_cst
+ return __c11_atomic_load(i, memory_order_seq_cst);
+}
+
+int fi1a(int *i) {
+ // CHECK: @fi1a
+ // CHECK: load atomic i32* {{.*}} seq_cst
+ int v;
+ __atomic_load(i, &v, memory_order_seq_cst);
+ return v;
+}
+
+int fi1b(int *i) {
+ // CHECK: @fi1b
+ // CHECK: load atomic i32* {{.*}} seq_cst
+ return __atomic_load_n(i, memory_order_seq_cst);
+}
+
+void fi2(_Atomic(int) *i) {
+ // CHECK: @fi2
+ // CHECK: store atomic i32 {{.*}} seq_cst
+ __c11_atomic_store(i, 1, memory_order_seq_cst);
+}
+
+void fi2a(int *i) {
+ // CHECK: @fi2a
+ // CHECK: store atomic i32 {{.*}} seq_cst
+ int v = 1;
+ __atomic_store(i, &v, memory_order_seq_cst);
+}
+
+void fi2b(int *i) {
+ // CHECK: @fi2b
+ // CHECK: store atomic i32 {{.*}} seq_cst
+ __atomic_store_n(i, 1, memory_order_seq_cst);
+}
+
+int fi3(_Atomic(int) *i) {
+ // CHECK: @fi3
+ // CHECK: atomicrmw and
+ // CHECK-NOT: and
+ return __c11_atomic_fetch_and(i, 1, memory_order_seq_cst);
+}
+
+int fi3a(int *i) {
+ // CHECK: @fi3a
+ // CHECK: atomicrmw xor
+ // CHECK-NOT: xor
+ return __atomic_fetch_xor(i, 1, memory_order_seq_cst);
+}
+
+int fi3b(int *i) {
+ // CHECK: @fi3b
+ // CHECK: atomicrmw add
+ // CHECK: add
+ return __atomic_add_fetch(i, 1, memory_order_seq_cst);
+}
+
+int fi3c(int *i) {
+ // CHECK: @fi3c
+ // CHECK: atomicrmw nand
+ // CHECK-NOT: and
+ return __atomic_fetch_nand(i, 1, memory_order_seq_cst);
+}
+
+int fi3d(int *i) {
+ // CHECK: @fi3d
+ // CHECK: atomicrmw nand
+ // CHECK: and
+ // CHECK: xor
+ return __atomic_nand_fetch(i, 1, memory_order_seq_cst);
+}
+
+_Bool fi4(_Atomic(int) *i) {
+ // CHECK: @fi4
+ // CHECK: cmpxchg i32*
+ int cmp = 0;
+ return __c11_atomic_compare_exchange_strong(i, &cmp, 1, memory_order_acquire, memory_order_acquire);
+}
+
+_Bool fi4a(int *i) {
+ // CHECK: @fi4
+ // CHECK: cmpxchg i32*
+ int cmp = 0;
+ int desired = 1;
+ return __atomic_compare_exchange(i, &cmp, &desired, 0, memory_order_acquire, memory_order_acquire);
+}
+
+_Bool fi4b(int *i) {
+ // CHECK: @fi4
+ // CHECK: cmpxchg i32*
+ int cmp = 0;
+ return __atomic_compare_exchange_n(i, &cmp, 1, 1, memory_order_acquire, memory_order_acquire);
+}
+
+float ff1(_Atomic(float) *d) {
+ // CHECK: @ff1
+ // CHECK: load atomic i32* {{.*}} monotonic
+ return __c11_atomic_load(d, memory_order_relaxed);
+}
+
+void ff2(_Atomic(float) *d) {
+ // CHECK: @ff2
+ // CHECK: store atomic i32 {{.*}} release
+ __c11_atomic_store(d, 1, memory_order_release);
+}
+
+float ff3(_Atomic(float) *d) {
+ return __c11_atomic_exchange(d, 2, memory_order_seq_cst);
+}
+
+int* fp1(_Atomic(int*) *p) {
+ // CHECK: @fp1
+ // CHECK: load atomic i64* {{.*}} seq_cst
+ return __c11_atomic_load(p, memory_order_seq_cst);
+}
+
+int* fp2(_Atomic(int*) *p) {
+ // CHECK: @fp2
+ // CHECK: store i64 4
+ // CHECK: atomicrmw add {{.*}} monotonic
+ return __c11_atomic_fetch_add(p, 1, memory_order_relaxed);
+}
+
+int *fp2a(int **p) {
+ // CHECK: @fp2a
+ // CHECK: store i64 4
+ // CHECK: atomicrmw sub {{.*}} monotonic
+ // Note, the GNU builtins do not multiply by sizeof(T)!
+ return __atomic_fetch_sub(p, 4, memory_order_relaxed);
+}
+
+_Complex float fc(_Atomic(_Complex float) *c) {
+ // CHECK: @fc
+ // CHECK: atomicrmw xchg i64*
+ return __c11_atomic_exchange(c, 2, memory_order_seq_cst);
+}
+
+typedef struct X { int x; } X;
+X fs(_Atomic(X) *c) {
+ // CHECK: @fs
+ // CHECK: atomicrmw xchg i32*
+ return __c11_atomic_exchange(c, (X){2}, memory_order_seq_cst);
+}
+
+X fsa(X *c, X *d) {
+ // CHECK: @fsa
+ // CHECK: atomicrmw xchg i32*
+ X ret;
+ __atomic_exchange(c, d, &ret, memory_order_seq_cst);
+ return ret;
+}
+
+_Bool fsb(_Bool *c) {
+ // CHECK: @fsb
+ // CHECK: atomicrmw xchg i8*
+ return __atomic_exchange_n(c, 1, memory_order_seq_cst);
+}
+
+char flag1;
+volatile char flag2;
+void test_and_set() {
+ // CHECK: atomicrmw xchg i8* @flag1, i8 1 seq_cst
+ __atomic_test_and_set(&flag1, memory_order_seq_cst);
+ // CHECK: atomicrmw volatile xchg i8* @flag2, i8 1 acquire
+ __atomic_test_and_set(&flag2, memory_order_acquire);
+ // CHECK: store atomic volatile i8 0, i8* @flag2 release
+ __atomic_clear(&flag2, memory_order_release);
+ // CHECK: store atomic i8 0, i8* @flag1 seq_cst
+ __atomic_clear(&flag1, memory_order_seq_cst);
+}
+
+struct Sixteen {
+ char c[16];
+} sixteen;
+struct Seventeen {
+ char c[17];
+} seventeen;
+
+int lock_free(struct Incomplete *incomplete) {
+ // CHECK: @lock_free
+
+ // CHECK: call i32 @__atomic_is_lock_free(i64 3, i8* null)
+ __c11_atomic_is_lock_free(3);
+
+ // CHECK: call i32 @__atomic_is_lock_free(i64 16, i8* {{.*}}@sixteen{{.*}})
+ __atomic_is_lock_free(16, &sixteen);
+
+ // CHECK: call i32 @__atomic_is_lock_free(i64 17, i8* {{.*}}@seventeen{{.*}})
+ __atomic_is_lock_free(17, &seventeen);
+
+ // CHECK: call i32 @__atomic_is_lock_free(i64 4, {{.*}})
+ __atomic_is_lock_free(4, incomplete);
+
+ char cs[20];
+ // CHECK: call i32 @__atomic_is_lock_free(i64 4, {{.*}})
+ __atomic_is_lock_free(4, cs+1);
+
+ // CHECK-NOT: call
+ __atomic_always_lock_free(3, 0);
+ __atomic_always_lock_free(16, 0);
+ __atomic_always_lock_free(17, 0);
+ __atomic_always_lock_free(16, &sixteen);
+ __atomic_always_lock_free(17, &seventeen);
+
+ int n;
+ __atomic_is_lock_free(4, &n);
+
+ // CHECK: ret i32 1
+ return __c11_atomic_is_lock_free(sizeof(_Atomic(int)));
+}
+
+// Tests for atomic operations on big values. These should call the functions
+// defined here:
+// http://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary#The_Library_interface
+
+struct foo {
+ int big[128];
+};
+struct bar {
+ char c[3];
+};
+
+struct bar smallThing, thing1, thing2;
+struct foo bigThing;
+_Atomic(struct foo) bigAtomic;
+
+void structAtomicStore() {
+ // CHECK: @structAtomicStore
+ struct foo f = {0};
+ __c11_atomic_store(&bigAtomic, f, 5);
+ // CHECK: call void @__atomic_store(i64 512, i8* bitcast ({{.*}} @bigAtomic to i8*),
+
+ struct bar b = {0};
+ __atomic_store(&smallThing, &b, 5);
+ // CHECK: call void @__atomic_store(i64 3, i8* {{.*}} @smallThing
+
+ __atomic_store(&bigThing, &f, 5);
+ // CHECK: call void @__atomic_store(i64 512, i8* {{.*}} @bigThing
+}
+void structAtomicLoad() {
+ // CHECK: @structAtomicLoad
+ struct foo f = __c11_atomic_load(&bigAtomic, 5);
+ // CHECK: call void @__atomic_load(i64 512, i8* bitcast ({{.*}} @bigAtomic to i8*),
+
+ struct bar b;
+ __atomic_load(&smallThing, &b, 5);
+ // CHECK: call void @__atomic_load(i64 3, i8* {{.*}} @smallThing
+
+ __atomic_load(&bigThing, &f, 5);
+ // CHECK: call void @__atomic_load(i64 512, i8* {{.*}} @bigThing
+}
+struct foo structAtomicExchange() {
+ // CHECK: @structAtomicExchange
+ struct foo f = {0};
+ struct foo old;
+ __atomic_exchange(&f, &bigThing, &old, 5);
+ // CHECK: call void @__atomic_exchange(i64 512, {{.*}}, i8* bitcast ({{.*}} @bigThing to i8*),
+
+ return __c11_atomic_exchange(&bigAtomic, f, 5);
+ // CHECK: call void @__atomic_exchange(i64 512, i8* bitcast ({{.*}} @bigAtomic to i8*),
+}
+int structAtomicCmpExchange() {
+ // CHECK: @structAtomicCmpExchange
+ _Bool x = __atomic_compare_exchange(&smallThing, &thing1, &thing2, 1, 5, 5);
+ // CHECK: call zeroext i1 @__atomic_compare_exchange(i64 3, {{.*}} @smallThing{{.*}} @thing1{{.*}} @thing2
+
+ struct foo f = {0};
+ struct foo g = {0};
+ g.big[12] = 12;
+ return x & __c11_atomic_compare_exchange_strong(&bigAtomic, &f, g, 5, 5);
+ // CHECK: call zeroext i1 @__atomic_compare_exchange(i64 512, i8* bitcast ({{.*}} @bigAtomic to i8*),
+}
+
+// Check that no atomic operations are used in any initialisation of _Atomic
+// types.
+_Atomic(int) atomic_init_i = 42;
+
+// CHECK: @atomic_init_foo
+void atomic_init_foo()
+{
+ // CHECK-NOT: }
+ // CHECK-NOT: atomic
+ // CHECK: store
+ _Atomic(int) j = 12;
+
+ // CHECK-NOT: }
+ // CHECK-NOT: atomic
+ // CHECK: store
+ __c11_atomic_init(&j, 42);
+
+ // CHECK-NOT: atomic
+ // CHECK: }
+}
+
+// CHECK: @invalid_atomic
+void invalid_atomic(_Atomic(int) *i) {
+ __c11_atomic_store(i, 1, memory_order_consume);
+ __c11_atomic_store(i, 1, memory_order_acquire);
+ __c11_atomic_store(i, 1, memory_order_acq_rel);
+ __c11_atomic_load(i, memory_order_release);
+ __c11_atomic_load(i, memory_order_acq_rel);
+}
+
+#endif
diff --git a/test/CodeGen/bitfield-2.c b/test/CodeGen/bitfield-2.c
index bec55ffa7512..58b17f17f02a 100644
--- a/test/CodeGen/bitfield-2.c
+++ b/test/CodeGen/bitfield-2.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -emit-llvm -triple x86_64 -O3 -o %t.opt.ll %s \
-// RUN: -fdump-record-layouts 2> %t.dump.txt
+// RUN: -fdump-record-layouts > %t.dump.txt
// RUN: FileCheck -check-prefix=CHECK-RECORD < %t.dump.txt %s
// RUN: FileCheck -check-prefix=CHECK-OPT < %t.opt.ll %s
@@ -32,7 +32,7 @@ int f0_reload(struct s0 *a0) {
return (a0->f0 += 1);
}
-// CHECK-OPT: define i64 @test_0()
+// CHECK-OPT-LABEL: define i64 @test_0()
// CHECK-OPT: ret i64 1
// CHECK-OPT: }
unsigned long long test_0() {
@@ -78,7 +78,7 @@ int f1_reload(struct s1 *a0) {
return (a0->f1 += 1234);
}
-// CHECK-OPT: define i64 @test_1()
+// CHECK-OPT-LABEL: define i64 @test_1()
// CHECK-OPT: ret i64 210
// CHECK-OPT: }
unsigned long long test_1() {
@@ -120,7 +120,7 @@ int f2_reload(union u2 *a0) {
return (a0->f0 += 1234);
}
-// CHECK-OPT: define i64 @test_2()
+// CHECK-OPT-LABEL: define i64 @test_2()
// CHECK-OPT: ret i64 2
// CHECK-OPT: }
unsigned long long test_2() {
@@ -156,7 +156,7 @@ int f3_reload(struct s3 *a0) {
return (a0->f0 += 1234);
}
-// CHECK-OPT: define i64 @test_3()
+// CHECK-OPT-LABEL: define i64 @test_3()
// CHECK-OPT: ret i64 -559039940
// CHECK-OPT: }
unsigned long long test_3() {
@@ -190,7 +190,7 @@ int f4_reload(struct s4 *a0) {
return (a0->f0 += 1234) ^ (a0->f1 += 5678);
}
-// CHECK-OPT: define i64 @test_4()
+// CHECK-OPT-LABEL: define i64 @test_4()
// CHECK-OPT: ret i64 4860
// CHECK-OPT: }
unsigned long long test_4() {
@@ -222,7 +222,7 @@ int f5_reload(struct s5 *a0) {
return (a0->f0 += 0xF) ^ (a0->f1 += 0xF) ^ (a0->f2 += 0xF);
}
-// CHECK-OPT: define i64 @test_5()
+// CHECK-OPT-LABEL: define i64 @test_5()
// CHECK-OPT: ret i64 2
// CHECK-OPT: }
unsigned long long test_5() {
@@ -252,7 +252,7 @@ int f6_reload(struct s6 *a0) {
return (a0->f0 += 0xF);
}
-// CHECK-OPT: define zeroext i1 @test_6()
+// CHECK-OPT-LABEL: define zeroext i1 @test_6()
// CHECK-OPT: ret i1 true
// CHECK-OPT: }
_Bool test_6() {
@@ -310,7 +310,7 @@ int f8_reload(struct s8 *a0) {
return (a0->f0 += 0xFD) ^ (a0->f2 += 0xFD) ^ (a0->f3 += 0xFD);
}
-// CHECK-OPT: define i32 @test_8()
+// CHECK-OPT-LABEL: define i32 @test_8()
// CHECK-OPT: ret i32 -3
// CHECK-OPT: }
unsigned test_8() {
diff --git a/test/CodeGen/bitfield-assign.c b/test/CodeGen/bitfield-assign.c
index b8ab61339cf6..270f44de52f3 100644
--- a/test/CodeGen/bitfield-assign.c
+++ b/test/CodeGen/bitfield-assign.c
@@ -4,14 +4,14 @@
/* 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_cc1 -triple i386-unknown-unknown -O0 -emit-llvm -o %t %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -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_cc1 -triple i386-unknown-unknown -O3 -emit-llvm -o %t %s
-// RUN: grep 'load ' %t | count 0
-// RUN: grep "@g0" %t | count 0
+// RUN: not grep 'load ' %t
+// RUN: not grep "@g0" %t
struct s0 {
int f0 : 2;
diff --git a/test/CodeGen/bitfield.c b/test/CodeGen/bitfield.c
index dea5e43e0f1c..c624d0045d33 100644
--- a/test/CodeGen/bitfield.c
+++ b/test/CodeGen/bitfield.c
@@ -1,6 +1,5 @@
-// RUN: %clang_cc1 -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
+// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - -O3 -no-struct-path-tbaa | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - -O3 | FileCheck %s --check-prefix=PATH
static int f0(int n) {
struct s0 {
@@ -17,6 +16,10 @@ static int f0(int n) {
}
int g0(void) {
+// CHECK-LABEL: @g0()
+// CHECK: ret i32 1
+// PATH-LABEL: @g0()
+// PATH: ret i32 1
return f0(-1) + 44335655;
}
@@ -35,6 +38,10 @@ static int f1(void) {
}
int g1(void) {
+// CHECK-LABEL: @g1()
+// CHECK: ret i32 1
+// PATH-LABEL: @g1()
+// PATH: ret i32 1
return f1() + 16;
}
@@ -51,6 +58,10 @@ static int f2(void) {
}
int g2(void) {
+// CHECK-LABEL: @g2()
+// CHECK: ret i32 1
+// PATH-LABEL: @g2()
+// PATH: ret i32 1
return f2() - 9;
}
@@ -70,5 +81,9 @@ static int f3(int n) {
}
int g3(void) {
+// CHECK-LABEL: @g3()
+// CHECK: ret i32 1
+// PATH-LABEL: @g3()
+// PATH: ret i32 1
return f3(20) + 130725747;
}
diff --git a/test/CodeGen/block-byref-aggr.c b/test/CodeGen/block-byref-aggr.c
index eb342b856e4f..eed023956cd3 100644
--- a/test/CodeGen/block-byref-aggr.c
+++ b/test/CodeGen/block-byref-aggr.c
@@ -12,7 +12,7 @@ void test0() {
a = makeAgg();
}
-// CHECK: define void @test0()
+// CHECK-LABEL: define void @test0()
// CHECK: [[A:%.*]] = alloca [[BYREF:%.*]], align 8
// CHECK-NEXT: [[TEMP:%.*]] = alloca [[AGG]], align 4
// CHECK: [[RESULT:%.*]] = call i32 @makeAgg()
@@ -37,7 +37,7 @@ void test1() {
__block Agg a, b;
a = b = makeAgg();
}
-// CHECK: define void @test1()
+// CHECK-LABEL: define void @test1()
// CHECK: [[A:%.*]] = alloca [[A_BYREF:%.*]], align 8
// CHECK-NEXT: [[B:%.*]] = alloca [[B_BYREF:%.*]], align 8
// CHECK-NEXT: [[TEMP:%.*]] = alloca [[AGG]], align 4
diff --git a/test/CodeGen/blocks-2.c b/test/CodeGen/blocks-2.c
deleted file mode 100644
index 4e574dafec52..000000000000
--- a/test/CodeGen/blocks-2.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %clang_cc1 -g %s -emit-llvm -o %t -fblocks
-// RUN: grep "func.start" %t | count 4
-// RUN: %clang_cc1 -g %s -triple i386-unknown-unknown -emit-llvm -o %t -fblocks -fblock-introspection
-// RUN: grep "v8@?0i4" %t | count 1
-// RUN: %clang_cc1 -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: *
-
-static __inline__ __attribute__((always_inline)) int bar(int va, int vb) { return (va == vb); }
-
-int test_block_dbg() {
- extern int g;
- static int i = 1;
- ^(int j){ i = bar(3,4); }(0);
- return i + g;
-}
-
diff --git a/test/CodeGen/blocks.c b/test/CodeGen/blocks.c
index 71f7171c7181..5871e8c2429c 100644
--- a/test/CodeGen/blocks.c
+++ b/test/CodeGen/blocks.c
@@ -45,7 +45,7 @@ void f3() {
// The bool can fill in between the header and the long long.
// Add the appropriate amount of padding between them.
void f4_helper(long long (^)(void));
-// CHECK: define void @f4()
+// CHECK-LABEL: define void @f4()
void f4(void) {
_Bool b = 0;
long long ll = 0;
@@ -60,9 +60,21 @@ struct F5 {
char buffer[32] __attribute((aligned));
};
void f5_helper(void (^)(struct F5 *));
-// CHECK: define void @f5()
+// CHECK-LABEL: define void @f5()
void f5(void) {
struct F5 value;
// CHECK: alloca <{ i8*, i32, i32, i8*, {{%.*}}*, [12 x i8], [[F5:%.*]] }>, align 16
f5_helper(^(struct F5 *slot) { *slot = value; });
}
+
+// rdar://14085217
+void (^b)() = ^{};
+int main() {
+ (b?: ^{})();
+}
+// CHECK: [[ZERO:%.*]] = load void (...)** @b
+// CHECK-NEXT: [[TB:%.*]] = icmp ne void (...)* [[ZERO]], null
+// CHECK-NEXT: br i1 [[TB]], label [[CT:%.*]], label [[CF:%.*]]
+// CHECK: [[ONE:%.*]] = bitcast void (...)* [[ZERO]] to void ()*
+// CHECK-NEXT: br label [[CE:%.*]]
+
diff --git a/test/CodeGen/bool_test.c b/test/CodeGen/bool_test.c
index 83d833077151..a4aa669f16c3 100644
--- a/test/CodeGen/bool_test.c
+++ b/test/CodeGen/bool_test.c
@@ -8,7 +8,7 @@ void f(_Bool *x, _Bool *y) {
*x = *y;
}
-// CHECK: define void @f(
+// CHECK-LABEL: define void @f(
// CHECK: [[FROMMEM:%.*]] = load i32* %
// CHECK: [[BOOLVAL:%.*]] = trunc i32 [[FROMMEM]] to i1
// CHECK: [[TOMEM:%.*]] = zext i1 [[BOOLVAL]] to i32
diff --git a/test/CodeGen/bounds-checking.c b/test/CodeGen/bounds-checking.c
index fa7541f8141e..d93cd3ede7d6 100644
--- a/test/CodeGen/bounds-checking.c
+++ b/test/CodeGen/bounds-checking.c
@@ -1,26 +1,29 @@
-// RUN: %clang_cc1 -fsanitize=bounds -emit-llvm -triple x86_64-apple-darwin10 < %s | FileCheck %s
+// RUN: %clang_cc1 -fsanitize=local-bounds -emit-llvm -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fsanitize=array-bounds -O -fsanitize-undefined-trap-on-error -emit-llvm -triple x86_64-apple-darwin10 -DNO_DYNAMIC %s -o - | FileCheck %s
-// CHECK: @f
+// CHECK-LABEL: @f
double f(int b, int i) {
double a[b];
- // CHECK: trap
+ // CHECK: call {{.*}} @llvm.trap
return a[i];
}
-// CHECK: @f2
+// CHECK-LABEL: @f2
void f2() {
// everything is constant; no trap possible
- // CHECK-NOT: trap
+ // CHECK-NOT: call {{.*}} @llvm.trap
int a[2];
a[1] = 42;
-
+
+#ifndef NO_DYNAMIC
short *b = malloc(64);
b[5] = *a + a[1] + 2;
+#endif
}
-// CHECK: @f3
+// CHECK-LABEL: @f3
void f3() {
int a[1];
- // CHECK: trap
+ // CHECK: call {{.*}} @llvm.trap
a[2] = 1;
}
diff --git a/test/CodeGen/branch-on-bool.c b/test/CodeGen/branch-on-bool.c
new file mode 100644
index 000000000000..78dae1b1fd78
--- /dev/null
+++ b/test/CodeGen/branch-on-bool.c
@@ -0,0 +1,22 @@
+// RUN: %clang %s -O0 -emit-llvm -S -o - | FileCheck %s
+
+void foo();
+void bar();
+
+void fold_if(int a, int b) {
+ // CHECK: define {{.*}} @fold_if(
+ // CHECK-NOT: = phi
+ // CHECK: }
+ if (a && b)
+ foo();
+ else
+ bar();
+}
+
+void fold_for(int a, int b) {
+ // CHECK: define {{.*}} @fold_for(
+ // CHECK-NOT: = phi
+ // CHECK: }
+ for (int i = 0; a && i < b; ++i) foo();
+ for (int i = 0; a || i < b; ++i) bar();
+}
diff --git a/test/CodeGen/builtin-ms-noop.cpp b/test/CodeGen/builtin-ms-noop.cpp
index 42c25016b138..7c5068dd61b0 100644
--- a/test/CodeGen/builtin-ms-noop.cpp
+++ b/test/CodeGen/builtin-ms-noop.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-pc-win32 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fms-extensions -triple i686-pc-win32 -emit-llvm %s -o - | FileCheck %s
class A {
public:
diff --git a/test/CodeGen/builtins-arm-exclusive.c b/test/CodeGen/builtins-arm-exclusive.c
new file mode 100644
index 000000000000..7eccb9e27bb5
--- /dev/null
+++ b/test/CodeGen/builtins-arm-exclusive.c
@@ -0,0 +1,112 @@
+// REQUIRES: arm-registered-target
+// RUN: %clang_cc1 -Wall -Werror -triple thumbv7-linux-gnueabi -fno-signed-char -O3 -emit-llvm -o - %s | FileCheck %s
+
+// Make sure the canonical use works before going into smaller details:
+int atomic_inc(int *addr) {
+ int Failure, OldVal;
+ do {
+ OldVal = __builtin_arm_ldrex(addr);
+ Failure = __builtin_arm_strex(OldVal + 1, addr);
+ } while (Failure);
+
+ return OldVal;
+}
+
+// CHECK: @atomic_inc
+// CHECK: [[OLDVAL:%.*]] = tail call i32 @llvm.arm.ldrex.p0i32(i32* %addr)
+// CHECK: [[INC:%.*]] = add nsw i32 [[OLDVAL]], 1
+// CHECK: [[FAILURE:%.*]] = tail call i32 @llvm.arm.strex.p0i32(i32 [[INC]], i32* %addr)
+// CHECK: [[TST:%.*]] = icmp eq i32 [[FAILURE]], 0
+// CHECK: br i1 [[TST]], label {{%[a-zA-Z0-9.]+}}, label {{%[a-zA-Z0-9.]+}}
+
+struct Simple {
+ char a, b;
+};
+
+int test_ldrex(char *addr, long long *addr64, float *addrfloat) {
+// CHECK: @test_ldrex
+ int sum = 0;
+ sum += __builtin_arm_ldrex(addr);
+// CHECK: [[INTRES:%.*]] = tail call i32 @llvm.arm.ldrex.p0i8(i8* %addr)
+// CHECK: and i32 [[INTRES]], 255
+
+ sum += __builtin_arm_ldrex((short *)addr);
+// CHECK: [[ADDR16:%.*]] = bitcast i8* %addr to i16*
+// CHECK: [[INTRES:%.*]] = tail call i32 @llvm.arm.ldrex.p0i16(i16* [[ADDR16]])
+// CHECK: [[TMPSEXT:%.*]] = shl i32 [[INTRES]], 16
+// CHECK: ashr exact i32 [[TMPSEXT]], 16
+
+ sum += __builtin_arm_ldrex((int *)addr);
+// CHECK: [[ADDR32:%.*]] = bitcast i8* %addr to i32*
+// CHECK: call i32 @llvm.arm.ldrex.p0i32(i32* [[ADDR32]])
+
+ sum += __builtin_arm_ldrex((long long *)addr);
+// CHECK: call { i32, i32 } @llvm.arm.ldrexd(i8* %addr)
+
+ sum += __builtin_arm_ldrex(addr64);
+// CHECK: [[ADDR64_AS8:%.*]] = bitcast i64* %addr64 to i8*
+// CHECK: call { i32, i32 } @llvm.arm.ldrexd(i8* [[ADDR64_AS8]])
+
+ sum += __builtin_arm_ldrex(addrfloat);
+// CHECK: [[INTADDR:%.*]] = bitcast float* %addrfloat to i32*
+// CHECK: [[INTRES:%.*]] = tail call i32 @llvm.arm.ldrex.p0i32(i32* [[INTADDR]])
+// CHECK: bitcast i32 [[INTRES]] to float
+
+ sum += __builtin_arm_ldrex((double *)addr);
+// CHECK: [[STRUCTRES:%.*]] = tail call { i32, i32 } @llvm.arm.ldrexd(i8* %addr)
+// CHECK: [[RESHI:%.*]] = extractvalue { i32, i32 } [[STRUCTRES]], 1
+// CHECK: [[RESLO:%.*]] = extractvalue { i32, i32 } [[STRUCTRES]], 0
+// CHECK: [[RESHI64:%.*]] = zext i32 [[RESHI]] to i64
+// CHECK: [[RESLO64:%.*]] = zext i32 [[RESLO]] to i64
+// CHECK: [[RESHIHI:%.*]] = shl nuw i64 [[RESHI64]], 32
+// CHECK: [[INTRES:%.*]] = or i64 [[RESHIHI]], [[RESLO64]]
+// CHECK: bitcast i64 [[INTRES]] to double
+
+ sum += *__builtin_arm_ldrex((int **)addr);
+// CHECK: [[INTRES:%.*]] = tail call i32 @llvm.arm.ldrex.p0i32(i32* [[ADDR32]])
+// CHECK: inttoptr i32 [[INTRES]] to i32*
+
+ sum += __builtin_arm_ldrex((struct Simple **)addr)->a;
+// CHECK: [[INTRES:%.*]] = tail call i32 @llvm.arm.ldrex.p0i32(i32* [[ADDR32]])
+// CHECK: inttoptr i32 [[INTRES]] to %struct.Simple*
+
+ return sum;
+}
+
+int test_strex(char *addr) {
+// CHECK: @test_strex
+ int res = 0;
+ struct Simple var = {0};
+ res |= __builtin_arm_strex(4, addr);
+// CHECK: call i32 @llvm.arm.strex.p0i8(i32 4, i8* %addr)
+
+ res |= __builtin_arm_strex(42, (short *)addr);
+// CHECK: [[ADDR16:%.*]] = bitcast i8* %addr to i16*
+// CHECK: call i32 @llvm.arm.strex.p0i16(i32 42, i16* [[ADDR16]])
+
+ res |= __builtin_arm_strex(42, (int *)addr);
+// CHECK: [[ADDR32:%.*]] = bitcast i8* %addr to i32*
+// CHECK: call i32 @llvm.arm.strex.p0i32(i32 42, i32* [[ADDR32]])
+
+ res |= __builtin_arm_strex(42, (long long *)addr);
+// CHECK: call i32 @llvm.arm.strexd(i32 42, i32 0, i8* %addr)
+
+ res |= __builtin_arm_strex(2.71828f, (float *)addr);
+// CHECK: call i32 @llvm.arm.strex.p0i32(i32 1076754509, i32* [[ADDR32]])
+
+ res |= __builtin_arm_strex(3.14159, (double *)addr);
+// CHECK: call i32 @llvm.arm.strexd(i32 -266631570, i32 1074340345, i8* %addr)
+
+ res |= __builtin_arm_strex(&var, (struct Simple **)addr);
+// CHECK: [[INTVAL:%.*]] = ptrtoint i16* %var to i32
+// CHECK: call i32 @llvm.arm.strex.p0i32(i32 [[INTVAL]], i32* [[ADDR32]])
+
+ return res;
+}
+
+void test_clrex() {
+// CHECK: @test_clrex
+
+ __builtin_arm_clrex();
+// CHECK: call void @llvm.arm.clrex()
+}
diff --git a/test/CodeGen/builtins-arm.c b/test/CodeGen/builtins-arm.c
index e6c7cede1fdc..937e1d962594 100644
--- a/test/CodeGen/builtins-arm.c
+++ b/test/CodeGen/builtins-arm.c
@@ -18,3 +18,13 @@ void test_eh_return_data_regno()
res = __builtin_eh_return_data_regno(0); // CHECK: store volatile i32 0
res = __builtin_eh_return_data_regno(1); // CHECK: store volatile i32 1
}
+
+void sevl() {
+ __builtin_arm_sevl();
+}
+// CHECK: call {{.*}} @llvm.arm.sevl
+
+void test_barrier() {
+ __builtin_arm_dmb(1); //CHECK: call {{.*}} @llvm.arm.dmb(i32 1)
+ __builtin_arm_dsb(2); //CHECK: call {{.*}} @llvm.arm.dsb(i32 2)
+}
diff --git a/test/CodeGen/builtins-mips-msa.c b/test/CodeGen/builtins-mips-msa.c
new file mode 100644
index 000000000000..69cb8e22a194
--- /dev/null
+++ b/test/CodeGen/builtins-mips-msa.c
@@ -0,0 +1,829 @@
+// REQUIRES: mips-registered-target
+// RUN: %clang_cc1 -triple mips-unknown-linux-gnu -emit-llvm %s -o - \
+// RUN: | FileCheck %s
+
+typedef signed char v16i8 __attribute__ ((vector_size(16)));
+typedef signed short v8i16 __attribute__ ((vector_size(16)));
+typedef signed int v4i32 __attribute__ ((vector_size(16)));
+typedef signed long long v2i64 __attribute__ ((vector_size(16)));
+typedef unsigned char v16u8 __attribute__ ((vector_size(16)));
+typedef unsigned short v8u16 __attribute__ ((vector_size(16)));
+typedef unsigned int v4u32 __attribute__ ((vector_size(16)));
+typedef unsigned long long v2u64 __attribute__ ((vector_size(16)));
+typedef __fp16 v8f16 __attribute__ ((vector_size(16)));
+typedef float v4f32 __attribute__ ((vector_size(16)));
+typedef double v2f64 __attribute__ ((vector_size(16)));
+
+void test(void) {
+ v16i8 v16i8_a = (v16i8) {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+ v16i8 v16i8_b = (v16i8) {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
+ v16i8 v16i8_r;
+ v8i16 v8i16_a = (v8i16) {0, 1, 2, 3, 4, 5, 6, 7};
+ v8i16 v8i16_b = (v8i16) {1, 2, 3, 4, 5, 6, 7, 8};
+ v8i16 v8i16_r;
+ v4i32 v4i32_a = (v4i32) {0, 1, 2, 3};
+ v4i32 v4i32_b = (v4i32) {1, 2, 3, 4};
+ v4i32 v4i32_r;
+ v2i64 v2i64_a = (v2i64) {0, 1};
+ v2i64 v2i64_b = (v2i64) {1, 2};
+ v2i64 v2i64_r;
+
+ v16u8 v16u8_a = (v16u8) {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+ v16u8 v16u8_b = (v16u8) {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
+ v16u8 v16u8_r;
+ v8u16 v8u16_a = (v8u16) {0, 1, 2, 3, 4, 5, 6, 7};
+ v8u16 v8u16_b = (v8u16) {1, 2, 3, 4, 5, 6, 7, 8};
+ v8u16 v8u16_r;
+ v4u32 v4u32_a = (v4u32) {0, 1, 2, 3};
+ v4u32 v4u32_b = (v4u32) {1, 2, 3, 4};
+ v4u32 v4u32_r;
+ v2u64 v2u64_a = (v2u64) {0, 1};
+ v2u64 v2u64_b = (v2u64) {1, 2};
+ v2u64 v2u64_r;
+
+ v8f16 v8f16_a = (v8f16) {0.5, 1, 2, 3, 4, 5, 6, 7};
+ v8f16 v8f16_b = (v8f16) {1.5, 2, 3, 4, 5, 6, 7, 8};
+ v8f16 v8f16_r;
+ v4f32 v4f32_a = (v4f32) {0.5, 1, 2, 3};
+ v4f32 v4f32_b = (v4f32) {1.5, 2, 3, 4};
+ v4f32 v4f32_r;
+ v2f64 v2f64_a = (v2f64) {0.5, 1};
+ v2f64 v2f64_b = (v2f64) {1.5, 2};
+ v2f64 v2f64_r;
+
+ int int_r;
+ long long ll_r;
+ int int_a = 0;
+
+ v16i8_r = __builtin_msa_add_a_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.add.a.b(
+ v8i16_r = __builtin_msa_add_a_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.add.a.h(
+ v4i32_r = __builtin_msa_add_a_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.add.a.w(
+ v2i64_r = __builtin_msa_add_a_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.add.a.d(
+
+ v16i8_r = __builtin_msa_adds_a_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.adds.a.b(
+ v8i16_r = __builtin_msa_adds_a_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.adds.a.h(
+ v4i32_r = __builtin_msa_adds_a_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.adds.a.w(
+ v2i64_r = __builtin_msa_adds_a_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.adds.a.d(
+
+ v16i8_r = __builtin_msa_adds_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.adds.s.b(
+ v8i16_r = __builtin_msa_adds_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.adds.s.h(
+ v4i32_r = __builtin_msa_adds_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.adds.s.w(
+ v2i64_r = __builtin_msa_adds_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.adds.s.d(
+
+ v16u8_r = __builtin_msa_adds_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.adds.u.b(
+ v8u16_r = __builtin_msa_adds_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.adds.u.h(
+ v4u32_r = __builtin_msa_adds_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.adds.u.w(
+ v2u64_r = __builtin_msa_adds_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.adds.u.d(
+
+ v16i8_r = __builtin_msa_addv_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.addv.b(
+ v8i16_r = __builtin_msa_addv_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.addv.h(
+ v4i32_r = __builtin_msa_addv_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.addv.w(
+ v2i64_r = __builtin_msa_addv_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.addv.d(
+
+ v16u8_r = __builtin_msa_addv_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.addv.b(
+ v8u16_r = __builtin_msa_addv_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.addv.h(
+ v4u32_r = __builtin_msa_addv_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.addv.w(
+ v2u64_r = __builtin_msa_addv_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.addv.d(
+
+ v16i8_r = __builtin_msa_addvi_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.addvi.b(
+ v8i16_r = __builtin_msa_addvi_h(v8i16_a, 25); // CHECK: call <8 x i16> @llvm.mips.addvi.h(
+ v4i32_r = __builtin_msa_addvi_w(v4i32_a, 25); // CHECK: call <4 x i32> @llvm.mips.addvi.w(
+ v2i64_r = __builtin_msa_addvi_d(v2i64_a, 25); // CHECK: call <2 x i64> @llvm.mips.addvi.d(
+
+ v16u8_r = __builtin_msa_addvi_b(v16u8_a, 25); // CHECK: call <16 x i8> @llvm.mips.addvi.b(
+ v8u16_r = __builtin_msa_addvi_h(v8u16_a, 25); // CHECK: call <8 x i16> @llvm.mips.addvi.h(
+ v4u32_r = __builtin_msa_addvi_w(v4u32_a, 25); // CHECK: call <4 x i32> @llvm.mips.addvi.w(
+ v2u64_r = __builtin_msa_addvi_d(v2u64_a, 25); // CHECK: call <2 x i64> @llvm.mips.addvi.d(
+
+ v16i8_r = __builtin_msa_and_v(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.and.v(
+ v8i16_r = __builtin_msa_and_v(v8i16_a, v8i16_b); // CHECK: call <16 x i8> @llvm.mips.and.v(
+ v4i32_r = __builtin_msa_and_v(v4i32_a, v4i32_b); // CHECK: call <16 x i8> @llvm.mips.and.v(
+ v2i64_r = __builtin_msa_and_v(v2i64_a, v2i64_b); // CHECK: call <16 x i8> @llvm.mips.and.v(
+
+ v16i8_r = __builtin_msa_andi_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.andi.b(
+ v8i16_r = __builtin_msa_andi_b(v8i16_a, 25); // CHECK: call <16 x i8> @llvm.mips.andi.b(
+ v4i32_r = __builtin_msa_andi_b(v4i32_a, 25); // CHECK: call <16 x i8> @llvm.mips.andi.b(
+ v2i64_r = __builtin_msa_andi_b(v2i64_a, 25); // CHECK: call <16 x i8> @llvm.mips.andi.b(
+
+ v16u8_r = __builtin_msa_andi_b(v16u8_a, 25); // CHECK: call <16 x i8> @llvm.mips.andi.b(
+ v8u16_r = __builtin_msa_andi_b(v8u16_a, 25); // CHECK: call <16 x i8> @llvm.mips.andi.b(
+ v4u32_r = __builtin_msa_andi_b(v4u32_a, 25); // CHECK: call <16 x i8> @llvm.mips.andi.b(
+ v2u64_r = __builtin_msa_andi_b(v2u64_a, 25); // CHECK: call <16 x i8> @llvm.mips.andi.b(
+
+ v16i8_r = __builtin_msa_asub_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.asub.s.b(
+ v8i16_r = __builtin_msa_asub_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.asub.s.h(
+ v4i32_r = __builtin_msa_asub_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.asub.s.w(
+ v2i64_r = __builtin_msa_asub_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.asub.s.d(
+
+ v16u8_r = __builtin_msa_asub_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.asub.u.b(
+ v8u16_r = __builtin_msa_asub_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.asub.u.h(
+ v4u32_r = __builtin_msa_asub_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.asub.u.w(
+ v2u64_r = __builtin_msa_asub_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.asub.u.d(
+
+ v16i8_r = __builtin_msa_ave_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.ave.s.b(
+ v8i16_r = __builtin_msa_ave_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.ave.s.h(
+ v4i32_r = __builtin_msa_ave_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.ave.s.w(
+ v2i64_r = __builtin_msa_ave_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.ave.s.d(
+
+ v16u8_r = __builtin_msa_ave_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.ave.u.b(
+ v8u16_r = __builtin_msa_ave_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.ave.u.h(
+ v4u32_r = __builtin_msa_ave_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.ave.u.w(
+ v2u64_r = __builtin_msa_ave_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.ave.u.d(
+
+ v16i8_r = __builtin_msa_aver_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.aver.s.b(
+ v8i16_r = __builtin_msa_aver_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.aver.s.h(
+ v4i32_r = __builtin_msa_aver_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.aver.s.w(
+ v2i64_r = __builtin_msa_aver_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.aver.s.d(
+
+ v16u8_r = __builtin_msa_aver_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.aver.u.b(
+ v8u16_r = __builtin_msa_aver_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.aver.u.h(
+ v4u32_r = __builtin_msa_aver_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.aver.u.w(
+ v2u64_r = __builtin_msa_aver_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.aver.u.d(
+
+ v16i8_r = __builtin_msa_bclr_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.bclr.b(
+ v8i16_r = __builtin_msa_bclr_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.bclr.h(
+ v4i32_r = __builtin_msa_bclr_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.bclr.w(
+ v2i64_r = __builtin_msa_bclr_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.bclr.d(
+
+ v16i8_r = __builtin_msa_bclri_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.bclri.b(
+ v8i16_r = __builtin_msa_bclri_h(v8i16_a, 25); // CHECK: call <8 x i16> @llvm.mips.bclri.h(
+ v4i32_r = __builtin_msa_bclri_w(v4i32_a, 25); // CHECK: call <4 x i32> @llvm.mips.bclri.w(
+ v2i64_r = __builtin_msa_bclri_d(v2i64_a, 25); // CHECK: call <2 x i64> @llvm.mips.bclri.d(
+
+ v16i8_r = __builtin_msa_binsl_b(v16i8_r, v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.binsl.b(
+ v8i16_r = __builtin_msa_binsl_h(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.binsl.h(
+ v4i32_r = __builtin_msa_binsl_w(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.binsl.w(
+ v2i64_r = __builtin_msa_binsl_d(v2i64_r, v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.binsl.d(
+
+ v16i8_r = __builtin_msa_binsli_b(v16i8_r, v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.binsli.b(
+ v8i16_r = __builtin_msa_binsli_h(v8i16_r, v8i16_a, 25); // CHECK: call <8 x i16> @llvm.mips.binsli.h(
+ v4i32_r = __builtin_msa_binsli_w(v4i32_r, v4i32_a, 25); // CHECK: call <4 x i32> @llvm.mips.binsli.w(
+ v2i64_r = __builtin_msa_binsli_d(v2i64_r, v2i64_a, 25); // CHECK: call <2 x i64> @llvm.mips.binsli.d(
+
+ v16i8_r = __builtin_msa_binsr_b(v16i8_r, v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.binsr.b(
+ v8i16_r = __builtin_msa_binsr_h(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.binsr.h(
+ v4i32_r = __builtin_msa_binsr_w(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.binsr.w(
+ v2i64_r = __builtin_msa_binsr_d(v2i64_r, v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.binsr.d(
+
+ v16i8_r = __builtin_msa_binsri_b(v16i8_r, v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.binsri.b(
+ v8i16_r = __builtin_msa_binsri_h(v8i16_r, v8i16_a, 25); // CHECK: call <8 x i16> @llvm.mips.binsri.h(
+ v4i32_r = __builtin_msa_binsri_w(v4i32_r, v4i32_a, 25); // CHECK: call <4 x i32> @llvm.mips.binsri.w(
+ v2i64_r = __builtin_msa_binsri_d(v2i64_r, v2i64_a, 25); // CHECK: call <2 x i64> @llvm.mips.binsri.d(
+
+ v16i8_r = __builtin_msa_bmnz_v(v16i8_r, v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.bmnz.v(
+ v8i16_r = __builtin_msa_bmnz_v(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <16 x i8> @llvm.mips.bmnz.v(
+ v4i32_r = __builtin_msa_bmnz_v(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <16 x i8> @llvm.mips.bmnz.v(
+ v2i64_r = __builtin_msa_bmnz_v(v2i64_r, v2i64_a, v2i64_b); // CHECK: call <16 x i8> @llvm.mips.bmnz.v(
+
+ v16i8_r = __builtin_msa_bmnzi_b(v16i8_r, v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.bmnzi.b(
+
+ v16i8_r = __builtin_msa_bmz_v(v16i8_r, v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.bmz.v(
+ v8i16_r = __builtin_msa_bmz_v(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <16 x i8> @llvm.mips.bmz.v(
+ v4i32_r = __builtin_msa_bmz_v(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <16 x i8> @llvm.mips.bmz.v(
+ v2i64_r = __builtin_msa_bmz_v(v2i64_r, v2i64_a, v2i64_b); // CHECK: call <16 x i8> @llvm.mips.bmz.v(
+
+ v16i8_r = __builtin_msa_bmzi_b(v16i8_r, v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.bmzi.b(
+
+ v16i8_r = __builtin_msa_bneg_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.bneg.b(
+ v8i16_r = __builtin_msa_bneg_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.bneg.h(
+ v4i32_r = __builtin_msa_bneg_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.bneg.w(
+ v2i64_r = __builtin_msa_bneg_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.bneg.d(
+
+ v16i8_r = __builtin_msa_bnegi_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.bnegi.b(
+ v8i16_r = __builtin_msa_bnegi_h(v8i16_a, 25); // CHECK: call <8 x i16> @llvm.mips.bnegi.h(
+ v4i32_r = __builtin_msa_bnegi_w(v4i32_a, 25); // CHECK: call <4 x i32> @llvm.mips.bnegi.w(
+ v2i64_r = __builtin_msa_bnegi_d(v2i64_a, 25); // CHECK: call <2 x i64> @llvm.mips.bnegi.d(
+
+ int_r = __builtin_msa_bnz_b(v16i8_a); // CHECK: call i32 @llvm.mips.bnz.b(
+ int_r = __builtin_msa_bnz_h(v16i8_a); // CHECK: call i32 @llvm.mips.bnz.h(
+ int_r = __builtin_msa_bnz_w(v16i8_a); // CHECK: call i32 @llvm.mips.bnz.w(
+ int_r = __builtin_msa_bnz_d(v16i8_a); // CHECK: call i32 @llvm.mips.bnz.d(
+
+ int_r = __builtin_msa_bnz_v(v16i8_a); // CHECK: call i32 @llvm.mips.bnz.v(
+
+ v16i8_r = __builtin_msa_bsel_v(v16i8_r, v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.bsel.v(
+ v8i16_r = __builtin_msa_bsel_v(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <16 x i8> @llvm.mips.bsel.v(
+ v4i32_r = __builtin_msa_bsel_v(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <16 x i8> @llvm.mips.bsel.v(
+ v2i64_r = __builtin_msa_bsel_v(v2i64_r, v2i64_a, v2i64_b); // CHECK: call <16 x i8> @llvm.mips.bsel.v(
+
+ v16i8_r = __builtin_msa_bseli_b(v16i8_r, v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.bseli.b(
+
+ v16i8_r = __builtin_msa_bset_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.bset.b(
+ v8i16_r = __builtin_msa_bset_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.bset.h(
+ v4i32_r = __builtin_msa_bset_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.bset.w(
+ v2i64_r = __builtin_msa_bset_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.bset.d(
+
+ v16i8_r = __builtin_msa_bseti_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.bseti.b(
+ v8i16_r = __builtin_msa_bseti_h(v8i16_a, 25); // CHECK: call <8 x i16> @llvm.mips.bseti.h(
+ v4i32_r = __builtin_msa_bseti_w(v4i32_a, 25); // CHECK: call <4 x i32> @llvm.mips.bseti.w(
+ v2i64_r = __builtin_msa_bseti_d(v2i64_a, 25); // CHECK: call <2 x i64> @llvm.mips.bseti.d(
+
+ int_r = __builtin_msa_bz_b(v16i8_a); // CHECK: call i32 @llvm.mips.bz.b(
+ int_r = __builtin_msa_bz_h(v16i8_a); // CHECK: call i32 @llvm.mips.bz.h(
+ int_r = __builtin_msa_bz_w(v16i8_a); // CHECK: call i32 @llvm.mips.bz.w(
+ int_r = __builtin_msa_bz_d(v16i8_a); // CHECK: call i32 @llvm.mips.bz.d(
+
+ int_r = __builtin_msa_bz_v(v16i8_a); // CHECK: call i32 @llvm.mips.bz.v(
+
+ v16i8_r = __builtin_msa_ceq_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.ceq.b(
+ v8i16_r = __builtin_msa_ceq_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.ceq.h(
+ v4i32_r = __builtin_msa_ceq_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.ceq.w(
+ v2i64_r = __builtin_msa_ceq_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.ceq.d(
+
+ v16i8_r = __builtin_msa_ceqi_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.ceqi.b(
+ v8i16_r = __builtin_msa_ceqi_h(v8i16_a, 25); // CHECK: call <8 x i16> @llvm.mips.ceqi.h(
+ v4i32_r = __builtin_msa_ceqi_w(v4i32_a, 25); // CHECK: call <4 x i32> @llvm.mips.ceqi.w(
+ v2i64_r = __builtin_msa_ceqi_d(v2i64_a, 25); // CHECK: call <2 x i64> @llvm.mips.ceqi.d(
+
+ int_r = __builtin_msa_cfcmsa(1); // CHECK: call i32 @llvm.mips.cfcmsa(
+
+ v16i8_r = __builtin_msa_cle_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.cle.s.b(
+ v8i16_r = __builtin_msa_cle_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.cle.s.h(
+ v4i32_r = __builtin_msa_cle_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.cle.s.w(
+ v2i64_r = __builtin_msa_cle_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.cle.s.d(
+
+ v16u8_r = __builtin_msa_cle_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.cle.u.b(
+ v8u16_r = __builtin_msa_cle_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.cle.u.h(
+ v4u32_r = __builtin_msa_cle_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.cle.u.w(
+ v2u64_r = __builtin_msa_cle_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.cle.u.d(
+
+ v16i8_r = __builtin_msa_clei_s_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.clei.s.b(
+ v8i16_r = __builtin_msa_clei_s_h(v8i16_a, 25); // CHECK: call <8 x i16> @llvm.mips.clei.s.h(
+ v4i32_r = __builtin_msa_clei_s_w(v4i32_a, 25); // CHECK: call <4 x i32> @llvm.mips.clei.s.w(
+ v2i64_r = __builtin_msa_clei_s_d(v2i64_a, 25); // CHECK: call <2 x i64> @llvm.mips.clei.s.d(
+
+ v16u8_r = __builtin_msa_clei_u_b(v16u8_a, 25); // CHECK: call <16 x i8> @llvm.mips.clei.u.b(
+ v8u16_r = __builtin_msa_clei_u_h(v8u16_a, 25); // CHECK: call <8 x i16> @llvm.mips.clei.u.h(
+ v4u32_r = __builtin_msa_clei_u_w(v4u32_a, 25); // CHECK: call <4 x i32> @llvm.mips.clei.u.w(
+ v2u64_r = __builtin_msa_clei_u_d(v2u64_a, 25); // CHECK: call <2 x i64> @llvm.mips.clei.u.d(
+
+ v16i8_r = __builtin_msa_clt_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.clt.s.b(
+ v8i16_r = __builtin_msa_clt_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.clt.s.h(
+ v4i32_r = __builtin_msa_clt_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.clt.s.w(
+ v2i64_r = __builtin_msa_clt_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.clt.s.d(
+
+ v16u8_r = __builtin_msa_clt_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.clt.u.b(
+ v8u16_r = __builtin_msa_clt_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.clt.u.h(
+ v4u32_r = __builtin_msa_clt_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.clt.u.w(
+ v2u64_r = __builtin_msa_clt_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.clt.u.d(
+
+ v16i8_r = __builtin_msa_clti_s_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.clti.s.b(
+ v8i16_r = __builtin_msa_clti_s_h(v8i16_a, 25); // CHECK: call <8 x i16> @llvm.mips.clti.s.h(
+ v4i32_r = __builtin_msa_clti_s_w(v4i32_a, 25); // CHECK: call <4 x i32> @llvm.mips.clti.s.w(
+ v2i64_r = __builtin_msa_clti_s_d(v2i64_a, 25); // CHECK: call <2 x i64> @llvm.mips.clti.s.d(
+
+ v16u8_r = __builtin_msa_clti_u_b(v16u8_a, 25); // CHECK: call <16 x i8> @llvm.mips.clti.u.b(
+ v8u16_r = __builtin_msa_clti_u_h(v8u16_a, 25); // CHECK: call <8 x i16> @llvm.mips.clti.u.h(
+ v4u32_r = __builtin_msa_clti_u_w(v4u32_a, 25); // CHECK: call <4 x i32> @llvm.mips.clti.u.w(
+ v2u64_r = __builtin_msa_clti_u_d(v2u64_a, 25); // CHECK: call <2 x i64> @llvm.mips.clti.u.d(
+
+ int_r = __builtin_msa_copy_s_b(v16i8_a, 1); // CHECK: call i32 @llvm.mips.copy.s.b(
+ int_r = __builtin_msa_copy_s_h(v8i16_a, 1); // CHECK: call i32 @llvm.mips.copy.s.h(
+ int_r = __builtin_msa_copy_s_w(v4i32_a, 1); // CHECK: call i32 @llvm.mips.copy.s.w(
+ ll_r = __builtin_msa_copy_s_d(v2i64_a, 1); // CHECK: call i64 @llvm.mips.copy.s.d(
+
+ int_r = __builtin_msa_copy_u_b(v16u8_a, 1); // CHECK: call i32 @llvm.mips.copy.u.b(
+ int_r = __builtin_msa_copy_u_h(v8u16_a, 1); // CHECK: call i32 @llvm.mips.copy.u.h(
+ int_r = __builtin_msa_copy_u_w(v4u32_a, 1); // CHECK: call i32 @llvm.mips.copy.u.w(
+ ll_r = __builtin_msa_copy_u_d(v2i64_a, 1); // CHECK: call i64 @llvm.mips.copy.u.d(
+
+ __builtin_msa_ctcmsa(1, int_a); // CHECK: call void @llvm.mips.ctcmsa(
+
+ v16i8_r = __builtin_msa_div_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.div.s.b(
+ v8i16_r = __builtin_msa_div_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.div.s.h(
+ v4i32_r = __builtin_msa_div_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.div.s.w(
+ v2i64_r = __builtin_msa_div_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.div.s.d(
+
+ v16u8_r = __builtin_msa_div_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.div.u.b(
+ v8u16_r = __builtin_msa_div_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.div.u.h(
+ v4u32_r = __builtin_msa_div_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.div.u.w(
+ v2u64_r = __builtin_msa_div_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.div.u.d(
+
+ v8i16_r = __builtin_msa_dotp_s_h(v16i8_a, v16i8_b); // CHECK: call <8 x i16> @llvm.mips.dotp.s.h(
+ v4i32_r = __builtin_msa_dotp_s_w(v8i16_a, v8i16_b); // CHECK: call <4 x i32> @llvm.mips.dotp.s.w(
+ v2i64_r = __builtin_msa_dotp_s_d(v4i32_a, v4i32_b); // CHECK: call <2 x i64> @llvm.mips.dotp.s.d(
+
+ v8u16_r = __builtin_msa_dotp_u_h(v16u8_a, v16u8_b); // CHECK: call <8 x i16> @llvm.mips.dotp.u.h(
+ v4u32_r = __builtin_msa_dotp_u_w(v8u16_a, v8u16_b); // CHECK: call <4 x i32> @llvm.mips.dotp.u.w(
+ v2u64_r = __builtin_msa_dotp_u_d(v4u32_a, v4u32_b); // CHECK: call <2 x i64> @llvm.mips.dotp.u.d(
+
+ v8i16_r = __builtin_msa_dpadd_s_h(v8i16_r, v16i8_a, v16i8_b); // CHECK: call <8 x i16> @llvm.mips.dpadd.s.h(
+ v4i32_r = __builtin_msa_dpadd_s_w(v4i32_r, v8i16_a, v8i16_b); // CHECK: call <4 x i32> @llvm.mips.dpadd.s.w(
+ v2i64_r = __builtin_msa_dpadd_s_d(v2i64_r, v4i32_a, v4i32_b); // CHECK: call <2 x i64> @llvm.mips.dpadd.s.d(
+
+ v8u16_r = __builtin_msa_dpadd_u_h(v8u16_r, v16u8_a, v16u8_b); // CHECK: call <8 x i16> @llvm.mips.dpadd.u.h(
+ v4u32_r = __builtin_msa_dpadd_u_w(v4u32_r, v8u16_a, v8u16_b); // CHECK: call <4 x i32> @llvm.mips.dpadd.u.w(
+ v2u64_r = __builtin_msa_dpadd_u_d(v2u64_r, v4u32_a, v4u32_b); // CHECK: call <2 x i64> @llvm.mips.dpadd.u.d(
+
+ v8i16_r = __builtin_msa_dpsub_s_h(v8i16_r, v16i8_a, v16i8_b); // CHECK: call <8 x i16> @llvm.mips.dpsub.s.h(
+ v4i32_r = __builtin_msa_dpsub_s_w(v4i32_r, v8i16_a, v8i16_b); // CHECK: call <4 x i32> @llvm.mips.dpsub.s.w(
+ v2i64_r = __builtin_msa_dpsub_s_d(v2i64_r, v4i32_a, v4i32_b); // CHECK: call <2 x i64> @llvm.mips.dpsub.s.d(
+
+ v8u16_r = __builtin_msa_dpsub_u_h(v8u16_r, v16u8_a, v16u8_b); // CHECK: call <8 x i16> @llvm.mips.dpsub.u.h(
+ v4u32_r = __builtin_msa_dpsub_u_w(v4u32_r, v8u16_a, v8u16_b); // CHECK: call <4 x i32> @llvm.mips.dpsub.u.w(
+ v2u64_r = __builtin_msa_dpsub_u_d(v2u64_r, v4u32_a, v4u32_b); // CHECK: call <2 x i64> @llvm.mips.dpsub.u.d(
+
+ v4f32_r = __builtin_msa_fadd_w(v4f32_a, v4f32_b); // CHECK: call <4 x float> @llvm.mips.fadd.w(
+ v2f64_r = __builtin_msa_fadd_d(v2f64_a, v2f64_b); // CHECK: call <2 x double> @llvm.mips.fadd.d(
+
+ v4i32_r = __builtin_msa_fcaf_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fcaf.w(
+ v2i64_r = __builtin_msa_fcaf_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fcaf.d(
+
+ v4i32_r = __builtin_msa_fceq_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fceq.w(
+ v2i64_r = __builtin_msa_fceq_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fceq.d(
+
+ v4i32_r = __builtin_msa_fclass_w(v4f32_a); // CHECK: call <4 x i32> @llvm.mips.fclass.w(
+ v2i64_r = __builtin_msa_fclass_d(v2f64_a); // CHECK: call <2 x i64> @llvm.mips.fclass.d(
+
+ v4i32_r = __builtin_msa_fcle_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fcle.w(
+ v2i64_r = __builtin_msa_fcle_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fcle.d(
+
+ v4i32_r = __builtin_msa_fclt_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fclt.w(
+ v2i64_r = __builtin_msa_fclt_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fclt.d(
+
+ v4i32_r = __builtin_msa_fcne_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fcne.w(
+ v2i64_r = __builtin_msa_fcne_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fcne.d(
+
+ v4i32_r = __builtin_msa_fcor_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fcor.w(
+ v2i64_r = __builtin_msa_fcor_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fcor.d(
+
+ v4i32_r = __builtin_msa_fcueq_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fcueq.w(
+ v2i64_r = __builtin_msa_fcueq_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fcueq.d(
+
+ v4i32_r = __builtin_msa_fcule_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fcule.w(
+ v2i64_r = __builtin_msa_fcule_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fcule.d(
+
+ v4i32_r = __builtin_msa_fcult_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fcult.w(
+ v2i64_r = __builtin_msa_fcult_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fcult.d(
+
+ v4i32_r = __builtin_msa_fcun_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fcun.w(
+ v2i64_r = __builtin_msa_fcun_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fcun.d(
+
+ v4i32_r = __builtin_msa_fcune_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fcune.w(
+ v2i64_r = __builtin_msa_fcune_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fcune.d(
+
+ v4f32_r = __builtin_msa_fdiv_w(v4f32_a, v4f32_b); // CHECK: call <4 x float> @llvm.mips.fdiv.w(
+ v2f64_r = __builtin_msa_fdiv_d(v2f64_a, v2f64_b); // CHECK: call <2 x double> @llvm.mips.fdiv.d(
+
+ v8f16_r = __builtin_msa_fexdo_h(v4f32_a, v4f32_b); // CHECK: call <8 x half> @llvm.mips.fexdo.h(
+ v4f32_r = __builtin_msa_fexdo_w(v2f64_a, v2f64_b); // CHECK: call <4 x float> @llvm.mips.fexdo.w(
+
+ v4f32_r = __builtin_msa_fexp2_w(v4f32_a, v4i32_b); // CHECK: call <4 x float> @llvm.mips.fexp2.w(
+ v2f64_r = __builtin_msa_fexp2_d(v2f64_a, v2i64_b); // CHECK: call <2 x double> @llvm.mips.fexp2.d(
+
+ v4f32_r = __builtin_msa_fexupl_w(v8f16_a); // CHECK: call <4 x float> @llvm.mips.fexupl.w(
+ v2f64_r = __builtin_msa_fexupl_d(v4f32_a); // CHECK: call <2 x double> @llvm.mips.fexupl.d(
+
+ v4f32_r = __builtin_msa_fexupr_w(v8f16_a); // CHECK: call <4 x float> @llvm.mips.fexupr.w(
+ v2f64_r = __builtin_msa_fexupr_d(v4f32_a); // CHECK: call <2 x double> @llvm.mips.fexupr.d(
+
+ v4f32_r = __builtin_msa_ffint_s_w(v4i32_a); // CHECK: call <4 x float> @llvm.mips.ffint.s.w(
+ v2f64_r = __builtin_msa_ffint_s_d(v2i64_a); // CHECK: call <2 x double> @llvm.mips.ffint.s.d(
+
+ v4f32_r = __builtin_msa_ffint_u_w(v4i32_a); // CHECK: call <4 x float> @llvm.mips.ffint.u.w(
+ v2f64_r = __builtin_msa_ffint_u_d(v2i64_a); // CHECK: call <2 x double> @llvm.mips.ffint.u.d(
+
+ v4f32_r = __builtin_msa_ffql_w(v8i16_a); // CHECK: call <4 x float> @llvm.mips.ffql.w(
+ v2f64_r = __builtin_msa_ffql_d(v4i32_a); // CHECK: call <2 x double> @llvm.mips.ffql.d(
+
+ v4f32_r = __builtin_msa_ffqr_w(v8i16_a); // CHECK: call <4 x float> @llvm.mips.ffqr.w(
+ v2f64_r = __builtin_msa_ffqr_d(v4i32_a); // CHECK: call <2 x double> @llvm.mips.ffqr.d(
+
+ v16i8_r = __builtin_msa_fill_b(3); // CHECK: call <16 x i8> @llvm.mips.fill.b(
+ v8i16_r = __builtin_msa_fill_h(3); // CHECK: call <8 x i16> @llvm.mips.fill.h(
+ v4i32_r = __builtin_msa_fill_w(3); // CHECK: call <4 x i32> @llvm.mips.fill.w(
+ v2i64_r = __builtin_msa_fill_d(3); // CHECK: call <2 x i64> @llvm.mips.fill.d(
+
+ v4f32_r = __builtin_msa_flog2_w(v8f16_a); // CHECK: call <4 x float> @llvm.mips.flog2.w(
+ v2f64_r = __builtin_msa_flog2_d(v4f32_a); // CHECK: call <2 x double> @llvm.mips.flog2.d(
+
+ v4f32_r = __builtin_msa_fmadd_w(v8f16_r, v8f16_a, v8f16_b); // CHECK: call <4 x float> @llvm.mips.fmadd.w(
+ v2f64_r = __builtin_msa_fmadd_d(v4f32_r, v4f32_a, v4f32_b); // CHECK: call <2 x double> @llvm.mips.fmadd.d(
+
+ v4f32_r = __builtin_msa_fmax_w(v4f32_a, v4f32_b); // CHECK: call <4 x float> @llvm.mips.fmax.w(
+ v2f64_r = __builtin_msa_fmax_d(v2f64_a, v2f64_b); // CHECK: call <2 x double> @llvm.mips.fmax.d(
+
+ v4f32_r = __builtin_msa_fmax_a_w(v4f32_a, v4f32_b); // CHECK: call <4 x float> @llvm.mips.fmax.a.w(
+ v2f64_r = __builtin_msa_fmax_a_d(v2f64_a, v2f64_b); // CHECK: call <2 x double> @llvm.mips.fmax.a.d(
+
+ v4f32_r = __builtin_msa_fmin_w(v4f32_a, v4f32_b); // CHECK: call <4 x float> @llvm.mips.fmin.w(
+ v2f64_r = __builtin_msa_fmin_d(v2f64_a, v2f64_b); // CHECK: call <2 x double> @llvm.mips.fmin.d(
+
+ v4f32_r = __builtin_msa_fmin_a_w(v4f32_a, v4f32_b); // CHECK: call <4 x float> @llvm.mips.fmin.a.w(
+ v2f64_r = __builtin_msa_fmin_a_d(v2f64_a, v2f64_b); // CHECK: call <2 x double> @llvm.mips.fmin.a.d(
+
+ v4f32_r = __builtin_msa_fmsub_w(v8f16_r, v8f16_a, v8f16_b); // CHECK: call <4 x float> @llvm.mips.fmsub.w(
+ v2f64_r = __builtin_msa_fmsub_d(v4f32_r, v4f32_a, v4f32_b); // CHECK: call <2 x double> @llvm.mips.fmsub.d(
+
+ v4f32_r = __builtin_msa_fmul_w(v4f32_a, v4f32_b); // CHECK: call <4 x float> @llvm.mips.fmul.w(
+ v2f64_r = __builtin_msa_fmul_d(v2f64_a, v2f64_b); // CHECK: call <2 x double> @llvm.mips.fmul.d(
+
+ v4f32_r = __builtin_msa_frint_w(v8f16_a); // CHECK: call <4 x float> @llvm.mips.frint.w(
+ v2f64_r = __builtin_msa_frint_d(v4f32_a); // CHECK: call <2 x double> @llvm.mips.frint.d(
+
+ v4f32_r = __builtin_msa_frcp_w(v8f16_a); // CHECK: call <4 x float> @llvm.mips.frcp.w(
+ v2f64_r = __builtin_msa_frcp_d(v4f32_a); // CHECK: call <2 x double> @llvm.mips.frcp.d(
+
+ v4f32_r = __builtin_msa_frsqrt_w(v8f16_a); // CHECK: call <4 x float> @llvm.mips.frsqrt.w(
+ v2f64_r = __builtin_msa_frsqrt_d(v4f32_a); // CHECK: call <2 x double> @llvm.mips.frsqrt.d(
+
+ v4i32_r = __builtin_msa_fseq_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fseq.w(
+ v2i64_r = __builtin_msa_fseq_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fseq.d(
+
+ v4i32_r = __builtin_msa_fsaf_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fsaf.w(
+ v2i64_r = __builtin_msa_fsaf_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fsaf.d(
+
+ v4i32_r = __builtin_msa_fsle_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fsle.w(
+ v2i64_r = __builtin_msa_fsle_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fsle.d(
+
+ v4i32_r = __builtin_msa_fslt_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fslt.w(
+ v2i64_r = __builtin_msa_fslt_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fslt.d(
+
+ v4i32_r = __builtin_msa_fsne_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fsne.w(
+ v2i64_r = __builtin_msa_fsne_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fsne.d(
+
+ v4i32_r = __builtin_msa_fsor_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fsor.w(
+ v2i64_r = __builtin_msa_fsor_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fsor.d(
+
+ v4f32_r = __builtin_msa_fsqrt_w(v8f16_a); // CHECK: call <4 x float> @llvm.mips.fsqrt.w(
+ v2f64_r = __builtin_msa_fsqrt_d(v4f32_a); // CHECK: call <2 x double> @llvm.mips.fsqrt.d(
+
+ v4f32_r = __builtin_msa_fsub_w(v4f32_a, v4f32_b); // CHECK: call <4 x float> @llvm.mips.fsub.w(
+ v2f64_r = __builtin_msa_fsub_d(v2f64_a, v2f64_b); // CHECK: call <2 x double> @llvm.mips.fsub.d(
+
+ v4i32_r = __builtin_msa_fsueq_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fsueq.w(
+ v2i64_r = __builtin_msa_fsueq_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fsueq.d(
+
+ v4i32_r = __builtin_msa_fsule_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fsule.w(
+ v2i64_r = __builtin_msa_fsule_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fsule.d(
+
+ v4i32_r = __builtin_msa_fsult_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fsult.w(
+ v2i64_r = __builtin_msa_fsult_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fsult.d(
+
+ v4i32_r = __builtin_msa_fsun_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fsun.w(
+ v2i64_r = __builtin_msa_fsun_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fsun.d(
+
+ v4i32_r = __builtin_msa_fsune_w(v4f32_a, v4f32_b); // CHECK: call <4 x i32> @llvm.mips.fsune.w(
+ v2i64_r = __builtin_msa_fsune_d(v2f64_a, v2f64_b); // CHECK: call <2 x i64> @llvm.mips.fsune.d(
+
+ v4i32_r = __builtin_msa_ftint_s_w(v4f32_a); // CHECK: call <4 x i32> @llvm.mips.ftint.s.w(
+ v2i64_r = __builtin_msa_ftint_s_d(v2f64_a); // CHECK: call <2 x i64> @llvm.mips.ftint.s.d(
+
+ v4i32_r = __builtin_msa_ftint_u_w(v4f32_a); // CHECK: call <4 x i32> @llvm.mips.ftint.u.w(
+ v2i64_r = __builtin_msa_ftint_u_d(v2f64_a); // CHECK: call <2 x i64> @llvm.mips.ftint.u.d(
+
+ v8i16_r = __builtin_msa_ftq_h(v4f32_a, v4f32_b); // CHECK: call <8 x i16> @llvm.mips.ftq.h(
+ v4i32_r = __builtin_msa_ftq_w(v2f64_a, v2f64_b); // CHECK: call <4 x i32> @llvm.mips.ftq.w(
+
+ v4i32_r = __builtin_msa_ftrunc_s_w(v4f32_a); // CHECK: call <4 x i32> @llvm.mips.ftrunc.s.w(
+ v2i64_r = __builtin_msa_ftrunc_s_d(v2f64_a); // CHECK: call <2 x i64> @llvm.mips.ftrunc.s.d(
+
+ v4i32_r = __builtin_msa_ftrunc_u_w(v4f32_a); // CHECK: call <4 x i32> @llvm.mips.ftrunc.u.w(
+ v2i64_r = __builtin_msa_ftrunc_u_d(v2f64_a); // CHECK: call <2 x i64> @llvm.mips.ftrunc.u.d(
+
+ v8i16_r = __builtin_msa_hadd_s_h(v16i8_a, v16i8_b); // CHECK: call <8 x i16> @llvm.mips.hadd.s.h(
+ v4i32_r = __builtin_msa_hadd_s_w(v8i16_a, v8i16_b); // CHECK: call <4 x i32> @llvm.mips.hadd.s.w(
+ v2i64_r = __builtin_msa_hadd_s_d(v4i32_a, v4i32_b); // CHECK: call <2 x i64> @llvm.mips.hadd.s.d(
+
+ v8u16_r = __builtin_msa_hadd_u_h(v16u8_a, v16u8_b); // CHECK: call <8 x i16> @llvm.mips.hadd.u.h(
+ v4u32_r = __builtin_msa_hadd_u_w(v8u16_a, v8u16_b); // CHECK: call <4 x i32> @llvm.mips.hadd.u.w(
+ v2u64_r = __builtin_msa_hadd_u_d(v4u32_a, v4u32_b); // CHECK: call <2 x i64> @llvm.mips.hadd.u.d(
+
+ v8i16_r = __builtin_msa_hsub_s_h(v16i8_a, v16i8_b); // CHECK: call <8 x i16> @llvm.mips.hsub.s.h(
+ v4i32_r = __builtin_msa_hsub_s_w(v8i16_a, v8i16_b); // CHECK: call <4 x i32> @llvm.mips.hsub.s.w(
+ v2i64_r = __builtin_msa_hsub_s_d(v4i32_a, v4i32_b); // CHECK: call <2 x i64> @llvm.mips.hsub.s.d(
+
+ v8u16_r = __builtin_msa_hsub_u_h(v16u8_a, v16u8_b); // CHECK: call <8 x i16> @llvm.mips.hsub.u.h(
+ v4u32_r = __builtin_msa_hsub_u_w(v8u16_a, v8u16_b); // CHECK: call <4 x i32> @llvm.mips.hsub.u.w(
+ v2u64_r = __builtin_msa_hsub_u_d(v4u32_a, v4u32_b); // CHECK: call <2 x i64> @llvm.mips.hsub.u.d(
+
+ v16i8_r = __builtin_msa_ilvev_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.ilvev.b(
+ v8i16_r = __builtin_msa_ilvev_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.ilvev.h(
+ v4i32_r = __builtin_msa_ilvev_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.ilvev.w(
+ v2i64_r = __builtin_msa_ilvev_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.ilvev.d(
+
+ v16i8_r = __builtin_msa_ilvl_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.ilvl.b(
+ v8i16_r = __builtin_msa_ilvl_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.ilvl.h(
+ v4i32_r = __builtin_msa_ilvl_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.ilvl.w(
+ v2i64_r = __builtin_msa_ilvl_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.ilvl.d(
+
+ v16i8_r = __builtin_msa_ilvod_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.ilvod.b(
+ v8i16_r = __builtin_msa_ilvod_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.ilvod.h(
+ v4i32_r = __builtin_msa_ilvod_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.ilvod.w(
+ v2i64_r = __builtin_msa_ilvod_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.ilvod.d(
+
+ v16i8_r = __builtin_msa_ilvr_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.ilvr.b(
+ v8i16_r = __builtin_msa_ilvr_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.ilvr.h(
+ v4i32_r = __builtin_msa_ilvr_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.ilvr.w(
+ v2i64_r = __builtin_msa_ilvr_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.ilvr.d(
+
+ v16i8_r = __builtin_msa_insert_b(v16i8_r, 1, 25); // CHECK: call <16 x i8> @llvm.mips.insert.b(
+ v8i16_r = __builtin_msa_insert_h(v8i16_r, 1, 25); // CHECK: call <8 x i16> @llvm.mips.insert.h(
+ v4i32_r = __builtin_msa_insert_w(v4i32_r, 1, 25); // CHECK: call <4 x i32> @llvm.mips.insert.w(
+ v2i64_r = __builtin_msa_insert_d(v2i64_r, 1, 25); // CHECK: call <2 x i64> @llvm.mips.insert.d(
+
+ v16i8_r = __builtin_msa_insve_b(v16i8_r, 1, v16i8_a); // CHECK: call <16 x i8> @llvm.mips.insve.b(
+ v8i16_r = __builtin_msa_insve_h(v8i16_r, 1, v8i16_a); // CHECK: call <8 x i16> @llvm.mips.insve.h(
+ v4i32_r = __builtin_msa_insve_w(v4i32_r, 1, v4i32_a); // CHECK: call <4 x i32> @llvm.mips.insve.w(
+ v2i64_r = __builtin_msa_insve_d(v2i64_r, 1, v2i64_a); // CHECK: call <2 x i64> @llvm.mips.insve.d(
+
+ v16i8_r = __builtin_msa_ld_b(&v16i8_a, 1); // CHECK: call <16 x i8> @llvm.mips.ld.b(
+ v8i16_r = __builtin_msa_ld_h(&v8i16_a, 2); // CHECK: call <8 x i16> @llvm.mips.ld.h(
+ v4i32_r = __builtin_msa_ld_w(&v4i32_a, 4); // CHECK: call <4 x i32> @llvm.mips.ld.w(
+ v2i64_r = __builtin_msa_ld_d(&v2i64_a, 8); // CHECK: call <2 x i64> @llvm.mips.ld.d(
+
+ v16i8_r = __builtin_msa_ldi_b(3); // CHECK: call <16 x i8> @llvm.mips.ldi.b(
+ v8i16_r = __builtin_msa_ldi_h(3); // CHECK: call <8 x i16> @llvm.mips.ldi.h(
+ v4i32_r = __builtin_msa_ldi_w(3); // CHECK: call <4 x i32> @llvm.mips.ldi.w(
+ v2i64_r = __builtin_msa_ldi_d(3); // CHECK: call <2 x i64> @llvm.mips.ldi.d(
+
+ v8i16_r = __builtin_msa_madd_q_h(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.madd.q.h(
+ v4i32_r = __builtin_msa_madd_q_w(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.madd.q.w(
+
+ v8i16_r = __builtin_msa_maddr_q_h(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.maddr.q.h(
+ v4i32_r = __builtin_msa_maddr_q_w(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.maddr.q.w(
+
+ v16i8_r = __builtin_msa_maddv_b(v16i8_r, v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.maddv.b(
+ v8i16_r = __builtin_msa_maddv_h(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.maddv.h(
+ v4i32_r = __builtin_msa_maddv_w(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.maddv.w(
+ v2i64_r = __builtin_msa_maddv_d(v2i64_r, v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.maddv.d(
+
+ v16i8_r = __builtin_msa_max_a_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.max.a.b(
+ v8i16_r = __builtin_msa_max_a_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.max.a.h(
+ v4i32_r = __builtin_msa_max_a_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.max.a.w(
+ v2i64_r = __builtin_msa_max_a_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.max.a.d(
+
+ v16i8_r = __builtin_msa_max_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.max.s.b(
+ v8i16_r = __builtin_msa_max_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.max.s.h(
+ v4i32_r = __builtin_msa_max_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.max.s.w(
+ v2i64_r = __builtin_msa_max_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.max.s.d(
+
+ v16u8_r = __builtin_msa_max_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.max.u.b(
+ v8u16_r = __builtin_msa_max_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.max.u.h(
+ v4u32_r = __builtin_msa_max_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.max.u.w(
+ v2u64_r = __builtin_msa_max_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.max.u.d(
+
+ v16i8_r = __builtin_msa_maxi_s_b(v16i8_a, 2); // CHECK: call <16 x i8> @llvm.mips.maxi.s.b(
+ v8i16_r = __builtin_msa_maxi_s_h(v8i16_a, 2); // CHECK: call <8 x i16> @llvm.mips.maxi.s.h(
+ v4i32_r = __builtin_msa_maxi_s_w(v4i32_a, 2); // CHECK: call <4 x i32> @llvm.mips.maxi.s.w(
+ v2i64_r = __builtin_msa_maxi_s_d(v2i64_a, 2); // CHECK: call <2 x i64> @llvm.mips.maxi.s.d(
+
+ v16u8_r = __builtin_msa_maxi_u_b(v16u8_a, 2); // CHECK: call <16 x i8> @llvm.mips.maxi.u.b(
+ v8u16_r = __builtin_msa_maxi_u_h(v8u16_a, 2); // CHECK: call <8 x i16> @llvm.mips.maxi.u.h(
+ v4u32_r = __builtin_msa_maxi_u_w(v4u32_a, 2); // CHECK: call <4 x i32> @llvm.mips.maxi.u.w(
+ v2u64_r = __builtin_msa_maxi_u_d(v2u64_a, 2); // CHECK: call <2 x i64> @llvm.mips.maxi.u.d(
+
+ v16i8_r = __builtin_msa_min_a_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.min.a.b(
+ v8i16_r = __builtin_msa_min_a_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.min.a.h(
+ v4i32_r = __builtin_msa_min_a_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.min.a.w(
+ v2i64_r = __builtin_msa_min_a_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.min.a.d(
+
+ v16i8_r = __builtin_msa_min_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.min.s.b(
+ v8i16_r = __builtin_msa_min_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.min.s.h(
+ v4i32_r = __builtin_msa_min_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.min.s.w(
+ v2i64_r = __builtin_msa_min_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.min.s.d(
+
+ v16u8_r = __builtin_msa_min_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.min.u.b(
+ v8u16_r = __builtin_msa_min_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.min.u.h(
+ v4u32_r = __builtin_msa_min_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.min.u.w(
+ v2u64_r = __builtin_msa_min_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.min.u.d(
+
+ v16i8_r = __builtin_msa_mini_s_b(v16i8_a, 2); // CHECK: call <16 x i8> @llvm.mips.mini.s.b(
+ v8i16_r = __builtin_msa_mini_s_h(v8i16_a, 2); // CHECK: call <8 x i16> @llvm.mips.mini.s.h(
+ v4i32_r = __builtin_msa_mini_s_w(v4i32_a, 2); // CHECK: call <4 x i32> @llvm.mips.mini.s.w(
+ v2i64_r = __builtin_msa_mini_s_d(v2i64_a, 2); // CHECK: call <2 x i64> @llvm.mips.mini.s.d(
+
+ v16u8_r = __builtin_msa_mini_u_b(v16u8_a, 2); // CHECK: call <16 x i8> @llvm.mips.mini.u.b(
+ v8u16_r = __builtin_msa_mini_u_h(v8u16_a, 2); // CHECK: call <8 x i16> @llvm.mips.mini.u.h(
+ v4u32_r = __builtin_msa_mini_u_w(v4u32_a, 2); // CHECK: call <4 x i32> @llvm.mips.mini.u.w(
+ v2u64_r = __builtin_msa_mini_u_d(v2u64_a, 2); // CHECK: call <2 x i64> @llvm.mips.mini.u.d(
+
+ v16i8_r = __builtin_msa_mod_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.mod.s.b(
+ v8i16_r = __builtin_msa_mod_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.mod.s.h(
+ v4i32_r = __builtin_msa_mod_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.mod.s.w(
+ v2i64_r = __builtin_msa_mod_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.mod.s.d(
+
+ v16u8_r = __builtin_msa_mod_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.mod.u.b(
+ v8u16_r = __builtin_msa_mod_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.mod.u.h(
+ v4u32_r = __builtin_msa_mod_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.mod.u.w(
+ v2u64_r = __builtin_msa_mod_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.mod.u.d(
+
+ v16i8_r = __builtin_msa_move_v(v16i8_a); // CHECK: call <16 x i8> @llvm.mips.move.v(
+
+ v8i16_r = __builtin_msa_msub_q_h(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.msub.q.h(
+ v4i32_r = __builtin_msa_msub_q_w(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.msub.q.w(
+
+ v8i16_r = __builtin_msa_msubr_q_h(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.msubr.q.h(
+ v4i32_r = __builtin_msa_msubr_q_w(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.msubr.q.w(
+
+ v16i8_r = __builtin_msa_msubv_b(v16i8_r, v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.msubv.b(
+ v8i16_r = __builtin_msa_msubv_h(v8i16_r, v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.msubv.h(
+ v4i32_r = __builtin_msa_msubv_w(v4i32_r, v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.msubv.w(
+ v2i64_r = __builtin_msa_msubv_d(v2i64_r, v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.msubv.d(
+
+ v8i16_r = __builtin_msa_mul_q_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.mul.q.h(
+ v4i32_r = __builtin_msa_mul_q_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.mul.q.w(
+
+ v8i16_r = __builtin_msa_mulr_q_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.mulr.q.h(
+ v4i32_r = __builtin_msa_mulr_q_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.mulr.q.w(
+
+ v16i8_r = __builtin_msa_mulv_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.mulv.b(
+ v8i16_r = __builtin_msa_mulv_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.mulv.h(
+ v4i32_r = __builtin_msa_mulv_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.mulv.w(
+ v2i64_r = __builtin_msa_mulv_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.mulv.d(
+
+ v16i8_r = __builtin_msa_nloc_b(v16i8_a); // CHECK: call <16 x i8> @llvm.mips.nloc.b(
+ v8i16_r = __builtin_msa_nloc_h(v8i16_a); // CHECK: call <8 x i16> @llvm.mips.nloc.h(
+ v4i32_r = __builtin_msa_nloc_w(v4i32_a); // CHECK: call <4 x i32> @llvm.mips.nloc.w(
+ v2i64_r = __builtin_msa_nloc_d(v2i64_a); // CHECK: call <2 x i64> @llvm.mips.nloc.d(
+
+ v16i8_r = __builtin_msa_nlzc_b(v16i8_a); // CHECK: call <16 x i8> @llvm.mips.nlzc.b(
+ v8i16_r = __builtin_msa_nlzc_h(v8i16_a); // CHECK: call <8 x i16> @llvm.mips.nlzc.h(
+ v4i32_r = __builtin_msa_nlzc_w(v4i32_a); // CHECK: call <4 x i32> @llvm.mips.nlzc.w(
+ v2i64_r = __builtin_msa_nlzc_d(v2i64_a); // CHECK: call <2 x i64> @llvm.mips.nlzc.d(
+
+ v16i8_r = __builtin_msa_nor_v(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.nor.v(
+ v8i16_r = __builtin_msa_nor_v(v8i16_a, v8i16_b); // CHECK: call <16 x i8> @llvm.mips.nor.v(
+ v4i32_r = __builtin_msa_nor_v(v4i32_a, v4i32_b); // CHECK: call <16 x i8> @llvm.mips.nor.v(
+ v2i64_r = __builtin_msa_nor_v(v2i64_a, v2i64_b); // CHECK: call <16 x i8> @llvm.mips.nor.v(
+
+ v16i8_r = __builtin_msa_nori_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.nori.b(
+ v8i16_r = __builtin_msa_nori_b(v8i16_a, 25); // CHECK: call <16 x i8> @llvm.mips.nori.b(
+ v4i32_r = __builtin_msa_nori_b(v4i32_a, 25); // CHECK: call <16 x i8> @llvm.mips.nori.b(
+ v2i64_r = __builtin_msa_nori_b(v2i64_a, 25); // CHECK: call <16 x i8> @llvm.mips.nori.b(
+
+ v16u8_r = __builtin_msa_nori_b(v16u8_a, 25); // CHECK: call <16 x i8> @llvm.mips.nori.b(
+ v8u16_r = __builtin_msa_nori_b(v8u16_a, 25); // CHECK: call <16 x i8> @llvm.mips.nori.b(
+ v4u32_r = __builtin_msa_nori_b(v4u32_a, 25); // CHECK: call <16 x i8> @llvm.mips.nori.b(
+ v2u64_r = __builtin_msa_nori_b(v2u64_a, 25); // CHECK: call <16 x i8> @llvm.mips.nori.b(
+
+ v16i8_r = __builtin_msa_or_v(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.or.v(
+ v8i16_r = __builtin_msa_or_v(v8i16_a, v8i16_b); // CHECK: call <16 x i8> @llvm.mips.or.v(
+ v4i32_r = __builtin_msa_or_v(v4i32_a, v4i32_b); // CHECK: call <16 x i8> @llvm.mips.or.v(
+ v2i64_r = __builtin_msa_or_v(v2i64_a, v2i64_b); // CHECK: call <16 x i8> @llvm.mips.or.v(
+
+ v16i8_r = __builtin_msa_ori_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.ori.b(
+ v8i16_r = __builtin_msa_ori_b(v8i16_a, 25); // CHECK: call <16 x i8> @llvm.mips.ori.b(
+ v4i32_r = __builtin_msa_ori_b(v4i32_a, 25); // CHECK: call <16 x i8> @llvm.mips.ori.b(
+ v2i64_r = __builtin_msa_ori_b(v2i64_a, 25); // CHECK: call <16 x i8> @llvm.mips.ori.b(
+
+ v16u8_r = __builtin_msa_ori_b(v16u8_a, 25); // CHECK: call <16 x i8> @llvm.mips.ori.b(
+ v8u16_r = __builtin_msa_ori_b(v8u16_a, 25); // CHECK: call <16 x i8> @llvm.mips.ori.b(
+ v4u32_r = __builtin_msa_ori_b(v4u32_a, 25); // CHECK: call <16 x i8> @llvm.mips.ori.b(
+ v2u64_r = __builtin_msa_ori_b(v2u64_a, 25); // CHECK: call <16 x i8> @llvm.mips.ori.b(
+
+ v16i8_r = __builtin_msa_pckev_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.pckev.b(
+ v8i16_r = __builtin_msa_pckev_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.pckev.h(
+ v4i32_r = __builtin_msa_pckev_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.pckev.w(
+ v2i64_r = __builtin_msa_pckev_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.pckev.d(
+
+ v16i8_r = __builtin_msa_pckod_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.pckod.b(
+ v8i16_r = __builtin_msa_pckod_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.pckod.h(
+ v4i32_r = __builtin_msa_pckod_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.pckod.w(
+ v2i64_r = __builtin_msa_pckod_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.pckod.d(
+
+ v16i8_r = __builtin_msa_pcnt_b(v16i8_a); // CHECK: call <16 x i8> @llvm.mips.pcnt.b(
+ v8i16_r = __builtin_msa_pcnt_h(v8i16_a); // CHECK: call <8 x i16> @llvm.mips.pcnt.h(
+ v4i32_r = __builtin_msa_pcnt_w(v4i32_a); // CHECK: call <4 x i32> @llvm.mips.pcnt.w(
+ v2i64_r = __builtin_msa_pcnt_d(v2i64_a); // CHECK: call <2 x i64> @llvm.mips.pcnt.d(
+
+ v16i8_r = __builtin_msa_sat_s_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.sat.s.b(
+ v8i16_r = __builtin_msa_sat_s_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.sat.s.h(
+ v4i32_r = __builtin_msa_sat_s_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.sat.s.w(
+ v2i64_r = __builtin_msa_sat_s_d(v2i64_a, 3); // CHECK: call <2 x i64> @llvm.mips.sat.s.d(
+
+ v16i8_r = __builtin_msa_sat_u_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.sat.u.b(
+ v8i16_r = __builtin_msa_sat_u_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.sat.u.h(
+ v4i32_r = __builtin_msa_sat_u_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.sat.u.w(
+ v2i64_r = __builtin_msa_sat_u_d(v2i64_a, 3); // CHECK: call <2 x i64> @llvm.mips.sat.u.d(
+
+ v16i8_r = __builtin_msa_shf_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.shf.b(
+ v8i16_r = __builtin_msa_shf_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.shf.h(
+ v4i32_r = __builtin_msa_shf_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.shf.w(
+
+ v16i8_r = __builtin_msa_sld_b(v16i8_a, 10); // CHECK: call <16 x i8> @llvm.mips.sld.b(
+ v8i16_r = __builtin_msa_sld_h(v8i16_a, 10); // CHECK: call <8 x i16> @llvm.mips.sld.h(
+ v4i32_r = __builtin_msa_sld_w(v4i32_a, 10); // CHECK: call <4 x i32> @llvm.mips.sld.w(
+ v2i64_r = __builtin_msa_sld_d(v2i64_a, 10); // CHECK: call <2 x i64> @llvm.mips.sld.d(
+
+ v16i8_r = __builtin_msa_sldi_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.sldi.b(
+ v8i16_r = __builtin_msa_sldi_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.sldi.h(
+ v4i32_r = __builtin_msa_sldi_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.sldi.w(
+ v2i64_r = __builtin_msa_sldi_d(v2i64_a, 3); // CHECK: call <2 x i64> @llvm.mips.sldi.d(
+
+ v16i8_r = __builtin_msa_sll_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.sll.b(
+ v8i16_r = __builtin_msa_sll_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.sll.h(
+ v4i32_r = __builtin_msa_sll_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.sll.w(
+ v2i64_r = __builtin_msa_sll_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.sll.d(
+
+ v16i8_r = __builtin_msa_slli_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.slli.b(
+ v8i16_r = __builtin_msa_slli_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.slli.h(
+ v4i32_r = __builtin_msa_slli_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.slli.w(
+ v2i64_r = __builtin_msa_slli_d(v2i64_a, 3); // CHECK: call <2 x i64> @llvm.mips.slli.d(
+
+ v16i8_r = __builtin_msa_splat_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.splat.b(
+ v8i16_r = __builtin_msa_splat_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.splat.h(
+ v4i32_r = __builtin_msa_splat_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.splat.w(
+ v2i64_r = __builtin_msa_splat_d(v2i64_a, 3); // CHECK: call <2 x i64> @llvm.mips.splat.d(
+
+ v16i8_r = __builtin_msa_splati_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.splati.b(
+ v8i16_r = __builtin_msa_splati_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.splati.h(
+ v4i32_r = __builtin_msa_splati_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.splati.w(
+ v2i64_r = __builtin_msa_splati_d(v2i64_a, 3); // CHECK: call <2 x i64> @llvm.mips.splati.d(
+
+ v16i8_r = __builtin_msa_sra_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.sra.b(
+ v8i16_r = __builtin_msa_sra_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.sra.h(
+ v4i32_r = __builtin_msa_sra_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.sra.w(
+ v2i64_r = __builtin_msa_sra_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.sra.d(
+
+ v16i8_r = __builtin_msa_srai_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.srai.b(
+ v8i16_r = __builtin_msa_srai_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.srai.h(
+ v4i32_r = __builtin_msa_srai_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.srai.w(
+ v2i64_r = __builtin_msa_srai_d(v2i64_a, 3); // CHECK: call <2 x i64> @llvm.mips.srai.d(
+
+ v16i8_r = __builtin_msa_srar_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.srar.b(
+ v8i16_r = __builtin_msa_srar_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.srar.h(
+ v4i32_r = __builtin_msa_srar_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.srar.w(
+ v2i64_r = __builtin_msa_srar_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.srar.d(
+
+ v16i8_r = __builtin_msa_srari_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.srari.b(
+ v8i16_r = __builtin_msa_srari_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.srari.h(
+ v4i32_r = __builtin_msa_srari_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.srari.w(
+ v2i64_r = __builtin_msa_srari_d(v2i64_a, 3); // CHECK: call <2 x i64> @llvm.mips.srari.d(
+
+ v16i8_r = __builtin_msa_srl_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.srl.b(
+ v8i16_r = __builtin_msa_srl_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.srl.h(
+ v4i32_r = __builtin_msa_srl_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.srl.w(
+ v2i64_r = __builtin_msa_srl_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.srl.d(
+
+ v16i8_r = __builtin_msa_srli_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.srli.b(
+ v8i16_r = __builtin_msa_srli_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.srli.h(
+ v4i32_r = __builtin_msa_srli_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.srli.w(
+ v2i64_r = __builtin_msa_srli_d(v2i64_a, 3); // CHECK: call <2 x i64> @llvm.mips.srli.d(
+
+ v16i8_r = __builtin_msa_srlr_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.srlr.b(
+ v8i16_r = __builtin_msa_srlr_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.srlr.h(
+ v4i32_r = __builtin_msa_srlr_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.srlr.w(
+ v2i64_r = __builtin_msa_srlr_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.srlr.d(
+
+ v16i8_r = __builtin_msa_srlri_b(v16i8_a, 3); // CHECK: call <16 x i8> @llvm.mips.srlri.b(
+ v8i16_r = __builtin_msa_srlri_h(v8i16_a, 3); // CHECK: call <8 x i16> @llvm.mips.srlri.h(
+ v4i32_r = __builtin_msa_srlri_w(v4i32_a, 3); // CHECK: call <4 x i32> @llvm.mips.srlri.w(
+ v2i64_r = __builtin_msa_srlri_d(v2i64_a, 3); // CHECK: call <2 x i64> @llvm.mips.srlri.d(
+
+ __builtin_msa_st_b(v16i8_b, &v16i8_a, 1); // CHECK: call void @llvm.mips.st.b(
+ __builtin_msa_st_h(v8i16_b, &v8i16_a, 2); // CHECK: call void @llvm.mips.st.h(
+ __builtin_msa_st_w(v4i32_b, &v4i32_a, 4); // CHECK: call void @llvm.mips.st.w(
+ __builtin_msa_st_d(v2i64_b, &v2i64_a, 8); // CHECK: call void @llvm.mips.st.d(
+
+ v16i8_r = __builtin_msa_subs_s_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.subs.s.b(
+ v8i16_r = __builtin_msa_subs_s_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.subs.s.h(
+ v4i32_r = __builtin_msa_subs_s_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.subs.s.w(
+ v2i64_r = __builtin_msa_subs_s_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.subs.s.d(
+
+ v16u8_r = __builtin_msa_subs_u_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.subs.u.b(
+ v8u16_r = __builtin_msa_subs_u_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.subs.u.h(
+ v4u32_r = __builtin_msa_subs_u_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.subs.u.w(
+ v2u64_r = __builtin_msa_subs_u_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.subs.u.d(
+
+ v16u8_r = __builtin_msa_subsus_u_b(v16u8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.subsus.u.b(
+ v8u16_r = __builtin_msa_subsus_u_h(v8u16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.subsus.u.h(
+ v4u32_r = __builtin_msa_subsus_u_w(v4u32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.subsus.u.w(
+ v2u64_r = __builtin_msa_subsus_u_d(v2u64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.subsus.u.d(
+
+ v16i8_r = __builtin_msa_subsuu_s_b(v16u8_a, v16u8_b); // CHECK: call <16 x i8> @llvm.mips.subsuu.s.b(
+ v8i16_r = __builtin_msa_subsuu_s_h(v8u16_a, v8u16_b); // CHECK: call <8 x i16> @llvm.mips.subsuu.s.h(
+ v4i32_r = __builtin_msa_subsuu_s_w(v4u32_a, v4u32_b); // CHECK: call <4 x i32> @llvm.mips.subsuu.s.w(
+ v2i64_r = __builtin_msa_subsuu_s_d(v2u64_a, v2u64_b); // CHECK: call <2 x i64> @llvm.mips.subsuu.s.d(
+
+ v16i8_r = __builtin_msa_subv_b(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.subv.b(
+ v8i16_r = __builtin_msa_subv_h(v8i16_a, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.subv.h(
+ v4i32_r = __builtin_msa_subv_w(v4i32_a, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.subv.w(
+ v2i64_r = __builtin_msa_subv_d(v2i64_a, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.subv.d(
+
+ v16i8_r = __builtin_msa_subvi_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.subvi.b(
+ v8i16_r = __builtin_msa_subvi_h(v8i16_a, 25); // CHECK: call <8 x i16> @llvm.mips.subvi.h(
+ v4i32_r = __builtin_msa_subvi_w(v4i32_a, 25); // CHECK: call <4 x i32> @llvm.mips.subvi.w(
+ v2i64_r = __builtin_msa_subvi_d(v2i64_a, 25); // CHECK: call <2 x i64> @llvm.mips.subvi.d(
+
+ v16i8_r = __builtin_msa_vshf_b(v16i8_a, v16i8_b, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.vshf.b(
+ v8i16_r = __builtin_msa_vshf_h(v8i16_a, v8i16_b, v8i16_b); // CHECK: call <8 x i16> @llvm.mips.vshf.h(
+ v4i32_r = __builtin_msa_vshf_w(v4i32_a, v4i32_b, v4i32_b); // CHECK: call <4 x i32> @llvm.mips.vshf.w(
+ v2i64_r = __builtin_msa_vshf_d(v2i64_a, v2i64_b, v2i64_b); // CHECK: call <2 x i64> @llvm.mips.vshf.d(
+
+ v16i8_r = __builtin_msa_xor_v(v16i8_a, v16i8_b); // CHECK: call <16 x i8> @llvm.mips.xor.v(
+ v8i16_r = __builtin_msa_xor_v(v8i16_a, v8i16_b); // CHECK: call <16 x i8> @llvm.mips.xor.v(
+ v4i32_r = __builtin_msa_xor_v(v4i32_a, v4i32_b); // CHECK: call <16 x i8> @llvm.mips.xor.v(
+ v2i64_r = __builtin_msa_xor_v(v2i64_a, v2i64_b); // CHECK: call <16 x i8> @llvm.mips.xor.v(
+
+ v16i8_r = __builtin_msa_xori_b(v16i8_a, 25); // CHECK: call <16 x i8> @llvm.mips.xori.b(
+ v8i16_r = __builtin_msa_xori_b(v8i16_a, 25); // CHECK: call <16 x i8> @llvm.mips.xori.b(
+ v4i32_r = __builtin_msa_xori_b(v4i32_a, 25); // CHECK: call <16 x i8> @llvm.mips.xori.b(
+ v2i64_r = __builtin_msa_xori_b(v2i64_a, 25); // CHECK: call <16 x i8> @llvm.mips.xori.b(
+
+ v16u8_r = __builtin_msa_xori_b(v16u8_a, 25); // CHECK: call <16 x i8> @llvm.mips.xori.b(
+ v8u16_r = __builtin_msa_xori_b(v8u16_a, 25); // CHECK: call <16 x i8> @llvm.mips.xori.b(
+ v4u32_r = __builtin_msa_xori_b(v4u32_a, 25); // CHECK: call <16 x i8> @llvm.mips.xori.b(
+ v2u64_r = __builtin_msa_xori_b(v2u64_a, 25); // CHECK: call <16 x i8> @llvm.mips.xori.b(
+
+}
diff --git a/test/CodeGen/builtins-ms.c b/test/CodeGen/builtins-ms.c
new file mode 100644
index 000000000000..0676e9df7a7d
--- /dev/null
+++ b/test/CodeGen/builtins-ms.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - -fms-extensions -triple i686-pc-win32 | FileCheck %s
+
+// CHECK-LABEL: define void @test_alloca
+void capture(void *);
+void test_alloca(int n) {
+ capture(_alloca(n));
+ // CHECK: %[[arg:.*]] = alloca i8, i32 %
+ // CHECK: call void @capture(i8* %[[arg]])
+}
diff --git a/test/CodeGen/builtins-multiprecision.c b/test/CodeGen/builtins-multiprecision.c
index 172f683de3b8..4d196088d3d8 100644
--- a/test/CodeGen/builtins-multiprecision.c
+++ b/test/CodeGen/builtins-multiprecision.c
@@ -2,6 +2,25 @@
// RUN: %clang_cc1 -triple "x86_64-unknown-unknown" -emit-llvm -x c %s -o - -O3 | FileCheck %s
// RUN: %clang_cc1 -triple "x86_64-mingw32" -emit-llvm -x c %s -o - -O3 | FileCheck %s
+unsigned char test_addcb(unsigned char x, unsigned char y,
+ unsigned char carryin, unsigned char *z) {
+ // CHECK: @test_addcb
+ // CHECK: %{{.+}} = {{.*}} call { i8, i1 } @llvm.uadd.with.overflow.i8(i8 %x, i8 %y)
+ // CHECK: %{{.+}} = extractvalue { i8, i1 } %{{.+}}, 1
+ // CHECK: %{{.+}} = extractvalue { i8, i1 } %{{.+}}, 0
+ // CHECK: %{{.+}} = {{.*}} call { i8, i1 } @llvm.uadd.with.overflow.i8(i8 %{{.+}}, i8 %carryin)
+ // CHECK: %{{.+}} = extractvalue { i8, i1 } %{{.+}}, 1
+ // CHECK: %{{.+}} = extractvalue { i8, i1 } %{{.+}}, 0
+ // CHECK: %{{.+}} = or i1 %{{.+}}, %{{.+}}
+ // CHECK: %{{.+}} = zext i1 %{{.+}} to i8
+ // CHECK: store i8 %{{.+}}, i8* %z, align 1
+
+ unsigned char carryout;
+ *z = __builtin_addcb(x, y, carryin, &carryout);
+
+ return carryout;
+}
+
unsigned short test_addcs(unsigned short x, unsigned short y,
unsigned short carryin, unsigned short *z) {
// CHECK: @test_addcs
@@ -76,6 +95,25 @@ unsigned long long test_addcll(unsigned long long x, unsigned long long y,
return carryout;
}
+unsigned char test_subcb(unsigned char x, unsigned char y,
+ unsigned char carryin, unsigned char *z) {
+ // CHECK: @test_subcb
+ // CHECK: %{{.+}} = {{.*}} call { i8, i1 } @llvm.usub.with.overflow.i8(i8 %x, i8 %y)
+ // CHECK: %{{.+}} = extractvalue { i8, i1 } %{{.+}}, 1
+ // CHECK: %{{.+}} = extractvalue { i8, i1 } %{{.+}}, 0
+ // CHECK: %{{.+}} = {{.*}} call { i8, i1 } @llvm.usub.with.overflow.i8(i8 %{{.+}}, i8 %carryin)
+ // CHECK: %{{.+}} = extractvalue { i8, i1 } %{{.+}}, 1
+ // CHECK: %{{.+}} = extractvalue { i8, i1 } %{{.+}}, 0
+ // CHECK: %{{.+}} = or i1 %{{.+}}, %{{.+}}
+ // CHECK: %{{.+}} = zext i1 %{{.+}} to i8
+ // CHECK: store i8 %{{.+}}, i8* %z, align 1
+
+ unsigned char carryout;
+ *z = __builtin_subcb(x, y, carryin, &carryout);
+
+ return carryout;
+}
+
unsigned short test_subcs(unsigned short x, unsigned short y,
unsigned short carryin, unsigned short *z) {
// CHECK: @test_subcs
diff --git a/test/CodeGen/builtins-nvptx.c b/test/CodeGen/builtins-nvptx.c
index 2c7e0c136769..7deee8ef48eb 100644
--- a/test/CodeGen/builtins-nvptx.c
+++ b/test/CodeGen/builtins-nvptx.c
@@ -165,4 +165,13 @@ void nvvm_math(float f1, float f2, double d1, double d2) {
double td3 = __nvvm_sqrt_rn_d(d1);
// CHECK: call double @llvm.nvvm.rcp.rn.d
double td4 = __nvvm_rcp_rn_d(d2);
+
+// CHECK: call void @llvm.nvvm.membar.cta()
+ __nvvm_membar_cta();
+// CHECK: call void @llvm.nvvm.membar.gl()
+ __nvvm_membar_gl();
+// CHECK: call void @llvm.nvvm.membar.sys()
+ __nvvm_membar_sys();
+// CHECK: call void @llvm.nvvm.barrier0()
+ __nvvm_bar0();
}
diff --git a/test/CodeGen/builtins-overflow.c b/test/CodeGen/builtins-overflow.c
new file mode 100644
index 000000000000..5c5500d5684a
--- /dev/null
+++ b/test/CodeGen/builtins-overflow.c
@@ -0,0 +1,175 @@
+// Test CodeGen for Security Check Overflow Builtins.
+// rdar://13421498
+
+// RUN: %clang_cc1 -triple "i686-unknown-unknown" -emit-llvm -x c %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple "x86_64-unknown-unknown" -emit-llvm -x c %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple "x86_64-mingw32" -emit-llvm -x c %s -o - | FileCheck %s
+
+extern unsigned UnsignedErrorCode;
+extern unsigned long UnsignedLongErrorCode;
+extern unsigned long long UnsignedLongLongErrorCode;
+extern int IntErrorCode;
+extern long LongErrorCode;
+extern long long LongLongErrorCode;
+
+unsigned test_uadd_overflow(unsigned x, unsigned y) {
+// CHECK: @test_uadd_overflow
+// CHECK: %{{.+}} = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
+ unsigned result;
+ if (__builtin_uadd_overflow(x, y, &result))
+ return UnsignedErrorCode;
+ return result;
+}
+
+unsigned long test_uaddl_overflow(unsigned long x, unsigned long y) {
+// CHECK: @test_uaddl_overflow([[UL:i32|i64]] %x
+// CHECK: %{{.+}} = call { [[UL]], i1 } @llvm.uadd.with.overflow.[[UL]]([[UL]] %{{.+}}, [[UL]] %{{.+}})
+ unsigned long result;
+ if (__builtin_uaddl_overflow(x, y, &result))
+ return UnsignedLongErrorCode;
+ return result;
+}
+
+unsigned long long test_uaddll_overflow(unsigned long long x, unsigned long long y) {
+// CHECK: @test_uaddll_overflow
+// CHECK: %{{.+}} = call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %{{.+}}, i64 %{{.+}})
+ unsigned long long result;
+ if (__builtin_uaddll_overflow(x, y, &result))
+ return UnsignedLongLongErrorCode;
+ return result;
+}
+
+unsigned test_usub_overflow(unsigned x, unsigned y) {
+// CHECK: @test_usub_overflow
+// CHECK: %{{.+}} = call { i32, i1 } @llvm.usub.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
+ unsigned result;
+ if (__builtin_usub_overflow(x, y, &result))
+ return UnsignedErrorCode;
+ return result;
+}
+
+unsigned long test_usubl_overflow(unsigned long x, unsigned long y) {
+// CHECK: @test_usubl_overflow([[UL:i32|i64]] %x
+// CHECK: %{{.+}} = call { [[UL]], i1 } @llvm.usub.with.overflow.[[UL]]([[UL]] %{{.+}}, [[UL]] %{{.+}})
+ unsigned long result;
+ if (__builtin_usubl_overflow(x, y, &result))
+ return UnsignedLongErrorCode;
+ return result;
+}
+
+unsigned long long test_usubll_overflow(unsigned long long x, unsigned long long y) {
+// CHECK: @test_usubll_overflow
+// CHECK: %{{.+}} = call { i64, i1 } @llvm.usub.with.overflow.i64(i64 %{{.+}}, i64 %{{.+}})
+ unsigned long long result;
+ if (__builtin_usubll_overflow(x, y, &result))
+ return UnsignedLongLongErrorCode;
+ return result;
+}
+
+unsigned test_umul_overflow(unsigned x, unsigned y) {
+// CHECK: @test_umul_overflow
+// CHECK: %{{.+}} = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
+ unsigned result;
+ if (__builtin_umul_overflow(x, y, &result))
+ return UnsignedErrorCode;
+ return result;
+}
+
+unsigned long test_umull_overflow(unsigned long x, unsigned long y) {
+// CHECK: @test_umull_overflow([[UL:i32|i64]] %x
+// CHECK: %{{.+}} = call { [[UL]], i1 } @llvm.umul.with.overflow.[[UL]]([[UL]] %{{.+}}, [[UL]] %{{.+}})
+ unsigned long result;
+ if (__builtin_umull_overflow(x, y, &result))
+ return UnsignedLongErrorCode;
+ return result;
+}
+
+unsigned long long test_umulll_overflow(unsigned long long x, unsigned long long y) {
+// CHECK: @test_umulll_overflow
+// CHECK: %{{.+}} = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %{{.+}}, i64 %{{.+}})
+ unsigned long long result;
+ if (__builtin_umulll_overflow(x, y, &result))
+ return UnsignedLongLongErrorCode;
+ return result;
+}
+
+int test_sadd_overflow(int x, int y) {
+// CHECK: @test_sadd_overflow
+// CHECK: %{{.+}} = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
+ int result;
+ if (__builtin_sadd_overflow(x, y, &result))
+ return IntErrorCode;
+ return result;
+}
+
+long test_saddl_overflow(long x, long y) {
+// CHECK: @test_saddl_overflow([[UL:i32|i64]] %x
+// CHECK: %{{.+}} = call { [[UL]], i1 } @llvm.sadd.with.overflow.[[UL]]([[UL]] %{{.+}}, [[UL]] %{{.+}})
+ long result;
+ if (__builtin_saddl_overflow(x, y, &result))
+ return LongErrorCode;
+ return result;
+}
+
+long long test_saddll_overflow(long long x, long long y) {
+// CHECK: @test_saddll_overflow
+// CHECK: %{{.+}} = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %{{.+}}, i64 %{{.+}})
+ long long result;
+ if (__builtin_saddll_overflow(x, y, &result))
+ return LongLongErrorCode;
+ return result;
+}
+
+int test_ssub_overflow(int x, int y) {
+// CHECK: @test_ssub_overflow
+// CHECK: %{{.+}} = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
+ int result;
+ if (__builtin_ssub_overflow(x, y, &result))
+ return IntErrorCode;
+ return result;
+}
+
+long test_ssubl_overflow(long x, long y) {
+// CHECK: @test_ssubl_overflow([[UL:i32|i64]] %x
+// CHECK: %{{.+}} = call { [[UL]], i1 } @llvm.ssub.with.overflow.[[UL]]([[UL]] %{{.+}}, [[UL]] %{{.+}})
+ long result;
+ if (__builtin_ssubl_overflow(x, y, &result))
+ return LongErrorCode;
+ return result;
+}
+
+long long test_ssubll_overflow(long long x, long long y) {
+// CHECK: @test_ssubll_overflow
+// CHECK: %{{.+}} = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 %{{.+}}, i64 %{{.+}})
+ long long result;
+ if (__builtin_ssubll_overflow(x, y, &result))
+ return LongLongErrorCode;
+ return result;
+}
+
+int test_smul_overflow(int x, int y) {
+// CHECK: @test_smul_overflow
+// CHECK: %{{.+}} = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
+ int result;
+ if (__builtin_smul_overflow(x, y, &result))
+ return IntErrorCode;
+ return result;
+}
+
+long test_smull_overflow(long x, long y) {
+// CHECK: @test_smull_overflow([[UL:i32|i64]] %x
+// CHECK: %{{.+}} = call { [[UL]], i1 } @llvm.smul.with.overflow.[[UL]]([[UL]] %{{.+}}, [[UL]] %{{.+}})
+ long result;
+ if (__builtin_smull_overflow(x, y, &result))
+ return LongErrorCode;
+ return result;
+}
+
+long long test_smulll_overflow(long long x, long long y) {
+// CHECK: @test_smulll_overflow
+// CHECK: %{{.+}} = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 %{{.+}}, i64 %{{.+}})
+ long long result;
+ if (__builtin_smulll_overflow(x, y, &result))
+ return LongLongErrorCode;
+ return result;
+}
diff --git a/test/CodeGen/builtins-ppc-altivec.c b/test/CodeGen/builtins-ppc-altivec.c
index 9427a8a57cdf..47a198f2aeda 100644
--- a/test/CodeGen/builtins-ppc-altivec.c
+++ b/test/CodeGen/builtins-ppc-altivec.c
@@ -41,7 +41,7 @@ int res_i;
int res_ui;
int res_f;
-// CHECK: define void @test1
+// CHECK-LABEL: define void @test1
void test1() {
/* vec_abs */
@@ -333,7 +333,7 @@ void test1() {
}
-// CHECK: define void @test2
+// CHECK-LABEL: define void @test2
void test2() {
/* vec_avg */
res_vsc = vec_avg(vsc, vsc); // CHECK: @llvm.ppc.altivec.vavgsb
@@ -371,7 +371,7 @@ void test2() {
res_vbi = vec_vcmpgefp(vf, vf); // CHECK: @llvm.ppc.altivec.vcmpgefp
}
-// CHECK: define void @test5
+// CHECK-LABEL: define void @test5
void test5() {
/* vec_cmpgt */
@@ -394,7 +394,7 @@ void test5() {
res_vbi = vec_cmple(vf, vf); // CHECK: @llvm.ppc.altivec.vcmpgefp
}
-// CHECK: define void @test6
+// CHECK-LABEL: define void @test6
void test6() {
/* vec_cmplt */
res_vbc = vec_cmplt(vsc, vsc); // CHECK: @llvm.ppc.altivec.vcmpgtsb
@@ -3055,7 +3055,7 @@ void test6() {
}
/* ------------------------------ Relational Operators ------------------------------ */
-// CHECK: define void @test7
+// CHECK-LABEL: define void @test7
void test7() {
vector signed char vsc1 = (vector signed char)(-1);
vector signed char vsc2 = (vector signed char)(-2);
diff --git a/test/CodeGen/builtins-x86.c b/test/CodeGen/builtins-x86.c
index fcf1512ca16e..261bf2f5d8b3 100644
--- a/test/CodeGen/builtins-x86.c
+++ b/test/CodeGen/builtins-x86.c
@@ -55,6 +55,7 @@ void f0() {
const float* tmp_fCp;
double* tmp_dp;
const double* tmp_dCp;
+ long long* tmp_LLip;
#define imm_i 32
#define imm_i_0_2 0
@@ -288,6 +289,9 @@ void f0() {
tmp_i = __builtin_ia32_movmskpd(tmp_V2d);
tmp_i = __builtin_ia32_pmovmskb128(tmp_V16c);
(void) __builtin_ia32_movnti(tmp_ip, tmp_i);
+#ifdef USE_64
+ (void) __builtin_ia32_movnti64(tmp_LLip, tmp_LLi);
+#endif
(void) __builtin_ia32_movntpd(tmp_dp, tmp_V2d);
(void) __builtin_ia32_movntdq(tmp_V2LLip, tmp_V2LLi);
tmp_V2LLi = __builtin_ia32_psadbw128(tmp_V16c, tmp_V16c);
@@ -491,5 +495,13 @@ void f0() {
tmp_V2f = __builtin_ia32_pi2fw(tmp_V2i);
tmp_V2f = __builtin_ia32_pswapdsf(tmp_V2f);
tmp_V2i = __builtin_ia32_pswapdsi(tmp_V2i);
+
+ tmp_V4i = __builtin_ia32_sha1rnds4(tmp_V4i, tmp_V4i, imm_i);
+ tmp_V4i = __builtin_ia32_sha1nexte(tmp_V4i, tmp_V4i);
+ tmp_V4i = __builtin_ia32_sha1msg1(tmp_V4i, tmp_V4i);
+ tmp_V4i = __builtin_ia32_sha1msg2(tmp_V4i, tmp_V4i);
+ tmp_V4i = __builtin_ia32_sha256rnds2(tmp_V4i, tmp_V4i, tmp_V4i);
+ tmp_V4i = __builtin_ia32_sha256msg1(tmp_V4i, tmp_V4i);
+ tmp_V4i = __builtin_ia32_sha256msg2(tmp_V4i, tmp_V4i);
#endif
}
diff --git a/test/CodeGen/builtins.c b/test/CodeGen/builtins.c
index 9ba12bbf2fec..39bd84c5a5a4 100644
--- a/test/CodeGen/builtins.c
+++ b/test/CodeGen/builtins.c
@@ -131,7 +131,7 @@ void foo() {
__builtin_strcat(0, 0);
}
-// CHECK: define void @bar(
+// CHECK-LABEL: define void @bar(
void bar() {
float f;
double d;
@@ -167,7 +167,7 @@ void bar() {
// CHECK: }
-// CHECK: define void @test_float_builtins
+// CHECK-LABEL: define void @test_float_builtins
void test_float_builtins(float F, double D, long double LD) {
volatile int res;
res = __builtin_isinf(F);
@@ -197,7 +197,7 @@ void test_float_builtins(float F, double D, long double LD) {
// CHECK: and i1
}
-// CHECK: define void @test_builtin_longjmp
+// CHECK-LABEL: define void @test_builtin_longjmp
void test_builtin_longjmp(void **buffer) {
// CHECK: [[BITCAST:%.*]] = bitcast
// CHECK-NEXT: call void @llvm.eh.sjlj.longjmp(i8* [[BITCAST]])
@@ -205,7 +205,7 @@ void test_builtin_longjmp(void **buffer) {
// CHECK-NEXT: unreachable
}
-// CHECK: define i64 @test_builtin_readcyclecounter
+// CHECK-LABEL: define i64 @test_builtin_readcyclecounter
long long test_builtin_readcyclecounter() {
// CHECK: call i64 @llvm.readcyclecounter()
return __builtin_readcyclecounter();
diff --git a/test/CodeGen/builtinshufflevector2.c b/test/CodeGen/builtinshufflevector2.c
index ac0e07a41907..04405b5cd159 100644
--- a/test/CodeGen/builtinshufflevector2.c
+++ b/test/CodeGen/builtinshufflevector2.c
@@ -3,7 +3,7 @@
typedef float float4 __attribute__((ext_vector_type(4)));
typedef unsigned int uint4 __attribute__((ext_vector_type(4)));
-// CHECK: define void @clang_shufflevector_v_v(
+// CHECK-LABEL: define void @clang_shufflevector_v_v(
void clang_shufflevector_v_v( float4* A, float4 x, uint4 mask ) {
// CHECK: [[MASK:%.*]] = and <4 x i32> {{%.*}}, <i32 3, i32 3, i32 3, i32 3>
// CHECK: [[I:%.*]] = extractelement <4 x i32> [[MASK]], i32 0
@@ -27,9 +27,16 @@ void clang_shufflevector_v_v( float4* A, float4 x, uint4 mask ) {
*A = __builtin_shufflevector( x, mask );
}
-// CHECK: define void @clang_shufflevector_v_v_c(
-void clang_shufflevector_v_v_c( float4* A, float4 x, float4 y, uint4 mask ) {
+// CHECK-LABEL: define void @clang_shufflevector_v_v_c(
+void clang_shufflevector_v_v_c( float4* A, float4 x, float4 y) {
// CHECK: [[V:%.*]] = shufflevector <4 x float> {{%.*}}, <4 x float> {{%.*}}, <4 x i32> <i32 0, i32 4, i32 1, i32 5>
// CHECK: store <4 x float> [[V]], <4 x float>* {{%.*}}
*A = __builtin_shufflevector( x, y, 0, 4, 1, 5 );
}
+
+// CHECK-LABEL: define void @clang_shufflevector_v_v_undef(
+void clang_shufflevector_v_v_undef( float4* A, float4 x, float4 y) {
+// CHECK: [[V:%.*]] = shufflevector <4 x float> {{%.*}}, <4 x float> {{%.*}}, <4 x i32> <i32 0, i32 4, i32 undef, i32 5>
+// CHECK: store <4 x float> [[V]], <4 x float>* {{%.*}}
+ *A = __builtin_shufflevector( x, y, 0, 4, -1, 5 );
+}
diff --git a/test/CodeGen/byval-memcpy-elim.c b/test/CodeGen/byval-memcpy-elim.c
index 76cdafb5e8c5..d4b751a48bd9 100644
--- a/test/CodeGen/byval-memcpy-elim.c
+++ b/test/CodeGen/byval-memcpy-elim.c
@@ -12,7 +12,7 @@ struct Test2S {
// Make sure we don't generate extra memcpy for lvalues
void test1a(struct Test1S, struct Test2S);
-// CHECK: define void @test1(
+// CHECK-LABEL: define void @test1(
// CHECK-NOT: memcpy
// CHECK: call void @test1a
void test1(struct Test1S *A, struct Test2S *B) {
@@ -28,7 +28,7 @@ struct Test3S {
int a,b,c,d,e,f,g,h,i,j,k,l;
};
void test2a(struct Test3S q);
-// CHECK: define void @test2(
+// CHECK-LABEL: define void @test2(
// CHECK: alloca %struct.Test3S, align 8
// CHECK: memcpy
// CHECK: call void @test2a
@@ -38,7 +38,7 @@ void test2(struct Test3S *q) {
// But make sure we don't generate a memcpy when we can guarantee alignment.
void fooey(void);
-// CHECK: define void @test3(
+// CHECK-LABEL: define void @test3(
// CHECK: alloca %struct.Test3S, align 8
// CHECK: call void @fooey
// CHECK-NOT: memcpy
diff --git a/test/CodeGen/c-strings.c b/test/CodeGen/c-strings.c
index 60a6b019129b..ff86619117ad 100644
--- a/test/CodeGen/c-strings.c
+++ b/test/CodeGen/c-strings.c
@@ -19,13 +19,13 @@ unsigned char align = 1;
void bar(const char *);
-// CHECK: define void @f0()
+// CHECK-LABEL: define void @f0()
void f0() {
bar("hello");
// CHECK: call void @bar({{.*}} @.str
}
-// CHECK: define void @f1()
+// CHECK-LABEL: define void @f1()
void f1() {
static char *x = "hello";
bar(x);
@@ -33,14 +33,14 @@ void f1() {
// CHECK: call void @bar(i8* [[T1:%.*]])
}
-// CHECK: define void @f2()
+// CHECK-LABEL: define void @f2()
void f2() {
static char x[] = "hello";
bar(x);
// CHECK: call void @bar({{.*}} @f2.x
}
-// CHECK: define void @f3()
+// CHECK-LABEL: define void @f3()
void f3() {
static char x[8] = "hello";
bar(x);
@@ -49,7 +49,7 @@ void f3() {
void gaz(void *);
-// CHECK: define void @f4()
+// CHECK-LABEL: define void @f4()
void f4() {
static struct s {
char *name;
diff --git a/test/CodeGen/c11atomics-ios.c b/test/CodeGen/c11atomics-ios.c
index d1c9b143306f..ad004fa4b2f3 100644
--- a/test/CodeGen/c11atomics-ios.c
+++ b/test/CodeGen/c11atomics-ios.c
@@ -6,7 +6,7 @@
// This work was done in pursuit of <rdar://13338582>.
-// CHECK: define arm_aapcscc void @testFloat(float*
+// CHECK-LABEL: define arm_aapcscc void @testFloat(float*
void testFloat(_Atomic(float) *fp) {
// CHECK: [[FP:%.*]] = alloca float*
// CHECK-NEXT: [[X:%.*]] = alloca float
@@ -102,8 +102,6 @@ void testStruct(_Atomic(S) *fp) {
// CHECK-NEXT: store [[S]]*
// CHECK-NEXT: [[P:%.*]] = load [[S]]** [[FP]]
-// CHECK-NEXT: [[T0:%.*]] = bitcast [[S]]* [[P]] to i8*
-// CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[T0]], i8 0, i64 8, i32 8, i1 false)
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[S]]* [[P]], i32 0, i32 0
// CHECK-NEXT: store i16 1, i16* [[T0]], align 2
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[S]]* [[P]], i32 0, i32 1
@@ -114,8 +112,6 @@ void testStruct(_Atomic(S) *fp) {
// CHECK-NEXT: store i16 4, i16* [[T0]], align 2
__c11_atomic_init(fp, (S){1,2,3,4});
-// CHECK-NEXT: [[T0:%.*]] = bitcast [[S]]* [[X]] to i8*
-// CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[T0]], i8 0, i64 8, i32 8, i1 false)
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[S]]* [[X]], i32 0, i32 0
// CHECK-NEXT: store i16 1, i16* [[T0]], align 2
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[S]]* [[X]], i32 0, i32 1
@@ -169,7 +165,7 @@ void testPromotedStruct(_Atomic(PS) *fp) {
__c11_atomic_init(fp, (PS){1,2,3});
// CHECK-NEXT: [[T0:%.*]] = bitcast [[APS]]* [[X]] to i8*
-// CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[T0]], i8 0, i64 8, i32 8, i1 false)
+// CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* [[T0]], i8 0, i32 8, i32 8, i1 false)
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[APS]]* [[X]], i32 0, i32 0
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[PS]]* [[T0]], i32 0, i32 0
// CHECK-NEXT: store i16 1, i16* [[T1]], align 2
@@ -183,7 +179,7 @@ void testPromotedStruct(_Atomic(PS) *fp) {
// CHECK-NEXT: [[T1:%.*]] = bitcast [[APS]]* [[T0]] to i64*
// CHECK-NEXT: [[T2:%.*]] = load atomic i64* [[T1]] seq_cst, align 8
// CHECK-NEXT: [[T3:%.*]] = bitcast [[APS]]* [[TMP0]] to i64*
-// CHECK-NEXT: store i64 [[T2]], i64* [[T3]], align 8
+// CHECK-NEXT: store i64 [[T2]], i64* [[T3]], align 2
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[APS]]* [[TMP0]], i32 0, i32 0
// CHECK-NEXT: [[T1:%.*]] = bitcast [[PS]]* [[F]] to i8*
// CHECK-NEXT: [[T2:%.*]] = bitcast [[PS]]* [[T0]] to i8*
@@ -191,6 +187,8 @@ void testPromotedStruct(_Atomic(PS) *fp) {
PS f = *fp;
// CHECK-NEXT: [[T0:%.*]] = load [[APS]]** [[FP]]
+// CHECK-NEXT: [[T1:%.*]] = bitcast { %struct.PS, [2 x i8] }* [[TMP1]] to i8*
+// CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* [[T1]], i8 0, i32 8, i32 8, i1 false)
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[APS]]* [[TMP1]], i32 0, i32 0
// CHECK-NEXT: [[T2:%.*]] = bitcast [[PS]]* [[T1]] to i8*
// CHECK-NEXT: [[T3:%.*]] = bitcast [[PS]]* [[F]] to i8*
diff --git a/test/CodeGen/c11atomics.c b/test/CodeGen/c11atomics.c
index 8d298af01919..5c761b137498 100644
--- a/test/CodeGen/c11atomics.c
+++ b/test/CodeGen/c11atomics.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv7-unknown-freebsd -std=c11 | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv5-unknown-freebsd -std=c11 | FileCheck %s
// Test that we are generating atomicrmw instructions, rather than
// compare-exchange loops for common atomic ops. This makes a big difference
@@ -135,7 +135,7 @@ void testandeq(void)
s &= 42;
}
-// CHECK: define arm_aapcscc void @testFloat(float*
+// CHECK-LABEL: define arm_aapcscc void @testFloat(float*
void testFloat(_Atomic(float) *fp) {
// CHECK: [[FP:%.*]] = alloca float*
// CHECK-NEXT: [[X:%.*]] = alloca float
@@ -233,8 +233,6 @@ void testStruct(_Atomic(S) *fp) {
// CHECK-NEXT: store [[S]]*
// CHECK-NEXT: [[P:%.*]] = load [[S]]** [[FP]]
-// CHECK-NEXT: [[T0:%.*]] = bitcast [[S]]* [[P]] to i8*
-// CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[T0]], i8 0, i64 8, i32 8, i1 false)
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[S]]* [[P]], i32 0, i32 0
// CHECK-NEXT: store i16 1, i16* [[T0]], align 2
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[S]]* [[P]], i32 0, i32 1
@@ -245,8 +243,6 @@ void testStruct(_Atomic(S) *fp) {
// CHECK-NEXT: store i16 4, i16* [[T0]], align 2
__c11_atomic_init(fp, (S){1,2,3,4});
-// CHECK-NEXT: [[T0:%.*]] = bitcast [[S]]* [[X]] to i8*
-// CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[T0]], i8 0, i64 8, i32 8, i1 false)
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[S]]* [[X]], i32 0, i32 0
// CHECK-NEXT: store i16 1, i16* [[T0]], align 2
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[S]]* [[X]], i32 0, i32 1
@@ -283,6 +279,9 @@ void testPromotedStruct(_Atomic(PS) *fp) {
// CHECK-NEXT: [[F:%.*]] = alloca [[PS:%.*]], align 2
// CHECK-NEXT: [[TMP0:%.*]] = alloca [[APS]], align 8
// CHECK-NEXT: [[TMP1:%.*]] = alloca [[APS]], align 8
+// CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
+// CHECK-NEXT: [[TMP2:%.*]] = alloca %struct.PS, align 2
+// CHECK-NEXT: [[TMP3:%.*]] = alloca [[APS]], align 8
// CHECK-NEXT: store [[APS]]*
// CHECK-NEXT: [[P:%.*]] = load [[APS]]** [[FP]]
@@ -298,7 +297,7 @@ void testPromotedStruct(_Atomic(PS) *fp) {
__c11_atomic_init(fp, (PS){1,2,3});
// CHECK-NEXT: [[T0:%.*]] = bitcast [[APS]]* [[X]] to i8*
-// CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[T0]], i8 0, i64 8, i32 8, i1 false)
+// CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* [[T0]], i8 0, i32 8, i32 8, i1 false)
// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[APS]]* [[X]], i32 0, i32 0
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[PS]]* [[T0]], i32 0, i32 0
// CHECK-NEXT: store i16 1, i16* [[T1]], align 2
@@ -319,6 +318,8 @@ void testPromotedStruct(_Atomic(PS) *fp) {
PS f = *fp;
// CHECK-NEXT: [[T0:%.*]] = load [[APS]]** [[FP]]
+// CHECK-NEXT: [[T1:%.*]] = bitcast { %struct.PS, [2 x i8] }* [[TMP1]] to i8*
+// CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* [[T1]], i8 0, i32 8, i32 8, i1 false)
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[APS]]* [[TMP1]], i32 0, i32 0
// CHECK-NEXT: [[T2:%.*]] = bitcast [[PS]]* [[T1]] to i8*
// CHECK-NEXT: [[T3:%.*]] = bitcast [[PS]]* [[F]] to i8*
@@ -328,6 +329,20 @@ void testPromotedStruct(_Atomic(PS) *fp) {
// CHECK-NEXT: call arm_aapcscc void @__atomic_store(i32 8, i8* [[T4]], i8* [[T5]], i32 5)
*fp = f;
+// CHECK-NEXT: [[T0:%.*]] = load [[APS]]** [[FP]], align 4
+// CHECK-NEXT: [[T1:%.*]] = bitcast [[APS]]* [[T0]] to i8*
+// CHECK-NEXT: [[T2:%.*]] = bitcast [[APS]]* [[TMP3]] to i8*
+// CHECK-NEXT: call arm_aapcscc void @__atomic_load(i32 8, i8* [[T1]], i8* [[T2]], i32 5)
+// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[APS]]* [[TMP3]], i32 0, i32 0
+// CHECK-NEXT: [[T1:%.*]] = bitcast %struct.PS* [[TMP2]] to i8*
+// CHECK-NEXT: [[T2:%.*]] = bitcast %struct.PS* [[T0]] to i8*
+// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[T1]], i8* [[T2]], i32 6, i32 2, i1 false)
+// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %struct.PS* [[TMP2]], i32 0, i32 0
+// CHECK-NEXT: [[T1:%.*]] = load i16* [[T0]], align 2
+// CHECK-NEXT: [[T2:%.*]] = sext i16 [[T1]] to i32
+// CHECK-NEXT: store i32 [[T2]], i32* [[A]], align 4
+ int a = ((PS)*fp).x;
+
// CHECK-NEXT: ret void
}
diff --git a/test/CodeGen/capture-complex-expr-in-block.c b/test/CodeGen/capture-complex-expr-in-block.c
index 86c93d0252bc..83695a8b734d 100644
--- a/test/CodeGen/capture-complex-expr-in-block.c
+++ b/test/CodeGen/capture-complex-expr-in-block.c
@@ -12,7 +12,7 @@ int main ()
b();
}
-// CHECK: define internal void @__main_block_invoke
+// CHECK-LABEL: define internal void @__main_block_invoke
// CHECK: [[C1:%.*]] = alloca { double, double }, align 8
// CHECK: [[RP:%.*]] = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 0
// CHECK-NEXT: [[R:%.*]] = load double* [[RP]]
diff --git a/test/CodeGen/captured-statements-nested.c b/test/CodeGen/captured-statements-nested.c
new file mode 100644
index 000000000000..d8ec74692adf
--- /dev/null
+++ b/test/CodeGen/captured-statements-nested.c
@@ -0,0 +1,126 @@
+// RUN: %clang_cc1 -fblocks -emit-llvm %s -o %t
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK1
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK2
+
+struct A {
+ int a;
+ float b;
+ char c;
+};
+
+void test_nest_captured_stmt(int param) {
+ int w;
+ // CHECK1: %struct.anon{{.*}} = type { i32*, i32* }
+ // CHECK1: %struct.anon{{.*}} = type { i32*, i32*, i32**, i32* }
+ // CHECK1: [[T:%struct.anon.*]] = type { i32*, i32*, %struct.A*, i32**, i32* }
+ #pragma clang __debug captured
+ {
+ int x;
+ int *y = &w;
+ #pragma clang __debug captured
+ {
+ struct A z;
+ #pragma clang __debug captured
+ {
+ w = x = z.a = 1;
+ *y = param;
+ z.b = 0.1f;
+ z.c = 'c';
+
+ // CHECK1: define internal void @__captured_stmt{{.*}}([[T]]
+ //
+ // CHECK1: getelementptr inbounds [[T]]* {{.*}}, i32 0, i32 2
+ // CHECK1-NEXT: load %struct.A**
+ // CHECK1-NEXT: getelementptr inbounds %struct.A*
+ // CHECK1-NEXT: store i32 1
+ //
+ // CHECK1: getelementptr inbounds [[T]]* {{.*}}, i32 0, i32 1
+ // CHECK1-NEXT: load i32**
+ // CHECK1-NEXT: store i32 1
+ //
+ // CHECK1: getelementptr inbounds [[T]]* {{.*}}, i32 0, i32 0
+ // CHECK1-NEXT: load i32**
+ // CHECK1-NEXT: store i32 1
+ //
+ // CHECK1: getelementptr inbounds [[T]]* {{.*}}, i32 0, i32 4
+ // CHECK1-NEXT: load i32**
+ // CHECK1-NEXT: load i32*
+ // CHECK1-NEXT: getelementptr inbounds [[T]]* {{.*}}, i32 0, i32 3
+ // CHECK1-NEXT: load i32***
+ // CHECK1-NEXT: load i32**
+ // CHECK1-NEXT: store i32
+ //
+ // CHECK1: getelementptr inbounds [[T]]* {{.*}}, i32 0, i32 2
+ // CHECK1-NEXT: load %struct.A**
+ // CHECK1-NEXT: getelementptr inbounds %struct.A*
+ // CHECK1-NEXT: store float
+ //
+ // CHECK1: getelementptr inbounds [[T]]* {{.*}}, i32 0, i32 2
+ // CHECK1-NEXT: load %struct.A**
+ // CHECK1-NEXT: getelementptr inbounds %struct.A*
+ // CHECK1-NEXT: store i8 99
+ }
+ }
+ }
+}
+
+void test_nest_block() {
+ __block int x;
+ int y;
+ ^{
+ int z;
+ x = z;
+ #pragma clang __debug captured
+ {
+ z = y; // OK
+ }
+ }();
+
+ // CHECK2: define internal void @{{.*}}test_nest_block_block_invoke
+ //
+ // CHECK2: [[Z:%[0-9a-z_]*]] = alloca i32
+ // CHECK2: alloca %struct.anon{{.*}}
+ //
+ // CHECK2: store i32
+ // CHECK2: store i32* [[Z]]
+ //
+ // CHECK2: getelementptr inbounds %struct.anon
+ // CHECK2-NEXT: getelementptr inbounds
+ // CHECK2-NEXT: store i32*
+ //
+ // CHECK2: call void @__captured_stmt
+
+ int a;
+ #pragma clang __debug captured
+ {
+ __block int b;
+ int c;
+ __block int d;
+ ^{
+ b = a;
+ b = c;
+ b = d;
+ }();
+ }
+
+ // CHECK2: alloca %struct.__block_byref_b
+ // CHECK2-NEXT: [[C:%[0-9a-z_]*]] = alloca i32
+ // CHECK2-NEXT: alloca %struct.__block_byref_d
+ //
+ // CHECK2: bitcast %struct.__block_byref_b*
+ // CHECK2-NEXT: store i8*
+ //
+ // CHECK2: [[CapA:%[0-9a-z_.]*]] = getelementptr inbounds {{.*}}, i32 0, i32 7
+ //
+ // CHECK2: getelementptr inbounds %struct.anon{{.*}}, i32 0, i32 0
+ // CHECK2: load i32**
+ // CHECK2: load i32*
+ // CHECK2: store i32 {{.*}}, i32* [[CapA]]
+ //
+ // CHECK2: [[CapC:%[0-9a-z_.]*]] = getelementptr inbounds {{.*}}, i32 0, i32 8
+ // CHECK2-NEXT: [[Val:%[0-9a-z_]*]] = load i32* [[C]]
+ // CHECK2-NEXT: store i32 [[Val]], i32* [[CapC]]
+ //
+ // CHECK2: bitcast %struct.__block_byref_d*
+ // CHECK2-NEXT: store i8*
+}
diff --git a/test/CodeGen/captured-statements.c b/test/CodeGen/captured-statements.c
new file mode 100644
index 000000000000..c87c1873506b
--- /dev/null
+++ b/test/CodeGen/captured-statements.c
@@ -0,0 +1,80 @@
+// RUN: %clang_cc1 -emit-llvm %s -o %t
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-GLOBALS
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-1
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-2
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-3
+
+int foo();
+int global;
+
+// Single statement
+void test1() {
+ int i = 0;
+ #pragma clang __debug captured
+ {
+ i++;
+ }
+ // CHECK-1: %struct.anon = type { i32* }
+ //
+ // CHECK-1: test1
+ // CHECK-1: alloca %struct.anon
+ // CHECK-1: getelementptr inbounds %struct.anon*
+ // CHECK-1: store i32* %i
+ // CHECK-1: call void @[[HelperName:__captured_stmt[0-9]+]]
+}
+
+// CHECK-1: define internal void @[[HelperName]](%struct.anon
+// CHECK-1: getelementptr inbounds %struct.anon{{.*}}, i32 0, i32 0
+// CHECK-1: load i32**
+// CHECK-1: load i32*
+// CHECK-1: add nsw i32
+// CHECK-1: store i32
+
+// Compound statement with local variable
+void test2(int x) {
+ #pragma clang __debug captured
+ {
+ int i;
+ for (i = 0; i < x; i++)
+ foo();
+ }
+ // CHECK-2: test2
+ // CHECK-2-NOT: %i
+ // CHECK-2: call void @[[HelperName:__captured_stmt[0-9]+]]
+}
+
+// CHECK-2: define internal void @[[HelperName]]
+// CHECK-2-NOT: }
+// CHECK-2: %i = alloca i32
+
+// Capture array
+void test3() {
+ int arr[] = {1, 2, 3, 4, 5};
+ #pragma clang __debug captured
+ {
+ arr[2] = arr[1];
+ }
+ // CHECK-3: test3
+ // CHECK-3: alloca [5 x i32]
+ // CHECK-3: call void @__captured_stmt
+}
+
+void dont_capture_global() {
+ static int s;
+ extern int e;
+ #pragma clang __debug captured
+ {
+ global++;
+ s++;
+ e++;
+ }
+
+ // CHECK-GLOBALS: %[[Capture:struct\.anon[\.0-9]*]] = type {}
+ // CHECK-GLOBALS: call void @__captured_stmt[[HelperName:[0-9]+]](%[[Capture]]
+}
+
+// CHECK-GLOBALS: define internal void @__captured_stmt[[HelperName]]
+// CHECK-GLOBALS-NOT: ret
+// CHECK-GLOBALS: load i32* @global
+// CHECK-GLOBALS: load i32* @
+// CHECK-GLOBALS: load i32* @e
diff --git a/test/CodeGen/catch-undef-behavior.c b/test/CodeGen/catch-undef-behavior.c
index ebe39feea434..9be261467d2f 100644
--- a/test/CodeGen/catch-undef-behavior.c
+++ b/test/CodeGen/catch-undef-behavior.c
@@ -31,12 +31,12 @@ void foo() {
// CHECK-TRAP: %[[CHECK0:.*]] = icmp ne {{.*}}* %[[PTR:.*]], null
// CHECK: %[[I8PTR:.*]] = bitcast i32* %[[PTR]] to i8*
- // CHECK-NEXT: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64(i8* %[[I8PTR]], i1 false)
+ // CHECK-NEXT: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64.p0i8(i8* %[[I8PTR]], i1 false)
// CHECK-NEXT: %[[CHECK1:.*]] = icmp uge i64 %[[SIZE]], 4
// CHECK-NEXT: %[[CHECK01:.*]] = and i1 %[[CHECK0]], %[[CHECK1]]
// CHECK-TRAP: %[[I8PTR:.*]] = bitcast i32* %[[PTR]] to i8*
- // CHECK-TRAP-NEXT: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64(i8* %[[I8PTR]], i1 false)
+ // CHECK-TRAP-NEXT: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64.p0i8(i8* %[[I8PTR]], i1 false)
// CHECK-TRAP-NEXT: %[[CHECK1:.*]] = icmp uge i64 %[[SIZE]], 4
// CHECK-TRAP-NEXT: %[[CHECK01:.*]] = and i1 %[[CHECK0]], %[[CHECK1]]
diff --git a/test/CodeGen/char-literal.c b/test/CodeGen/char-literal.c
index 237d4b2010ee..6fdf8b7c02b1 100644
--- a/test/CodeGen/char-literal.c
+++ b/test/CodeGen/char-literal.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=C %s
-// RUN: %clang_cc1 -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=C %s
-// RUN: %clang_cc1 -x c++ -std=c++11 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CPP0X %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-C %s
+// RUN: %clang_cc1 -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-C %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-CPP0X %s
#include <stddef.h>
diff --git a/test/CodeGen/complex-convert.c b/test/CodeGen/complex-convert.c
index aaa57a023a2f..e35be9c14917 100644
--- a/test/CodeGen/complex-convert.c
+++ b/test/CodeGen/complex-convert.c
@@ -21,7 +21,7 @@ void foo(signed char sc, unsigned char uc, signed long long sll,
_Complex unsigned char cuc1;
_Complex signed long long csll1;
_Complex unsigned long long cull1;
- // CHECK: define void @foo(
+ // CHECK-LABEL: define void @foo(
// CHECK: alloca i[[CHSIZE:[0-9]+]], align [[CHALIGN:[0-9]+]]
// CHECK-NEXT: alloca i[[CHSIZE]], align [[CHALIGN]]
// CHECK-NEXT: alloca i[[LLSIZE:[0-9]+]], align [[LLALIGN:[0-9]+]]
diff --git a/test/CodeGen/complex-indirect.c b/test/CodeGen/complex-indirect.c
index 0daa970e760a..cb84f7f49725 100644
--- a/test/CodeGen/complex-indirect.c
+++ b/test/CodeGen/complex-indirect.c
@@ -7,6 +7,6 @@
void a(int,int,int,int,int,int,__complex__ char);
void b(__complex__ char *y) { a(0,0,0,0,0,0,*y); }
-// CHECK: define void @b
+// CHECK-LABEL: define void @b
// CHECK: alloca { i8, i8 }*, align 8
// CHECK: call void @a(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i16 {{.*}})
diff --git a/test/CodeGen/complex-init-list.c b/test/CodeGen/complex-init-list.c
index 99c1c62b5884..bc38e2caf21f 100644
--- a/test/CodeGen/complex-init-list.c
+++ b/test/CodeGen/complex-init-list.c
@@ -8,11 +8,11 @@ _Complex float x = { 1.0f, 1.0f/0.0f };
// CHECK: @x = global { float, float } { float 1.000000e+00, float 0x7FF0000000000000 }, align 4
_Complex float f(float x, float y) { _Complex float z = { x, y }; return z; }
-// CHECK: define <2 x float> @f
+// CHECK-LABEL: define <2 x float> @f
// CHECK: alloca { float, float }
// CHECK: alloca { float, float }
_Complex float f2(float x, float y) { return (_Complex float){ x, y }; }
-// CHECK: define <2 x float> @f2
+// CHECK-LABEL: define <2 x float> @f2
// CHECK: alloca { float, float }
// CHECK: alloca { float, float }
diff --git a/test/CodeGen/complex.c b/test/CodeGen/complex.c
index 1212660e878d..206db253caa4 100644
--- a/test/CodeGen/complex.c
+++ b/test/CodeGen/complex.c
@@ -32,8 +32,7 @@ void test3() {
double Gr = __real g1;
cf += D;
- // FIXME: Currently unsupported!
- //D += cf;
+ D += cf;
cf /= g1;
g1 = g1 + D;
g1 = D + g1;
@@ -51,8 +50,7 @@ void test3int() {
i = __real ci1;
cs += i;
- // FIXME: Currently unsupported!
- //D += cf;
+ D += cf;
cs /= ci1;
ci1 = ci1 + i;
ci1 = i + ci1;
@@ -97,3 +95,6 @@ double t7(double _Complex c) {
void t8() {
__complex__ int *x = &(__complex__ int){1};
}
+
+const _Complex double test9const = 0;
+_Complex double test9func() { return test9const; }
diff --git a/test/CodeGen/compound-assign-overflow.c b/test/CodeGen/compound-assign-overflow.c
index e82061bdb7b3..15334294d47e 100644
--- a/test/CodeGen/compound-assign-overflow.c
+++ b/test/CodeGen/compound-assign-overflow.c
@@ -7,8 +7,7 @@
// CHECK: @[[LINE_100:.*]] = private unnamed_addr global {{.*}}, i32 100, i32 5 {{.*}} @[[INT]]
// CHECK: @[[UINT:.*]] = private unnamed_addr constant { i16, i16, [15 x i8] } { i16 0, i16 10, [15 x i8] c"'unsigned int'\00" }
// CHECK: @[[LINE_200:.*]] = private unnamed_addr global {{.*}}, i32 200, i32 5 {{.*}} @[[UINT]]
-// CHECK: @[[DIVINT:.*]] = private unnamed_addr constant { i16, i16, [6 x i8] } { i16 0, i16 11, [6 x i8] c"'int'\00" }
-// CHECK: @[[LINE_300:.*]] = private unnamed_addr global {{.*}}, i32 300, i32 5 {{.*}} @[[DIVINT]]
+// CHECK: @[[LINE_300:.*]] = private unnamed_addr global {{.*}}, i32 300, i32 5 {{.*}} @[[INT]]
int32_t x;
diff --git a/test/CodeGen/compound-literal.c b/test/CodeGen/compound-literal.c
index e4bf962e12ad..458a78e1984b 100644
--- a/test/CodeGen/compound-literal.c
+++ b/test/CodeGen/compound-literal.c
@@ -12,7 +12,7 @@ struct s {int a, b, c;} * b = &(struct s) {1, 2, 3};
_Complex double * x = &(_Complex double){1.0f};
}
-// CHECK: define void @f()
+// CHECK-LABEL: define void @f()
void f() {
typedef struct S { int x,y; } S;
// CHECK: [[S:%[a-zA-Z0-9.]+]] = alloca [[STRUCT:%[a-zA-Z0-9.]+]],
@@ -33,7 +33,7 @@ void f() {
// CHECK-NEXT: ret void
}
-// CHECK: define i48 @g(
+// CHECK-LABEL: define i48 @g(
struct G { short x, y, z; };
struct G g(int x, int y, int z) {
// CHECK: [[RESULT:%.*]] = alloca [[G:%.*]], align 2
diff --git a/test/CodeGen/const-init.c b/test/CodeGen/const-init.c
index 5f729b8df428..7d7ccae370dd 100644
--- a/test/CodeGen/const-init.c
+++ b/test/CodeGen/const-init.c
@@ -156,6 +156,6 @@ void g29() {
// CHECK: @g29.b = internal global [1 x i32] [i32 ptrtoint ([5 x i8]* @.str to i32)], align 4
// CHECK: @g29.c = internal global [1 x i32] [i32 97], align 4
static DCC_SRVR_NM a = { {"@"} };
- static int b[1] = { "asdf" };
+ static int b[1] = { "asdf" }; // expected-warning {{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char [5]'}}
static int c[1] = { L"a" };
}
diff --git a/test/CodeGen/convertvector.c b/test/CodeGen/convertvector.c
new file mode 100644
index 000000000000..2b23dd96e1b8
--- /dev/null
+++ b/test/CodeGen/convertvector.c
@@ -0,0 +1,114 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -target-cpu corei7-avx -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -target-cpu corei7-avx -emit-llvm -x c++ %s -o - | FileCheck %s
+
+typedef double vector8double __attribute__((__vector_size__(64)));
+typedef float vector8float __attribute__((__vector_size__(32)));
+typedef long vector8long __attribute__((__vector_size__(64)));
+typedef short vector8short __attribute__((__vector_size__(16)));
+typedef unsigned long vector8ulong __attribute__((__vector_size__(64)));
+typedef unsigned short vector8ushort __attribute__((__vector_size__(16)));
+
+#ifdef __cplusplus
+#define BOOL bool
+#else
+#define BOOL _Bool
+#endif
+
+typedef BOOL vector8bool __attribute__((__ext_vector_type__(8)));
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+vector8float flt_trunc(vector8double x) {
+ return __builtin_convertvector(x, vector8float);
+ // CHECK-LABEL: @flt_trunc
+ // CHECK: fptrunc <8 x double> %{{[^ ]}} to <8 x float>
+}
+
+vector8double flt_ext(vector8float x) {
+ return __builtin_convertvector(x, vector8double);
+ // CHECK-LABEL: @flt_ext
+ // CHECK: fpext <8 x float> %{{[^ ]}} to <8 x double>
+}
+
+vector8bool flt_tobool(vector8float x) {
+ return __builtin_convertvector(x, vector8bool);
+ // CHECK-LABEL: @flt_tobool
+ // CHECK-NOT: fptoui <8 x float> %{{[^ ]}} to <8 x i1>
+ // CHECK: fcmp une <8 x float> %{{[^ ]}}, zeroinitializer
+}
+
+vector8long flt_tosi(vector8float x) {
+ return __builtin_convertvector(x, vector8long);
+ // CHECK-LABEL: @flt_tosi
+ // CHECK: fptosi <8 x float> %{{[^ ]}} to <8 x i64>
+}
+
+vector8ulong flt_toui(vector8float x) {
+ return __builtin_convertvector(x, vector8ulong);
+ // CHECK-LABEL: @flt_toui
+ // CHECK: fptoui <8 x float> %{{[^ ]}} to <8 x i64>
+}
+
+vector8ulong fltd_toui(vector8double x) {
+ return __builtin_convertvector(x, vector8ulong);
+ // CHECK-LABEL: @fltd_toui
+ // CHECK: fptoui <8 x double> %{{[^ ]}} to <8 x i64>
+}
+
+vector8ulong int_zext(vector8ushort x) {
+ return __builtin_convertvector(x, vector8ulong);
+ // CHECK-LABEL: @int_zext
+ // CHECK: zext <8 x i16> %{{[^ ]}} to <8 x i64>
+}
+
+vector8long int_sext(vector8short x) {
+ return __builtin_convertvector(x, vector8long);
+ // CHECK-LABEL: @int_sext
+ // CHECK: sext <8 x i16> %{{[^ ]}} to <8 x i64>
+}
+
+vector8bool int_tobool(vector8short x) {
+ return __builtin_convertvector(x, vector8bool);
+ // CHECK-LABEL: @int_tobool
+ // CHECK-NOT: trunc <8 x i16> %{{[^ ]}} to <8 x i1>
+ // CHECK: icmp ne <8 x i16> %{{[^ ]}}, zeroinitializer
+}
+
+vector8float int_tofp(vector8short x) {
+ return __builtin_convertvector(x, vector8float);
+ // CHECK-LABEL: @int_tofp
+ // CHECK: sitofp <8 x i16> %{{[^ ]}} to <8 x float>
+}
+
+vector8float uint_tofp(vector8ushort x) {
+ return __builtin_convertvector(x, vector8float);
+ // CHECK-LABEL: @uint_tofp
+ // CHECK: uitofp <8 x i16> %{{[^ ]}} to <8 x float>
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifdef __cplusplus
+template<typename T>
+T int_toT(vector8long x) {
+ return __builtin_convertvector(x, T);
+}
+
+extern "C" {
+ vector8double int_toT_fp(vector8long x) {
+ // CHECK-LABEL: @int_toT_fp
+ // CHECK: sitofp <8 x i64> %{{[^ ]}} to <8 x double>
+ return int_toT<vector8double>(x);
+ }
+}
+#else
+vector8double int_toT_fp(vector8long x) {
+ return __builtin_convertvector(x, vector8double);
+}
+#endif
+
diff --git a/test/CodeGen/cxx-default-arg.cpp b/test/CodeGen/cxx-default-arg.cpp
index 25b7c10ad10f..12e266640818 100644
--- a/test/CodeGen/cxx-default-arg.cpp
+++ b/test/CodeGen/cxx-default-arg.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-llvm %s -o %t
-// Note: define CLANG_GENERATE_KNOWN_GOOD and compile to generate code
+// Note-LABEL: define CLANG_GENERATE_KNOWN_GOOD and compile to generate code
// that makes all of the defaulted arguments explicit. The resulting
// byte code should be identical to the compilation without
// CLANG_GENERATE_KNOWN_GOOD.
diff --git a/test/CodeGen/darwin-string-literals.c b/test/CodeGen/darwin-string-literals.c
index 968386a90e98..c7d9ff916000 100644
--- a/test/CodeGen/darwin-string-literals.c
+++ b/test/CodeGen/darwin-string-literals.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix LSB %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-LSB %s
// CHECK-LSB: @.str = private unnamed_addr constant [8 x i8] c"string0\00"
// CHECK-LSB: @.str1 = linker_private unnamed_addr constant [8 x i8] c"string1\00"
@@ -6,7 +6,7 @@
// CHECK-LSB: @.str4 = internal unnamed_addr constant [6 x i16] [i16 116, i16 101, i16 115, i16 116, i16 8482, i16 0], align 2
-// RUN: %clang_cc1 -triple powerpc-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix MSB %s
+// RUN: %clang_cc1 -triple powerpc-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-MSB %s
// CHECK-MSB: @.str = private unnamed_addr constant [8 x i8] c"string0\00"
// CHECK-MSB: @.str1 = linker_private unnamed_addr constant [8 x i8] c"string1\00"
diff --git a/test/CodeGen/debug-info-args.c b/test/CodeGen/debug-info-args.c
index 3312952a06cf..50b85411adb9 100644
--- a/test/CodeGen/debug-info-args.c
+++ b/test/CodeGen/debug-info-args.c
@@ -2,7 +2,7 @@
int somefunc(char *x, int y, double z) {
- // CHECK: metadata ![[NUM:[^,]*]], i32 0, i32 0} ; [ DW_TAG_subroutine_type
+ // CHECK: metadata ![[NUM:[^,]*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type
// CHECK: ![[NUM]] = {{metadata !{metadata ![^,]*, metadata ![^,]*, metadata ![^,]*, metadata ![^,]*}}}
return y;
diff --git a/test/CodeGen/debug-info-block-decl.c b/test/CodeGen/debug-info-block-decl.c
new file mode 100644
index 000000000000..06c0e1ad3192
--- /dev/null
+++ b/test/CodeGen/debug-info-block-decl.c
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -g -fblocks -emit-llvm -o - %s | FileCheck %s
+// Assignment and block entry should point to the same line.
+// rdar://problem/14039866
+
+// CHECK: define{{.*}}@main()
+// CHECK: store{{.*}}bitcast{{.*}}, !dbg ![[ASSIGNMENT:[0-9]+]]
+// CHECK: define {{.*}} @__main_block_invoke
+// CHECK: dbg ![[BLOCK_ENTRY:[0-9]+]]
+
+int main()
+{
+// CHECK: [[ASSIGNMENT]] = metadata !{i32 [[@LINE+2]],
+// CHECK: [[BLOCK_ENTRY]] = metadata !{i32 [[@LINE+1]],
+ int (^blockptr)(void) = ^(void) {
+ return 0;
+ };
+ return blockptr();
+}
+
diff --git a/test/CodeGen/debug-info-enum.c b/test/CodeGen/debug-info-enum.c
deleted file mode 100644
index b4a1ce0d3a22..000000000000
--- a/test/CodeGen/debug-info-enum.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm -g %s -o %t
-// RUN: grep DW_TAG_enumeration_type %t
-// Radar 8195980
-
-enum vtag {
- VT_ONE
-};
-
-int foo(int i) {
- return i == VT_ONE;
-}
diff --git a/test/CodeGen/debug-info-limited.c b/test/CodeGen/debug-info-limited.c
new file mode 100644
index 000000000000..7333452ee568
--- /dev/null
+++ b/test/CodeGen/debug-info-limited.c
@@ -0,0 +1,11 @@
+// RUN: %clang -flimit-debug-info -emit-llvm -g -S %s -o - | FileCheck %s
+
+// Ensure we emit the full definition of 'foo' even though only its declaration
+// is needed, since C has no ODR to ensure that the definition will be the same
+// in whatever TU actually uses/requires the definition of 'foo'.
+// CHECK: ; [ DW_TAG_structure_type ] [foo] {{.*}} [def]
+
+struct foo {
+};
+
+struct foo *f;
diff --git a/test/CodeGen/debug-info-version.c b/test/CodeGen/debug-info-version.c
new file mode 100644
index 000000000000..3a74876de59b
--- /dev/null
+++ b/test/CodeGen/debug-info-version.c
@@ -0,0 +1,8 @@
+// RUN: %clang -g -S -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang -S -emit-llvm -o - %s | FileCheck %s --check-prefix=NO_DEBUG
+int main (void) {
+ return 0;
+}
+
+// CHECK: metadata !{i32 1, metadata !"Debug Info Version", i32 1}
+// NO_DEBUG-NOT: metadata !"Debug Info Version"
diff --git a/test/CodeGen/debug-info-vla.c b/test/CodeGen/debug-info-vla.c
index 20fb6aace41f..7a8da960db47 100644
--- a/test/CodeGen/debug-info-vla.c
+++ b/test/CodeGen/debug-info-vla.c
@@ -1,9 +1,8 @@
// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s
-// CHECK: metadata !{i32 {{.*}}, metadata {{.*}}, metadata !"vla", metadata {{.*}}, i32 7, metadata {{.*}}, i32 0, i32 0, i64 2} ; [ DW_TAG_auto_variable ]
-
void testVLAwithSize(int s)
{
+// CHECK: metadata !{i32 {{.*}}, metadata {{.*}}, metadata !"vla", metadata {{.*}}, i32 [[@LINE+1]], metadata {{.*}}, i32 8192, i32 0} ; [ DW_TAG_auto_variable ] [vla] [line [[@LINE+1]]]
int vla[s];
int i;
for (i = 0; i < s; i++) {
diff --git a/test/CodeGen/decl-in-prototype.c b/test/CodeGen/decl-in-prototype.c
index 2c0fc4fc3b17..15efa6551bc3 100644
--- a/test/CodeGen/decl-in-prototype.c
+++ b/test/CodeGen/decl-in-prototype.c
@@ -2,13 +2,13 @@
const int AA = 5;
-// CHECK: define i32 @f1
+// CHECK-LABEL: define i32 @f1
int f1(enum {AA,BB} E) {
// CHECK: ret i32 1
return BB;
}
-// CHECK: define i32 @f2
+// CHECK-LABEL: define i32 @f2
int f2(enum {AA=7,BB} E) {
// CHECK: ret i32 7
return AA;
diff --git a/test/CodeGen/dependent-lib.c b/test/CodeGen/dependent-lib.c
new file mode 100644
index 000000000000..df4aaf073060
--- /dev/null
+++ b/test/CodeGen/dependent-lib.c
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 %s --dependent-lib=msvcrt -triple i686-pc-win32 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s --dependent-lib=msvcrt -triple x86_64-pc-win32 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s --dependent-lib=msvcrt -triple i686-pc-linux -emit-llvm -o - | FileCheck -check-prefix LINUX %s
+
+// CHECK: !llvm.module.flags = !{!0}
+// CHECK: !0 = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
+// CHECK: ![[link_opts]] = metadata !{metadata ![[msvcrt:[0-9]+]]}
+// CHECK: ![[msvcrt]] = metadata !{metadata !"/DEFAULTLIB:msvcrt.lib"}
+
+// LINUX: !llvm.module.flags = !{!0}
+// LINUX: !0 = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
+// LINUX: ![[link_opts]] = metadata !{metadata ![[msvcrt:[0-9]+]]}
+// LINUX: ![[msvcrt]] = metadata !{metadata !"-lmsvcrt"}
+
+int f();
diff --git a/test/CodeGen/designated-initializers.c b/test/CodeGen/designated-initializers.c
index 6561ce56d823..b11c67a45421 100644
--- a/test/CodeGen/designated-initializers.c
+++ b/test/CodeGen/designated-initializers.c
@@ -52,6 +52,93 @@ struct ds ds7 = {
.b = 3
};
+
+// <rdar://problem/10465114>
+struct overwrite_string_struct1 {
+ __typeof(L"foo"[0]) L[6];
+ int M;
+} overwrite_string1[] = { { { L"foo" }, 1 }, [0].L[2] = L'x'};
+// CHECK: [6 x i32] [i32 102, i32 111, i32 120, i32 0, i32 0, i32 0], i32 1
+struct overwrite_string_struct2 {
+ char L[6];
+ int M;
+} overwrite_string2[] = { { { "foo" }, 1 }, [0].L[2] = 'x'};
+// CHECK: [6 x i8] c"fox\00\00\00", i32 1
+struct overwrite_string_struct3 {
+ char L[3];
+ int M;
+} overwrite_string3[] = { { { "foo" }, 1 }, [0].L[2] = 'x'};
+// CHECK: [3 x i8] c"fox", i32 1
+struct overwrite_string_struct4 {
+ char L[3];
+ int M;
+} overwrite_string4[] = { { { "foobar" }, 1 }, [0].L[2] = 'x'};
+// CHECK: [3 x i8] c"fox", i32 1
+struct overwrite_string_struct5 {
+ char L[6];
+ int M;
+} overwrite_string5[] = { { { "foo" }, 1 }, [0].L[4] = 'y'};
+// CHECK: [6 x i8] c"foo\00y\00", i32 1
+
+
+// CHECK: @u1 = {{.*}} { i32 65535 }
+union u_FFFF { char c; long l; } u1 = { .l = 0xFFFF };
+
+
+/// PR16644
+typedef union u_16644 {
+ struct s_16644 {
+ int zero;
+ int one;
+ int two;
+ int three;
+ } a;
+ int b[4];
+} union_16644_t;
+
+// CHECK: @union_16644_instance_0 = {{.*}} { i32 0, i32 0, i32 0, i32 3 } }
+union_16644_t union_16644_instance_0 =
+{
+ .b[0] = 0,
+ .a.one = 1,
+ .b[2] = 2,
+ .a.three = 3,
+};
+
+// CHECK: @union_16644_instance_1 = {{.*}} [i32 10, i32 0, i32 0, i32 0]
+union_16644_t union_16644_instance_1 =
+{
+ .a.three = 13,
+ .b[2] = 12,
+ .a.one = 11,
+ .b[0] = 10,
+};
+
+// CHECK: @union_16644_instance_2 = {{.*}} [i32 0, i32 20, i32 0, i32 0]
+union_16644_t union_16644_instance_2 =
+{
+ .a.one = 21,
+ .b[1] = 20,
+};
+
+// CHECK: @union_16644_instance_3 = {{.*}} { i32 0, i32 31, i32 0, i32 0 }
+union_16644_t union_16644_instance_3 =
+{
+ .b[1] = 30,
+ .a = {
+ .one = 31
+ }
+};
+
+// CHECK: @union_16644_instance_4 = {{.*}} { i32 5, i32 2, i32 0, i32 0 } {{.*}} [i32 0, i32 4, i32 0, i32 0]
+union_16644_t union_16644_instance_4[2] =
+{
+ [0].a.one = 2,
+ [1].a.zero = 3,
+ [0].a.zero = 5,
+ [1].b[1] = 4
+};
+
void test1(int argc, char **argv)
{
// CHECK: internal global %struct.foo { i8* null, i32 1024 }
diff --git a/test/CodeGen/dllimport-dllexport.c b/test/CodeGen/dllimport-dllexport.c
index c187503c5cfa..e70ac03f04c7 100644
--- a/test/CodeGen/dllimport-dllexport.c
+++ b/test/CodeGen/dllimport-dllexport.c
@@ -2,11 +2,11 @@
void __attribute__((dllimport)) foo1();
void __attribute__((dllexport)) foo1(){}
-// CHECK: define dllexport void @foo1
+// CHECK-LABEL: define dllexport void @foo1
void __attribute__((dllexport)) foo2();
// PR6269
__declspec(dllimport) void foo3();
__declspec(dllexport) void foo3(){}
-// CHECK: define dllexport void @foo3
+// CHECK-LABEL: define dllexport void @foo3
__declspec(dllexport) void foo4();
diff --git a/test/CodeGen/dwarf-version.c b/test/CodeGen/dwarf-version.c
new file mode 100644
index 000000000000..6c0f097a3b88
--- /dev/null
+++ b/test/CodeGen/dwarf-version.c
@@ -0,0 +1,14 @@
+// RUN: %clang -target x86_64-linux-gnu -gdwarf-2 -S -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3
+// RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
+// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=LINUX
+// RUN: %clang -target x86_64-apple-darwin -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=DARWIN
+int main (void) {
+ return 0;
+}
+
+// CHECK: metadata !{i32 2, metadata !"Dwarf Version", i32 2}
+// VER3: metadata !{i32 2, metadata !"Dwarf Version", i32 3}
+// VER4: metadata !{i32 2, metadata !"Dwarf Version", i32 4}
+// LINUX: metadata !{i32 2, metadata !"Dwarf Version", i32 4}
+// DARWIN: metadata !{i32 2, metadata !"Dwarf Version", i32 2}
diff --git a/test/CodeGen/exceptions-seh.c b/test/CodeGen/exceptions-seh.c
new file mode 100644
index 000000000000..eadbe15cfff0
--- /dev/null
+++ b/test/CodeGen/exceptions-seh.c
@@ -0,0 +1,18 @@
+// RUN: not %clang_cc1 -triple i686-pc-win32 -fexceptions -fms-extensions -emit-llvm -o - %s 2>&1 | FileCheck %s
+
+// This is a codegen test because we only emit the diagnostic when we start
+// generating code.
+
+int SaveDiv(int numerator, int denominator, int *res) {
+ int myres = 0;
+ __try {
+ myres = numerator / denominator;
+ } __except (1) {
+ return 0;
+ }
+ *res = myres;
+ return 1;
+}
+// CHECK-NOT error
+// CHECK: error: cannot compile this SEH __try yet
+// CHECK-NOT error
diff --git a/test/CodeGen/exceptions.c b/test/CodeGen/exceptions.c
index 311bc84e6a16..ae0af4dd9d84 100644
--- a/test/CodeGen/exceptions.c
+++ b/test/CodeGen/exceptions.c
@@ -5,8 +5,8 @@
void test1() {
extern void test1_helper(void (^)(int));
- // CHECK: define void @test1()
- // CHECK-ARM: define arm_aapcscc void @test1()
+ // CHECK-LABEL: define void @test1()
+ // CHECK-ARM-LABEL: define arm_aapcscc void @test1()
__block int x = 10;
diff --git a/test/CodeGen/exprs.c b/test/CodeGen/exprs.c
index f8f28330ab77..2a2216946b25 100644
--- a/test/CodeGen/exprs.c
+++ b/test/CodeGen/exprs.c
@@ -121,7 +121,7 @@ void f10() {
}
// rdar://7530813
-// CHECK: define i32 @f11
+// CHECK-LABEL: define i32 @f11
int f11(long X) {
int A[100];
return A[X];
@@ -134,14 +134,14 @@ int f11(long X) {
int f12() {
// PR3150
- // CHECK: define i32 @f12
+ // CHECK-LABEL: define i32 @f12
// CHECK: ret i32 1
return 1||1;
}
// Make sure negate of fp uses -0.0 for proper -0 handling.
double f13(double X) {
- // CHECK: define double @f13
+ // CHECK-LABEL: define double @f13
// CHECK: fsub double -0.0
return -X;
}
@@ -151,7 +151,7 @@ void f14(struct s14 *a) {
(void) &*a;
}
-// CHECK: define void @f15
+// CHECK-LABEL: define void @f15
void f15() {
extern void f15_start(void);
f15_start();
@@ -168,7 +168,7 @@ void f15() {
}
// PR8967: this was crashing
-// CHECK: define void @f16()
+// CHECK-LABEL: define void @f16()
void f16() {
__extension__({ goto lbl; });
lbl:
@@ -176,7 +176,7 @@ void f16() {
}
// PR13704: negative increment in i128 is not preserved.
-// CHECK: define void @f17()
+// CHECK-LABEL: define void @f17()
void f17() {
extern void extfunc(__int128);
__int128 x = 2;
diff --git a/test/CodeGen/ext-vector.c b/test/CodeGen/ext-vector.c
index a9fa1511758b..0b78e97fbb36 100644
--- a/test/CodeGen/ext-vector.c
+++ b/test/CodeGen/ext-vector.c
@@ -286,3 +286,18 @@ int4 test15(uint4 V0) {
V = V || V;
return V;
}
+
+// CHECK: @test16
+void test16(float2 a, float2 b) {
+ float2 t0 = (a + b) / 2;
+}
+
+typedef char char16 __attribute__((ext_vector_type(16)));
+
+// CHECK: @test17
+void test17(void) {
+ char16 valA;
+ char valB;
+ char valC;
+ char16 destVal = valC ? valA : valB;
+}
diff --git a/test/CodeGen/fast-math.c b/test/CodeGen/fast-math.c
index 76cfbbd36548..4a513589ef4c 100644
--- a/test/CodeGen/fast-math.c
+++ b/test/CodeGen/fast-math.c
@@ -2,7 +2,7 @@
float f0, f1, f2;
void foo(void) {
- // CHECK: define void @foo()
+ // CHECK-LABEL: define void @foo()
// CHECK: fadd fast
f0 = f1 + f2;
diff --git a/test/CodeGen/finite-math.c b/test/CodeGen/finite-math.c
index bf39cea42cea..b0ee15759a5d 100644
--- a/test/CodeGen/finite-math.c
+++ b/test/CodeGen/finite-math.c
@@ -2,7 +2,7 @@
float f0, f1, f2;
void foo(void) {
- // CHECK: define void @foo()
+ // CHECK-LABEL: define void @foo()
// CHECK: fadd nnan ninf
f0 = f1 + f2;
diff --git a/test/CodeGen/fp16-ops.c b/test/CodeGen/fp16-ops.c
index e50651330670..a848ed16bd8a 100644
--- a/test/CodeGen/fp16-ops.c
+++ b/test/CodeGen/fp16-ops.c
@@ -7,7 +7,7 @@ volatile __fp16 h0 = 0.0, h1 = 1.0, h2;
volatile float f0, f1, f2;
void foo(void) {
- // CHECK: define void @foo()
+ // CHECK-LABEL: define void @foo()
// Check unary ops
diff --git a/test/CodeGen/func-return-member.c b/test/CodeGen/func-return-member.c
index 14ecac5d6bbb..efc30034e002 100644
--- a/test/CodeGen/func-return-member.c
+++ b/test/CodeGen/func-return-member.c
@@ -10,17 +10,17 @@ int X;
struct frk F;
float _Complex C;
-// CHECK: define void @bar
+// CHECK-LABEL: define void @bar
void bar(void) {
X = foo().f.f.x;
}
-// CHECK: define void @bun
+// CHECK-LABEL: define void @bun
void bun(void) {
F = foo().f.f;
}
-// CHECK: define void @ban
+// CHECK-LABEL: define void @ban
void ban(void) {
C = foo().f.f.c;
}
diff --git a/test/CodeGen/function-attributes.c b/test/CodeGen/function-attributes.c
index 25ca9163a191..47a056835571 100644
--- a/test/CodeGen/function-attributes.c
+++ b/test/CodeGen/function-attributes.c
@@ -24,7 +24,7 @@ void f6(signed short x) { }
void f7(unsigned short x) { }
-// CHECK: define void @f8()
+// CHECK-LABEL: define void @f8()
// CHECK: [[AI:#[0-9]+]]
// CHECK: {
void __attribute__((always_inline)) f8(void) { }
@@ -61,7 +61,7 @@ void f13(void){}
// Ensure that these get inlined: rdar://6853279
-// CHECK: define void @f14
+// CHECK-LABEL: define void @f14
// CHECK-NOT: @ai_
// CHECK: call void @f14_end
static __inline__ __attribute__((always_inline))
@@ -81,21 +81,21 @@ void f14(int a) {
}
// <rdar://problem/7102668> [irgen] clang isn't setting the optsize bit on functions
-// CHECK: define void @f15
+// CHECK-LABEL: define void @f15
// CHECK: [[NUW]]
// CHECK: {
void f15(void) {
}
// PR5254
-// CHECK: define void @f16
+// CHECK-LABEL: define void @f16
// CHECK: [[ALIGN:#[0-9]+]]
// CHECK: {
void __attribute__((force_align_arg_pointer)) f16(void) {
}
// PR11038
-// CHECK: define void @f18()
+// CHECK-LABEL: define void @f18()
// CHECK: [[RT:#[0-9]+]]
// CHECK: {
// CHECK: call void @f17()
@@ -106,7 +106,7 @@ __attribute__ ((returns_twice)) void f18(void) {
f17();
}
-// CHECK: define void @f19()
+// CHECK-LABEL: define void @f19()
// CHECK: {
// CHECK: call i32 @setjmp(i32* null)
// CHECK: [[RT_CALL]]
diff --git a/test/CodeGen/functions.c b/test/CodeGen/functions.c
index 8241a3d1674a..55f2d5f35ce3 100644
--- a/test/CodeGen/functions.c
+++ b/test/CodeGen/functions.c
@@ -20,14 +20,14 @@ int a(int);
int a() {return 1;}
void f0() {}
-// CHECK: define void @f0()
+// CHECK-LABEL: define void @f0()
void f1();
void f2(void) {
// CHECK: call void @f1()
f1(1, 2, 3);
}
-// CHECK: define void @f1()
+// CHECK-LABEL: define void @f1()
void f1() {}
// CHECK: define {{.*}} @f3{{\(\)|\(.*sret.*\)}}
@@ -54,7 +54,7 @@ void f8_callback(struct Incomplete);
void f8_user(void (*callback)(struct Incomplete));
void f8_test() {
f8_user(&f8_callback);
-// CHECK: define void @f8_test()
+// CHECK-LABEL: define void @f8_test()
// CHECK: call void @f8_user({{.*}}* bitcast (void ()* @f8_callback to {{.*}}*))
// CHECK: declare void @f8_user({{.*}}*)
// CHECK: declare void @f8_callback()
diff --git a/test/CodeGen/implicit-arg.c b/test/CodeGen/implicit-arg.c
index 52ab58ec9801..c25f034a1a38 100644
--- a/test/CodeGen/implicit-arg.c
+++ b/test/CodeGen/implicit-arg.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -O0 -o -
+// RUN: %clang_cc1 %s -emit-llvm -o -
// RUN: %clang_cc1 %s -emit-llvm -O1 -o -
// rdar://6518089
diff --git a/test/CodeGen/incomplete-function-type.c b/test/CodeGen/incomplete-function-type.c
index b6309472a5bc..fc216dae4a71 100644
--- a/test/CodeGen/incomplete-function-type.c
+++ b/test/CodeGen/incomplete-function-type.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
// CHECK: ModuleID
// CHECK-NOT: opaque
-// CHECK: define void @f0
+// CHECK-LABEL: define void @f0
enum teste1 test1f(void), (*test1)(void) = test1f;
struct tests2 test2f(), (*test2)() = test2f;
diff --git a/test/CodeGen/inline.c b/test/CodeGen/inline.c
index 442b38000b3c..70ab696b64ee 100644
--- a/test/CodeGen/inline.c
+++ b/test/CodeGen/inline.c
@@ -1,55 +1,64 @@
// RUN: echo "GNU89 tests:"
-// RUN: %clang %s -target i386-unknown-unknown -O1 -emit-llvm -S -o - -std=gnu89 | FileCheck %s --check-prefix=CHECK1
-// CHECK1: define i32 @foo()
-// CHECK1: define i32 @bar()
-// CHECK1: define void @unreferenced1()
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -O1 -disable-llvm-optzns -emit-llvm -o - -std=gnu89 | FileCheck %s --check-prefix=CHECK1
+// CHECK1-LABEL: define i32 @foo()
+// CHECK1-LABEL: define i32 @bar()
+// CHECK1-LABEL: define void @unreferenced1()
// CHECK1-NOT: unreferenced2
-// CHECK1: define void @gnu_inline()
-// CHECK1: define i32 @test1
-// CHECK1: define i32 @test2
-// CHECK1: define void @test3()
-// CHECK1: define available_externally i32 @test4
-// CHECK1: define available_externally i32 @test5
-// CHECK1: define i32 @test6
-// CHECK1: define void @test7
+// CHECK1-LABEL: define void @gnu_inline()
+// CHECK1-LABEL: define i32 @test1
+// CHECK1-LABEL: define i32 @test2
+// CHECK1-LABEL: define void @test3()
+// CHECK1-LABEL: define available_externally i32 @test4
+// CHECK1-LABEL: define available_externally i32 @test5
+// CHECK1-LABEL: define i32 @test6
+// CHECK1-LABEL: define void @test7
// CHECK1: define i{{..}} @strlcpy
// CHECK1-NOT: test9
-// CHECK1: define void @testA
-// CHECK1: define void @testB
-// CHECK1: define void @testC
-// CHECK1: define available_externally void @gnu_ei_inline()
-// CHECK1: define available_externally i32 @ei()
+// CHECK1-LABEL: define void @testA
+// CHECK1-LABEL: define void @testB
+// CHECK1-LABEL: define void @testC
+// CHECK1-LABEL: define available_externally void @gnu_ei_inline()
+// CHECK1-LABEL: define available_externally i32 @ei()
// RUN: echo "C99 tests:"
-// RUN: %clang %s -target i386-unknown-unknown -O1 -emit-llvm -S -o - -std=gnu99 | FileCheck %s --check-prefix=CHECK2
-// CHECK2: define i32 @ei()
-// CHECK2: define i32 @bar()
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -O1 -disable-llvm-optzns -emit-llvm -o - -std=gnu99 | FileCheck %s --check-prefix=CHECK2
+// CHECK2-LABEL: define i32 @ei()
+// CHECK2-LABEL: define i32 @bar()
// CHECK2-NOT: unreferenced1
-// CHECK2: define void @unreferenced2()
-// CHECK2: define void @gnu_inline()
-// CHECK2: define i32 @test1
-// CHECK2: define i32 @test2
-// CHECK2: define void @test3
-// CHECK2: define available_externally i32 @test4
-// CHECK2: define available_externally i32 @test5
-// CHECK2: define i32 @test6
-// CHECK2: define void @test7
+// CHECK2-LABEL: define void @unreferenced2()
+// CHECK2-LABEL: define void @gnu_inline()
+// CHECK2-LABEL: define i32 @test1
+// CHECK2-LABEL: define i32 @test2
+// CHECK2-LABEL: define void @test3
+// CHECK2-LABEL: define available_externally i32 @test4
+// CHECK2-LABEL: define available_externally i32 @test5
+// CHECK2-LABEL: define i32 @test6
+// CHECK2-LABEL: define void @test7
// CHECK2: define available_externally i{{..}} @strlcpy
-// CHECK2: define void @test9
-// CHECK2: define void @testA
-// CHECK2: define void @testB
-// CHECK2: define void @testC
-// CHECK2: define available_externally void @gnu_ei_inline()
-// CHECK2: define available_externally i32 @foo()
+// CHECK2-LABEL: define void @test9
+// CHECK2-LABEL: define void @testA
+// CHECK2-LABEL: define void @testB
+// CHECK2-LABEL: define void @testC
+// CHECK2-LABEL: define available_externally void @gnu_ei_inline()
+// CHECK2-LABEL: define available_externally i32 @foo()
// RUN: echo "C++ tests:"
-// RUN: %clang -x c++ %s -target i386-unknown-unknown -O1 -emit-llvm -S -o - -std=c++98 | FileCheck %s --check-prefix=CHECK3
-// CHECK3: define i32 @_Z3barv()
-// CHECK3: define linkonce_odr i32 @_Z3foov()
+// RUN: %clang_cc1 -x c++ %s -triple i386-unknown-unknown -O1 -disable-llvm-optzns -emit-llvm -o - -std=c++98 | FileCheck %s --check-prefix=CHECK3
+// CHECK3-LABEL: define i32 @_Z3barv()
+// CHECK3-LABEL: define linkonce_odr i32 @_Z3foov()
// CHECK3-NOT: unreferenced
-// CHECK3: define void @_Z10gnu_inlinev()
-// CHECK3: define available_externally void @_Z13gnu_ei_inlinev()
-// CHECK3: define linkonce_odr i32 @_Z2eiv()
+// CHECK3-LABEL: define void @_Z10gnu_inlinev()
+// CHECK3-LABEL: define available_externally void @_Z13gnu_ei_inlinev()
+// CHECK3-LABEL: define linkonce_odr i32 @_Z2eiv()
+
+// RUN: echo "MS C Mode tests:"
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -O1 -disable-llvm-optzns -emit-llvm -o - -std=c99 -fms-compatibility | FileCheck %s --check-prefix=CHECK4
+// CHECK4-LABEL: define i32 @bar()
+// CHECK4-LABEL: define void @gnu_inline()
+// CHECK4-LABEL: define available_externally void @gnu_ei_inline()
+// CHECK4-LABEL: define linkonce_odr i32 @foo()
+// CHECK4-NOT: unreferenced
+// CHECK4-LABEL: define linkonce_odr i32 @ei()
extern __inline int ei() { return 123; }
diff --git a/test/CodeGen/inline2.c b/test/CodeGen/inline2.c
index fca4fff7ca8d..670ae201f9ba 100644
--- a/test/CodeGen/inline2.c
+++ b/test/CodeGen/inline2.c
@@ -1,60 +1,60 @@
-// RUN: %clang_cc1 -O1 -std=gnu89 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix GNU89 %s
-// RUN: %clang_cc1 -O1 -std=c99 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix C99 %s
+// RUN: %clang_cc1 -O1 -std=gnu89 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-GNU89 %s
+// RUN: %clang_cc1 -O1 -std=c99 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-C99 %s
-// CHECK-GNU89: define i32 @f0()
-// CHECK-C99: define i32 @f0()
+// CHECK-GNU89-LABEL: define i32 @f0()
+// CHECK-C99-LABEL: define i32 @f0()
int f0(void);
int f0(void) { return 0; }
-// CHECK-GNU89: define i32 @f1()
-// CHECK-C99: define i32 @f1()
+// CHECK-GNU89-LABEL: define i32 @f1()
+// CHECK-C99-LABEL: define i32 @f1()
inline int f1(void);
int f1(void) { return 0; }
-// CHECK-GNU89: define i32 @f2()
-// CHECK-C99: define i32 @f2()
+// CHECK-GNU89-LABEL: define i32 @f2()
+// CHECK-C99-LABEL: define i32 @f2()
int f2(void);
inline int f2(void) { return 0; }
-// CHECK-GNU89: define i32 @f3()
-// CHECK-C99: define i32 @f3()
+// CHECK-GNU89-LABEL: define i32 @f3()
+// CHECK-C99-LABEL: define i32 @f3()
extern inline int f3(void);
int f3(void) { return 0; }
-// CHECK-GNU89: define i32 @f5()
-// CHECK-C99: define i32 @f5()
+// CHECK-GNU89-LABEL: define i32 @f5()
+// CHECK-C99-LABEL: define i32 @f5()
extern inline int f5(void);
inline int f5(void) { return 0; }
-// CHECK-GNU89: define i32 @f6()
-// CHECK-C99: define i32 @f6()
+// CHECK-GNU89-LABEL: define i32 @f6()
+// CHECK-C99-LABEL: define i32 @f6()
inline int f6(void);
extern inline int f6(void) { return 0; }
-// CHECK-GNU89: define i32 @f7()
-// CHECK-C99: define i32 @f7()
+// CHECK-GNU89-LABEL: define i32 @f7()
+// CHECK-C99-LABEL: define i32 @f7()
extern inline int f7(void);
extern int f7(void) { return 0; }
-// CHECK-GNU89: define i32 @fA()
+// CHECK-GNU89-LABEL: define i32 @fA()
inline int fA(void) { return 0; }
-// CHECK-GNU89: define available_externally i32 @f4()
-// CHECK-C99: define i32 @f4()
+// CHECK-GNU89-LABEL: define available_externally i32 @f4()
+// CHECK-C99-LABEL: define i32 @f4()
int f4(void);
extern inline int f4(void) { return 0; }
-// CHECK-GNU89: define available_externally i32 @f8()
-// CHECK-C99: define i32 @f8()
+// CHECK-GNU89-LABEL: define available_externally i32 @f8()
+// CHECK-C99-LABEL: define i32 @f8()
extern int f8(void);
extern inline int f8(void) { return 0; }
-// CHECK-GNU89: define available_externally i32 @f9()
-// CHECK-C99: define i32 @f9()
+// CHECK-GNU89-LABEL: define available_externally i32 @f9()
+// CHECK-C99-LABEL: define i32 @f9()
extern inline int f9(void);
extern inline int f9(void) { return 0; }
-// CHECK-C99: define available_externally i32 @fA()
+// CHECK-C99-LABEL: define available_externally i32 @fA()
int test_all() {
return f0() + f1() + f2() + f3() + f4() + f5() + f6() + f7() + f8() + f9()
diff --git a/test/CodeGen/integer-overflow.c b/test/CodeGen/integer-overflow.c
index ed2dede7814c..a007960dec83 100644
--- a/test/CodeGen/integer-overflow.c
+++ b/test/CodeGen/integer-overflow.c
@@ -8,9 +8,9 @@
// Tests for signed integer overflow stuff.
// rdar://7432000 rdar://7221421
void test1() {
- // DEFAULT: define void @test1
- // WRAPV: define void @test1
- // TRAPV: define void @test1
+ // DEFAULT-LABEL: define void @test1
+ // WRAPV-LABEL: define void @test1
+ // TRAPV-LABEL: define void @test1
extern volatile int f11G, a, b;
// DEFAULT: add nsw i32
diff --git a/test/CodeGen/le32-arguments.c b/test/CodeGen/le32-arguments.c
index 2cbbc0fbea45..d26640e6927a 100644
--- a/test/CodeGen/le32-arguments.c
+++ b/test/CodeGen/le32-arguments.c
@@ -2,7 +2,7 @@
// Basic argument/attribute tests for le32/PNaCl
-// CHECK: define void @f0(i32 %i, i32 %j, double %k)
+// CHECK-LABEL: define void @f0(i32 %i, i32 %j, double %k)
void f0(int i, long j, double k) {}
typedef struct {
@@ -10,27 +10,27 @@ typedef struct {
int bb;
} s1;
// Structs should be passed byval and not split up
-// CHECK: define void @f1(%struct.s1* byval %i)
+// CHECK-LABEL: define void @f1(%struct.s1* byval %i)
void f1(s1 i) {}
typedef struct {
int cc;
} s2;
// Structs should be returned sret and not simplified by the frontend
-// CHECK: define void @f2(%struct.s2* noalias sret %agg.result)
+// CHECK-LABEL: define void @f2(%struct.s2* noalias sret %agg.result)
s2 f2() {
s2 foo;
return foo;
}
-// CHECK: define void @f3(i64 %i)
+// CHECK-LABEL: define void @f3(i64 %i)
void f3(long long i) {}
// i8/i16 should be signext, i32 and higher should not
-// CHECK: define void @f4(i8 signext %a, i16 signext %b)
+// CHECK-LABEL: define void @f4(i8 signext %a, i16 signext %b)
void f4(char a, short b) {}
-// CHECK: define void @f5(i8 zeroext %a, i16 zeroext %b)
+// CHECK-LABEL: define void @f5(i8 zeroext %a, i16 zeroext %b)
void f5(unsigned char a, unsigned short b) {}
@@ -40,7 +40,7 @@ enum my_enum {
ENUM3,
};
// Enums should be treated as the underlying i32
-// CHECK: define void @f6(i32 %a)
+// CHECK-LABEL: define void @f6(i32 %a)
void f6(enum my_enum a) {}
union simple_union {
@@ -48,7 +48,7 @@ union simple_union {
char b;
};
// Unions should be passed as byval structs
-// CHECK: define void @f7(%union.simple_union* byval %s)
+// CHECK-LABEL: define void @f7(%union.simple_union* byval %s)
void f7(union simple_union s) {}
typedef struct {
@@ -57,5 +57,5 @@ typedef struct {
int b8 : 8;
} bitfield1;
// Bitfields should be passed as byval structs
-// CHECK: define void @f8(%struct.bitfield1* byval %bf1)
+// CHECK-LABEL: define void @f8(%struct.bitfield1* byval %bf1)
void f8(bitfield1 bf1) {}
diff --git a/test/CodeGen/le32-libcall-pow.c b/test/CodeGen/le32-libcall-pow.c
new file mode 100644
index 000000000000..1b8a7a33a562
--- /dev/null
+++ b/test/CodeGen/le32-libcall-pow.c
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -fno-math-builtin -fmath-errno -emit-llvm -o - %s -triple le32-unknown-nacl | FileCheck %s
+// RUN: %clang_cc1 -fno-math-builtin -emit-llvm -o - %s -triple le32-unknown-nacl | FileCheck %s
+
+// le32 (PNaCl) never generates intrinsics for pow calls, with or without
+// errno, when the -fno-math-builtin flag is passed to -cc1. A separate test
+// makes sure this flag is indeed passed for le32.
+
+float powf(float, float);
+double pow(double, double);
+long double powl(long double, long double);
+
+// CHECK-LABEL: define void @test_pow
+void test_pow(float a0, double a1, long double a2) {
+ // CHECK: call float @powf
+ float l0 = powf(a0, a0);
+
+ // CHECK: call double @pow
+ double l1 = pow(a1, a1);
+
+ // CHECK: call double @powl
+ long double l2 = powl(a2, a2);
+}
+
+// CHECK: declare float @powf(float, float)
+// CHECK: declare double @pow(double, double)
+// CHECK: declare double @powl(double, double)
+
diff --git a/test/CodeGen/libcall-declarations.c b/test/CodeGen/libcall-declarations.c
index d07590ff1171..6442e29bd86e 100644
--- a/test/CodeGen/libcall-declarations.c
+++ b/test/CodeGen/libcall-declarations.c
@@ -1,194 +1,596 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin12 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=CHECK-NOERRNO
// RUN: %clang_cc1 -triple x86_64-linux-gnu -S -o - -emit-llvm -fmath-errno %s | FileCheck %s -check-prefix=CHECK-ERRNO
+// RUN: %clang_cc1 -triple x86_64-apple-darwin12 -S -o - -emit-llvm -x c++ %s | FileCheck %s -check-prefix=CHECK-NOERRNO
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -S -o - -emit-llvm -x c++ -fmath-errno %s | FileCheck %s -check-prefix=CHECK-ERRNO
// Prototypes.
+#ifdef __cplusplus
+extern "C" {
+#endif
+double atan2(double, double);
+float atan2f(float, float);
+long double atan2l(long double, long double);
+int abs(int);
+long int labs(long int);
+long long int llabs(long long int);
+double copysign(double, double);
+float copysignf(float, float);
+long double copysignl(long double, long double);
+double fabs(double);
+float fabsf(float);
+long double fabsl(long double);
+double fmod(double, double);
+float fmodf(float, float);
+long double fmodl(long double, long double);
+double frexp(double, int *);
+float frexpf(float, int *);
+long double frexpl(long double, int *);
+double ldexp(double, int);
+float ldexpf(float, int);
+long double ldexpl(long double, int);
+double modf(double, double *);
+float modff(float, float *);
+long double modfl(long double, long double *);
+double nan(const char *);
+float nanf(const char *);
+long double nanl(const char *);
+double pow(double, double);
+float powf(float, float);
+long double powl(long double, long double);
double acos(double);
-long double acosl(long double);
float acosf(float);
+long double acosl(long double);
+double acosh(double);
+float acoshf(float);
+long double acoshl(long double);
double asin(double);
-long double asinl(long double);
float asinf(float);
+long double asinl(long double);
+double asinh(double);
+float asinhf(float);
+long double asinhl(long double);
double atan(double);
-long double atanl(long double);
float atanf(float);
-double atan2(double, double);
-long double atan2l(long double, long double);
-float atan2f(float, float);
+long double atanl( long double);
+double atanh(double);
+float atanhf(float);
+long double atanhl(long double);
+double cbrt(double);
+float cbrtf(float);
+long double cbrtl(long double);
double ceil(double);
-long double ceill(long double);
float ceilf(float);
-double copysign(double, double);
-long double copysignl(long double, long double);
-float copysignf(float, float);
+long double ceill(long double);
double cos(double);
-long double cosl(long double);
float cosf(float);
+long double cosl(long double);
+double cosh(double);
+float coshf(float);
+long double coshl(long double);
+double erf(double);
+float erff(float);
+long double erfl(long double);
+double erfc(double);
+float erfcf(float);
+long double erfcl(long double);
double exp(double);
-long double expl(long double);
float expf(float);
+long double expl(long double);
double exp2(double);
-long double exp2l(long double);
float exp2f(float);
-double fabs(double);
-long double fabsl(long double);
-float fabsf(float);
+long double exp2l(long double);
+double expm1(double);
+float expm1f(float);
+long double expm1l(long double);
+double fdim(double, double);
+float fdimf(float, float);
+long double fdiml(long double, long double);
double floor(double);
-long double floorl(long double);
float floorf(float);
+long double floorl(long double);
double fma(double, double, double);
-long double fmal(long double, long double, long double);
float fmaf(float, float, float);
+long double fmal(long double, long double, long double);
double fmax(double, double);
-long double fmaxl(long double, long double);
float fmaxf(float, float);
+long double fmaxl(long double, long double);
double fmin(double, double);
-long double fminl(long double, long double);
float fminf(float, float);
+long double fminl(long double, long double);
+double hypot(double, double);
+float hypotf(float, float);
+long double hypotl(long double, long double);
+int ilogb(double);
+int ilogbf(float);
+int ilogbl(long double);
+double lgamma(double);
+float lgammaf(float);
+long double lgammal(long double);
+long long int llrint(double);
+long long int llrintf(float);
+long long int llrintl(long double);
+long long int llround(double);
+long long int llroundf(float);
+long long int llroundl(long double);
double log(double);
-long double logl(long double);
float logf(float);
+long double logl(long double);
+double log10(double);
+float log10f(float);
+long double log10l(long double);
+double log1p(double);
+float log1pf(float);
+long double log1pl(long double);
double log2(double);
-long double log2l(long double);
float log2f(float);
+long double log2l(long double);
+double logb(double);
+float logbf(float);
+long double logbl(long double);
+long int lrint(double);
+long int lrintf(float);
+long int lrintl(long double);
+long int lround(double);
+long int lroundf(float);
+long int lroundl(long double);
double nearbyint(double);
-long double nearbyintl(long double);
float nearbyintf(float);
-double pow(double, double);
-long double powl(long double, long double);
-float powf(float, float);
+long double nearbyintl(long double);
+double nextafter(double, double);
+float nextafterf(float, float);
+long double nextafterl(long double, long double);
+double nexttoward(double, long double);
+float nexttowardf(float, long double);
+long double nexttowardl(long double, long double);
+double remainder(double, double);
+float remainderf(float, float);
+long double remainderl(long double, long double);
double rint(double);
-long double rintl(long double);
float rintf(float);
+long double rintl(long double);
double round(double);
-long double roundl(long double);
float roundf(float);
+long double roundl(long double);
+double scalbln(double, long int exp);
+float scalblnf(float, long int exp);
+long double scalblnl(long double, long int exp);
+double scalbn(double, int exp);
+float scalbnf(float, int exp);
+long double scalbnl(long double, int exp);
double sin(double);
-long double sinl(long double);
float sinf(float);
+long double sinl(long double);
+double sinh(double);
+float sinhf(float);
+long double sinhl(long double);
double sqrt(double);
-long double sqrtl(long double);
float sqrtf(float);
+long double sqrtl(long double);
double tan(double);
-long double tanl(long double);
float tanf(float);
+long double tanl(long double);
+double tanh(double);
+float tanhf(float);
+long double tanhl(long double);
+double tgamma(double);
+float tgammaf(float);
+long double tgammal(long double);
double trunc(double);
-long double truncl(long double);
float truncf(float);
+long double truncl(long double);
+double cabs(double _Complex);
+float cabsf(float _Complex);
+long double cabsl(long double _Complex);
+double _Complex cacos(double _Complex);
+float _Complex cacosf(float _Complex);
+long double _Complex cacosl(long double _Complex);
+double _Complex cacosh(double _Complex);
+float _Complex cacoshf(float _Complex);
+long double _Complex cacoshl(long double _Complex);
+double carg(double _Complex);
+float cargf(float _Complex);
+long double cargl(long double _Complex);
+double _Complex casin(double _Complex);
+float _Complex casinf(float _Complex);
+long double _Complex casinl(long double _Complex);
+double _Complex casinh(double _Complex);
+float _Complex casinhf(float _Complex);
+long double _Complex casinhl(long double _Complex);
+double _Complex catan(double _Complex);
+float _Complex catanf(float _Complex);
+long double _Complex catanl(long double _Complex);
+double _Complex catanh(double _Complex);
+float _Complex catanhf(float _Complex);
+long double _Complex catanhl(long double _Complex);
+double _Complex ccos(double _Complex);
+float _Complex ccosf(float _Complex);
+long double _Complex ccosl(long double _Complex);
+double _Complex ccosh(double _Complex);
+float _Complex ccoshf(float _Complex);
+long double _Complex ccoshl(long double _Complex);
+double _Complex cexp(double _Complex);
+float _Complex cexpf(float _Complex);
+long double _Complex cexpl(long double _Complex);
+double cimag(double _Complex);
+float cimagf(float _Complex);
+long double cimagl(long double _Complex);
+double _Complex conj(double _Complex);
+float _Complex conjf(float _Complex);
+long double _Complex conjl(long double _Complex);
+double _Complex clog(double _Complex);
+float _Complex clogf(float _Complex);
+long double _Complex clogl(long double _Complex);
+double _Complex cproj(double _Complex);
+float _Complex cprojf(float _Complex);
+long double _Complex cprojl(long double _Complex);
+double _Complex cpow(double _Complex, _Complex double);
+float _Complex cpowf(float _Complex, _Complex float);
+long double _Complex cpowl(long double _Complex, _Complex long double);
+double creal(double _Complex);
+float crealf(float _Complex);
+long double creall(long double _Complex);
+double _Complex csin(double _Complex);
+float _Complex csinf(float _Complex);
+long double _Complex csinl(long double _Complex);
+double _Complex csinh(double _Complex);
+float _Complex csinhf(float _Complex);
+long double _Complex csinhl(long double _Complex);
+double _Complex csqrt(double _Complex);
+float _Complex csqrtf(float _Complex);
+long double _Complex csqrtl(long double _Complex);
+double _Complex ctan(double _Complex);
+float _Complex ctanf(float _Complex);
+long double _Complex ctanl(long double _Complex);
+double _Complex ctanh(double _Complex);
+float _Complex ctanhf(float _Complex);
+long double _Complex ctanhl(long double _Complex);
+#ifdef __cplusplus
+}
+#endif
// Force emission of the declare statements.
+#define F(x) ((void*)x)
void *use[] = {
- acos, acosl, acosf, asin, asinl, asinf, atan, atanl, atanf, atan2, atan2l,
- atan2f, ceil, ceill, ceilf, copysign, copysignl, copysignf, cos, cosl, cosf,
- exp, expl, expf, exp2, exp2l, exp2f, fabs, fabsl, fabsf, floor, floorl,
- floorf, fma, fmal, fmaf, fmax, fmaxl, fmaxf, fmin, fminl, fminf, log, logl,
- logf, log2, log2l, log2f, nearbyint, nearbyintl, nearbyintf, pow, powl, powf,
- rint, rintl, rintf, round, roundl, roundf, sin, sinl, sinf, sqrt, sqrtl,
- sqrtf, tan, tanl, tanf, trunc, truncl, truncf
+ F(atan2), F(atan2f), F(atan2l), F(abs), F(labs),
+ F(llabs), F(copysign), F(copysignf), F(copysignl), F(fabs),
+ F(fabsf), F(fabsl), F(fmod), F(fmodf), F(fmodl),
+ F(frexp), F(frexpf), F(frexpl), F(ldexp), F(ldexpf),
+ F(ldexpl), F(modf), F(modff), F(modfl), F(nan),
+ F(nanf), F(nanl), F(pow), F(powf), F(powl),
+ F(acos), F(acosf), F(acosl), F(acosh), F(acoshf),
+ F(acoshl), F(asin), F(asinf), F(asinl), F(asinh),
+ F(asinhf), F(asinhl), F(atan), F(atanf), F(atanl),
+ F(atanh), F(atanhf), F(atanhl), F(cbrt), F(cbrtf),
+ F(cbrtl), F(ceil), F(ceilf), F(ceill), F(cos),
+ F(cosf), F(cosl), F(cosh), F(coshf), F(coshl),
+ F(erf), F(erff), F(erfl), F(erfc), F(erfcf),
+ F(erfcl), F(exp), F(expf), F(expl), F(exp2),
+ F(exp2f), F(exp2l), F(expm1), F(expm1f), F(expm1l),
+ F(fdim), F(fdimf), F(fdiml), F(floor), F(floorf),
+ F(floorl), F(fma), F(fmaf), F(fmal), F(fmax),
+ F(fmaxf), F(fmaxl), F(fmin), F(fminf), F(fminl),
+ F(hypot), F(hypotf), F(hypotl), F(ilogb), F(ilogbf),
+ F(ilogbl), F(lgamma), F(lgammaf), F(lgammal), F(llrint),
+ F(llrintf), F(llrintl), F(llround), F(llroundf), F(llroundl),
+ F(log), F(logf), F(logl), F(log10), F(log10f),
+ F(log10l), F(log1p), F(log1pf), F(log1pl), F(log2),
+ F(log2f), F(log2l), F(logb), F(logbf), F(logbl),
+ F(lrint), F(lrintf), F(lrintl), F(lround), F(lroundf),
+ F(lroundl), F(nearbyint), F(nearbyintf), F(nearbyintl), F(nextafter),
+ F(nextafterf), F(nextafterl), F(nexttoward), F(nexttowardf), F(nexttowardl),
+ F(remainder), F(remainderf), F(remainderl), F(rint), F(rintf),
+ F(rintl), F(round), F(roundf), F(roundl), F(scalbln),
+ F(scalblnf), F(scalblnl), F(scalbn), F(scalbnf), F(scalbnl),
+ F(sin), F(sinf), F(sinl), F(sinh), F(sinhf),
+ F(sinhl), F(sqrt), F(sqrtf), F(sqrtl), F(tan),
+ F(tanf), F(tanl), F(tanh), F(tanhf), F(tanhl),
+ F(tgamma), F(tgammaf), F(tgammal), F(trunc), F(truncf),
+ F(truncl), F(cabs), F(cabsf), F(cabsl), F(cacos),
+ F(cacosf), F(cacosl), F(cacosh), F(cacoshf), F(cacoshl),
+ F(carg), F(cargf), F(cargl), F(casin), F(casinf),
+ F(casinl), F(casinh), F(casinhf), F(casinhl), F(catan),
+ F(catanf), F(catanl), F(catanh), F(catanhf), F(catanhl),
+ F(ccos), F(ccosf), F(ccosl), F(ccosh), F(ccoshf),
+ F(ccoshl), F(cexp), F(cexpf), F(cexpl), F(cimag),
+ F(cimagf), F(cimagl), F(conj), F(conjf), F(conjl),
+ F(clog), F(clogf), F(clogl), F(cproj), F(cprojf),
+ F(cprojl), F(cpow), F(cpowf), F(cpowl), F(creal),
+ F(crealf), F(creall), F(csin), F(csinf), F(csinl),
+ F(csinh), F(csinhf), F(csinhl), F(csqrt), F(csqrtf),
+ F(csqrtl), F(ctan), F(ctanf), F(ctanl), F(ctanh),
+ F(ctanhf), F(ctanhl)
};
-// CHECK-NOERRNO: declare double @acos(double) [[NUW:#[0-9]+]]
-// CHECK-NOERRNO: declare x86_fp80 @acosl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @atan2(double, double) [[NUW:#[0-9]+]]
+// CHECK-NOERRNO: declare float @atan2f(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare i32 @abs(i32) [[NUW]]
+// CHECK-NOERRNO: declare i64 @labs(i64) [[NUW]]
+// CHECK-NOERRNO: declare i64 @llabs(i64) [[NUW]]
+// CHECK-NOERRNO: declare double @copysign(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @copysignf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @fabs(double) [[NUW]]
+// CHECK-NOERRNO: declare float @fabsf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @fabsl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @fmod(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @fmodf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @fmodl(x86_fp80, x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @ldexp(double, i32) [[NUW]]
+// CHECK-NOERRNO: declare float @ldexpf(float, i32) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @ldexpl(x86_fp80, i32) [[NUW]]
+// CHECK-NOERRNO: declare double @nan(i8*) [[NUW]]
+// CHECK-NOERRNO: declare float @nanf(i8*) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @nanl(i8*) [[NUW]]
+// CHECK-NOERRNO: declare double @pow(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @powf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @powl(x86_fp80, x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @acos(double) [[NUW]]
// CHECK-NOERRNO: declare float @acosf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @acosl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @acosh(double) [[NUW]]
+// CHECK-NOERRNO: declare float @acoshf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @acoshl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @asin(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @asinl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @asinf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @asinl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @asinh(double) [[NUW]]
+// CHECK-NOERRNO: declare float @asinhf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @asinhl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @atan(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @atanl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @atanf(float) [[NUW]]
-// CHECK-NOERRNO: declare double @atan2(double, double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[NUW]]
-// CHECK-NOERRNO: declare float @atan2f(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @atanl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @atanh(double) [[NUW]]
+// CHECK-NOERRNO: declare float @atanhf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @atanhl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @cbrt(double) [[NUW]]
+// CHECK-NOERRNO: declare float @cbrtf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @cbrtl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @ceil(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @ceill(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @ceilf(float) [[NUW]]
-// CHECK-NOERRNO: declare double @copysign(double, double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) [[NUW]]
-// CHECK-NOERRNO: declare float @copysignf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @ceill(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @cos(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @cosl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @cosf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @cosl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @cosh(double) [[NUW]]
+// CHECK-NOERRNO: declare float @coshf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @coshl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @erf(double) [[NUW]]
+// CHECK-NOERRNO: declare float @erff(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @erfl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @erfc(double) [[NUW]]
+// CHECK-NOERRNO: declare float @erfcf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @erfcl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @exp(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @expl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @expf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @expl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @exp2(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @exp2l(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @exp2f(float) [[NUW]]
-// CHECK-NOERRNO: declare double @fabs(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @fabsl(x86_fp80) [[NUW]]
-// CHECK-NOERRNO: declare float @fabsf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @exp2l(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @expm1(double) [[NUW]]
+// CHECK-NOERRNO: declare float @expm1f(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @expm1l(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @fdim(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @fdimf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @fdiml(x86_fp80, x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @floor(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @floorl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @floorf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @floorl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @fma(double, double, double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @fmal(x86_fp80, x86_fp80, x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @fmaf(float, float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @fmal(x86_fp80, x86_fp80, x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @fmax(double, double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @fmaxf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @fmin(double, double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @fminf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @hypot(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @hypotf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @hypotl(x86_fp80, x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare i32 @ilogb(double) [[NUW]]
+// CHECK-NOERRNO: declare i32 @ilogbf(float) [[NUW]]
+// CHECK-NOERRNO: declare i32 @ilogbl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @lgamma(double) [[NUW]]
+// CHECK-NOERRNO: declare float @lgammaf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @lgammal(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare i64 @llrint(double) [[NUW]]
+// CHECK-NOERRNO: declare i64 @llrintf(float) [[NUW]]
+// CHECK-NOERRNO: declare i64 @llrintl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare i64 @llround(double) [[NUW]]
+// CHECK-NOERRNO: declare i64 @llroundf(float) [[NUW]]
+// CHECK-NOERRNO: declare i64 @llroundl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @log(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @logl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @logf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @logl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @log10(double) [[NUW]]
+// CHECK-NOERRNO: declare float @log10f(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @log10l(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @log1p(double) [[NUW]]
+// CHECK-NOERRNO: declare float @log1pf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @log1pl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @log2(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @log2l(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @log2f(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @log2l(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @logb(double) [[NUW]]
+// CHECK-NOERRNO: declare float @logbf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @logbl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare i64 @lrint(double) [[NUW]]
+// CHECK-NOERRNO: declare i64 @lrintf(float) [[NUW]]
+// CHECK-NOERRNO: declare i64 @lrintl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare i64 @lround(double) [[NUW]]
+// CHECK-NOERRNO: declare i64 @lroundf(float) [[NUW]]
+// CHECK-NOERRNO: declare i64 @lroundl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @nearbyint(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @nearbyintl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @nearbyintf(float) [[NUW]]
-// CHECK-NOERRNO: declare double @pow(double, double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @powl(x86_fp80, x86_fp80) [[NUW]]
-// CHECK-NOERRNO: declare float @powf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @nearbyintl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @nextafter(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @nextafterf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @nextafterl(x86_fp80, x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @nexttoward(double, x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare float @nexttowardf(float, x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @nexttowardl(x86_fp80, x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @remainder(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @remainderf(float, float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @remainderl(x86_fp80, x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @rint(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @rintl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @rintf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @rintl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @round(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @roundl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @roundf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @roundl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @scalbln(double, i64) [[NUW]]
+// CHECK-NOERRNO: declare float @scalblnf(float, i64) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @scalblnl(x86_fp80, i64) [[NUW]]
+// CHECK-NOERRNO: declare double @scalbn(double, i32) [[NUW]]
+// CHECK-NOERRNO: declare float @scalbnf(float, i32) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @scalbnl(x86_fp80, i32) [[NUW]]
// CHECK-NOERRNO: declare double @sin(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @sinl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @sinf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @sinl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @sinh(double) [[NUW]]
+// CHECK-NOERRNO: declare float @sinhf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @sinhl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @sqrt(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @sqrtl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @sqrtf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @sqrtl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @tan(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @tanl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @tanf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @tanl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @tanh(double) [[NUW]]
+// CHECK-NOERRNO: declare float @tanhf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @tanhl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @tgamma(double) [[NUW]]
+// CHECK-NOERRNO: declare float @tgammaf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @tgammal(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare double @trunc(double) [[NUW]]
-// CHECK-NOERRNO: declare x86_fp80 @truncl(x86_fp80) [[NUW]]
// CHECK-NOERRNO: declare float @truncf(float) [[NUW]]
+// CHECK-NOERRNO: declare x86_fp80 @truncl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare double @cabs(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @cabsf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @cacos(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @cacosf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @cacosh(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @cacoshf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare double @carg(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @cargf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @casin(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @casinf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @casinh(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @casinhf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @catan(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @catanf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @catanh(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @catanhf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @ccos(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @ccosf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @ccosh(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @ccoshf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @cexp(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @cexpf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare double @cimag(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @cimagf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @conj(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @conjf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @clog(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @clogf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @cproj(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @cprojf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @cpow(double, double, double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @cpowf(<2 x float>, <2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare double @creal(double, double) [[NUW]]
+// CHECK-NOERRNO: declare float @crealf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @csin(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @csinf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @csinh(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @csinhf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @csqrt(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @csqrtf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @ctan(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @ctanf(<2 x float>) [[NUW]]
+// CHECK-NOERRNO: declare { double, double } @ctanh(double, double) [[NUW]]
+// CHECK-NOERRNO: declare <2 x float> @ctanhf(<2 x float>) [[NUW]]
-// CHECK-ERRNO: declare double @ceil(double) [[NUW:#[0-9]+]]
-// CHECK-ERRNO: declare x86_fp80 @ceill(x86_fp80) [[NUW]]
-// CHECK-ERRNO: declare float @ceilf(float) [[NUW]]
+// CHECK-ERRNO: declare i32 @abs(i32) [[NUW:#[0-9]+]]
+// CHECK-ERRNO: declare i64 @labs(i64) [[NUW]]
+// CHECK-ERRNO: declare i64 @llabs(i64) [[NUW]]
// CHECK-ERRNO: declare double @copysign(double, double) [[NUW]]
-// CHECK-ERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) [[NUW]]
// CHECK-ERRNO: declare float @copysignf(float, float) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) [[NUW]]
// CHECK-ERRNO: declare double @fabs(double) [[NUW]]
-// CHECK-ERRNO: declare x86_fp80 @fabsl(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare float @fabsf(float) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @fabsl(x86_fp80) [[NUW]]
+// CHECK-ERRNO: declare double @nan(i8*) [[NUW]]
+// CHECK-ERRNO: declare float @nanf(i8*) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @nanl(i8*) [[NUW]]
+// CHECK-ERRNO: declare double @ceil(double) [[NUW]]
+// CHECK-ERRNO: declare float @ceilf(float) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @ceill(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare double @floor(double) [[NUW]]
-// CHECK-ERRNO: declare x86_fp80 @floorl(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare float @floorf(float) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @floorl(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare double @fmax(double, double) [[NUW]]
-// CHECK-ERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) [[NUW]]
// CHECK-ERRNO: declare float @fmaxf(float, float) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) [[NUW]]
// CHECK-ERRNO: declare double @fmin(double, double) [[NUW]]
-// CHECK-ERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) [[NUW]]
// CHECK-ERRNO: declare float @fminf(float, float) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) [[NUW]]
// CHECK-ERRNO: declare double @nearbyint(double) [[NUW]]
-// CHECK-ERRNO: declare x86_fp80 @nearbyintl(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare float @nearbyintf(float) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @nearbyintl(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare double @rint(double) [[NUW]]
-// CHECK-ERRNO: declare x86_fp80 @rintl(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare float @rintf(float) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @rintl(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare double @round(double) [[NUW]]
-// CHECK-ERRNO: declare x86_fp80 @roundl(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare float @roundf(float) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @roundl(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare double @trunc(double) [[NUW]]
-// CHECK-ERRNO: declare x86_fp80 @truncl(x86_fp80) [[NUW]]
// CHECK-ERRNO: declare float @truncf(float) [[NUW]]
+// CHECK-ERRNO: declare x86_fp80 @truncl(x86_fp80) [[NUW]]
+// CHECK-ERRNO: declare double @cabs(double, double) [[NUW]]
+// CHECK-ERRNO: declare float @cabsf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @cacos(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @cacosf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @cacosh(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @cacoshf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare double @carg(double, double) [[NUW]]
+// CHECK-ERRNO: declare float @cargf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @casin(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @casinf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @casinh(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @casinhf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @catan(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @catanf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @catanh(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @catanhf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @ccos(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @ccosf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @ccosh(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @ccoshf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @cexp(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @cexpf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare double @cimag(double, double) [[NUW]]
+// CHECK-ERRNO: declare float @cimagf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @conj(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @conjf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @clog(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @clogf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @cproj(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @cprojf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @cpow(double, double, double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @cpowf(<2 x float>, <2 x float>) [[NUW]]
+// CHECK-ERRNO: declare double @creal(double, double) [[NUW]]
+// CHECK-ERRNO: declare float @crealf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @csin(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @csinf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @csinh(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @csinhf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @csqrt(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @csqrtf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @ctan(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @ctanf(<2 x float>) [[NUW]]
+// CHECK-ERRNO: declare { double, double } @ctanh(double, double) [[NUW]]
+// CHECK-ERRNO: declare <2 x float> @ctanhf(<2 x float>) [[NUW]]
// CHECK-NOERRNO: attributes [[NUW]] = { nounwind readnone{{.*}} }
diff --git a/test/CodeGen/libcalls-complex.c b/test/CodeGen/libcalls-complex.c
index 7bcfa605ae8b..22c97b6a7b3f 100644
--- a/test/CodeGen/libcalls-complex.c
+++ b/test/CodeGen/libcalls-complex.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fno-builtin -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix YES %s
-// RUN: %clang_cc1 -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix NO %s
+// RUN: %clang_cc1 -fno-builtin -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-YES %s
+// RUN: %clang_cc1 -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-NO %s
extern float crealf(float _Complex);
extern double creal(double _Complex);
diff --git a/test/CodeGen/libcalls-d.c b/test/CodeGen/libcalls-d.c
index b375f2bb83a6..3d88eb1a305e 100644
--- a/test/CodeGen/libcalls-d.c
+++ b/test/CodeGen/libcalls-d.c
@@ -1,8 +1,8 @@
// llvm-gcc -O1+ should run simplify libcalls, O0 shouldn't
// and -fno-builtins shouldn't.
// -fno-math-errno should emit an llvm intrinsic, -fmath-errno should not.
-// RUN: %clang_cc1 %s -emit-llvm -fno-math-errno -O0 -o - | grep {call.*exp2\\.f64}
-// RUN: %clang_cc1 %s -emit-llvm -fmath-errno -O0 -o - | grep {call.*exp2}
+// RUN: %clang_cc1 %s -emit-llvm -fno-math-errno -o - | grep {call.*exp2\\.f64}
+// RUN: %clang_cc1 %s -emit-llvm -fmath-errno -o - | grep {call.*exp2}
// RUN: %clang_cc1 %s -emit-llvm -O1 -o - | grep {call.*ldexp}
// RUN: %clang_cc1 %s -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2}
diff --git a/test/CodeGen/libcalls-ld.c b/test/CodeGen/libcalls-ld.c
index 2758761b5ee1..dfa7835d6b73 100644
--- a/test/CodeGen/libcalls-ld.c
+++ b/test/CodeGen/libcalls-ld.c
@@ -1,8 +1,8 @@
// llvm-gcc -O1+ should run simplify libcalls, O0 shouldn't
// and -fno-builtins shouldn't.
// -fno-math-errno should emit an llvm intrinsic, -fmath-errno should not.
-// RUN: %clang_cc1 %s -emit-llvm -fno-math-errno -O0 -o - | grep {call.*exp2\\..*f}
-// RUN: %clang_cc1 %s -emit-llvm -fmath-errno -O0 -o - | grep {call.*exp2l}
+// RUN: %clang_cc1 %s -emit-llvm -fno-math-errno -o - | grep {call.*exp2\\..*f}
+// RUN: %clang_cc1 %s -emit-llvm -fmath-errno -o - | grep {call.*exp2l}
// RUN: %clang_cc1 %s -emit-llvm -O1 -o - | grep {call.*ldexp}
// RUN: %clang_cc1 %s -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2l}
diff --git a/test/CodeGen/libcalls.c b/test/CodeGen/libcalls.c
index 8f8e18226a35..3112c8757343 100644
--- a/test/CodeGen/libcalls.c
+++ b/test/CodeGen/libcalls.c
@@ -1,8 +1,10 @@
-// RUN: %clang_cc1 -fmath-errno -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix YES %s
-// RUN: %clang_cc1 -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix NO %s
+// RUN: %clang_cc1 -fmath-errno -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-YES %s
+// RUN: %clang_cc1 -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-NO %s
+// RUN: %clang_cc1 -menable-unsafe-fp-math -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-FAST %s
-// CHECK-YES: define void @test_sqrt
-// CHECK-NO: define void @test_sqrt
+// CHECK-YES-LABEL: define void @test_sqrt
+// CHECK-NO-LABEL: define void @test_sqrt
+// CHECK-FAST-LABEL: define void @test_sqrt
void test_sqrt(float a0, double a1, long double a2) {
// Following llvm-gcc's lead, we never emit these as intrinsics;
// no-math-errno isn't good enough. We could probably use intrinsics
@@ -27,9 +29,12 @@ void test_sqrt(float a0, double a1, long double a2) {
// CHECK-NO: declare float @sqrtf(float) [[NUW_RN:#[0-9]+]]
// CHECK-NO: declare double @sqrt(double) [[NUW_RN]]
// CHECK-NO: declare x86_fp80 @sqrtl(x86_fp80) [[NUW_RN]]
+// CHECK-FAST: declare float @llvm.sqrt.f32(float)
+// CHECK-FAST: declare double @llvm.sqrt.f64(double)
+// CHECK-FAST: declare x86_fp80 @llvm.sqrt.f80(x86_fp80)
-// CHECK-YES: define void @test_pow
-// CHECK-NO: define void @test_pow
+// CHECK-YES-LABEL: define void @test_pow
+// CHECK-NO-LABEL: define void @test_pow
void test_pow(float a0, double a1, long double a2) {
// CHECK-YES: call float @powf
// CHECK-NO: call float @llvm.pow.f32
@@ -51,8 +56,8 @@ void test_pow(float a0, double a1, long double a2) {
// CHECK-NO: declare double @llvm.pow.f64(double, double) [[NUW_RO]]
// CHECK-NO: declare x86_fp80 @llvm.pow.f80(x86_fp80, x86_fp80) [[NUW_RO]]
-// CHECK-YES: define void @test_fma
-// CHECK-NO: define void @test_fma
+// CHECK-YES-LABEL: define void @test_fma
+// CHECK-NO-LABEL: define void @test_fma
void test_fma(float a0, double a1, long double a2) {
// CHECK-YES: call float @llvm.fma.f32
// CHECK-NO: call float @llvm.fma.f32
diff --git a/test/CodeGen/link-bitcode-file.c b/test/CodeGen/link-bitcode-file.c
index 77404062ecdd..cf9493f988ae 100644
--- a/test/CodeGen/link-bitcode-file.c
+++ b/test/CodeGen/link-bitcode-file.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -emit-llvm-bc -o %t.bc %s
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-NO-BC %s
-// RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s 2>&1 | FileCheck -check-prefix=CHECK-BC %s
+// RUN: not %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s 2>&1 | FileCheck -check-prefix=CHECK-BC %s
int f(void);
@@ -13,12 +13,12 @@ int f(void) {
#else
-// CHECK-NO-BC: define i32 @g
+// CHECK-NO-BC-LABEL: define i32 @g
// CHECK-NO-BC: ret i32 42
int g(void) {
return f();
}
-// CHECK-NO-BC: define i32 @f
+// CHECK-NO-BC-LABEL: define i32 @f
#endif
diff --git a/test/CodeGen/linkage-redecl.c b/test/CodeGen/linkage-redecl.c
index 14112fe3a0a8..58993f349f81 100644
--- a/test/CodeGen/linkage-redecl.c
+++ b/test/CodeGen/linkage-redecl.c
@@ -16,4 +16,4 @@ void g0() {
}
extern void f(int x) { } // still has internal linkage
-// CHECK: define internal void @f
+// CHECK-LABEL: define internal void @f
diff --git a/test/CodeGen/linux-arm-atomic.c b/test/CodeGen/linux-arm-atomic.c
index c7ce1d228bb5..116925a585b6 100644
--- a/test/CodeGen/linux-arm-atomic.c
+++ b/test/CodeGen/linux-arm-atomic.c
@@ -1,6 +1,8 @@
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv7-unknown-linux | FileCheck %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-unknown-linux | FileCheck %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv7-unknown-linux | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-unknown-freebsd | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-unknown-bitrig | FileCheck %s
typedef int _Atomic_word;
_Atomic_word exchange_and_add(volatile _Atomic_word *__mem, int __val) {
diff --git a/test/CodeGen/long-double-x86-nacl.c b/test/CodeGen/long-double-x86-nacl.c
index 175129cb6a2a..cec381a06b9b 100644
--- a/test/CodeGen/long-double-x86-nacl.c
+++ b/test/CodeGen/long-double-x86-nacl.c
@@ -3,5 +3,5 @@
long double x = 0;
int checksize[sizeof(x) == 8 ? 1 : -1];
-// CHECK: define void @s1(double %a)
+// CHECK-LABEL: define void @s1(double %a)
void s1(long double a) {}
diff --git a/test/CodeGen/mangle-windows-rtd.c b/test/CodeGen/mangle-windows-rtd.c
new file mode 100644
index 000000000000..fc6f309eaf58
--- /dev/null
+++ b/test/CodeGen/mangle-windows-rtd.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm -mrtd %s -o - -triple=i386-mingw32 | FileCheck %s
+
+void f1(void) {}
+// CHECK: define x86_stdcallcc void @"\01_f1@0"
+
+void __stdcall f2(void) {}
+// CHECK: define x86_stdcallcc void @"\01_f2@0"
+
+void __fastcall f3(void) {}
+// CHECK: define x86_fastcallcc void @"\01@f3@0"
diff --git a/test/CodeGen/mangle-windows.c b/test/CodeGen/mangle-windows.c
new file mode 100644
index 000000000000..670649216ddf
--- /dev/null
+++ b/test/CodeGen/mangle-windows.c
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft \
+// RUN: -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-mingw32 | FileCheck %s
+
+void __stdcall f1(void) {}
+// CHECK: define x86_stdcallcc void @"\01_f1@0"
+
+void __fastcall f2(void) {}
+// CHECK: define x86_fastcallcc void @"\01@f2@0"
+
+void __stdcall f3() {}
+// CHECK: define x86_stdcallcc void @"\01_f3@0"
+
+void __fastcall f4(char a) {}
+// CHECK: define x86_fastcallcc void @"\01@f4@4"
+
+void __fastcall f5(short a) {}
+// CHECK: define x86_fastcallcc void @"\01@f5@4"
+
+void __fastcall f6(int a) {}
+// CHECK: define x86_fastcallcc void @"\01@f6@4"
+
+void __fastcall f7(long a) {}
+// CHECK: define x86_fastcallcc void @"\01@f7@4"
+
+void __fastcall f8(long long a) {}
+// CHECK: define x86_fastcallcc void @"\01@f8@8"
+
+void __fastcall f9(long long a, char b, char c, short d) {}
+// CHECK: define x86_fastcallcc void @"\01@f9@20"(i64 %a, i8 signext %b, i8
+// signext %c, i16 signext %d)
+
+void f12(void) {}
+// CHECK: define void @f12(
diff --git a/test/CodeGen/may-alias.c b/test/CodeGen/may-alias.c
index c76724444bf2..4d6f721f6abb 100644
--- a/test/CodeGen/may-alias.c
+++ b/test/CodeGen/may-alias.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -Werror -triple i386-unknown-unknown -emit-llvm -O1 -disable-llvm-optzns -o - %s | FileCheck %s
-// RUN: %clang_cc1 -Werror -triple i386-unknown-unknown -emit-llvm -O1 -struct-path-tbaa -disable-llvm-optzns -o - %s | FileCheck %s -check-prefix=PATH
+// RUN: %clang_cc1 -Werror -triple i386-unknown-unknown -emit-llvm -O1 -no-struct-path-tbaa -disable-llvm-optzns -o - %s | FileCheck %s
+// RUN: %clang_cc1 -Werror -triple i386-unknown-unknown -emit-llvm -O1 -disable-llvm-optzns -o - %s | FileCheck %s -check-prefix=PATH
// Types with the may_alias attribute should be considered equivalent
// to char for aliasing.
@@ -8,10 +8,10 @@ typedef int __attribute__((may_alias)) aliasing_int;
void test0(aliasing_int *ai, int *i)
{
-// CHECK: store i32 0, i32* %{{.*}}, !tbaa !1
+// CHECK: store i32 0, i32* %{{.*}}, !tbaa [[TAG_CHAR:!.*]]
// PATH: store i32 0, i32* %{{.*}}, !tbaa [[TAG_CHAR:!.*]]
*ai = 0;
-// CHECK: store i32 1, i32* %{{.*}}, !tbaa !3
+// CHECK: store i32 1, i32* %{{.*}}, !tbaa [[TAG_INT:!.*]]
// PATH: store i32 1, i32* %{{.*}}, !tbaa [[TAG_INT:!.*]]
*i = 1;
}
@@ -20,22 +20,23 @@ void test0(aliasing_int *ai, int *i)
struct Test1 { int x; };
struct Test1MA { int x; } __attribute__((may_alias));
void test1(struct Test1MA *p1, struct Test1 *p2) {
- // CHECK: store i32 2, i32* {{%.*}}, !tbaa !1
+ // CHECK: store i32 2, i32* {{%.*}}, !tbaa [[TAG_CHAR]]
// PATH: store i32 2, i32* {{%.*}}, !tbaa [[TAG_CHAR]]
p1->x = 2;
- // CHECK: store i32 3, i32* {{%.*}}, !tbaa !3
+ // CHECK: store i32 3, i32* {{%.*}}, !tbaa [[TAG_INT]]
// PATH: store i32 3, i32* {{%.*}}, !tbaa [[TAG_test1_x:!.*]]
p2->x = 3;
}
-
-// CHECK: !0 = metadata !{metadata !"any pointer", metadata !1}
-// CHECK: !1 = metadata !{metadata !"omnipotent char", metadata !2}
-// CHECK: !2 = metadata !{metadata !"Simple C/C++ TBAA"}
-// CHECK: !3 = metadata !{metadata !"int", metadata !1}
+// CHECK: metadata !{metadata !"any pointer", metadata [[TYPE_CHAR:!.*]],
+// CHECK: [[TYPE_CHAR]] = metadata !{metadata !"omnipotent char", metadata [[TAG_CXX_TBAA:!.*]],
+// CHECK: [[TAG_CXX_TBAA]] = metadata !{metadata !"Simple C/C++ TBAA"}
+// CHECK: [[TAG_CHAR]] = metadata !{metadata [[TYPE_CHAR]], metadata [[TYPE_CHAR]], i64 0}
+// CHECK: [[TAG_INT]] = metadata !{metadata [[TYPE_INT:!.*]], metadata [[TYPE_INT]], i64 0}
+// CHECK: [[TYPE_INT]] = metadata !{metadata !"int", metadata [[TYPE_CHAR]]
// PATH: [[TYPE_CHAR:!.*]] = metadata !{metadata !"omnipotent char", metadata !{{.*}}
// PATH: [[TAG_CHAR]] = metadata !{metadata [[TYPE_CHAR]], metadata [[TYPE_CHAR]], i64 0}
// PATH: [[TAG_INT]] = metadata !{metadata [[TYPE_INT:!.*]], metadata [[TYPE_INT]], i64 0}
// PATH: [[TYPE_INT]] = metadata !{metadata !"int", metadata [[TYPE_CHAR]]
// PATH: [[TAG_test1_x]] = metadata !{metadata [[TYPE_test1:!.*]], metadata [[TYPE_INT]], i64 0}
-// PATH: [[TYPE_test1]] = metadata !{metadata !"_ZTS5Test1", metadata [[TYPE_INT]], i64 0}
+// PATH: [[TYPE_test1]] = metadata !{metadata !"Test1", metadata [[TYPE_INT]], i64 0}
diff --git a/test/CodeGen/microsoft-call-conv-x64.c b/test/CodeGen/microsoft-call-conv-x64.c
index 97a1d99d6b6d..6475dfa2936d 100644
--- a/test/CodeGen/microsoft-call-conv-x64.c
+++ b/test/CodeGen/microsoft-call-conv-x64.c
@@ -3,12 +3,12 @@
void __fastcall f1(void);
void __stdcall f2(void);
void __fastcall f4(void) {
-// CHECK: define void @f4()
+// CHECK-LABEL: define void @f4()
f1();
// CHECK: call void @f1()
}
void __stdcall f5(void) {
-// CHECK: define void @f5()
+// CHECK-LABEL: define void @f5()
f2();
// CHECK: call void @f2()
}
diff --git a/test/CodeGen/microsoft-call-conv.c b/test/CodeGen/microsoft-call-conv.c
index 64d10fb4f4ff..b80c58dfd1f2 100644
--- a/test/CodeGen/microsoft-call-conv.c
+++ b/test/CodeGen/microsoft-call-conv.c
@@ -1,20 +1,22 @@
// RUN: %clang_cc1 -triple i386-pc-linux -emit-llvm < %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-pc-linux -emit-llvm -mrtd < %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-pc-linux -emit-llvm -fms-compatibility < %s
void __fastcall f1(void);
void __stdcall f2(void);
void __thiscall f3(void);
void __fastcall f4(void) {
-// CHECK: define x86_fastcallcc void @f4()
+// CHECK-LABEL: define x86_fastcallcc void @f4()
f1();
// CHECK: call x86_fastcallcc void @f1()
}
void __stdcall f5(void) {
-// CHECK: define x86_stdcallcc void @f5()
+// CHECK-LABEL: define x86_stdcallcc void @f5()
f2();
// CHECK: call x86_stdcallcc void @f2()
}
void __thiscall f6(void) {
-// CHECK: define x86_thiscallcc void @f6()
+// CHECK-LABEL: define x86_thiscallcc void @f6()
f3();
// CHECK: call x86_thiscallcc void @f3()
}
@@ -48,3 +50,11 @@ void f8(void) {
f7(0);
// CHECK: call x86_stdcallcc void @f7(i32 0)
}
+
+// PR12535
+void __fastcall f9(int x, int y) {};
+// WIN: define x86_fastcallcc void @f9({{.*}})
+void __fastcall f10(int x, ...) {};
+// WIN: define void @f10({{.*}})
+void __stdcall f11(int x, ...) {};
+// WIN: define void @f11({{.*}})
diff --git a/test/CodeGen/mips-byval-arg.c b/test/CodeGen/mips-byval-arg.c
index 41ccd60e8f3e..589e85ef9dd1 100644
--- a/test/CodeGen/mips-byval-arg.c
+++ b/test/CodeGen/mips-byval-arg.c
@@ -7,8 +7,8 @@ typedef struct {
extern void foo2(S0);
-// O32: define void @foo1(i32 %a0.coerce0, i32 %a0.coerce1, i32 %a0.coerce2)
-// N64: define void @foo1(i64 %a0.coerce0, i32 %a0.coerce1)
+// O32-LABEL: define void @foo1(i32 %a0.coerce0, i32 %a0.coerce1, i32 %a0.coerce2)
+// N64-LABEL: define void @foo1(i64 %a0.coerce0, i32 %a0.coerce1)
void foo1(S0 a0) {
foo2(a0);
diff --git a/test/CodeGen/mips-clobber-reg.c b/test/CodeGen/mips-clobber-reg.c
index be18353af820..a87a3e7b2e66 100644
--- a/test/CodeGen/mips-clobber-reg.c
+++ b/test/CodeGen/mips-clobber-reg.c
@@ -1,80 +1,150 @@
-// RUN: %clang -target mipsel-unknown-linux -S -o - -emit-llvm %s
+// RUN: %clang -target mipsel-unknown-linux -S -o - -emit-llvm %s
/*
This checks that the frontend will accept both
- enumerated and symbolic Mips GPR register names.
-
+ enumerated and symbolic Mips register names.
+
+ Includes:
+ - GPR
+ - FPU
+ - MSA
+
Any bad names will make the frontend choke.
*/
main()
{
- __asm__ __volatile__ (".set noat \n\t addi $7,$at,77":::"at");
- __asm__ __volatile__ ("addi $7,$v0,77":::"v0");
- __asm__ __volatile__ ("addi $7,$v1,77":::"v1");
- __asm__ __volatile__ ("addi $7,$a0,77":::"a0");
- __asm__ __volatile__ ("addi $7,$a1,77":::"a1");
- __asm__ __volatile__ ("addi $7,$a2,77":::"a2");
- __asm__ __volatile__ ("addi $7,$a3,77":::"a3");
- __asm__ __volatile__ ("addi $7,$t0,77":::"t0");
- __asm__ __volatile__ ("addi $7,$t1,77":::"t1");
- __asm__ __volatile__ ("addi $7,$t2,77":::"t2");
- __asm__ __volatile__ ("addi $7,$t3,77":::"t3");
- __asm__ __volatile__ ("addi $7,$t4,77":::"t4");
- __asm__ __volatile__ ("addi $7,$t5,77":::"t5");
- __asm__ __volatile__ ("addi $7,$t6,77":::"t6");
- __asm__ __volatile__ ("addi $7,$t7,77":::"t7");
- __asm__ __volatile__ ("addi $7,$s0,77":::"s0");
- __asm__ __volatile__ ("addi $7,$s1,77":::"s1");
- __asm__ __volatile__ ("addi $7,$s2,77":::"s2");
- __asm__ __volatile__ ("addi $7,$s3,77":::"s3");
- __asm__ __volatile__ ("addi $7,$s4,77":::"s4");
- __asm__ __volatile__ ("addi $7,$s5,77":::"s5");
- __asm__ __volatile__ ("addi $7,$s6,77":::"s6");
- __asm__ __volatile__ ("addi $7,$s7,77":::"s7");
- __asm__ __volatile__ ("addi $7,$t8,77":::"t8");
- __asm__ __volatile__ ("addi $7,$t9,77":::"t9");
- __asm__ __volatile__ ("addi $7,$k0,77":::"k0");
- __asm__ __volatile__ ("addi $7,$k1,77":::"k1");
- __asm__ __volatile__ ("addi $7,$gp,77":::"gp");
- __asm__ __volatile__ ("addi $7,$sp,77":::"sp");
- __asm__ __volatile__ ("addi $7,$fp,77":::"fp");
- __asm__ __volatile__ ("addi $7,$sp,77":::"$sp");
- __asm__ __volatile__ ("addi $7,$fp,77":::"$fp");
- __asm__ __volatile__ ("addi $7,$ra,77":::"ra");
+ __asm__ __volatile__ (".set noat \n\t addi $7,$at,77":::"at");
+ __asm__ __volatile__ ("addi $7,$v0,77":::"v0");
+ __asm__ __volatile__ ("addi $7,$v1,77":::"v1");
+ __asm__ __volatile__ ("addi $7,$a0,77":::"a0");
+ __asm__ __volatile__ ("addi $7,$a1,77":::"a1");
+ __asm__ __volatile__ ("addi $7,$a2,77":::"a2");
+ __asm__ __volatile__ ("addi $7,$a3,77":::"a3");
+ __asm__ __volatile__ ("addi $7,$t0,77":::"t0");
+ __asm__ __volatile__ ("addi $7,$t1,77":::"t1");
+ __asm__ __volatile__ ("addi $7,$t2,77":::"t2");
+ __asm__ __volatile__ ("addi $7,$t3,77":::"t3");
+ __asm__ __volatile__ ("addi $7,$t4,77":::"t4");
+ __asm__ __volatile__ ("addi $7,$t5,77":::"t5");
+ __asm__ __volatile__ ("addi $7,$t6,77":::"t6");
+ __asm__ __volatile__ ("addi $7,$t7,77":::"t7");
+ __asm__ __volatile__ ("addi $7,$s0,77":::"s0");
+ __asm__ __volatile__ ("addi $7,$s1,77":::"s1");
+ __asm__ __volatile__ ("addi $7,$s2,77":::"s2");
+ __asm__ __volatile__ ("addi $7,$s3,77":::"s3");
+ __asm__ __volatile__ ("addi $7,$s4,77":::"s4");
+ __asm__ __volatile__ ("addi $7,$s5,77":::"s5");
+ __asm__ __volatile__ ("addi $7,$s6,77":::"s6");
+ __asm__ __volatile__ ("addi $7,$s7,77":::"s7");
+ __asm__ __volatile__ ("addi $7,$t8,77":::"t8");
+ __asm__ __volatile__ ("addi $7,$t9,77":::"t9");
+ __asm__ __volatile__ ("addi $7,$k0,77":::"k0");
+ __asm__ __volatile__ ("addi $7,$k1,77":::"k1");
+ __asm__ __volatile__ ("addi $7,$gp,77":::"gp");
+ __asm__ __volatile__ ("addi $7,$sp,77":::"sp");
+ __asm__ __volatile__ ("addi $7,$fp,77":::"fp");
+ __asm__ __volatile__ ("addi $7,$sp,77":::"$sp");
+ __asm__ __volatile__ ("addi $7,$fp,77":::"$fp");
+ __asm__ __volatile__ ("addi $7,$ra,77":::"ra");
+
+ __asm__ __volatile__ ("addi $7,$0,77":::"$0");
+ __asm__ __volatile__ (".set noat \n\t addi $7,$1,77":::"$1");
+ __asm__ __volatile__ ("addi $7,$2,77":::"$2");
+ __asm__ __volatile__ ("addi $7,$3,77":::"$3");
+ __asm__ __volatile__ ("addi $7,$4,77":::"$4");
+ __asm__ __volatile__ ("addi $7,$5,77":::"$5");
+ __asm__ __volatile__ ("addi $7,$6,77":::"$6");
+ __asm__ __volatile__ ("addi $7,$7,77":::"$7");
+ __asm__ __volatile__ ("addi $7,$8,77":::"$8");
+ __asm__ __volatile__ ("addi $7,$9,77":::"$9");
+ __asm__ __volatile__ ("addi $7,$10,77":::"$10");
+ __asm__ __volatile__ ("addi $7,$11,77":::"$11");
+ __asm__ __volatile__ ("addi $7,$12,77":::"$12");
+ __asm__ __volatile__ ("addi $7,$13,77":::"$13");
+ __asm__ __volatile__ ("addi $7,$14,77":::"$14");
+ __asm__ __volatile__ ("addi $7,$15,77":::"$15");
+ __asm__ __volatile__ ("addi $7,$16,77":::"$16");
+ __asm__ __volatile__ ("addi $7,$17,77":::"$17");
+ __asm__ __volatile__ ("addi $7,$18,77":::"$18");
+ __asm__ __volatile__ ("addi $7,$19,77":::"$19");
+ __asm__ __volatile__ ("addi $7,$20,77":::"$20");
+ __asm__ __volatile__ ("addi $7,$21,77":::"$21");
+ __asm__ __volatile__ ("addi $7,$22,77":::"$22");
+ __asm__ __volatile__ ("addi $7,$23,77":::"$23");
+ __asm__ __volatile__ ("addi $7,$24,77":::"$24");
+ __asm__ __volatile__ ("addi $7,$25,77":::"$25");
+ __asm__ __volatile__ ("addi $7,$26,77":::"$26");
+ __asm__ __volatile__ ("addi $7,$27,77":::"$27");
+ __asm__ __volatile__ ("addi $7,$28,77":::"$28");
+ __asm__ __volatile__ ("addi $7,$29,77":::"$29");
+ __asm__ __volatile__ ("addi $7,$30,77":::"$30");
+ __asm__ __volatile__ ("addi $7,$31,77":::"$31");
- __asm__ __volatile__ ("addi $7,$0,77":::"$0");
- __asm__ __volatile__ (".set noat \n\t addi $7,$1,77":::"$1");
- __asm__ __volatile__ ("addi $7,$2,77":::"$2");
- __asm__ __volatile__ ("addi $7,$3,77":::"$3");
- __asm__ __volatile__ ("addi $7,$4,77":::"$4");
- __asm__ __volatile__ ("addi $7,$5,77":::"$5");
- __asm__ __volatile__ ("addi $7,$6,77":::"$6");
- __asm__ __volatile__ ("addi $7,$7,77":::"$7");
- __asm__ __volatile__ ("addi $7,$8,77":::"$8");
- __asm__ __volatile__ ("addi $7,$9,77":::"$9");
- __asm__ __volatile__ ("addi $7,$10,77":::"$10");
- __asm__ __volatile__ ("addi $7,$11,77":::"$10");
- __asm__ __volatile__ ("addi $7,$12,77":::"$12");
- __asm__ __volatile__ ("addi $7,$13,77":::"$13");
- __asm__ __volatile__ ("addi $7,$14,77":::"$14");
- __asm__ __volatile__ ("addi $7,$15,77":::"$15");
- __asm__ __volatile__ ("addi $7,$16,77":::"$16");
- __asm__ __volatile__ ("addi $7,$17,77":::"$17");
- __asm__ __volatile__ ("addi $7,$18,77":::"$18");
- __asm__ __volatile__ ("addi $7,$19,77":::"$19");
- __asm__ __volatile__ ("addi $7,$20,77":::"$20");
- __asm__ __volatile__ ("addi $7,$21,77":::"$21");
- __asm__ __volatile__ ("addi $7,$22,77":::"$22");
- __asm__ __volatile__ ("addi $7,$23,77":::"$23");
- __asm__ __volatile__ ("addi $7,$24,77":::"$24");
- __asm__ __volatile__ ("addi $7,$25,77":::"$25");
- __asm__ __volatile__ ("addi $7,$26,77":::"$26");
- __asm__ __volatile__ ("addi $7,$27,77":::"$27");
- __asm__ __volatile__ ("addi $7,$28,77":::"$28");
- __asm__ __volatile__ ("addi $7,$29,77":::"$29");
- __asm__ __volatile__ ("addi $7,$30,77":::"$30");
- __asm__ __volatile__ ("addi $7,$31,77":::"$31");
+ __asm__ __volatile__ ("fadd.s $f0,77":::"$f0");
+ __asm__ __volatile__ ("fadd.s $f1,77":::"$f1");
+ __asm__ __volatile__ ("fadd.s $f2,77":::"$f2");
+ __asm__ __volatile__ ("fadd.s $f3,77":::"$f3");
+ __asm__ __volatile__ ("fadd.s $f4,77":::"$f4");
+ __asm__ __volatile__ ("fadd.s $f5,77":::"$f5");
+ __asm__ __volatile__ ("fadd.s $f6,77":::"$f6");
+ __asm__ __volatile__ ("fadd.s $f7,77":::"$f7");
+ __asm__ __volatile__ ("fadd.s $f8,77":::"$f8");
+ __asm__ __volatile__ ("fadd.s $f9,77":::"$f9");
+ __asm__ __volatile__ ("fadd.s $f10,77":::"$f10");
+ __asm__ __volatile__ ("fadd.s $f11,77":::"$f11");
+ __asm__ __volatile__ ("fadd.s $f12,77":::"$f12");
+ __asm__ __volatile__ ("fadd.s $f13,77":::"$f13");
+ __asm__ __volatile__ ("fadd.s $f14,77":::"$f14");
+ __asm__ __volatile__ ("fadd.s $f15,77":::"$f15");
+ __asm__ __volatile__ ("fadd.s $f16,77":::"$f16");
+ __asm__ __volatile__ ("fadd.s $f17,77":::"$f17");
+ __asm__ __volatile__ ("fadd.s $f18,77":::"$f18");
+ __asm__ __volatile__ ("fadd.s $f19,77":::"$f19");
+ __asm__ __volatile__ ("fadd.s $f20,77":::"$f20");
+ __asm__ __volatile__ ("fadd.s $f21,77":::"$f21");
+ __asm__ __volatile__ ("fadd.s $f22,77":::"$f22");
+ __asm__ __volatile__ ("fadd.s $f23,77":::"$f23");
+ __asm__ __volatile__ ("fadd.s $f24,77":::"$f24");
+ __asm__ __volatile__ ("fadd.s $f25,77":::"$f25");
+ __asm__ __volatile__ ("fadd.s $f26,77":::"$f26");
+ __asm__ __volatile__ ("fadd.s $f27,77":::"$f27");
+ __asm__ __volatile__ ("fadd.s $f28,77":::"$f28");
+ __asm__ __volatile__ ("fadd.s $f29,77":::"$f29");
+ __asm__ __volatile__ ("fadd.s $f30,77":::"$f30");
+ __asm__ __volatile__ ("fadd.s $f31,77":::"$f31");
+ __asm__ __volatile__ ("ldi.w $w0,77":::"$w0");
+ __asm__ __volatile__ ("ldi.w $w1,77":::"$w1");
+ __asm__ __volatile__ ("ldi.w $w2,77":::"$w2");
+ __asm__ __volatile__ ("ldi.w $w3,77":::"$w3");
+ __asm__ __volatile__ ("ldi.w $w4,77":::"$w4");
+ __asm__ __volatile__ ("ldi.w $w5,77":::"$w5");
+ __asm__ __volatile__ ("ldi.w $w6,77":::"$w6");
+ __asm__ __volatile__ ("ldi.w $w7,77":::"$w7");
+ __asm__ __volatile__ ("ldi.w $w8,77":::"$w8");
+ __asm__ __volatile__ ("ldi.w $w9,77":::"$w9");
+ __asm__ __volatile__ ("ldi.w $w10,77":::"$w10");
+ __asm__ __volatile__ ("ldi.w $w11,77":::"$w10");
+ __asm__ __volatile__ ("ldi.w $w12,77":::"$w12");
+ __asm__ __volatile__ ("ldi.w $w13,77":::"$w13");
+ __asm__ __volatile__ ("ldi.w $w14,77":::"$w14");
+ __asm__ __volatile__ ("ldi.w $w15,77":::"$w15");
+ __asm__ __volatile__ ("ldi.w $w16,77":::"$w16");
+ __asm__ __volatile__ ("ldi.w $w17,77":::"$w17");
+ __asm__ __volatile__ ("ldi.w $w18,77":::"$w18");
+ __asm__ __volatile__ ("ldi.w $w19,77":::"$w19");
+ __asm__ __volatile__ ("ldi.w $w20,77":::"$w20");
+ __asm__ __volatile__ ("ldi.w $w21,77":::"$w21");
+ __asm__ __volatile__ ("ldi.w $w22,77":::"$w22");
+ __asm__ __volatile__ ("ldi.w $w23,77":::"$w23");
+ __asm__ __volatile__ ("ldi.w $w24,77":::"$w24");
+ __asm__ __volatile__ ("ldi.w $w25,77":::"$w25");
+ __asm__ __volatile__ ("ldi.w $w26,77":::"$w26");
+ __asm__ __volatile__ ("ldi.w $w27,77":::"$w27");
+ __asm__ __volatile__ ("ldi.w $w28,77":::"$w28");
+ __asm__ __volatile__ ("ldi.w $w29,77":::"$w29");
+ __asm__ __volatile__ ("ldi.w $w30,77":::"$w30");
+ __asm__ __volatile__ ("ldi.w $w31,77":::"$w31");
}
diff --git a/test/CodeGen/mips-constraints-mem.c b/test/CodeGen/mips-constraints-mem.c
index ea6bcaff9730..2c3c01ac11e2 100644
--- a/test/CodeGen/mips-constraints-mem.c
+++ b/test/CodeGen/mips-constraints-mem.c
@@ -9,7 +9,7 @@ int foo()
// 'R': An address that can be used in a non-macro load or stor'
// This test will result in the higher and lower nibbles being
// switched due to the lwl/lwr instruction pairs.
- // CHECK: %{{[0-9]+}} = call i32 asm sideeffect "lwl $0, 1 + $1\0A\09lwr $0, 2 + $1\0A\09", "=r,*R"(i32* %{{[0-9,a-f]+}}) #1, !srcloc !0
+ // CHECK: %{{[0-9]+}} = call i32 asm sideeffect "lwl $0, 1 + $1\0A\09lwr $0, 2 + $1\0A\09", "=r,*R"(i32* %{{[0-9,a-f]+}}) #1,
int c = 0xffbbccdd;
diff --git a/test/CodeGen/mips-inline-asm-modifiers.c b/test/CodeGen/mips-inline-asm-modifiers.c
index 7c4ca2ce1446..9d697e8b228e 100644
--- a/test/CodeGen/mips-inline-asm-modifiers.c
+++ b/test/CodeGen/mips-inline-asm-modifiers.c
@@ -5,12 +5,16 @@
int printf(const char*, ...);
- // CHECK: %{{[0-9]+}} = call i32 asm ".set noreorder;\0Alw $0,$1;\0A.set reorder;\0A", "=r,*m"(i32* getelementptr inbounds ([8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2, !srcloc !0
- // CHECK: %{{[0-9]+}} = call i32 asm "lw $0,${1:D};\0A", "=r,*m"(i32* getelementptr inbounds ([8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2, !srcloc !1
+typedef int v4i32 __attribute__((vector_size(16)));
+
+ // CHECK: %{{[0-9]+}} = call i32 asm ".set noreorder;\0Alw $0,$1;\0A.set reorder;\0A", "=r,*m"(i32* getelementptr inbounds ([8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2,
+ // CHECK: %{{[0-9]+}} = call i32 asm "lw $0,${1:D};\0A", "=r,*m"(i32* getelementptr inbounds ([8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2,
+ // CHECK: %{{[0-9]+}} = call <4 x i32> asm "ldi.w ${0:w},1", "=f"
int b[8] = {0,1,2,3,4,5,6,7};
int main()
{
int i;
+ v4i32 v4i32_r;
// The first word. Notice, no 'D'
{asm (
@@ -29,6 +33,9 @@ int main()
: "m" (*(b+4))
);}
+ // MSA registers
+ {asm ("ldi.w %w0,1" : "=f" (v4i32_r));}
+
printf("%d\n",i);
return 1;
diff --git a/test/CodeGen/mips-target-data.c b/test/CodeGen/mips-target-data.c
index 88eadcb13d6b..6475ccb4d273 100644
--- a/test/CodeGen/mips-target-data.c
+++ b/test/CodeGen/mips-target-data.c
@@ -6,6 +6,8 @@
// RUN: FileCheck %s -check-prefix=64EL
// RUN: %clang -target mips64-linux-gnu -o - -emit-llvm -S %s |\
// RUN: FileCheck %s -check-prefix=64EB
+// RUN: %clang -target mipsel-linux-gnu -o - -emit-llvm -S -mfp64 %s |\
+// RUN: FileCheck %s -check-prefix=32EL
// 32EL: e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64
// 32EB: E-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64
diff --git a/test/CodeGen/mips-vector-return.c b/test/CodeGen/mips-vector-return.c
index 0bff96969000..a7c8ce157c84 100644
--- a/test/CodeGen/mips-vector-return.c
+++ b/test/CodeGen/mips-vector-return.c
@@ -8,14 +8,14 @@ typedef float v4sf __attribute__ ((__vector_size__ (16)));
typedef double v4df __attribute__ ((__vector_size__ (32)));
typedef int v4i32 __attribute__ ((__vector_size__ (16)));
-// O32: define void @test_v4sf(<4 x float>* noalias nocapture sret
+// O32-LABEL: define void @test_v4sf(<4 x float>* noalias nocapture sret
// N64: define { i64, i64 } @test_v4sf
v4sf test_v4sf(float a) {
return (v4sf){0.0f, a, 0.0f, 0.0f};
}
-// O32: define void @test_v4df(<4 x double>* noalias nocapture sret
-// N64: define void @test_v4df(<4 x double>* noalias nocapture sret
+// O32-LABEL: define void @test_v4df(<4 x double>* noalias nocapture sret
+// N64-LABEL: define void @test_v4df(<4 x double>* noalias nocapture sret
v4df test_v4df(double a) {
return (v4df){0.0, a, 0.0, 0.0};
}
diff --git a/test/CodeGen/mips64-class-return.cpp b/test/CodeGen/mips64-class-return.cpp
index 2a786df3effa..a473c1319550 100644
--- a/test/CodeGen/mips64-class-return.cpp
+++ b/test/CodeGen/mips64-class-return.cpp
@@ -34,12 +34,12 @@ D1 foo2(void) {
return gd1;
}
-// CHECK: define void @_Z4foo32D2(i64 %a0.coerce0, double %a0.coerce1)
+// CHECK-LABEL: define void @_Z4foo32D2(i64 %a0.coerce0, double %a0.coerce1)
void foo3(D2 a0) {
gd2 = a0;
}
-// CHECK: define void @_Z4foo42D0(i64 %a0.coerce0, i64 %a0.coerce1)
+// CHECK-LABEL: define void @_Z4foo42D0(i64 %a0.coerce0, i64 %a0.coerce1)
void foo4(D0 a0) {
gd0 = a0;
}
diff --git a/test/CodeGen/mips64-padding-arg.c b/test/CodeGen/mips64-padding-arg.c
index 85dc00c90590..49a29c1efb31 100644
--- a/test/CodeGen/mips64-padding-arg.c
+++ b/test/CodeGen/mips64-padding-arg.c
@@ -1,5 +1,6 @@
// RUN: %clang -target mipsel-unknown-linux -O3 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=O32
// RUN: %clang -target mips64el-unknown-linux -O3 -S -mabi=n64 -o - -emit-llvm %s | FileCheck %s -check-prefix=N64
+// RUN: %clang -target mipsel-unknown-linux -mfp64 -O3 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=O32
typedef struct {
double d;
@@ -8,7 +9,7 @@ typedef struct {
// Insert padding to ensure arguments of type S0 are aligned to 16-byte boundaries.
-// N64: define void @foo1(i32 %a0, i64, double %a1.coerce0, i64 %a1.coerce1, i64 %a1.coerce2, i64 %a1.coerce3, double %a2.coerce0, i64 %a2.coerce1, i64 %a2.coerce2, i64 %a2.coerce3, i32 %b, i64, double %a3.coerce0, i64 %a3.coerce1, i64 %a3.coerce2, i64 %a3.coerce3)
+// N64-LABEL: define void @foo1(i32 %a0, i64, double %a1.coerce0, i64 %a1.coerce1, i64 %a1.coerce2, i64 %a1.coerce3, double %a2.coerce0, i64 %a2.coerce1, i64 %a2.coerce2, i64 %a2.coerce3, i32 %b, i64, double %a3.coerce0, i64 %a3.coerce1, i64 %a3.coerce2, i64 %a3.coerce3)
// N64: tail call void @foo2(i32 1, i32 2, i32 %a0, i64 undef, double %a1.coerce0, i64 %a1.coerce1, i64 %a1.coerce2, i64 %a1.coerce3, double %a2.coerce0, i64 %a2.coerce1, i64 %a2.coerce2, i64 %a2.coerce3, i32 3, i64 undef, double %a3.coerce0, i64 %a3.coerce1, i64 %a3.coerce2, i64 %a3.coerce3)
// N64: declare void @foo2(i32, i32, i32, i64, double, i64, i64, i64, double, i64, i64, i64, i32, i64, double, i64, i64, i64)
@@ -20,7 +21,7 @@ void foo1(int a0, S0 a1, S0 a2, int b, S0 a3) {
// Insert padding before long double argument.
//
-// N64: define void @foo3(i32 %a0, i64, fp128 %a1)
+// N64-LABEL: define void @foo3(i32 %a0, i64, fp128 %a1)
// N64: tail call void @foo4(i32 1, i32 2, i32 %a0, i64 undef, fp128 %a1)
// N64: declare void @foo4(i32, i32, i32, i64, fp128)
@@ -32,7 +33,7 @@ void foo3(int a0, long double a1) {
// Insert padding after hidden argument.
//
-// N64: define void @foo5(%struct.S0* noalias sret %agg.result, i64, fp128 %a0)
+// N64-LABEL: define void @foo5(%struct.S0* noalias sret %agg.result, i64, fp128 %a0)
// N64: call void @foo6(%struct.S0* sret %agg.result, i32 1, i32 2, i64 undef, fp128 %a0)
// N64: declare void @foo6(%struct.S0* sret, i32, i32, i64, fp128)
@@ -44,7 +45,7 @@ S0 foo5(long double a0) {
// Do not insert padding if ABI is O32.
//
-// O32: define void @foo7(float %a0, double %a1)
+// O32-LABEL: define void @foo7(float %a0, double %a1)
// O32: declare void @foo8(float, double)
extern void foo8(float, double);
@@ -53,3 +54,18 @@ void foo7(float a0, double a1) {
foo8(a0 + 1.0f, a1 + 2.0);
}
+// O32-LABEL: define void @foo9()
+// O32: declare void @foo10(i32, i32
+
+typedef struct __attribute__((aligned(16))) {
+ int a;
+} S16;
+
+S16 s16;
+
+void foo10(int, S16);
+
+void foo9(void) {
+ foo10(1, s16);
+}
+
diff --git a/test/CodeGen/mmx-inline-asm-error.c b/test/CodeGen/mmx-inline-asm-error.c
new file mode 100644
index 000000000000..a6393682ced1
--- /dev/null
+++ b/test/CodeGen/mmx-inline-asm-error.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -verify -triple x86_64-unknown-unknown -emit-llvm-only %s
+typedef int vec256 __attribute__((ext_vector_type(8)));
+
+vec256 foo(vec256 in) {
+ vec256 out;
+
+ asm("something %0" : : "y"(in)); // expected-error {{invalid type 'vec256' in asm input for constraint 'y'}}
+ asm("something %0" : "=y"(out)); // expected-error {{invalid type 'vec256' in asm input for constraint 'y'}}
+ asm("something %0, %0" : "+y"(out)); // expected-error {{invalid type 'vec256' in asm input for constraint 'y'}}
+
+ return out;
+}
+
diff --git a/test/CodeGen/mrtd.c b/test/CodeGen/mrtd.c
index a40a59ac0fcc..8fa7cf02cead 100644
--- a/test/CodeGen/mrtd.c
+++ b/test/CodeGen/mrtd.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -mrtd -triple i386-unknown-freebsd9.0 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -mrtd -triple i386-unknown-unknown -std=c89 -emit-llvm -o - %s | FileCheck %s
void baz(int arg);
@@ -14,4 +14,13 @@ void foo(int arg) {
// CHECK: declare x86_stdcallcc void @baz(i32)
+void qux(int arg, ...) { }
+// CHECK: define void @qux(i32 %arg, ...)
+
+void quux(int a1, int a2, int a3) {
+ qux(a1, a2, a3);
+}
+// CHECK-LABEL: define x86_stdcallcc void @quux
+// CHECK: call void (i32, ...)* @qux
+
// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
diff --git a/test/CodeGen/ms-declspecs.c b/test/CodeGen/ms-declspecs.c
index 26bdc58ebb7f..5dc7787b8fb9 100644
--- a/test/CodeGen/ms-declspecs.c
+++ b/test/CodeGen/ms-declspecs.c
@@ -1,5 +1,10 @@
// RUN: %clang_cc1 -triple i386-pc-win32 %s -emit-llvm -fms-compatibility -o - | FileCheck %s
+__declspec(selectany) int x1 = 1;
+const __declspec(selectany) int x2 = 2;
+// CHECK: @x1 = weak_odr global i32 1, align 4
+// CHECK: @x2 = weak_odr constant i32 2, align 4
+
struct __declspec(align(16)) S {
char x;
};
diff --git a/test/CodeGen/ms-inline-asm-64.c b/test/CodeGen/ms-inline-asm-64.c
index dd7b9b3349eb..f667708c6591 100644
--- a/test/CodeGen/ms-inline-asm-64.c
+++ b/test/CodeGen/ms-inline-asm-64.c
@@ -1,5 +1,5 @@
// REQUIRES: x86-64-registered-target
-// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -O0 -fasm-blocks -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s
void t1() {
int var = 10;
diff --git a/test/CodeGen/ms-inline-asm.c b/test/CodeGen/ms-inline-asm.c
index c71a8df0ec7a..c4486f6f332f 100644
--- a/test/CodeGen/ms-inline-asm.c
+++ b/test/CodeGen/ms-inline-asm.c
@@ -1,5 +1,5 @@
// REQUIRES: x86-64-registered-target
-// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -O0 -fasm-blocks -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s
void t1() {
// CHECK: @t1
diff --git a/test/CodeGen/ms-inline-asm.cpp b/test/CodeGen/ms-inline-asm.cpp
index 8f824f9947b6..64b8558b483a 100644
--- a/test/CodeGen/ms-inline-asm.cpp
+++ b/test/CodeGen/ms-inline-asm.cpp
@@ -1,5 +1,5 @@
// REQUIRES: x86-64-registered-target
-// RUN: %clang_cc1 -x c++ %s -triple i386-apple-darwin10 -O0 -fasm-blocks -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -x c++ %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s
// rdar://13645930
@@ -39,7 +39,7 @@ void t2() {
// CHECK: call void asm sideeffect inteldialect "mov eax, $0", "r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32** @_ZN3Foo3Bar3ptrE)
}
-// CHECK: define void @_Z2t3v()
+// CHECK-LABEL: define void @_Z2t3v()
void t3() {
__asm mov eax, LENGTH Foo::ptr
// CHECK: call void asm sideeffect inteldialect "mov eax, $$1", "~{eax},~{dirflag},~{fpsr},~{flags}"()
@@ -76,7 +76,7 @@ struct T4 {
void test();
};
-// CHECK: define void @_ZN2T44testEv(
+// CHECK-LABEL: define void @_ZN2T44testEv(
void T4::test() {
// CHECK: [[T0:%.*]] = alloca [[T4:%.*]]*,
// CHECK: [[THIS:%.*]] = load [[T4]]** [[T0]]
@@ -91,7 +91,7 @@ template <class T> struct T5 {
template <class U> static T create(U);
void run();
};
-// CHECK: define void @_Z5test5v()
+// CHECK-LABEL: define void @_Z5test5v()
void test5() {
// CHECK: [[X:%.*]] = alloca i32
// CHECK: [[Y:%.*]] = alloca i32
@@ -103,3 +103,11 @@ void test5() {
__asm mov x, eax
// CHECK: call void asm sideeffect inteldialect "mov dword ptr $0, eax", "=*m,~{dirflag},~{fpsr},~{flags}"(i32* [[X]])
}
+
+// Just verify this doesn't emit an error.
+void test6() {
+ __asm {
+ a:
+ jmp a
+ }
+}
diff --git a/test/CodeGen/ms_abi.c b/test/CodeGen/ms_abi.c
new file mode 100644
index 000000000000..7c5c26fc41c2
--- /dev/null
+++ b/test/CodeGen/ms_abi.c
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-freebsd10.0 -emit-llvm < %s | FileCheck -check-prefix=FREEBSD %s
+// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm < %s | FileCheck -check-prefix=WIN64 %s
+
+void __attribute__((ms_abi)) f1(void);
+void __attribute__((sysv_abi)) f2(void);
+void f3(void) {
+// FREEBSD: define void @f3()
+// WIN64: define void @f3()
+ f1();
+// FREEBSD: call x86_64_win64cc void @f1()
+// WIN64: call void @f1()
+ f2();
+// FREEBSD: call void @f2()
+// WIN64: call x86_64_sysvcc void @f2()
+}
+// FREEBSD: declare x86_64_win64cc void @f1()
+// FREEBSD: declare void @f2()
+// WIN64: declare void @f1()
+// WIN64: declare x86_64_sysvcc void @f2()
+
diff --git a/test/CodeGen/mult-alt-generic.c b/test/CodeGen/mult-alt-generic.c
index 111679e3a980..6c9d789e412b 100644
--- a/test/CodeGen/mult-alt-generic.c
+++ b/test/CodeGen/mult-alt-generic.c
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -triple i686 %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -triple x86_64 %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -triple arm %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -triple mblaze %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -triple mips %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -triple mipsel %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -triple powerpc %s -emit-llvm -o - | FileCheck %s
diff --git a/test/CodeGen/no-opt-volatile-memcpy.c b/test/CodeGen/no-opt-volatile-memcpy.c
index 0fab3632805f..718d704a3338 100644
--- a/test/CodeGen/no-opt-volatile-memcpy.c
+++ b/test/CodeGen/no-opt-volatile-memcpy.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -O0 -triple=x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple=x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
// rdar://11861085
struct s {
@@ -14,7 +14,7 @@ void foo (void) {
gs = gs;
ls = gs;
}
-// CHECK: define void @foo()
+// CHECK-LABEL: define void @foo()
// CHECK: %[[LS:.*]] = alloca %struct.s, align 4
// CHECK-NEXT: %[[ZERO:.*]] = bitcast %struct.s* %[[LS]] to i8*
// CHECK-NEXT: %[[ONE:.*]] = bitcast %struct.s* %[[LS]] to i8*
@@ -34,7 +34,7 @@ void fee (void) {
s = s;
s.y = gs;
}
-// CHECK: define void @fee()
+// CHECK-LABEL: define void @fee()
// CHECK: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true)
// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true)
diff --git a/test/CodeGen/nomathbuiltin.c b/test/CodeGen/nomathbuiltin.c
new file mode 100644
index 000000000000..f80cd91de9d4
--- /dev/null
+++ b/test/CodeGen/nomathbuiltin.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fno-math-builtin -emit-llvm -o - %s | FileCheck %s
+
+// Check that the -fno-math-builtin option for -cc1 is working properly.
+
+
+double pow(double, double);
+
+double foo(double a, double b) {
+ return pow(a, b);
+// CHECK: call double @pow
+}
+
diff --git a/test/CodeGen/nvptx-abi.c b/test/CodeGen/nvptx-abi.c
new file mode 100644
index 000000000000..f846def2de52
--- /dev/null
+++ b/test/CodeGen/nvptx-abi.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -triple nvptx-unknown-unknown -S -o - %s -emit-llvm | FileCheck %s
+// RUN: %clang_cc1 -triple nvptx64-unknown-unknown -S -o - %s -emit-llvm | FileCheck %s
+
+typedef struct float4_s {
+ float x, y, z, w;
+} float4_t;
+
+float4_t my_function(void);
+
+// CHECK-DAG: declare %struct.float4_s @my_function
+
+float bar(void) {
+ float4_t ret;
+// CHECK-DAG: call %struct.float4_s @my_function
+ ret = my_function();
+ return ret.x;
+}
diff --git a/test/CodeGen/nvptx-inlineasm-ptx.c b/test/CodeGen/nvptx-inlineasm-ptx.c
new file mode 100644
index 000000000000..0a19123ee074
--- /dev/null
+++ b/test/CodeGen/nvptx-inlineasm-ptx.c
@@ -0,0 +1,40 @@
+// RUN: %clang_cc1 -triple nvptx-unknown-unknown -O3 -S -o - %s -emit-llvm | FileCheck %s
+// RUN: %clang_cc1 -triple nvptx64-unknown-unknown -O3 -S -o - %s -emit-llvm | FileCheck %s
+
+void constraints() {
+ char c;
+ unsigned char uc;
+ short s;
+ unsigned short us;
+ int i;
+ unsigned int ui;
+ long l;
+ unsigned long ul;
+ float f;
+ double d;
+
+ // CHECK: i8 asm sideeffect "mov.b8 $0, $1;", "=c,c"
+ asm volatile ("mov.b8 %0, %1;" : "=c"(c) : "c"(c));
+ // CHECK: i8 asm sideeffect "mov.b8 $0, $1;", "=c,c"
+ asm volatile ("mov.b8 %0, %1;" : "=c"(uc) : "c"(uc));
+
+ // CHECK: i16 asm sideeffect "mov.b16 $0, $1;", "=h,h"
+ asm volatile ("mov.b16 %0, %1;" : "=h"(s) : "h"(s));
+ // CHECK: i16 asm sideeffect "mov.b16 $0, $1;", "=h,h"
+ asm volatile ("mov.b16 %0, %1;" : "=h"(us) : "h"(us));
+
+ // CHECK: i32 asm sideeffect "mov.b32 $0, $1;", "=r,r"
+ asm volatile ("mov.b32 %0, %1;" : "=r"(i) : "r"(i));
+ // CHECK: i32 asm sideeffect "mov.b32 $0, $1;", "=r,r"
+ asm volatile ("mov.b32 %0, %1;" : "=r"(ui) : "r"(ui));
+
+ // CHECK: i64 asm sideeffect "mov.b64 $0, $1;", "=l,l"
+ asm volatile ("mov.b64 %0, %1;" : "=l"(l) : "l"(l));
+ // CHECK: i64 asm sideeffect "mov.b64 $0, $1;", "=l,l"
+ asm volatile ("mov.b64 %0, %1;" : "=l"(ul) : "l"(ul));
+
+ // CHECK: float asm sideeffect "mov.b32 $0, $1;", "=f,f"
+ asm volatile ("mov.b32 %0, %1;" : "=f"(f) : "f"(f));
+ // CHECK: double asm sideeffect "mov.b64 $0, $1;", "=d,d"
+ asm volatile ("mov.b64 %0, %1;" : "=d"(d) : "d"(d));
+}
diff --git a/test/CodeGen/object-size.c b/test/CodeGen/object-size.c
index f6c7db835bf3..5a4dc99f3658 100644
--- a/test/CodeGen/object-size.c
+++ b/test/CodeGen/object-size.c
@@ -13,38 +13,38 @@ char gbuf[63];
char *gp;
int gi, gj;
-// CHECK: define void @test1
+// CHECK-LABEL: define void @test1
void test1() {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8]* @gbuf, i32 0, i64 4), i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0), i64 59)
strcpy(&gbuf[4], "Hi there");
}
-// CHECK: define void @test2
+// CHECK-LABEL: define void @test2
void test2() {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8]* @gbuf, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0), i64 63)
strcpy(gbuf, "Hi there");
}
-// CHECK: define void @test3
+// CHECK-LABEL: define void @test3
void test3() {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8]* @gbuf, i64 1, i64 37), i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0), i64 0)
strcpy(&gbuf[100], "Hi there");
}
-// CHECK: define void @test4
+// CHECK-LABEL: define void @test4
void test4() {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8]* @gbuf, i32 0, i64 -1), i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0), i64 0)
strcpy((char*)(void*)&gbuf[-1], "Hi there");
}
-// CHECK: define void @test5
+// CHECK-LABEL: define void @test5
void test5() {
// CHECK: = load i8** @gp
- // CHECK-NEXT:= call i64 @llvm.objectsize.i64(i8* %{{.*}}, i1 false)
+ // CHECK-NEXT:= call i64 @llvm.objectsize.i64.p0i8(i8* %{{.*}}, i1 false)
strcpy(gp, "Hi there");
}
-// CHECK: define void @test6
+// CHECK-LABEL: define void @test6
void test6() {
char buf[57];
@@ -52,7 +52,7 @@ void test6() {
strcpy(&buf[4], "Hi there");
}
-// CHECK: define void @test7
+// CHECK-LABEL: define void @test7
void test7() {
int i;
// Ensure we only evaluate the side-effect once.
@@ -62,7 +62,7 @@ void test7() {
strcpy((++i, gbuf), "Hi there");
}
-// CHECK: define void @test8
+// CHECK-LABEL: define void @test8
void test8() {
char *buf[50];
// CHECK-NOT: __strcpy_chk
@@ -70,14 +70,14 @@ void test8() {
strcpy(buf[++gi], "Hi there");
}
-// CHECK: define void @test9
+// CHECK-LABEL: define void @test9
void test9() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0))
strcpy((char *)((++gi) + gj), "Hi there");
}
-// CHECK: define void @test10
+// CHECK-LABEL: define void @test10
char **p;
void test10() {
// CHECK-NOT: __strcpy_chk
@@ -85,42 +85,42 @@ void test10() {
strcpy(*(++p), "Hi there");
}
-// CHECK: define void @test11
+// CHECK-LABEL: define void @test11
void test11() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* getelementptr inbounds ([63 x i8]* @gbuf, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0))
strcpy(gp = gbuf, "Hi there");
}
-// CHECK: define void @test12
+// CHECK-LABEL: define void @test12
void test12() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0))
strcpy(++gp, "Hi there");
}
-// CHECK: define void @test13
+// CHECK-LABEL: define void @test13
void test13() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0))
strcpy(gp++, "Hi there");
}
-// CHECK: define void @test14
+// CHECK-LABEL: define void @test14
void test14() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0))
strcpy(--gp, "Hi there");
}
-// CHECK: define void @test15
+// CHECK-LABEL: define void @test15
void test15() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{..*}}, i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0))
strcpy(gp--, "Hi there");
}
-// CHECK: define void @test16
+// CHECK-LABEL: define void @test16
void test16() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0))
diff --git a/test/CodeGen/override-layout.c b/test/CodeGen/override-layout.c
index 99c2cd656ec0..57de8b525dcf 100644
--- a/test/CodeGen/override-layout.c
+++ b/test/CodeGen/override-layout.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -w -fdump-record-layouts %s 2> %t.layouts
-// RUN: %clang_cc1 -w -fdump-record-layouts-simple %s > %t.before 2>&1
-// RUN: %clang_cc1 -w -DPACKED= -DALIGNED16= -fdump-record-layouts-simple -foverride-record-layout=%t.layouts %s > %t.after 2>&1
+// RUN: %clang_cc1 -w -fdump-record-layouts %s > %t.layouts
+// RUN: %clang_cc1 -w -fdump-record-layouts-simple %s > %t.before
+// RUN: %clang_cc1 -w -DPACKED= -DALIGNED16= -fdump-record-layouts-simple -foverride-record-layout=%t.layouts %s > %t.after
// RUN: diff %t.before %t.after
// RUN: FileCheck %s < %t.after
@@ -19,24 +19,32 @@ struct X0 {
int x[6] PACKED;
};
+void use_X0() { struct X0 x0; x0.x[5] = sizeof(struct X0); };
+
// CHECK: Type: struct X1
struct X1 {
char x[13];
struct X0 y;
} PACKED;
+void use_X1() { struct X1 x1; x1.x[5] = sizeof(struct X1); };
+
// CHECK: Type: struct X2
struct PACKED X2 {
short x;
int y;
};
+void use_X2() { struct X2 x2; x2.y = sizeof(struct X2); };
+
// CHECK: Type: struct X3
struct X3 {
short x PACKED;
int y;
};
+void use_X3() { struct X3 x3; x3.y = sizeof(struct X3); };
+
#pragma pack(push,2)
// CHECK: Type: struct X4
struct X4 {
@@ -45,18 +53,26 @@ struct X4 {
};
#pragma pack(pop)
+void use_X4() { struct X4 x4; x4.y = sizeof(struct X4); };
+
// CHECK: Type: struct X5
struct PACKED X5 { double a[19]; signed char b; };
+void use_X5() { struct X5 x5; x5.b = sizeof(struct X5); };
+
// CHECK: Type: struct X6
struct PACKED X6 { long double a; char b; };
+void use_X6() { struct X6 x6; x6.b = sizeof(struct X6); };
+
// CHECK: Type: struct X7
struct X7 {
unsigned x;
unsigned char y;
} PACKED;
+void use_X7() { struct X7 x7; x7.y = x7.x = sizeof(struct X7); }
+
// CHECK: Type: union X8
union X8 {
struct X7 x;
@@ -114,32 +130,6 @@ struct ALIGNED16 X16 {
};
void use_structs() {
- struct X0 x0;
- x0.x[5] = sizeof(struct X0);
-
- struct X1 x1;
- x1.x[5] = sizeof(struct X1);
-
- struct X2 x2;
- x2.y = sizeof(struct X2);
-
- struct X3 x3;
- x3.y = sizeof(struct X3);
-
- struct X4 x4;
- x4.y = sizeof(struct X4);
-
- struct X5 x5;
- x5.b = sizeof(struct X5);
-
- struct X6 x6;
- x6.b = sizeof(struct X6);
-
- struct X7 x7;
- typedef int X7array[sizeof(struct X7)];
- x7.x = sizeof(struct X7);
- x7.y = x7.x;
-
union X8 x8;
typedef int X8array[sizeof(union X8)];
x8.y = sizeof(union X8);
diff --git a/test/CodeGen/packed-arrays.c b/test/CodeGen/packed-arrays.c
index 0c8bb6c7bd4f..8e748dfcfce7 100644
--- a/test/CodeGen/packed-arrays.c
+++ b/test/CodeGen/packed-arrays.c
@@ -51,10 +51,10 @@ int align2_x0 = __alignof(((struct s2*) 0)->x[0]);
// CHECK: @align3_x0 = global i32 4
int align3_x0 = __alignof(((struct s3*) 0)->x[0]);
-// CHECK: define i32 @f0_a
+// CHECK-LABEL: define i32 @f0_a
// CHECK: load i32* %{{.*}}, align 1
// CHECK: }
-// CHECK: define i32 @f0_b
+// CHECK-LABEL: define i32 @f0_b
// CHECK: load i32* %{{.*}}, align 4
// CHECK: }
int f0_a(struct s0 *a) {
@@ -66,19 +66,19 @@ int f0_b(struct s0 *a) {
// Note that we are incompatible with GCC on this example.
//
-// CHECK: define i32 @f1_a
+// CHECK-LABEL: define i32 @f1_a
// CHECK: load i32* %{{.*}}, align 1
// CHECK: }
-// CHECK: define i32 @f1_b
+// CHECK-LABEL: define i32 @f1_b
// CHECK: load i32* %{{.*}}, align 4
// CHECK: }
// Note that we are incompatible with GCC on this example.
//
-// CHECK: define i32 @f1_c
+// CHECK-LABEL: define i32 @f1_c
// CHECK: load i32* %{{.*}}, align 4
// CHECK: }
-// CHECK: define i32 @f1_d
+// CHECK-LABEL: define i32 @f1_d
// CHECK: load i32* %{{.*}}, align 1
// CHECK: }
int f1_a(struct s1 *a) {
@@ -94,16 +94,16 @@ int f1_d(struct s1 *a) {
return a->z;
}
-// CHECK: define i32 @f2_a
+// CHECK-LABEL: define i32 @f2_a
// CHECK: load i32* %{{.*}}, align 1
// CHECK: }
-// CHECK: define i32 @f2_b
+// CHECK-LABEL: define i32 @f2_b
// CHECK: load i32* %{{.*}}, align 4
// CHECK: }
-// CHECK: define i32 @f2_c
+// CHECK-LABEL: define i32 @f2_c
// CHECK: load i32* %{{.*}}, align 1
// CHECK: }
-// CHECK: define i32 @f2_d
+// CHECK-LABEL: define i32 @f2_d
// CHECK: load i32* %{{.*}}, align 1
// CHECK: }
int f2_a(struct s2 *a) {
@@ -119,16 +119,16 @@ int f2_d(struct s2 *a) {
return a->z;
}
-// CHECK: define i32 @f3_a
+// CHECK-LABEL: define i32 @f3_a
// CHECK: load i32* %{{.*}}, align 1
// CHECK: }
-// CHECK: define i32 @f3_b
+// CHECK-LABEL: define i32 @f3_b
// CHECK: load i32* %{{.*}}, align 4
// CHECK: }
-// CHECK: define i32 @f3_c
+// CHECK-LABEL: define i32 @f3_c
// CHECK: load i32* %{{.*}}, align 1
// CHECK: }
-// CHECK: define i32 @f3_d
+// CHECK-LABEL: define i32 @f3_d
// CHECK: load i32* %{{.*}}, align 1
// CHECK: }
int f3_a(struct s3 *a) {
@@ -146,7 +146,7 @@ int f3_d(struct s3 *a) {
// Verify we don't claim things are overaligned.
//
-// CHECK: define double @f4
+// CHECK-LABEL: define double @f4
// CHECK: load double* {{.*}}, align 8
// CHECK: }
extern double g4[5] __attribute__((aligned(16)));
diff --git a/test/CodeGen/packed-nest-unpacked.c b/test/CodeGen/packed-nest-unpacked.c
index 7f486c99987d..393174196f4e 100644
--- a/test/CodeGen/packed-nest-unpacked.c
+++ b/test/CodeGen/packed-nest-unpacked.c
@@ -28,7 +28,7 @@ void test3(struct X a) {
// <rdar://problem/10530444>
void test4() {
// CHECK: @test4
- // FIXME: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* bitcast (%struct.X* getelementptr inbounds (%struct.Y* @g, i32 0, i32 1) to i8*), i64 24, i32 1, i1 false)
+ // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* bitcast (%struct.X* getelementptr inbounds (%struct.Y* @g, i32 0, i32 1) to i8*), i64 24, i32 1, i1 false)
f(g.y);
}
diff --git a/test/CodeGen/packed-structure.c b/test/CodeGen/packed-structure.c
index ffd98dbfcf36..a915a544b9eb 100644
--- a/test/CodeGen/packed-structure.c
+++ b/test/CodeGen/packed-structure.c
@@ -16,7 +16,7 @@ int s0_align_x = __alignof(((struct s0*)0)->x);
int s0_align_y = __alignof(((struct s0*)0)->y);
int s0_align = __alignof(struct s0);
-// CHECK-FUNCTIONS: define i32 @s0_load_x
+// CHECK-FUNCTIONS-LABEL: define i32 @s0_load_x
// CHECK-FUNCTIONS: [[s0_load_x:%.*]] = load i32* {{.*}}, align 4
// CHECK-FUNCTIONS: ret i32 [[s0_load_x]]
int s0_load_x(struct s0 *a) { return a->x; }
@@ -24,11 +24,11 @@ int s0_load_x(struct s0 *a) { return a->x; }
// has changed in llvm-gcc recently, previously both x and y would be loaded
// with align 1 (in 2363.1 at least).
//
-// CHECK-FUNCTIONS: define i32 @s0_load_y
+// CHECK-FUNCTIONS-LABEL: define i32 @s0_load_y
// CHECK-FUNCTIONS: [[s0_load_y:%.*]] = load i32* {{.*}}, align 1
// CHECK-FUNCTIONS: ret i32 [[s0_load_y]]
int s0_load_y(struct s0 *a) { return a->y; }
-// CHECK-FUNCTIONS: define void @s0_copy
+// CHECK-FUNCTIONS-LABEL: define void @s0_copy
// CHECK-FUNCTIONS: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* {{.*}}, i64 8, i32 4, i1 false)
void s0_copy(struct s0 *a, struct s0 *b) { *b = *a; }
@@ -46,15 +46,15 @@ int s1_align_x = __alignof(((struct s1*)0)->x);
int s1_align_y = __alignof(((struct s1*)0)->y);
int s1_align = __alignof(struct s1);
-// CHECK-FUNCTIONS: define i32 @s1_load_x
+// CHECK-FUNCTIONS-LABEL: define i32 @s1_load_x
// CHECK-FUNCTIONS: [[s1_load_x:%.*]] = load i32* {{.*}}, align 1
// CHECK-FUNCTIONS: ret i32 [[s1_load_x]]
int s1_load_x(struct s1 *a) { return a->x; }
-// CHECK-FUNCTIONS: define i32 @s1_load_y
+// CHECK-FUNCTIONS-LABEL: define i32 @s1_load_y
// CHECK-FUNCTIONS: [[s1_load_y:%.*]] = load i32* {{.*}}, align 1
// CHECK-FUNCTIONS: ret i32 [[s1_load_y]]
int s1_load_y(struct s1 *a) { return a->y; }
-// CHECK-FUNCTIONS: define void @s1_copy
+// CHECK-FUNCTIONS-LABEL: define void @s1_copy
// CHECK-FUNCTIONS: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* {{.*}}, i64 8, i32 1, i1 false)
void s1_copy(struct s1 *a, struct s1 *b) { *b = *a; }
@@ -74,15 +74,15 @@ int s2_align_x = __alignof(((struct s2*)0)->x);
int s2_align_y = __alignof(((struct s2*)0)->y);
int s2_align = __alignof(struct s2);
-// CHECK-FUNCTIONS: define i32 @s2_load_x
+// CHECK-FUNCTIONS-LABEL: define i32 @s2_load_x
// CHECK-FUNCTIONS: [[s2_load_y:%.*]] = load i32* {{.*}}, align 2
// CHECK-FUNCTIONS: ret i32 [[s2_load_y]]
int s2_load_x(struct s2 *a) { return a->x; }
-// CHECK-FUNCTIONS: define i32 @s2_load_y
+// CHECK-FUNCTIONS-LABEL: define i32 @s2_load_y
// CHECK-FUNCTIONS: [[s2_load_y:%.*]] = load i32* {{.*}}, align 2
// CHECK-FUNCTIONS: ret i32 [[s2_load_y]]
int s2_load_y(struct s2 *a) { return a->y; }
-// CHECK-FUNCTIONS: define void @s2_copy
+// CHECK-FUNCTIONS-LABEL: define void @s2_copy
// CHECK-FUNCTIONS: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* {{.*}}, i64 8, i32 2, i1 false)
void s2_copy(struct s2 *a, struct s2 *b) { *b = *a; }
@@ -92,7 +92,7 @@ struct __attribute__((packed, aligned)) s3 {
};
// CHECK-GLOBAL: @s3_1 = global i32 1
int s3_1 = __alignof(((struct s3*) 0)->anInt);
-// CHECK-FUNCTIONS: define i32 @test3(
+// CHECK-FUNCTIONS-LABEL: define i32 @test3(
int test3(struct s3 *ptr) {
// CHECK-FUNCTIONS: [[PTR:%.*]] = getelementptr inbounds {{%.*}}* {{%.*}}, i32 0, i32 1
// CHECK-FUNCTIONS-NEXT: load i32* [[PTR]], align 1
diff --git a/test/CodeGen/ppc64-extend.c b/test/CodeGen/ppc64-extend.c
index 68d28c79b526..d46b65104392 100644
--- a/test/CodeGen/ppc64-extend.c
+++ b/test/CodeGen/ppc64-extend.c
@@ -1,5 +1,5 @@
// REQUIRES: ppc64-registered-target
-// RUN: %clang_cc1 -O0 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
void f1(int x) { return; }
// CHECK: define void @f1(i32 signext %x) [[NUW:#[0-9]+]]
diff --git a/test/CodeGen/ppc64-struct-onefloat.c b/test/CodeGen/ppc64-struct-onefloat.c
index 4f9e1949cea3..e26987f44a0e 100644
--- a/test/CodeGen/ppc64-struct-onefloat.c
+++ b/test/CodeGen/ppc64-struct-onefloat.c
@@ -1,5 +1,5 @@
// REQUIRES: ppc64-registered-target
-// RUN: %clang_cc1 -O0 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
typedef struct s1 { float f; } Sf;
typedef struct s2 { double d; } Sd;
@@ -8,7 +8,7 @@ typedef struct s5 { Sd ds; } SSd;
void bar(Sf a, Sd b, SSf d, SSd e) {}
-// CHECK: define void @bar
+// CHECK-LABEL: define void @bar
// CHECK: %a = alloca %struct.s1, align 4
// CHECK: %b = alloca %struct.s2, align 8
// CHECK: %d = alloca %struct.s4, align 4
@@ -34,7 +34,7 @@ void foo(void)
bar(p1, p2, p4, p5);
}
-// CHECK: define void @foo
+// CHECK-LABEL: define void @foo
// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr %struct.s1* %p1, i32 0, i32 0
// CHECK: %{{[0-9]+}} = load float* %{{[a-zA-Z0-9.]+}}, align 1
// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr %struct.s2* %p2, i32 0, i32 0
diff --git a/test/CodeGen/ppc64-struct-onevect.c b/test/CodeGen/ppc64-struct-onevect.c
new file mode 100644
index 000000000000..a5a1232ffa89
--- /dev/null
+++ b/test/CodeGen/ppc64-struct-onevect.c
@@ -0,0 +1,13 @@
+// REQUIRES: ppc64-registered-target
+// RUN: %clang_cc1 -O2 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
+
+typedef float v4sf __attribute__ ((vector_size (16)));
+
+struct s { v4sf v; };
+
+v4sf foo (struct s a) {
+ return a.v;
+}
+
+// CHECK-LABEL: define <4 x float> @foo(<4 x float> inreg %a.coerce)
+// CHECK: ret <4 x float> %a.coerce
diff --git a/test/CodeGen/pr12251.c b/test/CodeGen/pr12251.c
index b01713122141..ea74cc6a594d 100644
--- a/test/CodeGen/pr12251.c
+++ b/test/CodeGen/pr12251.c
@@ -5,7 +5,7 @@ enum e1 g1(enum e1 *x) {
return *x;
}
-// CHECK: define i32 @g1
+// CHECK-LABEL: define i32 @g1
// CHECK: load i32* %x, align 4
// CHECK-NOT: range
// CHECK: ret
diff --git a/test/CodeGen/pr2394.c b/test/CodeGen/pr2394.c
index f1091ec2fba3..c92e364dedac 100644
--- a/test/CodeGen/pr2394.c
+++ b/test/CodeGen/pr2394.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -emit-llvm -o - | FileCheck %s
struct __attribute((packed)) x {int a : 24;};
int a(struct x* g) {
// CHECK: load i24
diff --git a/test/CodeGen/pr3518.c b/test/CodeGen/pr3518.c
index f96a5aa65f19..ff8d75e7b90c 100644
--- a/test/CodeGen/pr3518.c
+++ b/test/CodeGen/pr3518.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
// PR 3518
// Some of the objects were coming out as unintialized (external) before 3518
// was fixed. Internal names are different between llvm-gcc and clang so they
diff --git a/test/CodeGen/pr4349.c b/test/CodeGen/pr4349.c
index 94b4fbd5db46..016995871a49 100644
--- a/test/CodeGen/pr4349.c
+++ b/test/CodeGen/pr4349.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
// PR 4349
union reg
diff --git a/test/CodeGen/pr9614.c b/test/CodeGen/pr9614.c
index 8fdb2f299ce0..53abef1801d9 100644
--- a/test/CodeGen/pr9614.c
+++ b/test/CodeGen/pr9614.c
@@ -18,7 +18,7 @@ void f(void) {
strrchr_foo("", '.');
}
-// CHECK: define void @f()
+// CHECK-LABEL: define void @f()
// CHECK: call void @foo()
// CHECK-NEXT: call void @bar()
// CHECK-NEXT: call i8* @strrchr(
diff --git a/test/CodeGen/pragma-comment.c b/test/CodeGen/pragma-comment.c
new file mode 100644
index 000000000000..30bf7b7d4e5b
--- /dev/null
+++ b/test/CodeGen/pragma-comment.c
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple x86_64-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple i686-pc-linux -fms-extensions -emit-llvm -o - | FileCheck -check-prefix LINUX %s
+
+#pragma comment(lib, "msvcrt.lib")
+#pragma comment(lib, "kernel32")
+#pragma comment(lib, "USER32.LIB")
+
+#define BAR "2"
+#pragma comment(linker," /bar=" BAR)
+
+// CHECK: !llvm.module.flags = !{!0}
+// CHECK: !0 = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
+// CHECK: ![[link_opts]] = metadata !{metadata ![[msvcrt:[0-9]+]], metadata ![[kernel32:[0-9]+]], metadata ![[USER32:[0-9]+]], metadata ![[bar:[0-9]+]]}
+// CHECK: ![[msvcrt]] = metadata !{metadata !"/DEFAULTLIB:msvcrt.lib"}
+// CHECK: ![[kernel32]] = metadata !{metadata !"/DEFAULTLIB:kernel32.lib"}
+// CHECK: ![[USER32]] = metadata !{metadata !"/DEFAULTLIB:USER32.LIB"}
+// CHECK: ![[bar]] = metadata !{metadata !" /bar=2"}
+
+// LINUX: metadata !{metadata !"-lmsvcrt.lib"}
+// LINUX: metadata !{metadata !"-lkernel32"}
+// LINUX: metadata !{metadata !"-lUSER32.LIB"}
+// LINUX: metadata !{metadata !" /bar=2"}
diff --git a/test/CodeGen/pragma-detect_mismatch.c b/test/CodeGen/pragma-detect_mismatch.c
new file mode 100644
index 000000000000..86cc6d8586f8
--- /dev/null
+++ b/test/CodeGen/pragma-detect_mismatch.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
+
+#pragma detect_mismatch("test", "1")
+
+#define BAR "2"
+#pragma detect_mismatch("test2", BAR)
+
+// CHECK: !llvm.module.flags = !{!0}
+// CHECK: !0 = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
+// CHECK: ![[link_opts]] = metadata !{metadata ![[test:[0-9]+]], metadata ![[test2:[0-9]+]]}
+// CHECK: ![[test]] = metadata !{metadata !"/FAILIFMISMATCH:\22test=1\22"}
+// CHECK: ![[test2]] = metadata !{metadata !"/FAILIFMISMATCH:\22test2=2\22"}
diff --git a/test/CodeGen/pragma-pack-2.c b/test/CodeGen/pragma-pack-2.c
index bfb34d7c688d..1ca3bdf32a28 100644
--- a/test/CodeGen/pragma-pack-2.c
+++ b/test/CodeGen/pragma-pack-2.c
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X32 %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix CHECK-X32 %s
// CHECK-X32: %struct.s0 = type { i64, i64, i32, [12 x i32] }
// CHECK-X32: %struct.s1 = type { [15 x i32], %struct.s0 }
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X64 %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix CHECK-X64 %s
// CHECK-X64: %struct.s0 = type <{ i64, i64, i32, [12 x i32] }>
// CHECK-X64: %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 04b636e9c774..586317430744 100644
--- a/test/CodeGen/pragma-pack-3.c
+++ b/test/CodeGen/pragma-pack-3.c
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X32 %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix CHECK-X32 %s
// CHECK-X32: %union.command = type <{ i8*, [2 x i8] }>
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X64 %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix CHECK-X64 %s
// CHECK-X64: %union.command = type <{ i8*, [2 x i8] }>
// <rdar://problem/7184250>
diff --git a/test/CodeGen/pragma-visibility.c b/test/CodeGen/pragma-visibility.c
index a7fceb3d1ac1..56e73f301aee 100644
--- a/test/CodeGen/pragma-visibility.c
+++ b/test/CodeGen/pragma-visibility.c
@@ -17,8 +17,8 @@ int z = 0;
#pragma GCC visibility push(hidden)
void f() {}
-// CHECK: define hidden void @f
+// CHECK-LABEL: define hidden void @f
__attribute((visibility("default"))) void g();
void g() {}
-// CHECK: define void @g
+// CHECK-LABEL: define void @g
diff --git a/test/CodeGen/pragma-weak.c b/test/CodeGen/pragma-weak.c
index d4b1b9f93f62..b5d186324bf6 100644
--- a/test/CodeGen/pragma-weak.c
+++ b/test/CodeGen/pragma-weak.c
@@ -5,24 +5,22 @@
// CHECK: @correct_linkage = weak global
-// CHECK: @both = alias void ()* @__both
-// CHECK: @both2 = alias void ()* @__both2
-// CHECK: @both3 = alias weak void ()* @__both3
-// CHECK: @a3 = alias weak void ()* @__a3
-// CHECK: @weakvar_alias = alias weak i32* @__weakvar_alias
-// CHECK: @foo = alias weak void ()* @__foo
-// CHECK: @foo2 = alias weak void ()* @__foo2
-// CHECK: @stutter = alias weak void ()* @__stutter
-// CHECK: @stutter2 = alias weak void ()* @__stutter2
-// CHECK: @declfirst = alias weak void ()* @__declfirst
-// CHECK: @declfirstattr = alias weak void ()* @__declfirstattr
-// CHECK: @mix2 = alias weak void ()* @__mix2
-// CHECK: @a1 = alias weak void ()* @__a1
-// CHECK: @xxx = alias weak void ()* @__xxx
+// CHECK-DAG: @both = alias void ()* @__both
+// CHECK-DAG: @both2 = alias void ()* @__both2
+// CHECK-DAG: @weakvar_alias = alias weak i32* @__weakvar_alias
+// CHECK-DAG: @foo = alias weak void ()* @__foo
+// CHECK-DAG: @foo2 = alias weak void ()* @__foo2
+// CHECK-DAG: @stutter = alias weak void ()* @__stutter
+// CHECK-DAG: @stutter2 = alias weak void ()* @__stutter2
+// CHECK-DAG: @declfirst = alias weak void ()* @__declfirst
+// CHECK-DAG: @declfirstattr = alias weak void ()* @__declfirstattr
+// CHECK-DAG: @mix2 = alias weak void ()* @__mix2
+// CHECK-DAG: @a1 = alias weak void ()* @__a1
+// CHECK-DAG: @xxx = alias weak void ()* @__xxx
-// CHECK: define weak void @weakdef()
+// CHECK-LABEL: define weak void @weakdef()
#pragma weak weakvar
@@ -42,12 +40,12 @@ int __weakvar_alias;
#pragma weak foo = __foo
void __foo(void) {}
-// CHECK: define void @__foo()
+// CHECK-LABEL: define void @__foo()
void __foo2(void) {}
#pragma weak foo2 = __foo2
-// CHECK: define void @__foo2()
+// CHECK-LABEL: define void @__foo2()
///// test errors
@@ -69,12 +67,12 @@ typedef int __td2;
#pragma weak stutter = __stutter
#pragma weak stutter = __stutter
void __stutter(void) {}
-// CHECK: define void @__stutter()
+// CHECK-LABEL: define void @__stutter()
void __stutter2(void) {}
#pragma weak stutter2 = __stutter2
#pragma weak stutter2 = __stutter2
-// CHECK: define void @__stutter2()
+// CHECK-LABEL: define void @__stutter2()
// test decl/pragma weak order
@@ -82,12 +80,12 @@ void __stutter2(void) {}
void __declfirst(void);
#pragma weak declfirst = __declfirst
void __declfirst(void) {}
-// CHECK: define void @__declfirst()
+// CHECK-LABEL: define void @__declfirst()
void __declfirstattr(void) __attribute((noinline));
#pragma weak declfirstattr = __declfirstattr
void __declfirstattr(void) {}
-// CHECK: define void @__declfirstattr()
+// CHECK-LABEL: define void @__declfirstattr()
//// test that other attributes are preserved
@@ -96,7 +94,7 @@ void __declfirstattr(void) {}
void mix(void);
#pragma weak mix
__attribute((weak)) void mix(void) { }
-// CHECK: define weak void @mix()
+// CHECK-LABEL: define weak void @mix()
// ensure following __attributes are preserved and that only a single
// alias is generated
@@ -104,7 +102,7 @@ __attribute((weak)) void mix(void) { }
void __mix2(void) __attribute((noinline));
void __mix2(void) __attribute((noinline));
void __mix2(void) {}
-// CHECK: define void @__mix2()
+// CHECK-LABEL: define void @__mix2()
////////////// test #pragma weak/__attribute combinations
@@ -113,7 +111,7 @@ void __mix2(void) {}
void both(void) __attribute((alias("__both")));
#pragma weak both = __both
void __both(void) {}
-// CHECK: define void @__both()
+// CHECK-LABEL: define void @__both()
// if the TARGET is previously declared then whichever aliasing method
// comes first applies and subsequent aliases are discarded.
@@ -123,13 +121,7 @@ void __both2(void);
void both2(void) __attribute((alias("__both2"))); // first, wins
#pragma weak both2 = __both2
void __both2(void) {}
-// CHECK: define void @__both2()
-
-void __both3(void);
-#pragma weak both3 = __both3 // first, wins
-void both3(void) __attribute((alias("__both3")));
-void __both3(void) {}
-// CHECK: define void @__both3()
+// CHECK-LABEL: define void @__both2()
///////////// ensure that #pragma weak does not alter existing __attributes()
@@ -138,16 +130,8 @@ void __a1(void) __attribute((noinline));
void __a1(void) {}
// CHECK: define void @__a1() [[NI:#[0-9]+]]
-// attributes introduced BEFORE a combination of #pragma weak and alias()
-// hold...
-void __a3(void) __attribute((noinline));
-#pragma weak a3 = __a3
-void a3(void) __attribute((alias("__a3")));
-void __a3(void) {}
-// CHECK: define void @__a3() [[NI]]
-
#pragma weak xxx = __xxx
-__attribute((pure,noinline,const,fastcall)) void __xxx(void) { }
+__attribute((pure,noinline,const)) void __xxx(void) { }
// CHECK: void @__xxx() [[RN:#[0-9]+]]
///////////// PR10878: Make sure we can call a weak alias
@@ -165,6 +149,28 @@ void PR14046f() {
}
// CHECK: declare extern_weak i32 @PR14046e()
+// Parse #pragma weak after a label or case statement
+extern int PR16705a(void);
+extern int PR16705b(void);
+extern int PR16705c(void);
+void PR16705f(int a) {
+ switch(a) {
+ case 1:
+#pragma weak PR16705a
+ PR16705a();
+ default:
+#pragma weak PR16705b
+ PR16705b();
+ }
+label:
+ #pragma weak PR16705c
+ PR16705c();
+}
+
+// CHECK: declare extern_weak i32 @PR16705a()
+// CHECK: declare extern_weak i32 @PR16705b()
+// CHECK: declare extern_weak i32 @PR16705c()
+
///////////// TODO: stuff that still doesn't work
@@ -176,7 +182,7 @@ void yyy(void){}
void zzz(void){}
#pragma weak yyy
// NOTE: weak doesn't apply, not before or in same TopLevelDec(!)
-// CHECK: define void @yyy()
+// CHECK-LABEL: define void @yyy()
int correct_linkage;
diff --git a/test/CodeGen/predefined-expr.c b/test/CodeGen/predefined-expr.c
index e2826b68d7df..3471dcdaa2a4 100644
--- a/test/CodeGen/predefined-expr.c
+++ b/test/CodeGen/predefined-expr.c
@@ -6,6 +6,8 @@
// CHECK: @__PRETTY_FUNCTION__.externFunction = private unnamed_addr constant [22 x i8] c"void externFunction()\00"
// CHECK: @__func__.privateExternFunction = private unnamed_addr constant [22 x i8] c"privateExternFunction\00"
// CHECK: @__PRETTY_FUNCTION__.privateExternFunction = private unnamed_addr constant [29 x i8] c"void privateExternFunction()\00"
+// CHECK: @__func__.__captured_stmt = private unnamed_addr constant [25 x i8] c"functionWithCapturedStmt\00"
+// CHECK: @__PRETTY_FUNCTION__.__captured_stmt = private unnamed_addr constant [32 x i8] c"void functionWithCapturedStmt()\00"
// CHECK: @__func__.staticFunction = private unnamed_addr constant [15 x i8] c"staticFunction\00"
// CHECK: @__PRETTY_FUNCTION__.staticFunction = private unnamed_addr constant [22 x i8] c"void staticFunction()\00"
@@ -29,6 +31,15 @@ __private_extern__ void privateExternFunction() {
printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
}
+void functionWithCapturedStmt() {
+ #pragma clang __debug captured
+ {
+ printf("__func__ %s\n", __func__);
+ printf("__FUNCTION__ %s\n", __FUNCTION__);
+ printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
+ }
+}
+
static void staticFunction() {
printf("__func__ %s\n", __func__);
printf("__FUNCTION__ %s\n", __FUNCTION__);
@@ -39,6 +50,7 @@ int main() {
plainFunction();
externFunction();
privateExternFunction();
+ functionWithCapturedStmt();
staticFunction();
return 0;
diff --git a/test/CodeGen/regparm.c b/test/CodeGen/regparm.c
index 4c3752c56a13..151c58f958bd 100644
--- a/test/CodeGen/regparm.c
+++ b/test/CodeGen/regparm.c
@@ -15,7 +15,7 @@ extern void FASTCALL reduced(char b, double c, foo* d, double e, int f);
// PR7025
void FASTCALL f1(int i, int j, int k);
-// CHECK: define void @f1(i32 inreg %i, i32 inreg %j, i32 %k)
+// CHECK-LABEL: define void @f1(i32 inreg %i, i32 inreg %j, i32 %k)
void f1(int i, int j, int k) { }
int
diff --git a/test/CodeGen/sections.c b/test/CodeGen/sections.c
new file mode 100644
index 000000000000..7994acf4dcac
--- /dev/null
+++ b/test/CodeGen/sections.c
@@ -0,0 +1,28 @@
+// REQUIRES: x86-registered-target
+
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -o - < %s | FileCheck %s --check-prefix=PLAIN
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -ffunction-sections -fno-function-sections -o - < %s | FileCheck %s --check-prefix=PLAIN
+
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -ffunction-sections -o - < %s | FileCheck %s --check-prefix=FUNC_SECT
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fno-function-sections -ffunction-sections -o - < %s | FileCheck %s --check-prefix=FUNC_SECT
+
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fdata-sections -o - < %s | FileCheck %s --check-prefix=DATA_SECT
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fno-data-sections -fdata-sections -o - < %s | FileCheck %s --check-prefix=DATA_SECT
+
+const int hello = 123;
+void world() {}
+
+// PLAIN-NOT: section
+// PLAIN: world:
+// PLAIN: section .rodata,
+// PLAIN: hello:
+
+// FUNC_SECT: section .text.world,
+// FUNC_SECT: world:
+// FUNC_SECT: section .rodata,
+// FUNC_SECT: hello:
+
+// DATA_SECT-NOT: section
+// DATA_SECT: world:
+// DATA_SECT: .section .rodata.hello,
+// DATA_SECT: hello:
diff --git a/test/CodeGen/sha-builtins.c b/test/CodeGen/sha-builtins.c
new file mode 100644
index 000000000000..181dba15b539
--- /dev/null
+++ b/test/CodeGen/sha-builtins.c
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 %s -O3 -triple=x86_64-unknown-unknown -target-feature +sha -emit-llvm -o - | FileCheck %s
+
+// Don't include mm_malloc.h, it's system specific.
+#define __MM_MALLOC_H
+
+#include <immintrin.h>
+
+__m128i test_sha1rnds4(__m128i a, __m128i b) {
+ // CHECK: call <4 x i32> @llvm.x86.sha1rnds4
+ return _mm_sha1rnds4_epu32(a, b, 8);
+}
+__m128i test_sha1nexte(__m128i a, __m128i b) {
+ // CHECK: call <4 x i32> @llvm.x86.sha1nexte
+ return _mm_sha1nexte_epu32(a, b);
+}
+__m128i test_sha1msg1(__m128i a, __m128i b) {
+ // CHECK: call <4 x i32> @llvm.x86.sha1msg1
+ return _mm_sha1msg1_epu32(a, b);
+}
+__m128i test_sha1msg2(__m128i a, __m128i b) {
+ // CHECK: call <4 x i32> @llvm.x86.sha1msg2
+ return _mm_sha1msg2_epu32(a, b);
+}
+__m128i test_sha256rnds2(__m128i a, __m128i b, __m128i c) {
+ // CHECK: call <4 x i32> @llvm.x86.sha256rnds2
+ return _mm_sha256rnds2_epu32(a, b, c);
+}
+__m128i test_sha256msg1(__m128i a, __m128i b) {
+ // CHECK: call <4 x i32> @llvm.x86.sha256msg1
+ return _mm_sha256msg1_epu32(a, b);
+}
+__m128i test_sha256msg2(__m128i a, __m128i b) {
+ // CHECK: call <4 x i32> @llvm.x86.sha256msg2
+ return _mm_sha256msg2_epu32(a, b);
+}
diff --git a/test/CodeGen/sparcv9-abi.c b/test/CodeGen/sparcv9-abi.c
new file mode 100644
index 000000000000..4ba4be852fe8
--- /dev/null
+++ b/test/CodeGen/sparcv9-abi.c
@@ -0,0 +1,181 @@
+// RUN: %clang_cc1 -triple sparcv9-unknown-unknown -emit-llvm %s -o - | FileCheck %s
+#include <stdarg.h>
+
+// CHECK-LABEL: define void @f_void()
+void f_void(void) {}
+
+// Arguments and return values smaller than the word size are extended.
+
+// CHECK-LABEL: define signext i32 @f_int_1(i32 signext %x)
+int f_int_1(int x) { return x; }
+
+// CHECK-LABEL: define zeroext i32 @f_int_2(i32 zeroext %x)
+unsigned f_int_2(unsigned x) { return x; }
+
+// CHECK-LABEL: define i64 @f_int_3(i64 %x)
+long long f_int_3(long long x) { return x; }
+
+// CHECK-LABEL: define signext i8 @f_int_4(i8 signext %x)
+char f_int_4(char x) { return x; }
+
+// Small structs are passed in registers.
+struct small {
+ int *a, *b;
+};
+
+// CHECK-LABEL: define %struct.small @f_small(i32* %x.coerce0, i32* %x.coerce1)
+struct small f_small(struct small x) {
+ x.a += *x.b;
+ x.b = 0;
+ return x;
+}
+
+// Medium-sized structs are passed indirectly, but can be returned in registers.
+struct medium {
+ int *a, *b;
+ int *c, *d;
+};
+
+// CHECK-LABEL: define %struct.medium @f_medium(%struct.medium* %x)
+struct medium f_medium(struct medium x) {
+ x.a += *x.b;
+ x.b = 0;
+ return x;
+}
+
+// Large structs are also returned indirectly.
+struct large {
+ int *a, *b;
+ int *c, *d;
+ int x;
+};
+
+// CHECK-LABEL: define void @f_large(%struct.large* noalias sret %agg.result, %struct.large* %x)
+struct large f_large(struct large x) {
+ x.a += *x.b;
+ x.b = 0;
+ return x;
+}
+
+// A 64-bit struct fits in a register.
+struct reg {
+ int a, b;
+};
+
+// CHECK-LABEL: define i64 @f_reg(i64 %x.coerce)
+struct reg f_reg(struct reg x) {
+ x.a += x.b;
+ return x;
+}
+
+// Structs with mixed int and float parts require the inreg attribute.
+struct mixed {
+ int a;
+ float b;
+};
+
+// CHECK-LABEL: define inreg %struct.mixed @f_mixed(i32 inreg %x.coerce0, float inreg %x.coerce1)
+struct mixed f_mixed(struct mixed x) {
+ x.a += 1;
+ return x;
+}
+
+// Struct with padding.
+struct mixed2 {
+ int a;
+ double b;
+};
+
+// CHECK: define { i64, double } @f_mixed2(i64 %x.coerce0, double %x.coerce1)
+// CHECK: store i64 %x.coerce0
+// CHECK: store double %x.coerce1
+struct mixed2 f_mixed2(struct mixed2 x) {
+ x.a += 1;
+ return x;
+}
+
+// Struct with single element and padding in passed in the high bits of a
+// register.
+struct tiny {
+ char a;
+};
+
+// CHECK-LABEL: define i64 @f_tiny(i64 %x.coerce)
+// CHECK: %[[HB:[^ ]+]] = lshr i64 %x.coerce, 56
+// CHECK: = trunc i64 %[[HB]] to i8
+struct tiny f_tiny(struct tiny x) {
+ x.a += 1;
+ return x;
+}
+
+// CHECK-LABEL: define void @call_tiny()
+// CHECK: %[[XV:[^ ]+]] = zext i8 %{{[^ ]+}} to i64
+// CHECK: %[[HB:[^ ]+]] = shl i64 %[[XV]], 56
+// CHECK: = call i64 @f_tiny(i64 %[[HB]])
+void call_tiny() {
+ struct tiny x = { 1 };
+ f_tiny(x);
+}
+
+// CHECK-LABEL: define signext i32 @f_variable(i8* %f, ...)
+// CHECK: %ap = alloca i8*
+// CHECK: call void @llvm.va_start
+//
+int f_variable(char *f, ...) {
+ int s = 0;
+ char c;
+ va_list ap;
+ va_start(ap, f);
+ while ((c = *f++)) switch (c) {
+
+// CHECK: %[[CUR:[^ ]+]] = load i8** %ap
+// CHECK-DAG: %[[NXT:[^ ]+]] = getelementptr i8* %[[CUR]], i32 8
+// CHECK-DAG: store i8* %[[NXT]], i8** %ap
+// CHECK-DAG: %[[EXT:[^ ]+]] = getelementptr i8* %[[CUR]], i32 4
+// CHECK-DAG: %[[ADR:[^ ]+]] = bitcast i8* %[[EXT]] to i32*
+// CHECK-DAG: load i32* %[[ADR]]
+// CHECK: br
+ case 'i':
+ s += va_arg(ap, int);
+ break;
+
+// CHECK: %[[CUR:[^ ]+]] = load i8** %ap
+// CHECK-DAG: %[[NXT:[^ ]+]] = getelementptr i8* %[[CUR]], i32 8
+// CHECK-DAG: store i8* %[[NXT]], i8** %ap
+// CHECK-DAG: %[[ADR:[^ ]+]] = bitcast i8* %[[CUR]] to i64*
+// CHECK-DAG: load i64* %[[ADR]]
+// CHECK: br
+ case 'l':
+ s += va_arg(ap, long);
+ break;
+
+// CHECK: %[[CUR:[^ ]+]] = load i8** %ap
+// CHECK-DAG: %[[NXT:[^ ]+]] = getelementptr i8* %[[CUR]], i32 8
+// CHECK-DAG: store i8* %[[NXT]], i8** %ap
+// CHECK-DAG: %[[ADR:[^ ]+]] = bitcast i8* %[[CUR]] to %struct.tiny*
+// CHECK: br
+ case 't':
+ s += va_arg(ap, struct tiny).a;
+ break;
+
+// CHECK: %[[CUR:[^ ]+]] = load i8** %ap
+// CHECK-DAG: %[[NXT:[^ ]+]] = getelementptr i8* %[[CUR]], i32 16
+// CHECK-DAG: store i8* %[[NXT]], i8** %ap
+// CHECK-DAG: %[[ADR:[^ ]+]] = bitcast i8* %[[CUR]] to %struct.small*
+// CHECK: br
+ case 's':
+ s += *va_arg(ap, struct small).a;
+ break;
+
+// CHECK: %[[CUR:[^ ]+]] = load i8** %ap
+// CHECK-DAG: %[[NXT:[^ ]+]] = getelementptr i8* %[[CUR]], i32 8
+// CHECK-DAG: store i8* %[[NXT]], i8** %ap
+// CHECK-DAG: %[[IND:[^ ]+]] = bitcast i8* %[[CUR]] to %struct.medium**
+// CHECK-DAG: %[[ADR:[^ ]+]] = load %struct.medium** %[[IND]]
+// CHECK: br
+ case 'm':
+ s += *va_arg(ap, struct medium).a;
+ break;
+ }
+ return s;
+}
diff --git a/test/CodeGen/sret.c b/test/CodeGen/sret.c
index ed1f9a44ef14..828bf9b42d61 100644
--- a/test/CodeGen/sret.c
+++ b/test/CodeGen/sret.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | grep sret | count 5
+// RUN: %clang_cc1 %s -emit-llvm -o - | grep sret | count 5
struct abc {
long a;
diff --git a/test/CodeGen/sret2.c b/test/CodeGen/sret2.c
index c96ce4d5c4e0..375746251163 100644
--- a/test/CodeGen/sret2.c
+++ b/test/CodeGen/sret2.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | grep sret | count 2
+// RUN: %clang_cc1 %s -emit-llvm -o - | grep sret | count 2
struct abc {
long a;
diff --git a/test/CodeGen/sse-builtins.c b/test/CodeGen/sse-builtins.c
index 400209fca291..1f5cb8e9e107 100644
--- a/test/CodeGen/sse-builtins.c
+++ b/test/CodeGen/sse-builtins.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -ffreestanding -triple i386-apple-darwin9 -target-cpu pentium4 -target-feature +sse4.1 -g -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -ffreestanding -triple x86_64-apple-macosx10.8.0 -target-feature +sse4.1 -g -emit-llvm %s -o - | FileCheck %s
#include <xmmintrin.h>
#include <emmintrin.h>
@@ -63,7 +63,7 @@ __m128 test_load1_ps(void* y) {
}
void test_store_ss(__m128 x, void* y) {
- // CHECK: define void @test_store_ss
+ // CHECK-LABEL: define void @test_store_ss
// CHECK: store {{.*}} float* {{.*}}, align 1,
_mm_store_ss(y, x);
}
@@ -99,32 +99,32 @@ __m128d test_loadl_pd(__m128d x, void* y) {
}
void test_store_sd(__m128d x, void* y) {
- // CHECK: define void @test_store_sd
+ // CHECK-LABEL: define void @test_store_sd
// CHECK: store {{.*}} double* {{.*}}, align 1{{$}}
_mm_store_sd(y, x);
}
void test_store1_pd(__m128d x, void* y) {
- // CHECK: define void @test_store1_pd
+ // CHECK-LABEL: define void @test_store1_pd
// CHECK: store {{.*}} double* {{.*}}, align 1{{$}}
// CHECK: store {{.*}} double* {{.*}}, align 1{{$}}
_mm_store1_pd(y, x);
}
void test_storer_pd(__m128d x, void* y) {
- // CHECK: define void @test_storer_pd
+ // CHECK-LABEL: define void @test_storer_pd
// CHECK: store {{.*}} <2 x double>* {{.*}}, align 16{{$}}
_mm_storer_pd(y, x);
}
void test_storeh_pd(__m128d x, void* y) {
- // CHECK: define void @test_storeh_pd
+ // CHECK-LABEL: define void @test_storeh_pd
// CHECK: store {{.*}} double* {{.*}}, align 1{{$}}
_mm_storeh_pd(y, x);
}
void test_storel_pd(__m128d x, void* y) {
- // CHECK: define void @test_storel_pd
+ // CHECK-LABEL: define void @test_storel_pd
// CHECK: store {{.*}} double* {{.*}}, align 1{{$}}
_mm_storel_pd(y, x);
}
@@ -184,7 +184,56 @@ __m128d test_mm_round_sd(__m128d x, __m128d y) {
}
void test_storel_epi64(__m128i x, void* y) {
- // CHECK: define void @test_storel_epi64
+ // CHECK-LABEL: define void @test_storel_epi64
// CHECK: store {{.*}} i64* {{.*}}, align 1{{$}}
_mm_storel_epi64(y, x);
}
+
+void test_stream_si32(int x, void *y) {
+ // CHECK-LABEL: define void @test_stream_si32
+ // CHECK: store {{.*}} i32* {{.*}}, align 1, !nontemporal
+ _mm_stream_si32(y, x);
+}
+
+void test_stream_si64(long long x, void *y) {
+ // CHECK-LABEL: define void @test_stream_si64
+ // CHECK: store {{.*}} i64* {{.*}}, align 1, !nontemporal
+ _mm_stream_si64(y, x);
+}
+
+void test_stream_si128(__m128i x, void *y) {
+ // CHECK-LABEL: define void @test_stream_si128
+ // CHECK: store {{.*}} <2 x i64>* {{.*}}, align 16, !nontemporal
+ _mm_stream_si128(y, x);
+}
+
+void test_extract_epi16(__m128i __a) {
+ // CHECK-LABEL: define void @test_extract_epi16
+ // CHECK: [[x:%.*]] = and i32 %{{.*}}, 7
+ // CHECK: extractelement <8 x i16> %{{.*}}, i32 [[x]]
+ _mm_extract_epi16(__a, 8);
+}
+
+int test_extract_ps(__m128i __a) {
+ // CHECK-LABEL: @test_extract_ps
+ // CHECK: extractelement <4 x float> %{{.*}}, i32 0
+ return _mm_extract_ps(__a, 4);
+}
+
+int test_extract_epi8(__m128i __a) {
+ // CHECK-LABEL: @test_extract_epi8
+ // CHECK: extractelement <16 x i8> %{{.*}}, i32 0
+ return _mm_extract_epi8(__a, 16);
+}
+
+int test_extract_epi32(__m128i __a) {
+ // CHECK-LABEL: @test_extract_epi32
+ // CHECK: extractelement <4 x i32> %{{.*}}, i32 0
+ return _mm_extract_epi32(__a, 4);
+}
+
+void test_insert_epi32(__m128i __a, int b) {
+ // CHECK-LABEL: @test_insert_epi32
+ // CHECK: insertelement <4 x i32> %{{.*}}, i32 %{{.*}}, i32 0
+ _mm_insert_epi32(__a, b, 4);
+}
diff --git a/test/CodeGen/statements.c b/test/CodeGen/statements.c
index 5affb9a83513..ad5cb6278134 100644
--- a/test/CodeGen/statements.c
+++ b/test/CodeGen/statements.c
@@ -1,13 +1,6 @@
// RUN: %clang_cc1 -Wno-error=return-type %s -emit-llvm-only
// REQUIRES: LP64
-void test1(int x) {
-switch (x) {
-case 111111111111111111111111111111111111111:
-bar();
-}
-}
-
// Mismatched type between return and function result.
int test2() { return; }
void test3() { return 4; }
diff --git a/test/CodeGen/static-order.c b/test/CodeGen/static-order.c
index e7f9814261cc..58aabbebd57e 100644
--- a/test/CodeGen/static-order.c
+++ b/test/CodeGen/static-order.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
// CHECK: ModuleID
// CHECK-NOT: zeroinitializer
-// CHECK: define i8* @f
+// CHECK-LABEL: define i8* @f
struct s {
int a;
diff --git a/test/CodeGen/stdcall-fastcall.c b/test/CodeGen/stdcall-fastcall.c
index d51817882283..b6217ac1cf3c 100644
--- a/test/CodeGen/stdcall-fastcall.c
+++ b/test/CodeGen/stdcall-fastcall.c
@@ -4,17 +4,17 @@ void __attribute__((fastcall)) f1(void);
void __attribute__((stdcall)) f2(void);
void __attribute__((thiscall)) f3(void);
void __attribute__((fastcall)) f4(void) {
-// CHECK: define x86_fastcallcc void @f4()
+// CHECK-LABEL: define x86_fastcallcc void @f4()
f1();
// CHECK: call x86_fastcallcc void @f1()
}
void __attribute__((stdcall)) f5(void) {
-// CHECK: define x86_stdcallcc void @f5()
+// CHECK-LABEL: define x86_stdcallcc void @f5()
f2();
// CHECK: call x86_stdcallcc void @f2()
}
void __attribute__((thiscall)) f6(void) {
-// CHECK: define x86_thiscallcc void @f6()
+// CHECK-LABEL: define x86_thiscallcc void @f6()
f3();
// CHECK: call x86_thiscallcc void @f3()
}
@@ -51,7 +51,7 @@ void f8(void) {
void __attribute__((fastcall)) foo1(int y);
void bar1(int y) {
- // CHECK: define void @bar1
+ // CHECK-LABEL: define void @bar1
// CHECK: call x86_fastcallcc void @foo1(i32 inreg %
foo1(y);
}
@@ -61,14 +61,14 @@ struct S1 {
};
void __attribute__((fastcall)) foo2(struct S1 y);
void bar2(struct S1 y) {
- // CHECK: define void @bar2
+ // CHECK-LABEL: define void @bar2
// CHECK: call x86_fastcallcc void @foo2(i32 inreg undef, i32 %
foo2(y);
}
void __attribute__((fastcall)) foo3(int *y);
void bar3(int *y) {
- // CHECK: define void @bar3
+ // CHECK-LABEL: define void @bar3
// CHECK: call x86_fastcallcc void @foo3(i32* inreg %
foo3(y);
}
@@ -76,7 +76,7 @@ void bar3(int *y) {
enum Enum {Eval};
void __attribute__((fastcall)) foo4(enum Enum y);
void bar4(enum Enum y) {
- // CHECK: define void @bar4
+ // CHECK-LABEL: define void @bar4
// CHECK: call x86_fastcallcc void @foo4(i32 inreg %
foo4(y);
}
@@ -88,49 +88,49 @@ struct S2 {
};
void __attribute__((fastcall)) foo5(struct S2 y);
void bar5(struct S2 y) {
- // CHECK: define void @bar5
+ // CHECK-LABEL: define void @bar5
// CHECK: call x86_fastcallcc void @foo5(%struct.S2* byval align 4 %
foo5(y);
}
void __attribute__((fastcall)) foo6(long long y);
void bar6(long long y) {
- // CHECK: define void @bar6
+ // CHECK-LABEL: define void @bar6
// CHECK: call x86_fastcallcc void @foo6(i64 %
foo6(y);
}
void __attribute__((fastcall)) foo7(int a, struct S1 b, int c);
void bar7(int a, struct S1 b, int c) {
- // CHECK: define void @bar7
+ // CHECK-LABEL: define void @bar7
// CHECK: call x86_fastcallcc void @foo7(i32 inreg %{{.*}}, i32 %{{.*}}, i32 %{{.*}}
foo7(a, b, c);
}
void __attribute__((fastcall)) foo8(struct S1 a, int b);
void bar8(struct S1 a, int b) {
- // CHECK: define void @bar8
+ // CHECK-LABEL: define void @bar8
// CHECK: call x86_fastcallcc void @foo8(i32 inreg undef, i32 %{{.*}}, i32 inreg %
foo8(a, b);
}
void __attribute__((fastcall)) foo9(struct S2 a, int b);
void bar9(struct S2 a, int b) {
- // CHECK: define void @bar9
+ // CHECK-LABEL: define void @bar9
// CHECK: call x86_fastcallcc void @foo9(%struct.S2* byval align 4 %{{.*}}, i32 %
foo9(a, b);
}
void __attribute__((fastcall)) foo10(float y, int x);
void bar10(float y, int x) {
- // CHECK: define void @bar10
+ // CHECK-LABEL: define void @bar10
// CHECK: call x86_fastcallcc void @foo10(float %{{.*}}, i32 inreg %
foo10(y, x);
}
void __attribute__((fastcall)) foo11(double y, int x);
void bar11(double y, int x) {
- // CHECK: define void @bar11
+ // CHECK-LABEL: define void @bar11
// CHECK: call x86_fastcallcc void @foo11(double %{{.*}}, i32 inreg %
foo11(y, x);
}
@@ -140,7 +140,7 @@ struct S3 {
};
void __attribute__((fastcall)) foo12(struct S3 y, int x);
void bar12(struct S3 y, int x) {
- // CHECK: define void @bar12
+ // CHECK-LABEL: define void @bar12
// CHECK: call x86_fastcallcc void @foo12(float %{{.*}}, i32 inreg %
foo12(y, x);
}
diff --git a/test/CodeGen/string-literal-unicode-conversion.c b/test/CodeGen/string-literal-unicode-conversion.c
index 3e5b7fb04112..23205b80b027 100644
--- a/test/CodeGen/string-literal-unicode-conversion.c
+++ b/test/CodeGen/string-literal-unicode-conversion.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=C %s
-// RUN: %clang_cc1 -x c++ -std=c++0x -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CPP0X %s
-// RUN: %clang_cc1 -x c++ -std=c++0x -fshort-wchar -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=SHORTWCHAR %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-C %s
+// RUN: %clang_cc1 -x c++ -std=c++0x -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-CPP0X %s
+// RUN: %clang_cc1 -x c++ -std=c++0x -fshort-wchar -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-SHORTWCHAR %s
// This file contains a mix of ISO-8859-1 and UTF-8 encoded data.
// the literal assigned to 'aa' should be the ISO-8859-1 encoding for the code
@@ -31,10 +31,11 @@ void f() {
wchar_t const *b = L"Кошка";
// CHECK-C: private unnamed_addr constant [4 x i32] [i32 20320, i32 22909, i32 66304, i32 0], align 4
- // CHECK-SHORTWCHAR: private unnamed_addr constant [4 x i16] [i16 20320, i16 22909, i16 768, i16 0], align 2
// CHECK-CPP0X: private unnamed_addr constant [4 x i32] [i32 20320, i32 22909, i32 66304, i32 0], align 4
+#if __WCHAR_MAX__ == 2147483647
wchar_t const *b2 = L"\x4f60\x597d\x10300";
-
+#endif
+
#if __cplusplus >= 201103L
// CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"1\D0\9A\D0\BE\D1\88\D0\BA\D0\B0\00", align 1
diff --git a/test/CodeGen/struct-init.c b/test/CodeGen/struct-init.c
index 5273138e4e5e..30834acec736 100644
--- a/test/CodeGen/struct-init.c
+++ b/test/CodeGen/struct-init.c
@@ -1,5 +1,5 @@
// REQUIRES: arm-registered-target
-// RUN: %clang_cc1 -S -triple armv7-apple-darwin %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -S -triple armv7-apple-darwin -target-feature +neon %s -emit-llvm -o - | FileCheck %s
typedef struct _zend_ini_entry zend_ini_entry;
struct _zend_ini_entry {
diff --git a/test/CodeGen/struct-matching-constraint.c b/test/CodeGen/struct-matching-constraint.c
index bdd11c8b9000..dfc3014c5d9a 100644
--- a/test/CodeGen/struct-matching-constraint.c
+++ b/test/CodeGen/struct-matching-constraint.c
@@ -1,5 +1,5 @@
// REQUIRES: arm-registered-target
-// RUN: %clang_cc1 -S -emit-llvm -triple armv7a-apple-darwin %s -o /dev/null
+// RUN: %clang_cc1 -S -emit-llvm -triple armv7a-apple-darwin -target-feature +neon %s -o /dev/null
typedef unsigned short uint16_t;
typedef __attribute__((neon_vector_type(8))) uint16_t uint16x8_t;
diff --git a/test/CodeGen/switch-dce.c b/test/CodeGen/switch-dce.c
index a18d3bc89e7d..5a68ff26c6f5 100644
--- a/test/CodeGen/switch-dce.c
+++ b/test/CodeGen/switch-dce.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -O0 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
// PR9322 and rdar://6970405
diff --git a/test/CodeGen/switch.c b/test/CodeGen/switch.c
index 8b94a0976e6e..2417a870f166 100644
--- a/test/CodeGen/switch.c
+++ b/test/CodeGen/switch.c
@@ -63,7 +63,7 @@ static int foo4(int i) {
return j;
}
-// CHECK: define i32 @foo4t()
+// CHECK-LABEL: define i32 @foo4t()
// CHECK: ret i32 376
// CHECK: }
int foo4t() {
@@ -71,7 +71,7 @@ int foo4t() {
return foo4(111) + foo4(99) + foo4(222) + foo4(601);
}
-// CHECK: define void @foo5()
+// CHECK-LABEL: define void @foo5()
// CHECK-NOT: switch
// CHECK: }
void foo5(){
@@ -83,7 +83,7 @@ void foo5(){
}
}
-// CHECK: define void @foo6()
+// CHECK-LABEL: define void @foo6()
// CHECK-NOT: switch
// CHECK: }
void foo6(){
@@ -91,7 +91,7 @@ void foo6(){
}
}
-// CHECK: define void @foo7()
+// CHECK-LABEL: define void @foo7()
// CHECK-NOT: switch
// CHECK: }
void foo7(){
@@ -101,7 +101,7 @@ void foo7(){
}
-// CHECK: define i32 @f8(
+// CHECK-LABEL: define i32 @f8(
// CHECK: ret i32 3
// CHECK: }
int f8(unsigned x) {
@@ -115,7 +115,7 @@ int f8(unsigned x) {
// Ensure that default after a case range is not ignored.
//
-// CHECK: define i32 @f9()
+// CHECK-LABEL: define i32 @f9()
// CHECK: ret i32 10
// CHECK: }
static int f9_0(unsigned x) {
@@ -134,7 +134,7 @@ int f9() {
// miscompilation of fallthrough from default to a (tested) case
// range.
//
-// CHECK: define i32 @f10()
+// CHECK-LABEL: define i32 @f10()
// CHECK: ret i32 10
// CHECK: }
static int f10_0(unsigned x) {
@@ -153,7 +153,7 @@ int f10() {
// This generated incorrect code because of poor switch chaining.
//
-// CHECK: define i32 @f11(
+// CHECK-LABEL: define i32 @f11(
// CHECK: ret i32 3
// CHECK: }
int f11(int x) {
@@ -167,7 +167,7 @@ int f11(int x) {
// This just asserted because of the way case ranges were calculated.
//
-// CHECK: define i32 @f12(
+// CHECK-LABEL: define i32 @f12(
// CHECK: ret i32 3
// CHECK: }
int f12(int x) {
@@ -181,7 +181,7 @@ int f12(int x) {
// Make sure return is not constant (if empty range is skipped or miscompiled)
//
-// CHECK: define i32 @f13(
+// CHECK-LABEL: define i32 @f13(
// CHECK: ret i32 %
// CHECK: }
int f13(unsigned x) {
diff --git a/test/CodeGen/systemz-inline-asm.c b/test/CodeGen/systemz-inline-asm.c
index 8e5854f1bb6c..c9372333b1f2 100644
--- a/test/CodeGen/systemz-inline-asm.c
+++ b/test/CodeGen/systemz-inline-asm.c
@@ -5,31 +5,31 @@ unsigned long gl;
void test_store_m(unsigned int i) {
asm("st %1, %0" : "=m" (gi) : "r" (i));
-// CHECK: define void @test_store_m(i32 zeroext %i)
+// CHECK-LABEL: define void @test_store_m(i32 zeroext %i)
// CHECK: call void asm "st $1, $0", "=*m,r"(i32* @gi, i32 %i)
}
void test_store_Q(unsigned int i) {
asm("st %1, %0" : "=Q" (gi) : "r" (i));
-// CHECK: define void @test_store_Q(i32 zeroext %i)
+// CHECK-LABEL: define void @test_store_Q(i32 zeroext %i)
// CHECK: call void asm "st $1, $0", "=*Q,r"(i32* @gi, i32 %i)
}
void test_store_R(unsigned int i) {
asm("st %1, %0" : "=R" (gi) : "r" (i));
-// CHECK: define void @test_store_R(i32 zeroext %i)
+// CHECK-LABEL: define void @test_store_R(i32 zeroext %i)
// CHECK: call void asm "st $1, $0", "=*R,r"(i32* @gi, i32 %i)
}
void test_store_S(unsigned int i) {
asm("st %1, %0" : "=S" (gi) : "r" (i));
-// CHECK: define void @test_store_S(i32 zeroext %i)
+// CHECK-LABEL: define void @test_store_S(i32 zeroext %i)
// CHECK: call void asm "st $1, $0", "=*S,r"(i32* @gi, i32 %i)
}
void test_store_T(unsigned int i) {
asm("st %1, %0" : "=T" (gi) : "r" (i));
-// CHECK: define void @test_store_T(i32 zeroext %i)
+// CHECK-LABEL: define void @test_store_T(i32 zeroext %i)
// CHECK: call void asm "st $1, $0", "=*T,r"(i32* @gi, i32 %i)
}
@@ -37,7 +37,7 @@ int test_load_m() {
unsigned int i;
asm("l %0, %1" : "=r" (i) : "m" (gi));
return i;
-// CHECK: define signext i32 @test_load_m()
+// CHECK-LABEL: define signext i32 @test_load_m()
// CHECK: call i32 asm "l $0, $1", "=r,*m"(i32* @gi)
}
@@ -45,7 +45,7 @@ int test_load_Q() {
unsigned int i;
asm("l %0, %1" : "=r" (i) : "Q" (gi));
return i;
-// CHECK: define signext i32 @test_load_Q()
+// CHECK-LABEL: define signext i32 @test_load_Q()
// CHECK: call i32 asm "l $0, $1", "=r,*Q"(i32* @gi)
}
@@ -53,7 +53,7 @@ int test_load_R() {
unsigned int i;
asm("l %0, %1" : "=r" (i) : "R" (gi));
return i;
-// CHECK: define signext i32 @test_load_R()
+// CHECK-LABEL: define signext i32 @test_load_R()
// CHECK: call i32 asm "l $0, $1", "=r,*R"(i32* @gi)
}
@@ -61,7 +61,7 @@ int test_load_S() {
unsigned int i;
asm("l %0, %1" : "=r" (i) : "S" (gi));
return i;
-// CHECK: define signext i32 @test_load_S()
+// CHECK-LABEL: define signext i32 @test_load_S()
// CHECK: call i32 asm "l $0, $1", "=r,*S"(i32* @gi)
}
@@ -69,61 +69,61 @@ int test_load_T() {
unsigned int i;
asm("l %0, %1" : "=r" (i) : "T" (gi));
return i;
-// CHECK: define signext i32 @test_load_T()
+// CHECK-LABEL: define signext i32 @test_load_T()
// CHECK: call i32 asm "l $0, $1", "=r,*T"(i32* @gi)
}
void test_mI(unsigned char *c) {
asm volatile("cli %0, %1" :: "Q" (*c), "I" (100));
-// CHECK: define void @test_mI(i8* %c)
+// CHECK-LABEL: define void @test_mI(i8* %c)
// CHECK: call void asm sideeffect "cli $0, $1", "*Q,I"(i8* %c, i32 100)
}
unsigned int test_dJa(unsigned int i, unsigned int j) {
asm("sll %0, %2(%3)" : "=d" (i) : "0" (i), "J" (1000), "a" (j));
return i;
-// CHECK: define zeroext i32 @test_dJa(i32 zeroext %i, i32 zeroext %j)
+// CHECK-LABEL: define zeroext i32 @test_dJa(i32 zeroext %i, i32 zeroext %j)
// CHECK: call i32 asm "sll $0, $2($3)", "=d,0,J,a"(i32 %i, i32 1000, i32 %j)
}
unsigned long test_rK(unsigned long i) {
asm("aghi %0, %2" : "=r" (i) : "0" (i), "K" (-30000));
return i;
-// CHECK: define i64 @test_rK(i64 %i)
+// CHECK-LABEL: define i64 @test_rK(i64 %i)
// CHECK: call i64 asm "aghi $0, $2", "=r,0,K"(i64 %i, i32 -30000)
}
unsigned long test_rL(unsigned long i) {
asm("sllg %0, %1, %2" : "=r" (i) : "r" (i), "L" (500000));
return i;
-// CHECK: define i64 @test_rL(i64 %i)
+// CHECK-LABEL: define i64 @test_rL(i64 %i)
// CHECK: call i64 asm "sllg $0, $1, $2", "=r,r,L"(i64 %i, i32 500000)
}
void test_M() {
asm volatile("#FOO %0" :: "M"(0x7fffffff));
-// CHECK: define void @test_M()
+// CHECK-LABEL: define void @test_M()
// CHECK: call void asm sideeffect "#FOO $0", "M"(i32 2147483647)
}
float test_f32(float f, float g) {
asm("aebr %0, %2" : "=f" (f) : "0" (f), "f" (g));
return f;
-// CHECK: define float @test_f32(float %f, float %g)
+// CHECK-LABEL: define float @test_f32(float %f, float %g)
// CHECK: call float asm "aebr $0, $2", "=f,0,f"(float %f, float %g)
}
double test_f64(double f, double g) {
asm("adbr %0, %2" : "=f" (f) : "0" (f), "f" (g));
return f;
-// CHECK: define double @test_f64(double %f, double %g)
+// CHECK-LABEL: define double @test_f64(double %f, double %g)
// CHECK: call double asm "adbr $0, $2", "=f,0,f"(double %f, double %g)
}
long double test_f128(long double f, long double g) {
asm("axbr %0, %2" : "=f" (f) : "0" (f), "f" (g));
return f;
-// CHECK: define void @test_f128(fp128* noalias nocapture sret [[DEST:%.*]], fp128* byval nocapture, fp128* byval nocapture)
+// CHECK: define void @test_f128(fp128* noalias nocapture sret [[DEST:%.*]], fp128* nocapture readonly, fp128* nocapture readonly)
// CHECK: %f = load fp128* %0
// CHECK: %g = load fp128* %1
// CHECK: [[RESULT:%.*]] = tail call fp128 asm "axbr $0, $2", "=f,0,f"(fp128 %f, fp128 %g)
diff --git a/test/CodeGen/tbaa-class.cpp b/test/CodeGen/tbaa-class.cpp
index 967ba19a04da..bdd155d450a9 100644
--- a/test/CodeGen/tbaa-class.cpp
+++ b/test/CodeGen/tbaa-class.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -struct-path-tbaa -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s -check-prefix=PATH
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -no-struct-path-tbaa -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s -check-prefix=PATH
// Test TBAA metadata generated by front-end.
typedef unsigned char uint8_t;
@@ -52,8 +52,8 @@ public:
uint32_t g(uint32_t *s, StructA *A, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32:!.*]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32:!.*]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32:!.*]]
@@ -64,8 +64,8 @@ uint32_t g(uint32_t *s, StructA *A, uint64_t count) {
uint32_t g2(uint32_t *s, StructA *A, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_i16:!.*]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_A_f16:!.*]]
@@ -76,8 +76,8 @@ uint32_t g2(uint32_t *s, StructA *A, uint64_t count) {
uint32_t g3(StructA *A, StructB *B, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32:!.*]]
@@ -88,8 +88,8 @@ uint32_t g3(StructA *A, StructB *B, uint64_t count) {
uint32_t g4(StructA *A, StructB *B, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_i16]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_B_a_f16:!.*]]
@@ -100,8 +100,8 @@ uint32_t g4(StructA *A, StructB *B, uint64_t count) {
uint32_t g5(StructA *A, StructB *B, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_f32:!.*]]
@@ -112,8 +112,8 @@ uint32_t g5(StructA *A, StructB *B, uint64_t count) {
uint32_t g6(StructA *A, StructB *B, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32_2:!.*]]
@@ -124,8 +124,8 @@ uint32_t g6(StructA *A, StructB *B, uint64_t count) {
uint32_t g7(StructA *A, StructS *S, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32:!.*]]
@@ -136,8 +136,8 @@ uint32_t g7(StructA *A, StructS *S, uint64_t count) {
uint32_t g8(StructA *A, StructS *S, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_i16]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_S_f16:!.*]]
@@ -148,8 +148,8 @@ uint32_t g8(StructA *A, StructS *S, uint64_t count) {
uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32:!.*]]
@@ -160,8 +160,8 @@ uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) {
uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S2_f32_2:!.*]]
@@ -172,8 +172,8 @@ uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) {
uint32_t g11(StructC *C, StructD *D, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_C_b_a_f32:!.*]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_D_b_a_f32:!.*]]
@@ -184,8 +184,8 @@ uint32_t g11(StructC *C, StructD *D, uint64_t count) {
uint32_t g12(StructC *C, StructD *D, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// TODO: differentiate the two accesses.
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32]]
@@ -198,12 +198,14 @@ uint32_t g12(StructC *C, StructD *D, uint64_t count) {
return b1->a.f32;
}
-// CHECK: !1 = metadata !{metadata !"omnipotent char", metadata !2}
-// CHECK: !2 = metadata !{metadata !"Simple C/C++ TBAA"}
-// CHECK: !4 = metadata !{metadata !"int", metadata !1}
-// CHECK: !5 = metadata !{metadata !"short", metadata !1}
+// CHECK: [[TYPE_char:!.*]] = metadata !{metadata !"omnipotent char", metadata [[TAG_cxx_tbaa:!.*]],
+// CHECK: [[TAG_cxx_tbaa]] = metadata !{metadata !"Simple C/C++ TBAA"}
+// CHECK: [[TAG_i32]] = metadata !{metadata [[TYPE_i32:!.*]], metadata [[TYPE_i32]], i64 0}
+// CHECK: [[TYPE_i32]] = metadata !{metadata !"int", metadata [[TYPE_char]],
+// CHECK: [[TAG_i16]] = metadata !{metadata [[TYPE_i16:!.*]], metadata [[TYPE_i16]], i64 0}
+// CHECK: [[TYPE_i16]] = metadata !{metadata !"short", metadata [[TYPE_char]],
-// PATH: [[TYPE_CHAR:!.*]] = metadata !{metadata !"omnipotent char", metadata !3
+// PATH: [[TYPE_CHAR:!.*]] = metadata !{metadata !"omnipotent char", metadata
// PATH: [[TAG_i32]] = metadata !{metadata [[TYPE_INT:!.*]], metadata [[TYPE_INT]], i64 0}
// PATH: [[TYPE_INT]] = metadata !{metadata !"int", metadata [[TYPE_CHAR]]
// PATH: [[TAG_A_f32]] = metadata !{metadata [[TYPE_A:!.*]], metadata [[TYPE_INT]], i64 4}
diff --git a/test/CodeGen/tbaa-for-vptr.cpp b/test/CodeGen/tbaa-for-vptr.cpp
index 93690361906b..7ba058bffe66 100644
--- a/test/CodeGen/tbaa-for-vptr.cpp
+++ b/test/CodeGen/tbaa-for-vptr.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -emit-llvm -o - -O0 -fsanitize=thread %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -o - -fsanitize=thread %s | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -o - -O1 %s | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -o - -O1 -relaxed-aliasing -fsanitize=thread %s | FileCheck %s
//
-// RUN: %clang_cc1 -emit-llvm -o - -O0 %s | FileCheck %s --check-prefix=NOTBAA
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s --check-prefix=NOTBAA
// RUN: %clang_cc1 -emit-llvm -o - -O2 -relaxed-aliasing %s | FileCheck %s --check-prefix=NOTBAA
//
// Check that we generate TBAA for vtable pointer loads and stores.
@@ -23,5 +23,6 @@ void CallFoo(A *a) {
// CHECK: %{{.*}} = load {{.*}} !tbaa ![[NUM:[0-9]+]]
// CHECK: store {{.*}} !tbaa ![[NUM]]
-// CHECK: [[NUM]] = metadata !{metadata !"vtable pointer", metadata !{{.*}}}
+// CHECK: [[NUM]] = metadata !{metadata [[TYPE:!.*]], metadata [[TYPE]], i64 0}
+// CHECK: [[TYPE]] = metadata !{metadata !"vtable pointer", metadata !{{.*}}
// NOTBAA-NOT: = metadata !{metadata !"Simple C/C++ TBAA"}
diff --git a/test/CodeGen/tbaa-ms-abi.cpp b/test/CodeGen/tbaa-ms-abi.cpp
new file mode 100644
index 000000000000..67390b1a8a54
--- /dev/null
+++ b/test/CodeGen/tbaa-ms-abi.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -cxx-abi microsoft -triple i686-pc-win32 -disable-llvm-optzns -emit-llvm -o - -O1 %s | FileCheck %s
+//
+// Test that TBAA works in the Microsoft C++ ABI. We used to error out while
+// attempting to mangle RTTI.
+
+struct StructA {
+ int a;
+};
+
+struct StructB : virtual StructA {
+ StructB();
+};
+
+StructB::StructB() {
+ a = 42;
+// CHECK: store i32 42, i32* {{.*}}, !tbaa [[TAG_A_i32:!.*]]
+}
+
+// CHECK: [[TYPE_CHAR:!.*]] = metadata !{metadata !"omnipotent char", metadata
+// CHECK: [[TYPE_INT:!.*]] = metadata !{metadata !"int", metadata [[TYPE_CHAR]], i64 0}
+// CHECK: [[TAG_A_i32]] = metadata !{metadata [[TYPE_A:!.*]], metadata [[TYPE_INT]], i64 0}
+// CHECK: [[TYPE_A]] = metadata !{metadata !"?AUStructA@@", metadata [[TYPE_INT]], i64 0}
diff --git a/test/CodeGen/tbaa-struct.cpp b/test/CodeGen/tbaa-struct.cpp
index 6d593a3c1b24..f8bd1245ceef 100644
--- a/test/CodeGen/tbaa-struct.cpp
+++ b/test/CodeGen/tbaa-struct.cpp
@@ -65,10 +65,12 @@ void copy5(struct six *a, struct six *b) {
// CHECK: [[TS]] = metadata !{i64 0, i64 2, metadata !{{.*}}, i64 4, i64 4, metadata !{{.*}}, i64 8, i64 1, metadata !{{.*}}, i64 12, i64 4, metadata !{{.*}}}
// CHECK: [[CHAR:!.*]] = metadata !{metadata !"omnipotent char", metadata !{{.*}}}
-// CHECK: [[INT:!.*]] = metadata !{metadata !"int", metadata [[CHAR]]}
+// CHECK: [[TAG_INT:!.*]] = metadata !{metadata [[INT:!.*]], metadata [[INT]], i64 0}
+// CHECK: [[INT]] = metadata !{metadata !"int", metadata [[CHAR]]
+// CHECK: [[TAG_CHAR:!.*]] = metadata !{metadata [[CHAR]], metadata [[CHAR]], i64 0}
// (offset, size) = (0,1) char; (4,2) short; (8,4) int; (12,1) char; (16,4) int; (20,4) int
// CHECK: [[TS2]] = metadata !{i64 0, i64 1, metadata !{{.*}}, i64 4, i64 2, metadata !{{.*}}, i64 8, i64 4, metadata !{{.*}}, i64 12, i64 1, metadata !{{.*}}, i64 16, i64 4, metadata {{.*}}, i64 20, i64 4, metadata {{.*}}}
// (offset, size) = (0,8) char; (0,2) char; (4,8) char
// CHECK: [[TS3]] = metadata !{i64 0, i64 8, metadata !{{.*}}, i64 0, i64 2, metadata !{{.*}}, i64 4, i64 8, metadata !{{.*}}}
-// CHECK: [[TS4]] = metadata !{i64 0, i64 1, metadata [[CHAR]], i64 1, i64 1, metadata [[CHAR]], i64 2, i64 1, metadata [[CHAR]]}
-// CHECK: [[TS5]] = metadata !{i64 0, i64 1, metadata [[CHAR]], i64 4, i64 4, metadata [[INT]], i64 4, i64 1, metadata [[CHAR]], i64 5, i64 1, metadata [[CHAR]]}
+// CHECK: [[TS4]] = metadata !{i64 0, i64 1, metadata [[TAG_CHAR]], i64 1, i64 4, metadata [[TAG_INT]], i64 1, i64 1, metadata [[TAG_CHAR]], i64 2, i64 1, metadata [[TAG_CHAR]]}
+// CHECK: [[TS5]] = metadata !{i64 0, i64 1, metadata [[TAG_CHAR]], i64 4, i64 4, metadata [[TAG_INT]], i64 4, i64 1, metadata [[TAG_CHAR]], i64 5, i64 1, metadata [[TAG_CHAR]]}
diff --git a/test/CodeGen/tbaa-thread-sanitizer.cpp b/test/CodeGen/tbaa-thread-sanitizer.cpp
new file mode 100644
index 000000000000..abffae3a8fab
--- /dev/null
+++ b/test/CodeGen/tbaa-thread-sanitizer.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s -fsanitize=thread -relaxed-aliasing -O1 | FileCheck %s
+
+// Make sure we do not crash when relaxed-aliasing is on.
+// CHECK-NOT: !tbaa
+struct iterator { void *node; };
+
+struct pair {
+ iterator first;
+ pair(const iterator &a) : first(a) {}
+};
+
+void equal_range() {
+ (void)pair(iterator());
+}
diff --git a/test/CodeGen/tbaa.cpp b/test/CodeGen/tbaa.cpp
index afb8893d3e6a..92d31e5ae293 100644
--- a/test/CodeGen/tbaa.cpp
+++ b/test/CodeGen/tbaa.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -struct-path-tbaa -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s -check-prefix=PATH
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -no-struct-path-tbaa -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s -check-prefix=PATH
// Test TBAA metadata generated by front-end.
typedef unsigned char uint8_t;
@@ -46,8 +46,8 @@ typedef struct
uint32_t g(uint32_t *s, StructA *A, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32:!.*]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32:!.*]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32:!.*]]
@@ -58,8 +58,8 @@ uint32_t g(uint32_t *s, StructA *A, uint64_t count) {
uint32_t g2(uint32_t *s, StructA *A, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_i16:!.*]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_A_f16:!.*]]
@@ -70,8 +70,8 @@ uint32_t g2(uint32_t *s, StructA *A, uint64_t count) {
uint32_t g3(StructA *A, StructB *B, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32:!.*]]
@@ -82,8 +82,8 @@ uint32_t g3(StructA *A, StructB *B, uint64_t count) {
uint32_t g4(StructA *A, StructB *B, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_i16]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_B_a_f16:!.*]]
@@ -94,8 +94,8 @@ uint32_t g4(StructA *A, StructB *B, uint64_t count) {
uint32_t g5(StructA *A, StructB *B, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_f32:!.*]]
@@ -106,8 +106,8 @@ uint32_t g5(StructA *A, StructB *B, uint64_t count) {
uint32_t g6(StructA *A, StructB *B, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32_2:!.*]]
@@ -118,8 +118,8 @@ uint32_t g6(StructA *A, StructB *B, uint64_t count) {
uint32_t g7(StructA *A, StructS *S, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32:!.*]]
@@ -130,8 +130,8 @@ uint32_t g7(StructA *A, StructS *S, uint64_t count) {
uint32_t g8(StructA *A, StructS *S, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_i16]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_S_f16:!.*]]
@@ -142,8 +142,8 @@ uint32_t g8(StructA *A, StructS *S, uint64_t count) {
uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S2_f32:!.*]]
@@ -154,8 +154,8 @@ uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) {
uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_i16]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa [[TAG_S2_f16:!.*]]
@@ -166,8 +166,8 @@ uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) {
uint32_t g11(StructC *C, StructD *D, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_C_b_a_f32:!.*]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_D_b_a_f32:!.*]]
@@ -178,8 +178,8 @@ uint32_t g11(StructC *C, StructD *D, uint64_t count) {
uint32_t g12(StructC *C, StructD *D, uint64_t count) {
// CHECK: define i32 @{{.*}}(
-// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
-// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// TODO: differentiate the two accesses.
// PATH: define i32 @{{.*}}(
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32]]
@@ -203,7 +203,7 @@ struct five {
char g13(struct five *a, struct five *b) {
return a->b;
// CHECK: define signext i8 @{{.*}}(
-// CHECK: load i8* %{{.*}}, align 1, !tbaa !1
+// CHECK: load i8* %{{.*}}, align 1, !tbaa [[TAG_char:!.*]]
// PATH: define signext i8 @{{.*}}(
// PATH: load i8* %{{.*}}, align 1, !tbaa [[TAG_five_b:!.*]]
}
@@ -216,18 +216,35 @@ struct six {
};
char g14(struct six *a, struct six *b) {
// CHECK: define signext i8 @{{.*}}(
-// CHECK: load i8* %{{.*}}, align 1, !tbaa !1
+// CHECK: load i8* %{{.*}}, align 1, !tbaa [[TAG_char]]
// PATH: define signext i8 @{{.*}}(
// PATH: load i8* %{{.*}}, align 1, !tbaa [[TAG_six_b:!.*]]
return a->b;
}
-// CHECK: !1 = metadata !{metadata !"omnipotent char", metadata !2}
-// CHECK: !2 = metadata !{metadata !"Simple C/C++ TBAA"}
-// CHECK: !4 = metadata !{metadata !"int", metadata !1}
-// CHECK: !5 = metadata !{metadata !"short", metadata !1}
+// Types that differ only by name may alias.
+typedef StructS StructS3;
+uint32_t g15(StructS *S, StructS3 *S3, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
+ S->f32 = 1;
+ S3->f32 = 4;
+ return S->f32;
+}
+
+// CHECK: [[TYPE_char:!.*]] = metadata !{metadata !"omnipotent char", metadata [[TAG_cxx_tbaa:!.*]],
+// CHECK: [[TAG_cxx_tbaa]] = metadata !{metadata !"Simple C/C++ TBAA"}
+// CHECK: [[TAG_i32]] = metadata !{metadata [[TYPE_i32:!.*]], metadata [[TYPE_i32]], i64 0}
+// CHECK: [[TYPE_i32]] = metadata !{metadata !"int", metadata [[TYPE_char]],
+// CHECK: [[TAG_i16]] = metadata !{metadata [[TYPE_i16:!.*]], metadata [[TYPE_i16]], i64 0}
+// CHECK: [[TYPE_i16]] = metadata !{metadata !"short", metadata [[TYPE_char]],
+// CHECK: [[TAG_char]] = metadata !{metadata [[TYPE_char]], metadata [[TYPE_char]], i64 0}
-// PATH: [[TYPE_CHAR:!.*]] = metadata !{metadata !"omnipotent char", metadata !3
+// PATH: [[TYPE_CHAR:!.*]] = metadata !{metadata !"omnipotent char", metadata
// PATH: [[TAG_i32]] = metadata !{metadata [[TYPE_INT:!.*]], metadata [[TYPE_INT]], i64 0}
// PATH: [[TYPE_INT]] = metadata !{metadata !"int", metadata [[TYPE_CHAR]]
// PATH: [[TAG_A_f32]] = metadata !{metadata [[TYPE_A:!.*]], metadata [[TYPE_INT]], i64 4}
@@ -250,6 +267,6 @@ char g14(struct six *a, struct six *b) {
// PATH: [[TAG_D_b_a_f32]] = metadata !{metadata [[TYPE_D:!.*]], metadata [[TYPE_INT]], i64 12}
// PATH: [[TYPE_D]] = metadata !{metadata !"_ZTS7StructD", metadata [[TYPE_SHORT]], i64 0, metadata [[TYPE_B]], i64 4, metadata [[TYPE_INT]], i64 28, metadata [[TYPE_CHAR]], i64 32}
// PATH: [[TAG_five_b]] = metadata !{metadata [[TYPE_five:!.*]], metadata [[TYPE_CHAR]], i64 1}
-// PATH: [[TYPE_five]] = metadata !{metadata !"_ZTS4five", metadata [[TYPE_CHAR]], i64 0, metadata [[TYPE_CHAR]], i64 1, metadata [[TYPE_CHAR]], i64 2}
+// PATH: [[TYPE_five]] = metadata !{metadata !"_ZTS4five", metadata [[TYPE_CHAR]], i64 0, metadata [[TYPE_INT]], i64 1, metadata [[TYPE_CHAR]], i64 1, metadata [[TYPE_CHAR]], i64 2}
// PATH: [[TAG_six_b]] = metadata !{metadata [[TYPE_six:!.*]], metadata [[TYPE_CHAR]], i64 4}
// PATH: [[TYPE_six]] = metadata !{metadata !"_ZTS3six", metadata [[TYPE_CHAR]], i64 0, metadata [[TYPE_INT]], i64 4, metadata [[TYPE_CHAR]], i64 4, metadata [[TYPE_CHAR]], i64 5}
diff --git a/test/CodeGen/tbm-builtins.c b/test/CodeGen/tbm-builtins.c
new file mode 100644
index 000000000000..e3a702161ecc
--- /dev/null
+++ b/test/CodeGen/tbm-builtins.c
@@ -0,0 +1,137 @@
+// RUN: %clang_cc1 %s -O3 -triple=x86_64-unknown-unknown -target-feature +tbm -emit-llvm -o - | FileCheck %s
+
+// Don't include mm_malloc.h, it's system specific.
+#define __MM_MALLOC_H
+
+#include <x86intrin.h>
+
+unsigned int test__bextri_u32(unsigned int a) {
+ // CHECK: call i32 @llvm.x86.tbm.bextri.u32
+ return __bextri_u32(a, 1);
+}
+
+unsigned long long test__bextri_u64(unsigned long long a) {
+ // CHECK: call i64 @llvm.x86.tbm.bextri.u64
+ return __bextri_u64(a, 2);
+}
+
+unsigned long long test__bextri_u64_bigint(unsigned long long a) {
+ // CHECK: call i64 @llvm.x86.tbm.bextri.u64
+ return __bextri_u64(a, 0x7fffffffffLL);
+}
+
+unsigned int test__blcfill_u32(unsigned int a) {
+ // CHECK: [[TMP:%.*]] = add i32 [[SRC:%.*]], 1
+ // CHECK-NEXT: %{{.*}} = and i32 [[TMP]], [[SRC]]
+ return __blcfill_u32(a);
+}
+
+unsigned long long test__blcfill_u64(unsigned long long a) {
+ // CHECK: [[TMPT:%.*]] = add i64 [[SRC:%.*]], 1
+ // CHECK-NEXT: %{{.*}} = and i64 [[TMP]], [[SRC]]
+ return __blcfill_u64(a);
+}
+
+unsigned int test__blci_u32(unsigned int a) {
+ // CHECK: [[TMP:%.*]] = sub i32 -2, [[SRC:%.*]]
+ // CHECK-NEXT: %{{.*}} = or i32 [[TMP]], [[SRC]]
+ return __blci_u32(a);
+}
+
+unsigned long long test__blci_u64(unsigned long long a) {
+ // CHECK: [[TMP:%.*]] = sub i64 -2, [[SRC:%.*]]
+ // CHECK-NEXT: %{{.*}} = or i64 [[TMP]], [[SRC]]
+ return __blci_u64(a);
+}
+
+unsigned int test__blcic_u32(unsigned int a) {
+ // CHECK: [[TMP1:%.*]] = xor i32 [[SRC:%.*]], -1
+ // CHECK-NEXT: [[TMP2:%.*]] = add i32 [[SRC]], 1
+ // CHECK-NEXT: {{.*}} = and i32 [[TMP2]], [[TMP1]]
+ return __blcic_u32(a);
+}
+
+unsigned long long test__blcic_u64(unsigned long long a) {
+ // CHECK: [[TMP1:%.*]] = xor i64 [[SRC:%.*]], -1
+ // CHECK-NEXT: [[TMP2:%.*]] = add i64 [[SRC]], 1
+ // CHECK-NEXT: {{.*}} = and i64 [[TMP2]], [[TMP1]]
+ return __blcic_u64(a);
+}
+
+unsigned int test__blcmsk_u32(unsigned int a) {
+ // CHECK: [[TMP:%.*]] = add i32 [[SRC:%.*]], 1
+ // CHECK-NEXT: {{.*}} = xor i32 [[TMP]], [[SRC]]
+ return __blcmsk_u32(a);
+}
+
+unsigned long long test__blcmsk_u64(unsigned long long a) {
+ // CHECK: [[TMP:%.*]] = add i64 [[SRC:%.*]], 1
+ // CHECK-NEXT: {{.*}} = xor i64 [[TMP]], [[SRC]]
+ return __blcmsk_u64(a);
+}
+
+unsigned int test__blcs_u32(unsigned int a) {
+ // CHECK: [[TMP:%.*]] = add i32 [[SRC:%.*]], 1
+ // CHECK-NEXT: {{.*}} = or i32 [[TMP]], [[SRC]]
+ return __blcs_u32(a);
+}
+
+unsigned long long test__blcs_u64(unsigned long long a) {
+ // CHECK: [[TMP:%.*]] = add i64 [[SRC:%.*]], 1
+ // CHECK-NEXT: {{.*}} = or i64 [[TMP]], [[SRC]]
+ return __blcs_u64(a);
+}
+
+unsigned int test__blsfill_u32(unsigned int a) {
+ // CHECK: [[TMP:%.*]] = add i32 [[SRC:%.*]], -1
+ // CHECK-NEXT: {{.*}} = or i32 [[TMP]], [[SRC]]
+ return __blsfill_u32(a);
+}
+
+unsigned long long test__blsfill_u64(unsigned long long a) {
+ // CHECK: [[TMP:%.*]] = add i64 [[SRC:%.*]], -1
+ // CHECK-NEXT: {{.*}} = or i64 [[TMP]], [[SRC]]
+ return __blsfill_u64(a);
+}
+
+unsigned int test__blsic_u32(unsigned int a) {
+ // CHECK: [[TMP1:%.*]] = xor i32 [[SRC:%.*]], -1
+ // CHECK-NEXT: [[TMP2:%.*]] = add i32 [[SRC:%.*]], -1
+ // CHECK-NEXT: {{.*}} = or i32 [[TMP2]], [[TMP1]]
+ return __blsic_u32(a);
+}
+
+unsigned long long test__blsic_u64(unsigned long long a) {
+ // CHECK: [[TMP1:%.*]] = xor i64 [[SRC:%.*]], -1
+ // CHECK-NEXT: [[TMP2:%.*]] = add i64 [[SRC:%.*]], -1
+ // CHECK-NEXT: {{.*}} = or i64 [[TMP2]], [[TMP1]]
+ return __blsic_u64(a);
+}
+
+unsigned int test__t1mskc_u32(unsigned int a) {
+ // CHECK: [[TMP1:%.*]] = xor i32 [[SRC:%.*]], -1
+ // CHECK-NEXT: [[TMP2:%.*]] = add i32 [[SRC:%.*]], 1
+ // CHECK-NEXT: {{.*}} = or i32 [[TMP2]], [[TMP1]]
+ return __t1mskc_u32(a);
+}
+
+unsigned long long test__t1mskc_u64(unsigned long long a) {
+ // CHECK: [[TMP1:%.*]] = xor i64 [[SRC:%.*]], -1
+ // CHECK-NEXT: [[TMP2:%.*]] = add i64 [[SRC:%.*]], 1
+ // CHECK-NEXT: {{.*}} = or i64 [[TMP2]], [[TMP1]]
+ return __t1mskc_u64(a);
+}
+
+unsigned int test__tzmsk_u32(unsigned int a) {
+ // CHECK: [[TMP1:%.*]] = xor i32 [[SRC:%.*]], -1
+ // CHECK-NEXT: [[TMP2:%.*]] = add i32 [[SRC:%.*]], -1
+ // CHECK-NEXT: {{.*}} = and i32 [[TMP2]], [[TMP1]]
+ return __tzmsk_u32(a);
+}
+
+unsigned long long test__tzmsk_u64(unsigned long long a) {
+ // CHECK: [[TMP1:%.*]] = xor i64 [[SRC:%.*]], -1
+ // CHECK-NEXT: [[TMP2:%.*]] = add i64 [[SRC:%.*]], -1
+ // CHECK-NEXT: {{.*}} = and i64 [[TMP2]], [[TMP1]]
+ return __tzmsk_u64(a);
+}
diff --git a/test/CodeGen/transparent-union.c b/test/CodeGen/transparent-union.c
index afdb3d6090b0..21040e4da05b 100644
--- a/test/CodeGen/transparent-union.c
+++ b/test/CodeGen/transparent-union.c
@@ -10,7 +10,7 @@ typedef union {
void f0(transp_t0 obj);
-// CHECK: define void @f1_0(i32* %a0)
+// CHECK-LABEL: define void @f1_0(i32* %a0)
// CHECK: call void @f0(%union.transp_t0* byval align 4 %{{.*}})
// CHECK: call void %{{.*}}(i8* %{{[a-z0-9]*}})
// CHECK: }
diff --git a/test/CodeGen/trapv.c b/test/CodeGen/trapv.c
index bc8bc700636c..51034108ee43 100644
--- a/test/CodeGen/trapv.c
+++ b/test/CodeGen/trapv.c
@@ -3,7 +3,7 @@
unsigned int ui, uj, uk;
int i, j, k;
-// CHECK: define void @test0()
+// CHECK-LABEL: define void @test0()
void test0() {
// -ftrapv doesn't affect unsigned arithmetic.
// CHECK: [[T1:%.*]] = load i32* @uj
@@ -23,7 +23,7 @@ void test0() {
i = j + k;
}
-// CHECK: define void @test1()
+// CHECK-LABEL: define void @test1()
void test1() {
extern void opaque(int);
opaque(i++);
@@ -37,7 +37,7 @@ void test1() {
// CHECK: call void @llvm.trap()
}
-// CHECK: define void @test2()
+// CHECK-LABEL: define void @test2()
void test2() {
extern void opaque(int);
opaque(++i);
@@ -51,7 +51,7 @@ void test2() {
// CHECK: call void @llvm.trap()
}
-// CHECK: define void @test3(
+// CHECK-LABEL: define void @test3(
void test3(int a, int b, float c, float d) {
// CHECK-NOT: @llvm.trap
(void)(a / b);
diff --git a/test/CodeGen/unsigned-overflow.c b/test/CodeGen/unsigned-overflow.c
index 341ea355636b..01ed0bf8cb5e 100644
--- a/test/CodeGen/unsigned-overflow.c
+++ b/test/CodeGen/unsigned-overflow.c
@@ -8,7 +8,7 @@ unsigned int ii, ij, ik;
extern void opaquelong(unsigned long);
extern void opaqueint(unsigned int);
-// CHECK: define void @testlongadd()
+// CHECK-LABEL: define void @testlongadd()
void testlongadd() {
// CHECK: [[T1:%.*]] = load i64* @lj
@@ -20,7 +20,7 @@ void testlongadd() {
li = lj + lk;
}
-// CHECK: define void @testlongsub()
+// CHECK-LABEL: define void @testlongsub()
void testlongsub() {
// CHECK: [[T1:%.*]] = load i64* @lj
@@ -32,7 +32,7 @@ void testlongsub() {
li = lj - lk;
}
-// CHECK: define void @testlongmul()
+// CHECK-LABEL: define void @testlongmul()
void testlongmul() {
// CHECK: [[T1:%.*]] = load i64* @lj
@@ -44,7 +44,7 @@ void testlongmul() {
li = lj * lk;
}
-// CHECK: define void @testlongpostinc()
+// CHECK-LABEL: define void @testlongpostinc()
void testlongpostinc() {
opaquelong(li++);
@@ -55,7 +55,7 @@ void testlongpostinc() {
// CHECK: call void @__ubsan_handle_add_overflow
}
-// CHECK: define void @testlongpreinc()
+// CHECK-LABEL: define void @testlongpreinc()
void testlongpreinc() {
opaquelong(++li);
@@ -66,7 +66,7 @@ void testlongpreinc() {
// CHECK: call void @__ubsan_handle_add_overflow
}
-// CHECK: define void @testintadd()
+// CHECK-LABEL: define void @testintadd()
void testintadd() {
// CHECK: [[T1:%.*]] = load i32* @ij
@@ -78,7 +78,7 @@ void testintadd() {
ii = ij + ik;
}
-// CHECK: define void @testintsub()
+// CHECK-LABEL: define void @testintsub()
void testintsub() {
// CHECK: [[T1:%.*]] = load i32* @ij
@@ -90,7 +90,7 @@ void testintsub() {
ii = ij - ik;
}
-// CHECK: define void @testintmul()
+// CHECK-LABEL: define void @testintmul()
void testintmul() {
// CHECK: [[T1:%.*]] = load i32* @ij
@@ -102,7 +102,7 @@ void testintmul() {
ii = ij * ik;
}
-// CHECK: define void @testintpostinc()
+// CHECK-LABEL: define void @testintpostinc()
void testintpostinc() {
opaqueint(ii++);
@@ -113,7 +113,7 @@ void testintpostinc() {
// CHECK: call void @__ubsan_handle_add_overflow
}
-// CHECK: define void @testintpreinc()
+// CHECK-LABEL: define void @testintpreinc()
void testintpreinc() {
opaqueint(++ii);
diff --git a/test/CodeGen/unsigned-promotion.c b/test/CodeGen/unsigned-promotion.c
index c263c0c946b0..2c3415201ce7 100644
--- a/test/CodeGen/unsigned-promotion.c
+++ b/test/CodeGen/unsigned-promotion.c
@@ -12,8 +12,8 @@ unsigned char ci, cj, ck;
extern void opaqueshort(unsigned short);
extern void opaquechar(unsigned char);
-// CHECKS: define void @testshortadd()
-// CHECKU: define void @testshortadd()
+// CHECKS-LABEL: define void @testshortadd()
+// CHECKU-LABEL: define void @testshortadd()
void testshortadd() {
// CHECKS: load i16* @sj
// CHECKS: load i16* @sk
@@ -33,8 +33,8 @@ void testshortadd() {
si = sj + sk;
}
-// CHECKS: define void @testshortsub()
-// CHECKU: define void @testshortsub()
+// CHECKS-LABEL: define void @testshortsub()
+// CHECKU-LABEL: define void @testshortsub()
void testshortsub() {
// CHECKS: load i16* @sj
@@ -55,8 +55,8 @@ void testshortsub() {
si = sj - sk;
}
-// CHECKS: define void @testshortmul()
-// CHECKU: define void @testshortmul()
+// CHECKS-LABEL: define void @testshortmul()
+// CHECKU-LABEL: define void @testshortmul()
void testshortmul() {
// CHECKS: load i16* @sj
@@ -76,8 +76,8 @@ void testshortmul() {
si = sj * sk;
}
-// CHECKS: define void @testcharadd()
-// CHECKU: define void @testcharadd()
+// CHECKS-LABEL: define void @testcharadd()
+// CHECKU-LABEL: define void @testcharadd()
void testcharadd() {
// CHECKS: load i8* @cj
@@ -98,8 +98,8 @@ void testcharadd() {
ci = cj + ck;
}
-// CHECKS: define void @testcharsub()
-// CHECKU: define void @testcharsub()
+// CHECKS-LABEL: define void @testcharsub()
+// CHECKU-LABEL: define void @testcharsub()
void testcharsub() {
// CHECKS: load i8* @cj
@@ -120,8 +120,8 @@ void testcharsub() {
ci = cj - ck;
}
-// CHECKS: define void @testcharmul()
-// CHECKU: define void @testcharmul()
+// CHECKS-LABEL: define void @testcharmul()
+// CHECKU-LABEL: define void @testcharmul()
void testcharmul() {
// CHECKS: load i8* @cj
diff --git a/test/CodeGen/unwind-attr.c b/test/CodeGen/unwind-attr.c
index e505a6e9e277..527237578ee4 100644
--- a/test/CodeGen/unwind-attr.c
+++ b/test/CodeGen/unwind-attr.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown -fexceptions -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix NOEXC %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix CHECK-NOEXC %s
int opaque();
diff --git a/test/CodeGen/vector.c b/test/CodeGen/vector.c
index 3fa5f1441d2f..6c14b7fa79eb 100644
--- a/test/CodeGen/vector.c
+++ b/test/CodeGen/vector.c
@@ -55,3 +55,10 @@ unsigned long test_epi16(__m128i x) { return _mm_extract_epi16(x, 3); }
// CHECK: @test_epi16
// CHECK: extractelement <8 x i16> {{.*}}, i32 3
// CHECK: zext i16 {{.*}} to i32
+
+void extractinttypes() {
+ extern int check_extract_result_int;
+ extern __typeof(_mm_extract_epi8(_mm_setzero_si128(), 3)) check_result_int;
+ extern __typeof(_mm_extract_epi16(_mm_setzero_si128(), 3)) check_result_int;
+ extern __typeof(_mm_extract_epi32(_mm_setzero_si128(), 3)) check_result_int;
+}
diff --git a/test/CodeGen/visibility.c b/test/CodeGen/visibility.c
index 3082b7b6ea6f..8e153b893a3f 100644
--- a/test/CodeGen/visibility.c
+++ b/test/CodeGen/visibility.c
@@ -23,15 +23,15 @@ static char g_deferred[] = "hello";
// CHECK-PROTECTED: @test4 = hidden global i32 10
// CHECK-HIDDEN: @test4 = hidden global i32 10
-// CHECK-DEFAULT: define i32 @f_def()
+// CHECK-DEFAULT-LABEL: define i32 @f_def()
// CHECK-DEFAULT: declare void @f_ext()
-// CHECK-DEFAULT: define internal void @f_deferred()
-// CHECK-PROTECTED: define protected i32 @f_def()
+// CHECK-DEFAULT-LABEL: define internal void @f_deferred()
+// CHECK-PROTECTED-LABEL: define protected i32 @f_def()
// CHECK-PROTECTED: declare void @f_ext()
-// CHECK-PROTECTED: define internal void @f_deferred()
-// CHECK-HIDDEN: define hidden i32 @f_def()
+// CHECK-PROTECTED-LABEL: define internal void @f_deferred()
+// CHECK-HIDDEN-LABEL: define hidden i32 @f_def()
// CHECK-HIDDEN: declare void @f_ext()
-// CHECK-HIDDEN: define internal void @f_deferred()
+// CHECK-HIDDEN-LABEL: define internal void @f_deferred()
extern void f_ext(void);
@@ -45,22 +45,22 @@ int f_def(void) {
}
// PR8457
-// CHECK-DEFAULT: define void @test1(
-// CHECK-PROTECTED: define void @test1(
-// CHECK-HIDDEN: define void @test1(
+// CHECK-DEFAULT-LABEL: define void @test1(
+// CHECK-PROTECTED-LABEL: define void @test1(
+// CHECK-HIDDEN-LABEL: define void @test1(
struct Test1 { int field; };
void __attribute__((visibility("default"))) test1(struct Test1 *v) { }
// rdar://problem/8595231
-// CHECK-DEFAULT: define void @test2()
-// CHECK-PROTECTED: define void @test2()
-// CHECK-HIDDEN: define void @test2()
+// CHECK-DEFAULT-LABEL: define void @test2()
+// CHECK-PROTECTED-LABEL: define void @test2()
+// CHECK-HIDDEN-LABEL: define void @test2()
void test2(void);
void __attribute__((visibility("default"))) test2(void) {}
-// CHECK-DEFAULT: define hidden void @test3()
-// CHECK-PROTECTED: define hidden void @test3()
-// CHECK-HIDDEN: define hidden void @test3()
+// CHECK-DEFAULT-LABEL: define hidden void @test3()
+// CHECK-PROTECTED-LABEL: define hidden void @test3()
+// CHECK-HIDDEN-LABEL: define hidden void @test3()
extern void test3(void);
__private_extern__ void test3(void) {}
@@ -69,8 +69,8 @@ extern int test4;
__private_extern__ int test4 = 10;
// rdar://12399248
-// CHECK-DEFAULT: define hidden void @test5()
-// CHECK-PROTECTED: define hidden void @test5()
-// CHECK-HIDDEN: define hidden void @test5()
+// CHECK-DEFAULT-LABEL: define hidden void @test5()
+// CHECK-PROTECTED-LABEL: define hidden void @test5()
+// CHECK-HIDDEN-LABEL: define hidden void @test5()
__attribute__((availability(macosx,introduced=10.5,deprecated=10.6)))
__private_extern__ void test5(void) {}
diff --git a/test/CodeGen/vla.c b/test/CodeGen/vla.c
index f63796b39dc2..1757ef778794 100644
--- a/test/CodeGen/vla.c
+++ b/test/CodeGen/vla.c
@@ -37,7 +37,7 @@ void g(int count) {
}
// rdar://8403108
-// CHECK: define void @f_8403108
+// CHECK-LABEL: define void @f_8403108
void f_8403108(unsigned x) {
// CHECK: call i8* @llvm.stacksave()
char s1[x];
@@ -86,7 +86,7 @@ int test2(int n)
}
// http://llvm.org/PR8567
-// CHECK: define double @test_PR8567
+// CHECK-LABEL: define double @test_PR8567
double test_PR8567(int n, double (*p)[n][5]) {
// CHECK: [[NV:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[PV:%.*]] = alloca [5 x double]*, align 4
@@ -104,7 +104,7 @@ double test_PR8567(int n, double (*p)[n][5]) {
}
int test4(unsigned n, char (*p)[n][n+1][6]) {
- // CHECK: define i32 @test4(
+ // CHECK-LABEL: define i32 @test4(
// CHECK: [[N:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[P:%.*]] = alloca [6 x i8]*, align 4
// CHECK-NEXT: [[P2:%.*]] = alloca [6 x i8]*, align 4
@@ -146,7 +146,7 @@ int test4(unsigned n, char (*p)[n][n+1][6]) {
// rdar://11485774
void test5(void)
{
- // CHECK: define void @test5(
+ // CHECK-LABEL: define void @test5(
int a[5], i = 0;
// CHECK: [[A:%.*]] = alloca [5 x i32], align 4
// CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
@@ -169,7 +169,7 @@ void test5(void)
void test6(void)
{
- // CHECK: define void @test6(
+ // CHECK-LABEL: define void @test6(
int n = 20, **a, i=0;
// CHECK: [[N:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[A:%.*]] = alloca i32**, align 4
@@ -192,6 +192,6 @@ void test6(void)
// Follow gcc's behavior for VLAs in parameter lists. PR9559.
void test7(int a[b(0)]) {
- // CHECK: define void @test7(
+ // CHECK-LABEL: define void @test7(
// CHECK: call i32 @b(i8* null)
}
diff --git a/test/CodeGen/vld_dup.c b/test/CodeGen/vld_dup.c
index 2bc251989b6a..95904124c596 100644
--- a/test/CodeGen/vld_dup.c
+++ b/test/CodeGen/vld_dup.c
@@ -1,7 +1,7 @@
// REQUIRES: arm-registered-target
// RUN: %clang_cc1 -triple armv7a-linux-gnueabi \
// RUN: -target-cpu cortex-a8 \
-// RUN: -emit-llvm -O0 -o - %s | FileCheck %s
+// RUN: -emit-llvm -o - %s | FileCheck %s
#include <arm_neon.h>
int main(){
int32_t v0[3];
diff --git a/test/CodeGen/volatile-1.c b/test/CodeGen/volatile-1.c
index 65511593d32a..d1861d545899 100644
--- a/test/CodeGen/volatile-1.c
+++ b/test/CodeGen/volatile-1.c
@@ -22,49 +22,49 @@ int printf(const char *, ...);
// that do implicit lvalue-to-rvalue conversion are substantially
// reduced.
-// CHECK: define void @test()
+// CHECK-LABEL: define void @test()
void test() {
// CHECK: load volatile [[INT]]* @i
i;
- // CHECK-NEXT: load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
+ // CHECK-NEXT: load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
// CHECK-NEXT: sitofp [[INT]]
(float)(ci);
- // CHECK-NEXT: load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
+ // CHECK-NEXT: load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
(void)ci;
// CHECK-NEXT: bitcast
// CHECK-NEXT: memcpy
(void)a;
- // CHECK-NEXT: [[R:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: [[I:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
- // CHECK-NEXT: store volatile [[INT]] [[R]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: store volatile [[INT]] [[I]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
+ // CHECK-NEXT: [[R:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: [[I:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
+ // CHECK-NEXT: store volatile [[INT]] [[R]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: store volatile [[INT]] [[I]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
(void)(ci=ci);
// CHECK-NEXT: [[T:%.*]] = load volatile [[INT]]* @j
// CHECK-NEXT: store volatile [[INT]] [[T]], [[INT]]* @i
(void)(i=j);
- // CHECK-NEXT: [[R1:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: [[I1:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
- // CHECK-NEXT: [[R2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: [[I2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
+ // CHECK-NEXT: [[R1:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: [[I1:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
+ // CHECK-NEXT: [[R2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: [[I2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
// Not sure why they're ordered this way.
// CHECK-NEXT: [[R:%.*]] = add [[INT]] [[R2]], [[R1]]
// CHECK-NEXT: [[I:%.*]] = add [[INT]] [[I2]], [[I1]]
- // CHECK-NEXT: store volatile [[INT]] [[R]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: store volatile [[INT]] [[I]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
+ // CHECK-NEXT: store volatile [[INT]] [[R]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: store volatile [[INT]] [[I]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
ci+=ci;
- // CHECK-NEXT: [[R1:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: [[I1:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
- // CHECK-NEXT: [[R2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: [[I2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
+ // CHECK-NEXT: [[R1:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: [[I1:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
+ // CHECK-NEXT: [[R2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: [[I2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
// CHECK-NEXT: [[R:%.*]] = add [[INT]] [[R2]], [[R1]]
// CHECK-NEXT: [[I:%.*]] = add [[INT]] [[I2]], [[I1]]
- // CHECK-NEXT: store volatile [[INT]] [[R]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: store volatile [[INT]] [[I]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
- // CHECK-NEXT: [[R2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0)
- // CHECK-NEXT: [[I2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1)
+ // CHECK-NEXT: store volatile [[INT]] [[R]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: store volatile [[INT]] [[I]], [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
+ // CHECK-NEXT: [[R2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 0), align 4
+ // CHECK-NEXT: [[I2:%.*]] = load volatile [[INT]]* getelementptr inbounds ([[CINT]]* @ci, i32 0, i32 1), align 4
// These additions can be elided
// CHECK-NEXT: add [[INT]] [[R]], [[R2]]
// CHECK-NEXT: add [[INT]] [[I]], [[I2]]
@@ -303,7 +303,7 @@ void test() {
}
extern volatile enum X x;
-// CHECK: define void @test1()
+// CHECK-LABEL: define void @test1()
void test1() {
extern void test1_helper(void);
test1_helper();
@@ -313,3 +313,15 @@ void test1() {
(void) x;
return x;
}
+
+// CHECK: define {{.*}} @test2()
+int test2() {
+ // CHECK: load volatile i32*
+ // CHECK-NEXT: load volatile i32*
+ // CHECK-NEXT: load volatile i32*
+ // CHECK-NEXT: add i32
+ // CHECK-NEXT: add i32
+ // CHECK-NEXT: store volatile i32
+ // CHECK-NEXT: ret i32
+ return i += ci;
+}
diff --git a/test/CodeGen/volatile-2.c b/test/CodeGen/volatile-2.c
index 3d342de69005..18d0d318ef82 100644
--- a/test/CodeGen/volatile-2.c
+++ b/test/CodeGen/volatile-2.c
@@ -1,10 +1,10 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
void test0() {
- // CHECK: define void @test0()
+ // CHECK-LABEL: define void @test0()
// CHECK: [[F:%.*]] = alloca float
- // CHECK-NEXT: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({ float, float }* @test0_v, i32 0, i32 0)
- // CHECK-NEXT: load volatile float* getelementptr inbounds ({{.*}} @test0_v, i32 0, i32 1)
+ // CHECK-NEXT: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({ float, float }* @test0_v, i32 0, i32 0), align 4
+ // CHECK-NEXT: load volatile float* getelementptr inbounds ({{.*}} @test0_v, i32 0, i32 1), align 4
// CHECK-NEXT: store float [[REAL]], float* [[F]], align 4
// CHECK-NEXT: ret void
extern volatile _Complex float test0_v;
@@ -12,11 +12,11 @@ void test0() {
}
void test1() {
- // CHECK: define void @test1()
- // CHECK: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0)
- // CHECK-NEXT: [[IMAG:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1)
- // CHECK-NEXT: store volatile float [[REAL]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0)
- // CHECK-NEXT: store volatile float [[IMAG]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1)
+ // CHECK-LABEL: define void @test1()
+ // CHECK: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0), align 4
+ // CHECK-NEXT: [[IMAG:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1), align 4
+ // CHECK-NEXT: store volatile float [[REAL]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0), align 4
+ // CHECK-NEXT: store volatile float [[IMAG]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1), align 4
// CHECK-NEXT: ret void
extern volatile _Complex float test1_v;
test1_v = test1_v;
diff --git a/test/CodeGen/volatile-complex.c b/test/CodeGen/volatile-complex.c
new file mode 100644
index 000000000000..71e5db6f5cf8
--- /dev/null
+++ b/test/CodeGen/volatile-complex.c
@@ -0,0 +1,67 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
+
+// Validate that volatile _Complex loads and stores are generated
+// properly, including their alignment (even when overaligned).
+//
+// This test assumes that floats are 32-bit aligned and doubles are
+// 64-bit aligned, and uses x86-64 as a target that should have this
+// datalayout.
+
+// CHECK: target datalayout = "{{.*}}f32:32:32-f64:64:64{{.*}}"
+
+volatile _Complex float cf;
+volatile _Complex double cd;
+volatile _Complex float cf32 __attribute__((aligned(32)));
+volatile _Complex double cd32 __attribute__((aligned(32)));
+
+// CHECK-LABEL-LABEL: define void @test_cf()
+void test_cf() {
+ // CHECK: load volatile float* getelementptr inbounds ({ float, float }* @cf, i32 0, i32 0), align 4
+ // CHECK-NEXT: load volatile float* getelementptr inbounds ({ float, float }* @cf, i32 0, i32 1), align 4
+ (void)(cf);
+ // CHECK-NEXT: [[R:%.*]] = load volatile float* getelementptr inbounds ({ float, float }* @cf, i32 0, i32 0), align 4
+ // CHECK-NEXT: [[I:%.*]] = load volatile float* getelementptr inbounds ({ float, float }* @cf, i32 0, i32 1), align 4
+ // CHECK-NEXT: store volatile float [[R]], float* getelementptr inbounds ({ float, float }* @cf, i32 0, i32 0), align 4
+ // CHECK-NEXT: store volatile float [[I]], float* getelementptr inbounds ({ float, float }* @cf, i32 0, i32 1), align 4
+ (void)(cf=cf);
+ // CHECK-NEXT: ret void
+}
+
+// CHECK-LABEL-LABEL: define void @test_cd()
+void test_cd() {
+ // CHECK: load volatile double* getelementptr inbounds ({ double, double }* @cd, i32 0, i32 0), align 8
+ // CHECK-NEXT: load volatile double* getelementptr inbounds ({ double, double }* @cd, i32 0, i32 1), align 8
+ (void)(cd);
+ // CHECK-NEXT: [[R:%.*]] = load volatile double* getelementptr inbounds ({ double, double }* @cd, i32 0, i32 0), align 8
+ // CHECK-NEXT: [[I:%.*]] = load volatile double* getelementptr inbounds ({ double, double }* @cd, i32 0, i32 1), align 8
+ // CHECK-NEXT: store volatile double [[R]], double* getelementptr inbounds ({ double, double }* @cd, i32 0, i32 0), align 8
+ // CHECK-NEXT: store volatile double [[I]], double* getelementptr inbounds ({ double, double }* @cd, i32 0, i32 1), align 8
+ (void)(cd=cd);
+ // CHECK-NEXT: ret void
+}
+
+// CHECK-LABEL-LABEL: define void @test_cf32()
+void test_cf32() {
+ // CHECK: load volatile float* getelementptr inbounds ({ float, float }* @cf32, i32 0, i32 0), align 32
+ // CHECK-NEXT: load volatile float* getelementptr inbounds ({ float, float }* @cf32, i32 0, i32 1), align 4
+ (void)(cf32);
+ // CHECK-NEXT: [[R:%.*]] = load volatile float* getelementptr inbounds ({ float, float }* @cf32, i32 0, i32 0), align 32
+ // CHECK-NEXT: [[I:%.*]] = load volatile float* getelementptr inbounds ({ float, float }* @cf32, i32 0, i32 1), align 4
+ // CHECK-NEXT: store volatile float [[R]], float* getelementptr inbounds ({ float, float }* @cf32, i32 0, i32 0), align 32
+ // CHECK-NEXT: store volatile float [[I]], float* getelementptr inbounds ({ float, float }* @cf32, i32 0, i32 1), align 4
+ (void)(cf32=cf32);
+ // CHECK-NEXT: ret void
+}
+
+// CHECK-LABEL-LABEL: define void @test_cd32()
+void test_cd32() {
+ // CHECK: load volatile double* getelementptr inbounds ({ double, double }* @cd32, i32 0, i32 0), align 32
+ // CHECK-NEXT: load volatile double* getelementptr inbounds ({ double, double }* @cd32, i32 0, i32 1), align 8
+ (void)(cd32);
+ // CHECK-NEXT: [[R:%.*]] = load volatile double* getelementptr inbounds ({ double, double }* @cd32, i32 0, i32 0), align 32
+ // CHECK-NEXT: [[I:%.*]] = load volatile double* getelementptr inbounds ({ double, double }* @cd32, i32 0, i32 1), align 8
+ // CHECK-NEXT: store volatile double [[R]], double* getelementptr inbounds ({ double, double }* @cd32, i32 0, i32 0), align 32
+ // CHECK-NEXT: store volatile double [[I]], double* getelementptr inbounds ({ double, double }* @cd32, i32 0, i32 1), align 8
+ (void)(cd32=cd32);
+ // CHECK-NEXT: ret void
+}
diff --git a/test/CodeGen/wchar-const.c b/test/CodeGen/wchar-const.c
index a9e7e523f96d..2e9af53a14de 100644
--- a/test/CodeGen/wchar-const.c
+++ b/test/CodeGen/wchar-const.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple i386-pc-win32 | FileCheck %s --check-prefix=WIN
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-apple-darwin | FileCheck %s --check-prefix=DAR
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple i386-pc-win32 | FileCheck %s --check-prefix=CHECK-WIN
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-apple-darwin | FileCheck %s --check-prefix=CHECK-DAR
// This should pass for any endianness combination of host and target.
// This bit is taken from Sema/wchar.c so we can avoid the wchar.h include.
diff --git a/test/CodeGen/x86_32-arguments-darwin.c b/test/CodeGen/x86_32-arguments-darwin.c
index 4aa4295ffda2..422e030537e0 100644
--- a/test/CodeGen/x86_32-arguments-darwin.c
+++ b/test/CodeGen/x86_32-arguments-darwin.c
@@ -1,44 +1,44 @@
// RUN: %clang_cc1 -w -fblocks -triple i386-apple-darwin9 -target-cpu yonah -emit-llvm -o - %s | FileCheck %s
-// CHECK: define signext i8 @f0()
+// CHECK-LABEL: define signext i8 @f0()
char f0(void) {
return 0;
}
-// CHECK: define signext i16 @f1()
+// CHECK-LABEL: define signext i16 @f1()
short f1(void) {
return 0;
}
-// CHECK: define i32 @f2()
+// CHECK-LABEL: define i32 @f2()
int f2(void) {
return 0;
}
-// CHECK: define float @f3()
+// CHECK-LABEL: define float @f3()
float f3(void) {
return 0;
}
-// CHECK: define double @f4()
+// CHECK-LABEL: define double @f4()
double f4(void) {
return 0;
}
-// CHECK: define x86_fp80 @f5()
+// CHECK-LABEL: define x86_fp80 @f5()
long double f5(void) {
return 0;
}
-// CHECK: define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8* %a4)
+// CHECK-LABEL: define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8* %a4)
void f6(char a0, short a1, int a2, long long a3, void *a4) {}
-// CHECK: define void @f7(i32 %a0)
+// CHECK-LABEL: define void @f7(i32 %a0)
typedef enum { A, B, C } e7;
void f7(e7 a0) {}
-// CHECK: define i64 @f8_1()
-// CHECK: define void @f8_2(i32 %a0.0, i32 %a0.1)
+// CHECK-LABEL: define i64 @f8_1()
+// CHECK-LABEL: define void @f8_2(i32 %a0.0, i32 %a0.1)
struct s8 {
int a;
int b;
@@ -48,11 +48,11 @@ void f8_2(struct s8 a0) {}
// This should be passed just as s8.
-// CHECK: define i64 @f9_1()
+// CHECK-LABEL: define i64 @f9_1()
// FIXME: llvm-gcc expands this, this may have some value for the
// backend in terms of optimization but doesn't change the ABI.
-// CHECK: define void @f9_2(%struct.s9* byval align 4 %a0)
+// CHECK-LABEL: define void @f9_2(%struct.s9* byval align 4 %a0)
struct s9 {
int a : 17;
int b;
@@ -123,91 +123,91 @@ struct s27 { struct { char a, b, c; } a; struct { char a; } b; } f27(void) { whi
// CHECK: void @f28(%struct.s28* noalias sret %agg.result)
struct s28 { int a; int b[]; } f28(void) { while (1) {} }
-// CHECK: define i16 @f29()
+// CHECK-LABEL: define i16 @f29()
struct s29 { struct { } a[1]; char b; char c; } f29(void) { while (1) {} }
-// CHECK: define i16 @f30()
+// CHECK-LABEL: define i16 @f30()
struct s30 { char a; char b : 4; } f30(void) { while (1) {} }
-// CHECK: define float @f31()
+// CHECK-LABEL: define float @f31()
struct s31 { char : 0; float b; char : 0; } f31(void) { while (1) {} }
-// CHECK: define i32 @f32()
+// CHECK-LABEL: define i32 @f32()
struct s32 { char a; unsigned : 0; } f32(void) { while (1) {} }
-// CHECK: define float @f33()
+// CHECK-LABEL: define float @f33()
struct s33 { float a; long long : 0; } f33(void) { while (1) {} }
-// CHECK: define float @f34()
+// CHECK-LABEL: define float @f34()
struct s34 { struct { int : 0; } a; float b; } f34(void) { while (1) {} }
-// CHECK: define i16 @f35()
+// CHECK-LABEL: define i16 @f35()
struct s35 { struct { int : 0; } a; char b; char c; } f35(void) { while (1) {} }
-// CHECK: define i16 @f36()
+// CHECK-LABEL: define i16 @f36()
struct s36 { struct { int : 0; } a[2][10]; char b; char c; } f36(void) { while (1) {} }
-// CHECK: define float @f37()
+// CHECK-LABEL: define float @f37()
struct s37 { float c[1][1]; } f37(void) { while (1) {} }
-// CHECK: define void @f38(%struct.s38* noalias sret %agg.result)
+// CHECK-LABEL: define void @f38(%struct.s38* noalias sret %agg.result)
struct s38 { char a[3]; short b; } f38(void) { while (1) {} }
-// CHECK: define void @f39(%struct.s39* byval align 16 %x)
+// CHECK-LABEL: define void @f39(%struct.s39* byval align 16 %x)
typedef int v39 __attribute((vector_size(16)));
struct s39 { v39 x; };
void f39(struct s39 x) {}
// <rdar://problem/7247671>
-// CHECK: define i32 @f40()
+// CHECK-LABEL: define i32 @f40()
enum e40 { ec0 = 0 };
enum e40 f40(void) { }
-// CHECK: define void ()* @f41()
+// CHECK-LABEL: define void ()* @f41()
typedef void (^vvbp)(void);
vvbp f41(void) { }
-// CHECK: define i32 @f42()
+// CHECK-LABEL: define i32 @f42()
struct s42 { enum e40 f0; } f42(void) { }
-// CHECK: define i64 @f43()
+// CHECK-LABEL: define i64 @f43()
struct s43 { enum e40 f0; int f1; } f43(void) { }
-// CHECK: define void ()* @f44()
+// CHECK-LABEL: define void ()* @f44()
struct s44 { vvbp f0; } f44(void) { }
-// CHECK: define i64 @f45()
+// CHECK-LABEL: define i64 @f45()
struct s45 { vvbp f0; int f1; } f45(void) { }
-// CHECK: define void @f46(i32 %a0)
+// CHECK-LABEL: define void @f46(i32 %a0)
void f46(enum e40 a0) { }
-// CHECK: define void @f47(void ()* %a1)
+// CHECK-LABEL: define void @f47(void ()* %a1)
void f47(vvbp a1) { }
-// CHECK: define void @f48(i32 %a0.0)
+// CHECK-LABEL: define void @f48(i32 %a0.0)
struct s48 { enum e40 f0; };
void f48(struct s48 a0) { }
-// CHECK: define void @f49(i32 %a0.0, i32 %a0.1)
+// CHECK-LABEL: define void @f49(i32 %a0.0, i32 %a0.1)
struct s49 { enum e40 f0; int f1; };
void f49(struct s49 a0) { }
-// CHECK: define void @f50(void ()* %a0.0)
+// CHECK-LABEL: define void @f50(void ()* %a0.0)
struct s50 { vvbp f0; };
void f50(struct s50 a0) { }
-// CHECK: define void @f51(void ()* %a0.0, i32 %a0.1)
+// CHECK-LABEL: define void @f51(void ()* %a0.0, i32 %a0.1)
struct s51 { vvbp f0; int f1; };
void f51(struct s51 a0) { }
-// CHECK: define void @f52(%struct.s52* byval align 4)
+// CHECK-LABEL: define void @f52(%struct.s52* byval align 4)
struct s52 {
long double a;
};
void f52(struct s52 x) {}
-// CHECK: define void @f53(%struct.s53* byval align 4)
+// CHECK-LABEL: define void @f53(%struct.s53* byval align 4)
struct __attribute__((aligned(32))) s53 {
int x;
int y;
@@ -216,18 +216,18 @@ void f53(struct s53 x) {}
typedef unsigned short v2i16 __attribute__((__vector_size__(4)));
-// CHECK: define i32 @f54(i32 %arg.coerce)
+// CHECK-LABEL: define i32 @f54(i32 %arg.coerce)
// rdar://8359483
v2i16 f54(v2i16 arg) { return arg+arg; }
typedef int v4i32 __attribute__((__vector_size__(16)));
-// CHECK: define <2 x i64> @f55(<4 x i32> %arg)
+// CHECK-LABEL: define <2 x i64> @f55(<4 x i32> %arg)
// PR8029
v4i32 f55(v4i32 arg) { return arg+arg; }
-// CHECK: define void @f56(
+// CHECK-LABEL: define void @f56(
// CHECK: i8 signext %a0, %struct.s56_0* byval align 4 %a1,
// CHECK: i64 %a2.coerce, %struct.s56_1* byval align 4,
// CHECK: i64 %a4.coerce, %struct.s56_2* byval align 4,
@@ -276,34 +276,34 @@ void f56(char a0, struct s56_0 a1,
a10, a11, a12, a13);
}
-// CHECK: define void @f57(i32 %x.0, i32 %x.1)
+// CHECK-LABEL: define void @f57(i32 %x.0, i32 %x.1)
// CHECK: call void @f57(
struct s57 { _Complex int x; };
void f57(struct s57 x) {} void f57a(void) { f57((struct s57){1}); }
-// CHECK: define void @f58()
+// CHECK-LABEL: define void @f58()
union u58 {};
void f58(union u58 x) {}
-// CHECK: define i64 @f59()
+// CHECK-LABEL: define i64 @f59()
struct s59 { float x __attribute((aligned(8))); };
struct s59 f59() { while (1) {} }
-// CHECK: define void @f60(%struct.s60* byval align 4, i32 %y)
+// CHECK-LABEL: define void @f60(%struct.s60* byval align 4, i32 %y)
struct s60 { int x __attribute((aligned(8))); };
void f60(struct s60 x, int y) {}
-// CHECK: define void @f61(i32 %x, %struct.s61* byval align 16 %y)
+// CHECK-LABEL: define void @f61(i32 %x, %struct.s61* byval align 16 %y)
typedef int T61 __attribute((vector_size(16)));
struct s61 { T61 x; int y; };
void f61(int x, struct s61 y) {}
-// CHECK: define void @f62(i32 %x, %struct.s62* byval align 4)
+// CHECK-LABEL: define void @f62(i32 %x, %struct.s62* byval align 4)
typedef int T62 __attribute((vector_size(16)));
struct s62 { T62 x; int y; } __attribute((packed, aligned(8)));
void f62(int x, struct s62 y) {}
-// CHECK: define i32 @f63
+// CHECK-LABEL: define i32 @f63
// CHECK: ptrtoint
// CHECK: and {{.*}}, -16
// CHECK: inttoptr
@@ -317,15 +317,15 @@ int f63(int i, ...) {
return s.y;
}
-// CHECK: define void @f64(%struct.s64* byval align 4 %x)
+// CHECK-LABEL: define void @f64(%struct.s64* byval align 4 %x)
struct s64 { signed char a[0]; signed char b[]; };
void f64(struct s64 x) {}
-// CHECK: define float @f65()
+// CHECK-LABEL: define float @f65()
struct s65 { signed char a[0]; float b; };
struct s65 f65() { return (struct s65){{},2}; }
-// CHECK: define <2 x i64> @f66
+// CHECK-LABEL: define <2 x i64> @f66
// CHECK: ptrtoint
// CHECK: and {{.*}}, -16
// CHECK: inttoptr
@@ -341,4 +341,4 @@ T66 f66(int i, ...) {
// PR14453
struct s67 { _Complex unsigned short int a; };
void f67(struct s67 x) {}
-// CHECK: define void @f67(%struct.s67* byval align 4 %x)
+// CHECK-LABEL: define void @f67(%struct.s67* byval align 4 %x)
diff --git a/test/CodeGen/x86_32-arguments-linux.c b/test/CodeGen/x86_32-arguments-linux.c
index e93f9dccbf05..1a8c6001292b 100644
--- a/test/CodeGen/x86_32-arguments-linux.c
+++ b/test/CodeGen/x86_32-arguments-linux.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -w -fblocks -triple i386-pc-linux-gnu -target-cpu pentium4 -emit-llvm -o %t %s
// RUN: FileCheck < %t %s
-// CHECK: define void @f56(
+// CHECK-LABEL: define void @f56(
// CHECK: i8 signext %a0, %struct.s56_0* byval align 4 %a1,
// CHECK: i64 %a2.coerce, %struct.s56_1* byval align 4,
// CHECK: <1 x double> %a4, %struct.s56_2* byval align 4,
diff --git a/test/CodeGen/x86_32-arguments-nommx.c b/test/CodeGen/x86_32-arguments-nommx.c
index 40362f796f6c..ce68e3a8916c 100644
--- a/test/CodeGen/x86_32-arguments-nommx.c
+++ b/test/CodeGen/x86_32-arguments-nommx.c
@@ -3,9 +3,9 @@
// no-mmx should put mmx into memory
typedef int __attribute__((vector_size (8))) i32v2;
int a(i32v2 x) { return x[0]; }
-// CHECK: define i32 @a(i64 %x.coerce)
+// CHECK-LABEL: define i32 @a(i64 %x.coerce)
// but SSE2 vectors should still go into an SSE2 register
typedef int __attribute__((vector_size (16))) i32v4;
int b(i32v4 x) { return x[0]; }
-// CHECK: define i32 @b(<4 x i32> %x)
+// CHECK-LABEL: define i32 @b(<4 x i32> %x)
diff --git a/test/CodeGen/x86_32-arguments-realign.c b/test/CodeGen/x86_32-arguments-realign.c
index b08862ee43e4..768e1cc4690f 100644
--- a/test/CodeGen/x86_32-arguments-realign.c
+++ b/test/CodeGen/x86_32-arguments-realign.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -w -fblocks -triple i386-apple-darwin9 -emit-llvm -o %t %s
// RUN: FileCheck < %t %s
-// CHECK: define void @f0(%struct.s0* byval align 4)
+// CHECK-LABEL: define void @f0(%struct.s0* byval align 4)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %{{.*}}, i8* %{{.*}}, i32 16, i32 4, i1 false)
// CHECK: }
struct s0 { long double a; };
diff --git a/test/CodeGen/x86_32-arguments-win32.c b/test/CodeGen/x86_32-arguments-win32.c
index 77ff9e2ff3dd..f8b09957b36e 100644
--- a/test/CodeGen/x86_32-arguments-win32.c
+++ b/test/CodeGen/x86_32-arguments-win32.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -w -triple i386-pc-win32 -emit-llvm -o - %s | FileCheck %s
-// CHECK: define i64 @f1_1()
-// CHECK: define void @f1_2(%struct.s1* byval align 4 %a0)
+// CHECK-LABEL: define i64 @f1_1()
+// CHECK-LABEL: define void @f1_2(%struct.s1* byval align 4 %a0)
struct s1 {
int a;
int b;
@@ -9,37 +9,37 @@ struct s1 {
struct s1 f1_1(void) { while (1) {} }
void f1_2(struct s1 a0) {}
-// CHECK: define i32 @f2_1()
+// CHECK-LABEL: define i32 @f2_1()
struct s2 {
short a;
short b;
};
struct s2 f2_1(void) { while (1) {} }
-// CHECK: define i16 @f3_1()
+// CHECK-LABEL: define i16 @f3_1()
struct s3 {
char a;
char b;
};
struct s3 f3_1(void) { while (1) {} }
-// CHECK: define i8 @f4_1()
+// CHECK-LABEL: define i8 @f4_1()
struct s4 {
char a:4;
char b:4;
};
struct s4 f4_1(void) { while (1) {} }
-// CHECK: define i64 @f5_1()
-// CHECK: define void @f5_2(%struct.s5* byval align 4)
+// CHECK-LABEL: define i64 @f5_1()
+// CHECK-LABEL: define void @f5_2(%struct.s5* byval align 4)
struct s5 {
double a;
};
struct s5 f5_1(void) { while (1) {} }
void f5_2(struct s5 a0) {}
-// CHECK: define i32 @f6_1()
-// CHECK: define void @f6_2(%struct.s6* byval align 4 %a0)
+// CHECK-LABEL: define i32 @f6_1()
+// CHECK-LABEL: define void @f6_2(%struct.s6* byval align 4 %a0)
struct s6 {
float a;
};
diff --git a/test/CodeGen/x86_32-fpcc-struct-return.c b/test/CodeGen/x86_32-fpcc-struct-return.c
new file mode 100644
index 000000000000..9f61599fc695
--- /dev/null
+++ b/test/CodeGen/x86_32-fpcc-struct-return.c
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-REG
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -fpcc-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PCC
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -freg-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-REG
+// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PCC
+// RUN: %clang_cc1 -triple i386-pc-linux-gnu -fpcc-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PCC
+// RUN: %clang_cc1 -triple i386-pc-linux-gnu -freg-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-REG
+// RUN: %clang_cc1 -triple i386-pc-win32 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-REG
+// RUN: %clang_cc1 -triple i386-pc-win32 -fpcc-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PCC
+// RUN: %clang_cc1 -triple i386-pc-win32 -freg-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-REG
+
+typedef struct { int a,b,c,d; } Big;
+typedef struct { int i; } Small;
+typedef struct { short s; } Short;
+typedef struct { } ZeroSized;
+
+// CHECK-LABEL: define void @returnBig
+// CHECK: ret void
+Big returnBig(Big x) { return x; }
+
+// CHECK-PCC-LABEL: define void @returnSmall
+// CHECK-PCC: ret void
+// CHECK-REG-LABEL: define i32 @returnSmall
+// CHECK-REG: ret i32
+Small returnSmall(Small x) { return x; }
+
+// CHECK-PCC-LABEL: define void @returnShort
+// CHECK-PCC: ret void
+// CHECK-REG-LABEL: define i16 @returnShort
+// CHECK-REG: ret i16
+Short returnShort(Short x) { return x; }
+
+// CHECK-LABEL: define void @returnZero()
+// CHECK: ret void
+ZeroSized returnZero(ZeroSized x) { return x; }
diff --git a/test/CodeGen/x86_64-arguments-nacl.c b/test/CodeGen/x86_64-arguments-nacl.c
index 8f756caba757..1c3f5b0c4a2f 100644
--- a/test/CodeGen/x86_64-arguments-nacl.c
+++ b/test/CodeGen/x86_64-arguments-nacl.c
@@ -21,21 +21,21 @@ struct PP_Var f0() {
return result;
}
-// CHECK: define void @f1(i64 %p1.coerce0, i64 %p1.coerce1)
+// CHECK-LABEL: define void @f1(i64 %p1.coerce0, i64 %p1.coerce1)
void f1(struct PP_Var p1) { while(1) {} }
// long doubles are 64 bits on NaCl
-// CHECK: define double @f5()
+// CHECK-LABEL: define double @f5()
long double f5(void) {
return 0;
}
-// CHECK: define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8* %a4)
+// CHECK-LABEL: define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8* %a4)
void f6(char a0, short a1, int a2, long long a3, void *a4) {
}
-// CHECK: define i64 @f8_1()
-// CHECK: define void @f8_2(i64 %a0.coerce)
+// CHECK-LABEL: define i64 @f8_1()
+// CHECK-LABEL: define void @f8_2(i64 %a0.coerce)
union u8 {
long double a;
int b;
@@ -43,18 +43,18 @@ union u8 {
union u8 f8_1() { while (1) {} }
void f8_2(union u8 a0) {}
-// CHECK: define i64 @f9()
+// CHECK-LABEL: define i64 @f9()
struct s9 { int a; int b; int : 0; } f9(void) { while (1) {} }
-// CHECK: define void @f10(i64 %a0.coerce)
+// CHECK-LABEL: define void @f10(i64 %a0.coerce)
struct s10 { int a; int b; int : 0; };
void f10(struct s10 a0) {}
-// CHECK: define double @f11()
+// CHECK-LABEL: define double @f11()
union { long double a; float b; } f11() { while (1) {} }
-// CHECK: define i32 @f12_0()
-// CHECK: define void @f12_1(i32 %a0.coerce)
+// CHECK-LABEL: define i32 @f12_0()
+// CHECK-LABEL: define void @f12_1(i32 %a0.coerce)
struct s12 { int a __attribute__((aligned(16))); };
struct s12 f12_0(void) { while (1) {} }
void f12_1(struct s12 a0) {}
@@ -68,7 +68,7 @@ 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) {} }
-// CHECK: define void @f20(%struct.s20* byval align 32 %x)
+// CHECK-LABEL: define void @f20(%struct.s20* byval align 32 %x)
struct __attribute__((aligned(32))) s20 {
int x;
int y;
@@ -96,10 +96,10 @@ typedef struct {
int a;
int b;
} s1;
-// CHECK: define i32 @f48(%struct.s1* byval %s)
+// CHECK-LABEL: define i32 @f48(%struct.s1* byval %s)
int __attribute__((pnaclcall)) f48(s1 s) { return s.a; }
-// CHECK: define void @f49(%struct.s1* noalias sret %agg.result)
+// CHECK-LABEL: define void @f49(%struct.s1* noalias sret %agg.result)
s1 __attribute__((pnaclcall)) f49() { s1 s; s.a = s.b = 1; return s; }
union simple_union {
@@ -107,7 +107,7 @@ union simple_union {
char b;
};
// Unions should be passed as byval structs
-// CHECK: define void @f50(%union.simple_union* byval %s)
+// CHECK-LABEL: define void @f50(%union.simple_union* byval %s)
void __attribute__((pnaclcall)) f50(union simple_union s) {}
typedef struct {
@@ -116,5 +116,5 @@ typedef struct {
int b8 : 8;
} bitfield1;
// Bitfields should be passed as byval structs
-// CHECK: define void @f51(%struct.bitfield1* byval %bf1)
+// CHECK-LABEL: define void @f51(%struct.bitfield1* byval %bf1)
void __attribute__((pnaclcall)) f51(bitfield1 bf1) {}
diff --git a/test/CodeGen/x86_64-arguments.c b/test/CodeGen/x86_64-arguments.c
index 518ee843308d..5d01d3bf69ed 100644
--- a/test/CodeGen/x86_64-arguments.c
+++ b/test/CodeGen/x86_64-arguments.c
@@ -2,49 +2,49 @@
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -target-feature +avx | FileCheck %s -check-prefix=AVX
#include <stdarg.h>
-// CHECK: define signext i8 @f0()
+// CHECK-LABEL: define signext i8 @f0()
char f0(void) {
return 0;
}
-// CHECK: define signext i16 @f1()
+// CHECK-LABEL: define signext i16 @f1()
short f1(void) {
return 0;
}
-// CHECK: define i32 @f2()
+// CHECK-LABEL: define i32 @f2()
int f2(void) {
return 0;
}
-// CHECK: define float @f3()
+// CHECK-LABEL: define float @f3()
float f3(void) {
return 0;
}
-// CHECK: define double @f4()
+// CHECK-LABEL: define double @f4()
double f4(void) {
return 0;
}
-// CHECK: define x86_fp80 @f5()
+// CHECK-LABEL: define x86_fp80 @f5()
long double f5(void) {
return 0;
}
-// CHECK: define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8* %a4)
+// CHECK-LABEL: define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8* %a4)
void f6(char a0, short a1, int a2, long long a3, void *a4) {
}
-// CHECK: define void @f7(i32 %a0)
+// CHECK-LABEL: define void @f7(i32 %a0)
typedef enum { A, B, C } e7;
void f7(e7 a0) {
}
// Test merging/passing of upper eightbyte with X87 class.
//
-// CHECK: define void @f8_1(%union.u8* noalias sret %agg.result)
-// CHECK: define void @f8_2(%union.u8* byval align 16 %a0)
+// CHECK-LABEL: define void @f8_1(%union.u8* noalias sret %agg.result)
+// CHECK-LABEL: define void @f8_2(%union.u8* byval align 16 %a0)
union u8 {
long double a;
int b;
@@ -52,18 +52,18 @@ union u8 {
union u8 f8_1() { while (1) {} }
void f8_2(union u8 a0) {}
-// CHECK: define i64 @f9()
+// CHECK-LABEL: define i64 @f9()
struct s9 { int a; int b; int : 0; } f9(void) { while (1) {} }
-// CHECK: define void @f10(i64 %a0.coerce)
+// CHECK-LABEL: define void @f10(i64 %a0.coerce)
struct s10 { int a; int b; int : 0; };
void f10(struct s10 a0) {}
-// CHECK: define void @f11(%union.anon* noalias sret %agg.result)
+// CHECK-LABEL: define void @f11(%union.anon* noalias sret %agg.result)
union { long double a; float b; } f11() { while (1) {} }
-// CHECK: define i32 @f12_0()
-// CHECK: define void @f12_1(i32 %a0.coerce)
+// CHECK-LABEL: define i32 @f12_0()
+// CHECK-LABEL: define void @f12_1(i32 %a0.coerce)
struct s12 { int a __attribute__((aligned(16))); };
struct s12 f12_0(void) { while (1) {} }
void f12_1(struct s12 a0) {}
@@ -94,19 +94,19 @@ void f17(float a, float b, float c, float d, float e, float f, float g, float h,
// Check for valid coercion. The struct should be passed/returned as i32, not
// as i64 for better code quality.
// rdar://8135035
-// CHECK: define void @f18(i32 %a, i32 %f18_arg1.coerce)
+// CHECK-LABEL: define void @f18(i32 %a, i32 %f18_arg1.coerce)
struct f18_s0 { int f0; };
void f18(int a, struct f18_s0 f18_arg1) { while (1) {} }
// Check byval alignment.
-// CHECK: define void @f19(%struct.s19* byval align 16 %x)
+// CHECK-LABEL: define void @f19(%struct.s19* byval align 16 %x)
struct s19 {
long double a;
};
void f19(struct s19 x) {}
-// CHECK: define void @f20(%struct.s20* byval align 32 %x)
+// CHECK-LABEL: define void @f20(%struct.s20* byval align 32 %x)
struct __attribute__((aligned(32))) s20 {
int x;
int y;
@@ -119,7 +119,7 @@ struct StringRef {
};
// rdar://7375902
-// CHECK: define i8* @f21(i64 %S.coerce0, i8* %S.coerce1)
+// CHECK-LABEL: define i8* @f21(i64 %S.coerce0, i8* %S.coerce1)
const char *f21(struct StringRef S) { return S.x+S.Ptr; }
// PR7567
@@ -140,7 +140,7 @@ struct f23S {
void f23(int A, struct f23S B) {
- // CHECK: define void @f23(i32 %A, i64 %B.coerce0, i32 %B.coerce1)
+ // CHECK-LABEL: define void @f23(i32 %A, i64 %B.coerce0, i32 %B.coerce1)
}
struct f24s { long a; int b; };
@@ -154,7 +154,7 @@ struct f23S f24(struct f23S *X, struct f24s *P2) {
// rdar://8248065
typedef float v4f32 __attribute__((__vector_size__(16)));
v4f32 f25(v4f32 X) {
- // CHECK: define <4 x float> @f25(<4 x float> %X)
+ // CHECK-LABEL: define <4 x float> @f25(<4 x float> %X)
// CHECK-NOT: alloca
// CHECK: alloca <4 x float>
// CHECK-NOT: alloca
@@ -180,7 +180,7 @@ struct v4f32wrapper {
};
struct v4f32wrapper f27(struct v4f32wrapper X) {
- // CHECK: define <4 x float> @f27(<4 x float> %X.coerce)
+ // CHECK-LABEL: define <4 x float> @f27(<4 x float> %X.coerce)
return X;
}
@@ -190,7 +190,7 @@ struct f28c {
int y;
};
void f28(struct f28c C) {
- // CHECK: define void @f28(double %C.coerce0, i32 %C.coerce1)
+ // CHECK-LABEL: define void @f28(double %C.coerce0, i32 %C.coerce1)
}
struct f29a {
@@ -201,26 +201,26 @@ struct f29a {
};
void f29a(struct f29a A) {
- // CHECK: define void @f29a(double %A.coerce0, i32 %A.coerce1)
+ // CHECK-LABEL: define void @f29a(double %A.coerce0, i32 %A.coerce1)
}
// rdar://8249586
struct S0 { char f0[8]; char f2; char f3; char f4; };
void f30(struct S0 p_4) {
- // CHECK: define void @f30(i64 %p_4.coerce0, i24 %p_4.coerce1)
+ // CHECK-LABEL: define void @f30(i64 %p_4.coerce0, i24 %p_4.coerce1)
}
// Pass the third element as a float when followed by tail padding.
// rdar://8251384
struct f31foo { float a, b, c; };
float f31(struct f31foo X) {
- // CHECK: define float @f31(<2 x float> %X.coerce0, float %X.coerce1)
+ // CHECK-LABEL: define float @f31(<2 x float> %X.coerce0, float %X.coerce1)
return X.c;
}
_Complex float f32(_Complex float A, _Complex float B) {
// rdar://6379669
- // CHECK: define <2 x float> @f32(<2 x float> %A.coerce, <2 x float> %B.coerce)
+ // CHECK-LABEL: define <2 x float> @f32(<2 x float> %A.coerce, <2 x float> %B.coerce)
return A+B;
}
@@ -235,12 +235,12 @@ void f33(va_list X) {
typedef unsigned long long v1i64 __attribute__((__vector_size__(8)));
// rdar://8359248
-// CHECK: define i64 @f34(i64 %arg.coerce)
+// CHECK-LABEL: define i64 @f34(i64 %arg.coerce)
v1i64 f34(v1i64 arg) { return arg; }
// rdar://8358475
-// CHECK: define i64 @f35(i64 %arg.coerce)
+// CHECK-LABEL: define i64 @f35(i64 %arg.coerce)
typedef unsigned long v1i64_2 __attribute__((__vector_size__(8)));
v1i64_2 f35(v1i64_2 arg) { return arg+arg; }
@@ -260,7 +260,7 @@ void f9122143()
func(ss);
}
-// CHECK: define double @f36(double %arg.coerce)
+// CHECK-LABEL: define double @f36(double %arg.coerce)
typedef unsigned v2i32 __attribute((__vector_size__(8)));
v2i32 f36(v2i32 arg) { return arg; }
@@ -308,7 +308,7 @@ void func43(SA s) {
func42(s);
}
-// CHECK: define i32 @f44
+// CHECK-LABEL: define i32 @f44
// CHECK: ptrtoint
// CHECK-NEXT: and {{.*}}, -32
// CHECK-NEXT: inttoptr
@@ -323,7 +323,7 @@ int f44(int i, ...) {
}
// Text that vec3 returns the correct LLVM IR type.
-// AVX: define i32 @foo(<3 x i64> %X)
+// AVX-LABEL: define i32 @foo(<3 x i64> %X)
typedef long long3 __attribute((ext_vector_type(3)));
int foo(long3 X)
{
@@ -379,7 +379,7 @@ void test49_helper(double, ...);
void test49(double d, double e) {
test49_helper(d, e);
}
-// CHECK: define void @test49(
+// CHECK-LABEL: define void @test49(
// CHECK: [[T0:%.*]] = load double*
// CHECK-NEXT: [[T1:%.*]] = load double*
// CHECK-NEXT: call void (double, ...)* @test49_helper(double [[T0]], double [[T1]])
@@ -388,7 +388,49 @@ void test50_helper();
void test50(double d, double e) {
test50_helper(d, e);
}
-// CHECK: define void @test50(
+// CHECK-LABEL: define void @test50(
// CHECK: [[T0:%.*]] = load double*
// CHECK-NEXT: [[T1:%.*]] = load double*
// CHECK-NEXT: call void (double, double, ...)* bitcast (void (...)* @test50_helper to void (double, double, ...)*)(double [[T0]], double [[T1]])
+
+struct test51_s { __uint128_t intval; };
+void test51(struct test51_s *s, __builtin_va_list argList) {
+ *s = __builtin_va_arg(argList, struct test51_s);
+}
+
+// CHECK-LABEL: define void @test51
+// CHECK: [[TMP_ADDR:%.*]] = alloca [[STRUCT_TEST51:%.*]], align 16
+// CHECK: br i1
+// CHECK: [[REG_SAVE_AREA_PTR:%.*]] = getelementptr inbounds {{.*}}, i32 0, i32 3
+// CHECK-NEXT: [[REG_SAVE_AREA:%.*]] = load i8** [[REG_SAVE_AREA_PTR]]
+// CHECK-NEXT: [[VALUE_ADDR:%.*]] = getelementptr i8* [[REG_SAVE_AREA]], i32 {{.*}}
+// CHECK-NEXT: [[CASTED_VALUE_ADDR:%.*]] = bitcast i8* [[VALUE_ADDR]] to [[STRUCT_TEST51]]
+// CHECK-NEXT: [[CASTED_TMP_ADDR:%.*]] = bitcast [[STRUCT_TEST51]]* [[TMP_ADDR]] to i8*
+// CHECK-NEXT: [[RECASTED_VALUE_ADDR:%.*]] = bitcast [[STRUCT_TEST51]]* [[CASTED_VALUE_ADDR]] to i8*
+// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[CASTED_TMP_ADDR]], i8* [[RECASTED_VALUE_ADDR]], i64 16, i32 8, i1 false)
+// CHECK-NEXT: add i32 {{.*}}, 16
+// CHECK-NEXT: store i32 {{.*}}, i32* {{.*}}
+// CHECK-NEXT: br label
+
+void test52_helper(int, ...);
+__m256 x52;
+void test52() {
+ test52_helper(0, x52, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0i);
+}
+// AVX: @test52_helper(i32 0, <8 x float> {{%[a-zA-Z0-9]+}}, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double {{%[a-zA-Z0-9]+}}, double {{%[a-zA-Z0-9]+}})
+
+void test53(__m256 *m, __builtin_va_list argList) {
+ *m = __builtin_va_arg(argList, __m256);
+}
+// AVX-LABEL: define void @test53
+// AVX-NOT: br i1
+// AVX: ret void
+
+void test54_helper(__m256, ...);
+__m256 x54;
+void test54() {
+ test54_helper(x54, x54, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0i);
+ test54_helper(x54, x54, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0i);
+}
+// AVX: @test54_helper(<8 x float> {{%[a-zA-Z0-9]+}}, <8 x float> {{%[a-zA-Z0-9]+}}, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double {{%[a-zA-Z0-9]+}}, double {{%[a-zA-Z0-9]+}})
+// AVX: @test54_helper(<8 x float> {{%[a-zA-Z0-9]+}}, <8 x float> {{%[a-zA-Z0-9]+}}, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, { double, double }* byval align 8 {{%[a-zA-Z0-9]+}})
diff --git a/test/CodeGen/xcore-abi.c b/test/CodeGen/xcore-abi.c
new file mode 100644
index 000000000000..10881de7cec2
--- /dev/null
+++ b/test/CodeGen/xcore-abi.c
@@ -0,0 +1,129 @@
+// RUN: %clang_cc1 -triple xcore -verify %s
+_Static_assert(sizeof(long long) == 8, "sizeof long long is wrong");
+_Static_assert(_Alignof(long long) == 4, "alignof long long is wrong");
+
+_Static_assert(sizeof(double) == 8, "sizeof double is wrong");
+_Static_assert(_Alignof(double) == 4, "alignof double is wrong");
+
+// RUN: %clang_cc1 -triple xcore-unknown-unknown -fno-signed-char -fno-common -emit-llvm -o - %s | FileCheck %s
+
+// CHECK: target datalayout = "e-p:32:32:32-a0:0:32-n32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f16:16:32-f32:32:32-f64:32:32"
+// CHECK: target triple = "xcore-unknown-unknown"
+
+// CHECK: @g1 = global i32 0, align 4
+int g1;
+
+#include <stdarg.h>
+struct x { int a[5]; };
+void f(void*);
+void testva (int n, ...) {
+ // CHECK-LABEL: testva
+ va_list ap;
+ va_start(ap,n);
+ // CHECK: [[AP:%[a-z0-9]+]] = alloca i8*, align 4
+ // CHECK: [[AP1:%[a-z0-9]+]] = bitcast i8** [[AP]] to i8*
+ // CHECK: call void @llvm.va_start(i8* [[AP1]])
+
+ char* v1 = va_arg (ap, char*);
+ f(v1);
+ // CHECK: [[I:%[a-z0-9]+]] = load i8** [[AP]]
+ // CHECK: [[P:%[a-z0-9]+]] = bitcast i8* [[I]] to i8**
+ // CHECK: [[IN:%[a-z0-9]+]] = getelementptr i8* [[I]], i32 4
+ // CHECK: store i8* [[IN]], i8** [[AP]]
+ // CHECK: [[V1:%[a-z0-9]+]] = load i8** [[P]]
+ // CHECK: store i8* [[V1]], i8** [[V:%[a-z0-9]+]], align 4
+ // CHECK: [[V2:%[a-z0-9]+]] = load i8** [[V]], align 4
+ // CHECK: call void @f(i8* [[V2]])
+
+ char v2 = va_arg (ap, char); // expected-warning{{second argument to 'va_arg' is of promotable type 'char'}}
+ f(&v2);
+ // CHECK: [[I:%[a-z0-9]+]] = load i8** [[AP]]
+ // CHECK: [[IN:%[a-z0-9]+]] = getelementptr i8* [[I]], i32 4
+ // CHECK: store i8* [[IN]], i8** [[AP]]
+ // CHECK: [[V1:%[a-z0-9]+]] = load i8* [[I]]
+ // CHECK: store i8 [[V1]], i8* [[V:%[a-z0-9]+]], align 1
+ // CHECK: call void @f(i8* [[V]])
+
+ int v3 = va_arg (ap, int);
+ f(&v3);
+ // CHECK: [[I:%[a-z0-9]+]] = load i8** [[AP]]
+ // CHECK: [[P:%[a-z0-9]+]] = bitcast i8* [[I]] to i32*
+ // CHECK: [[IN:%[a-z0-9]+]] = getelementptr i8* [[I]], i32 4
+ // CHECK: store i8* [[IN]], i8** [[AP]]
+ // CHECK: [[V1:%[a-z0-9]+]] = load i32* [[P]]
+ // CHECK: store i32 [[V1]], i32* [[V:%[a-z0-9]+]], align 4
+ // CHECK: [[V2:%[a-z0-9]+]] = bitcast i32* [[V]] to i8*
+ // CHECK: call void @f(i8* [[V2]])
+
+ long long int v4 = va_arg (ap, long long int);
+ f(&v4);
+ // CHECK: [[I:%[a-z0-9]+]] = load i8** [[AP]]
+ // CHECK: [[P:%[a-z0-9]+]] = bitcast i8* [[I]] to i64*
+ // CHECK: [[IN:%[a-z0-9]+]] = getelementptr i8* [[I]], i32 8
+ // CHECK: store i8* [[IN]], i8** [[AP]]
+ // CHECK: [[V1:%[a-z0-9]+]] = load i64* [[P]]
+ // CHECK: store i64 [[V1]], i64* [[V:%[a-z0-9]+]], align 4
+ // CHECK:[[V2:%[a-z0-9]+]] = bitcast i64* [[V]] to i8*
+ // CHECK: call void @f(i8* [[V2]])
+
+ struct x v5 = va_arg (ap, struct x); // typical agregate type
+ f(&v5);
+ // CHECK: [[I:%[a-z0-9]+]] = load i8** [[AP]]
+ // CHECK: [[I2:%[a-z0-9]+]] = bitcast i8* [[I]] to %struct.x**
+ // CHECK: [[P:%[a-z0-9]+]] = load %struct.x** [[I2]]
+ // CHECK: [[IN:%[a-z0-9]+]] = getelementptr i8* [[I]], i32 4
+ // CHECK: store i8* [[IN]], i8** [[AP]]
+ // CHECK: [[V1:%[a-z0-9]+]] = bitcast %struct.x* [[V:%[a-z0-9]+]] to i8*
+ // CHECK: [[P1:%[a-z0-9]+]] = bitcast %struct.x* [[P]] to i8*
+ // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[V1]], i8* [[P1]], i32 20, i32 4, i1 false)
+ // CHECK: [[V2:%[a-z0-9]+]] = bitcast %struct.x* [[V]] to i8*
+ // CHECK: call void @f(i8* [[V2]])
+
+ int* v6 = va_arg (ap, int[4]); // an unusual agregate type
+ f(v6);
+ // CHECK: [[I:%[a-z0-9]+]] = load i8** [[AP]]
+ // CHECK: [[I2:%[a-z0-9]+]] = bitcast i8* [[I]] to [4 x i32]**
+ // CHECK: [[P:%[a-z0-9]+]] = load [4 x i32]** [[I2]]
+ // CHECK: [[IN:%[a-z0-9]+]] = getelementptr i8* [[I]], i32 4
+ // CHECK: store i8* [[IN]], i8** [[AP]]
+ // CHECK: [[V1:%[a-z0-9]+]] = bitcast [4 x i32]* [[V0:%[a-z0-9]+]] to i8*
+ // CHECK: [[P1:%[a-z0-9]+]] = bitcast [4 x i32]* [[P]] to i8*
+ // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[V1]], i8* [[P1]], i32 16, i32 4, i1 false)
+ // CHECK: [[V2:%[a-z0-9]+]] = getelementptr inbounds [4 x i32]* [[V0]], i32 0, i32 0
+ // CHECK: store i32* [[V2]], i32** [[V:%[a-z0-9]+]], align 4
+ // CHECK: [[V3:%[a-z0-9]+]] = load i32** [[V]], align 4
+ // CHECK: [[V4:%[a-z0-9]+]] = bitcast i32* [[V3]] to i8*
+ // CHECK: call void @f(i8* [[V4]])
+
+ double v7 = va_arg (ap, double);
+ f(&v7);
+ // CHECK: [[I:%[a-z0-9]+]] = load i8** [[AP]]
+ // CHECK: [[P:%[a-z0-9]+]] = bitcast i8* [[I]] to double*
+ // CHECK: [[IN:%[a-z0-9]+]] = getelementptr i8* [[I]], i32 8
+ // CHECK: store i8* [[IN]], i8** [[AP]]
+ // CHECK: [[V1:%[a-z0-9]+]] = load double* [[P]]
+ // CHECK: store double [[V1]], double* [[V:%[a-z0-9]+]], align 4
+ // CHECK: [[V2:%[a-z0-9]+]] = bitcast double* [[V]] to i8*
+ // CHECK: call void @f(i8* [[V2]])
+}
+
+void testbuiltin (void) {
+ // CHECK-LABEL: testbuiltin
+ // CHECK: call i32 @llvm.xcore.getid()
+ // CHECK: call i32 @llvm.xcore.getps(i32 {{%[a-z0-9]+}})
+ // CHECK: call i32 @llvm.xcore.bitrev(i32 {{%[a-z0-9]+}})
+ // CHECK: call void @llvm.xcore.setps(i32 {{%[a-z0-9]+}}, i32 {{%[a-z0-9]+}})
+ int i = __builtin_getid();
+ unsigned int ui = __builtin_getps(i);
+ ui = __builtin_bitrev(ui);
+ __builtin_setps(i,ui);
+}
+
+// CHECK-LABEL: define zeroext i8 @testchar()
+// CHECK: ret i8 -1
+char testchar (void) {
+ return (char)-1;
+}
+
+// CHECK: "no-frame-pointer-elim"="false"
+// CHECK-NOT: "no-frame-pointer-elim-non-leaf"
diff --git a/test/CodeGenCUDA/address-spaces.cu b/test/CodeGenCUDA/address-spaces.cu
index 9df7e3f4d262..04344526f40e 100644
--- a/test/CodeGenCUDA/address-spaces.cu
+++ b/test/CodeGenCUDA/address-spaces.cu
@@ -12,13 +12,13 @@ __constant__ int j;
__shared__ int k;
__device__ void foo() {
- // CHECK: load i32* bitcast (i32 addrspace(1)* @i to i32*)
+ // CHECK: load i32* addrspacecast (i32 addrspace(1)* @i to i32*)
i++;
- // CHECK: load i32* bitcast (i32 addrspace(4)* @j to i32*)
+ // CHECK: load i32* addrspacecast (i32 addrspace(4)* @j to i32*)
j++;
- // CHECK: load i32* bitcast (i32 addrspace(3)* @k to i32*)
+ // CHECK: load i32* addrspacecast (i32 addrspace(3)* @k to i32*)
k++;
static int li;
diff --git a/test/CodeGenCUDA/ptx-kernels.cu b/test/CodeGenCUDA/ptx-kernels.cu
index 8d34f4f3a654..211692fcc7c0 100644
--- a/test/CodeGenCUDA/ptx-kernels.cu
+++ b/test/CodeGenCUDA/ptx-kernels.cu
@@ -2,11 +2,11 @@
#include "../SemaCUDA/cuda.h"
-// CHECK: define void @device_function
+// CHECK-LABEL: define void @device_function
extern "C"
__device__ void device_function() {}
-// CHECK: define void @global_function
+// CHECK-LABEL: define void @global_function
extern "C"
__global__ void global_function() {
// CHECK: call void @device_function
diff --git a/test/CodeGenCXX/2004-11-27-FriendDefaultArgCrash.cpp b/test/CodeGenCXX/2004-11-27-FriendDefaultArgCrash.cpp
index 3bfecd54b780..c478e7dcae1d 100644
--- a/test/CodeGenCXX/2004-11-27-FriendDefaultArgCrash.cpp
+++ b/test/CodeGenCXX/2004-11-27-FriendDefaultArgCrash.cpp
@@ -4,6 +4,6 @@
namespace nm {
struct str {
- friend int foo(int arg = 0);
+ friend void foo(int arg = 0) {};
};
}
diff --git a/test/CodeGenCXX/2005-02-14-BitFieldOffset.cpp b/test/CodeGenCXX/2005-02-14-BitFieldOffset.cpp
deleted file mode 100644
index c37f5dce32b2..000000000000
--- a/test/CodeGenCXX/2005-02-14-BitFieldOffset.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
-
-// CHECK-NOT: i32 6
-struct QVectorTypedData {
- int size;
- unsigned int sharable : 1;
- unsigned short array[1];
-};
-
-void foo(QVectorTypedData *X) {
- X->array[0] = 123;
-}
diff --git a/test/CodeGenCXX/2007-05-03-VectorInit.cpp b/test/CodeGenCXX/2007-05-03-VectorInit.cpp
index 5bc196f30fe2..b22b52a26615 100644
--- a/test/CodeGenCXX/2007-05-03-VectorInit.cpp
+++ b/test/CodeGenCXX/2007-05-03-VectorInit.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -O0 -o -
+// RUN: %clang_cc1 -emit-llvm %s -o -
// PR1378
typedef float v4sf __attribute__((vector_size(16)));
diff --git a/test/CodeGenCXX/2010-05-10-Var-DbgInfo.cpp b/test/CodeGenCXX/2010-05-10-Var-DbgInfo.cpp
index 7c05535b3587..802f4c3d67f7 100644
--- a/test/CodeGenCXX/2010-05-10-Var-DbgInfo.cpp
+++ b/test/CodeGenCXX/2010-05-10-Var-DbgInfo.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -O0 -g %s -o /dev/null
+// RUN: %clang_cc1 -emit-llvm -g %s -o /dev/null
// PR 7104
struct A {
diff --git a/test/CodeGenCXX/DynArrayInit.cpp b/test/CodeGenCXX/DynArrayInit.cpp
index 4b4c2ecf1d3e..fb865e35af4e 100644
--- a/test/CodeGenCXX/DynArrayInit.cpp
+++ b/test/CodeGenCXX/DynArrayInit.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -O3 -emit-llvm -o - %s | FileCheck %s
// PR7490
-// CHECK: define signext i8 @_Z2f0v
+// CHECK-LABEL: define signext i8 @_Z2f0v
// CHECK: ret i8 0
// CHECK: }
inline void* operator new[](unsigned long, void* __p) { return __p; }
diff --git a/test/CodeGenCXX/PR5050-constructor-conversion.cpp b/test/CodeGenCXX/PR5050-constructor-conversion.cpp
index c50dafbbab20..a1b05ebc70b1 100644
--- a/test/CodeGenCXX/PR5050-constructor-conversion.cpp
+++ b/test/CodeGenCXX/PR5050-constructor-conversion.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
struct A { A(const A&, int i1 = 1); };
diff --git a/test/CodeGenCXX/aarch64-mangle-neon-vectors.cpp b/test/CodeGenCXX/aarch64-mangle-neon-vectors.cpp
new file mode 100644
index 000000000000..2514704f1d88
--- /dev/null
+++ b/test/CodeGenCXX/aarch64-mangle-neon-vectors.cpp
@@ -0,0 +1,85 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon %s -emit-llvm -o - | FileCheck %s
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef signed char int8_t;
+typedef signed short int16_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+typedef unsigned char poly8_t;
+typedef unsigned short poly16_t;
+typedef __fp16 float16_t;
+typedef float float32_t;
+typedef double float64_t;
+
+typedef __attribute__((neon_vector_type(8))) int8_t int8x8_t;
+typedef __attribute__((neon_vector_type(16))) int8_t int8x16_t;
+typedef __attribute__((neon_vector_type(4))) int16_t int16x4_t;
+typedef __attribute__((neon_vector_type(8))) int16_t int16x8_t;
+typedef __attribute__((neon_vector_type(2))) int int32x2_t;
+typedef __attribute__((neon_vector_type(4))) int int32x4_t;
+typedef __attribute__((neon_vector_type(2))) int64_t int64x2_t;
+typedef __attribute__((neon_vector_type(8))) uint8_t uint8x8_t;
+typedef __attribute__((neon_vector_type(16))) uint8_t uint8x16_t;
+typedef __attribute__((neon_vector_type(4))) uint16_t uint16x4_t;
+typedef __attribute__((neon_vector_type(8))) uint16_t uint16x8_t;
+typedef __attribute__((neon_vector_type(2))) unsigned int uint32x2_t;
+typedef __attribute__((neon_vector_type(4))) unsigned int uint32x4_t;
+typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t;
+typedef __attribute__((neon_vector_type(4))) float16_t float16x4_t;
+typedef __attribute__((neon_vector_type(8))) float16_t float16x8_t;
+typedef __attribute__((neon_vector_type(2))) float32_t float32x2_t;
+typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t;
+typedef __attribute__((neon_vector_type(2))) float64_t float64x2_t;
+typedef __attribute__((neon_polyvector_type(8))) poly8_t poly8x8_t;
+typedef __attribute__((neon_polyvector_type(16))) poly8_t poly8x16_t;
+typedef __attribute__((neon_polyvector_type(4))) poly16_t poly16x4_t;
+typedef __attribute__((neon_polyvector_type(8))) poly16_t poly16x8_t;
+
+// CHECK: 10__Int8x8_t
+void f1(int8x8_t) {}
+// CHECK: 11__Int16x4_t
+void f2(int16x4_t) {}
+// CHECK: 11__Int32x2_t
+void f3(int32x2_t) {}
+// CHECK: 11__Uint8x8_t
+void f4(uint8x8_t) {}
+// CHECK: 12__Uint16x4_t
+void f5(uint16x4_t) {}
+// CHECK: 13__Float16x4_t
+void f6(float16x4_t) {}
+// CHECK: 13__Float16x8_t
+void f7(float16x8_t) {}
+// CHECK: 12__Uint32x2_t
+void f8(uint32x2_t) {}
+// CHECK: 13__Float32x2_t
+void f9(float32x2_t) {}
+// CHECK: 13__Float32x4_t
+void f10(float32x4_t) {}
+// CHECK: 11__Poly8x8_t
+void f11(poly8x8_t v) {}
+// CHECK: 12__Poly16x4_t
+void f12(poly16x4_t v) {}
+// CHECK:12__Poly8x16_t
+void f13(poly8x16_t v) {}
+// CHECK:12__Poly16x8_t
+void f14(poly16x8_t v) {}
+// CHECK: 11__Int8x16_t
+void f15(int8x16_t) {}
+// CHECK: 11__Int16x8_t
+void f16(int16x8_t) {}
+// CHECK:11__Int32x4_t
+void f17(int32x4_t) {}
+// CHECK: 12__Uint8x16_t
+void f18(uint8x16_t) {}
+// CHECK: 12__Uint16x8_t
+void f19(uint16x8_t) {}
+// CHECK: 12__Uint32x4_t
+void f20(uint32x4_t) {}
+// CHECK: 11__Int64x2_t
+void f21(int64x2_t) {}
+// CHECK: 12__Uint64x2_t
+void f22(uint64x2_t) {}
+// CHECK: 13__Float64x2_t
+void f23(float64x2_t) {}
diff --git a/test/CodeGenCXX/aarch64-neon.cpp b/test/CodeGenCXX/aarch64-neon.cpp
new file mode 100644
index 000000000000..5d2a00bebe73
--- /dev/null
+++ b/test/CodeGenCXX/aarch64-neon.cpp
@@ -0,0 +1,13 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
+// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
+
+// Test whether arm_neon.h can be used in .cpp file.
+
+#include "arm_neon.h"
+
+poly64x1_t test_vld1_p64(poly64_t const * ptr) {
+ // CHECK: test_vld1_p64
+ return vld1_p64(ptr);
+ // CHECK: ld1 {{{v[0-9]+}}.1d}, [{{x[0-9]+|sp}}]
+}
diff --git a/test/CodeGenCXX/abstract-class-ctors-dtors.cpp b/test/CodeGenCXX/abstract-class-ctors-dtors.cpp
index 012c2231551d..793bbde05021 100644
--- a/test/CodeGenCXX/abstract-class-ctors-dtors.cpp
+++ b/test/CodeGenCXX/abstract-class-ctors-dtors.cpp
@@ -7,10 +7,10 @@ struct A {
~A();
};
-// CHECK-NOT: define void @_ZN1AC1Ev
-// CHECK: define void @_ZN1AC2Ev
-// CHECK: define void @_ZN1AD1Ev
-// CHECK: define void @_ZN1AD2Ev
+// CHECK-NOT-LABEL: define void @_ZN1AC1Ev
+// CHECK-LABEL: define void @_ZN1AC2Ev
+// CHECK-LABEL: define void @_ZN1AD1Ev
+// CHECK-LABEL: define void @_ZN1AD2Ev
A::A() { }
A::~A() { }
diff --git a/test/CodeGenCXX/address-of-fntemplate.cpp b/test/CodeGenCXX/address-of-fntemplate.cpp
index 162c6e5754f3..71794520f0a0 100644
--- a/test/CodeGenCXX/address-of-fntemplate.cpp
+++ b/test/CodeGenCXX/address-of-fntemplate.cpp
@@ -9,8 +9,8 @@ void test() {
// CHECK: @_Z1fIiEvv
void (*p2)() = f<int>;
}
-// CHECK: define linkonce_odr void @_Z1fIiEvT_
-// CHECK: define linkonce_odr void @_Z1fIiEvv
+// CHECK-LABEL: define linkonce_odr void @_Z1fIiEvT_
+// CHECK-LABEL: define linkonce_odr void @_Z1fIiEvv
namespace PR6973 {
template<typename T>
diff --git a/test/CodeGenCXX/alloca-align.cpp b/test/CodeGenCXX/alloca-align.cpp
index 99d6ab5845f2..079b55d2b03a 100644
--- a/test/CodeGenCXX/alloca-align.cpp
+++ b/test/CodeGenCXX/alloca-align.cpp
@@ -6,19 +6,19 @@ struct s0 {
int TheStores __attribute__((aligned(16)));
};
-// CHECK: define void @f0
+// CHECK-LABEL: define void @f0
// CHECK: alloca %struct.s0, align 16
extern "C" void f0() {
(void) s0();
}
-// CHECK: define void @f1
+// CHECK-LABEL: define void @f1
// CHECK: alloca %struct.s0, align 16
extern "C" void f1() {
(void) (struct s0) { 0, 0, 0, 0 };
}
-// CHECK: define i32 @f2
+// CHECK-LABEL: define i32 @f2
// CHECK: alloca %struct.s1, align 2
struct s1 { short x; short y; };
extern "C" struct s1 f2(int a, struct s1 *x, struct s1 *y) {
diff --git a/test/CodeGenCXX/anonymous-namespaces.cpp b/test/CodeGenCXX/anonymous-namespaces.cpp
index 32e17a35ff2d..abc700fef6c2 100644
--- a/test/CodeGenCXX/anonymous-namespaces.cpp
+++ b/test/CodeGenCXX/anonymous-namespaces.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin10 -emit-llvm %s -o - > %t
-// RUN: FileCheck %s -check-prefix=1 < %t
-// RUN: FileCheck %s -check-prefix=2 < %t
+// RUN: FileCheck %s -check-prefix=CHECK-1 < %t
+// RUN: FileCheck %s -check-prefix=CHECK-2 < %t
int f();
@@ -28,12 +28,12 @@ namespace {
struct E : public virtual EBase { virtual ~E() {} };
};
- // CHECK-1: define internal i32 @_ZN12_GLOBAL__N_13fooEv()
+ // CHECK-1-LABEL: define internal i32 @_ZN12_GLOBAL__N_13fooEv()
int foo() {
return 32;
}
- // CHECK-1: define internal i32 @_ZN12_GLOBAL__N_11A3fooEv()
+ // CHECK-1-LABEL: define internal i32 @_ZN12_GLOBAL__N_11A3fooEv()
namespace A {
int foo() {
return 45;
@@ -58,11 +58,20 @@ namespace test2 {
struct C;
}
- // CHECK-2: define void @_ZN5test24testEv()
+ // CHECK-2-LABEL: define void @_ZN5test24testEv()
// CHECK-2: call void @_ZN5test21A1BINS_12_GLOBAL__N_11CEE3fooEv()
void test() {
A::B<C>::foo();
}
- // CHECK-2: define internal void @_ZN5test21A1BINS_12_GLOBAL__N_11CEE3fooEv()
+ // CHECK-2-LABEL: define internal void @_ZN5test21A1BINS_12_GLOBAL__N_11CEE3fooEv()
}
+
+namespace {
+
+int bar() {
+ extern int a;
+ return a;
+}
+
+} // namespace
diff --git a/test/CodeGenCXX/anonymous-union-member-initializer.cpp b/test/CodeGenCXX/anonymous-union-member-initializer.cpp
index 8dc4f4721dd0..98e982ddf695 100644
--- a/test/CodeGenCXX/anonymous-union-member-initializer.cpp
+++ b/test/CodeGenCXX/anonymous-union-member-initializer.cpp
@@ -31,7 +31,7 @@ namespace PR7021 {
union { long l; };
};
- // CHECK: define void @_ZN6PR70211fENS_1XES0_
+ // CHECK-LABEL: define void @_ZN6PR70211fENS_1XES0_
void f(X x, X z) {
X x1;
@@ -61,7 +61,7 @@ namespace test2 {
};
A::A() : b(10) { }
- // CHECK: define void @_ZN5test21AC2Ev(
+ // CHECK-LABEL: define void @_ZN5test21AC2Ev(
// CHECK-NOT: }
// CHECK: store i32 10
// CHECK: }
@@ -79,14 +79,14 @@ namespace PR10512 {
};
};
- // CHECK: define void @_ZN7PR105121AC2Ev
+ // CHECK-LABEL: define void @_ZN7PR105121AC2Ev
// CHECK: [[THISADDR:%[a-zA-z0-9.]+]] = alloca [[A:%"struct[A-Za-z0-9:.]+"]]
// CHECK-NEXT: store [[A]]* [[THIS:%[a-zA-z0-9.]+]], [[A]]** [[THISADDR]]
// CHECK-NEXT: [[THIS1:%[a-zA-z0-9.]+]] = load [[A]]** [[THISADDR]]
// CHECK-NEXT: ret void
A::A() {}
- // CHECK: define void @_ZN7PR105121AC2Ei
+ // CHECK-LABEL: define void @_ZN7PR105121AC2Ei
// CHECK: [[THISADDR:%[a-zA-z0-9.]+]] = alloca [[A:%"struct[A-Za-z0-9:.]+"]]
// CHECK-NEXT: [[XADDR:%[a-zA-z0-9.]+]] = alloca i32
// CHECK-NEXT: store [[A]]* [[THIS:%[a-zA-z0-9.]+]], [[A]]** [[THISADDR]]
@@ -100,7 +100,7 @@ namespace PR10512 {
// CHECK-NEXT: ret void
A::A(int x) : x(x) { }
- // CHECK: define void @_ZN7PR105121AC2El
+ // CHECK-LABEL: define void @_ZN7PR105121AC2El
// CHECK: [[THISADDR:%[a-zA-z0-9.]+]] = alloca [[A:%"struct[A-Za-z0-9:.]+"]]
// CHECK-NEXT: [[XADDR:%[a-zA-z0-9.]+]] = alloca i64
// CHECK-NEXT: store [[A]]* [[THIS:%[a-zA-z0-9.]+]], [[A]]** [[THISADDR]]
@@ -130,7 +130,7 @@ namespace test3 {
};
A::A() : callback(0), callback_value(0) {}
- // CHECK: define void @_ZN5test31AC2Ev(
+ // CHECK-LABEL: define void @_ZN5test31AC2Ev(
// CHECK: [[THIS:%.*]] = load
// CHECK-NEXT: [[UNION:%.*]] = getelementptr inbounds {{.*}} [[THIS]], i32 0, i32 0
// CHECK-NEXT: [[STRUCT:%.*]] = bitcast {{.*}}* [[UNION]] to
diff --git a/test/CodeGenCXX/apple-kext-indirect-virtual-dtor-call.cpp b/test/CodeGenCXX/apple-kext-indirect-virtual-dtor-call.cpp
index bd275f1c4da2..7ac5b5839e8c 100644
--- a/test/CodeGenCXX/apple-kext-indirect-virtual-dtor-call.cpp
+++ b/test/CodeGenCXX/apple-kext-indirect-virtual-dtor-call.cpp
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fapple-kext -fno-rtti -emit-llvm -o - %s | FileCheck %s
-// CHECK: define void @_ZN2B1D0Ev
+// CHECK-LABEL: define void @_ZN2B1D0Ev
// CHECK: [[T1:%.*]] = load void (%struct.B1*)** getelementptr inbounds (void (%struct.B1*)** bitcast ([5 x i8*]* @_ZTV2B1 to void (%struct.B1*)**), i64 2)
// CHECK-NEXT: call void [[T1]](%struct.B1* [[T2:%.*]])
-// CHECK: define void @_Z6DELETEP2B1
+// CHECK-LABEL: define void @_Z6DELETEP2B1
// CHECK: [[T3:%.*]] = load void (%struct.B1*)** getelementptr inbounds (void (%struct.B1*)** bitcast ([5 x i8*]* @_ZTV2B1 to void (%struct.B1*)**), i64 2)
// CHECK-NEXT: call void [[T3]](%struct.B1* [[T4:%.*]])
diff --git a/test/CodeGenCXX/apple-kext-linkage.C b/test/CodeGenCXX/apple-kext-linkage.C
index 59d228e2300c..e66b0389fcc3 100644
--- a/test/CodeGenCXX/apple-kext-linkage.C
+++ b/test/CodeGenCXX/apple-kext-linkage.C
@@ -13,21 +13,21 @@ void foo() {
Derived d1; // ok
}
-// CHECK: define internal i32 @_Z1fj(
+// CHECK-LABEL: define internal i32 @_Z1fj(
inline unsigned f(unsigned n) { return n == 0 ? 0 : n + f(n-1); }
unsigned g(unsigned n) { return f(n); }
// rdar://problem/10133200: give explicit instantiations external linkage in kernel mode
-// CHECK: define void @_Z3barIiEvv()
+// CHECK-LABEL: define void @_Z3barIiEvv()
template <typename T> void bar() {}
template void bar<int>();
-// CHECK: define internal i32 @_Z5identIiET_S0_(
+// CHECK-LABEL: define internal i32 @_Z5identIiET_S0_(
template <typename X> X ident(X x) { return x; }
int foo(int n) { return ident(n); }
-// CHECK: define internal void @_ZN7DerivedD1Ev(
-// CHECK: define internal void @_ZN7DerivedD0Ev(
-// CHECK: define internal void @_ZN7DeriveddlEPv(
+// CHECK-LABEL: define internal void @_ZN7DerivedD1Ev(
+// CHECK-LABEL: define internal void @_ZN7DerivedD0Ev(
+// CHECK-LABEL: define internal void @_ZN7DeriveddlEPv(
diff --git a/test/CodeGenCXX/arm-vaarg.cpp b/test/CodeGenCXX/arm-vaarg.cpp
new file mode 100644
index 000000000000..9850fb342faf
--- /dev/null
+++ b/test/CodeGenCXX/arm-vaarg.cpp
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -triple armv7-apple-ios -emit-llvm -o - %s | FileCheck %s
+struct Empty {};
+
+Empty emptyvar;
+
+int take_args(int a, ...) {
+ __builtin_va_list l;
+ __builtin_va_start(l, a);
+// CHECK: call void @llvm.va_start
+
+ emptyvar = __builtin_va_arg(l, Empty);
+// CHECK: load i8**
+// CHECK-NOT: getelementptr
+// CHECK: [[EMPTY_PTR:%[a-zA-Z0-9._]+]] = bitcast i8* {{%[a-zA-Z0-9._]+}} to %struct.Empty*
+
+ // It's conceivable that EMPTY_PTR may not actually be a valid pointer
+ // (e.g. it's at the very bottom of the stack and the next page is
+ // invalid). This doesn't matter provided it's never loaded (there's no
+ // well-defined way to tell), but it becomes a problem if we do try to use it.
+// CHECK-NOT: load %struct.Empty* [[EMPTY_PTR]]
+
+ int i = __builtin_va_arg(l, int);
+// CHECK: load i32*
+
+ __builtin_va_end(l);
+ return i;
+}
diff --git a/test/CodeGenCXX/arm.cpp b/test/CodeGenCXX/arm.cpp
index 48f2f0084015..2fb9c49bb707 100644
--- a/test/CodeGenCXX/arm.cpp
+++ b/test/CodeGenCXX/arm.cpp
@@ -28,7 +28,7 @@ bar baz;
// CHECK: call [[BAR:%.*]]* @_ZN3barC1Ev(
// CHECK-NEXT: call i32 @atexit(void ()* @__dtor_baz)
-// CHECK: define internal void @__dtor_baz()
+// CHECK-LABEL: define internal void @__dtor_baz()
// CHECK: call [[BAR]]* @_ZN3barD1Ev([[BAR]]* @baz)
// Destructors and constructors must return this.
@@ -41,7 +41,7 @@ namespace test1 {
void bar() { foo(); }
};
- // CHECK: define void @_ZN5test14testEv()
+ // CHECK-LABEL: define void @_ZN5test14testEv()
void test() {
// CHECK: [[AV:%.*]] = alloca [[A:%.*]], align 1
// CHECK: call [[A]]* @_ZN5test11AC1Ei([[A]]* [[AV]], i32 10)
@@ -52,19 +52,19 @@ namespace test1 {
a.bar();
}
- // CHECK: define linkonce_odr [[A]]* @_ZN5test11AC1Ei([[A]]* %this, i32 %i) unnamed_addr
+ // CHECK: define linkonce_odr [[A]]* @_ZN5test11AC1Ei([[A]]* returned %this, i32 %i) unnamed_addr
// CHECK: [[THIS:%.*]] = alloca [[A]]*, align 4
// CHECK: store [[A]]* {{.*}}, [[A]]** [[THIS]]
// CHECK: [[THIS1:%.*]] = load [[A]]** [[THIS]]
- // CHECK: [[THIS2:%.*]] = call [[A]]* @_ZN5test11AC2Ei(
- // CHECK: ret [[A]]* [[THIS2]]
+ // CHECK: {{%.*}} = call [[A]]* @_ZN5test11AC2Ei(
+ // CHECK: ret [[A]]* [[THIS1]]
- // CHECK: define linkonce_odr [[A]]* @_ZN5test11AD1Ev([[A]]* %this) unnamed_addr
+ // CHECK: define linkonce_odr [[A]]* @_ZN5test11AD1Ev([[A]]* returned %this) unnamed_addr
// CHECK: [[THIS:%.*]] = alloca [[A]]*, align 4
// CHECK: store [[A]]* {{.*}}, [[A]]** [[THIS]]
// CHECK: [[THIS1:%.*]] = load [[A]]** [[THIS]]
- // CHECK: [[THIS2:%.*]] = call [[A]]* @_ZN5test11AD2Ev(
- // CHECK: ret [[A]]* [[THIS2]]
+ // CHECK: {{%.*}} = call [[A]]* @_ZN5test11AD2Ev(
+ // CHECK: ret [[A]]* [[THIS1]]
}
// Awkward virtual cases.
@@ -107,7 +107,7 @@ namespace test3 {
};
void a() {
- // CHECK: define void @_ZN5test31aEv()
+ // CHECK-LABEL: define void @_ZN5test31aEv()
// CHECK: call noalias i8* @_Znam(i32 48)
// CHECK: store i32 4
// CHECK: store i32 10
@@ -115,7 +115,7 @@ namespace test3 {
}
void b(int n) {
- // CHECK: define void @_ZN5test31bEi(
+ // CHECK-LABEL: define void @_ZN5test31bEi(
// CHECK: [[N:%.*]] = load i32*
// CHECK: @llvm.umul.with.overflow.i32(i32 [[N]], i32 4)
// CHECK: @llvm.uadd.with.overflow.i32(i32 {{.*}}, i32 8)
@@ -128,7 +128,7 @@ namespace test3 {
}
void c() {
- // CHECK: define void @_ZN5test31cEv()
+ // CHECK-LABEL: define void @_ZN5test31cEv()
// CHECK: call noalias i8* @_Znam(i32 808)
// CHECK: store i32 4
// CHECK: store i32 200
@@ -136,7 +136,7 @@ namespace test3 {
}
void d(int n) {
- // CHECK: define void @_ZN5test31dEi(
+ // CHECK-LABEL: define void @_ZN5test31dEi(
// CHECK: [[N:%.*]] = load i32*
// CHECK: @llvm.umul.with.overflow.i32(i32 [[N]], i32 80)
// CHECK: [[NE:%.*]] = mul i32 [[N]], 20
@@ -149,7 +149,7 @@ namespace test3 {
}
void e(A *x) {
- // CHECK: define void @_ZN5test31eEPNS_1AE(
+ // CHECK-LABEL: define void @_ZN5test31eEPNS_1AE(
// CHECK: icmp eq {{.*}}, null
// CHECK: getelementptr {{.*}}, i64 -8
// CHECK: getelementptr {{.*}}, i64 4
@@ -161,7 +161,7 @@ namespace test3 {
}
void f(A (*x)[20]) {
- // CHECK: define void @_ZN5test31fEPA20_NS_1AE(
+ // CHECK-LABEL: define void @_ZN5test31fEPA20_NS_1AE(
// CHECK: icmp eq {{.*}}, null
// CHECK: getelementptr {{.*}}, i64 -8
// CHECK: getelementptr {{.*}}, i64 4
@@ -180,7 +180,7 @@ namespace test4 {
};
void a() {
- // CHECK: define void @_ZN5test41aEv()
+ // CHECK-LABEL: define void @_ZN5test41aEv()
// CHECK: call noalias i8* @_Znam(i32 48)
// CHECK: store i32 4
// CHECK: store i32 10
@@ -188,7 +188,7 @@ namespace test4 {
}
void b(int n) {
- // CHECK: define void @_ZN5test41bEi(
+ // CHECK-LABEL: define void @_ZN5test41bEi(
// CHECK: [[N:%.*]] = load i32*
// CHECK: @llvm.umul.with.overflow.i32(i32 [[N]], i32 4)
// CHECK: @llvm.uadd.with.overflow.i32(i32 {{.*}}, i32 8)
@@ -200,7 +200,7 @@ namespace test4 {
}
void c() {
- // CHECK: define void @_ZN5test41cEv()
+ // CHECK-LABEL: define void @_ZN5test41cEv()
// CHECK: call noalias i8* @_Znam(i32 808)
// CHECK: store i32 4
// CHECK: store i32 200
@@ -208,7 +208,7 @@ namespace test4 {
}
void d(int n) {
- // CHECK: define void @_ZN5test41dEi(
+ // CHECK-LABEL: define void @_ZN5test41dEi(
// CHECK: [[N:%.*]] = load i32*
// CHECK: @llvm.umul.with.overflow.i32(i32 [[N]], i32 80)
// CHECK: [[NE:%.*]] = mul i32 [[N]], 20
@@ -221,7 +221,7 @@ namespace test4 {
}
void e(A *x) {
- // CHECK: define void @_ZN5test41eEPNS_1AE(
+ // CHECK-LABEL: define void @_ZN5test41eEPNS_1AE(
// CHECK: [[ALLOC:%.*]] = getelementptr inbounds {{.*}}, i64 -8
// CHECK: getelementptr inbounds {{.*}}, i64 4
// CHECK: bitcast
@@ -233,7 +233,7 @@ namespace test4 {
}
void f(A (*x)[20]) {
- // CHECK: define void @_ZN5test41fEPA20_NS_1AE(
+ // CHECK-LABEL: define void @_ZN5test41fEPA20_NS_1AE(
// CHECK: [[ALLOC:%.*]] = getelementptr inbounds {{.*}}, i64 -8
// CHECK: getelementptr inbounds {{.*}}, i64 4
// CHECK: bitcast
@@ -251,7 +251,7 @@ namespace test5 {
~A();
};
- // CHECK: define void @_ZN5test54testEPNS_1AE
+ // CHECK-LABEL: define void @_ZN5test54testEPNS_1AE
void test(A *a) {
// CHECK: [[PTR:%.*]] = alloca [[A:%.*]]*, align 4
// CHECK-NEXT: store [[A]]* {{.*}}, [[A]]** [[PTR]], align 4
@@ -267,7 +267,7 @@ namespace test6 {
virtual ~A();
};
- // CHECK: define void @_ZN5test64testEPNS_1AE
+ // CHECK-LABEL: define void @_ZN5test64testEPNS_1AE
void test(A *a) {
// CHECK: [[AVAR:%.*]] = alloca [[A:%.*]]*, align 4
// CHECK-NEXT: store [[A]]* {{.*}}, [[A]]** [[AVAR]], align 4
@@ -290,7 +290,7 @@ namespace test7 {
// Static and guard tested at top of file
- // CHECK: define void @_ZN5test74testEv()
+ // CHECK-LABEL: define void @_ZN5test74testEv()
void test() {
// CHECK: [[T0:%.*]] = load i32* @_ZGVZN5test74testEvE1x
// CHECK-NEXT: [[T1:%.*]] = and i32 [[T0]], 1
@@ -325,7 +325,7 @@ namespace test8 {
// Static and guard tested at top of file
- // CHECK: define void @_ZN5test84testEv()
+ // CHECK-LABEL: define void @_ZN5test84testEv()
void test() {
// CHECK: [[T0:%.*]] = load i32* @_ZGVZN5test84testEvE1x
// CHECK-NEXT: [[T1:%.*]] = and i32 [[T0]], 1
@@ -394,7 +394,7 @@ namespace test9 {
void testDelete(A *array) {
delete[] array;
}
-// CHECK: define void @_ZN5test910testDeleteEPNS_1AE(
+// CHECK-LABEL: define void @_ZN5test910testDeleteEPNS_1AE(
// CHECK: [[BEGIN:%.*]] = load [[TEST9]]**
// CHECK-NEXT: [[T0:%.*]] = icmp eq [[TEST9]]* [[BEGIN]], null
// CHECK-NEXT: br i1 [[T0]],
@@ -413,7 +413,7 @@ namespace test9 {
// CHECK: call [[C]]* @_ZN5test21CD1Ev(
// CHECK: ret [[C]]* undef
- // CHECK: define linkonce_odr void @_ZTv0_n12_N5test21CD0Ev(
+ // CHECK-LABEL: define linkonce_odr void @_ZTv0_n12_N5test21CD0Ev(
// CHECK: call void @_ZN5test21CD0Ev(
// CHECK: ret void
diff --git a/test/CodeGenCXX/array-construction.cpp b/test/CodeGenCXX/array-construction.cpp
index 7b565a490c11..645ad1d787df 100644
--- a/test/CodeGenCXX/array-construction.cpp
+++ b/test/CodeGenCXX/array-construction.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-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
index 1b23c4d137aa..8d6f50fdfab1 100644
--- a/test/CodeGenCXX/array-operator-delete-call.cpp
+++ b/test/CodeGenCXX/array-operator-delete-call.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/atomic.cpp b/test/CodeGenCXX/atomic.cpp
index 36bb4ef5608e..653f16d26309 100644
--- a/test/CodeGenCXX/atomic.cpp
+++ b/test/CodeGenCXX/atomic.cpp
@@ -5,7 +5,7 @@ namespace PR11411 {
void f();
};
- // CHECK: define linkonce_odr void @_ZN7PR114113PtrIiE1fEv
+ // CHECK-LABEL: define linkonce_odr void @_ZN7PR114113PtrIiE1fEv
// CHECK-NOT: ret
template<typename _Tp> inline void Ptr<_Tp>::f() {
int* _refcount;
diff --git a/test/CodeGenCXX/atomicinit.cpp b/test/CodeGenCXX/atomicinit.cpp
index 38d012e6a9a1..ee2e9e4cf244 100644
--- a/test/CodeGenCXX/atomicinit.cpp
+++ b/test/CodeGenCXX/atomicinit.cpp
@@ -18,7 +18,7 @@ struct B {
_Atomic(B) b;
-// CHECK: define void @_Z11atomic_initR1Ai
+// CHECK-LABEL: define void @_Z11atomic_initR1Ai
void atomic_init(A& a, int i) {
// CHECK-NOT: atomic
// CHECK: tail call void @_ZN1BC1Ei
@@ -26,7 +26,7 @@ void atomic_init(A& a, int i) {
// CHECK-NEXT: ret void
}
-// CHECK: define void @_Z16atomic_init_boolPU7_Atomicbb
+// CHECK-LABEL: define void @_Z16atomic_init_boolPU7_Atomicbb
void atomic_init_bool(_Atomic(bool) *ab, bool b) {
// CHECK-NOT: atomic
// CHECK: {{zext i1.*to i8}}
@@ -40,7 +40,7 @@ struct AtomicBoolMember {
AtomicBoolMember(bool b);
};
-// CHECK: define void @_ZN16AtomicBoolMemberC2Eb
+// CHECK-LABEL: define void @_ZN16AtomicBoolMemberC2Eb
// CHECK: {{zext i1.*to i8}}
// CHECK-NEXT: store i8
// CHECK-NEXT: ret void
diff --git a/test/CodeGenCXX/attr-cleanup.cpp b/test/CodeGenCXX/attr-cleanup.cpp
new file mode 100644
index 000000000000..ff15b03de57c
--- /dev/null
+++ b/test/CodeGenCXX/attr-cleanup.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+
+namespace N {
+ void free(void *i) {}
+}
+
+int main(void) {
+ // CHECK: call void @_ZN1N4freeEPv
+ void *fp __attribute__((cleanup(N::free)));
+ return 0;
+}
diff --git a/test/CodeGenCXX/attr.cpp b/test/CodeGenCXX/attr.cpp
index 4748cda8cc47..8bcff363c723 100644
--- a/test/CodeGenCXX/attr.cpp
+++ b/test/CodeGenCXX/attr.cpp
@@ -26,7 +26,7 @@ void C::bar3() { }
void C::bar4() { }
// PR6635
-// CHECK: define i32 @_Z5test1v()
+// CHECK-LABEL: define i32 @_Z5test1v()
int test1() { return 10; }
// CHECK at top of file
extern "C" int test2() __attribute__((alias("_Z5test1v")));
diff --git a/test/CodeGenCXX/bitfield-layout.cpp b/test/CodeGenCXX/bitfield-layout.cpp
index 15f33d27658d..646300a7d1cb 100644
--- a/test/CodeGenCXX/bitfield-layout.cpp
+++ b/test/CodeGenCXX/bitfield-layout.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -O3 | FileCheck -check-prefix LP64 %s
-// RUN: %clang_cc1 %s -triple=i386-apple-darwin10 -emit-llvm -o - -O3 | FileCheck -check-prefix LP32 %s
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -O3 | FileCheck -check-prefix CHECK-LP64 %s
+// RUN: %clang_cc1 %s -triple=i386-apple-darwin10 -emit-llvm -o - -O3 | FileCheck -check-prefix CHECK-LP32 %s
// CHECK-LP64: %union.Test1 = type { i32, [4 x i8] }
union Test1 {
diff --git a/test/CodeGenCXX/bitfield.cpp b/test/CodeGenCXX/bitfield.cpp
index 1814aa2d534c..2c454b0c072c 100644
--- a/test/CodeGenCXX/bitfield.cpp
+++ b/test/CodeGenCXX/bitfield.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -verify -emit-llvm -o - %s \
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s \
// RUN: | FileCheck -check-prefix=CHECK-X86-64 %s
-// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -verify -emit-llvm -o - %s \
+// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -emit-llvm -o - %s \
// RUN: | FileCheck -check-prefix=CHECK-PPC64 %s
//
// Tests for bitfield access patterns in C++ with special attention to
@@ -20,13 +20,13 @@ namespace N0 {
unsigned b71 : 2;
};
unsigned read00(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N06read00
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N06read00
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-X86-64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-X86-64: %[[and:.*]] = and i64 %[[val]], 16383
// CHECK-X86-64: %[[trunc:.*]] = trunc i64 %[[and]] to i32
// CHECK-X86-64: ret i32 %[[trunc]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N06read00
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N06read00
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-PPC64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i64 %[[val]], 50
@@ -35,14 +35,14 @@ namespace N0 {
return s->b00;
}
unsigned read01(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N06read01
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N06read01
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-X86-64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-X86-64: %[[shr:.*]] = lshr i64 %[[val]], 14
// CHECK-X86-64: %[[and:.*]] = and i64 %[[shr]], 3
// CHECK-X86-64: %[[trunc:.*]] = trunc i64 %[[and]] to i32
// CHECK-X86-64: ret i32 %[[trunc]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N06read01
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N06read01
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-PPC64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i64 %[[val]], 48
@@ -52,14 +52,14 @@ namespace N0 {
return s->b01;
}
unsigned read20(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N06read20
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N06read20
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-X86-64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-X86-64: %[[shr:.*]] = lshr i64 %[[val]], 16
// CHECK-X86-64: %[[and:.*]] = and i64 %[[shr]], 63
// CHECK-X86-64: %[[trunc:.*]] = trunc i64 %[[and]] to i32
// CHECK-X86-64: ret i32 %[[trunc]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N06read20
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N06read20
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-PPC64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i64 %[[val]], 42
@@ -69,14 +69,14 @@ namespace N0 {
return s->b20;
}
unsigned read21(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N06read21
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N06read21
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-X86-64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-X86-64: %[[shr:.*]] = lshr i64 %[[val]], 22
// CHECK-X86-64: %[[and:.*]] = and i64 %[[shr]], 3
// CHECK-X86-64: %[[trunc:.*]] = trunc i64 %[[and]] to i32
// CHECK-X86-64: ret i32 %[[trunc]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N06read21
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N06read21
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-PPC64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i64 %[[val]], 40
@@ -86,14 +86,14 @@ namespace N0 {
return s->b21;
}
unsigned read30(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N06read30
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N06read30
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-X86-64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-X86-64: %[[shr:.*]] = lshr i64 %[[val]], 24
// CHECK-X86-64: %[[and:.*]] = and i64 %[[shr]], 1073741823
// CHECK-X86-64: %[[trunc:.*]] = trunc i64 %[[and]] to i32
// CHECK-X86-64: ret i32 %[[trunc]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N06read30
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N06read30
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-PPC64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i64 %[[val]], 10
@@ -103,14 +103,14 @@ namespace N0 {
return s->b30;
}
unsigned read31(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N06read31
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N06read31
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-X86-64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-X86-64: %[[shr:.*]] = lshr i64 %[[val]], 54
// CHECK-X86-64: %[[and:.*]] = and i64 %[[shr]], 3
// CHECK-X86-64: %[[trunc:.*]] = trunc i64 %[[and]] to i32
// CHECK-X86-64: ret i32 %[[trunc]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N06read31
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N06read31
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-PPC64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i64 %[[val]], 8
@@ -120,14 +120,14 @@ namespace N0 {
return s->b31;
}
unsigned read70(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N06read70
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N06read70
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-X86-64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-X86-64: %[[shr:.*]] = lshr i64 %[[val]], 56
// CHECK-X86-64: %[[and:.*]] = and i64 %[[shr]], 63
// CHECK-X86-64: %[[trunc:.*]] = trunc i64 %[[and]] to i32
// CHECK-X86-64: ret i32 %[[trunc]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N06read70
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N06read70
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-PPC64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i64 %[[val]], 2
@@ -137,13 +137,13 @@ namespace N0 {
return s->b70;
}
unsigned read71(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N06read71
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N06read71
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-X86-64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-X86-64: %[[shr:.*]] = lshr i64 %[[val]], 62
// CHECK-X86-64: %[[trunc:.*]] = trunc i64 %[[shr]] to i32
// CHECK-X86-64: ret i32 %[[trunc]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N06read71
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N06read71
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i64*
// CHECK-PPC64: %[[val:.*]] = load i64* %[[ptr]]
// CHECK-PPC64: %[[and:.*]] = and i64 %[[val]], 3
@@ -166,13 +166,13 @@ namespace N1 {
char c;
};
unsigned read(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N14read
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N14read
// CHECK-X86-64: %[[ptr:.*]] = getelementptr inbounds %{{.*}}* %{{.*}}, i32 0, i32 1
// CHECK-X86-64: %[[val:.*]] = load i8* %[[ptr]]
// CHECK-X86-64: %[[and:.*]] = and i8 %[[val]], 1
// CHECK-X86-64: %[[ext:.*]] = zext i8 %[[and]] to i32
// CHECK-X86-64: ret i32 %[[ext]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N14read
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N14read
// CHECK-PPC64: %[[ptr:.*]] = getelementptr inbounds %{{.*}}* %{{.*}}, i32 0, i32 1
// CHECK-PPC64: %[[val:.*]] = load i8* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i8 %[[val]], 7
@@ -181,7 +181,7 @@ namespace N1 {
return s->b;
}
void write(S* s, unsigned x) {
- // CHECK-X86-64: define void @_ZN2N15write
+ // CHECK-X86-64-LABEL: define void @_ZN2N15write
// CHECK-X86-64: %[[ptr:.*]] = getelementptr inbounds %{{.*}}* %{{.*}}, i32 0, i32 1
// CHECK-X86-64: %[[x_trunc:.*]] = trunc i32 %{{.*}} to i8
// CHECK-X86-64: %[[old:.*]] = load i8* %[[ptr]]
@@ -189,7 +189,7 @@ namespace N1 {
// CHECK-X86-64: %[[old_and:.*]] = and i8 %[[old]], -2
// CHECK-X86-64: %[[new:.*]] = or i8 %[[old_and]], %[[x_and]]
// CHECK-X86-64: store i8 %[[new]], i8* %[[ptr]]
- // CHECK-PPC64: define void @_ZN2N15write
+ // CHECK-PPC64-LABEL: define void @_ZN2N15write
// CHECK-PPC64: %[[ptr:.*]] = getelementptr inbounds %{{.*}}* %{{.*}}, i32 0, i32 1
// CHECK-PPC64: %[[x_trunc:.*]] = trunc i32 %{{.*}} to i8
// CHECK-PPC64: %[[old:.*]] = load i8* %[[ptr]]
@@ -210,12 +210,12 @@ namespace N2 {
void *p;
};
unsigned read(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N24read
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N24read
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-X86-64: %[[val:.*]] = load i32* %[[ptr]]
// CHECK-X86-64: %[[and:.*]] = and i32 %[[val]], 16777215
// CHECK-X86-64: ret i32 %[[and]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N24read
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N24read
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-PPC64: %[[val:.*]] = load i32* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i32 %[[val]], 8
@@ -223,14 +223,14 @@ namespace N2 {
return s->b;
}
void write(S* s, unsigned x) {
- // CHECK-X86-64: define void @_ZN2N25write
+ // CHECK-X86-64-LABEL: define void @_ZN2N25write
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-X86-64: %[[old:.*]] = load i32* %[[ptr]]
// CHECK-X86-64: %[[x_and:.*]] = and i32 %{{.*}}, 16777215
// CHECK-X86-64: %[[old_and:.*]] = and i32 %[[old]], -16777216
// CHECK-X86-64: %[[new:.*]] = or i32 %[[old_and]], %[[x_and]]
// CHECK-X86-64: store i32 %[[new]], i32* %[[ptr]]
- // CHECK-PPC64: define void @_ZN2N25write
+ // CHECK-PPC64-LABEL: define void @_ZN2N25write
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-PPC64: %[[old:.*]] = load i32* %[[ptr]]
// CHECK-PPC64: %[[x_and:.*]] = and i32 %{{.*}}, 16777215
@@ -249,12 +249,12 @@ namespace N3 {
unsigned b : 24;
};
unsigned read(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N34read
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N34read
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-X86-64: %[[val:.*]] = load i32* %[[ptr]]
// CHECK-X86-64: %[[and:.*]] = and i32 %[[val]], 16777215
// CHECK-X86-64: ret i32 %[[and]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N34read
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N34read
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-PPC64: %[[val:.*]] = load i32* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i32 %[[val]], 8
@@ -262,14 +262,14 @@ namespace N3 {
return s->b;
}
void write(S* s, unsigned x) {
- // CHECK-X86-64: define void @_ZN2N35write
+ // CHECK-X86-64-LABEL: define void @_ZN2N35write
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-X86-64: %[[old:.*]] = load i32* %[[ptr]]
// CHECK-X86-64: %[[x_and:.*]] = and i32 %{{.*}}, 16777215
// CHECK-X86-64: %[[old_and:.*]] = and i32 %[[old]], -16777216
// CHECK-X86-64: %[[new:.*]] = or i32 %[[old_and]], %[[x_and]]
// CHECK-X86-64: store i32 %[[new]], i32* %[[ptr]]
- // CHECK-PPC64: define void @_ZN2N35write
+ // CHECK-PPC64-LABEL: define void @_ZN2N35write
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-PPC64: %[[old:.*]] = load i32* %[[ptr]]
// CHECK-PPC64: %[[x_and:.*]] = and i32 %{{.*}}, 16777215
@@ -300,13 +300,13 @@ namespace N4 {
// FIXME: We should widen this load as long as the function isn't being
// instrumented by thread-sanitizer.
//
- // CHECK-X86-64: define i32 @_ZN2N44read
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N44read
// CHECK-X86-64: %[[gep:.*]] = getelementptr inbounds {{.*}}* %{{.*}}, i32 0, i32 1
// CHECK-X86-64: %[[ptr:.*]] = bitcast [3 x i8]* %[[gep]] to i24*
// CHECK-X86-64: %[[val:.*]] = load i24* %[[ptr]]
// CHECK-X86-64: %[[ext:.*]] = zext i24 %[[val]] to i32
// CHECK-X86-64: ret i32 %[[ext]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N44read
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N44read
// CHECK-PPC64: %[[gep:.*]] = getelementptr inbounds {{.*}}* %{{.*}}, i32 0, i32 1
// CHECK-PPC64: %[[ptr:.*]] = bitcast [3 x i8]* %[[gep]] to i24*
// CHECK-PPC64: %[[val:.*]] = load i24* %[[ptr]]
@@ -315,12 +315,12 @@ namespace N4 {
return s->b;
}
void write(Base* s, unsigned x) {
- // CHECK-X86-64: define void @_ZN2N45write
+ // CHECK-X86-64-LABEL: define void @_ZN2N45write
// CHECK-X86-64: %[[gep:.*]] = getelementptr inbounds {{.*}}* %{{.*}}, i32 0, i32 1
// CHECK-X86-64: %[[ptr:.*]] = bitcast [3 x i8]* %[[gep]] to i24*
// CHECK-X86-64: %[[new:.*]] = trunc i32 %{{.*}} to i24
// CHECK-X86-64: store i24 %[[new]], i24* %[[ptr]]
- // CHECK-PPC64: define void @_ZN2N45write
+ // CHECK-PPC64-LABEL: define void @_ZN2N45write
// CHECK-PPC64: %[[gep:.*]] = getelementptr inbounds {{.*}}* %{{.*}}, i32 0, i32 1
// CHECK-PPC64: %[[ptr:.*]] = bitcast [3 x i8]* %[[gep]] to i24*
// CHECK-PPC64: %[[new:.*]] = trunc i32 %{{.*}} to i24
@@ -342,12 +342,12 @@ namespace N5 {
struct Y { unsigned b : 24; } y;
};
unsigned read(U* u) {
- // CHECK-X86-64: define i32 @_ZN2N54read
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N54read
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-X86-64: %[[val:.*]] = load i32* %[[ptr]]
// CHECK-X86-64: %[[and:.*]] = and i32 %[[val]], 16777215
// CHECK-X86-64: ret i32 %[[and]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N54read
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N54read
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-PPC64: %[[val:.*]] = load i32* %[[ptr]]
// CHECK-PPC64: %[[shr:.*]] = lshr i32 %[[val]], 8
@@ -355,14 +355,14 @@ namespace N5 {
return u->y.b;
}
void write(U* u, unsigned x) {
- // CHECK-X86-64: define void @_ZN2N55write
+ // CHECK-X86-64-LABEL: define void @_ZN2N55write
// CHECK-X86-64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-X86-64: %[[old:.*]] = load i32* %[[ptr]]
// CHECK-X86-64: %[[x_and:.*]] = and i32 %{{.*}}, 16777215
// CHECK-X86-64: %[[old_and:.*]] = and i32 %[[old]], -16777216
// CHECK-X86-64: %[[new:.*]] = or i32 %[[old_and]], %[[x_and]]
// CHECK-X86-64: store i32 %[[new]], i32* %[[ptr]]
- // CHECK-PPC64: define void @_ZN2N55write
+ // CHECK-PPC64-LABEL: define void @_ZN2N55write
// CHECK-PPC64: %[[ptr:.*]] = bitcast %{{.*}}* %{{.*}} to i32*
// CHECK-PPC64: %[[old:.*]] = load i32* %[[ptr]]
// CHECK-PPC64: %[[x_and:.*]] = and i32 %{{.*}}, 16777215
@@ -387,7 +387,7 @@ namespace N6 {
unsigned char b2 : 8;
};
unsigned read(S* s) {
- // CHECK-X86-64: define i32 @_ZN2N64read
+ // CHECK-X86-64-LABEL: define i32 @_ZN2N64read
// CHECK-X86-64: %[[ptr1:.*]] = bitcast {{.*}}* %{{.*}} to i24*
// CHECK-X86-64: %[[val1:.*]] = load i24* %[[ptr1]]
// CHECK-X86-64: %[[ext1:.*]] = zext i24 %[[val1]] to i32
@@ -396,7 +396,7 @@ namespace N6 {
// CHECK-X86-64: %[[ext2:.*]] = zext i8 %[[val2]] to i32
// CHECK-X86-64: %[[add:.*]] = add nsw i32 %[[ext1]], %[[ext2]]
// CHECK-X86-64: ret i32 %[[add]]
- // CHECK-PPC64: define zeroext i32 @_ZN2N64read
+ // CHECK-PPC64-LABEL: define zeroext i32 @_ZN2N64read
// CHECK-PPC64: %[[ptr1:.*]] = bitcast {{.*}}* %{{.*}} to i24*
// CHECK-PPC64: %[[val1:.*]] = load i24* %[[ptr1]]
// CHECK-PPC64: %[[ext1:.*]] = zext i24 %[[val1]] to i32
@@ -408,14 +408,14 @@ namespace N6 {
return s->b1 + s->b2;
}
void write(S* s, unsigned x) {
- // CHECK-X86-64: define void @_ZN2N65write
+ // CHECK-X86-64-LABEL: define void @_ZN2N65write
// CHECK-X86-64: %[[ptr1:.*]] = bitcast {{.*}}* %{{.*}} to i24*
// CHECK-X86-64: %[[new1:.*]] = trunc i32 %{{.*}} to i24
// CHECK-X86-64: store i24 %[[new1]], i24* %[[ptr1]]
// CHECK-X86-64: %[[new2:.*]] = trunc i32 %{{.*}} to i8
// CHECK-X86-64: %[[ptr2:.*]] = getelementptr inbounds {{.*}}* %{{.*}}, i32 0, i32 1
// CHECK-X86-64: store i8 %[[new2]], i8* %[[ptr2]]
- // CHECK-PPC64: define void @_ZN2N65write
+ // CHECK-PPC64-LABEL: define void @_ZN2N65write
// CHECK-PPC64: %[[ptr1:.*]] = bitcast {{.*}}* %{{.*}} to i24*
// CHECK-PPC64: %[[new1:.*]] = trunc i32 %{{.*}} to i24
// CHECK-PPC64: store i24 %[[new1]], i24* %[[ptr1]]
diff --git a/test/CodeGenCXX/block-byref-cxx-objc.cpp b/test/CodeGenCXX/block-byref-cxx-objc.cpp
index 30f1f074b9b3..616fd67ccc38 100644
--- a/test/CodeGenCXX/block-byref-cxx-objc.cpp
+++ b/test/CodeGenCXX/block-byref-cxx-objc.cpp
@@ -15,13 +15,13 @@ int main()
return 0;
}
-// CHECK: define internal void @__Block_byref_object_copy_
+// CHECK-LABEL: define internal void @__Block_byref_object_copy_
// CHECK: call {{.*}} @_ZN1AC1ERKS_
-// CHECK: define internal void @__Block_byref_object_dispose_
+// CHECK-LABEL: define internal void @__Block_byref_object_dispose_
// CHECK: call {{.*}} @_ZN1AD1Ev
-// CHECK: define internal void @__copy_helper_block_
+// CHECK-LABEL: define internal void @__copy_helper_block_
// CHECK: call void @_Block_object_assign
-// CHECK: define internal void @__destroy_helper_block_
+// CHECK-LABEL: define internal void @__destroy_helper_block_
// CHECK: call void @_Block_object_dispose
// rdar://problem/11135650
diff --git a/test/CodeGenCXX/block-in-ctor-dtor.cpp b/test/CodeGenCXX/block-in-ctor-dtor.cpp
index 4ee6b1c10eb1..bd37d4418d4f 100644
--- a/test/CodeGenCXX/block-in-ctor-dtor.cpp
+++ b/test/CodeGenCXX/block-in-ctor-dtor.cpp
@@ -36,13 +36,13 @@ X::~X() {
};
-// CHECK: define internal void @___ZN4ZoneC2Ev_block_invoke
-// CHECK: define internal void @___ZN4ZoneC2Ev_block_invoke_
-// CHECK: define internal void @___ZN4ZoneD2Ev_block_invoke
-// CHECK: define internal void @___ZN4ZoneD2Ev_block_invoke_
-// CHECK: define internal void @___ZN1XC1Ev_block_invoke
-// CHECK: define internal void @___ZN1XC1Ev_block_invoke_
-// CHECK: define internal void @___ZN1XC2Ev_block_invoke
-// CHECK: define internal void @___ZN1XC2Ev_block_invoke_
-// CHECK: define internal void @___ZN1XD2Ev_block_invoke
-// CHECK: define internal void @___ZN1XD2Ev_block_invoke_
+// CHECK-LABEL: define internal void @___ZN4ZoneC2Ev_block_invoke
+// CHECK-LABEL: define internal void @___ZN4ZoneC2Ev_block_invoke_
+// CHECK-LABEL: define internal void @___ZN4ZoneD2Ev_block_invoke
+// CHECK-LABEL: define internal void @___ZN4ZoneD2Ev_block_invoke_
+// CHECK-LABEL: define internal void @___ZN1XC1Ev_block_invoke
+// CHECK-LABEL: define internal void @___ZN1XC1Ev_block_invoke_
+// CHECK-LABEL: define internal void @___ZN1XC2Ev_block_invoke
+// CHECK-LABEL: define internal void @___ZN1XC2Ev_block_invoke_
+// CHECK-LABEL: define internal void @___ZN1XD2Ev_block_invoke
+// CHECK-LABEL: define internal void @___ZN1XD2Ev_block_invoke_
diff --git a/test/CodeGenCXX/blocks-cxx11.cpp b/test/CodeGenCXX/blocks-cxx11.cpp
index 3f0380abbd37..9ff5826ec5f1 100644
--- a/test/CodeGenCXX/blocks-cxx11.cpp
+++ b/test/CodeGenCXX/blocks-cxx11.cpp
@@ -46,7 +46,7 @@ namespace test_complex_int {
void test() {
constexpr _Complex int x = 500;
takeABlock(^{ takeItByValue(x); });
- // CHECK: store i32 500,
+ // CHECK: store { i32, i32 } { i32 500, i32 0 },
// CHECK: store i32 500,
// CHECK-NEXT: store i32 0,
@@ -100,7 +100,7 @@ namespace test_block_in_lambda {
};
lambda(); // make sure we emit the invocation function
}
- // CHECK: define internal void @"_ZZN20test_block_in_lambda4testENS_1AEENK3$_0clEv"(
+ // CHECK-LABEL: define internal void @"_ZZN20test_block_in_lambda4testENS_1AEENK3$_0clEv"(
// CHECK: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], align 8
// CHECK: [[THIS:%.*]] = load [[LAMBDA_T:%.*]]**
// CHECK: [[TO_DESTROY:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5
diff --git a/test/CodeGenCXX/blocks.cpp b/test/CodeGenCXX/blocks.cpp
index 81eef0e02822..8a6fdacf8d1f 100644
--- a/test/CodeGenCXX/blocks.cpp
+++ b/test/CodeGenCXX/blocks.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 %s -fblocks -triple x86_64-apple-darwin -emit-llvm -o - | FileCheck %s
namespace test0 {
- // CHECK: define void @_ZN5test04testEi(
+ // CHECK-LABEL: define void @_ZN5test04testEi(
// CHECK: define internal void @___ZN5test04testEi_block_invoke{{.*}}(
// CHECK: define internal void @___ZN5test04testEi_block_invoke_2{{.*}}(
void test(int x) {
@@ -13,7 +13,7 @@ extern void (^out)();
namespace test1 {
// Capturing const objects doesn't require a local block.
- // CHECK: define void @_ZN5test15test1Ev()
+ // CHECK-LABEL: define void @_ZN5test15test1Ev()
// CHECK: store void ()* bitcast ({{.*}} @__block_literal_global{{.*}} to void ()*), void ()** @out
void test1() {
const int NumHorsemen = 4;
@@ -21,7 +21,7 @@ namespace test1 {
}
// That applies to structs too...
- // CHECK: define void @_ZN5test15test2Ev()
+ // CHECK-LABEL: define void @_ZN5test15test2Ev()
// CHECK: store void ()* bitcast ({{.*}} @__block_literal_global{{.*}} to void ()*), void ()** @out
struct loc { double x, y; };
void test2() {
@@ -30,7 +30,7 @@ namespace test1 {
}
// ...unless they have mutable fields...
- // CHECK: define void @_ZN5test15test3Ev()
+ // CHECK-LABEL: define void @_ZN5test15test3Ev()
// CHECK: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to void ()*
// CHECK: store void ()* [[T0]], void ()** @out
@@ -41,7 +41,7 @@ namespace test1 {
}
// ...or non-trivial destructors...
- // CHECK: define void @_ZN5test15test4Ev()
+ // CHECK-LABEL: define void @_ZN5test15test4Ev()
// CHECK: [[OBJ:%.*]] = alloca
// CHECK: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to void ()*
@@ -69,22 +69,22 @@ namespace test2 {
~B();
};
- // CHECK: define void @_ZN5test24testEv()
+ // CHECK-LABEL: define void @_ZN5test24testEv()
void test() {
__block A a;
__block B b;
}
- // CHECK: define internal void @__Block_byref_object_copy
+ // CHECK-LABEL: define internal void @__Block_byref_object_copy
// CHECK: call void @_ZN5test21AC1ERKS0_(
- // CHECK: define internal void @__Block_byref_object_dispose
+ // CHECK-LABEL: define internal void @__Block_byref_object_dispose
// CHECK: call void @_ZN5test21AD1Ev(
- // CHECK: define internal void @__Block_byref_object_copy
+ // CHECK-LABEL: define internal void @__Block_byref_object_copy
// CHECK: call void @_ZN5test21BC1ERKS0_(
- // CHECK: define internal void @__Block_byref_object_dispose
+ // CHECK-LABEL: define internal void @__Block_byref_object_dispose
// CHECK: call void @_ZN5test21BD1Ev(
}
@@ -118,8 +118,8 @@ namespace test4 {
extern void consume(void(^)());
consume(^{ return foo(A()); });
}
- // CHECK: define void @_ZN5test44testEv()
- // CHECK: define internal void @___ZN5test44testEv_block_invoke
+ // CHECK-LABEL: define void @_ZN5test44testEv()
+ // CHECK-LABEL: define internal void @___ZN5test44testEv_block_invoke
// CHECK: [[TMP:%.*]] = alloca [[A:%.*]], align 1
// CHECK-NEXT: store i8* [[BLOCKDESC:%.*]], i8** {{.*}}, align 8
// CHECK-NEXT: load i8*
@@ -147,7 +147,7 @@ namespace test5 {
doWithBlock(b);
}
- // CHECK: define void @_ZN5test54testEb(
+ // CHECK-LABEL: define void @_ZN5test54testEb(
// CHECK: [[COND:%.*]] = alloca i8
// CHECK-NEXT: [[X:%.*]] = alloca [[A:%.*]], align 4
// CHECK-NEXT: [[B:%.*]] = alloca void ()*, align 8
@@ -197,7 +197,7 @@ namespace test6 {
bar();
}
- // CHECK: define void @_ZN5test64testEv()
+ // CHECK-LABEL: define void @_ZN5test64testEv()
// CHECK: [[TEMP:%.*]] = alloca [[A:%.*]], align 1
// CHECK-NEXT: call void @_ZN5test61AC1Ev([[A]]* [[TEMP]])
// CHECK-NEXT: call void @_ZN5test63fooERKNS_1AEU13block_pointerFvvE(
diff --git a/test/CodeGenCXX/bool-bitfield.cpp b/test/CodeGenCXX/bool-bitfield.cpp
index 06bdf2bd0df3..a5a344ffb6ee 100644
--- a/test/CodeGenCXX/bool-bitfield.cpp
+++ b/test/CodeGenCXX/bool-bitfield.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -verify -emit-llvm -o - %s \
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s \
// RUN: | FileCheck %s
// PR14638; make sure this doesn't crash.
@@ -9,6 +9,6 @@ void func1(bool b, A& a1)
{
if ((a1.m_sorted = b)) {}
}
-// CHECK: define void @_Z5func1bR1A
+// CHECK-LABEL: define void @_Z5func1bR1A
// CHECK: br i1
// CHECK: ret void
diff --git a/test/CodeGenCXX/builtins.cpp b/test/CodeGenCXX/builtins.cpp
index c9b0bff0f2e2..98e2d1a8271c 100644
--- a/test/CodeGenCXX/builtins.cpp
+++ b/test/CodeGenCXX/builtins.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple=x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
// PR8839
extern "C" char memmove();
@@ -7,3 +7,22 @@ int main() {
// CHECK: call {{signext i8|i8}} @memmove()
return memmove();
}
+
+struct S;
+// CHECK: define {{.*}} @_Z9addressofbR1SS0_(
+S *addressof(bool b, S &s, S &t) {
+ // CHECK: %[[LVALUE:.*]] = phi
+ // CHECK: ret {{.*}}* %[[LVALUE]]
+ return __builtin_addressof(b ? s : t);
+}
+
+extern "C" int __builtin_abs(int); // #1
+long __builtin_abs(long); // #2
+extern "C" int __builtin_abs(int); // #3
+
+int x = __builtin_abs(-2);
+// CHECK: store i32 2, i32* @x, align 4
+
+long y = __builtin_abs(-2l);
+// CHECK: [[Y:%.+]] = call i64 @_Z13__builtin_absl(i64 -2)
+// CHECK: store i64 [[Y]], i64* @y, align 8
diff --git a/test/CodeGenCXX/c-linkage.cpp b/test/CodeGenCXX/c-linkage.cpp
index f6e64d9e7415..1607623c6fea 100644
--- a/test/CodeGenCXX/c-linkage.cpp
+++ b/test/CodeGenCXX/c-linkage.cpp
@@ -10,15 +10,15 @@ extern "C" {
}
}
-// CHECK: define void @_ZN1N1X1fEv
+// CHECK-LABEL: define void @_ZN1N1X1fEv
extern "C" {
static void test2_f() {
}
- // CHECK: define internal void @_Z7test2_fv
+ // CHECK-LABEL: define internal void @_Z7test2_fv
static void test2_f(int x) {
}
- // CHECK: define internal void @_Z7test2_fi
+ // CHECK-LABEL: define internal void @_Z7test2_fi
void test2_use() {
test2_f();
test2_f(42);
diff --git a/test/CodeGenCXX/c99-variable-length-array.cpp b/test/CodeGenCXX/c99-variable-length-array.cpp
index d486f9b01826..2cd8e114b1ec 100644
--- a/test/CodeGenCXX/c99-variable-length-array.cpp
+++ b/test/CodeGenCXX/c99-variable-length-array.cpp
@@ -9,7 +9,7 @@ struct Y {
~Y();
};
-// CHECK: define void @_Z1fiPPKc(
+// CHECK-LABEL: define void @_Z1fiPPKc(
void f(int argc, const char* argv[]) {
// CHECK: call void @_ZN1XC1Ev
X x;
diff --git a/test/CodeGenCXX/call-arg-zero-temp.cpp b/test/CodeGenCXX/call-arg-zero-temp.cpp
index 101e81f8ef79..14238f214515 100644
--- a/test/CodeGenCXX/call-arg-zero-temp.cpp
+++ b/test/CodeGenCXX/call-arg-zero-temp.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/captured-statements.cpp b/test/CodeGenCXX/captured-statements.cpp
new file mode 100644
index 000000000000..2843c2b69c95
--- /dev/null
+++ b/test/CodeGenCXX/captured-statements.cpp
@@ -0,0 +1,189 @@
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o %t
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-1
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-2
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-3
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-4
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-5
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-6
+// RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-7
+
+struct Foo {
+ int x;
+ float y;
+ ~Foo() {}
+};
+
+struct TestClass {
+ int x;
+
+ TestClass() : x(0) {};
+ void MemberFunc() {
+ Foo f;
+ #pragma clang __debug captured
+ {
+ f.y = x;
+ }
+ }
+};
+
+void test1() {
+ TestClass c;
+ c.MemberFunc();
+ // CHECK-1: %[[Capture:struct\.anon[\.0-9]*]] = type { %struct.Foo*, %struct.TestClass* }
+
+ // CHECK-1: define {{.*}} void @_ZN9TestClass10MemberFuncEv
+ // CHECK-1: alloca %struct.anon
+ // CHECK-1: getelementptr inbounds %[[Capture]]* %{{[^,]*}}, i32 0, i32 0
+ // CHECK-1: store %struct.Foo* %f, %struct.Foo**
+ // CHECK-1: getelementptr inbounds %[[Capture]]* %{{[^,]*}}, i32 0, i32 1
+ // CHECK-1: call void @[[HelperName:[A-Za-z0-9_]+]](%[[Capture]]*
+ // CHECK-1: call {{.*}}FooD1Ev
+ // CHECK-1: ret
+}
+
+// CHECK-1: define internal void @[[HelperName]]
+// CHECK-1: getelementptr inbounds %[[Capture]]* {{[^,]*}}, i32 0, i32 1
+// CHECK-1: getelementptr inbounds %struct.TestClass* {{[^,]*}}, i32 0, i32 0
+// CHECK-1: getelementptr inbounds %[[Capture]]* {{[^,]*}}, i32 0, i32 0
+
+void test2(int x) {
+ int y = [&]() {
+ #pragma clang __debug captured
+ {
+ x++;
+ }
+ return x;
+ }();
+
+ // CHECK-2-LABEL: define void @_Z5test2i
+ // CHECK-2: call {{.*}} @[[Lambda:["$\w]+]]
+ //
+ // CHECK-2: define internal {{.*}} @[[Lambda]]
+ // CHECK-2: call void @[[HelperName:["$_A-Za-z0-9]+]](%[[Capture:.*]]*
+ //
+ // CHECK-2: define internal void @[[HelperName]]
+ // CHECK-2: getelementptr inbounds %[[Capture]]*
+ // CHECK-2: load i32**
+ // CHECK-2: load i32*
+}
+
+void test3(int x) {
+ #pragma clang __debug captured
+ {
+ x = [=]() { return x + 1; } ();
+ }
+
+ // CHECK-3: %[[Capture:struct\.anon[\.0-9]*]] = type { i32* }
+
+ // CHECK-3-LABEL: define void @_Z5test3i
+ // CHECK-3: store i32*
+ // CHECK-3: call void @{{.*}}__captured_stmt
+ // CHECK-3: ret void
+}
+
+void test4() {
+ #pragma clang __debug captured
+ {
+ Foo f;
+ f.x = 5;
+ }
+ // CHECK-4-LABEL: define void @_Z5test4v
+ // CHECK-4: call void @[[HelperName:["$_A-Za-z0-9]+]](%[[Capture:.*]]*
+ // CHECK-4: ret void
+ //
+ // CHECK-4: define internal void @[[HelperName]]
+ // CHECK-4: store i32 5, i32*
+ // CHECK-4: call {{.*}}FooD1Ev
+}
+
+template <typename T, int id>
+void touch(const T &) {}
+
+template <typename T, unsigned id>
+void template_capture_var() {
+ T x;
+ #pragma clang __debug captured
+ {
+ touch<T, id>(x);
+ }
+}
+
+template <typename T, int id>
+class Val {
+ T v;
+public:
+ void set() {
+ #pragma clang __debug captured
+ {
+ touch<T, id>(v);
+ }
+ }
+
+ template <typename U, int id2>
+ void foo(U u) {
+ #pragma clang __debug captured
+ {
+ touch<U, id + id2>(u);
+ }
+ }
+};
+
+void test_capture_var() {
+ // CHECK-5: define {{.*}} void @_Z20template_capture_varIiLj201EEvv
+ // CHECK-5-NOT: }
+ // CHECK-5: store i32*
+ // CHECK-5: call void @__captured_stmt
+ // CHECK-5-NEXT: ret void
+ template_capture_var<int, 201>();
+
+ // CHECK-5: define {{.*}} void @_ZN3ValIfLi202EE3setEv
+ // CHECK-5-NOT: }
+ // CHECK-5: store %class.Val*
+ // CHECK-5: call void @__captured_stmt
+ // CHECK-5-NEXT: ret void
+ Val<float, 202> Obj;
+ Obj.set();
+
+ // CHECK-5: define {{.*}} void @_ZN3ValIfLi202EE3fooIdLi203EEEvT_
+ // CHECK-5-NOT: }
+ // CHECK-5: store %class.Val*
+ // CHECK-5: store double
+ // CHECK-5: call void @__captured_stmt
+ // CHECK-5-NEXT: ret void
+ Obj.foo<double, 203>(1.0);
+}
+
+template <typename T>
+void template_capture_lambda() {
+ T x, y;
+ [=, &y]() {
+ #pragma clang __debug captured
+ {
+ y += x;
+ }
+ }();
+}
+
+void test_capture_lambda() {
+ // CHECK-6: define {{.*}} void @_ZZ23template_capture_lambdaIiEvvENKUlvE_clEv
+ // CHECK-6-NOT: }
+ // CHECK-6: store i32*
+ // CHECK-6: store i32*
+ // CHECK-6: call void @__captured_stmt
+ // CHECK-6-NEXT: ret void
+ template_capture_lambda<int>();
+}
+
+inline int test_captured_linkage() {
+ // CHECK-7: @_ZZ21test_captured_linkagevE1i = linkonce_odr global i32 0
+ int j;
+ #pragma clang __debug captured
+ {
+ static int i = 0;
+ j = ++i;
+ }
+ return j;
+}
+void call_test_captured_linkage() {
+ test_captured_linkage();
+}
diff --git a/test/CodeGenCXX/cast-conversion.cpp b/test/CodeGenCXX/cast-conversion.cpp
index d023b9abfee0..5565f6548437 100644
--- a/test/CodeGenCXX/cast-conversion.cpp
+++ b/test/CodeGenCXX/cast-conversion.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
struct A {
A(int);
diff --git a/test/CodeGenCXX/catch-undef-behavior.cpp b/test/CodeGenCXX/catch-undef-behavior.cpp
index d6d0edfa1edb..338da57f0c7b 100644
--- a/test/CodeGenCXX/catch-undef-behavior.cpp
+++ b/test/CodeGenCXX/catch-undef-behavior.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsanitize=signed-integer-overflow,integer-divide-by-zero,float-divide-by-zero,shift,unreachable,return,vla-bound,alignment,null,vptr,object-size,float-cast-overflow,bool,enum,bounds -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fsanitize=signed-integer-overflow,integer-divide-by-zero,float-divide-by-zero,shift,unreachable,return,vla-bound,alignment,null,vptr,object-size,float-cast-overflow,bool,enum,array-bounds,function -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
struct S {
double d;
@@ -186,7 +186,7 @@ void bad_downcast_pointer(S *p) {
// CHECK: %[[NONNULL:.*]] = icmp ne {{.*}}, null
// CHECK: br i1 %[[NONNULL]],
- // CHECK: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64(
+ // CHECK: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64.p0i8(
// CHECK: %[[E1:.*]] = icmp uge i64 %[[SIZE]], 24
// CHECK: %[[MISALIGN:.*]] = and i64 %{{.*}}, 7
// CHECK: %[[E2:.*]] = icmp eq i64 %[[MISALIGN]], 0
@@ -207,7 +207,7 @@ void bad_downcast_pointer(S *p) {
void bad_downcast_reference(S &p) {
// CHECK: %[[E1:.*]] = icmp ne {{.*}}, null
// CHECK-NOT: br i1
- // CHECK: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64(
+ // CHECK: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64.p0i8(
// CHECK: %[[E2:.*]] = icmp uge i64 %[[SIZE]], 24
// CHECK: %[[E12:.*]] = and i1 %[[E1]], %[[E2]]
// CHECK: %[[MISALIGN:.*]] = and i64 %{{.*}}, 7
@@ -321,4 +321,156 @@ char string_index(int n) {
return "Hello"[n];
}
+class A // align=4
+{
+ int a1, a2, a3;
+};
+
+class B // align=8
+{
+ long b1, b2;
+};
+
+class C : public A, public B // align=16
+{
+ alignas(16) int c1;
+};
+
+// Make sure we check the alignment of the pointer after subtracting any
+// offset. The pointer before subtraction doesn't need to be aligned for
+// the destination type.
+
+// CHECK-LABEL: define void @_Z16downcast_pointerP1B(%class.B* %b)
+void downcast_pointer(B *b) {
+ (void) static_cast<C*>(b);
+ // Alignment check from EmitTypeCheck(TCK_DowncastPointer, ...)
+ // CHECK: [[SUB:%[.a-z0-9]*]] = getelementptr i8* {{.*}}, i64 -16
+ // CHECK-NEXT: [[C:%[0-9]*]] = bitcast i8* [[SUB]] to %class.C*
+ // null check goes here
+ // CHECK: [[FROM_PHI:%[0-9]*]] = phi %class.C* [ [[C]], {{.*}} ], {{.*}}
+ // Objectsize check goes here
+ // CHECK: [[C_INT:%[0-9]*]] = ptrtoint %class.C* [[FROM_PHI]] to i64
+ // CHECK-NEXT: [[MASKED:%[0-9]*]] = and i64 [[C_INT]], 15
+ // CHECK-NEXT: [[TEST:%[0-9]*]] = icmp eq i64 [[MASKED]], 0
+ // AND the alignment test with the objectsize test.
+ // CHECK-NEXT: [[AND:%[0-9]*]] = and i1 {{.*}}, [[TEST]]
+ // CHECK-NEXT: br i1 [[AND]]
+}
+
+// CHECK-LABEL: define void @_Z18downcast_referenceR1B(%class.B* %b)
+void downcast_reference(B &b) {
+ (void) static_cast<C&>(b);
+ // Alignment check from EmitTypeCheck(TCK_DowncastReference, ...)
+ // CHECK: [[SUB:%[.a-z0-9]*]] = getelementptr i8* {{.*}}, i64 -16
+ // CHECK-NEXT: [[C:%[0-9]*]] = bitcast i8* [[SUB]] to %class.C*
+ // Objectsize check goes here
+ // CHECK: [[C_INT:%[0-9]*]] = ptrtoint %class.C* [[C]] to i64
+ // CHECK-NEXT: [[MASKED:%[0-9]*]] = and i64 [[C_INT]], 15
+ // CHECK-NEXT: [[TEST:%[0-9]*]] = icmp eq i64 [[MASKED]], 0
+ // AND the alignment test with the objectsize test.
+ // CHECK-NEXT: [[AND:%[0-9]*]] = and i1 {{.*}}, [[TEST]]
+ // CHECK-NEXT: br i1 [[AND]]
+}
+
+// CHECK-LABEL: @_Z22indirect_function_callPFviE({{.*}} prefix <{ i32, i8* }> <{ i32 1413876459, i8* bitcast ({ i8*, i8* }* @_ZTIFvPFviEE to i8*) }>
+void indirect_function_call(void (*p)(int)) {
+ // CHECK: [[PTR:%[0-9]*]] = bitcast void (i32)* {{.*}} to <{ i32, i8* }>*
+
+ // Signature check
+ // CHECK-NEXT: [[SIGPTR:%[0-9]*]] = getelementptr <{ i32, i8* }>* [[PTR]], i32 0, i32 0
+ // CHECK-NEXT: [[SIG:%[0-9]*]] = load i32* [[SIGPTR]]
+ // CHECK-NEXT: [[SIGCMP:%[0-9]*]] = icmp eq i32 [[SIG]], 1413876459
+ // CHECK-NEXT: br i1 [[SIGCMP]]
+
+ // RTTI pointer check
+ // CHECK: [[RTTIPTR:%[0-9]*]] = getelementptr <{ i32, i8* }>* [[PTR]], i32 0, i32 1
+ // CHECK-NEXT: [[RTTI:%[0-9]*]] = load i8** [[RTTIPTR]]
+ // CHECK-NEXT: [[RTTICMP:%[0-9]*]] = icmp eq i8* [[RTTI]], bitcast ({ i8*, i8* }* @_ZTIFviE to i8*)
+ // CHECK-NEXT: br i1 [[RTTICMP]]
+ p(42);
+}
+
+namespace CopyValueRepresentation {
+ // CHECK-LABEL: define {{.*}} @_ZN23CopyValueRepresentation2S3aSERKS0_
+ // CHECK-NOT: call {{.*}} @__ubsan_handle_load_invalid_value
+ // CHECK-LABEL: define {{.*}} @_ZN23CopyValueRepresentation2S4aSEOS0_
+ // CHECK-NOT: call {{.*}} @__ubsan_handle_load_invalid_value
+ // CHECK-LABEL: define {{.*}} @_ZN23CopyValueRepresentation2S5C2ERKS0_
+ // CHECK-NOT: call {{.*}} __ubsan_handle_load_invalid_value
+ // CHECK-LABEL: define {{.*}} @_ZN23CopyValueRepresentation2S2C2ERKS0_
+ // CHECK: __ubsan_handle_load_invalid_value
+ // CHECK-LABEL: define {{.*}} @_ZN23CopyValueRepresentation2S1C2ERKS0_
+ // CHECK-NOT: call {{.*}} __ubsan_handle_load_invalid_value
+
+ struct CustomCopy { CustomCopy(); CustomCopy(const CustomCopy&); };
+ struct S1 {
+ CustomCopy CC;
+ bool b;
+ };
+ void callee1(S1);
+ void test1() {
+ S1 s11;
+ callee1(s11);
+ S1 s12;
+ s12 = s11;
+ }
+
+ static bool some_global_bool;
+ struct ExprCopy {
+ ExprCopy();
+ ExprCopy(const ExprCopy&, bool b = some_global_bool);
+ };
+ struct S2 {
+ ExprCopy EC;
+ bool b;
+ };
+ void callee2(S2);
+ void test2(void) {
+ S2 s21;
+ callee2(s21);
+ S2 s22;
+ s22 = s21;
+ }
+
+ struct CustomAssign { CustomAssign &operator=(const CustomAssign&); };
+ struct S3 {
+ CustomAssign CA;
+ bool b;
+ };
+ void test3() {
+ S3 x, y;
+ x = y;
+ }
+
+ struct CustomMove {
+ CustomMove();
+ CustomMove(const CustomMove&&);
+ CustomMove &operator=(const CustomMove&&);
+ };
+ struct S4 {
+ CustomMove CM;
+ bool b;
+ };
+ void test4() {
+ S4 x, y;
+ x = static_cast<S4&&>(y);
+ }
+
+ struct EnumCustomCopy {
+ EnumCustomCopy();
+ EnumCustomCopy(const EnumCustomCopy&);
+ };
+ struct S5 {
+ EnumCustomCopy ECC;
+ bool b;
+ };
+ void callee5(S5);
+ void test5() {
+ S5 s51;
+ callee5(s51);
+ S5 s52;
+ s52 = s51;
+ }
+}
+
// CHECK: attributes [[NR_NUW]] = { noreturn nounwind }
diff --git a/test/CodeGenCXX/catch-undef-behavior2.cpp b/test/CodeGenCXX/catch-undef-behavior2.cpp
new file mode 100644
index 000000000000..b8b31ca23f55
--- /dev/null
+++ b/test/CodeGenCXX/catch-undef-behavior2.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -std=c++11 -fsanitize=signed-integer-overflow,integer-divide-by-zero,float-divide-by-zero,shift,unreachable,return,vla-bound,alignment,null,vptr,object-size,float-cast-overflow,bool,enum,array-bounds,function -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
+
+bool GetOptionalBool(bool *value);
+bool GetBool(bool default_value) {
+ // CHECK-LABEL: @_Z7GetBoolb
+ // CHECK-NOT: select
+ bool value;
+ return GetOptionalBool(&value) ? value : default_value;
+}
diff --git a/test/CodeGenCXX/compound-literals.cpp b/test/CodeGenCXX/compound-literals.cpp
index 5df0ea587667..f1d88027c4fa 100644
--- a/test/CodeGenCXX/compound-literals.cpp
+++ b/test/CodeGenCXX/compound-literals.cpp
@@ -12,7 +12,7 @@ struct Y {
X x;
};
-// CHECK: define i32 @_Z1fv()
+// CHECK-LABEL: define i32 @_Z1fv()
int f() {
// CHECK: [[LVALUE:%[a-z0-9.]+]] = alloca
// CHECK-NEXT: [[I:%[a-z0-9]+]] = getelementptr inbounds {{.*}}* [[LVALUE]], i32 0, i32 0
@@ -26,7 +26,7 @@ int f() {
return ((Y){17, "seventeen"}).i;
}
-// CHECK: define i32 @_Z1gv()
+// CHECK-LABEL: define i32 @_Z1gv()
int g() {
// CHECK: store [2 x i32]* %{{[a-z0-9.]+}}, [2 x i32]** [[V:%[a-z0-9.]+]]
const int (&v)[2] = (int [2]) {1,2};
diff --git a/test/CodeGenCXX/condition.cpp b/test/CodeGenCXX/condition.cpp
index cc2eaf5bd6a5..452f1c3c9b7e 100644
--- a/test/CodeGenCXX/condition.cpp
+++ b/test/CodeGenCXX/condition.cpp
@@ -26,7 +26,7 @@ struct Y {
X getX();
-// CHECK: define void @_Z11if_destructi(
+// CHECK-LABEL: define void @_Z11if_destructi(
void if_destruct(int z) {
// Verify that the condition variable is destroyed at the end of the
// "if" statement.
@@ -95,7 +95,7 @@ void switch_destruct(int z) {
int foo();
-// CHECK: define void @_Z14while_destructi
+// CHECK-LABEL: define void @_Z14while_destructi
void while_destruct(int z) {
// CHECK: [[Z:%.*]] = alloca i32
// CHECK: [[CLEANUPDEST:%.*]] = alloca i32
@@ -135,7 +135,7 @@ void while_destruct(int z) {
// CHECK: ret
}
-// CHECK: define void @_Z12for_destructi(
+// CHECK-LABEL: define void @_Z12for_destructi(
void for_destruct(int z) {
// CHECK: [[Z:%.*]] = alloca i32
// CHECK: [[CLEANUPDEST:%.*]] = alloca i32
@@ -224,7 +224,7 @@ void for_destruct(int z) {
}
void do_destruct(int z) {
- // CHECK: define void @_Z11do_destruct
+ // CHECK-LABEL: define void @_Z11do_destruct
do {
// CHECK: store i32 77
z = 77;
diff --git a/test/CodeGenCXX/conditional-gnu-ext.cpp b/test/CodeGenCXX/conditional-gnu-ext.cpp
index 104a91d27356..44ebf9808e4a 100644
--- a/test/CodeGenCXX/conditional-gnu-ext.cpp
+++ b/test/CodeGenCXX/conditional-gnu-ext.cpp
@@ -77,7 +77,7 @@ namespace test3 {
};
B test0(B &x) {
- // CHECK: define void @_ZN5test35test0ERNS_1BE(
+ // CHECK-LABEL: define void @_ZN5test35test0ERNS_1BE(
// CHECK: [[X:%.*]] = alloca [[B:%.*]]*,
// CHECK-NEXT: store [[B]]* {{%.*}}, [[B]]** [[X]]
// CHECK-NEXT: [[T0:%.*]] = load [[B]]** [[X]]
@@ -92,7 +92,7 @@ namespace test3 {
}
B test1() {
- // CHECK: define void @_ZN5test35test1Ev(
+ // CHECK-LABEL: define void @_ZN5test35test1Ev(
// CHECK: [[TEMP:%.*]] = alloca [[B]],
// CHECK-NEXT: call void @_ZN5test312test1_helperEv([[B]]* sret [[TEMP]])
// CHECK-NEXT: [[BOOL:%.*]] = call zeroext i1 @_ZN5test31BcvbEv([[B]]* [[TEMP]])
@@ -109,7 +109,7 @@ namespace test3 {
A test2(B &x) {
- // CHECK: define void @_ZN5test35test2ERNS_1BE(
+ // CHECK-LABEL: define void @_ZN5test35test2ERNS_1BE(
// CHECK: [[X:%.*]] = alloca [[B]]*,
// CHECK-NEXT: store [[B]]* {{%.*}}, [[B]]** [[X]]
// CHECK-NEXT: [[T0:%.*]] = load [[B]]** [[X]]
@@ -124,7 +124,7 @@ namespace test3 {
}
A test3() {
- // CHECK: define void @_ZN5test35test3Ev(
+ // CHECK-LABEL: define void @_ZN5test35test3Ev(
// CHECK: [[TEMP:%.*]] = alloca [[B]],
// CHECK-NEXT: call void @_ZN5test312test3_helperEv([[B]]* sret [[TEMP]])
// CHECK-NEXT: [[BOOL:%.*]] = call zeroext i1 @_ZN5test31BcvbEv([[B]]* [[TEMP]])
diff --git a/test/CodeGenCXX/conditional-temporaries.cpp b/test/CodeGenCXX/conditional-temporaries.cpp
index d5382872f9d9..a3cc2fef1e8f 100644
--- a/test/CodeGenCXX/conditional-temporaries.cpp
+++ b/test/CodeGenCXX/conditional-temporaries.cpp
@@ -36,19 +36,19 @@ Checker c;
}
-// CHECK: define i32 @_Z12getCtorCallsv()
+// CHECK-LABEL: define i32 @_Z12getCtorCallsv()
int getCtorCalls() {
// CHECK: ret i32 5
return ctorcalls;
}
-// CHECK: define i32 @_Z12getDtorCallsv()
+// CHECK-LABEL: define i32 @_Z12getDtorCallsv()
int getDtorCalls() {
// CHECK: ret i32 5
return dtorcalls;
}
-// CHECK: define zeroext i1 @_Z7successv()
+// CHECK-LABEL: define zeroext i1 @_Z7successv()
bool success() {
// CHECK: ret i1 true
return ctorcalls == dtorcalls;
diff --git a/test/CodeGenCXX/const-init-cxx11.cpp b/test/CodeGenCXX/const-init-cxx11.cpp
index 833adba8bae7..d21e91178e40 100644
--- a/test/CodeGenCXX/const-init-cxx11.cpp
+++ b/test/CodeGenCXX/const-init-cxx11.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s -std=c++11 | FileCheck %s
+// RUN: not %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s -std=c++11 | FileCheck %s
// FIXME: The padding in all these objects should be zero-initialized.
namespace StructUnion {
@@ -224,12 +224,50 @@ namespace LiteralReference {
constexpr Lit() : n(5) {}
int n;
};
- // FIXME: This should have static initialization, but we do not implement
- // that yet. For now, just check that we don't set the (pointer) value of
- // the reference to 5!
- //
- // CHECK: @_ZN16LiteralReference3litE = global {{.*}} null
+
+ // This creates a non-const temporary and binds a reference to it.
+ // CHECK: @[[TEMP:.*]] = private global {{.*}} { i32 5 }, align 4
+ // CHECK: @_ZN16LiteralReference3litE = constant {{.*}} @[[TEMP]], align 8
const Lit &lit = Lit();
+
+ // This creates a const temporary as part of the reference initialization.
+ // CHECK: @[[TEMP:.*]] = private constant {{.*}} { i32 5 }, align 4
+ // CHECK: @_ZN16LiteralReference4lit2E = constant {{.*}} @[[TEMP]], align 8
+ const Lit &lit2 = {};
+
+ struct A { int &&r1; const int &&r2; };
+ struct B { A &&a1; const A &&a2; };
+ B b = { { 0, 1 }, { 2, 3 } };
+ // CHECK: @[[TEMP0:.*]] = private global i32 0, align 4
+ // CHECK: @[[TEMP1:.*]] = private constant i32 1, align 4
+ // CHECK: @[[TEMPA1:.*]] = private global {{.*}} { i32* @[[TEMP0]], i32* @[[TEMP1]] }, align 8
+ // CHECK: @[[TEMP2:.*]] = private global i32 2, align 4
+ // CHECK: @[[TEMP3:.*]] = private constant i32 3, align 4
+ // CHECK: @[[TEMPA2:.*]] = private constant {{.*}} { i32* @[[TEMP2]], i32* @[[TEMP3]] }, align 8
+ // CHECK: @_ZN16LiteralReference1bE = global {{.*}} { {{.*}}* @[[TEMPA1]], {{.*}}* @[[TEMPA2]] }, align 8
+
+ struct Subobj {
+ int a, b, c;
+ };
+ // CHECK: @[[TEMP:.*]] = private global {{.*}} { i32 1, i32 2, i32 3 }, align 4
+ // CHECK: @_ZN16LiteralReference2soE = constant {{.*}} (i8* getelementptr {{.*}} @[[TEMP]]{{.*}}, i64 4)
+ constexpr int &&so = Subobj{ 1, 2, 3 }.b;
+
+ struct Dummy { int padding; };
+ struct Derived : Dummy, Subobj {
+ constexpr Derived() : Dummy{200}, Subobj{4, 5, 6} {}
+ };
+ using ConstDerived = const Derived;
+ // CHECK: @[[TEMPCOMMA:.*]] = private constant {{.*}} { i32 200, i32 4, i32 5, i32 6 }
+ // CHECK: @_ZN16LiteralReference5commaE = constant {{.*}} getelementptr {{.*}} @[[TEMPCOMMA]]{{.*}}, i64 8)
+ constexpr const int &comma = (1, (2, ConstDerived{}).b);
+
+ // CHECK: @[[TEMPDERIVED:.*]] = private global {{.*}} { i32 200, i32 4, i32 5, i32 6 }
+ // CHECK: @_ZN16LiteralReference4baseE = constant {{.*}} getelementptr {{.*}} @[[TEMPDERIVED]]{{.*}}, i64 4)
+ constexpr Subobj &&base = Derived{};
+
+ // CHECK: @_ZN16LiteralReference7derivedE = constant {{.*}} @[[TEMPDERIVED]]
+ constexpr Derived &derived = static_cast<Derived&>(base);
}
namespace NonLiteralConstexpr {
@@ -330,6 +368,32 @@ namespace PR13273 {
extern const S s {};
}
+namespace ArrayTemporary {
+ struct A { const int (&x)[3]; };
+ struct B { const A (&x)[2]; };
+ // CHECK: @[[A1:_ZGRN14ArrayTemporary1bE.*]] = private constant [3 x i32] [i32 1, i32 2, i32 3]
+ // CHECK: @[[A2:_ZGRN14ArrayTemporary1bE.*]] = private constant [3 x i32] [i32 4, i32 5, i32 6]
+ // CHECK: @[[ARR:_ZGRN14ArrayTemporary1bE.*]] = private constant [2 x {{.*}}] [{{.*}} { [3 x i32]* @[[A1]] }, {{.*}} { [3 x i32]* @[[A2]] }]
+ // CHECK: @[[B:_ZGRN14ArrayTemporary1bE.*]] = private global {{.*}} { [2 x {{.*}}]* @[[ARR]] }
+ // CHECK: @_ZN14ArrayTemporary1bE = constant {{.*}}* @[[B]]
+ B &&b = { { { { 1, 2, 3 } }, { { 4, 5, 6 } } } };
+}
+
+namespace UnemittedTemporaryDecl {
+ constexpr int &&ref = 0;
+ extern constexpr int &ref2 = ref;
+ // CHECK: @_ZGRN22UnemittedTemporaryDecl3refE = private global i32 0
+
+ // FIXME: This declaration should not be emitted -- it isn't odr-used.
+ // CHECK: @_ZN22UnemittedTemporaryDecl3refE
+
+ // CHECK: @_ZN22UnemittedTemporaryDecl4ref2E = constant i32* @_ZGRN22UnemittedTemporaryDecl3refE
+}
+
+// CHECK: @_ZZN12LocalVarInit3aggEvE1a = internal constant {{.*}} i32 101
+// CHECK: @_ZZN12LocalVarInit4ctorEvE1a = internal constant {{.*}} i32 102
+// CHECK: @_ZZN12LocalVarInit8mutable_EvE1a = private unnamed_addr constant {{.*}} i32 103
+
// Constant initialization tests go before this point,
// dynamic initialization tests go after.
@@ -356,6 +420,40 @@ namespace PR13273 {
// CHECK-NOT: }
// CHECK: call {{.*}}cxa_atexit{{.*}}@_ZN19NonLiteralConstexpr4BothD1Ev
+// PR12848: Don't emit dynamic initializers for local constexpr variables.
+namespace LocalVarInit {
+ constexpr int f(int n) { return n; }
+ struct Agg { int k; };
+ struct Ctor { constexpr Ctor(int n) : k(n) {} int k; };
+ struct Mutable { constexpr Mutable(int n) : k(n) {} mutable int k; };
+
+ // CHECK: define {{.*}} @_ZN12LocalVarInit6scalarEv
+ // CHECK-NOT: call
+ // CHECK: store i32 100,
+ // CHECK-NOT: call
+ // CHECK: ret i32 100
+ int scalar() { constexpr int a = { f(100) }; return a; }
+
+ // CHECK: define {{.*}} @_ZN12LocalVarInit3aggEv
+ // CHECK-NOT: call
+ // CHECK: ret i32 101
+ int agg() { constexpr Agg a = { f(101) }; return a.k; }
+
+ // CHECK: define {{.*}} @_ZN12LocalVarInit4ctorEv
+ // CHECK-NOT: call
+ // CHECK: ret i32 102
+ int ctor() { constexpr Ctor a = { f(102) }; return a.k; }
+
+ // CHECK: define {{.*}} @_ZN12LocalVarInit8mutable_Ev
+ // CHECK-NOT: call
+ // CHECK: call {{.*}}memcpy{{.*}} @_ZZN12LocalVarInit8mutable_EvE1a
+ // CHECK-NOT: call
+ // Can't fold return value due to 'mutable'.
+ // CHECK-NOT: ret i32 103
+ // CHECK: }
+ int mutable_() { constexpr Mutable a = { f(103) }; return a.k; }
+}
+
namespace CrossFuncLabelDiff {
// Make sure we refuse to constant-fold the variable b.
constexpr long a(bool x) { return x ? 0 : (long)&&lbl + (0 && ({lbl: 0;})); }
diff --git a/test/CodeGenCXX/const-init-cxx1y.cpp b/test/CodeGenCXX/const-init-cxx1y.cpp
new file mode 100644
index 000000000000..978c428e078a
--- /dev/null
+++ b/test/CodeGenCXX/const-init-cxx1y.cpp
@@ -0,0 +1,48 @@
+// RUN: not %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s -std=c++1y | FileCheck %s
+
+struct A {
+ constexpr A() : n(1) {}
+ ~A();
+ int n;
+};
+struct B : A {
+ A a[3];
+ constexpr B() {
+ ++a[0].n;
+ a[1].n += 2;
+ a[2].n = n + a[1].n;
+ }
+};
+B b;
+
+// CHECK: @b = global {{.*}} i32 1, {{.*}} { i32 2 }, {{.*}} { i32 3 }, {{.*}} { i32 4 }
+// CHECK-NOT: _ZN1BC
+
+namespace ModifyStaticTemporary {
+ struct A { int &&temporary; int x; };
+ constexpr int f(int &r) { r *= 9; return r - 12; }
+ A a = { 6, f(a.temporary) };
+ // CHECK: @_ZGRN21ModifyStaticTemporary1aE = private global i32 54
+ // CHECK: @_ZN21ModifyStaticTemporary1aE = global {{.*}} i32* @_ZGRN21ModifyStaticTemporary1aE, i32 42
+
+ A b = { 7, ++b.temporary };
+ // CHECK: @_ZGRN21ModifyStaticTemporary1bE = private global i32 8
+ // CHECK: @_ZN21ModifyStaticTemporary1bE = global {{.*}} i32* @_ZGRN21ModifyStaticTemporary1bE, i32 8
+
+ // Can't emit all of 'c' as a constant here, so emit the initial value of
+ // 'c.temporary', not the value as modified by the partial evaluation within
+ // the initialization of 'c.x'.
+ A c = { 10, (++c.temporary, b.x) };
+ // CHECK: @_ZGRN21ModifyStaticTemporary1cE = private global i32 10
+ // CHECK: @_ZN21ModifyStaticTemporary1cE = global {{.*}} zeroinitializer
+}
+
+// CHECK: __cxa_atexit({{.*}} @_ZN1BD1Ev {{.*}} @b
+
+// CHECK: define
+// CHECK-NOT: @_ZGRN21ModifyStaticTemporary1cE
+// CHECK: store {{.*}} @_ZGRN21ModifyStaticTemporary1cE, {{.*}} @_ZN21ModifyStaticTemporary1cE
+// CHECK: add
+// CHECK: store
+// CHECK: load {{.*}} @_ZN21ModifyStaticTemporary1bE
+// CHECK: store {{.*}} @_ZN21ModifyStaticTemporary1cE
diff --git a/test/CodeGenCXX/const-init.cpp b/test/CodeGenCXX/const-init.cpp
index 201ce8f0c64c..05896ff7db00 100644
--- a/test/CodeGenCXX/const-init.cpp
+++ b/test/CodeGenCXX/const-init.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
+// RUN: not %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
// CHECK: @a = global i32 10
int a = 10;
diff --git a/test/CodeGenCXX/constructor-attr.cpp b/test/CodeGenCXX/constructor-attr.cpp
index 691795f77619..4f6d635e95d1 100644
--- a/test/CodeGenCXX/constructor-attr.cpp
+++ b/test/CodeGenCXX/constructor-attr.cpp
@@ -5,7 +5,7 @@
// PR6521
void bar();
struct Foo {
- // CHECK: define linkonce_odr void @_ZN3Foo3fooEv
+ // CHECK-LABEL: define linkonce_odr void @_ZN3Foo3fooEv
static void foo() __attribute__((constructor)) {
bar();
}
diff --git a/test/CodeGenCXX/constructor-conversion.cpp b/test/CodeGenCXX/constructor-conversion.cpp
index f50346328500..ebb414da960b 100644
--- a/test/CodeGenCXX/constructor-conversion.cpp
+++ b/test/CodeGenCXX/constructor-conversion.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-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 32086c1ad37c..c2cf44ce810c 100644
--- a/test/CodeGenCXX/constructor-default-arg.cpp
+++ b/test/CodeGenCXX/constructor-default-arg.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/constructor-destructor-return-this.cpp b/test/CodeGenCXX/constructor-destructor-return-this.cpp
index 1ff922de60f3..ea2ea45a3273 100644
--- a/test/CodeGenCXX/constructor-destructor-return-this.cpp
+++ b/test/CodeGenCXX/constructor-destructor-return-this.cpp
@@ -1,60 +1,116 @@
-//RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv7-apple-ios3.0 -target-abi apcs-gnu | FileCheck %s
+//RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-unknown-linux | FileCheck --check-prefix=CHECKGEN %s
+//RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv7-apple-ios3.0 -target-abi apcs-gnu | FileCheck --check-prefix=CHECKARM %s
+//RUN: %clang_cc1 %s -emit-llvm -o - -triple=i386-pc-win32 -cxx-abi microsoft -fno-rtti | FileCheck --check-prefix=CHECKMS %s
+// FIXME: these tests crash on the bots when run with -triple=x86_64-pc-win32
-// For constructors/desctructors that return 'this', if there exists a callsite
-// that returns 'this' and is immediately before the return instruction, make
-// sure we are using the return value from the callsite.
-// rdar://12818789
+// Make sure we attach the 'returned' attribute to the 'this' parameter of
+// constructors and destructors which return this (and only these cases)
-// CHECK: define linkonce_odr [[A:%.*]] @_ZN11ObjectCacheC1Ev([[A]] %this) unnamed_addr
-// CHECK: [[THIS1:%.*]] = call [[A]] @_ZN11ObjectCacheC2Ev(
-// CHECK-NEXT: ret [[A]] [[THIS1]]
+class A {
+public:
+ A();
+ ~A();
-// CHECK: define linkonce_odr [[A:%.*]] @_ZN5TimerI11ObjectCacheEC1EPS0_MS0_FvPS1_E([[A]] %this
-// CHECK: [[THIS1:%.*]] = call [[A]] @_ZN5TimerI11ObjectCacheEC2EPS0_MS0_FvPS1_E(
-// CHECK-NEXT: ret [[A]] [[THIS1]]
+private:
+ int x_;
+};
-// CHECK: define linkonce_odr [[A:%.*]] @_ZN5TimerI11ObjectCacheED1Ev([[A]] %this) unnamed_addr
-// CHECK: [[THIS1:%.*]] = call [[A]] @_ZN5TimerI11ObjectCacheED2Ev(
-// CHECK-NEXT: ret [[A]] [[THIS1]]
+class B : public A {
+public:
+ B(int *i);
+ ~B();
+
+private:
+ int *i_;
+};
-// CHECK: define linkonce_odr [[A:%.*]] @_ZN5TimerI11ObjectCacheED2Ev([[A]] %this) unnamed_addr
-// CHECK: [[THIS1:%.*]] = call [[B:%.*]] @_ZN9TimerBaseD2Ev(
-// CHECK-NEXT: [[THIS2:%.*]] = bitcast [[B]] [[THIS1]] to [[A]]
-// CHECK-NEXT: ret [[A]] [[THIS2]]
+B::B(int *i) : i_(i) { }
+B::~B() { }
-class TimerBase {
+// CHECKGEN-LABEL: define void @_ZN1BC1EPi(%class.B* %this, i32* %i)
+// CHECKGEN-LABEL: define void @_ZN1BC2EPi(%class.B* %this, i32* %i)
+// CHECKGEN-LABEL: define void @_ZN1BD1Ev(%class.B* %this)
+// CHECKGEN-LABEL: define void @_ZN1BD2Ev(%class.B* %this)
+
+// CHECKARM-LABEL: define %class.B* @_ZN1BC1EPi(%class.B* returned %this, i32* %i)
+// CHECKARM-LABEL: define %class.B* @_ZN1BC2EPi(%class.B* returned %this, i32* %i)
+// CHECKARM-LABEL: define %class.B* @_ZN1BD1Ev(%class.B* returned %this)
+// CHECKARM-LABEL: define %class.B* @_ZN1BD2Ev(%class.B* returned %this)
+
+// CHECKMS-LABEL: define x86_thiscallcc %class.B* @"\01??0B@@QAE@PAH@Z"(%class.B* returned %this, i32* %i)
+// CHECKMS-LABEL: define x86_thiscallcc void @"\01??1B@@QAE@XZ"(%class.B* %this)
+
+class C : public A, public B {
public:
- TimerBase();
- virtual ~TimerBase();
+ C(int *i, char *c);
+ virtual ~C();
+private:
+ char *c_;
};
-template <typename TimerFiredClass> class Timer : public TimerBase {
-public:
- typedef void (TimerFiredClass::*TimerFiredFunction)(Timer*);
+C::C(int *i, char *c) : B(i), c_(c) { }
+C::~C() { }
- Timer(TimerFiredClass* o, TimerFiredFunction f)
- : m_object(o), m_function(f) { }
+// CHECKGEN-LABEL: define void @_ZN1CC1EPiPc(%class.C* %this, i32* %i, i8* %c)
+// CHECKGEN-LABEL: define void @_ZN1CC2EPiPc(%class.C* %this, i32* %i, i8* %c)
+// CHECKGEN-LABEL: define void @_ZN1CD0Ev(%class.C* %this)
+// CHECKGEN-LABEL: define void @_ZN1CD1Ev(%class.C* %this)
+// CHECKGEN-LABEL: define void @_ZN1CD2Ev(%class.C* %this)
-private:
- virtual void fired() { (m_object->*m_function)(this); }
+// CHECKARM-LABEL: define %class.C* @_ZN1CC1EPiPc(%class.C* returned %this, i32* %i, i8* %c)
+// CHECKARM-LABEL: define %class.C* @_ZN1CC2EPiPc(%class.C* returned %this, i32* %i, i8* %c)
+// CHECKARM-LABEL: define void @_ZN1CD0Ev(%class.C* %this)
+// CHECKARM-LABEL: define %class.C* @_ZN1CD1Ev(%class.C* returned %this)
+// CHECKARM-LABEL: define %class.C* @_ZN1CD2Ev(%class.C* returned %this)
- TimerFiredClass* m_object;
- TimerFiredFunction m_function;
-};
+// CHECKMS-LABEL: define x86_thiscallcc %class.C* @"\01??0C@@QAE@PAHPAD@Z"(%class.C* returned %this, i32* %i, i8* %c)
+// CHECKMS-LABEL: define x86_thiscallcc void @"\01??1C@@UAE@XZ"(%class.C* %this)
-class ObjectCache {
+class D : public virtual A {
public:
- explicit ObjectCache();
- ~ObjectCache();
+ D();
+ ~D();
+};
-private:
- Timer<ObjectCache> m_notificationPostTimer;
+D::D() { }
+D::~D() { }
+
+// CHECKGEN-LABEL: define void @_ZN1DC1Ev(%class.D* %this)
+// CHECKGEN-LABEL: define void @_ZN1DC2Ev(%class.D* %this, i8** %vtt)
+// CHECKGEN-LABEL: define void @_ZN1DD1Ev(%class.D* %this)
+// CHECKGEN-LABEL: define void @_ZN1DD2Ev(%class.D* %this, i8** %vtt)
+
+// CHECKARM-LABEL: define %class.D* @_ZN1DC1Ev(%class.D* returned %this)
+// CHECKARM-LABEL: define %class.D* @_ZN1DC2Ev(%class.D* returned %this, i8** %vtt)
+// CHECKARM-LABEL: define %class.D* @_ZN1DD1Ev(%class.D* returned %this)
+// CHECKARM-LABEL: define %class.D* @_ZN1DD2Ev(%class.D* returned %this, i8** %vtt)
+
+// CHECKMS-LABEL: define x86_thiscallcc %class.D* @"\01??0D@@QAE@XZ"(%class.D* returned %this, i32 %is_most_derived)
+// CHECKMS-LABEL: define x86_thiscallcc void @"\01??1D@@QAE@XZ"(%class.D* %this)
+
+class E {
+public:
+ E();
+ virtual ~E();
};
-inline ObjectCache::ObjectCache() : m_notificationPostTimer(this, 0) { }
-inline ObjectCache::~ObjectCache() { }
+E* gete();
-ObjectCache *test() {
- ObjectCache *dd = new ObjectCache();
- return dd;
+void test_destructor() {
+ const E& e1 = E();
+ E* e2 = gete();
+ e2->~E();
}
+
+// CHECKARM-LABEL: define void @_Z15test_destructorv()
+
+// Verify that virtual calls to destructors are not marked with a 'returned'
+// this parameter at the call site...
+// CHECKARM: [[VFN:%.*]] = getelementptr inbounds %class.E* (%class.E*)**
+// CHECKARM: [[THUNK:%.*]] = load %class.E* (%class.E*)** [[VFN]]
+// CHECKARM: call %class.E* [[THUNK]](%class.E* %
+
+// ...but static calls create declarations with 'returned' this
+// CHECKARM: {{%.*}} = call %class.E* @_ZN1ED1Ev(%class.E* %
+
+// CHECKARM: declare %class.E* @_ZN1ED1Ev(%class.E* returned)
diff --git a/test/CodeGenCXX/constructor-for-array-members.cpp b/test/CodeGenCXX/constructor-for-array-members.cpp
index 7a365cd26da4..7842d9c725e5 100644
--- a/test/CodeGenCXX/constructor-for-array-members.cpp
+++ b/test/CodeGenCXX/constructor-for-array-members.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/constructor-init.cpp b/test/CodeGenCXX/constructor-init.cpp
index b33184e3966e..477a439f337a 100644
--- a/test/CodeGenCXX/constructor-init.cpp
+++ b/test/CodeGenCXX/constructor-init.cpp
@@ -70,7 +70,7 @@ template <class T> struct A {
operator int() {return 0;}
};
-// CHECK: define void @_Z1fv()
+// CHECK-LABEL: define void @_Z1fv()
void f() {
// CHECK: call void @_ZN1AIsEC1Ei
A<short> a4 = 97;
@@ -93,7 +93,7 @@ namespace InitVTable {
B(int);
};
- // CHECK: define void @_ZN10InitVTable1BC2Ev(%"struct.InitVTable::B"* %this) unnamed_addr
+ // CHECK-LABEL: define void @_ZN10InitVTable1BC2Ev(%"struct.InitVTable::B"* %this) unnamed_addr
// CHECK: [[T0:%.*]] = bitcast [[B:%.*]]* [[THIS:%.*]] to i8***
// CHECK-NEXT: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN10InitVTable1BE, i64 0, i64 2), i8*** [[T0]]
// CHECK: [[VTBL:%.*]] = load i32 ([[B]]*)*** {{%.*}}
@@ -106,7 +106,7 @@ namespace InitVTable {
// CHECK-NEXT: ret void
B::B() : A(foo()) {}
- // CHECK: define void @_ZN10InitVTable1BC2Ei(%"struct.InitVTable::B"* %this, i32 %x) unnamed_addr
+ // CHECK-LABEL: define void @_ZN10InitVTable1BC2Ei(%"struct.InitVTable::B"* %this, i32 %x) unnamed_addr
// CHECK: [[ARG:%.*]] = add nsw i32 {{%.*}}, 5
// CHECK-NEXT: call void @_ZN10InitVTable1AC2Ei({{.*}}* {{%.*}}, i32 [[ARG]])
// CHECK-NEXT: [[T0:%.*]] = bitcast [[B]]* {{%.*}} to i8***
@@ -120,7 +120,7 @@ namespace rdar9694300 {
int x;
};
- // CHECK: define void @_ZN11rdar96943001fEv
+ // CHECK-LABEL: define void @_ZN11rdar96943001fEv
void f() {
// CHECK: alloca
X x;
@@ -163,7 +163,7 @@ template<typename T> struct X;
// Make sure that the instantiated constructor initializes start and
// end properly.
-// CHECK: define linkonce_odr void @_ZN1XIiEC2ERKS0_(%struct.X* %this, %struct.X* %other) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1XIiEC2ERKS0_(%struct.X* %this, %struct.X* %other) unnamed_addr
// CHECK: {{store.*null}}
// CHECK: {{store.*null}}
// CHECK: ret
@@ -200,7 +200,7 @@ namespace PR10720 {
// CHECK-PR10720: ret
pair2 &operator=(pair2&&) = default;
- // CHECK-PR10720: define linkonce_odr void @_ZN7PR107205pair2C2EOS0_
+ // CHECK-PR10720-LABEL: define linkonce_odr void @_ZN7PR107205pair2C2EOS0_
// CHECK-PR10720-NOT: ret
// CHECK-PR10720: load
// CHECK-PR10720: icmp ult
@@ -210,7 +210,7 @@ namespace PR10720 {
// CHECK-PR10720: ret void
pair2(pair2&&) = default;
- // CHECK-PR10720: define linkonce_odr void @_ZN7PR107205pair2C2ERKS0_
+ // CHECK-PR10720-LABEL: define linkonce_odr void @_ZN7PR107205pair2C2ERKS0_
// CHECK-PR10720-NOT: ret
// CHECK-PR10720: load
// CHECK-PR10720: icmp ult
@@ -223,7 +223,7 @@ namespace PR10720 {
struct pair : X { // Make the copy constructor non-trivial, so we actually generate it.
int second[4];
- // CHECK-PR10720: define linkonce_odr void @_ZN7PR107204pairC2ERKS0_
+ // CHECK-PR10720-LABEL: define linkonce_odr void @_ZN7PR107204pairC2ERKS0_
// CHECK-PR10720-NOT: ret
// CHECK-PR10720: call void @llvm.memcpy
// CHECK-PR10720-NEXT: ret void
diff --git a/test/CodeGenCXX/constructor-template.cpp b/test/CodeGenCXX/constructor-template.cpp
index fe4687c1b303..0d38d10c1382 100644
--- a/test/CodeGenCXX/constructor-template.cpp
+++ b/test/CodeGenCXX/constructor-template.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
// PR4826
struct A {
diff --git a/test/CodeGenCXX/constructors.cpp b/test/CodeGenCXX/constructors.cpp
index 9e2da31f046a..f730b9ef491a 100644
--- a/test/CodeGenCXX/constructors.cpp
+++ b/test/CodeGenCXX/constructors.cpp
@@ -21,18 +21,18 @@ struct A {
A::A(struct Undeclared &ref) : mem(0) {}
// Check that delegation works.
-// CHECK: define void @_ZN1AC1ER10Undeclared(%struct.A* %this, %struct.Undeclared* %ref) unnamed_addr
+// CHECK-LABEL: define void @_ZN1AC1ER10Undeclared(%struct.A* %this, %struct.Undeclared* %ref) unnamed_addr
// CHECK: call void @_ZN1AC2ER10Undeclared(
-// CHECK: define void @_ZN1AC2ER10Undeclared(%struct.A* %this, %struct.Undeclared* %ref) unnamed_addr
+// CHECK-LABEL: define void @_ZN1AC2ER10Undeclared(%struct.A* %this, %struct.Undeclared* %ref) unnamed_addr
// CHECK: call void @_ZN6MemberC1Ei(
A::A(ValueClass v) : mem(v.y - v.x) {}
-// CHECK: define void @_ZN1AC1E10ValueClass(%struct.A* %this, i64 %v.coerce) unnamed_addr
+// CHECK-LABEL: define void @_ZN1AC1E10ValueClass(%struct.A* %this, i64 %v.coerce) unnamed_addr
// CHECK: call void @_ZN1AC2E10ValueClass(
-// CHECK: define void @_ZN1AC2E10ValueClass(%struct.A* %this, i64 %v.coerce) unnamed_addr
+// CHECK-LABEL: define void @_ZN1AC2E10ValueClass(%struct.A* %this, i64 %v.coerce) unnamed_addr
// CHECK: call void @_ZN6MemberC1Ei(
@@ -44,10 +44,10 @@ struct B : A {
B::B(struct Undeclared &ref) : A(ref), mem(1) {}
-// CHECK: define void @_ZN1BC1ER10Undeclared(%struct.B* %this, %struct.Undeclared* %ref) unnamed_addr
+// CHECK-LABEL: define void @_ZN1BC1ER10Undeclared(%struct.B* %this, %struct.Undeclared* %ref) unnamed_addr
// CHECK: call void @_ZN1BC2ER10Undeclared(
-// CHECK: define void @_ZN1BC2ER10Undeclared(%struct.B* %this, %struct.Undeclared* %ref) unnamed_addr
+// CHECK-LABEL: define void @_ZN1BC2ER10Undeclared(%struct.B* %this, %struct.Undeclared* %ref) unnamed_addr
// CHECK: call void @_ZN1AC2ER10Undeclared(
// CHECK: call void @_ZN6MemberC1Ei(
@@ -64,12 +64,12 @@ struct C : virtual A {
};
C::C(int x) : A(ValueClass(x, x+1)), mem(x * x) {}
-// CHECK: define void @_ZN1CC1Ei(%struct.C* %this, i32 %x) unnamed_addr
+// CHECK-LABEL: define void @_ZN1CC1Ei(%struct.C* %this, i32 %x) unnamed_addr
// CHECK: call void @_ZN10ValueClassC1Eii(
// CHECK: call void @_ZN1AC2E10ValueClass(
// CHECK: call void @_ZN6MemberC1Ei(
-// CHECK: define void @_ZN1CC2Ei(%struct.C* %this, i8** %vtt, i32 %x) unnamed_addr
+// CHECK-LABEL: define void @_ZN1CC2Ei(%struct.C* %this, i8** %vtt, i32 %x) unnamed_addr
// CHECK: call void @_ZN6MemberC1Ei(
@@ -83,12 +83,12 @@ struct D : A {
D::D(int x, ...) : A(ValueClass(x, x+1)), mem(x*x) {}
-// CHECK: define void @_ZN1DC1Eiz(%struct.D* %this, i32 %x, ...) unnamed_addr
+// CHECK-LABEL: define void @_ZN1DC1Eiz(%struct.D* %this, i32 %x, ...) unnamed_addr
// CHECK: call void @_ZN10ValueClassC1Eii(
// CHECK: call void @_ZN1AC2E10ValueClass(
// CHECK: call void @_ZN6MemberC1Ei(
-// CHECK: define void @_ZN1DC2Eiz(%struct.D* %this, i32 %x, ...) unnamed_addr
+// CHECK-LABEL: define void @_ZN1DC2Eiz(%struct.D* %this, i32 %x, ...) unnamed_addr
// CHECK: call void @_ZN10ValueClassC1Eii(
// CHECK: call void @_ZN1AC2E10ValueClass(
// CHECK: call void @_ZN6MemberC1Ei(
@@ -109,7 +109,7 @@ namespace test1 {
struct A { A(); void *ptr; };
struct B { B(); int x; A a[0]; };
B::B() {}
- // CHECK: define void @_ZN5test11BC2Ev(
+ // CHECK-LABEL: define void @_ZN5test11BC2Ev(
// CHECK: [[THIS:%.*]] = load [[B:%.*]]**
// CHECK-NEXT: ret void
}
diff --git a/test/CodeGenCXX/conversion-function.cpp b/test/CodeGenCXX/conversion-function.cpp
index 76d9e027d997..ec098d078d28 100644
--- a/test/CodeGenCXX/conversion-function.cpp
+++ b/test/CodeGenCXX/conversion-function.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
// XFAIL: *
extern "C" int printf(...);
struct S {
diff --git a/test/CodeGenCXX/convert-to-fptr.cpp b/test/CodeGenCXX/convert-to-fptr.cpp
index 425f79de5067..e497acf33dc4 100644
--- a/test/CodeGenCXX/convert-to-fptr.cpp
+++ b/test/CodeGenCXX/convert-to-fptr.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-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 5d09b5430a10..2ffc7bcb7c8d 100644
--- a/test/CodeGenCXX/copy-assign-synthesis-1.cpp
+++ b/test/CodeGenCXX/copy-assign-synthesis-1.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
-// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm %s -o - | \
+// RUN: FileCheck %s
+// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -emit-llvm %s -o - | \
+// RUN: FileCheck %s
extern "C" int printf(...);
@@ -93,11 +93,5 @@ int main() {
dstY.pr();
}
-// CHECK-LP64: .globl __ZN1XaSERKS_
-// CHECK-LP64: .weak_definition __ZN1XaSERKS_
-// CHECK-LP64: __ZN1XaSERKS_:
-
-// CHECK-LP32: .globl __ZN1XaSERKS_
-// CHECK-LP32: .weak_definition __ZN1XaSERKS_
-// CHECK-LP32: __ZN1XaSERKS_:
+// CHECK: define linkonce_odr %struct.X* @_ZN1XaSERKS_
diff --git a/test/CodeGenCXX/copy-assign-synthesis-2.cpp b/test/CodeGenCXX/copy-assign-synthesis-2.cpp
index c25e0467fad5..18e92f98ebde 100644
--- a/test/CodeGenCXX/copy-assign-synthesis-2.cpp
+++ b/test/CodeGenCXX/copy-assign-synthesis-2.cpp
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
struct A {};
A& (A::*x)(const A&) = &A::operator=;
-// CHECK: define linkonce_odr %struct.A* @_ZN1AaSERKS_
+// CHECK-LABEL: define linkonce_odr %struct.A* @_ZN1AaSERKS_
diff --git a/test/CodeGenCXX/copy-assign-synthesis.cpp b/test/CodeGenCXX/copy-assign-synthesis.cpp
index e9fc0c337c10..9c8ae8879540 100644
--- a/test/CodeGenCXX/copy-assign-synthesis.cpp
+++ b/test/CodeGenCXX/copy-assign-synthesis.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -emit-llvm -o %t %s
-// RUN: grep "_ZN1XaSERK1X" %t | count 0
+// RUN: not grep "_ZN1XaSERK1X" %t
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/copy-constructor-elim-2.cpp b/test/CodeGenCXX/copy-constructor-elim-2.cpp
index 4ff877516b09..727af1ba7cd3 100644
--- a/test/CodeGenCXX/copy-constructor-elim-2.cpp
+++ b/test/CodeGenCXX/copy-constructor-elim-2.cpp
@@ -2,7 +2,7 @@
struct A { int x; A(int); ~A(); };
A f() { return A(0); }
-// CHECK: define void @_Z1fv
+// CHECK-LABEL: define void @_Z1fv
// CHECK: call {{.*}} @_ZN1AC1Ei
// CHECK-NEXT: ret void
@@ -21,7 +21,7 @@ namespace no_elide_base {
Derived(const Other &O);
};
- // CHECK: define {{.*}} @_ZN13no_elide_base7DerivedC1ERKNS_5OtherE(%"struct.no_elide_base::Derived"* %this, %"struct.no_elide_base::Other"* %O) unnamed_addr
+ // CHECK: define {{.*}} @_ZN13no_elide_base7DerivedC1ERKNS_5OtherE(%"struct.no_elide_base::Derived"* returned %this, %"struct.no_elide_base::Other"* %O) unnamed_addr
Derived::Derived(const Other &O)
// CHECK: call {{.*}} @_ZNK13no_elide_base5OthercvNS_4BaseEEv
// CHECK: call {{.*}} @_ZN13no_elide_base4BaseC2ERKS0_
@@ -63,7 +63,7 @@ namespace PR12139 {
static A makeA() { A a; a.value = 2; return a; }
};
- // CHECK: define i32 @_ZN7PR121394testEv
+ // CHECK-LABEL: define i32 @_ZN7PR121394testEv
int test() {
// CHECK: call void @_ZN7PR121391A5makeAEv
// CHECK-NEXT: call %"struct.PR12139::A"* @_ZN7PR121391AC1ERKS0_i
diff --git a/test/CodeGenCXX/copy-constructor-elim.cpp b/test/CodeGenCXX/copy-constructor-elim.cpp
index c883584fe02f..ad3a87b9d5f8 100644
--- a/test/CodeGenCXX/copy-constructor-elim.cpp
+++ b/test/CodeGenCXX/copy-constructor-elim.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-llvm -o %t %s
-// RUN: grep "_ZN1CC1ERK1C" %t | count 0
-// RUN: grep "_ZN1SC1ERK1S" %t | count 0
+// RUN: not grep "_ZN1CC1ERK1C" %t
+// RUN: not grep "_ZN1SC1ERK1S" %t
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/copy-constructor-synthesis-2.cpp b/test/CodeGenCXX/copy-constructor-synthesis-2.cpp
index d028a28fdd67..03c66339947d 100644
--- a/test/CodeGenCXX/copy-constructor-synthesis-2.cpp
+++ b/test/CodeGenCXX/copy-constructor-synthesis-2.cpp
@@ -3,5 +3,5 @@
struct A { virtual void a(); };
A x(A& y) { return y; }
-// CHECK: define linkonce_odr {{.*}} @_ZN1AC1ERKS_(%struct.A* %this, %struct.A*) unnamed_addr
+// CHECK: define linkonce_odr {{.*}} @_ZN1AC1ERKS_(%struct.A* {{.*}}%this, %struct.A*) unnamed_addr
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2)
diff --git a/test/CodeGenCXX/copy-constructor-synthesis.cpp b/test/CodeGenCXX/copy-constructor-synthesis.cpp
index 68f680574b75..c8b265ca2d12 100644
--- a/test/CodeGenCXX/copy-constructor-synthesis.cpp
+++ b/test/CodeGenCXX/copy-constructor-synthesis.cpp
@@ -21,7 +21,7 @@ struct P {
};
-// CHECK: define linkonce_odr void @_ZN1XC1ERKS_(%struct.X* %this, %struct.X*) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1XC1ERKS_(%struct.X* %this, %struct.X*) unnamed_addr
struct X : M, N, P { // ...
X() : f1(1.0), d1(2.0), i1(3), name("HELLO"), bf1(0xff), bf2(0xabcd),
au_i1(1234), au1_4("MASKED") {}
@@ -136,7 +136,33 @@ void f(B b1) {
B b2 = b1;
}
-// CHECK: define linkonce_odr void @_ZN6PR66281BC2ERKS0_(%"struct.PR6628::B"* %this, %"struct.PR6628::B"*) unnamed_addr
+// CHECK: define linkonce_odr [[A:%.*]]* @_ZN12rdar138169401AaSERKS0_(
+// CHECK: [[THIS:%.*]] = load [[A]]**
+// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[A]]* [[THIS]], i32 0, i32 1
+// CHECK-NEXT: [[T1:%.*]] = bitcast [2 x i8]* [[T0]] to i16*
+// CHECK-NEXT: [[OTHER:%.*]] = load [[A]]**
+// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[A]]* [[OTHER]], i32 0, i32 1
+// CHECK-NEXT: [[T3:%.*]] = bitcast [2 x i8]* [[T2]] to i16*
+// CHECK-NEXT: [[T4:%.*]] = bitcast i16* [[T1]] to i8*
+// CHECK-NEXT: [[T5:%.*]] = bitcast i16* [[T3]] to i8*
+// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T4]], i8* [[T5]], i64 8, i32 8, i1 false)
+// CHECK-NEXT: ret [[A]]* [[THIS]]
+
+// CHECK-LABEL: define linkonce_odr void @_ZN12rdar138169401AC2ERKS0_(
+// CHECK: [[THIS:%.*]] = load [[A]]**
+// CHECK-NEXT: [[T0:%.*]] = bitcast [[A]]* [[THIS]] to i8***
+// CHECK-NEXT: store i8** getelementptr inbounds ([4 x i8*]* @_ZTVN12rdar138169401AE, i64 0, i64 2), i8*** [[T0]]
+// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[A]]* [[THIS]], i32 0, i32 1
+// CHECK-NEXT: [[T1:%.*]] = bitcast [2 x i8]* [[T0]] to i16*
+// CHECK-NEXT: [[OTHER:%.*]] = load [[A]]**
+// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[A]]* [[OTHER]], i32 0, i32 1
+// CHECK-NEXT: [[T3:%.*]] = bitcast [2 x i8]* [[T2]] to i16*
+// CHECK-NEXT: [[T4:%.*]] = bitcast i16* [[T1]] to i8*
+// CHECK-NEXT: [[T5:%.*]] = bitcast i16* [[T3]] to i8*
+// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[T4]], i8* [[T5]], i64 8, i32 8, i1 false)
+// CHECK-NEXT: ret void
+
+// CHECK-LABEL: define linkonce_odr void @_ZN6PR66281BC2ERKS0_(%"struct.PR6628::B"* %this, %"struct.PR6628::B"*) unnamed_addr
// CHECK: call void @_ZN6PR66281TC1Ev
// CHECK: call void @_ZN6PR66281TC1Ev
// CHECK: call void @_ZN6PR66281AC2ERKS0_RKNS_1TES5_
@@ -154,3 +180,18 @@ void f(B b1) {
// CHECK: call void @_ZN6PR66281TD1Ev
}
+// rdar://13816940
+// Test above because things get weirdly re-ordered.
+namespace rdar13816940 {
+ struct A {
+ virtual ~A();
+ unsigned short a : 1;
+ unsigned short : 15;
+ unsigned other;
+ };
+
+ void test(A &a) {
+ A x = a; // force copy constructor into existence
+ x = a; // also force the copy assignment operator
+ }
+}
diff --git a/test/CodeGenCXX/copy-initialization.cpp b/test/CodeGenCXX/copy-initialization.cpp
index aecd64ec1aac..1a16013a81a9 100644
--- a/test/CodeGenCXX/copy-initialization.cpp
+++ b/test/CodeGenCXX/copy-initialization.cpp
@@ -12,7 +12,7 @@ struct Bar {
void f(Foo);
-// CHECK: define void @_Z1g3Foo(%struct.Foo* %foo)
+// CHECK-LABEL: define void @_Z1g3Foo(%struct.Foo* %foo)
void g(Foo foo) {
// CHECK: call void @_ZN3BarC1Ev
// CHECK: @_ZNK3BarcvRK3FooEv
diff --git a/test/CodeGenCXX/crash.cpp b/test/CodeGenCXX/crash.cpp
new file mode 100644
index 000000000000..073542dd15b0
--- /dev/null
+++ b/test/CodeGenCXX/crash.cpp
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 %s -std=c++11 -emit-llvm-only
+// CHECK that we don't crash.
+
+// PR11676's example is ill-formed:
+/*
+union _XEvent {
+};
+void ProcessEvent() {
+ _XEvent pluginEvent = _XEvent();
+}
+*/
+
+// Example from PR11665:
+void f() {
+ union U { int field; } u = U();
+ (void)U().field;
+}
+
+namespace PR17476 {
+struct string {
+ string(const char *__s);
+ string &operator+=(const string &__str);
+};
+
+template <class ELFT> void finalizeDefaultAtomValues() {
+ auto startEnd = [&](const char * sym)->void {
+ string start("__");
+ start += sym;
+ }
+ ;
+ startEnd("preinit_array");
+}
+
+void f() { finalizeDefaultAtomValues<int>(); }
+}
diff --git a/test/CodeGenCXX/ctor-dtor-alias.cpp b/test/CodeGenCXX/ctor-dtor-alias.cpp
new file mode 100644
index 000000000000..235d1650dec9
--- /dev/null
+++ b/test/CodeGenCXX/ctor-dtor-alias.cpp
@@ -0,0 +1,163 @@
+// RUN: %clang_cc1 %s -triple x86_64-linux -emit-llvm -o - -mconstructor-aliases -O1 -disable-llvm-optzns | FileCheck %s
+// RUN: %clang_cc1 %s -triple x86_64-linux -emit-llvm -o - -mconstructor-aliases | FileCheck --check-prefix=NOOPT %s
+
+// RUN: %clang_cc1 -cc1 -triple x86_64--netbsd -emit-llvm \
+// RUN: -mconstructor-aliases -O2 %s -o - | FileCheck --check-prefix=CHECK-RAUW %s
+
+namespace test1 {
+// test that we don't produce an alias when the destructor is weak_odr. The
+// reason to avoid it that another TU might have no explicit template
+// instantiation definition or declaration, causing it to to output only
+// one of the destructors as linkonce_odr, producing a different comdat.
+
+// CHECK-DAG: define weak_odr void @_ZN5test16foobarIvEC2Ev
+// CHECK-DAG: define weak_odr void @_ZN5test16foobarIvEC1Ev
+
+template <typename T> struct foobar {
+ foobar() {}
+};
+
+template struct foobar<void>;
+}
+
+namespace test2 {
+// test that when the destrucor is linkonce_odr we just replace every use of
+// C1 with C2.
+
+// CHECK-DAG: define linkonce_odr void @_ZN5test26foobarIvEC2Ev(
+// CHECK-DAG: call void @_ZN5test26foobarIvEC2Ev
+void g();
+template <typename T> struct foobar {
+ foobar() { g(); }
+};
+foobar<void> x;
+}
+
+namespace test3 {
+// test that instead of an internal alias we just use the other destructor
+// directly.
+
+// CHECK-DAG: define internal void @_ZN5test312_GLOBAL__N_11AD2Ev(
+// CHECK-DAG: call i32 @__cxa_atexit{{.*}}_ZN5test312_GLOBAL__N_11AD2Ev
+namespace {
+struct A {
+ ~A() {}
+};
+
+struct B : public A {};
+}
+
+B x;
+}
+
+namespace test4 {
+ // Test that we don't produce aliases from B to A. We cannot because we cannot
+ // guarantee that they will be present in every TU. Instead, we just call
+ // A's destructor directly.
+
+ // CHECK-DAG: define linkonce_odr void @_ZN5test41AD2Ev(
+ // CHECK-DAG: call i32 @__cxa_atexit{{.*}}_ZN5test41AD2Ev
+
+ // test that we don't do this optimization at -O0 so that the debugger can
+ // see both destructors.
+ // NOOPT-DAG: call i32 @__cxa_atexit{{.*}}@_ZN5test41BD2Ev
+ // NOOOPT-DAG: define linkonce_odr void @_ZN5test41BD2Ev
+ struct A {
+ virtual ~A() {}
+ };
+ struct B : public A{
+ ~B() {}
+ };
+ B X;
+}
+
+namespace test5 {
+ // similar to test4, but with an internal B.
+
+ // CHECK-DAG: define linkonce_odr void @_ZN5test51AD2Ev(
+ // CHECK-DAG: call i32 @__cxa_atexit{{.*}}_ZN5test51AD2Ev
+ struct A {
+ virtual ~A() {}
+ };
+ namespace {
+ struct B : public A{
+ ~B() {}
+ };
+ }
+ B X;
+}
+
+namespace test6 {
+ // Test that we use ~A directly, even when ~A is not defined. The symbol for
+ // ~B would have been internal and still contain a reference to ~A.
+ struct A {
+ virtual ~A();
+ };
+ namespace {
+ struct B : public A {
+ ~B() {}
+ };
+ }
+ B X;
+ // CHECK-DAG: call i32 @__cxa_atexit({{.*}}@_ZN5test61AD2Ev
+}
+
+namespace test7 {
+ // Test that we don't produce an alias from ~B to ~A<int> (or crash figuring
+ // out if we should).
+ // pr17875.
+ // CHECK-DAG: define void @_ZN5test71BD2Ev
+ template <typename> struct A {
+ ~A() {}
+ };
+ class B : A<int> {
+ ~B();
+ };
+ template class A<int>;
+ B::~B() {}
+}
+
+namespace test8 {
+ // Test that we replace ~zed with ~bar which is an alias to ~foo.
+ // CHECK-DAG: call i32 @__cxa_atexit({{.*}}@_ZN5test83barD2Ev
+ // CHECK-DAG: @_ZN5test83barD2Ev = alias {{.*}} @_ZN5test83fooD2Ev
+ struct foo {
+ ~foo();
+ };
+ foo::~foo() {}
+ struct bar : public foo {
+ ~bar();
+ };
+ bar::~bar() {}
+ struct zed : public bar {};
+ zed foo;
+}
+
+// CHECK-RAUW: @_ZTV1C = linkonce_odr unnamed_addr constant [4 x i8*] [{{[^@]*}}@_ZTI1C {{[^@]*}}@_ZN1CD2Ev {{[^@]*}}@_ZN1CD0Ev {{[^@]*}}]
+// r194296 replaced C::~C with B::~B without emitting the later.
+
+class A {
+public:
+ A(int);
+ virtual ~A();
+};
+
+template <class>
+class B : A {
+public:
+ B()
+ : A(0) {
+ }
+ __attribute__((always_inline)) ~B() {
+ }
+};
+
+extern template class B<char>;
+
+class C : B<char> {
+};
+
+void
+fn1() {
+ new C;
+}
diff --git a/test/CodeGenCXX/cxx-block-objects.cpp b/test/CodeGenCXX/cxx-block-objects.cpp
index b98906599603..ff868fcdd06f 100644
--- a/test/CodeGenCXX/cxx-block-objects.cpp
+++ b/test/CodeGenCXX/cxx-block-objects.cpp
@@ -25,9 +25,9 @@ main()
return 0;
}
-// CHECK: define internal void @__copy_helper_block_
+// CHECK-LABEL: define internal void @__copy_helper_block_
// CHECK: call void @_ZN1AC1ERKS_
-// CHECK:define internal void @__destroy_helper_block_
+// CHECK-LABEL:define internal void @__destroy_helper_block_
// CHECK: call void @_ZN1AD1Ev
diff --git a/test/CodeGenCXX/cxx0x-delegating-ctors.cpp b/test/CodeGenCXX/cxx0x-delegating-ctors.cpp
index e909f0320454..c48e61fd14e0 100644
--- a/test/CodeGenCXX/cxx0x-delegating-ctors.cpp
+++ b/test/CodeGenCXX/cxx0x-delegating-ctors.cpp
@@ -87,7 +87,7 @@ namespace PR14588 {
virtual void squawk() { other(); }
};
- // CHECK: define void @_ZN7PR145883FooC1Ev(%"class.PR14588::Foo"*
+ // CHECK-LABEL: define void @_ZN7PR145883FooC1Ev(%"class.PR14588::Foo"*
// CHECK: call void @_ZN7PR145883FooC1EPKv(
// CHECK: invoke void @_ZN7PR145885otherEv()
// CHECK: call void @_ZN7PR145883FooD1Ev
diff --git a/test/CodeGenCXX/cxx0x-initializer-array.cpp b/test/CodeGenCXX/cxx0x-initializer-array.cpp
index 3144e941ef42..49bc86fadc78 100644
--- a/test/CodeGenCXX/cxx0x-initializer-array.cpp
+++ b/test/CodeGenCXX/cxx0x-initializer-array.cpp
@@ -6,7 +6,7 @@ struct A { int a[1]; };
typedef A x[];
int f() {
x{{{1}}};
- // CHECK: define i32 @_Z1fv
+ // CHECK-LABEL: define i32 @_Z1fv
// CHECK: store i32 1
// (It's okay if the output changes here, as long as we don't crash.)
return 0;
@@ -33,7 +33,7 @@ namespace ValueInitArrayOfMemPtr {
S1();
};
- // CHECK: define void @_ZN22ValueInitArrayOfMemPtr1fEi
+ // CHECK-LABEL: define void @_ZN22ValueInitArrayOfMemPtr1fEi
void f(int n) {
Agg1 a = { n };
// CHECK: store i32 -1,
@@ -42,7 +42,7 @@ namespace ValueInitArrayOfMemPtr {
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %{{.*}}, i8* bitcast ([3 x i32]* @[[THREE_NULL_MEMPTRS]] to i8*), i32 12, i32 4, i1 false)
}
- // CHECK: define void @_ZN22ValueInitArrayOfMemPtr1gEv
+ // CHECK-LABEL: define void @_ZN22ValueInitArrayOfMemPtr1gEv
void g() {
// CHECK: store i32 -1,
f(a{});
@@ -54,7 +54,7 @@ namespace array_dtor {
using T = S[3];
void f(const T &);
void f(T *);
- // CHECK: define void @_ZN10array_dtor1gEv(
+ // CHECK-LABEL: define void @_ZN10array_dtor1gEv(
void g() {
// CHECK: %[[ARRAY:.*]] = alloca [3 x
// CHECK: br
@@ -73,7 +73,7 @@ namespace array_dtor {
// CHECK: ret void
}
- // CHECK: define void @_ZN10array_dtor1hEv(
+ // CHECK-LABEL: define void @_ZN10array_dtor1hEv(
void h() {
// CHECK: %[[ARRAY:.*]] = alloca [3 x
// CHECK: br
@@ -91,7 +91,7 @@ namespace array_dtor {
// CHECK: ret void
}
- // CHECK: define void @_ZN10array_dtor1iEv(
+ // CHECK-LABEL: define void @_ZN10array_dtor1iEv(
void i() {
// CHECK: %[[ARRAY:.*]] = alloca [3 x
// CHECK: br
diff --git a/test/CodeGenCXX/cxx0x-initializer-constructors.cpp b/test/CodeGenCXX/cxx0x-initializer-constructors.cpp
index be5b44df1fec..f60536e92094 100644
--- a/test/CodeGenCXX/cxx0x-initializer-constructors.cpp
+++ b/test/CodeGenCXX/cxx0x-initializer-constructors.cpp
@@ -6,21 +6,21 @@ struct S {
};
void fn1() {
- // CHECK: define void @_Z3fn1v
+ // CHECK-LABEL: define void @_Z3fn1v
S s { 1 };
// CHECK: alloca %struct.S, align 1
// CHECK: call void @_ZN1SC1Ei(%struct.S* %s, i32 1)
}
void fn2() {
- // CHECK: define void @_Z3fn2v
+ // CHECK-LABEL: define void @_Z3fn2v
S s { 1, 2.0, 3.0 };
// CHECK: alloca %struct.S, align 1
// CHECK: call void @_ZN1SC1Eidd(%struct.S* %s, i32 1, double 2.000000e+00, double 3.000000e+00)
}
void fn3() {
- // CHECK: define void @_Z3fn3v
+ // CHECK-LABEL: define void @_Z3fn3v
S sa[] { { 1 }, { 2 }, { 3 } };
// CHECK: alloca [3 x %struct.S], align 1
// CHECK: call void @_ZN1SC1Ei(%struct.S* %{{.+}}, i32 1)
@@ -29,9 +29,25 @@ void fn3() {
}
void fn4() {
- // CHECK: define void @_Z3fn4v
+ // CHECK-LABEL: define void @_Z3fn4v
S sa[] { { 1, 2.0, 3.0 }, { 4, 5.0, 6.0 } };
// CHECK: alloca [2 x %struct.S], align 1
// CHECK: call void @_ZN1SC1Eidd(%struct.S* %{{.+}}, i32 1, double 2.000000e+00, double 3.000000e+00)
// CHECK: call void @_ZN1SC1Eidd(%struct.S* %{{.+}}, i32 4, double 5.000000e+00, double 6.000000e+00)
}
+
+namespace TreeTransformBracedInit {
+ struct S {};
+ struct T { T(const S &); T(const T&); ~T(); };
+ void x(const T &);
+ template<typename> void foo(const S &s) {
+ // Instantiation of this expression used to lose the CXXBindTemporaryExpr
+ // node and thus not destroy the temporary.
+ x({s});
+ }
+ template void foo<void>(const S&);
+ // CHECK: define {{.*}} void @_ZN23TreeTransformBracedInit3fooIvEEvRKNS_1SE(
+ // CHECK: call void @_ZN23TreeTransformBracedInit1TC1ERKNS_1SE(
+ // CHECK-NEXT: call void @_ZN23TreeTransformBracedInit1xERKNS_1TE(
+ // CHECK-NEXT: call void @_ZN23TreeTransformBracedInit1TD1Ev(
+}
diff --git a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-pr12086.cpp b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-pr12086.cpp
index 14d2f7729184..091d7b70117c 100644
--- a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-pr12086.cpp
+++ b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-pr12086.cpp
@@ -1,18 +1,28 @@
-// RUN: %clang_cc1 -std=c++11 -emit-llvm -o - -verify %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-STATIC-BL
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -emit-llvm -o - %s -Dconstexpr= | FileCheck %s --check-prefix=CHECK-DYNAMIC-BL
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -emit-llvm -o - %s -DUSE_END | FileCheck %s --check-prefix=CHECK-STATIC-BE
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -emit-llvm -o - %s -DUSE_END -Dconstexpr= | FileCheck %s --check-prefix=CHECK-DYNAMIC-BE
namespace std {
typedef decltype(sizeof(int)) size_t;
- // libc++'s implementation
template <class _E>
class initializer_list
{
const _E* __begin_;
+#ifdef USE_END
+ const _E* __end_;
+#else
size_t __size_;
+#endif
- initializer_list(const _E* __b, size_t __s)
+ constexpr initializer_list(const _E* __b, size_t __s)
: __begin_(__b),
+#ifdef USE_END
+ __end_(__b + __s)
+#else
__size_(__s)
+#endif
{}
public:
@@ -24,14 +34,99 @@ namespace std {
typedef const _E* iterator;
typedef const _E* const_iterator;
- initializer_list() : __begin_(nullptr), __size_(0) {}
+#ifdef USE_END
+ constexpr initializer_list() : __begin_(nullptr), __end_(nullptr) {}
+
+ size_t size() const {return __end_ - __begin_;}
+ const _E* begin() const {return __begin_;}
+ const _E* end() const {return __end_;}
+#else
+ constexpr initializer_list() : __begin_(nullptr), __size_(0) {}
size_t size() const {return __size_;}
const _E* begin() const {return __begin_;}
const _E* end() const {return __begin_ + __size_;}
+#endif
};
}
-std::initializer_list<std::initializer_list<int>> pleasefail = {
- {1, 2}, {3, 4}, {5, 6} // expected-error {{cannot compile}}
+constexpr int a = 2, b = 4, c = 6;
+std::initializer_list<std::initializer_list<int>> nested = {
+ {1, a}, {3, b}, {5, c}
};
+
+// CHECK-STATIC-BL: @_ZGR6nested = private constant [2 x i32] [i32 1, i32 2], align 4
+// CHECK-STATIC-BL: @_ZGR6nested1 = private constant [2 x i32] [i32 3, i32 4], align 4
+// CHECK-STATIC-BL: @_ZGR6nested2 = private constant [2 x i32] [i32 5, i32 6], align 4
+// CHECK-STATIC-BL: @_ZGR6nested3 = private constant [3 x {{.*}}] [
+// CHECK-STATIC-BL: {{.*}} { i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested, i32 0, i32 0), i64 2 },
+// CHECK-STATIC-BL: {{.*}} { i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested1, i32 0, i32 0), i64 2 },
+// CHECK-STATIC-BL: {{.*}} { i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested2, i32 0, i32 0), i64 2 }
+// CHECK-STATIC-BL: ], align 8
+// CHECK-STATIC-BL: @nested = global {{.*}} { {{.*}} getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested3, i32 0, i32 0), i64 3 }, align 8
+
+// CHECK-DYNAMIC-BL: @nested = global
+// CHECK-DYNAMIC-BL: @_ZGR6nested = private global [3 x
+// CHECK-DYNAMIC-BL: @_ZGR6nested1 = private global [2 x i32] zeroinitializer
+// CHECK-DYNAMIC-BL: @_ZGR6nested2 = private global [2 x i32] zeroinitializer
+// CHECK-DYNAMIC-BL: @_ZGR6nested3 = private global [2 x i32] zeroinitializer
+// CHECK-DYNAMIC-BL: store i32 1, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested1, i64 0, i64 0)
+// CHECK-DYNAMIC-BL: store i32 {{.*}}, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested1, i64 0, i64 1)
+// CHECK-DYNAMIC-BL: store i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested1, i64 0, i64 0),
+// CHECK-DYMAMIC-BL: i32** getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 0, i32 0), align 8
+// CHECK-DYNAMIC-BL: store i64 2, i64* getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 0, i32 1), align 8
+// CHECK-DYNAMIC-BL: store i32 3, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested2, i64 0, i64 0)
+// CHECK-DYNAMIC-BL: store i32 {{.*}}, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested2, i64 0, i64 1)
+// CHECK-DYNAMIC-BL: store i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested2, i64 0, i64 0),
+// CHECK-DYNAMIC-BL: i32** getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 1, i32 0), align 8
+// CHECK-DYNAMIC-BL: store i64 2, i64* getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 1, i32 1), align 8
+// CHECK-DYNAMIC-BL: store i32 5, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested3, i64 0, i64 0)
+// CHECK-DYNAMIC-BL: store i32 {{.*}}, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested3, i64 0, i64 1)
+// CHECK-DYNAMIC-BL: store i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested3, i64 0, i64 0),
+// CHECK-DYNAMIC-BL: i32** getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 2, i32 0), align 8
+// CHECK-DYNAMIC-BL: store i64 2, i64* getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 2, i32 1), align 8
+// CHECK-DYNAMIC-BL: store {{.*}}* getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 0),
+// CHECK-DYNAMIC-BL: {{.*}}** getelementptr inbounds ({{.*}}* @nested, i32 0, i32 0), align 8
+// CHECK-DYNAMIC-BL: store i64 3, i64* getelementptr inbounds ({{.*}}* @nested, i32 0, i32 1), align 8
+
+// CHECK-STATIC-BE: @_ZGR6nested = private constant [2 x i32] [i32 1, i32 2], align 4
+// CHECK-STATIC-BE: @_ZGR6nested1 = private constant [2 x i32] [i32 3, i32 4], align 4
+// CHECK-STATIC-BE: @_ZGR6nested2 = private constant [2 x i32] [i32 5, i32 6], align 4
+// CHECK-STATIC-BE: @_ZGR6nested3 = private constant [3 x {{.*}}] [
+// CHECK-STATIC-BE: {{.*}} { i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested, i32 0, i32 0),
+// CHECK-STATIC-BE: i32* bitcast (i8* getelementptr (i8* bitcast ([2 x i32]* @_ZGR6nested to i8*), i64 8) to i32*) }
+// CHECK-STATIC-BE: {{.*}} { i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested1, i32 0, i32 0),
+// CHECK-STATIC-BE: i32* bitcast (i8* getelementptr (i8* bitcast ([2 x i32]* @_ZGR6nested1 to i8*), i64 8) to i32*) }
+// CHECK-STATIC-BE: {{.*}} { i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested2, i32 0, i32 0),
+// CHECK-STATIC-BE: i32* bitcast (i8* getelementptr (i8* bitcast ([2 x i32]* @_ZGR6nested2 to i8*), i64 8) to i32*) }
+// CHECK-STATIC-BE: ], align 8
+// CHECK-STATIC-BE: @nested = global {{.*}} { {{.*}} getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested3, i32 0, i32 0),
+// CHECK-STATIC-BE: {{.*}} bitcast ({{.*}}* getelementptr (i8* bitcast ([3 x {{.*}}]* @_ZGR6nested3 to i8*), i64 48) to {{.*}}*) }
+
+// CHECK-DYNAMIC-BE: @nested = global
+// CHECK-DYNAMIC-BE: @_ZGR6nested = private global [3 x
+// CHECK-DYNAMIC-BE: @_ZGR6nested1 = private global [2 x i32] zeroinitializer
+// CHECK-DYNAMIC-BE: @_ZGR6nested2 = private global [2 x i32] zeroinitializer
+// CHECK-DYNAMIC-BE: @_ZGR6nested3 = private global [2 x i32] zeroinitializer
+// CHECK-DYNAMIC-BE: store i32 1, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested1, i64 0, i64 0)
+// CHECK-DYNAMIC-BE: store i32 {{.*}}, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested1, i64 0, i64 1)
+// CHECK-DYNAMIC-BE: store i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested1, i64 0, i64 0),
+// CHECK-DYMAMIC-BE: i32** getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 0, i32 0), align 8
+// CHECK-DYNAMIC-BE: store i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested1, i64 1, i64 0),
+// CHECK-DYMAMIC-BE: i32** getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 0, i32 1), align 8
+// CHECK-DYNAMIC-BE: store i32 3, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested2, i64 0, i64 0)
+// CHECK-DYNAMIC-BE: store i32 {{.*}}, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested2, i64 0, i64 1)
+// CHECK-DYNAMIC-BE: store i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested2, i64 0, i64 0),
+// CHECK-DYNAMIC-BE: i32** getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 1, i32 0), align 8
+// CHECK-DYNAMIC-BE: store i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested2, i64 1, i64 0),
+// CHECK-DYNAMIC-BE: i32** getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 1, i32 1), align 8
+// CHECK-DYNAMIC-BE: store i32 5, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested3, i64 0, i64 0)
+// CHECK-DYNAMIC-BE: store i32 {{.*}}, i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested3, i64 0, i64 1)
+// CHECK-DYNAMIC-BE: store i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested3, i64 0, i64 0),
+// CHECK-DYNAMIC-BE: i32** getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 2, i32 0), align 8
+// CHECK-DYNAMIC-BE: store i32* getelementptr inbounds ([2 x i32]* @_ZGR6nested3, i64 1, i64 0),
+// CHECK-DYNAMIC-BE: i32** getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 2, i32 1), align 8
+// CHECK-DYNAMIC-BE: store {{.*}}* getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 0, i64 0),
+// CHECK-DYNAMIC-BE: {{.*}}** getelementptr inbounds ({{.*}}* @nested, i32 0, i32 0), align 8
+// CHECK-DYNAMIC-BE: store {{.*}}* getelementptr inbounds ([3 x {{.*}}]* @_ZGR6nested, i64 1, i64 0),
+// CHECK-DYNAMIC-BE: {{.*}}** getelementptr inbounds ({{.*}}* @nested, i32 0, i32 1), align 8
diff --git a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-startend.cpp b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-startend.cpp
index 209ee6513855..8e0d161bc0f4 100644
--- a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-startend.cpp
+++ b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-startend.cpp
@@ -32,12 +32,12 @@ namespace std {
};
}
-// CHECK: @_ZL25globalInitList1__initlist = internal global [3 x i32] [i32 1, i32 2, i32 3]
-// CHECK: @globalInitList1 = global {{[^ ]+}} { i32* getelementptr inbounds ([3 x i32]* @_ZL25globalInitList1__initlist, {{[^)]*}}), i32*
+// CHECK: @_ZGR15globalInitList1 = private constant [3 x i32] [i32 1, i32 2, i32 3]
+// CHECK: @globalInitList1 = global {{[^ ]+}} { i32* getelementptr inbounds ([3 x i32]* @_ZGR15globalInitList1, {{[^)]*}}), i32*
std::initializer_list<int> globalInitList1 = {1, 2, 3};
void fn1(int i) {
- // CHECK: define void @_Z3fn1i
+ // CHECK-LABEL: define void @_Z3fn1i
// temporary array
// CHECK: [[array:%[^ ]+]] = alloca [3 x i32]
// CHECK: getelementptr inbounds [3 x i32]* [[array]], i{{32|64}} 0
@@ -66,7 +66,7 @@ struct destroyme2 {
void fn2() {
- // CHECK: define void @_Z3fn2v
+ // CHECK-LABEL: define void @_Z3fn2v
void target(std::initializer_list<destroyme1>);
// objects should be destroyed before dm2, after call returns
target({ destroyme1(), destroyme1() });
@@ -76,7 +76,7 @@ void fn2() {
}
void fn3() {
- // CHECK: define void @_Z3fn3v
+ // CHECK-LABEL: define void @_Z3fn3v
// objects should be destroyed after dm2
auto list = { destroyme1(), destroyme1() };
destroyme2 dm2;
diff --git a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
index d683493a83d8..164cbce027ef 100644
--- a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
+++ b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
@@ -47,23 +47,48 @@ struct wantslist1 {
~wantslist1();
};
-// CHECK: @_ZL25globalInitList1__initlist = internal global [3 x i32] [i32 1, i32 2, i32 3]
-// CHECK: @globalInitList1 = global %{{[^ ]+}} { i32* getelementptr inbounds ([3 x i32]* @_ZL25globalInitList1__initlist, i32 0, i32 0), i{{32|64}} 3 }
+// CHECK: @_ZGR15globalInitList1 = private constant [3 x i32] [i32 1, i32 2, i32 3]
+// CHECK: @globalInitList1 = global %{{[^ ]+}} { i32* getelementptr inbounds ([3 x i32]* @_ZGR15globalInitList1, i32 0, i32 0), i{{32|64}} 3 }
std::initializer_list<int> globalInitList1 = {1, 2, 3};
namespace thread_local_global_array {
- // CHECK: @_ZN25thread_local_global_arrayL11x__initlistE = internal thread_local global [4 x i32] [i32 1, i32 2, i32 3, i32 4]
- // CHECK: @_ZN25thread_local_global_array1xE = thread_local global {{.*}} @_ZN25thread_local_global_arrayL11x__initlistE, {{.*}} i64 4
+ // FIXME: We should be able to constant-evaluate this even though the
+ // initializer is not a constant expression (pointers to thread_local
+ // objects aren't really a problem).
+ //
+ // CHECK: @_ZN25thread_local_global_array1xE = thread_local global
+ // CHECK: @_ZGRN25thread_local_global_array1xE = private thread_local constant [4 x i32] [i32 1, i32 2, i32 3, i32 4]
std::initializer_list<int> thread_local x = { 1, 2, 3, 4 };
}
-// CHECK: @_ZL25globalInitList2__initlist = internal global [2 x %{{[^ ]*}}] zeroinitializer
-// CHECK: @globalInitList2 = global %{{[^ ]+}} { %[[WITHARG:[^ *]+]]* getelementptr inbounds ([2 x
+// CHECK: @globalInitList2 = global %{{[^ ]+}} zeroinitializer
+// CHECK: @_ZGR15globalInitList2 = private global [2 x %[[WITHARG:[^ ]*]]] zeroinitializer
+
+// CHECK: @_ZN15partly_constant1kE = global i32 0, align 4
+// CHECK: @_ZN15partly_constant2ilE = global {{.*}} null, align 8
+// CHECK: @[[PARTLY_CONSTANT_OUTER:_ZGRN15partly_constant2ilE.*]] = private global {{.*}} zeroinitializer, align 8
+// CHECK: @[[PARTLY_CONSTANT_INNER:_ZGRN15partly_constant2ilE.*]] = private global [3 x {{.*}}] zeroinitializer, align 8
+// CHECK: @[[PARTLY_CONSTANT_FIRST:_ZGRN15partly_constant2ilE.*]] = private constant [3 x i32] [i32 1, i32 2, i32 3], align 4
+// CHECK: @[[PARTLY_CONSTANT_SECOND:_ZGRN15partly_constant2ilE.*]] = private global [2 x i32] zeroinitializer, align 4
+// CHECK: @[[PARTLY_CONSTANT_THIRD:_ZGRN15partly_constant2ilE.*]] = private constant [4 x i32] [i32 5, i32 6, i32 7, i32 8], align 4
+
// CHECK: appending global
-// CHECK: define internal void
-// CHECK: call void @_ZN8witharg1C1ERK10destroyme1(%[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]]* @_ZL25globalInitList2__initlist, i{{32|64}} 0, i{{32|64}} 0
-// CHECK: call void @_ZN8witharg1C1ERK10destroyme1(%[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]]* @_ZL25globalInitList2__initlist, i{{32|64}} 0, i{{32|64}} 1
+
+
+// thread_local initializer:
+// CHECK-LABEL: define internal void
+// CHECK: store i32* getelementptr inbounds ([4 x i32]* @_ZGRN25thread_local_global_array1xE, i64 0, i64 0),
+// CHECK: i32** getelementptr inbounds ({{.*}}* @_ZN25thread_local_global_array1xE, i32 0, i32 0), align 8
+// CHECK: store i64 4, i64* getelementptr inbounds ({{.*}}* @_ZN25thread_local_global_array1xE, i32 0, i32 1), align 8
+
+
+// CHECK-LABEL: define internal void
+// CHECK: call void @_ZN8witharg1C1ERK10destroyme1(%[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]]* @_ZGR15globalInitList2, i{{32|64}} 0, i{{32|64}} 0
+// CHECK: call void @_ZN8witharg1C1ERK10destroyme1(%[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]]* @_ZGR15globalInitList2, i{{32|64}} 0, i{{32|64}} 1
// CHECK: __cxa_atexit
+// CHECK: store %[[WITHARG]]* getelementptr inbounds ([2 x %[[WITHARG]]]* @_ZGR15globalInitList2, i64 0, i64 0),
+// CHECK: %[[WITHARG]]** getelementptr inbounds (%{{.*}}* @globalInitList2, i32 0, i32 0), align 8
+// CHECK: store i64 2, i64* getelementptr inbounds (%{{.*}}* @globalInitList2, i32 0, i32 1), align 8
// CHECK: call void @_ZN10destroyme1D1Ev
// CHECK: call void @_ZN10destroyme1D1Ev
std::initializer_list<witharg1> globalInitList2 = {
@@ -71,7 +96,7 @@ std::initializer_list<witharg1> globalInitList2 = {
};
void fn1(int i) {
- // CHECK: define void @_Z3fn1i
+ // CHECK-LABEL: define void @_Z3fn1i
// temporary array
// CHECK: [[array:%[^ ]+]] = alloca [3 x i32]
// CHECK: getelementptr inbounds [3 x i32]* [[array]], i{{32|64}} 0
@@ -91,7 +116,7 @@ void fn1(int i) {
}
void fn2() {
- // CHECK: define void @_Z3fn2v
+ // CHECK-LABEL: define void @_Z3fn2v
void target(std::initializer_list<destroyme1>);
// objects should be destroyed before dm2, after call returns
// CHECK: call void @_Z6targetSt16initializer_listI10destroyme1E
@@ -102,7 +127,7 @@ void fn2() {
}
void fn3() {
- // CHECK: define void @_Z3fn3v
+ // CHECK-LABEL: define void @_Z3fn3v
// objects should be destroyed after dm2
auto list = { destroyme1(), destroyme1() };
destroyme2 dm2;
@@ -111,7 +136,7 @@ void fn3() {
}
void fn4() {
- // CHECK: define void @_Z3fn4v
+ // CHECK-LABEL: define void @_Z3fn4v
void target(std::initializer_list<witharg1>);
// objects should be destroyed before dm2, after call returns
// CHECK: call void @_ZN8witharg1C1ERK10destroyme1
@@ -124,7 +149,7 @@ void fn4() {
}
void fn5() {
- // CHECK: define void @_Z3fn5v
+ // CHECK-LABEL: define void @_Z3fn5v
// temps should be destroyed before dm2
// objects should be destroyed after dm2
// CHECK: call void @_ZN8witharg1C1ERK10destroyme1
@@ -136,7 +161,7 @@ void fn5() {
}
void fn6() {
- // CHECK: define void @_Z3fn6v
+ // CHECK-LABEL: define void @_Z3fn6v
void target(const wantslist1&);
// objects should be destroyed before dm2, after call returns
// CHECK: call void @_ZN10wantslist1C1ESt16initializer_listI10destroyme1E
@@ -149,7 +174,7 @@ void fn6() {
}
void fn7() {
- // CHECK: define void @_Z3fn7v
+ // CHECK-LABEL: define void @_Z3fn7v
// temps should be destroyed before dm2
// object should be destroyed after dm2
// CHECK: call void @_ZN10wantslist1C1ESt16initializer_listI10destroyme1E
@@ -161,7 +186,7 @@ void fn7() {
}
void fn8() {
- // CHECK: define void @_Z3fn8v
+ // CHECK-LABEL: define void @_Z3fn8v
void target(std::initializer_list<std::initializer_list<destroyme1>>);
// objects should be destroyed before dm2, after call returns
// CHECK: call void @_Z6targetSt16initializer_listIS_I10destroyme1EE
@@ -175,7 +200,7 @@ void fn8() {
}
void fn9() {
- // CHECK: define void @_Z3fn9v
+ // CHECK-LABEL: define void @_Z3fn9v
// objects should be destroyed after dm2
std::initializer_list<destroyme1> inner;
std::initializer_list<std::initializer_list<destroyme1>> list =
@@ -193,7 +218,7 @@ struct haslist1 {
haslist1();
};
-// CHECK: define void @_ZN8haslist1C2Ev
+// CHECK-LABEL: define void @_ZN8haslist1C2Ev
haslist1::haslist1()
// CHECK: alloca [3 x i32]
// CHECK: store i32 1
@@ -210,7 +235,7 @@ struct haslist2 {
haslist2();
};
-// CHECK: define void @_ZN8haslist2C2Ev
+// CHECK-LABEL: define void @_ZN8haslist2C2Ev
haslist2::haslist2()
: il{destroyme1(), destroyme1()}
{
@@ -220,7 +245,7 @@ haslist2::haslist2()
}
void fn10() {
- // CHECK: define void @_Z4fn10v
+ // CHECK-LABEL: define void @_Z4fn10v
// CHECK: alloca [3 x i32]
// CHECK: call noalias i8* @_Znw{{[jm]}}
// CHECK: store i32 1
@@ -232,7 +257,7 @@ void fn10() {
}
void fn11() {
- // CHECK: define void @_Z4fn11v
+ // CHECK-LABEL: define void @_Z4fn11v
(void) new std::initializer_list<destroyme1> {destroyme1(), destroyme1()};
// CHECK: call void @_ZN10destroyme1D1Ev
destroyme2 dm2;
@@ -260,7 +285,7 @@ namespace PR12178 {
namespace rdar13325066 {
struct X { ~X(); };
- // CHECK: define void @_ZN12rdar133250664loopERNS_1XES1_
+ // CHECK-LABEL: define void @_ZN12rdar133250664loopERNS_1XES1_
void loop(X &x1, X &x2) {
// CHECK: br label
// CHECK: br i1
@@ -275,3 +300,134 @@ namespace rdar13325066 {
for (X x : { x1, x2 }) { }
}
}
+
+namespace dtors {
+ struct S {
+ S();
+ ~S();
+ };
+ void z();
+
+ // CHECK-LABEL: define void @_ZN5dtors1fEv(
+ void f() {
+ // CHECK: call void @_ZN5dtors1SC1Ev(
+ // CHECK: call void @_ZN5dtors1SC1Ev(
+ std::initializer_list<S>{ S(), S() };
+
+ // Destruction loop for underlying array.
+ // CHECK: br label
+ // CHECK: call void @_ZN5dtors1SD1Ev(
+ // CHECK: br i1
+
+ // CHECK: call void @_ZN5dtors1zEv(
+ z();
+
+ // CHECK-NOT: call void @_ZN5dtors1SD1Ev(
+ }
+
+ // CHECK-LABEL: define void @_ZN5dtors1gEv(
+ void g() {
+ // CHECK: call void @_ZN5dtors1SC1Ev(
+ // CHECK: call void @_ZN5dtors1SC1Ev(
+ auto x = std::initializer_list<S>{ S(), S() };
+
+ // Destruction loop for underlying array.
+ // CHECK: br label
+ // CHECK: call void @_ZN5dtors1SD1Ev(
+ // CHECK: br i1
+
+ // CHECK: call void @_ZN5dtors1zEv(
+ z();
+
+ // CHECK-NOT: call void @_ZN5dtors1SD1Ev(
+ }
+
+ // CHECK-LABEL: define void @_ZN5dtors1hEv(
+ void h() {
+ // CHECK: call void @_ZN5dtors1SC1Ev(
+ // CHECK: call void @_ZN5dtors1SC1Ev(
+ std::initializer_list<S> x = { S(), S() };
+
+ // CHECK-NOT: call void @_ZN5dtors1SD1Ev(
+
+ // CHECK: call void @_ZN5dtors1zEv(
+ z();
+
+ // Destruction loop for underlying array.
+ // CHECK: br label
+ // CHECK: call void @_ZN5dtors1SD1Ev(
+ // CHECK: br i1
+ }
+}
+
+namespace partly_constant {
+ int k;
+ std::initializer_list<std::initializer_list<int>> &&il = { { 1, 2, 3 }, { 4, k }, { 5, 6, 7, 8 } };
+ // First init list.
+ // CHECK-NOT: @[[PARTLY_CONSTANT_FIRST]],
+ // CHECK: store i32* getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_FIRST]], i64 0, i64 0),
+ // CHECK: i32** getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_INNER]], i64 0, i64 0, i32 0)
+ // CHECK: store i64 3, i64* getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_INNER]], i64 0, i64 0, i32 1)
+ // CHECK-NOT: @[[PARTLY_CONSTANT_FIRST]],
+ //
+ // Second init list array (non-constant).
+ // CHECK: store i32 4, i32* getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_SECOND]], i64 0, i64 0)
+ // CHECK: load i32* @_ZN15partly_constant1kE
+ // CHECK: store i32 {{.*}}, i32* getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_SECOND]], i64 0, i64 1)
+ //
+ // Second init list.
+ // CHECK: store i32* getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_SECOND]], i64 0, i64 0),
+ // CHECK: i32** getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_INNER]], i64 0, i64 1, i32 0)
+ // CHECK: store i64 2, i64* getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_INNER]], i64 0, i64 1, i32 1)
+ //
+ // Third init list.
+ // CHECK-NOT: @[[PARTLY_CONSTANT_THIRD]],
+ // CHECK: store i32* getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_THIRD]], i64 0, i64 0),
+ // CHECK: i32** getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_INNER]], i64 0, i64 2, i32 0)
+ // CHECK: store i64 4, i64* getelementptr inbounds ({{.*}}* @_ZGRN15partly_constant2ilE4, i64 0, i64 2, i32 1)
+ // CHECK-NOT: @[[PARTLY_CONSTANT_THIRD]],
+ //
+ // Outer init list.
+ // CHECK: store {{.*}}* getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_INNER]], i64 0, i64 0),
+ // CHECK: {{.*}}** getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_OUTER]], i32 0, i32 0)
+ // CHECK: store i64 3, i64* getelementptr inbounds ({{.*}}* @[[PARTLY_CONSTANT_OUTER]], i32 0, i32 1)
+ //
+ // 'il' reference.
+ // CHECK: store {{.*}}* @[[PARTLY_CONSTANT_OUTER]], {{.*}}** @_ZN15partly_constant2ilE, align 8
+}
+
+namespace nested {
+ struct A { A(); ~A(); };
+ struct B { const A &a; ~B(); };
+ struct C { std::initializer_list<B> b; ~C(); };
+ void f();
+ // CHECK-LABEL: define void @_ZN6nested1gEv(
+ void g() {
+ // CHECK: call void @_ZN6nested1AC1Ev(
+ // CHECK-NOT: call
+ // CHECK: call void @_ZN6nested1AC1Ev(
+ // CHECK-NOT: call
+ const C &c { { { A() }, { A() } } };
+
+ // CHECK: call void @_ZN6nested1fEv(
+ // CHECK-NOT: call
+ f();
+
+ // CHECK: call void @_ZN6nested1CD1Ev(
+ // CHECK-NOT: call
+
+ // Destroy B[2] array.
+ // FIXME: This isn't technically correct: reverse construction order would
+ // destroy the second B then the second A then the first B then the first A.
+ // CHECK: call void @_ZN6nested1BD1Ev(
+ // CHECK-NOT: call
+ // CHECK: br
+
+ // CHECK-NOT: call
+ // CHECK: call void @_ZN6nested1AD1Ev(
+ // CHECK-NOT: call
+ // CHECK: call void @_ZN6nested1AD1Ev(
+ // CHECK-NOT: call
+ // CHECK: }
+ }
+}
diff --git a/test/CodeGenCXX/cxx11-exception-spec.cpp b/test/CodeGenCXX/cxx11-exception-spec.cpp
index 49ca8610f28f..96ea1d7f00ed 100644
--- a/test/CodeGenCXX/cxx11-exception-spec.cpp
+++ b/test/CodeGenCXX/cxx11-exception-spec.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -verify -fexceptions -fcxx-exceptions -triple x86_64-linux-gnu | FileCheck %s
+// RUN: not %clang_cc1 -std=c++11 -emit-llvm %s -o - -verify -fexceptions -fcxx-exceptions -triple x86_64-linux-gnu | FileCheck %s
void h();
diff --git a/test/CodeGenCXX/cxx11-initializer-array-new.cpp b/test/CodeGenCXX/cxx11-initializer-array-new.cpp
new file mode 100644
index 000000000000..23577bec661a
--- /dev/null
+++ b/test/CodeGenCXX/cxx11-initializer-array-new.cpp
@@ -0,0 +1,106 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 %s -emit-llvm -o - | FileCheck %s
+
+// PR10878
+
+struct S { S(); S(int); ~S(); int n; };
+
+void *p = new S[2][3]{ { 1, 2, 3 }, { 4, 5, 6 } };
+
+// CHECK-LABEL: define
+// CHECK: %[[ALLOC:.*]] = call noalias i8* @_Znam(i64 32)
+// CHECK: %[[COOKIE:.*]] = bitcast i8* %[[ALLOC]] to i64*
+// CHECK: store i64 6, i64* %[[COOKIE]]
+// CHECK: %[[START_AS_i8:.*]] = getelementptr inbounds i8* %[[ALLOC]], i64 8
+// CHECK: %[[START_AS_S:.*]] = bitcast i8* %[[START_AS_i8]] to %[[S:.*]]*
+//
+// Explicit initializers:
+//
+// { 1, 2, 3 }
+//
+// CHECK: %[[S_0:.*]] = bitcast %[[S]]* %[[START_AS_S]] to [3 x %[[S]]]*
+//
+// CHECK: %[[S_0_0:.*]] = getelementptr inbounds [3 x %[[S]]]* %[[S_0]], i64 0, i64 0
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_0_0]], i32 1)
+// CHECK: %[[S_0_1:.*]] = getelementptr inbounds %[[S]]* %[[S_0_0]], i64 1
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_0_1]], i32 2)
+// CHECK: %[[S_0_2:.*]] = getelementptr inbounds %[[S]]* %[[S_0_1]], i64 1
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_0_2]], i32 3)
+//
+// { 4, 5, 6 }
+//
+// CHECK: %[[S_1:.*]] = getelementptr [3 x %[[S]]]* %[[S_0]], i32 1
+//
+// CHECK: %[[S_1_0:.*]] = getelementptr inbounds [3 x %[[S]]]* %[[S_1]], i64 0, i64 0
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_1_0]], i32 4)
+// CHECK: %[[S_1_1:.*]] = getelementptr inbounds %[[S]]* %[[S_1_0]], i64 1
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_1_1]], i32 5)
+// CHECK: %[[S_1_2:.*]] = getelementptr inbounds %[[S]]* %[[S_1_1]], i64 1
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_1_2]], i32 6)
+//
+// CHECK-NOT: br i1
+// CHECK-NOT: call
+// CHECK: }
+
+int n;
+void *q = new S[n][3]{ { 1, 2, 3 }, { 4, 5, 6 } };
+
+// CHECK-LABEL: define
+//
+// CHECK: load i32* @n
+// CHECK: call {{.*}} @llvm.umul.with.overflow.i64(i64 %[[N:.*]], i64 12)
+// CHECK: %[[ELTS:.*]] = mul i64 %[[N]], 3
+// CHECK: call {{.*}} @llvm.uadd.with.overflow.i64(i64 %{{.*}}, i64 8)
+// CHECK: %[[ALLOC:.*]] = call noalias i8* @_Znam(i64 %{{.*}})
+//
+// CHECK: %[[COOKIE:.*]] = bitcast i8* %[[ALLOC]] to i64*
+// CHECK: store i64 %[[ELTS]], i64* %[[COOKIE]]
+// CHECK: %[[START_AS_i8:.*]] = getelementptr inbounds i8* %[[ALLOC]], i64 8
+// CHECK: %[[START_AS_S:.*]] = bitcast i8* %[[START_AS_i8]] to %[[S]]*
+// CHECK: %[[END_AS_S:.*]] = getelementptr inbounds %[[S]]* %[[START_AS_S]], i64 %[[ELTS]]
+//
+// Explicit initializers:
+//
+// { 1, 2, 3 }
+//
+// CHECK: %[[S_0:.*]] = bitcast %[[S]]* %[[START_AS_S]] to [3 x %[[S]]]*
+//
+// CHECK: %[[S_0_0:.*]] = getelementptr inbounds [3 x %[[S]]]* %[[S_0]], i64 0, i64 0
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_0_0]], i32 1)
+// CHECK: %[[S_0_1:.*]] = getelementptr inbounds %[[S]]* %[[S_0_0]], i64 1
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_0_1]], i32 2)
+// CHECK: %[[S_0_2:.*]] = getelementptr inbounds %[[S]]* %[[S_0_1]], i64 1
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_0_2]], i32 3)
+//
+// { 4, 5, 6 }
+//
+// CHECK: %[[S_1:.*]] = getelementptr [3 x %[[S]]]* %[[S_0]], i32 1
+//
+// CHECK: %[[S_1_0:.*]] = getelementptr inbounds [3 x %[[S]]]* %[[S_1]], i64 0, i64 0
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_1_0]], i32 4)
+// CHECK: %[[S_1_1:.*]] = getelementptr inbounds %[[S]]* %[[S_1_0]], i64 1
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_1_1]], i32 5)
+// CHECK: %[[S_1_2:.*]] = getelementptr inbounds %[[S]]* %[[S_1_1]], i64 1
+// CHECK: call void @_ZN1SC1Ei(%[[S]]* %[[S_1_2]], i32 6)
+//
+// CHECK: %[[S_2:.*]] = getelementptr [3 x %[[S]]]* %[[S_1]], i32 1
+// CHECK: %[[S_2_AS_S:.*]] = bitcast [3 x %[[S]]]* %[[S_2]] to %[[S]]*
+// CHECK: icmp eq %[[S]]* %[[S_2_AS_S]], %[[END_AS_S]]
+// CHECK: br i1
+//
+// S[n-2][3] initialization loop:
+//
+// CHECK: %[[END_INNER:.*]] = getelementptr inbounds %[[S]]* %{{.*}}, i64 3
+// CHECK: br label
+//
+// S[3] initialization loop:
+//
+// CHECK: call void @_ZN1SC1Ev(%[[S]]*
+// CHECK: %[[NEXT_INNER:.*]] = getelementptr inbounds %[[S]]* %{{.*}}, i64 1
+// CHECK: icmp eq %[[S]]* %[[NEXT_INNER]], %[[END_INNER]]
+// CHECK: br i1
+//
+// CHECK: %[[NEXT_OUTER:.*]] = getelementptr %[[S]]* %{{.*}}, i32 1
+// CHECK: icmp eq %[[S]]* %[[NEXT_OUTER]], %[[END_AS_S]]
+// CHECK: br i1
+//
+// CHECK: }
diff --git a/test/CodeGenCXX/cxx11-thread-local-reference.cpp b/test/CodeGenCXX/cxx11-thread-local-reference.cpp
index 2ea9acda4815..7759d41b0f92 100644
--- a/test/CodeGenCXX/cxx11-thread-local-reference.cpp
+++ b/test/CodeGenCXX/cxx11-thread-local-reference.cpp
@@ -13,7 +13,7 @@ int &g() { return r; }
// CHECK: call i32* @_Z1fv()
// CHECK: store i32* %{{.*}}, i32** @r, align 8
-// CHECK: define i32* @_Z1gv()
+// CHECK-LABEL: define i32* @_Z1gv()
// CHECK: call i32* @_ZTW1r()
// CHECK: ret i32* %{{.*}}
@@ -22,5 +22,5 @@ int &g() { return r; }
// CHECK: load i32** @r, align 8
// CHECK: ret i32* %{{.*}}
-// CHECK: define internal void @__tls_init()
+// CHECK-LABEL: define internal void @__tls_init()
// CHECK: call void @[[R_INIT]]()
diff --git a/test/CodeGenCXX/cxx11-thread-local.cpp b/test/CodeGenCXX/cxx11-thread-local.cpp
index a7141d133bbe..509562dd8fc1 100644
--- a/test/CodeGenCXX/cxx11-thread-local.cpp
+++ b/test/CodeGenCXX/cxx11-thread-local.cpp
@@ -35,7 +35,7 @@ int e = V<int>::m;
// CHECK: @_ZZ8tls_dtorvE1u = internal thread_local global
// CHECK: @_ZGVZ8tls_dtorvE1u = internal thread_local global i8 0
-// CHECK: @_ZGRZ8tls_dtorvE1u = internal thread_local global
+// CHECK: @_ZGRZ8tls_dtorvE1u = private thread_local global
// CHECK: @_ZGVN1VIiE1mE = weak_odr thread_local global i64 0
@@ -55,7 +55,7 @@ int e = V<int>::m;
// CHECK: call i32 @_Z1fv()
// CHECK-NEXT: store i32 {{.*}}, i32* @a, align 4
-// CHECK: define i32 @_Z1fv()
+// CHECK-LABEL: define i32 @_Z1fv()
int f() {
// CHECK: %[[GUARD:.*]] = load i8* @_ZGVZ1fvE1n, align 1
// CHECK: %[[NEED_INIT:.*]] = icmp eq i8 %[[GUARD]], 0
@@ -76,7 +76,7 @@ int f() {
// CHECK-NEXT: load i32* %{{.*}}, align 4
// CHECK-NEXT: store i32 %{{.*}}, i32* @c, align 4
-// CHECK: define weak_odr hidden i32* @_ZTW1b()
+// CHECK-LABEL: define weak_odr hidden i32* @_ZTW1b()
// CHECK: br i1 icmp ne (void ()* @_ZTH1b, void ()* null),
// not null:
// CHECK: call void @_ZTH1b()
@@ -97,7 +97,7 @@ int f() {
// CHECK-NEXT: load i32* %{{.*}}, align 4
// CHECK-NEXT: store i32 %{{.*}}, i32* @e, align 4
-// CHECK: define weak_odr hidden i32* @_ZTWN1VIiE1mE()
+// CHECK-LABEL: define weak_odr hidden i32* @_ZTWN1VIiE1mE()
// CHECK: call void @_ZTHN1VIiE1mE()
// CHECK: ret i32* @_ZN1VIiE1mE
@@ -105,7 +105,7 @@ int f() {
struct S { S(); ~S(); };
struct T { ~T(); };
-// CHECK: define void @_Z8tls_dtorv()
+// CHECK-LABEL: define void @_Z8tls_dtorv()
void tls_dtor() {
// CHECK: load i8* @_ZGVZ8tls_dtorvE1s
// CHECK: call void @_ZN1SC1Ev(%struct.S* @_ZZ8tls_dtorvE1s)
@@ -128,6 +128,13 @@ void tls_dtor() {
// CHECK: declare i32 @__cxa_thread_atexit(void (i8*)*, i8*, i8*)
+// CHECK: define {{.*}} @_Z7PR15991v(
+int PR15991() {
+ thread_local int n;
+ auto l = [] { return n; };
+ return l();
+}
+
// CHECK: define {{.*}} @[[V_M_INIT:.*]]()
// CHECK: load i8* bitcast (i64* @_ZGVN1VIiE1mE to i8*)
// CHECK: %[[V_M_INITIALIZED:.*]] = icmp eq i8 %{{.*}}, 0
@@ -164,10 +171,10 @@ void tls_dtor() {
// CHECK: declare extern_weak void @_ZTH1b()
-// CHECK: define internal hidden i32* @_ZTWL1d()
+// CHECK-LABEL: define internal hidden i32* @_ZTWL1d()
// CHECK: call void @_ZTHL1d()
// CHECK: ret i32* @_ZL1d
-// CHECK: define weak_odr hidden i32* @_ZTWN1U1mE()
+// CHECK-LABEL: define weak_odr hidden i32* @_ZTWN1U1mE()
// CHECK: call void @_ZTHN1U1mE()
// CHECK: ret i32* @_ZN1U1mE
diff --git a/test/CodeGenCXX/cxx1y-deduced-return-type.cpp b/test/CodeGenCXX/cxx1y-deduced-return-type.cpp
new file mode 100644
index 000000000000..6d15a2246df0
--- /dev/null
+++ b/test/CodeGenCXX/cxx1y-deduced-return-type.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -std=c++1y -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s
+
+// CHECK: @x = global {{.*}} zeroinitializer
+
+// CHECK: define {{.*}} @_Z1fv
+inline auto f() {
+ int n = 0;
+ // CHECK: load i32
+ // CHECK: store i32
+ // CHECK: ret
+ return [=] () mutable { return ++n; };
+}
+
+auto x = f();
+
+template<typename T> auto *g(T t) { return t; }
+template<typename T> decltype(auto) h(T t) { return t; }
+
+// CHECK: define {{.*}} @_Z1zv
+void z() {
+ // CHECK: call {{.*}} @_Z1gIPZ1fvEUlvE_EPDaT_(
+ // CHECK: call {{.*}} @_Z1hIPZ1fvEUlvE_EDcT_(
+ g(&x);
+ h(&x);
+}
+
+auto i() { return [] {}; }
+// CHECK: define {{.*}} @_Z1jv
+auto j() {
+ // CHECK: call {{.*}} @"_Z1hIZ1ivE3$_0EDcT_"()
+ h(i());
+}
diff --git a/test/CodeGenCXX/cxx1y-init-captures.cpp b/test/CodeGenCXX/cxx1y-init-captures.cpp
new file mode 100644
index 000000000000..a60269f3b185
--- /dev/null
+++ b/test/CodeGenCXX/cxx1y-init-captures.cpp
@@ -0,0 +1,102 @@
+// RUN: %clang_cc1 -std=c++1y -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s
+
+struct S {
+ S();
+ S(S &&);
+ ~S();
+};
+
+void f() {
+ (void) [s(S{})] {};
+}
+
+// CHECK-LABEL: define void @_Z1fv(
+// CHECK: call void @_ZN1SC1Ev(
+// CHECK: call void @"_ZZ1fvEN3$_0D1Ev"(
+
+// CHECK-LABEL: define internal void @"_ZZ1fvEN3$_0D1Ev"(
+// CHECK: @"_ZZ1fvEN3$_0D2Ev"(
+
+// D2 at end of file.
+
+void g() {
+ [a(1), b(2)] { return a + b; } ();
+}
+
+// CHECK-LABEL: define void @_Z1gv(
+// CHECK: getelementptr inbounds {{.*}}, i32 0, i32 0
+// CHECK: store i32 1, i32*
+// CHECK: getelementptr inbounds {{.*}}, i32 0, i32 1
+// CHECK: store i32 2, i32*
+// CHECK: call i32 @"_ZZ1gvENK3$_1clEv"(
+
+// CHECK-LABEL: define internal i32 @"_ZZ1gvENK3$_1clEv"(
+// CHECK: getelementptr inbounds {{.*}}, i32 0, i32 0
+// CHECK: load i32*
+// CHECK: getelementptr inbounds {{.*}}, i32 0, i32 1
+// CHECK: load i32*
+// CHECK: add nsw i32
+
+int h(int a) {
+ // CHECK-LABEL: define i32 @_Z1hi(
+ // CHECK: %[[A_ADDR:.*]] = alloca i32,
+ // CHECK: %[[OUTER:.*]] = alloca
+ // CHECK: store i32 {{.*}}, i32* %[[A_ADDR]],
+ //
+ // Initialize init-capture 'b(a)' by reference.
+ // CHECK: getelementptr inbounds {{.*}}* %[[OUTER]], i32 0, i32 0
+ // CHECK: store i32* %[[A_ADDR]], i32** {{.*}},
+ //
+ // Initialize init-capture 'c(a)' by copy.
+ // CHECK: getelementptr inbounds {{.*}}* %[[OUTER]], i32 0, i32 1
+ // CHECK: load i32* %[[A_ADDR]],
+ // CHECK: store i32
+ //
+ // CHECK: call i32 @"_ZZ1hiENK3$_2clEv"({{.*}}* %[[OUTER]])
+ return [&b(a), c(a)] {
+ // CHECK-LABEL: define internal i32 @"_ZZ1hiENK3$_2clEv"(
+ // CHECK: %[[OUTER_ADDR:.*]] = alloca
+ // CHECK: %[[INNER:.*]] = alloca
+ // CHECK: store {{.*}}, {{.*}}** %[[OUTER_ADDR]],
+ //
+ // Capture outer 'c' by reference.
+ // CHECK: %[[OUTER:.*]] = load {{.*}}** %[[OUTER_ADDR]]
+ // CHECK: getelementptr inbounds {{.*}}* %[[INNER]], i32 0, i32 0
+ // CHECK-NEXT: getelementptr inbounds {{.*}}* %[[OUTER]], i32 0, i32 1
+ // CHECK-NEXT: store i32* %
+ //
+ // Capture outer 'b' by copy.
+ // CHECK: getelementptr inbounds {{.*}}* %[[INNER]], i32 0, i32 1
+ // CHECK-NEXT: getelementptr inbounds {{.*}}* %[[OUTER]], i32 0, i32 0
+ // CHECK-NEXT: load i32** %
+ // CHECK-NEXT: load i32* %
+ // CHECK-NEXT: store i32
+ //
+ // CHECK: call i32 @"_ZZZ1hiENK3$_2clEvENKUlvE_clEv"({{.*}}* %[[INNER]])
+ return [=, &c] {
+ // CHECK-LABEL: define internal i32 @"_ZZZ1hiENK3$_2clEvENKUlvE_clEv"(
+ // CHECK: %[[INNER_ADDR:.*]] = alloca
+ // CHECK: store {{.*}}, {{.*}}** %[[INNER_ADDR]],
+ // CHECK: %[[INNER:.*]] = load {{.*}}** %[[INNER_ADDR]]
+ //
+ // Load capture of 'b'
+ // CHECK: getelementptr inbounds {{.*}}* %[[INNER]], i32 0, i32 1
+ // CHECK: load i32* %
+ //
+ // Load capture of 'c'
+ // CHECK: getelementptr inbounds {{.*}}* %[[INNER]], i32 0, i32 0
+ // CHECK: load i32** %
+ // CHECK: load i32* %
+ //
+ // CHECK: add nsw i32
+ return b + c;
+ } ();
+ } ();
+}
+
+// Ensure we can emit code for init-captures in global lambdas too.
+auto global_lambda = [a = 0] () mutable { return ++a; };
+int get_incremented() { return global_lambda(); }
+
+// CHECK-LABEL: define internal void @"_ZZ1fvEN3$_0D2Ev"(
+// CHECK: call void @_ZN1SD1Ev(
diff --git a/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp b/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
index ef78c434e35e..ae49a047f624 100644
--- a/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
+++ b/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
@@ -25,7 +25,11 @@ A b { 4, "bazquux", .x = 42, .c = 9 };
A c { 1, 0, 'A', f(), { 3 } };
// CHECK: @[[STR_A:.*]] = {{.*}} [7 x i8] c"foobar\00"
+// CHECK: @a = global {{.*}} zeroinitializer
+
+// @b has a constant initializer
// CHECK: @[[STR_B:.*]] = {{.*}} [8 x i8] c"bazquux\00"
+// CHECK: @b = global {{.*}} i32 4, {{.*}} @[[STR_B]], {{.*}} i8 117, i32 42, {{.*}} i8 9
B x;
B y {};
@@ -44,18 +48,9 @@ B z { 1 };
// CHECK: store i32 %{{.*}}, i32* getelementptr inbounds ({{.*}}* @a, i32 0, i32 3)
// CHECK: call void @{{.*}}C1Ev({{.*}} getelementptr inbounds (%struct.A* @a, i32 0, i32 4))
-// Initialization of 'b':
+// No dynamic initialization of 'b':
-// CHECK: store i32 4, i32* getelementptr inbounds ({{.*}} @b, i32 0, i32 0)
-// CHECK: store i8* {{.*}} @[[STR_B]]{{.*}}, i8** getelementptr inbounds ({{.*}} @b, i32 0, i32 1)
-// CHECK: load i32* getelementptr inbounds ({{.*}} @b, i32 0, i32 0)
-// CHECK: load i8** getelementptr inbounds ({{.*}} @b, i32 0, i32 1)
-// CHECK: getelementptr inbounds i8* %{{.*}}, {{.*}} %{{.*}}
-// CHECK: store i8 %{{.*}}, i8* getelementptr inbounds ({{.*}} @b, i32 0, i32 2)
-// CHECK-NOT: @_ZN1A1fEv
-// CHECK: store i32 42, i32* getelementptr inbounds ({{.*}}* @b, i32 0, i32 3)
-// CHECK-NOT: C1Ev
-// CHECK: store i8 9, i8* {{.*}} @b, i32 0, i32 4)
+// CHECK-NOT: @b
// Initialization of 'c':
diff --git a/test/CodeGenCXX/cxx1y-sized-deallocation.cpp b/test/CodeGenCXX/cxx1y-sized-deallocation.cpp
new file mode 100644
index 000000000000..7fd3ece3e02c
--- /dev/null
+++ b/test/CodeGenCXX/cxx1y-sized-deallocation.cpp
@@ -0,0 +1,110 @@
+// RUN: %clang_cc1 -std=c++1y %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fsized-deallocation %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK-UNSIZED
+
+// CHECK-UNSIZED-NOT: _ZdlPvm
+// CHECK-UNSIZED-NOT: _ZdaPvm
+
+typedef decltype(sizeof(0)) size_t;
+
+typedef int A;
+struct B { int n; };
+struct C { ~C() {} };
+struct D { D(); virtual ~D() {} };
+struct E {
+ void *operator new(size_t);
+ void *operator new[](size_t);
+ void operator delete(void *) noexcept;
+ void operator delete[](void *) noexcept;
+};
+struct F {
+ void *operator new(size_t);
+ void *operator new[](size_t);
+ void operator delete(void *, size_t) noexcept;
+ void operator delete[](void *, size_t) noexcept;
+};
+
+template<typename T> T get();
+
+template<typename T>
+void del() {
+ ::delete get<T*>();
+ ::delete[] get<T*>();
+ delete get<T*>();
+ delete[] get<T*>();
+}
+
+template void del<A>();
+template void del<B>();
+template void del<C>();
+template void del<D>();
+template void del<E>();
+template void del<F>();
+
+D::D() {}
+
+// CHECK-LABEL: define weak_odr void @_Z3delIiEvv()
+// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 4)
+// CHECK: call void @_ZdaPv(i8* %{{[^ ]*}})
+//
+// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 4)
+// CHECK: call void @_ZdaPv(i8* %{{[^ ]*}})
+
+// CHECK-LABEL: define linkonce void @_ZdlPvm(i8*
+// CHECK: call void @_ZdlPv(i8* %0)
+
+// CHECK-LABEL: define weak_odr void @_Z3delI1BEvv()
+// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 4)
+// CHECK: call void @_ZdaPv(i8* %{{[^ ]*}})
+//
+// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 4)
+// CHECK: call void @_ZdaPv(i8* %{{[^ ]*}})
+
+// CHECK-LABEL: define weak_odr void @_Z3delI1CEvv()
+// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 1)
+// CHECK: mul i64 1, %{{[^ ]*}}
+// CHECK: add i64 %{{[^ ]*}}, 8
+// CHECK: call void @_ZdaPvm(i8* %{{[^ ]*}}, i64 %{{[^ ]*}})
+//
+// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 1)
+// CHECK: mul i64 1, %{{[^ ]*}}
+// CHECK: add i64 %{{[^ ]*}}, 8
+// CHECK: call void @_ZdaPvm(i8* %{{[^ ]*}}, i64 %{{[^ ]*}})
+
+// CHECK-LABEL: define linkonce void @_ZdaPvm(i8*
+// CHECK: call void @_ZdaPv(i8* %0)
+
+// CHECK-LABEL: define weak_odr void @_Z3delI1DEvv()
+// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 8)
+// CHECK: mul i64 8, %{{[^ ]*}}
+// CHECK: add i64 %{{[^ ]*}}, 8
+// CHECK: call void @_ZdaPvm(i8* %{{[^ ]*}}, i64 %{{[^ ]*}})
+//
+// CHECK-NOT: Zdl
+// CHECK: call void %{{.*}}
+// CHECK-NOT: Zdl
+// CHECK: mul i64 8, %{{[^ ]*}}
+// CHECK: add i64 %{{[^ ]*}}, 8
+// CHECK: call void @_ZdaPvm(i8* %{{[^ ]*}}, i64 %{{[^ ]*}})
+
+// CHECK-LABEL: define weak_odr void @_Z3delI1EEvv()
+// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 1)
+// CHECK: call void @_ZdaPv(i8* %{{[^ ]*}})
+//
+// CHECK: call void @_ZN1EdlEPv(i8* %{{[^ ]*}})
+// CHECK: call void @_ZN1EdaEPv(i8* %{{[^ ]*}})
+
+// CHECK-LABEL: define weak_odr void @_Z3delI1FEvv()
+// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 1)
+// CHECK: mul i64 1, %{{[^ ]*}}
+// CHECK: add i64 %{{[^ ]*}}, 8
+// CHECK: call void @_ZdaPvm(i8* %{{[^ ]*}}, i64 %{{[^ ]*}})
+//
+// CHECK: call void @_ZN1FdlEPvm(i8* %{{[^ ]*}}, i64 1)
+// CHECK: mul i64 1, %{{[^ ]*}}
+// CHECK: add i64 %{{[^ ]*}}, 8
+// CHECK: call void @_ZN1FdaEPvm(i8* %{{[^ ]*}}, i64 %{{[^ ]*}})
+
+
+// CHECK-LABEL: define linkonce_odr void @_ZN1DD0Ev(%{{[^ ]*}}* %this)
+// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 8)
diff --git a/test/CodeGenCXX/cxx1y-variable-template.cpp b/test/CodeGenCXX/cxx1y-variable-template.cpp
new file mode 100644
index 000000000000..d1e70603e280
--- /dev/null
+++ b/test/CodeGenCXX/cxx1y-variable-template.cpp
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -std=c++1y -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
+
+// Check that we keep the 'extern' when we instantiate the definition of this
+// variable template specialization.
+template<typename T> extern const int extern_redecl;
+template<typename T> const int extern_redecl = 5;
+template const int extern_redecl<int>;
+
+// CHECK: @_Z13extern_redeclIiE = weak_odr constant
+
+template<typename T> struct Outer {
+ template<typename U> struct Inner {
+ template<typename V> static int arr[];
+ };
+};
+Outer<char[100]> outer_int;
+int init_arr();
+template<typename T> template<typename U> template<typename V> int Outer<T>::Inner<U>::arr[sizeof(T) + sizeof(U) + sizeof(V)] = { init_arr() };
+int *p = Outer<char[100]>::Inner<char[20]>::arr<char[3]>;
+
+// CHECK: @_ZN5OuterIA100_cE5InnerIA20_cE3arrIA3_cEE = weak_odr global [123 x i32] zeroinitializer
+// CHECK: @_ZGVN5OuterIA100_cE5InnerIA20_cE3arrIA3_cEE = weak_odr global
+
+// CHECK: call {{.*}}@_Z8init_arrv
diff --git a/test/CodeGenCXX/debug-info-artificial-arg.cpp b/test/CodeGenCXX/debug-info-artificial-arg.cpp
index ff0f6638f615..84f496f54c37 100644
--- a/test/CodeGenCXX/debug-info-artificial-arg.cpp
+++ b/test/CodeGenCXX/debug-info-artificial-arg.cpp
@@ -22,8 +22,8 @@ int main(int argc, char **argv) {
A reallyA (500);
}
-// CHECK: ![[ARTARG:.*]] = {{.*}} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from A]
-// CHECK: ![[CLASSTYPE:.*]] = {{.*}} ; [ DW_TAG_class_type ] [A]
-// CHECK: metadata ![[CLASSTYPE]], {{.*}} ; [ DW_TAG_subprogram ] [line 12] [A]
-// CHECK: metadata [[FUNCTYPE:![0-9]*]], i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
+// CHECK: ![[CLASSTYPE:.*]] = {{.*}}, metadata !"_ZTS1A"} ; [ DW_TAG_class_type ] [A]
+// CHECK: ![[ARTARG:.*]] = {{.*}} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1A]
+// CHECK: metadata !"_ZTS1A", {{.*}} ; [ DW_TAG_subprogram ] [line 12] [A]
+// CHECK: metadata [[FUNCTYPE:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
// CHECK: [[FUNCTYPE]] = metadata !{null, metadata ![[ARTARG]], metadata !{{.*}}, metadata !{{.*}}}
diff --git a/test/CodeGenCXX/debug-info-class-limited.cpp b/test/CodeGenCXX/debug-info-class-limited.cpp
new file mode 100644
index 000000000000..a4b9f46ec653
--- /dev/null
+++ b/test/CodeGenCXX/debug-info-class-limited.cpp
@@ -0,0 +1,52 @@
+// RUN: %clang -emit-llvm -g -S %s -o - | FileCheck %s
+
+namespace PR16214_1 {
+// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
+struct foo {
+ int i;
+};
+
+typedef foo bar;
+
+bar *a;
+bar b;
+}
+
+namespace PR14467 {
+// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
+struct foo {
+};
+
+foo *bar(foo *a) {
+ foo *b = new foo(*a);
+ return b;
+}
+}
+
+namespace test1 {
+// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [decl]
+struct foo {
+};
+
+extern int bar(foo *a);
+int baz(foo *a) {
+ return bar(a);
+}
+}
+
+namespace test2 {
+// FIXME: if we were a bit fancier, we could realize that the 'foo' type is only
+// required because of the 'bar' type which is not required at all (or might
+// only be required to be declared)
+// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
+struct foo {
+};
+
+struct bar {
+ foo f;
+};
+
+void func() {
+ foo *f;
+}
+}
diff --git a/test/CodeGenCXX/debug-info-class-nolimit.cpp b/test/CodeGenCXX/debug-info-class-nolimit.cpp
new file mode 100644
index 000000000000..ce72bd347cab
--- /dev/null
+++ b/test/CodeGenCXX/debug-info-class-nolimit.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -triple x86_64-unk-unk -fno-limit-debug-info -o - -emit-llvm -g %s | FileCheck %s
+
+namespace rdar14101097_1 { // see also PR16214
+// Check that we emit debug info for the definition of a struct if the
+// definition is available, even if it's used via a pointer wrapped in a
+// typedef.
+// CHECK: [ DW_TAG_structure_type ] [foo] {{.*}}[def]
+struct foo {
+};
+
+typedef foo *foop;
+
+void bar() {
+ foop f;
+}
+}
+
+namespace rdar14101097_2 {
+// As above, except trickier because we first encounter only a declaration of
+// the type and no debug-info related use after we see the definition of the
+// type.
+// CHECK: [ DW_TAG_structure_type ] [foo] {{.*}}[def]
+struct foo;
+void bar() {
+ foo *f;
+}
+struct foo {
+};
+}
+
diff --git a/test/CodeGenCXX/debug-info-class.cpp b/test/CodeGenCXX/debug-info-class.cpp
index df2492603e36..e1402c96f043 100644
--- a/test/CodeGenCXX/debug-info-class.cpp
+++ b/test/CodeGenCXX/debug-info-class.cpp
@@ -12,6 +12,51 @@ class B {
public:
virtual ~B();
};
+
+B::~B() {
+}
+
+struct C {
+ static int s;
+ virtual ~C();
+};
+
+C::~C() {
+}
+
+struct D {
+ D();
+ virtual ~D();
+ void func() {
+ }
+};
+
+struct E {
+ E();
+ virtual ~E();
+ virtual void func() {
+ }
+};
+
+struct F {
+ struct inner {
+ };
+ static const int i = 2;
+ virtual ~F();
+};
+
+struct G {
+ virtual void func();
+ struct inner {
+ int j;
+ };
+};
+
+struct H {};
+struct I : virtual H {};
+struct J : I {};
+J j;
+
struct A {
int one;
static const int HdrSize = 52;
@@ -21,9 +66,17 @@ struct A {
}
};
+void f1() {
+ D x;
+ x.func();
+ E y;
+ int i = F::i;
+ F::inner z;
+}
int main(int argc, char **argv) {
B b;
+ G::inner c_i;
if (argc) {
A a;
}
@@ -40,9 +93,33 @@ int main(int argc, char **argv) {
// CHECK: DW_TAG_structure_type ] [foo]
// CHECK: DW_TAG_class_type ] [bar]
// CHECK: DW_TAG_union_type ] [baz]
-// CHECK: DW_TAG_structure_type ] [A]
-// CHECK: HdrSize
-// CHECK: DW_TAG_class_type ] [B]
+// CHECK: DW_TAG_class_type ] [B] {{.*}} [def]
// CHECK: metadata !"_vptr$B", {{.*}}, i32 64, metadata !{{.*}}} ; [ DW_TAG_member ]
-// CHECK: ![[EXCEPTLOC]] = metadata !{i32 31,
-// CHECK: ![[RETLOC]] = metadata !{i32 30,
+
+// CHECK: [[C:![0-9]*]] = {{.*}} metadata [[C_MEM:![0-9]*]], i32 0, metadata !"_ZTS1C", null, metadata !"_ZTS1C"} ; [ DW_TAG_structure_type ] [C] {{.*}} [def]
+// CHECK: [[C_MEM]] = metadata !{metadata [[C_VPTR:![0-9]*]], metadata [[C_S:![0-9]*]], metadata [[C_DTOR:![0-9]*]]}
+// CHECK: [[C_VPTR]] = {{.*}} ; [ DW_TAG_member ] [_vptr$C] {{.*}} [artificial]
+// CHECK: [[C_S]] = {{.*}} ; [ DW_TAG_member ] [s] {{.*}} [static] [from int]
+// CHECK: [[C_DTOR]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [~C]
+
+// CHECK: metadata [[D_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTS1D"} ; [ DW_TAG_structure_type ] [D] {{.*}} [decl]
+// CHECK: [[D_MEM]] = metadata !{metadata [[D_FUNC:![0-9]*]]}
+// CHECK: [[D_FUNC]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [func]
+// CHECK: null, i32 0, null, null, metadata !"_ZTS1E"} ; [ DW_TAG_structure_type ] [E] {{.*}} [decl]
+// CHECK: [[F:![0-9]*]] = {{.*}} metadata [[F_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTS1F"} ; [ DW_TAG_structure_type ] [F] {{.*}} [decl]
+// CHECK: [[F_MEM]] = metadata !{metadata [[F_I:![0-9]*]]}
+// CHECK: [[F_I]] = {{.*}} ; [ DW_TAG_member ] [i]
+
+// CHECK: null, i32 0, null, null, metadata !"_ZTS1G"} ; [ DW_TAG_structure_type ] [G] {{.*}} [decl]
+// CHECK: metadata [[G_INNER_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTSN1G5innerE"} ; [ DW_TAG_structure_type ] [inner] [line 50, {{.*}} [def]
+// CHECK: [[G_INNER_MEM]] = metadata !{metadata [[G_INNER_I:![0-9]*]]}
+// CHECK: [[G_INNER_I]] = {{.*}} ; [ DW_TAG_member ] [j] {{.*}} [from int]
+
+// CHECK: ; [ DW_TAG_structure_type ] [A]
+// CHECK: HdrSize
+// CHECK: ; [ DW_TAG_structure_type ] [I] {{.*}} [def]
+
+// CHECK: [[F_I_DEF:![0-9]*]] = {{.*}}, metadata [[F_I]]} ; [ DW_TAG_variable ] [i]
+
+// CHECK: ![[EXCEPTLOC]] = metadata !{i32 84,
+// CHECK: ![[RETLOC]] = metadata !{i32 83,
diff --git a/test/CodeGenCXX/debug-info-cxx1y.cpp b/test/CodeGenCXX/debug-info-cxx1y.cpp
new file mode 100644
index 000000000000..3cb7e45e6985
--- /dev/null
+++ b/test/CodeGenCXX/debug-info-cxx1y.cpp
@@ -0,0 +1,7 @@
+// RUN: not %clang_cc1 -emit-llvm-only -std=c++1y -g %s 2>&1 | FileCheck %s
+
+struct foo {
+ auto func(); // CHECK: error: debug information for auto is not yet supported
+};
+
+foo f;
diff --git a/test/CodeGenCXX/debug-info-decl-nested.cpp b/test/CodeGenCXX/debug-info-decl-nested.cpp
new file mode 100644
index 000000000000..f79a8e9fe32d
--- /dev/null
+++ b/test/CodeGenCXX/debug-info-decl-nested.cpp
@@ -0,0 +1,61 @@
+// RUN: %clang_cc1 -std=c++11 -g -emit-llvm -g -triple x86_64-apple-darwin %s -o %t
+// RUN: cat %t | FileCheck %s -check-prefix=CHECK0
+// RUN: cat %t | FileCheck %s -check-prefix=CHECK1
+// RUN: cat %t | FileCheck %s -check-prefix=CHECK2
+//
+// This test ensures that we associate a declaration with the
+// definition of the constructor for OuterClass. The declaration is
+// necessary so the backend can emit the DW_AT_specification attribute
+// for the definition.
+//
+// rdar://problem/13116508
+
+class Foo;
+class OuterClass
+{
+ static class InnerClass {
+ public:
+ InnerClass(); // Here createContextChain() generates a limited type for OuterClass.
+ } theInnerClass;
+// CHECK0: [[DECL:[0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [private] [OuterClass]
+ OuterClass(const Foo *); // line 10
+};
+OuterClass::InnerClass OuterClass::theInnerClass; // This toplevel decl causes InnerClass to be generated.
+// CHECK0: metadata {{.*}}, metadata ![[DECL]], metadata {{.*}}, i32 [[@LINE+1]]} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [def] [OuterClass]
+OuterClass::OuterClass(const Foo *meta) { } // line 13
+
+
+
+
+
+class Foo1;
+class OuterClass1
+{
+ static class InnerClass1 {
+ public:
+ InnerClass1();
+ } theInnerClass1;
+// CHECK1: [[DECL:[0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE+2]]] [private] [Bar]
+// CHECK1: metadata {{.*}}, metadata ![[DECL]], metadata {{.*}}, i32 [[@LINE+4]]} ; [ DW_TAG_subprogram ] [line [[@LINE+4]]] [def] [Bar]
+ void Bar(const Foo1 *);
+};
+OuterClass1::InnerClass1 OuterClass1::theInnerClass1;
+void OuterClass1::Bar(const Foo1 *meta) { }
+
+
+
+
+
+class Foo2;
+class OuterClass2
+{
+ static class InnerClass2 {
+ public:
+ InnerClass2();
+ } theInnerClass2;
+// CHECK2: [[DECL:[0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [private] [~OuterClass2]
+ ~OuterClass2(); // line 10
+};
+OuterClass2::InnerClass2 OuterClass2::theInnerClass2;
+// CHECK2: metadata {{.*}}, metadata ![[DECL]], metadata {{.*}}, i32 [[@LINE+1]]} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [def] [~OuterClass2]
+OuterClass2::~OuterClass2() { }
diff --git a/test/CodeGenCXX/debug-info-enum-class.cpp b/test/CodeGenCXX/debug-info-enum-class.cpp
index 929327b79829..0f4b09afb5dd 100644
--- a/test/CodeGenCXX/debug-info-enum-class.cpp
+++ b/test/CodeGenCXX/debug-info-enum-class.cpp
@@ -9,10 +9,10 @@ B b;
C c;
D d;
-// CHECK: ; [ DW_TAG_enumeration_type ] [A] [line 3, size 32, align 32, offset 0] [from int]
-// CHECK: ; [ DW_TAG_enumeration_type ] [B] [line 4, size 64, align 64, offset 0] [from long unsigned int]
-// CHECK: ; [ DW_TAG_enumeration_type ] [C] [line 5, size 32, align 32, offset 0] [from ]
-// CHECK: ; [ DW_TAG_enumeration_type ] [D] [line 6, size 16, align 16, offset 0] [fwd] [from ]
+// CHECK: ; [ DW_TAG_enumeration_type ] [A] [line 3, size 32, align 32, offset 0] [def] [from int]
+// CHECK: ; [ DW_TAG_enumeration_type ] [B] [line 4, size 64, align 64, offset 0] [def] [from long unsigned int]
+// CHECK: ; [ DW_TAG_enumeration_type ] [C] [line 5, size 32, align 32, offset 0] [def] [from ]
+// CHECK: ; [ DW_TAG_enumeration_type ] [D] [line 6, size 16, align 16, offset 0] [decl] [from ]
namespace PR14029 {
// Make sure this doesn't crash/assert.
diff --git a/test/CodeGenCXX/debug-info-enum.cpp b/test/CodeGenCXX/debug-info-enum.cpp
index c08fc35af5b9..f0e2608db856 100644
--- a/test/CodeGenCXX/debug-info-enum.cpp
+++ b/test/CodeGenCXX/debug-info-enum.cpp
@@ -1,8 +1,36 @@
-// RUN: %clang -fverbose-asm -S -g %s -o - | grep DW_TAG_enumeration_type
+// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
-int v;
-enum index { MAX };
-void foo(void)
-{
- v = MAX;
+// CHECK: [[ENUMS:![0-9]*]], {{[^,]*}}, {{[^,]*}}, {{[^,]*}}, {{[^,]*}}, {{[^,]*}}} ; [ DW_TAG_compile_unit ]
+// CHECK: [[ENUMS]] = metadata !{metadata [[E1:![0-9]*]], metadata [[E2:![0-9]*]], metadata [[E3:![0-9]*]]}
+
+namespace test1 {
+// CHECK: [[E1]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST1:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS:![0-9]*]], {{[^,]*}}, null, null, metadata !"_ZTSN5test11eE"} ; [ DW_TAG_enumeration_type ] [e]
+// CHECK: [[TEST1]] = {{.*}} ; [ DW_TAG_namespace ] [test1]
+// CHECK: [[TEST1_ENUMS]] = metadata !{metadata [[TEST1_E:![0-9]*]]}
+// CHECK: [[TEST1_E]] = {{.*}}, metadata !"E", i64 0} ; [ DW_TAG_enumerator ] [E :: 0]
+enum e { E };
+void foo() {
+ int v = E;
+}
+}
+
+namespace test2 {
+// rdar://8195980
+// CHECK: [[E2]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST2:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS]], {{[^,]*}}, null, null, metadata !"_ZTSN5test21eE"} ; [ DW_TAG_enumeration_type ] [e]
+// CHECK: [[TEST2]] = {{.*}} ; [ DW_TAG_namespace ] [test2]
+enum e { E };
+bool func(int i) {
+ return i == E;
+}
+}
+
+namespace test3 {
+// CHECK: [[E3]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST3:![0-9]*]], {{.*}}, metadata [[TEST3_ENUMS:![0-9]*]], {{[^,]*}}, null, null, metadata !"_ZTSN5test31eE"} ; [ DW_TAG_enumeration_type ] [e]
+// CHECK: [[TEST3]] = {{.*}} ; [ DW_TAG_namespace ] [test3]
+// CHECK: [[TEST3_ENUMS]] = metadata !{metadata [[TEST3_E:![0-9]*]]}
+// CHECK: [[TEST3_E]] = {{.*}}, metadata !"E", i64 -1} ; [ DW_TAG_enumerator ] [E :: -1]
+enum e { E = -1 };
+void func() {
+ e x;
+}
}
diff --git a/test/CodeGenCXX/debug-info-friend.cpp b/test/CodeGenCXX/debug-info-friend.cpp
index c50f281a3b8f..b103b142a2ae 100644
--- a/test/CodeGenCXX/debug-info-friend.cpp
+++ b/test/CodeGenCXX/debug-info-friend.cpp
@@ -1,11 +1,20 @@
-// RUN: %clang -fverbose-asm -S -g %s -o - | grep DW_TAG_friend
+// RUN: %clang -emit-llvm -S -g %s -o - | FileCheck %s
class MyFriend;
-class SomeClass
-{
- friend class MyFriend;
+class SomeClass {
+ friend class MyFriend;
+ typedef int SomeType;
};
-SomeClass sc;
+SomeClass *x;
+struct MyFriend {
+ static void func(SomeClass::SomeType) {
+ }
+};
+
+// Emitting debug info for friends unnecessarily bloats debug info without any
+// known benefit or debugger feature that requires it. Re-enable this is a
+// use-case appears.
+// CHECK-NOT: DW_TAG_friend
diff --git a/test/CodeGenCXX/debug-info-function-context.cpp b/test/CodeGenCXX/debug-info-function-context.cpp
new file mode 100644
index 000000000000..4ca1c8d1eced
--- /dev/null
+++ b/test/CodeGenCXX/debug-info-function-context.cpp
@@ -0,0 +1,36 @@
+// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-pc-linux-gnu %s -o - | FileCheck %s
+
+struct C {
+ void member_function();
+ static int static_member_function();
+ static int static_member_variable;
+};
+
+int C::static_member_variable = 0;
+
+void C::member_function() { static_member_variable = 0; }
+
+int C::static_member_function() { return static_member_variable; }
+
+C global_variable;
+
+int global_function() { return -1; }
+
+namespace ns {
+void global_namespace_function() { global_variable.member_function(); }
+int global_namespace_variable = 1;
+}
+
+// Check that the functions that belong to C have C as a context and the
+// functions that belong to the namespace have it as a context, and the global
+// function has the file as a context.
+
+// CHECK: metadata !"_ZTS1C", metadata !"member_function"{{.*}} [ DW_TAG_subprogram ] [line 11] [def] [member_function]
+
+// CHECK: metadata !"_ZTS1C", metadata !"static_member_function"{{.*}} [ DW_TAG_subprogram ] [line 13] [def] [static_member_function]
+
+// CHECK: metadata !22, metadata !"global_function"{{.*}} [ DW_TAG_subprogram ] [line 17] [def] [global_function]
+// CHECK: !22 = {{.*}} [ DW_TAG_file_type ]
+
+// CHECK: metadata !24, metadata !"global_namespace_function"{{.*}} [ DW_TAG_subprogram ] [line 20] [def] [global_namespace_function]
+// CHECK: !24 = {{.*}} [ DW_TAG_namespace ] [ns] [line 19]
diff --git a/test/CodeGenCXX/debug-info-gline-tables-only.cpp b/test/CodeGenCXX/debug-info-gline-tables-only.cpp
index 8d2e63d67778..7ecdeb2ec22e 100644
--- a/test/CodeGenCXX/debug-info-gline-tables-only.cpp
+++ b/test/CodeGenCXX/debug-info-gline-tables-only.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -O0 -gline-tables-only -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -gline-tables-only -S -emit-llvm -o - | FileCheck %s
// Checks that clang with "-gline-tables-only" doesn't emit debug info
// for variables and types.
@@ -13,9 +13,17 @@ class E : public C {
// CHECK-NOT: DW_TAG_reference type
void x(const D& d);
};
+struct F {
+ enum X { };
+ void func(X);
+ virtual ~F();
+};
+F::~F() {
+}
}
// CHECK-NOT: DW_TAG_variable
NS::C c;
NS::D d;
NS::E e;
+NS::F f;
diff --git a/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp b/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp
index bdaf58c82703..afa77077a25d 100644
--- a/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp
+++ b/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp
@@ -20,8 +20,8 @@ void foo() {
// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 12] [local] [def] [__dtor_glob]
// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 13] [local] [def] [__cxx_global_var_init1]
// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 13] [local] [def] [__cxx_global_array_dtor]
-// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 13] [local] [def] [__dtor_]
+// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 13] [local] [def] [__dtor_array]
// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 16] [local] [def] [__dtor__ZZ3foovE4stat]
-// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line {{.*}}] [local] [def] [_GLOBAL__I_a]
+// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line {{.*}}] [local] [def]{{$}}
-// CHECK-KEXT: [ DW_TAG_subprogram ] [line {{.*}}] [local] [def] [_GLOBAL__D_a]
+// CHECK-KEXT: [ DW_TAG_subprogram ] [line {{.*}}] [local] [def]{{$}}
diff --git a/test/CodeGenCXX/debug-info-globalinit.cpp b/test/CodeGenCXX/debug-info-globalinit.cpp
index b3891c148e3e..30c8bfc680eb 100644
--- a/test/CodeGenCXX/debug-info-globalinit.cpp
+++ b/test/CodeGenCXX/debug-info-globalinit.cpp
@@ -12,19 +12,27 @@ int test() {
static int i = test();
__attribute__((nodebug)) static int j = test();
+static int k = test();
int main(void) {}
-// CHECK: define internal void @__cxx_global_var_init()
+// CHECK-LABEL: define internal void @__cxx_global_var_init()
// CHECK-NOT: __cxx_global_var_init
// CHECK: %[[C0:.+]] = call i32 @_Z4testv(), !dbg ![[LINE:.*]]
// CHECK-NOT: __cxx_global_var_init
// CHECK: store i32 %[[C0]], i32* @_ZL1i, align 4, !dbg
//
-// CHECK: define internal void @__cxx_global_var_init1()
+// CHECK-LABEL: define internal void @__cxx_global_var_init1()
// CHECK-NOT: dbg
// CHECK: %[[C1:.+]] = call i32 @_Z4testv()
// CHECK-NOT: dbg
// CHECK: store i32 %[[C1]], i32* @_ZL1j, align 4
+//
+// CHECK-LABEL: define internal void @__cxx_global_var_init2()
+// CHECK-NOT: __cxx_global_var_init
+// CHECK: %[[C2:.+]] = call i32 @_Z4testv(), !dbg ![[LINE2:.*]]
+// CHECK-NOT: __cxx_global_var_init
+// CHECK: store i32 %[[C2]], i32* @_ZL1k, align 4, !dbg
//
// CHECK: ![[LINE]] = metadata !{i32 13, i32
+// CHECK: ![[LINE2]] = metadata !{i32 15, i32
diff --git a/test/CodeGenCXX/debug-info-limit-type.cpp b/test/CodeGenCXX/debug-info-limit-type.cpp
deleted file mode 100644
index e03024fb3cd9..000000000000
--- a/test/CodeGenCXX/debug-info-limit-type.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %clang -emit-llvm -g -S %s -o - | FileCheck %s
-// XFAIL: *
-
-class B {
-public:
- int bb;
- void fn2() {}
-};
-
-class A {
-public:
- int aa;
- void fn1(B b) { b.fn2(); }
-};
-
-void foo(A *aptr) {
-}
-
-void bar() {
- A a;
-}
-
-// B should only be emitted as a forward reference (i32 4).
-// CHECK: metadata !"B", metadata !6, i32 3, i32 0, i32 0, i32 0, i32 4} ; [ DW_TAG_class_type ]
diff --git a/test/CodeGenCXX/debug-info-limit.cpp b/test/CodeGenCXX/debug-info-limit.cpp
deleted file mode 100644
index bca887b4db87..000000000000
--- a/test/CodeGenCXX/debug-info-limit.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %clang -emit-llvm -g -S %s -o - | FileCheck %s
-
-// TAG_member is used to encode debug info for class constructor.
-// CHECK: TAG_member
-class A {
-public:
- int z;
-};
-
-A *foo (A* x) {
- A *a = new A(*x);
- return a;
-}
-
diff --git a/test/CodeGenCXX/debug-info-limited.cpp b/test/CodeGenCXX/debug-info-limited.cpp
new file mode 100644
index 000000000000..54a2424fddd9
--- /dev/null
+++ b/test/CodeGenCXX/debug-info-limited.cpp
@@ -0,0 +1,33 @@
+// RUN: %clang -flimit-debug-info -emit-llvm -g -S %s -o - | FileCheck %s
+
+// CHECK: ; [ DW_TAG_class_type ] [A] {{.*}} [def]
+class A {
+public:
+ int z;
+};
+
+A *foo (A* x) {
+ A *a = new A(*x);
+ return a;
+}
+
+// Verify that we're not emitting a full definition of B in limit debug mode.
+// CHECK: ; [ DW_TAG_class_type ] [B] {{.*}} [decl]
+
+class B {
+public:
+ int y;
+};
+
+extern int bar(B *b);
+int baz(B *b) {
+ return bar(b);
+}
+
+
+// CHECK: ; [ DW_TAG_structure_type ] [C] {{.*}} [decl]
+
+struct C {
+};
+
+C (*x)(C);
diff --git a/test/CodeGenCXX/debug-info-method.cpp b/test/CodeGenCXX/debug-info-method.cpp
index 3ee4d9b08f46..50b3f66354e0 100644
--- a/test/CodeGenCXX/debug-info-method.cpp
+++ b/test/CodeGenCXX/debug-info-method.cpp
@@ -1,9 +1,10 @@
// RUN: %clang_cc1 -emit-llvm -std=c++11 -g %s -o - | FileCheck %s
-// CHECK: ![[THISTYPE:[0-9]+]] = {{.*}} ; [ DW_TAG_pointer_type ] {{.*}} [artificial] [from A]
+// CHECK: metadata !"_ZTS1A"} ; [ DW_TAG_class_type ] [A]
// CHECK: metadata !"_ZN1A3fooEiS_3$_0", {{.*}} [protected]
+// CHECK: ![[THISTYPE:[0-9]+]] = {{.*}} ; [ DW_TAG_pointer_type ] {{.*}} [artificial] [from _ZTS1A]
// CHECK: DW_TAG_ptr_to_member_type
// CHECK: {{.*}}metadata ![[MEMFUNTYPE:[0-9]+]], metadata !{{.*}}} ; [ DW_TAG_ptr_to_member_type ] {{.*}} [from ]
-// CHECK: ![[MEMFUNTYPE]] = {{.*}}metadata ![[MEMFUNARGS:[0-9]+]], i32 0, i32 0} ; [ DW_TAG_subroutine_type ] {{.*}} [from ]
+// CHECK: ![[MEMFUNTYPE]] = {{.*}}metadata ![[MEMFUNARGS:[0-9]+]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] {{.*}} [from ]
// CHECK: ![[MEMFUNARGS]] = {{.*}}, metadata ![[THISTYPE]],
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
diff --git a/test/CodeGenCXX/debug-info-namespace.cpp b/test/CodeGenCXX/debug-info-namespace.cpp
index 13a7914b7be0..a2d7ede1643e 100644
--- a/test/CodeGenCXX/debug-info-namespace.cpp
+++ b/test/CodeGenCXX/debug-info-namespace.cpp
@@ -1,14 +1,24 @@
-// RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang -g -gline-tables-only -S -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-GMLT %s
+// RUN: %clang -g -fno-limit-debug-info -S -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-NOLIMIT %s
namespace A {
#line 1 "foo.cpp"
namespace B {
int i;
+void f1() { }
+void f1(int) { }
+struct foo;
+struct bar { };
+typedef bar baz;
}
+}
+namespace A {
using namespace B;
}
using namespace A;
+namespace E = A;
int func(bool b) {
if (b) {
@@ -16,22 +26,52 @@ int func(bool b) {
return i;
}
using namespace A;
- return B::i;
+ using B::foo;
+ using B::bar;
+ using B::f1;
+ using B::i;
+ using B::baz;
+ namespace X = A;
+ namespace Y = X;
+ return i + X::B::i + Y::B::i;
}
+// This should work even if 'i' and 'func' were declarations & not definitions,
+// but it doesn't yet.
+
// CHECK: [[CU:![0-9]*]] = {{.*}}[[MODULES:![0-9]*]], metadata !""} ; [ DW_TAG_compile_unit ]
// CHECK: [[FILE:![0-9]*]] {{.*}}debug-info-namespace.cpp"
-// CHECK: [[FUNC:![0-9]*]] {{.*}} ; [ DW_TAG_subprogram ] [line 9] [def] [func]
-// CHECK: [[FILE2:![0-9]*]]} ; [ DW_TAG_file_type ] [{{.*}}foo.cpp]
-// CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[NS:![0-9]*]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i]
-// CHECK: [[NS]] = {{.*}}, metadata [[FILE2]], metadata [[CTXT:![0-9]*]], {{.*}} ; [ DW_TAG_namespace ] [B] [line 1]
-// CHECK: [[CTXT]] = {{.*}}, metadata [[FILE]], null, {{.*}} ; [ DW_TAG_namespace ] [A] [line 3]
-// CHECK: [[MODULES]] = metadata !{metadata [[M1:![0-9]*]], metadata [[M2:![0-9]*]], metadata [[M3:![0-9]*]], metadata [[M4:![0-9]*]]}
-// CHECK: [[M1]] = metadata !{i32 {{[0-9]*}}, metadata [[CTXT]], metadata [[NS]], i32 4} ; [ DW_TAG_imported_module ]
-// CHECK: [[M2]] = metadata !{i32 {{[0-9]*}}, metadata [[CU]], metadata [[CTXT]], i32 7} ; [ DW_TAG_imported_module ]
-// CHECK: [[M3]] = metadata !{i32 {{[0-9]*}}, metadata [[LEX:![0-9]*]], metadata [[NS]], i32 11} ; [ DW_TAG_imported_module ]
-// CHECK: [[LEX]] = metadata !{i32 {{[0-9]*}}, metadata [[FILE2]], metadata [[FUNC]], i32 10, i32 0, i32 0} ; [ DW_TAG_lexical_block ]
-// CHECK: [[M4]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[CTXT]], i32 14} ; [ DW_TAG_imported_module ]
+// CHECK: [[FOO:![0-9]*]] {{.*}} ; [ DW_TAG_structure_type ] [foo] [line 5, size 0, align 0, offset 0] [decl] [from ]
+// CHECK: [[FOOCPP:![0-9]*]] = metadata !{metadata !"foo.cpp", {{.*}}
+// CHECK: [[NS:![0-9]*]] = {{.*}}, metadata [[FILE2:![0-9]*]], metadata [[CTXT:![0-9]*]], {{.*}} ; [ DW_TAG_namespace ] [B] [line 1]
+// CHECK: [[CTXT]] = {{.*}}, metadata [[FILE]], null, {{.*}} ; [ DW_TAG_namespace ] [A] [line 5]
+// CHECK: [[BAR:![0-9]*]] {{.*}} ; [ DW_TAG_structure_type ] [bar] [line 6, {{.*}}] [decl] [from ]
+// CHECK: [[F1:![0-9]*]] {{.*}} ; [ DW_TAG_subprogram ] [line 4] [def] [f1]
+// CHECK: [[FUNC:![0-9]*]] {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func]
+// CHECK: [[FILE2]]} ; [ DW_TAG_file_type ] [{{.*}}foo.cpp]
+// CHECK: [[I:![0-9]*]] = {{.*}}, metadata [[NS]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i]
+// CHECK: [[MODULES]] = metadata !{metadata [[M1:![0-9]*]], metadata [[M2:![0-9]*]], metadata [[M3:![0-9]*]], metadata [[M4:![0-9]*]], metadata [[M5:![0-9]*]], metadata [[M6:![0-9]*]], metadata [[M7:![0-9]*]], metadata [[M8:![0-9]*]], metadata [[M9:![0-9]*]], metadata [[M10:![0-9]*]], metadata [[M11:![0-9]*]], metadata [[M12:![0-9]*]]}
+// CHECK: [[M1]] = metadata !{i32 {{[0-9]*}}, metadata [[CTXT]], metadata [[NS]], i32 11} ; [ DW_TAG_imported_module ]
+// CHECK: [[M2]] = metadata !{i32 {{[0-9]*}}, metadata [[CU]], metadata [[CTXT]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_module ]
+// CHECK: [[M3]] = metadata !{i32 {{[0-9]*}}, metadata [[CU]], metadata [[CTXT]], i32 15, metadata !"E"} ; [ DW_TAG_imported_module ]
+// CHECK: [[M4]] = metadata !{i32 {{[0-9]*}}, metadata [[LEX2:![0-9]*]], metadata [[NS]], i32 19} ; [ DW_TAG_imported_module ]
+// CHECK: [[LEX2]] = metadata !{i32 {{[0-9]*}}, metadata [[FILE2]], metadata [[LEX1:![0-9]+]], i32 {{[0-9]*}}, i32 0, i32 {{.*}}} ; [ DW_TAG_lexical_block ]
+// CHECK: [[LEX1]] = metadata !{i32 {{[0-9]*}}, metadata [[FILE2]], metadata [[FUNC]], i32 {{[0-9]*}}, i32 0, i32 {{.*}}} ; [ DW_TAG_lexical_block ]
+// CHECK: [[M5]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[CTXT]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_module ]
+// CHECK: [[M6]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[FOO:![0-9]*]], i32 23} ; [ DW_TAG_imported_declaration ]
+// CHECK: [[M7]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[BAR:![0-9]*]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_declaration ]
+// CHECK: [[M8]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[F1]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_declaration ]
+// CHECK: [[M9]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[I]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_declaration ]
+// CHECK: [[M10]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[BAZ:![0-9]*]], i32 {{[0-9]*}}} ; [ DW_TAG_imported_declaration ]
+// CHECK: [[BAZ]] = metadata !{i32 {{[0-9]*}}, metadata [[FOOCPP]], metadata [[NS]], {{.*}}, metadata !"_ZTSN1A1B3barE"} ; [ DW_TAG_typedef ] [baz] {{.*}} [from _ZTSN1A1B3barE]
+// CHECK: [[M11]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[CTXT]], i32 {{[0-9]*}}, metadata !"X"} ; [ DW_TAG_imported_module ]
+// CHECK: [[M12]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[M11]], i32 {{[0-9]*}}, metadata !"Y"} ; [ DW_TAG_imported_module ]
+
+// CHECK-GMLT: [[CU:![0-9]*]] = {{.*}}[[MODULES:![0-9]*]], metadata !""} ; [ DW_TAG_compile_unit ]
+// CHECK-GMLT: [[MODULES]] = metadata !{i32 0}
+
+// CHECK-NOLIMIT: ; [ DW_TAG_structure_type ] [bar] [line 6, {{.*}}] [def] [from ]
// FIXME: It is confused on win32 to generate file entry when dosish filename is given.
// REQUIRES: shell
+// REQUIRES: shell-preserves-root
diff --git a/test/CodeGenCXX/debug-info-nullptr.cpp b/test/CodeGenCXX/debug-info-nullptr.cpp
index 42e9741d1967..ef9b618fdb34 100644
--- a/test/CodeGenCXX/debug-info-nullptr.cpp
+++ b/test/CodeGenCXX/debug-info-nullptr.cpp
@@ -4,4 +4,4 @@ void foo() {
decltype(nullptr) t = 0;
}
-// CHECK: [ DW_TAG_unspecified_type ] [nullptr_t]
+// CHECK: [ DW_TAG_unspecified_type ] [decltype(nullptr)]
diff --git a/test/CodeGenCXX/debug-info-pubtypes.cpp b/test/CodeGenCXX/debug-info-pubtypes.cpp
index 6ca3da8674f3..6393cddeef67 100644
--- a/test/CodeGenCXX/debug-info-pubtypes.cpp
+++ b/test/CodeGenCXX/debug-info-pubtypes.cpp
@@ -1,6 +1,5 @@
// REQUIRES: x86-64-registered-target
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -g -fno-limit-debug-info -S %s -o %t
-// RUN: FileCheck %s < %t
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -g -fno-limit-debug-info -S -mllvm -generate-dwarf-pub-sections=Enable %s -o - | FileCheck %s
// FIXME: This testcase shouldn't rely on assembly emission.
//CHECK: Lpubtypes_begin[[SECNUM:[0-9]:]]
@@ -10,7 +9,7 @@
class G {
public:
- void foo();
+ void foo();
};
void G::foo() {
diff --git a/test/CodeGenCXX/debug-info-same-line.cpp b/test/CodeGenCXX/debug-info-same-line.cpp
index ad245031abf0..519e9eeb87a4 100644
--- a/test/CodeGenCXX/debug-info-same-line.cpp
+++ b/test/CodeGenCXX/debug-info-same-line.cpp
@@ -83,6 +83,21 @@ main(int argc, char const *argv[])
// result
// CHECK: call void @llvm.dbg.declare
+// We want to see a distinct !dbg node.
+// CHECK-NOT: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[A_MD]]), !dbg ![[A_DI]]
+// CHECK: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[A_MD]]), !dbg !{{.*}}
+// CHECK-NOT: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[B_MD]]), !dbg ![[B_DI]]
+// CHECK: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[B_MD]]), !dbg !{{.*}}
+// result
+// CHECK: call void @llvm.dbg.declare
+
+// Again: we want to see a distinct !dbg node.
+// CHECK: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[X_MD:[0-9]+]]), !dbg ![[X_DI:[0-9]+]]
+// CHECK: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[Y_MD:[0-9]+]]), !dbg ![[Y_DI:[0-9]+]]
+// result
+// CHECK: call void @llvm.dbg.declare
+
+
// CHECK: define {{.*}} @main
// CHECK: call {{.*}} @_Z3fooii
// CHECK: call {{.*}} @_Z3fooii
@@ -96,3 +111,13 @@ main(int argc, char const *argv[])
// CHECK: load {{.*}} !dbg ![[DBG]]
// CHECK: call {{.*}} @_Z11strange_maxii(i32 {{.*}}, i32 {{.*}}), !dbg ![[DBG]]
// CHECK: call {{.*}} @_Z11strange_maxii(i32 {{.*}}, i32 {{.*}}), !dbg ![[DBG]]
+
+
+// Verify that product() has its own inlined_at location at column 15.
+// CHECK-DAG: ![[A_MD]] = metadata{{.*}}[ DW_TAG_arg_variable ] [a]
+// CHECK-DAG: ![[B_MD]] = metadata{{.*}}[ DW_TAG_arg_variable ] [b]
+// CHECK-DAG: ![[X_MD]] = metadata{{.*}}[ DW_TAG_arg_variable ] [x]
+// CHECK-DAG: ![[Y_MD]] = metadata{{.*}}[ DW_TAG_arg_variable ] [y]
+// CHECK-DAG: ![[X_DI]] = metadata !{i32 {{[0-9]+}}, i32 {{[0-9]+}}, metadata !{{[0-9]+}}, metadata ![[PRODUCT:[0-9]+]]}
+// CHECK-DAG: [[PRODUCT]] = metadata !{i32 {{.*}}, i32 16, metadata !{{.*}}, null}
+// CHECK-DAG: ![[Y_DI]] = metadata !{i32 {{[0-9]+}}, i32 {{[0-9]+}}, metadata !{{[0-9]+}}, metadata ![[PRODUCT]]}
diff --git a/test/CodeGenCXX/debug-info-scope.cpp b/test/CodeGenCXX/debug-info-scope.cpp
new file mode 100644
index 000000000000..557ee3178354
--- /dev/null
+++ b/test/CodeGenCXX/debug-info-scope.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -g -emit-llvm %s -o -| FileCheck %s
+//
+// Two variables with the same name in subsequent if staments need to be in separate scopes.
+//
+// rdar://problem/14024005
+//
+
+int printf(const char*, ...);
+
+char *return_char (int input)
+{
+ if (input%2 == 0)
+ return "I am even.\n";
+ else
+ return "I am odd.\n";
+}
+
+int main2() {
+// CHECK: [ DW_TAG_auto_variable ] [ptr] [line [[@LINE+2]]]
+// CHECK metadata !{i32 {{.*}}, metadata !{{.*}}, i32 [[@LINE+1]], {{.*}}} ; [ DW_TAG_lexical_block ]
+ if (char *ptr = return_char(1)) {
+ printf ("%s", ptr);
+ }
+// CHECK: [ DW_TAG_auto_variable ] [ptr] [line [[@LINE+2]]]
+// CHECK metadata !{i32 {{.*}}, metadata !{{.*}}, i32 [[@LINE+1]], {{.*}}} ; [ DW_TAG_lexical_block ]
+ if (char *ptr = return_char(2)) {
+ printf ("%s", ptr);
+ }
+ else printf ("%s", ptr);
+
+ return 0;
+}
diff --git a/test/CodeGenCXX/debug-info-static-member.cpp b/test/CodeGenCXX/debug-info-static-member.cpp
index 774f7b1727c3..1ac235c50f8e 100644
--- a/test/CodeGenCXX/debug-info-static-member.cpp
+++ b/test/CodeGenCXX/debug-info-static-member.cpp
@@ -1,7 +1,9 @@
-// RUN: %clangxx -target x86_64-unknown-unknown -g -O0 %s -emit-llvm -S -o - | FileCheck %s
+// RUN: %clangxx -target x86_64-unknown-unknown -g %s -emit-llvm -S -o - | FileCheck %s
// PR14471
-
+enum X {
+ Y
+};
class C
{
static int a;
@@ -13,6 +15,7 @@ public:
static int c;
const static int const_c = 18;
int d;
+ static X x_a;
};
int C::a = 4;
@@ -30,12 +33,15 @@ int main()
// why the definition of "a" comes before the declarations while
// "b" and "c" come after.
-// CHECK: metadata !"a", {{.*}} @_ZN1C1aE, metadata ![[DECL_A:[0-9]+]]} ; [ DW_TAG_variable ] [a] {{.*}} [def]
-// CHECK: ![[DECL_A]] = metadata {{.*}} [ DW_TAG_member ] [a] [line {{.*}}, size 0, align 0, offset 0] [private] [static]
+// CHECK: metadata !"_ZTS1X"} ; [ DW_TAG_enumeration_type ] [X]
+// CHECK: metadata !"_ZTS1C"} ; [ DW_TAG_class_type ] [C]
+// CHECK: ![[DECL_A:[0-9]+]] = metadata {{.*}} [ DW_TAG_member ] [a] [line {{.*}}, size 0, align 0, offset 0] [private] [static]
// CHECK: metadata !"const_a", {{.*}}, i1 true} ; [ DW_TAG_member ] [const_a] [line {{.*}}, size 0, align 0, offset 0] [private] [static]
// CHECK: ![[DECL_B:[0-9]+]] {{.*}} metadata !"b", {{.*}} [ DW_TAG_member ] [b] [line {{.*}}, size 0, align 0, offset 0] [protected] [static]
// CHECK: metadata !"const_b", {{.*}}, float 0x{{.*}}} ; [ DW_TAG_member ] [const_b] [line {{.*}}, size 0, align 0, offset 0] [protected] [static]
// CHECK: ![[DECL_C:[0-9]+]] {{.*}} metadata !"c", {{.*}} [ DW_TAG_member ] [c] [line {{.*}}, size 0, align 0, offset 0] [static]
// CHECK: metadata !"const_c", {{.*}} [ DW_TAG_member ] [const_c] [line {{.*}}, size 0, align 0, offset 0] [static]
+// CHECK: metadata !"x_a", {{.*}} [ DW_TAG_member ] [x_a] {{.*}} [static]
+// CHECK: metadata !"a", {{.*}} @_ZN1C1aE, metadata ![[DECL_A]]} ; [ DW_TAG_variable ] [a] {{.*}} [def]
// CHECK: metadata !"b", {{.*}} @_ZN1C1bE, metadata ![[DECL_B]]} ; [ DW_TAG_variable ] [b] {{.*}} [def]
// CHECK: metadata !"c", {{.*}} @_ZN1C1cE, metadata ![[DECL_C]]} ; [ DW_TAG_variable ] [c] {{.*}} [def]
diff --git a/test/CodeGenCXX/debug-info-template-limit.cpp b/test/CodeGenCXX/debug-info-template-limit.cpp
index afad31b14efa..c3e241ecc806 100644
--- a/test/CodeGenCXX/debug-info-template-limit.cpp
+++ b/test/CodeGenCXX/debug-info-template-limit.cpp
@@ -1,8 +1,8 @@
// RUN: %clang -flimit-debug-info -emit-llvm -g -S %s -o - | FileCheck %s
// Check that this pointer type is TC<int>
-// CHECK: ![[LINE:[0-9]+]]} ; [ DW_TAG_pointer_type ]{{.*}}[from TC<int>]
-// CHECK-NEXT: ![[LINE]] ={{.*}}"TC<int>"
+// CHECK: ![[LINE:[0-9]+]] = {{.*}}"TC<int>", {{.*}} metadata !"_ZTS2TCIiE"} ; [ DW_TAG_class_type ]
+// CHECK: metadata !"_ZTS2TCIiE"} ; [ DW_TAG_pointer_type ]{{.*}}[from _ZTS2TCIiE]
template<typename T>
class TC {
diff --git a/test/CodeGenCXX/debug-info-template-member.cpp b/test/CodeGenCXX/debug-info-template-member.cpp
index 6be7f9bd2495..9ac1befc1019 100644
--- a/test/CodeGenCXX/debug-info-template-member.cpp
+++ b/test/CodeGenCXX/debug-info-template-member.cpp
@@ -1,21 +1,78 @@
// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s
-class MyClass
-{
-public:
- int add2(int j)
- {
- return add<2>(j);
- }
-private:
- template <int i> int add(int j)
- {
- return i + j;
- }
+struct MyClass {
+ template <int i> int add(int j) {
+ return i + j;
+ }
+ virtual void func() {
+ }
};
-MyClass m;
+int add2(int x) {
+ return MyClass().add<2>(x);
+}
+
+inline int add3(int x) {
+ return MyClass().add<3>(x); // even though add<3> is ODR used, don't emit it since we don't codegen it
+}
+
+// CHECK: [[FOO_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTS3foo"} ; [ DW_TAG_structure_type ] [foo]
+// CHECK: [[FOO_MEM]] = metadata !{metadata [[FOO_FUNC:![0-9]*]]}
+// CHECK: [[FOO_FUNC]] = {{.*}}, metadata !"_ZN3foo4funcEN5outerIS_E5innerE", i32 {{[0-9]*}}, metadata [[FOO_FUNC_TYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [func]
+// CHECK: [[FOO_FUNC_TYPE]] = {{.*}}, metadata [[FOO_FUNC_PARAMS:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
+// CHECK: [[FOO_FUNC_PARAMS]] = metadata !{null, metadata !{{[0-9]*}}, metadata [[OUTER_FOO_INNER:![0-9]*]]}
+// CHECK: [[OUTER_FOO_INNER]] = {{.*}} ; [ DW_TAG_structure_type ] [inner]
+
+// CHECK: metadata [[VIRT_MEM:![0-9]*]], i32 0, metadata !"_ZTS4virtI4elemE", metadata [[VIRT_TEMP_PARAM:![0-9]*]], metadata !"_ZTS4virtI4elemE"} ; [ DW_TAG_structure_type ] [virt<elem>] {{.*}} [def]
+// CHECK: [[VIRT_TEMP_PARAM]] = metadata !{metadata [[VIRT_T:![0-9]*]]}
+// CHECK: [[VIRT_T]] = {{.*}}, metadata !"T", metadata !"_ZTS4elem", {{.*}} ; [ DW_TAG_template_type_parameter ]
+
+// CHECK: [[C:![0-9]*]] = {{.*}}, metadata [[C_MEM:![0-9]*]], i32 0, metadata !"_ZTS7MyClass", null, metadata !"_ZTS7MyClass"} ; [ DW_TAG_structure_type ] [MyClass]
+// CHECK: [[C_MEM]] = metadata !{metadata [[C_VPTR:![0-9]*]], metadata [[C_ADD:![0-9]*]], metadata [[C_FUNC:![0-9]*]], metadata [[C_CTOR:![0-9]*]]}
+// CHECK: [[C_VPTR]] = {{.*}} ; [ DW_TAG_member ] [_vptr$MyClass]
+
+// CHECK: [[C_ADD]] = {{.*}} ; [ DW_TAG_subprogram ] [line 4] [add<2>]
+// CHECK: [[C_FUNC]] = {{.*}} ; [ DW_TAG_subprogram ] [line 7] [func]
+// CHECK: [[C_CTOR]] = {{.*}} ; [ DW_TAG_subprogram ] [line 0] [MyClass]
+
+// CHECK: [[ELEM:![0-9]*]] = {{.*}}, metadata [[ELEM_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTS4elem"} ; [ DW_TAG_structure_type ] [elem] {{.*}} [def]
+// CHECK: [[ELEM_MEM]] = metadata !{metadata [[ELEM_X:![0-9]*]]}
+// CHECK: [[ELEM_X]] = {{.*}} ; [ DW_TAG_member ] [x] {{.*}} [static] [from _ZTS4virtI4elemE]
+
+template<typename T>
+struct outer {
+ struct inner {
+ int i;
+ };
+};
+
+struct foo {
+ void func(outer<foo>::inner);
+};
+
+inline void func() {
+ // require 'foo' to be complete before the emission of 'inner' so that, when
+ // constructing the context chain for 'x' we emit the full definition of
+ // 'foo', which requires the definition of 'inner' again
+ foo f;
+}
+
+outer<foo>::inner x;
+
+// CHECK: metadata [[OUTER_FOO_INNER]], i32 {{[0-9]*}}, i32 {{[0-9]*}}, %"struct.outer<foo>::inner"* @x, {{.*}} ; [ DW_TAG_variable ] [x]
+
+template <typename T>
+struct virt {
+ T* values;
+ virtual ~virt();
+};
+struct elem {
+ static virt<elem> x; // ensure that completing 'elem' will require/completing 'virt<elem>'
+};
+inline void f1() {
+ elem e; // ensure 'elem' is required to be complete when it is emitted as a template argument for 'virt<elem>'
+};
+void f2() {
+ virt<elem> d; // emit 'virt<elem>'
+}
-// CHECK: metadata [[C_MEM:![0-9]*]], i32 0, null, null} ; [ DW_TAG_class_type ] [MyClass]
-// CHECK: [[C_MEM]] = metadata !{metadata {{.*}}, metadata [[C_TEMP:![0-9]*]], metadata {{.*}}}
-// CHECK: [[C_TEMP]] = {{.*}} ; [ DW_TAG_subprogram ] [line 11] [private] [add<2>]
diff --git a/test/CodeGenCXX/debug-info-template-quals.cpp b/test/CodeGenCXX/debug-info-template-quals.cpp
index 335c8abb11e4..740f7bfa5ce5 100644
--- a/test/CodeGenCXX/debug-info-template-quals.cpp
+++ b/test/CodeGenCXX/debug-info-template-quals.cpp
@@ -15,13 +15,13 @@ void foo (const char *c) {
str.assign(c, str);
}
-// CHECK: [[P:.*]] = {{.*}}, metadata [[CON:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
+// CHECK: [[BS:.*]] = {{.*}} ; [ DW_TAG_structure_type ] [basic_string<char>] [line 4, size 8, align 8, offset 0] [def] [from ]
+// CHECK: [[TYPE:![0-9]*]] = metadata !{i32 {{.*}}, metadata [[ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
+// CHECK: [[ARGS]] = metadata !{metadata !{{.*}}, metadata !{{.*}}, metadata [[P:![0-9]*]], metadata [[R:.*]]}
+// CHECK: [[P]] = {{.*}}, metadata [[CON:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
// CHECK: [[CON]] = {{.*}}, metadata [[CH:![0-9]*]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from char]
// CHECK: [[CH]] = {{.*}} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
-// CHECK: {{.*}} metadata [[TYPE:![0-9]*]], {{.*}}, metadata !{{[0-9]*}}, metadata !{{[0-9]*}}, i32 8} ; [ DW_TAG_subprogram ] [line 7] [def] [scope 8] [assign]
-// CHECK: [[TYPE]] = metadata !{i32 {{.*}}, metadata [[ARGS:.*]], i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
-// CHECK: [[ARGS]] = metadata !{metadata !{{.*}}, metadata !{{.*}}, metadata [[P]], metadata [[R:.*]]}
-// CHECK: [[BS:.*]] = {{.*}} ; [ DW_TAG_structure_type ] [basic_string<char>] [line 4, size 8, align 8, offset 0] [from ]
// CHECK: [[R]] = {{.*}}, metadata [[CON2:![0-9]*]]} ; [ DW_TAG_reference_type ] [line 0, size 0, align 0, offset 0] [from ]
-// CHECK: [[CON2]] = {{.*}}, metadata [[BS]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from basic_string<char>]
+// CHECK: [[CON2]] = {{.*}}, metadata !"_ZTS12basic_stringIcE"} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from _ZTS12basic_stringIcE]
+// CHECK: {{.*}} metadata [[TYPE]], {{.*}}, metadata !{{[0-9]*}}, metadata !{{[0-9]*}}, i32 8} ; [ DW_TAG_subprogram ] [line 7] [def] [scope 8] [assign]
diff --git a/test/CodeGenCXX/debug-info-template.cpp b/test/CodeGenCXX/debug-info-template.cpp
index 9d52159bed84..f58973bcceae 100644
--- a/test/CodeGenCXX/debug-info-template.cpp
+++ b/test/CodeGenCXX/debug-info-template.cpp
@@ -1,46 +1,116 @@
-// RUN: %clang -emit-llvm -g -S %s -o - | FileCheck %s
+// RUN: %clang -S -emit-llvm -target x86_64-unknown_unknown -g %s -o - -std=c++11 | FileCheck %s
-//CHECK: TC<int>
-//CHECK: DW_TAG_template_type_parameter
+// CHECK: {{.*}}, i1 false, metadata !"", i32 0, metadata !{{[0-9]]*}}, metadata [[RETAIN:![0-9]*]], {{.*}} ; [ DW_TAG_compile_unit ]
+// CHECK: [[EMPTY:![0-9]*]] = metadata !{i32 0}
+// CHECK: [[RETAIN]] = metadata !{metadata !{{[0-9]]*}}, metadata [[FOO:![0-9]*]],
-template<typename T>
-class TC {
-public:
- TC(const TC &) {}
- TC() {}
-};
-TC<int> tci;
+// CHECK: [[TC:![0-9]*]] = {{.*}}, metadata [[TCARGS:![0-9]*]], metadata !"{{.*}}"} ; [ DW_TAG_structure_type ] [TC<unsigned int, 2, &glb, &foo::e, &foo::f, &func, tmpl_impl, 1, 2, 3>]
+// CHECK: [[TCARGS]] = metadata !{metadata [[TCARG1:![0-9]*]], metadata [[TCARG2:![0-9]*]], metadata [[TCARG3:![0-9]*]], metadata [[TCARG4:![0-9]*]], metadata [[TCARG5:![0-9]*]], metadata [[TCARG6:![0-9]*]], metadata [[TCARG7:![0-9]*]], metadata [[TCARG8:![0-9]*]]}
+//
+// We seem to be missing file/line/col info on template value parameters -
+// metadata supports it but it's not populated. GCC doesn't emit it either,
+// perhaps we should just drop it from the metadata.
+//
+// CHECK: [[TCARG1]] = {{.*}}metadata !"T", metadata [[UINT:![0-9]*]], {{.*}} ; [ DW_TAG_template_type_parameter ]
+// CHECK: [[UINT:![0-9]*]] = {{.*}} ; [ DW_TAG_base_type ] [unsigned int]
+// CHECK: [[TCARG2]] = {{.*}}metadata !"", metadata [[UINT]], i32 2, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[TCARG3]] = {{.*}}metadata !"x", metadata [[INTPTR:![0-9]*]], i32* @glb, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[INTPTR]] = {{.*}}, metadata [[INT:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from int]
+// CHECK: [[INT]] = {{.*}} ; [ DW_TAG_base_type ] [int]
+// CHECK: [[TCARG4]] = {{.*}}metadata !"a", metadata [[MEMINTPTR:![0-9]*]], i64 8, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[MEMINTPTR]] = {{.*}}, metadata !"_ZTS3foo"} ; [ DW_TAG_ptr_to_member_type ] {{.*}}[from int]
+//
+// Currently Clang emits the pointer-to-member-function value, but LLVM doesn't
+// use it (GCC doesn't emit a value for pointers to member functions either - so
+// it's not clear what, if any, format would be acceptable to GDB)
+//
+// CHECK: [[TCARG5]] = {{.*}}metadata !"b", metadata [[MEMFUNPTR:![0-9]*]], { i64, i64 } { i64 ptrtoint (void (%struct.foo*)* @_ZN3foo1fEv to i64), i64 0 }, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[MEMFUNPTR]] = {{.*}}, metadata [[FTYPE:![0-9]*]], metadata !"_ZTS3foo"} ; [ DW_TAG_ptr_to_member_type ]
+// CHECK: [[FTYPE]] = {{.*}}, metadata [[FARGS:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
+// CHECK: [[FARGS]] = metadata !{null, metadata [[FARG1:![0-9]*]]}
+// CHECK: [[FARG1]] = {{.*}} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS3foo]
+//
+// CHECK: [[TCARG6]] = {{.*}}metadata !"f", metadata [[FUNPTR:![0-9]*]], void ()* @_Z4funcv, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[FUNPTR]] = {{.*}}, metadata [[FUNTYPE:![0-9]*]]} ; [ DW_TAG_pointer_type ]
+// CHECK: [[FUNTYPE]] = {{.*}}, metadata [[FUNARGS:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
+// CHECK: [[FUNARGS]] = metadata !{null}
+// CHECK: [[TCARG7]] = {{.*}}metadata !"tmpl", null, metadata !"tmpl_impl", {{.*}} ; [ DW_TAG_GNU_template_template_param ]
+// CHECK: [[TCARG8]] = {{.*}}metadata !"Is", null, metadata [[TCARG8_VALS:![0-9]*]], {{.*}} ; [ DW_TAG_GNU_template_parameter_pack ]
+// CHECK: [[TCARG8_VALS]] = metadata !{metadata [[TCARG8_1:![0-9]*]], metadata [[TCARG8_2:![0-9]*]], metadata [[TCARG8_3:![0-9]*]]}
+// CHECK: [[TCARG8_1]] = {{.*}}metadata !"", metadata [[INT]], i32 1, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[TCARG8_2]] = {{.*}}metadata !"", metadata [[INT]], i32 2, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[TCARG8_3]] = {{.*}}metadata !"", metadata [[INT]], i32 3, {{.*}} ; [ DW_TAG_template_value_parameter ]
+//
+// We could just emit a declaration of 'foo' here, rather than the entire
+// definition (same goes for any time we emit a member (function or data)
+// pointer type)
+// CHECK: [[FOO]] = {{.*}}, metadata !"_ZTS3foo"} ; [ DW_TAG_structure_type ] [foo]
+// CHECK: metadata !"f", metadata !"_ZN3foo1fEv", i32 {{[0-9]*}}, metadata [[FTYPE:![0-9]*]],
+//
+
+
+// CHECK: [[TCNESTED:![0-9]*]] = metadata !{i32 {{[0-9]*}}, metadata !{{[0-9]*}}, metadata !"_ZTS2TCIjLj2EXadL_Z3glbEEXadL_ZN3foo1eEEEXadL_ZNS0_1fEvEEXadL_Z4funcvEE9tmpl_implJLi1ELi2ELi3EEE", {{.*}} ; [ DW_TAG_structure_type ] [nested]
+// CHECK: [[TCNT:![0-9]*]] = {{.*}}, metadata [[TCNARGS:![0-9]*]], metadata !"{{.*}}"} ; [ DW_TAG_structure_type ] [TC<int, -3, nullptr, nullptr, nullptr, nullptr, tmpl_impl>]
+// CHECK: [[TCNARGS]] = metadata !{metadata [[TCNARG1:![0-9]*]], metadata [[TCNARG2:![0-9]*]], metadata [[TCNARG3:![0-9]*]], metadata [[TCNARG4:![0-9]*]], metadata [[TCNARG5:![0-9]*]], metadata [[TCNARG6:![0-9]*]], metadata [[TCARG7:![0-9]*]], metadata [[TCNARG8:![0-9]*]]}
+// CHECK: [[TCNARG1]] = {{.*}}metadata !"T", metadata [[INT]], {{.*}} ; [ DW_TAG_template_type_parameter ]
+// CHECK: [[TCNARG2]] = {{.*}}metadata !"", metadata [[INT]], i32 -3, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[TCNARG3]] = {{.*}}metadata !"x", metadata [[INTPTR]], i8 0, {{.*}} ; [ DW_TAG_template_value_parameter ]
+
+// The interesting null pointer: -1 for member data pointers (since they are
+// just an offset in an object, they can be zero and non-null for the first
+// member)
+
+// CHECK: [[TCNARG4]] = {{.*}}metadata !"a", metadata [[MEMINTPTR]], i64 -1, {{.*}} ; [ DW_TAG_template_value_parameter ]
+//
+// In some future iteration we could possibly emit the value of a null member
+// function pointer as '{ i64, i64 } zeroinitializer' as it may be handled
+// naturally from the LLVM CodeGen side once we decide how to handle non-null
+// member function pointers. For now, it's simpler just to emit the 'i8 0'.
+//
+// CHECK: [[TCNARG5]] = {{.*}}metadata !"b", metadata [[MEMFUNPTR]], i8 0, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[TCNARG6]] = {{.*}}metadata !"f", metadata [[FUNPTR]], i8 0, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[TCNARG8]] = {{.*}}metadata !"Is", null, metadata [[EMPTY]], {{.*}} ; [ DW_TAG_GNU_template_parameter_pack ]
+
+// CHECK: metadata [[PTOARGS:![0-9]*]], metadata !"{{.*}}"} ; [ DW_TAG_structure_type ] [PaddingAtEndTemplate<&PaddedObj>]
+// CHECK: [[PTOARGS]] = metadata !{metadata [[PTOARG1:![0-9]*]]}
+// CHECK: [[PTOARG1]] = {{.*}}metadata !"", metadata [[CONST_PADDINGATEND_PTR:![0-9]*]], { i32, i8, [3 x i8] }* @PaddedObj, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[CONST_PADDINGATEND_PTR]] = {{.*}} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS12PaddingAtEnd]
-//CHECK: TU<2>
-//CHECK: DW_TAG_template_value_parameter
-template<unsigned >
-class TU {
- int b;
+// CHECK: metadata [[TCNESTED]], i32 0, i32 1, %"struct.TC<unsigned int, 2, &glb, &foo::e, &foo::f, &func, tmpl_impl, 1, 2, 3>::nested"* @tci, null} ; [ DW_TAG_variable ] [tci]
+
+// CHECK: metadata [[TCNT:![0-9]*]], i32 0, i32 1, %struct.TC* @tcn, null} ; [ DW_TAG_variable ] [tcn]
+struct foo {
+ char pad[8]; // make the member pointer to 'e' a bit more interesting (nonzero)
+ int e;
+ void f();
+};
+
+template<typename T, T, int *x, int foo::*a, void (foo::*b)(), void (*f)(), template<typename> class tmpl, int ...Is>
+struct TC {
+ struct nested {
+ };
};
-TU<2> u2;
+int glb;
+void func();
-// PR9600
-template<typename T> class vector {};
-class Foo;
-typedef vector<Foo*> FooVector[3];
-struct Test {
- virtual void foo(FooVector *);
+template<typename>
+struct tmpl_impl {
};
-static Test test;
-// PR9608
-template <int i> struct TheTemplate {
- struct Empty2 {};
- typedef const Empty2 DependentType[i];
- TheTemplate() {}
-};
+TC<unsigned, 2, &glb, &foo::e, &foo::f, &func, tmpl_impl, 1, 2, 3>::nested tci;
+TC<int, -3, nullptr, nullptr, nullptr, nullptr, tmpl_impl> tcn;
-class TheTemplateTest : public TheTemplate<42> {
- TheTemplateTest();
- void method(const TheTemplate<42>::DependentType *) {}
-};
+struct PaddingAtEnd {
+ int i;
+ char c;
+};
+
+PaddingAtEnd PaddedObj = {};
-TheTemplateTest::TheTemplateTest() : TheTemplate<42>() {}
+template <const PaddingAtEnd *>
+struct PaddingAtEndTemplate {
+};
+PaddingAtEndTemplate<&PaddedObj> PaddedTemplateObj;
diff --git a/test/CodeGenCXX/debug-info-thunk.cpp b/test/CodeGenCXX/debug-info-thunk.cpp
index 394ebd829188..2a5089572534 100644
--- a/test/CodeGenCXX/debug-info-thunk.cpp
+++ b/test/CodeGenCXX/debug-info-thunk.cpp
@@ -14,4 +14,4 @@ struct C : A, B {
void C::f() { }
-// CHECK: [ DW_TAG_subprogram ] [line 15] [def] [_ZThn{{4|8}}_N1C1fEv]
+// CHECK: metadata !"_ZThn{{4|8}}_N1C1fEv", i32 15, {{.*}} ; [ DW_TAG_subprogram ] [line 15] [def]{{$}}
diff --git a/test/CodeGenCXX/debug-info-union-template.cpp b/test/CodeGenCXX/debug-info-union-template.cpp
index f5e6e14a71d1..570520d03d9e 100644
--- a/test/CodeGenCXX/debug-info-union-template.cpp
+++ b/test/CodeGenCXX/debug-info-union-template.cpp
@@ -10,6 +10,6 @@ namespace PR15637 {
Value<float> f;
}
-// CHECK: {{.*}}, metadata !"Value<float>", {{.*}}, null, metadata [[TTPARAM:.*]]} ; [ DW_TAG_union_type ] [Value<float>]
+// CHECK: {{.*}}, metadata !"Value<float>", {{.*}}, null, metadata [[TTPARAM:.*]], metadata !"_ZTSN7PR156375ValueIfEE"} ; [ DW_TAG_union_type ] [Value<float>]
// CHECK: [[TTPARAM]] = metadata !{metadata [[PARAMS:.*]]}
// CHECK: [[PARAMS]] = metadata !{{{.*}}metadata !"T",{{.*}}} ; [ DW_TAG_template_type_parameter ]
diff --git a/test/CodeGenCXX/debug-info-uuid.cpp b/test/CodeGenCXX/debug-info-uuid.cpp
new file mode 100644
index 000000000000..a57e2f0a84ae
--- /dev/null
+++ b/test/CodeGenCXX/debug-info-uuid.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -emit-llvm -fms-extensions -triple=x86_64-pc-win32 -cxx-abi microsoft -g %s -o - -std=c++11 | FileCheck %s
+// RUN: not %clang_cc1 -emit-llvm -fms-extensions -triple=x86_64-unknown-unknown -g %s -o - -std=c++11 2>&1 | FileCheck %s --check-prefix=CHECK-ITANIUM
+
+// CHECK: metadata [[TGIARGS:![0-9]*]], null} ; [ DW_TAG_structure_type ] [tmpl_guid<&__uuidof(uuid)>]
+// CHECK: [[TGIARGS]] = metadata !{metadata [[TGIARG1:![0-9]*]]}
+// CHECK: [[TGIARG1]] = {{.*}}metadata !"", metadata [[CONST_GUID_PTR:![0-9]*]], { i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab, {{.*}} ; [ DW_TAG_template_value_parameter ]
+// CHECK: [[CONST_GUID_PTR]] = {{.*}}, metadata [[CONST_GUID:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
+// CHECK: [[CONST_GUID]] = {{.*}}, metadata [[GUID:![0-9]*]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from _GUID]
+// CHECK: [[GUID]] = {{.*}} ; [ DW_TAG_structure_type ] [_GUID]
+
+// CHECK-ITANIUM: error: cannot yet mangle expression type CXXUuidofExpr
+
+struct _GUID;
+template <const _GUID *>
+struct tmpl_guid {
+};
+
+struct __declspec(uuid("{12345678-1234-1234-1234-1234567890ab}")) uuid;
+tmpl_guid<&__uuidof(uuid)> tgi;
diff --git a/test/CodeGenCXX/debug-info-zero-length-arrays.cpp b/test/CodeGenCXX/debug-info-zero-length-arrays.cpp
index fb47022b646f..101796509da3 100644
--- a/test/CodeGenCXX/debug-info-zero-length-arrays.cpp
+++ b/test/CodeGenCXX/debug-info-zero-length-arrays.cpp
@@ -7,6 +7,6 @@ class A {
A a;
// CHECK: metadata [[ARRAY_TYPE:![0-9]*]]} ; [ DW_TAG_member ] [x]
-// CHECK: metadata [[ELEM_TYPE:![0-9]*]], i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 0, align 32, offset 0] [from int]
+// CHECK: metadata [[ELEM_TYPE:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 0, align 32, offset 0] [from int]
// CHECK: [[ELEM_TYPE]] = metadata !{metadata [[SUBRANGE:.*]]}
// CHECK: [[SUBRANGE]] = metadata !{i32 786465, i64 0, i64 -1} ; [ DW_TAG_subrange_type ] [unbounded]
diff --git a/test/CodeGenCXX/debug-info.cpp b/test/CodeGenCXX/debug-info.cpp
index 33b52789caf2..93a4fe3f466a 100644
--- a/test/CodeGenCXX/debug-info.cpp
+++ b/test/CodeGenCXX/debug-info.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm-only -g %s
+// RUN: %clang_cc1 -triple x86_64-none-linux-gnu -emit-llvm -g %s -o - | FileCheck %s
template<typename T> struct Identity {
typedef T Type;
};
@@ -67,3 +67,54 @@ class Cls {
Cls obj;
}
+
+namespace pr14763 {
+struct foo {
+ foo(const foo&);
+};
+
+foo func(foo f) {
+ return f; // reference 'f' for now because otherwise we hit another bug
+}
+
+// CHECK: [[FOO:![0-9]*]] = metadata !{i32 {{[0-9]*}}, metadata !{{[0-9]*}}, metadata [[PR14763:![0-9]*]], {{.*}} ; [ DW_TAG_structure_type ] [foo]
+// CHECK: [[PR14763]] = {{.*}} ; [ DW_TAG_namespace ] [pr14763]
+// CHECK: [[INCTYPE:![0-9]*]] = {{.*}} ; [ DW_TAG_structure_type ] [incomplete]{{.*}} [decl]
+// CHECK: metadata [[A_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTSN7pr162141aE"} ; [ DW_TAG_structure_type ] [a]
+// CHECK: [[A_MEM]] = metadata !{metadata [[A_I:![0-9]*]]}
+// CHECK: [[A_I]] = {{.*}} ; [ DW_TAG_member ] [i] {{.*}} [from int]
+// CHECK: ; [ DW_TAG_structure_type ] [b] {{.*}}[decl]
+
+// CHECK: [[FUNC:![0-9]*]] = {{.*}} metadata !"_ZN7pr147634funcENS_3fooE", i32 {{[0-9]*}}, metadata [[FUNC_TYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func]
+}
+
+namespace pr9608 { // also pr9600
+struct incomplete;
+incomplete (*x)[3];
+// CHECK: metadata [[INCARRAYPTR:![0-9]*]], i32 0, i32 1, [3 x i8]** @_ZN6pr96081xE, null} ; [ DW_TAG_variable ] [x]
+// CHECK: [[INCARRAYPTR]] = {{.*}}metadata [[INCARRAY:![0-9]*]]} ; [ DW_TAG_pointer_type ]
+// CHECK: [[INCARRAY]] = {{.*}}metadata !"_ZTSN6pr960810incompleteE", metadata {{![0-9]*}}, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 0, align 0, offset 0] [from _ZTSN6pr960810incompleteE]
+}
+
+// For some reason the argument for PR14763 ended up all the way down here
+// CHECK: = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], {{.*}}, metadata [[FOO]], i32 8192, i32 0} ; [ DW_TAG_arg_variable ] [f]
+
+namespace pr16214 {
+struct a {
+ int i;
+};
+
+typedef a at;
+
+struct b {
+};
+
+typedef b bt;
+
+void func() {
+ at a_inst;
+ bt *b_ptr_inst;
+ const bt *b_cnst_ptr_inst;
+}
+
+}
diff --git a/test/CodeGenCXX/debug-lambda-expressions.cpp b/test/CodeGenCXX/debug-lambda-expressions.cpp
index 39c9a445c4ee..0b087360f9d5 100644
--- a/test/CodeGenCXX/debug-lambda-expressions.cpp
+++ b/test/CodeGenCXX/debug-lambda-expressions.cpp
@@ -12,7 +12,7 @@ int b(int x) { return [x]{return x;}(); }
int c(int x) { return [&x]{return x;}(); }
struct D { D(); D(const D&); int x; };
-int d(int x) { D y[10]; [x,y] { return y[x].x; }(); }
+int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); }
// Randomness for file. -- 6
// CHECK: [[FILE:.*]] = {{.*}} [ DW_TAG_file_type ] [{{.*}}debug-lambda-expressions.cpp]
@@ -30,42 +30,38 @@ int d(int x) { D y[10]; [x,y] { return y[x].x; }(); }
// CHECK: [[D_FUNC:.*]] = {{.*}} [ DW_TAG_subprogram ] [line [[D_LINE:.*]]] [def] [d]
// Back to D. -- 24
-// CHECK: [[LAM_D:.*]] = {{.*}}, metadata [[D_FUNC]], {{.*}}, metadata [[LAM_D_ARGS:.*]], i32 0, null, null} ; [ DW_TAG_class_type ] [line [[D_LINE]],
-// CHECK: [[LAM_D_ARGS]] = metadata !{metadata [[CAP_D_X:.*]], metadata [[CAP_D_Y:.*]], metadata [[CON_LAM_D:.*]], metadata [[DES_LAM_D:.*]]}
+// CHECK: [[LAM_D:.*]] = {{.*}}, metadata [[D_FUNC]], {{.*}}, metadata [[LAM_D_ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[D_LINE]],
+// CHECK: [[LAM_D_ARGS]] = metadata !{metadata [[CAP_D_X:.*]], metadata [[CAP_D_Y:.*]], metadata [[CON_LAM_D:.*]]}
// CHECK: [[CAP_D_X]] = {{.*}}, metadata [[LAM_D]], {{.*}} [ DW_TAG_member ] [x] [line [[D_LINE]],
// CHECK: [[CAP_D_Y]] = {{.*}}, metadata [[LAM_D]], {{.*}} [ DW_TAG_member ] [y] [line [[D_LINE]],
// CHECK: [[CON_LAM_D]] = {{.*}}, metadata [[LAM_D]], {{.*}} [ DW_TAG_subprogram ] [line [[D_LINE]]] [operator()]
-// CHECK: [[DES_LAM_D]] = {{.*}}, metadata [[LAM_D]], {{.*}} [ DW_TAG_subprogram ] [line [[D_LINE]]] [~]
// Back to C. -- 55
-// CHECK: [[LAM_C:.*]] = {{.*}}, metadata [[C_FUNC]], {{.*}}, metadata [[LAM_C_ARGS:.*]], i32 0, null, null} ; [ DW_TAG_class_type ] [line [[C_LINE]],
-// CHECK: [[LAM_C_ARGS]] = metadata !{metadata [[CAP_C:.*]], metadata [[CON_LAM_C:.*]], metadata [[DES_LAM_C:.*]]}
+// CHECK: [[LAM_C:.*]] = {{.*}}, metadata [[C_FUNC]], {{.*}}, metadata [[LAM_C_ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[C_LINE]],
+// CHECK: [[LAM_C_ARGS]] = metadata !{metadata [[CAP_C:.*]], metadata [[CON_LAM_C:.*]]}
// Ignoring the member type for now.
// CHECK: [[CAP_C]] = {{.*}}, metadata [[LAM_C]], {{.*}}} ; [ DW_TAG_member ] [x] [line [[C_LINE]],
// CHECK: [[CON_LAM_C]] = {{.*}}, metadata [[LAM_C]], {{.*}} [ DW_TAG_subprogram ] [line [[C_LINE]]] [operator()]
-// CHECK: [[DES_LAM_C]] = {{.*}}, metadata [[LAM_C]], {{.*}} [ DW_TAG_subprogram ] [line [[C_LINE]]] [~]
// Back to B. -- 67
-// CHECK: [[LAM_B:.*]] = {{.*}}, metadata [[B_FUNC]], {{.*}}, metadata [[LAM_B_ARGS:.*]], i32 0, null, null} ; [ DW_TAG_class_type ] [line [[B_LINE]],
-// CHECK: [[LAM_B_ARGS]] = metadata !{metadata [[CAP_B:.*]], metadata [[CON_LAM_B:.*]], metadata [[DES_LAM_B:.*]]}
+// CHECK: [[LAM_B:.*]] = {{.*}}, metadata [[B_FUNC]], {{.*}}, metadata [[LAM_B_ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[B_LINE]],
+// CHECK: [[LAM_B_ARGS]] = metadata !{metadata [[CAP_B:.*]], metadata [[CON_LAM_B:.*]]}
// CHECK: [[CAP_B]] = {{.*}}, metadata [[LAM_B]], {{.*}}} ; [ DW_TAG_member ] [x] [line [[B_LINE]],
// CHECK: [[CON_LAM_B]] = {{.*}}, metadata [[LAM_B]], {{.*}} [ DW_TAG_subprogram ] [line [[B_LINE]]] [operator()]
-// CHECK: [[DES_LAM_B]] = {{.*}}, metadata [[LAM_B]], {{.*}} [ DW_TAG_subprogram ] [line [[B_LINE]]] [~]
// Back to A. -- 78
-// CHECK: [[LAM_A:.*]] = {{.*}}, metadata [[A_FUNC]], {{.*}}, metadata [[LAM_A_ARGS:.*]], i32 0, null, null} ; [ DW_TAG_class_type ] [line [[A_LINE]],
-// CHECK: [[LAM_A_ARGS]] = metadata !{metadata [[CON_LAM_A:.*]], metadata [[DES_LAM_A:.*]]}
+// CHECK: [[LAM_A:.*]] = {{.*}}, metadata [[A_FUNC]], {{.*}}, metadata [[LAM_A_ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[A_LINE]],
+// CHECK: [[LAM_A_ARGS]] = metadata !{metadata [[CON_LAM_A:.*]]}
// CHECK: [[CON_LAM_A]] = {{.*}}, metadata [[LAM_A]], {{.*}} [ DW_TAG_subprogram ] [line [[A_LINE]]] [operator()]
-// CHECK: [[DES_LAM_A]] = {{.*}}, metadata [[LAM_A]], {{.*}} [ DW_TAG_subprogram ] [line [[A_LINE]]] [~]
// CVAR:
// CHECK: {{.*}} metadata [[CVAR_T:![0-9]*]], {{.*}} ; [ DW_TAG_variable ] [cvar] [line [[CVAR_LINE:[0-9]*]]]
-// CHECK: [[CVAR_T]] = {{.*}}, metadata ![[CVAR_ARGS:.*]], i32 0, null, null} ; [ DW_TAG_class_type ] [line [[CVAR_LINE]],
-// CHECK: [[CVAR_ARGS]] = metadata !{metadata !{{.*}}, metadata !{{.*}}, metadata !{{.*}}}
+// CHECK: [[CVAR_T]] = {{.*}}, metadata ![[CVAR_ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[CVAR_LINE]],
+// CHECK: [[CVAR_ARGS]] = metadata !{metadata !{{.*}}}
// VAR:
// CHECK: {{.*}} metadata [[VAR_T:![0-9]*]], {{.*}} ; [ DW_TAG_variable ] [var] [line [[VAR_LINE:[0-9]*]]]
-// CHECK: [[VAR_T]] = {{.*}}, metadata [[VAR_ARGS:![0-9]*]], i32 0, null, null} ; [ DW_TAG_class_type ] [line [[VAR_LINE]],
-// CHECK: [[VAR_ARGS]] = metadata !{metadata !{{.*}}, metadata !{{.*}}, metadata !{{.*}}}
+// CHECK: [[VAR_T]] = {{.*}}, metadata [[VAR_ARGS:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_class_type ] [line [[VAR_LINE]],
+// CHECK: [[VAR_ARGS]] = metadata !{metadata !{{.*}}}
diff --git a/test/CodeGenCXX/decl-ref-init.cpp b/test/CodeGenCXX/decl-ref-init.cpp
index a066fbb3f3ea..1a82ee2b485b 100644
--- a/test/CodeGenCXX/decl-ref-init.cpp
+++ b/test/CodeGenCXX/decl-ref-init.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-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 3d741d502834..43756006f209 100644
--- a/test/CodeGenCXX/default-arg-temps.cpp
+++ b/test/CodeGenCXX/default-arg-temps.cpp
@@ -13,7 +13,7 @@ public:
X(const X&, const T& t = T());
};
-// CHECK: define void @_Z1gv()
+// CHECK-LABEL: define void @_Z1gv()
void g() {
// CHECK: call void @_ZN1TC1Ev([[T:%.*]]* [[AGG1:%.*]])
// CHECK-NEXT: call void @_Z1fRK1T([[T]]* [[AGG1]])
@@ -41,7 +41,7 @@ void g() {
class obj{ int a; float b; double d; };
-// CHECK: define void @_Z1hv()
+// CHECK-LABEL: define void @_Z1hv()
void h() {
// CHECK: call void @llvm.memset.p0i8.i64(
obj o = obj();
@@ -61,7 +61,7 @@ namespace test1 {
C c;
A a;
- // CHECK: define linkonce_odr void @_ZN5test11DC2Ev(%"struct.test1::D"* %this) unnamed_addr
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test11DC2Ev(%"struct.test1::D"* %this) unnamed_addr
// CHECK: call void @_ZN5test11BC1Ev(
// CHECK-NEXT: call void @_ZN5test11CC1ERKNS_1BE(
// CHECK-NEXT: call void @_ZN5test11BD1Ev(
diff --git a/test/CodeGenCXX/default-arguments.cpp b/test/CodeGenCXX/default-arguments.cpp
index 206d4d6c8860..83cae3afd561 100644
--- a/test/CodeGenCXX/default-arguments.cpp
+++ b/test/CodeGenCXX/default-arguments.cpp
@@ -26,7 +26,7 @@ struct B {
B(const A1& = A1(), const A2& = A2());
};
-// CHECK: define void @_Z2f1v()
+// CHECK-LABEL: define void @_Z2f1v()
void f1() {
// CHECK: call void @_ZN2A1C1Ev(
@@ -42,10 +42,10 @@ struct C {
C();
};
-// CHECK: define void @_ZN1CC1Ev(%struct.C* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN1CC1Ev(%struct.C* %this) unnamed_addr
// CHECK: call void @_ZN1CC2Ev(
-// CHECK: define void @_ZN1CC2Ev(%struct.C* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN1CC2Ev(%struct.C* %this) unnamed_addr
// CHECK: call void @_ZN2A1C1Ev(
// CHECK: call void @_ZN2A2C1Ev(
// CHECK: call void @_ZN1BC1ERK2A1RK2A2(
@@ -53,7 +53,7 @@ struct C {
// CHECK: call void @_ZN2A1D1Ev
C::C() { }
-// CHECK: define void @_Z2f3v()
+// CHECK-LABEL: define void @_Z2f3v()
void f3() {
// CHECK: call void @_ZN2A1C1Ev(
// CHECK: call void @_ZN2A2C1Ev(
diff --git a/test/CodeGenCXX/default-constructor-for-members.cpp b/test/CodeGenCXX/default-constructor-for-members.cpp
index 714811f37b14..6065b49ac158 100644
--- a/test/CodeGenCXX/default-constructor-for-members.cpp
+++ b/test/CodeGenCXX/default-constructor-for-members.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/default-constructor-template-member.cpp b/test/CodeGenCXX/default-constructor-template-member.cpp
index 0dd64dfcb4c9..215696405a4f 100644
--- a/test/CodeGenCXX/default-constructor-template-member.cpp
+++ b/test/CodeGenCXX/default-constructor-template-member.cpp
@@ -5,6 +5,7 @@ struct B { A<int> x; };
void a() {
B b;
}
+
// CHECK: call {{.*}} @_ZN1BC1Ev
-// CHECK: define linkonce_odr {{.*}} @_ZN1BC1Ev(%struct.B* %this) unnamed_addr
+// CHECK: define linkonce_odr {{.*}} @_ZN1BC1Ev(%struct.B* {{.*}}%this) unnamed_addr
// CHECK: call {{.*}} @_ZN1AIiEC1Ev
diff --git a/test/CodeGenCXX/deferred-global-init.cpp b/test/CodeGenCXX/deferred-global-init.cpp
index 24c8c675b006..deb458f55c7d 100644
--- a/test/CodeGenCXX/deferred-global-init.cpp
+++ b/test/CodeGenCXX/deferred-global-init.cpp
@@ -7,10 +7,10 @@ void* bar() { return a; }
// CHECK: @_ZL1a = internal global i8* null
-// CHECK: define internal void @__cxx_global_var_init
+// CHECK-LABEL: define internal void @__cxx_global_var_init
// CHECK: load i8** @foo
// CHECK: ret void
-// CHECK: define internal void @_GLOBAL__I_a
+// CHECK-LABEL: define internal void @_GLOBAL__I_a
// CHECK: call void @__cxx_global_var_init()
// CHECK: ret void
diff --git a/test/CodeGenCXX/delayed-template-parsing.cpp b/test/CodeGenCXX/delayed-template-parsing.cpp
new file mode 100644
index 000000000000..fa177d456255
--- /dev/null
+++ b/test/CodeGenCXX/delayed-template-parsing.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -fdelayed-template-parsing -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -fdelayed-template-parsing -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
+
+namespace ClassScopeSpecialization {
+ struct Type {
+ template <int i>
+ void Foo() {}
+ template <>
+ void Foo<0>() {}
+ };
+
+ void call() {
+ Type T;
+// CHECK: call {{.*}} @"\01??$Foo@$0A@@Type@ClassScopeSpecialization@@QAEXXZ"
+// X64: call {{.*}} @"\01??$Foo@$0A@@Type@ClassScopeSpecialization@@QEAAXXZ"
+ T.Foo<0>();
+ }
+}
diff --git a/test/CodeGenCXX/delete-two-arg.cpp b/test/CodeGenCXX/delete-two-arg.cpp
index b82e9ba63ddc..f8e6bff29580 100644
--- a/test/CodeGenCXX/delete-two-arg.cpp
+++ b/test/CodeGenCXX/delete-two-arg.cpp
@@ -1,11 +1,11 @@
-// RUN: %clang_cc1 -triple i686-pc-linux-gnu %s -o - -emit-llvm -verify | FileCheck %s
+// RUN: not %clang_cc1 -triple i686-pc-linux-gnu %s -o - -emit-llvm -verify | FileCheck %s
typedef __typeof(sizeof(int)) size_t;
namespace test1 {
struct A { void operator delete(void*,size_t); int x; };
- // CHECK: define void @_ZN5test11aEPNS_1AE(
+ // CHECK-LABEL: define void @_ZN5test11aEPNS_1AE(
void a(A *x) {
// CHECK: load
// CHECK-NEXT: icmp eq {{.*}}, null
@@ -35,7 +35,7 @@ namespace test2 {
return ::new A[10];
}
- // CHECK: define void @_ZN5test24testEPNS_1AE(
+ // CHECK-LABEL: define void @_ZN5test24testEPNS_1AE(
void test(A *p) {
// CHECK: [[P:%.*]] = alloca [[A]]*, align 4
// CHECK-NEXT: store [[A]]* {{%.*}}, [[A]]** [[P]], align 4
@@ -60,7 +60,7 @@ namespace test3 {
};
struct B : A {};
- // CHECK: define void @_ZN5test34testEv()
+ // CHECK-LABEL: define void @_ZN5test34testEv()
void test() {
// CHECK: call noalias i8* @_Znaj(i32 24)
// CHECK-NEXT: bitcast
diff --git a/test/CodeGenCXX/delete.cpp b/test/CodeGenCXX/delete.cpp
index 1299b29a03a8..cdd5a89963e4 100644
--- a/test/CodeGenCXX/delete.cpp
+++ b/test/CodeGenCXX/delete.cpp
@@ -19,7 +19,7 @@ struct T {
int a;
};
-// CHECK: define void @_Z2t4P1T
+// CHECK-LABEL: define void @_Z2t4P1T
void t4(T *t) {
// CHECK: call void @_ZN1TD1Ev
// CHECK-NEXT: bitcast
@@ -46,7 +46,7 @@ namespace test0 {
~A() {}
};
- // CHECK: define void @_ZN5test04testEPNS_1AE(
+ // CHECK-LABEL: define void @_ZN5test04testEPNS_1AE(
void test(A *a) {
// CHECK: call void @_ZN5test01AD1Ev
// CHECK-NEXT: bitcast
@@ -54,8 +54,8 @@ namespace test0 {
delete a;
}
- // CHECK: define linkonce_odr void @_ZN5test01AD1Ev(%"struct.test0::A"* %this) unnamed_addr
- // CHECK: define linkonce_odr void @_ZN5test01AdlEPv
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test01AD1Ev(%"struct.test0::A"* %this) unnamed_addr
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test01AdlEPv
}
namespace test1 {
@@ -64,7 +64,7 @@ namespace test1 {
~A();
};
- // CHECK: define void @_ZN5test14testEPA10_A20_NS_1AE(
+ // CHECK-LABEL: define void @_ZN5test14testEPA10_A20_NS_1AE(
void test(A (*arr)[10][20]) {
delete [] arr;
// CHECK: icmp eq [10 x [20 x [[A:%.*]]]]* [[PTR:%.*]], null
@@ -88,7 +88,7 @@ namespace test1 {
}
namespace test2 {
- // CHECK: define void @_ZN5test21fEPb
+ // CHECK-LABEL: define void @_ZN5test21fEPb
void f(bool *b) {
// CHECK: call void @_ZdlPv(i8*
delete b;
@@ -111,7 +111,7 @@ namespace test4 {
void operator delete (void *);
};
- // CHECK: define void @_ZN5test421global_delete_virtualEPNS_1XE
+ // CHECK-LABEL: define void @_ZN5test421global_delete_virtualEPNS_1XE
void global_delete_virtual(X *xp) {
// Load the offset-to-top from the vtable and apply it.
// This has to be done first because the dtor can mess it up.
@@ -136,7 +136,7 @@ namespace test4 {
namespace test5 {
struct Incomplete;
- // CHECK: define void @_ZN5test523array_delete_incompleteEPNS_10IncompleteES1_
+ // CHECK-LABEL: define void @_ZN5test523array_delete_incompleteEPNS_10IncompleteES1_
void array_delete_incomplete(Incomplete *p1, Incomplete *p2) {
// CHECK: call void @_ZdlPv
delete p1;
@@ -145,4 +145,4 @@ namespace test5 {
}
}
-// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
+// CHECK: attributes [[NUW]] = {{[{].*}} nounwind {{.*[}]}}
diff --git a/test/CodeGenCXX/derived-to-base-conv.cpp b/test/CodeGenCXX/derived-to-base-conv.cpp
index 9b15c6804dfc..675c50c42328 100644
--- a/test/CodeGenCXX/derived-to-base-conv.cpp
+++ b/test/CodeGenCXX/derived-to-base-conv.cpp
@@ -31,7 +31,7 @@ struct X {
void test0_helper(A);
void test0(X x) {
test0_helper(x);
- // CHECK: define void @_Z5test01X(
+ // CHECK-LABEL: define void @_Z5test01X(
// CHECK: [[TMP:%.*]] = alloca [[A:%.*]], align
// CHECK-NEXT: [[T0:%.*]] = call [[B:%.*]]* @_ZN1XcvR1BEv(
// CHECK-NEXT: [[T1:%.*]] = bitcast [[B]]* [[T0]] to [[A]]*
@@ -60,7 +60,7 @@ struct Derived : Base {
void test1_helper(Base);
void test1(Derived bb) {
- // CHECK: define void @_Z5test17Derived(
+ // CHECK-LABEL: define void @_Z5test17Derived(
// CHECK-NOT: call {{.*}} @_ZN4BasecvR7DerivedEv(
// CHECK: call void @_ZN4BaseC1ERKS_(
// CHECK-NOT: call {{.*}} @_ZN4BasecvR7DerivedEv(
@@ -75,7 +75,7 @@ class Test2a {};
class Test2b final : public virtual Test2a {};
void test2(Test2b &x) {
Test2a &y = x;
- // CHECK: define void @_Z5test2R6Test2b(
+ // CHECK-LABEL: define void @_Z5test2R6Test2b(
// CHECK: [[X:%.*]] = alloca [[B:%.*]]*, align 8
// CHECK-NEXT: [[Y:%.*]] = alloca [[A:%.*]]*, align 8
// CHECK-NEXT: store [[B]]* {{%.*}}, [[B]]** [[X]], align 8
diff --git a/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp b/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp
index 0e153022439b..f2ecfc1d38cc 100644
--- a/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp
+++ b/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp
@@ -9,7 +9,7 @@ struct D final : virtual C {
virtual void f();
};
-// CHECK: define %struct.B* @_Z1fR1D
+// CHECK-LABEL: define %struct.B* @_Z1fR1D
B &f(D &d) {
// CHECK-NOT: load i8**
return d;
diff --git a/test/CodeGenCXX/destructor-exception-spec.cpp b/test/CodeGenCXX/destructor-exception-spec.cpp
index 579daef8541f..e111ba0ba8e5 100644
--- a/test/CodeGenCXX/destructor-exception-spec.cpp
+++ b/test/CodeGenCXX/destructor-exception-spec.cpp
@@ -1,4 +1,6 @@
// RUN: %clang_cc1 -emit-llvm-only %s -std=c++11
+// RUN: %clang_cc1 -emit-llvm-only -fno-use-cxa-atexit %s -std=c++11
+// RUN: %clang_cc1 -cxx-abi microsoft -fno-rtti -emit-llvm-only %s -std=c++11
// PR13479: don't crash with -fno-exceptions.
namespace {
diff --git a/test/CodeGenCXX/destructors.cpp b/test/CodeGenCXX/destructors.cpp
index 7dc188ba94b5..799cca28b4a4 100644
--- a/test/CodeGenCXX/destructors.cpp
+++ b/test/CodeGenCXX/destructors.cpp
@@ -1,14 +1,10 @@
-// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -o - -mconstructor-aliases -fcxx-exceptions -fexceptions | FileCheck %s
+// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -o - -mconstructor-aliases -fcxx-exceptions -fexceptions -O1 -disable-llvm-optzns | FileCheck %s
-// CHECK: @_ZN5test01AD1Ev = alias {{.*}} @_ZN5test01AD2Ev
-// CHECK: @_ZN5test11MD2Ev = alias {{.*}} @_ZN5test11AD2Ev
-// CHECK: @_ZN5test11ND2Ev = alias {{.*}} @_ZN5test11AD2Ev
-// CHECK: @_ZN5test11OD2Ev = alias {{.*}} @_ZN5test11AD2Ev
-// CHECK: @_ZN5test11SD2Ev = alias bitcast {{.*}} @_ZN5test11AD2Ev
-
-// CHECK: @_ZN5test312_GLOBAL__N_11DD1Ev = alias internal {{.*}} @_ZN5test312_GLOBAL__N_11DD2Ev
-// CHECK: @_ZN5test312_GLOBAL__N_11DD2Ev = alias internal bitcast {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
-// CHECK: @_ZN5test312_GLOBAL__N_11CD1Ev = alias internal {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
+// CHECK-DAG: @_ZN5test01AD1Ev = alias {{.*}} @_ZN5test01AD2Ev
+// CHECK-DAG: @_ZN5test11MD2Ev = alias {{.*}} @_ZN5test11AD2Ev
+// CHECK-DAG: @_ZN5test11ND2Ev = alias {{.*}} @_ZN5test11AD2Ev
+// CHECK-DAG: @_ZN5test11OD2Ev = alias {{.*}} @_ZN5test11AD2Ev
+// CHECK-DAG: @_ZN5test11SD2Ev = alias bitcast {{.*}} @_ZN5test11AD2Ev
struct A {
int a;
@@ -40,13 +36,13 @@ namespace PR7526 {
struct allocator_derived : allocator { };
- // CHECK: define void @_ZN6PR75269allocatorD2Ev(%"struct.PR7526::allocator"* %this) unnamed_addr
+ // CHECK-LABEL: define void @_ZN6PR75263fooEv()
+ // CHECK: call void {{.*}} @_ZN6PR75269allocatorD2Ev
+
+ // CHECK-LABEL: define void @_ZN6PR75269allocatorD2Ev(%"struct.PR7526::allocator"* %this) unnamed_addr
// CHECK: call void @__cxa_call_unexpected
allocator::~allocator() throw() { foo(); }
- // CHECK: define linkonce_odr void @_ZN6PR752617allocator_derivedD1Ev(%"struct.PR7526::allocator_derived"* %this) unnamed_addr
- // CHECK-NOT: call void @__cxa_call_unexpected
- // CHECK: }
void foo() {
allocator_derived ad;
}
@@ -93,7 +89,7 @@ namespace test0 {
// complete destructor alias tested above
-// CHECK: define void @_ZN5test01AD2Ev(%"struct.test0::A"* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN5test01AD2Ev(%"struct.test0::A"* %this) unnamed_addr
// CHECK: invoke void @_ZN5test06MemberD1Ev
// CHECK: unwind label [[MEM_UNWIND:%[a-zA-Z0-9.]+]]
// CHECK: invoke void @_ZN5test04BaseD2Ev
@@ -106,7 +102,7 @@ namespace test0 {
B::~B() try { } catch (int i) {}
// It will suppress the delegation optimization here, though.
-// CHECK: define void @_ZN5test01BD1Ev(%"struct.test0::B"* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN5test01BD1Ev(%"struct.test0::B"* %this) unnamed_addr
// CHECK: invoke void @_ZN5test06MemberD1Ev
// CHECK: unwind label [[MEM_UNWIND:%[a-zA-Z0-9.]+]]
// CHECK: invoke void @_ZN5test04BaseD2Ev
@@ -114,7 +110,7 @@ namespace test0 {
// CHECK: invoke void @_ZN5test05VBaseD2Ev
// CHECK: unwind label [[VBASE_UNWIND:%[a-zA-Z0-9.]+]]
-// CHECK: define void @_ZN5test01BD2Ev(%"struct.test0::B"* %this, i8** %vtt) unnamed_addr
+// CHECK-LABEL: define void @_ZN5test01BD2Ev(%"struct.test0::B"* %this, i8** %vtt) unnamed_addr
// CHECK: invoke void @_ZN5test06MemberD1Ev
// CHECK: unwind label [[MEM_UNWIND:%[a-zA-Z0-9.]+]]
// CHECK: invoke void @_ZN5test04BaseD2Ev
@@ -142,24 +138,24 @@ namespace test1 {
O::~O() {} // alias tested above
struct P : NonEmpty, A { ~P(); };
- P::~P() {} // CHECK: define void @_ZN5test11PD2Ev(%"struct.test1::P"* %this) unnamed_addr
+ P::~P() {} // CHECK-LABEL: define void @_ZN5test11PD2Ev(%"struct.test1::P"* %this) unnamed_addr
struct Q : A, B { ~Q(); };
- Q::~Q() {} // CHECK: define void @_ZN5test11QD2Ev(%"struct.test1::Q"* %this) unnamed_addr
+ Q::~Q() {} // CHECK-LABEL: define void @_ZN5test11QD2Ev(%"struct.test1::Q"* %this) unnamed_addr
struct R : A { ~R(); };
- R::~R() { A a; } // CHECK: define void @_ZN5test11RD2Ev(%"struct.test1::R"* %this) unnamed_addr
+ R::~R() { A a; } // CHECK-LABEL: define void @_ZN5test11RD2Ev(%"struct.test1::R"* %this) unnamed_addr
struct S : A { ~S(); int x; };
S::~S() {} // alias tested above
struct T : A { ~T(); B x; };
- T::~T() {} // CHECK: define void @_ZN5test11TD2Ev(%"struct.test1::T"* %this) unnamed_addr
+ T::~T() {} // CHECK-LABEL: define void @_ZN5test11TD2Ev(%"struct.test1::T"* %this) unnamed_addr
// The VTT parameter prevents this. We could still make this work
// for calling conventions that are safe against extra parameters.
struct U : A, virtual B { ~U(); };
- U::~U() {} // CHECK: define void @_ZN5test11UD2Ev(%"struct.test1::U"* %this, i8** %vtt) unnamed_addr
+ U::~U() {} // CHECK-LABEL: define void @_ZN5test11UD2Ev(%"struct.test1::U"* %this, i8** %vtt) unnamed_addr
}
// PR6471
@@ -168,7 +164,7 @@ namespace test2 {
struct B : A { ~B(); };
B::~B() {}
- // CHECK: define void @_ZN5test21BD2Ev(%"struct.test2::B"* %this) unnamed_addr
+ // CHECK-LABEL: define void @_ZN5test21BD2Ev(%"struct.test2::B"* %this) unnamed_addr
// CHECK: call void @_ZN5test21AD2Ev
}
@@ -184,18 +180,12 @@ namespace test3 {
void test() {
new D; // Force emission of D's vtable
}
-
- // Checked at top of file:
- // @_ZN5test312_GLOBAL__N_11CD1Ev = alias internal {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
-
- // More checks at end of file.
-
}
namespace test4 {
struct A { ~A(); };
- // CHECK: define void @_ZN5test43fooEv()
+ // CHECK-LABEL: define void @_ZN5test43fooEv()
// CHECK: call void @_ZN5test41AD1Ev
// CHECK: ret void
void foo() {
@@ -208,7 +198,7 @@ namespace test4 {
return;
}
- // CHECK: define void @_ZN5test43barEi(
+ // CHECK-LABEL: define void @_ZN5test43barEi(
// CHECK: [[X:%.*]] = alloca i32
// CHECK-NEXT: [[A:%.*]] = alloca
// CHECK: br label
@@ -233,7 +223,7 @@ namespace test4 {
namespace test5 {
struct A { ~A(); };
- // CHECK: define void @_ZN5test53fooEv()
+ // CHECK-LABEL: define void @_ZN5test53fooEv()
// CHECK: [[ELEMS:%.*]] = alloca [5 x [[A:%.*]]], align
// CHECK-NEXT: [[EXN:%.*]] = alloca i8*
// CHECK-NEXT: [[SEL:%.*]] = alloca i32
@@ -272,7 +262,7 @@ namespace test6 {
};
C::C() { opaque(); }
- // CHECK: define void @_ZN5test61CC1Ev(%"struct.test6::C"* %this) unnamed_addr
+ // CHECK-LABEL: define void @_ZN5test61CC1Ev(%"struct.test6::C"* %this) unnamed_addr
// CHECK: call void @_ZN5test61BILj2EEC2Ev
// CHECK: invoke void @_ZN5test61BILj3EEC2Ev
// CHECK: invoke void @_ZN5test61BILj0EEC2Ev
@@ -282,7 +272,7 @@ namespace test6 {
// FIXME: way too much EH cleanup code follows
C::~C() { opaque(); }
- // CHECK: define void @_ZN5test61CD1Ev(%"struct.test6::C"* %this) unnamed_addr
+ // CHECK-LABEL: define void @_ZN5test61CD1Ev(%"struct.test6::C"* %this) unnamed_addr
// CHECK: invoke void @_ZN5test61CD2Ev
// CHECK: invoke void @_ZN5test61BILj3EED2Ev
// CHECK: call void @_ZN5test61BILj2EED2Ev
@@ -290,7 +280,7 @@ namespace test6 {
// CHECK: invoke void @_ZN5test61BILj3EED2Ev
// CHECK: invoke void @_ZN5test61BILj2EED2Ev
- // CHECK: define void @_ZN5test61CD2Ev(%"struct.test6::C"* %this, i8** %vtt) unnamed_addr
+ // CHECK-LABEL: define void @_ZN5test61CD2Ev(%"struct.test6::C"* %this, i8** %vtt) unnamed_addr
// CHECK: invoke void @_ZN5test66opaqueEv
// CHECK: invoke void @_ZN5test61AD1Ev
// CHECK: invoke void @_ZN5test61AD1Ev
@@ -318,7 +308,7 @@ namespace test7 {
};
// Verify that this doesn't get emitted as an alias
- // CHECK: define void @_ZN5test71BD2Ev(
+ // CHECK-LABEL: define void @_ZN5test71BD2Ev(
// CHECK: invoke void @_ZN5test71DD1Ev(
// CHECK: call void @_ZN5test71AD2Ev(
B::~B() {}
@@ -338,7 +328,7 @@ namespace test8 {
l: die();
}
- // CHECK: define void @_ZN5test84testEv()
+ // CHECK-LABEL: define void @_ZN5test84testEv()
// CHECK: [[X:%.*]] = alloca [[A:%.*]], align 1
// CHECK-NEXT: [[Y:%.*]] = alloca [[A:%.*]], align 1
// CHECK: call void @_ZN5test81AC1Ev([[A]]* [[X]])
@@ -366,10 +356,26 @@ namespace test9 {
// CHECK: call void @_ZN5test92f2Ev()
}
+namespace test10 {
+ // We used to crash trying to replace _ZN6test106OptionD1Ev with
+ // _ZN6test106OptionD2Ev twice.
+ struct Option {
+ virtual ~Option() {}
+ };
+ template <class DataType> class opt : public Option {};
+ template class opt<int>;
+ // CHECK-LABEL: define zeroext i1 @_ZN6test1016handleOccurrenceEv(
+ bool handleOccurrence() {
+ // CHECK: call void @_ZN6test106OptionD2Ev(
+ Option x;
+ return true;
+ }
+}
+
// Checks from test3:
- // CHECK: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::<anonymous namespace>::D"* %this) unnamed_addr
- // CHECK: invoke void @_ZN5test312_GLOBAL__N_11DD1Ev(
+ // CHECK-LABEL: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::<anonymous namespace>::D"* %this) unnamed_addr
+ // CHECK: invoke void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
// CHECK: call void @_ZdlPv({{.*}}) [[NUW:#[0-9]+]]
// CHECK: ret void
// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
@@ -377,21 +383,22 @@ namespace test9 {
// CHECK: call void @_ZdlPv({{.*}}) [[NUW]]
// CHECK: resume { i8*, i32 }
- // Checked at top of file:
- // @_ZN5test312_GLOBAL__N_11DD1Ev = alias internal {{.*}} @_ZN5test312_GLOBAL__N_11DD2Ev
- // @_ZN5test312_GLOBAL__N_11DD2Ev = alias internal bitcast {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
-
- // CHECK: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD1Ev(
+ // CHECK-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD1Ev(
// CHECK: getelementptr inbounds i8* {{.*}}, i64 -8
- // CHECK: call void @_ZN5test312_GLOBAL__N_11DD1Ev(
+ // CHECK: call void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
// CHECK: ret void
- // CHECK: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD0Ev(
+ // CHECK-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD0Ev(
// CHECK: getelementptr inbounds i8* {{.*}}, i64 -8
// CHECK: call void @_ZN5test312_GLOBAL__N_11DD0Ev(
// CHECK: ret void
- // CHECK: define internal void @_ZN5test312_GLOBAL__N_11CD2Ev(%"struct.test3::<anonymous namespace>::C"* %this) unnamed_addr
+ // CHECK-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD1Ev(
+ // CHECK: getelementptr inbounds i8* {{.*}}, i64 -8
+ // CHECK: call void @_ZN5test312_GLOBAL__N_11CD2Ev(
+ // CHECK: ret void
+
+ // CHECK-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD2Ev(%"struct.test3::<anonymous namespace>::C"* %this) unnamed_addr
// CHECK: invoke void @_ZN5test31BD2Ev(
// CHECK: call void @_ZN5test31AD2Ev(
// CHECK: ret void
@@ -399,8 +406,8 @@ namespace test9 {
// CHECK: declare void @_ZN5test31BD2Ev(
// CHECK: declare void @_ZN5test31AD2Ev(
- // CHECK: define internal void @_ZN5test312_GLOBAL__N_11CD0Ev(%"struct.test3::<anonymous namespace>::C"* %this) unnamed_addr
- // CHECK: invoke void @_ZN5test312_GLOBAL__N_11CD1Ev(
+ // CHECK-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD0Ev(%"struct.test3::<anonymous namespace>::C"* %this) unnamed_addr
+ // CHECK: invoke void @_ZN5test312_GLOBAL__N_11CD2Ev(
// CHECK: call void @_ZdlPv({{.*}}) [[NUW]]
// CHECK: ret void
// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
@@ -408,14 +415,9 @@ namespace test9 {
// CHECK: call void @_ZdlPv({{.*}}) [[NUW]]
// CHECK: resume { i8*, i32 }
- // CHECK: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD1Ev(
- // CHECK: getelementptr inbounds i8* {{.*}}, i64 -8
- // CHECK: call void @_ZN5test312_GLOBAL__N_11CD1Ev(
- // CHECK: ret void
-
- // CHECK: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD0Ev(
+ // CHECK-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD0Ev(
// CHECK: getelementptr inbounds i8* {{.*}}, i64 -8
// CHECK: call void @_ZN5test312_GLOBAL__N_11CD0Ev(
// CHECK: ret void
- // CHECK: attributes [[NUW]] = { nounwind{{.*}} }
+ // CHECK: attributes [[NUW]] = {{[{].*}} nounwind {{.*[}]}}
diff --git a/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp b/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
index 40f3cada7d46..11026e8df3e7 100644
--- a/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
+++ b/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
@@ -5,7 +5,7 @@ namespace Test1 {
virtual int f() final;
};
- // CHECK: define i32 @_ZN5Test11fEPNS_1AE
+ // CHECK-LABEL: define i32 @_ZN5Test11fEPNS_1AE
int f(A *a) {
// CHECK: call i32 @_ZN5Test11A1fEv
return a->f();
@@ -17,7 +17,7 @@ namespace Test2 {
virtual int f();
};
- // CHECK: define i32 @_ZN5Test21fEPNS_1AE
+ // CHECK-LABEL: define i32 @_ZN5Test21fEPNS_1AE
int f(A *a) {
// CHECK: call i32 @_ZN5Test21A1fEv
return a->f();
@@ -31,19 +31,19 @@ namespace Test3 {
struct B final : A { };
- // CHECK: define i32 @_ZN5Test31fEPNS_1BE
+ // CHECK-LABEL: define i32 @_ZN5Test31fEPNS_1BE
int f(B *b) {
// CHECK: call i32 @_ZN5Test31A1fEv
return b->f();
}
- // CHECK: define i32 @_ZN5Test31fERNS_1BE
+ // CHECK-LABEL: define i32 @_ZN5Test31fERNS_1BE
int f(B &b) {
// CHECK: call i32 @_ZN5Test31A1fEv
return b.f();
}
- // CHECK: define i32 @_ZN5Test31fEPv
+ // CHECK-LABEL: define i32 @_ZN5Test31fEPv
int f(void *v) {
// CHECK: call i32 @_ZN5Test31A1fEv
return static_cast<B*>(v)->f();
@@ -59,7 +59,7 @@ namespace Test4 {
virtual void f();
};
- // CHECK: define void @_ZN5Test41fEPNS_1BE
+ // CHECK-LABEL: define void @_ZN5Test41fEPNS_1BE
void f(B* d) {
// CHECK: call void @_ZN5Test41B1fEv
static_cast<A*>(d)->f();
@@ -78,7 +78,7 @@ namespace Test5 {
struct C final : B {
};
- // CHECK: define void @_ZN5Test51fEPNS_1CE
+ // CHECK-LABEL: define void @_ZN5Test51fEPNS_1CE
void f(C* d) {
// FIXME: It should be possible to devirtualize this case, but that is
// not implemented yet.
@@ -105,7 +105,7 @@ namespace Test6 {
struct D final : public C, public B {
};
- // CHECK: define void @_ZN5Test61fEPNS_1DE
+ // CHECK-LABEL: define void @_ZN5Test61fEPNS_1DE
void f(D* d) {
// CHECK: call void @_ZN5Test61DD1Ev
static_cast<A*>(d)->~A();
@@ -126,7 +126,7 @@ namespace Test7 {
virtual int f() {return z;}
};
- // CHECK: define i32 @_ZN5Test71fEPNS_3zedE
+ // CHECK-LABEL: define i32 @_ZN5Test71fEPNS_3zedE
int f(zed *z) {
// CHECK: alloca
// CHECK-NEXT: store
@@ -144,7 +144,7 @@ namespace Test8 {
virtual int foo() { return b; }
};
struct C final : A, B { };
- // CHECK: define i32 @_ZN5Test84testEPNS_1CE
+ // CHECK-LABEL: define i32 @_ZN5Test84testEPNS_1CE
int test(C *c) {
// CHECK: %[[THIS:.*]] = phi
// CHECK-NEXT: call i32 @_ZN5Test81B3fooEv(%"struct.Test8::B"* %[[THIS]])
diff --git a/test/CodeGenCXX/devirtualize-virtual-function-calls.cpp b/test/CodeGenCXX/devirtualize-virtual-function-calls.cpp
index 52f1cd3fa236..911ddeedd236 100644
--- a/test/CodeGenCXX/devirtualize-virtual-function-calls.cpp
+++ b/test/CodeGenCXX/devirtualize-virtual-function-calls.cpp
@@ -79,7 +79,7 @@ namespace test3 {
struct D : public B {
};
void f(D d) {
- // CHECK: define void @_ZN5test31fENS_1DE
+ // CHECK-LABEL: define void @_ZN5test31fENS_1DE
d.B::~B();
}
}
diff --git a/test/CodeGenCXX/dynamic_cast-no-rtti.cpp b/test/CodeGenCXX/dynamic_cast-no-rtti.cpp
new file mode 100644
index 000000000000..0e26de5bcf8b
--- /dev/null
+++ b/test/CodeGenCXX/dynamic_cast-no-rtti.cpp
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -emit-llvm %s -verify -fno-rtti -o - | FileCheck %s
+// expected-no-diagnostics
+
+struct A {
+ virtual ~A(){};
+};
+
+struct B : public A {
+ B() : A() {}
+};
+
+// An upcast can be resolved statically and can be used with -fno-rtti, iff it
+// does not use runtime support.
+A *upcast(B *b) {
+ return dynamic_cast<A *>(b);
+// CHECK-LABEL: define %struct.A* @_Z6upcastP1B
+// CHECK-NOT: call i8* @__dynamic_cast
+}
+
+// A NoOp dynamic_cast can be used with -fno-rtti iff it does not use
+// runtime support.
+B *samecast(B *b) {
+ return dynamic_cast<B *>(b);
+// CHECK-LABEL: define %struct.B* @_Z8samecastP1B
+// CHECK-NOT: call i8* @__dynamic_cast
+}
diff --git a/test/CodeGenCXX/eh.cpp b/test/CodeGenCXX/eh.cpp
index 70887f7718d0..2a61e61bb818 100644
--- a/test/CodeGenCXX/eh.cpp
+++ b/test/CodeGenCXX/eh.cpp
@@ -9,7 +9,7 @@ void test1() {
throw d1;
}
-// CHECK: define void @_Z5test1v()
+// CHECK-LABEL: define void @_Z5test1v()
// CHECK: [[EXNOBJ:%.*]] = call i8* @__cxa_allocate_exception(i64 8)
// CHECK-NEXT: [[EXN:%.*]] = bitcast i8* [[EXNOBJ]] to [[DSTAR:%[^*]*\*]]
// CHECK-NEXT: [[EXN2:%.*]] = bitcast [[DSTAR]] [[EXN]] to i8*
@@ -29,7 +29,7 @@ void test2() {
throw d2;
}
-// CHECK: define void @_Z5test2v()
+// CHECK-LABEL: define void @_Z5test2v()
// CHECK: [[EXNVAR:%.*]] = alloca i8*
// CHECK-NEXT: [[SELECTORVAR:%.*]] = alloca i32
// CHECK-NEXT: [[EXNOBJ:%.*]] = call i8* @__cxa_allocate_exception(i64 16)
@@ -51,7 +51,7 @@ void test3() {
throw (volatile test3_D *)0;
}
-// CHECK: define void @_Z5test3v()
+// CHECK-LABEL: define void @_Z5test3v()
// CHECK: [[EXNOBJ:%.*]] = call i8* @__cxa_allocate_exception(i64 8)
// CHECK-NEXT: [[EXN:%.*]] = bitcast i8* [[EXNOBJ]] to [[D:%[^*]+]]**
// CHECK-NEXT: store [[D]]* null, [[D]]** [[EXN]]
@@ -63,7 +63,7 @@ void test4() {
throw;
}
-// CHECK: define void @_Z5test4v()
+// CHECK-LABEL: define void @_Z5test4v()
// CHECK: call void @__cxa_rethrow() [[NR]]
// CHECK-NEXT: unreachable
@@ -79,7 +79,7 @@ namespace test5 {
void test() {
try { throw A(); } catch (A &x) {}
}
-// CHECK: define void @_ZN5test54testEv()
+// CHECK-LABEL: define void @_ZN5test54testEv()
// CHECK: [[EXNOBJ:%.*]] = call i8* @__cxa_allocate_exception(i64 1)
// CHECK: [[EXNCAST:%.*]] = bitcast i8* [[EXNOBJ]] to [[A:%[^*]*]]*
// CHECK-NEXT: invoke void @_ZN5test51AC1Ev([[A]]* [[EXNCAST]])
@@ -101,7 +101,7 @@ namespace test6 {
// PR7127
namespace test7 {
-// CHECK: define i32 @_ZN5test73fooEv()
+// CHECK-LABEL: define i32 @_ZN5test73fooEv()
int foo() {
// CHECK: [[CAUGHTEXNVAR:%.*]] = alloca i8*
// CHECK-NEXT: [[SELECTORVAR:%.*]] = alloca i32
@@ -160,7 +160,7 @@ namespace test8 {
struct A { A(const A&); ~A(); };
void bar();
- // CHECK: define void @_ZN5test83fooEv()
+ // CHECK-LABEL: define void @_ZN5test83fooEv()
void foo() {
try {
// CHECK: invoke void @_ZN5test83barEv()
@@ -184,11 +184,11 @@ namespace test9 {
struct A { A(); };
- // CHECK: define void @_ZN5test91AC1Ev(%"struct.test9::A"* %this) unnamed_addr
+ // CHECK-LABEL: define void @_ZN5test91AC1Ev(%"struct.test9::A"* %this) unnamed_addr
// CHECK: call void @_ZN5test91AC2Ev
// CHECK-NEXT: ret void
- // CHECK: define void @_ZN5test91AC2Ev(%"struct.test9::A"* %this) unnamed_addr
+ // CHECK-LABEL: define void @_ZN5test91AC2Ev(%"struct.test9::A"* %this) unnamed_addr
A::A() try {
// CHECK: invoke void @_ZN5test96opaqueEv()
opaque();
@@ -210,7 +210,7 @@ namespace test10 {
struct A { ~A(); };
struct B { int x; };
- // CHECK: define void @_ZN6test103fooEv()
+ // CHECK-LABEL: define void @_ZN6test103fooEv()
void foo() {
A a; // force a cleanup context
@@ -244,7 +244,7 @@ namespace test10 {
namespace test11 {
void opaque();
- // CHECK: define void @_ZN6test113fooEv()
+ // CHECK-LABEL: define void @_ZN6test113fooEv()
void foo() {
try {
// CHECK: invoke void @_ZN6test116opaqueEv()
@@ -261,7 +261,7 @@ namespace test11 {
struct A {};
- // CHECK: define void @_ZN6test113barEv()
+ // CHECK-LABEL: define void @_ZN6test113barEv()
void bar() {
try {
// CHECK: [[EXNSLOT:%.*]] = alloca i8*
@@ -286,7 +286,7 @@ namespace test12 {
struct A { ~A() noexcept(false); };
bool opaque(const A&);
- // CHECK: define void @_ZN6test124testEv()
+ // CHECK-LABEL: define void @_ZN6test124testEv()
void test() {
// CHECK: [[X:%.*]] = alloca [[A:%.*]],
// CHECK: [[EHCLEANUPDEST:%.*]] = alloca i32
@@ -371,7 +371,7 @@ namespace test15 {
bool opaque(int);
- // CHECK: define void @_ZN6test153fooEv()
+ // CHECK-LABEL: define void @_ZN6test153fooEv()
void foo() {
A a;
@@ -405,7 +405,7 @@ namespace test16 {
void foo();
bool cond();
- // CHECK: define void @_ZN6test163barEv()
+ // CHECK-LABEL: define void @_ZN6test163barEv()
void bar() {
// CHECK: [[EXN_SAVE:%.*]] = alloca i8*
// CHECK-NEXT: [[EXN_ACTIVE:%.*]] = alloca i1
diff --git a/test/CodeGenCXX/empty-classes.cpp b/test/CodeGenCXX/empty-classes.cpp
index 1ce1dad40ffa..8491480bcf54 100644
--- a/test/CodeGenCXX/empty-classes.cpp
+++ b/test/CodeGenCXX/empty-classes.cpp
@@ -29,7 +29,7 @@ struct D : A, Empty {
#define CHECK(x) if (!(x)) return __LINE__
// PR7012
-// CHECK: define i32 @_Z1fv()
+// CHECK-LABEL: define i32 @_Z1fv()
int f() {
B b1;
diff --git a/test/CodeGenCXX/empty-nontrivially-copyable.cpp b/test/CodeGenCXX/empty-nontrivially-copyable.cpp
new file mode 100644
index 000000000000..9ee3281505ec
--- /dev/null
+++ b/test/CodeGenCXX/empty-nontrivially-copyable.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -triple armv7-apple-ios -x c++ -emit-llvm -o - %s | FileCheck %s
+
+// According to the Itanium ABI (3.1.1), types with non-trivial copy
+// constructors passed by value should be passed indirectly, with the caller
+// creating a temporary.
+
+struct Empty;
+
+struct Empty {
+ Empty(const Empty &e);
+ bool check();
+};
+
+bool foo(Empty e) {
+// CHECK: @_Z3foo5Empty(%struct.Empty* %e)
+// CHECK: call {{.*}} @_ZN5Empty5checkEv(%struct.Empty* %e)
+ return e.check();
+}
+
+void caller(Empty &e) {
+// CHECK: @_Z6callerR5Empty(%struct.Empty* %e)
+// CHECK: call {{.*}} @_ZN5EmptyC1ERKS_(%struct.Empty* [[NEWTMP:%.*]], %struct.Empty*
+// CHECK: call {{.*}} @_Z3foo5Empty(%struct.Empty* [[NEWTMP]])
+ foo(e);
+}
diff --git a/test/CodeGenCXX/exceptions.cpp b/test/CodeGenCXX/exceptions.cpp
index f6f5079791ab..d37e6109db4a 100644
--- a/test/CodeGenCXX/exceptions.cpp
+++ b/test/CodeGenCXX/exceptions.cpp
@@ -269,7 +269,7 @@ namespace test5 {
void foo();
- // CHECK: define void @_ZN5test54testEv()
+ // CHECK-LABEL: define void @_ZN5test54testEv()
// CHECK: [[EXNSLOT:%.*]] = alloca i8*
// CHECK-NEXT: [[SELECTORSLOT:%.*]] = alloca i32
// CHECK-NEXT: [[A:%.*]] = alloca [[A_T:%.*]], align 1
@@ -403,7 +403,7 @@ namespace test8 {
void test() {
throw makeA();
}
- // CHECK: define void @_ZN5test84testEv
+ // CHECK-LABEL: define void @_ZN5test84testEv
}
// Make sure we generate the correct code for the delete[] call which
@@ -432,14 +432,14 @@ namespace test10 {
struct A { ~A(); };
A::~A() try { cleanup(); } catch (...) { return; }
- // CHECK: define void @_ZN6test101AD1Ev(
+ // CHECK-LABEL: define void @_ZN6test101AD1Ev(
// CHECK: invoke void @_ZN6test107cleanupEv()
// CHECK-NOT: rethrow
// CHECK: ret void
struct B { ~B(); };
B::~B() try { cleanup(); } catch (...) {}
- // CHECK: define void @_ZN6test101BD1Ev(
+ // CHECK-LABEL: define void @_ZN6test101BD1Ev(
// CHECK: invoke void @_ZN6test107cleanupEv()
// CHECK: call i8* @__cxa_begin_catch
// CHECK-NEXT: invoke void @__cxa_rethrow()
@@ -447,7 +447,7 @@ namespace test10 {
struct C { ~C(); };
C::~C() try { cleanup(); } catch (...) { if (suppress) return; }
- // CHECK: define void @_ZN6test101CD1Ev(
+ // CHECK-LABEL: define void @_ZN6test101CD1Ev(
// CHECK: invoke void @_ZN6test107cleanupEv()
// CHECK: call i8* @__cxa_begin_catch
// CHECK-NEXT: load i8* @_ZN6test108suppressE, align 1
@@ -477,7 +477,7 @@ namespace test11 {
C::C() {
throw 0;
}
- // CHECK: define void @_ZN6test111CC2Ev(
+ // CHECK-LABEL: define void @_ZN6test111CC2Ev(
// CHECK: [[THIS:%.*]] = load [[C:%.*]]** {{%.*}}
// Construct single.
// CHECK-NEXT: [[SINGLE:%.*]] = getelementptr inbounds [[C]]* [[THIS]], i32 0, i32 0
diff --git a/test/CodeGenCXX/explicit-instantiation.cpp b/test/CodeGenCXX/explicit-instantiation.cpp
index 8daf3c680006..6a4fd822122f 100644
--- a/test/CodeGenCXX/explicit-instantiation.cpp
+++ b/test/CodeGenCXX/explicit-instantiation.cpp
@@ -13,7 +13,7 @@ Result plus<T, U, Result>::operator()(const T& t, const U& u) const {
return t + u;
}
-// CHECK: define weak_odr i32 @_ZNK4plusIillEclERKiRKl
+// CHECK-LABEL: define weak_odr i32 @_ZNK4plusIillEclERKiRKl
template struct plus<int, long, long>;
// Check that we emit definitions from explicit instantiations even when they
@@ -27,16 +27,16 @@ template <typename T> struct S {
};
};
-// CHECK: define weak_odr void @_ZN1SIiE1fEv
+// CHECK-LABEL: define weak_odr void @_ZN1SIiE1fEv
template void S<int>::f();
-// CHECK: define weak_odr void @_ZN1SIiE1gEv
+// CHECK-LABEL: define weak_odr void @_ZN1SIiE1gEv
template void S<int>::g();
// See the check line at the top of the file.
template int S<int>::i;
-// CHECK: define weak_odr void @_ZN1SIiE2S21hEv
+// CHECK-LABEL: define weak_odr void @_ZN1SIiE2S21hEv
template void S<int>::S2::h();
template <typename T> void S<T>::f() {}
diff --git a/test/CodeGenCXX/fastcall.cpp b/test/CodeGenCXX/fastcall.cpp
index c0a910667274..0326ce53bc4a 100644
--- a/test/CodeGenCXX/fastcall.cpp
+++ b/test/CodeGenCXX/fastcall.cpp
@@ -2,7 +2,7 @@
void __attribute__((fastcall)) foo1(int &y);
void bar1(int &y) {
- // CHECK: define void @_Z4bar1Ri
+ // CHECK-LABEL: define void @_Z4bar1Ri
// CHECK: call x86_fastcallcc void @_Z4foo1Ri(i32* inreg %
foo1(y);
}
@@ -14,7 +14,7 @@ struct S1 {
void __attribute__((fastcall)) foo2(S1 a, int b);
void bar2(S1 a, int b) {
- // CHECK: define void @_Z4bar22S1i
+ // CHECK-LABEL: define void @_Z4bar22S1i
// CHECK: call x86_fastcallcc void @_Z4foo22S1i(%struct.S1* inreg %{{.*}}, i32 inreg %
foo2(a, b);
}
diff --git a/test/CodeGenCXX/for-range.cpp b/test/CodeGenCXX/for-range.cpp
index 926fe445a5ba..8124129713f0 100644
--- a/test/CodeGenCXX/for-range.cpp
+++ b/test/CodeGenCXX/for-range.cpp
@@ -32,7 +32,7 @@ B *end(C&);
extern B array[5];
-// CHECK: define void @_Z9for_arrayv(
+// CHECK-LABEL: define void @_Z9for_arrayv(
void for_array() {
// CHECK: call void @_ZN1AC1Ev(%struct.A* [[A:.*]])
A a;
@@ -40,7 +40,7 @@ void for_array() {
// CHECK-NOT: 5begin
// CHECK-NOT: 3end
// CHECK: getelementptr {{.*}}, i32 0
- // CHECK: getelementptr {{.*}}, i64 1, i64 0
+ // CHECK: getelementptr {{.*}}, i64 5
// CHECK: br label %[[COND:.*]]
// CHECK: [[COND]]:
@@ -61,7 +61,7 @@ void for_array() {
// CHECK: ret void
}
-// CHECK: define void @_Z9for_rangev(
+// CHECK-LABEL: define void @_Z9for_rangev(
void for_range() {
// CHECK: call void @_ZN1AC1Ev(%struct.A* [[A:.*]])
A a;
@@ -93,7 +93,7 @@ void for_range() {
// CHECK: ret void
}
-// CHECK: define void @_Z16for_member_rangev(
+// CHECK-LABEL: define void @_Z16for_member_rangev(
void for_member_range() {
// CHECK: call void @_ZN1AC1Ev(%struct.A* [[A:.*]])
A a;
diff --git a/test/CodeGenCXX/forward-enum.cpp b/test/CodeGenCXX/forward-enum.cpp
index c1169e013994..685e4f31cc61 100644
--- a/test/CodeGenCXX/forward-enum.cpp
+++ b/test/CodeGenCXX/forward-enum.cpp
@@ -3,7 +3,7 @@
enum MyEnum : char;
void bar(MyEnum value) { }
-// CHECK: define void @_Z3foo6MyEnum
+// CHECK-LABEL: define void @_Z3foo6MyEnum
void foo(MyEnum value)
{
// CHECK: call void @_Z3bar6MyEnum(i8 signext
diff --git a/test/CodeGenCXX/fp16-mangle.cpp b/test/CodeGenCXX/fp16-mangle.cpp
index 4a056d6c6bbb..bd5a3194112c 100644
--- a/test/CodeGenCXX/fp16-mangle.cpp
+++ b/test/CodeGenCXX/fp16-mangle.cpp
@@ -4,9 +4,9 @@
template <typename T, typename U> struct S { static int i; };
template <> int S<__fp16, __fp16>::i = 3;
-// CHECK: define void @_Z1fPDh(i16* %x)
+// CHECK-LABEL: define void @_Z1fPDh(i16* %x)
void f (__fp16 *x) { }
-// CHECK: define void @_Z1gPDhS_(i16* %x, i16* %y)
+// CHECK-LABEL: define void @_Z1gPDhS_(i16* %x, i16* %y)
void g (__fp16 *x, __fp16 *y) { }
diff --git a/test/CodeGenCXX/function-template-explicit-specialization.cpp b/test/CodeGenCXX/function-template-explicit-specialization.cpp
index 21f0127ab489..5d26dcd61cf0 100644
--- a/test/CodeGenCXX/function-template-explicit-specialization.cpp
+++ b/test/CodeGenCXX/function-template-explicit-specialization.cpp
@@ -3,11 +3,11 @@
template<typename T> void a(T);
template<> void a(int) {}
-// CHECK: define void @_Z1aIiEvT_
+// CHECK-LABEL: define void @_Z1aIiEvT_
namespace X {
template<typename T> void b(T);
template<> void b(int) {}
}
-// CHECK: define void @_ZN1X1bIiEEvT_
+// CHECK-LABEL: define void @_ZN1X1bIiEEvT_
diff --git a/test/CodeGenCXX/global-array-destruction.cpp b/test/CodeGenCXX/global-array-destruction.cpp
index 087d655f0a27..6ebc13953f67 100644
--- a/test/CodeGenCXX/global-array-destruction.cpp
+++ b/test/CodeGenCXX/global-array-destruction.cpp
@@ -56,7 +56,7 @@ using U = T[2][3];
U &&u = U{ {{1.0, 2}, {3.0, 4}, {5.0, 6}}, {{7.0, 8}, {9.0, 10}, {11.0, 12}} };
// CHECK: call {{.*}} @__cxa_atexit
-// CHECK: getelementptr inbounds ([2 x [3 x {{.*}}]]* @_ZGR1u, i64 1, i64 0, i64 0)
+// CHECK: getelementptr inbounds ({{.*}}* getelementptr inbounds ([2 x [3 x {{.*}}]]* @_ZGR1u, i32 0, i32 0, i32 0), i64 6)
// CHECK: call void @_ZN1TD1Ev
// CHECK: icmp eq {{.*}} @_ZGR1u
// CHECK: br i1 {{.*}}
diff --git a/test/CodeGenCXX/global-block-literal-helpers.cpp b/test/CodeGenCXX/global-block-literal-helpers.cpp
index 350ea548662c..762b5d9910df 100644
--- a/test/CodeGenCXX/global-block-literal-helpers.cpp
+++ b/test/CodeGenCXX/global-block-literal-helpers.cpp
@@ -5,23 +5,23 @@ namespace N {
typedef void (^BL)();
int func(BL, BL, BL);
-// CHECK: define internal void @_ZN1N8ArrBlockE_block_invoke(
-// CHECK: define internal void @_ZN1N8ArrBlockE_block_invoke_2(
-// CHECK: define internal void @_ZN1N8ArrBlockE_block_invoke_3
+// CHECK-LABEL: define internal void @_ZN1N8ArrBlockE_block_invoke(
+// CHECK-LABEL: define internal void @_ZN1N8ArrBlockE_block_invoke_2(
+// CHECK-LABEL: define internal void @_ZN1N8ArrBlockE_block_invoke_3
BL ArrBlock [] = { ^{}, ^{}, ^{} };
-// CHECK: define internal void @_ZN1N4ivalE_block_invoke_4(
-// CHECK: define internal void @_ZN1N4ivalE_block_invoke_5(
-// CHECK: define internal void @_ZN1N4ivalE_block_invoke_6(
+// CHECK-LABEL: define internal void @_ZN1N4ivalE_block_invoke_4(
+// CHECK-LABEL: define internal void @_ZN1N4ivalE_block_invoke_5(
+// CHECK-LABEL: define internal void @_ZN1N4ivalE_block_invoke_6(
int ival = func(^{}, ^{}, ^{});
-// CHECK: define internal void @_ZN1N9gvarlobalE_block_invoke_7(
+// CHECK-LABEL: define internal void @_ZN1N9gvarlobalE_block_invoke_7(
void (^gvarlobal)(void) = ^{};
struct S {
BL field = ^{};
};
-// CHECK: define internal void @_ZN1N3blfE_block_invoke_8(
+// CHECK-LABEL: define internal void @_ZN1N3blfE_block_invoke_8(
S blf;
};
diff --git a/test/CodeGenCXX/global-dtor-no-atexit.cpp b/test/CodeGenCXX/global-dtor-no-atexit.cpp
index 7c4b6aa1e05f..9d35e848e3ca 100644
--- a/test/CodeGenCXX/global-dtor-no-atexit.cpp
+++ b/test/CodeGenCXX/global-dtor-no-atexit.cpp
@@ -22,7 +22,7 @@ public:
A a, b;
// PR9593
-// CHECK: define void @_Z4funcv()
+// CHECK-LABEL: define void @_Z4funcv()
// CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZ4funcvE2a1)
// CHECK: call void @_ZN1AC1Ev([[A]]* @_ZZ4funcvE2a1)
// CHECK-NEXT: call i32 @atexit(void ()* @__dtor__ZZ4funcvE2a1)
diff --git a/test/CodeGenCXX/global-init.cpp b/test/CodeGenCXX/global-init.cpp
index 426cf9c10e3a..69631c278905 100644
--- a/test/CodeGenCXX/global-init.cpp
+++ b/test/CodeGenCXX/global-init.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm -fexceptions %s -o - |FileCheck %s
-// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm %s -o - |FileCheck -check-prefix NOEXC %s
+// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm %s -o - |FileCheck -check-prefix CHECK-NOEXC %s
struct A {
A();
@@ -45,7 +45,7 @@ namespace test1 {
const int y = x - 1; // This gets deferred.
const int z = ~y; // This also gets deferred, but gets "undeferred" before y.
int test() { return z; }
-// CHECK: define i32 @_ZN5test14testEv()
+// CHECK-LABEL: define i32 @_ZN5test14testEv()
// All of these initializers end up delayed, so we check them later.
}
diff --git a/test/CodeGenCXX/goto.cpp b/test/CodeGenCXX/goto.cpp
index 77b6166aff41..904f95fb22be 100644
--- a/test/CodeGenCXX/goto.cpp
+++ b/test/CodeGenCXX/goto.cpp
@@ -5,7 +5,7 @@ namespace test0 {
struct A { A(); ~A(); };
struct V { V(const A &a = A()); ~V(); };
- // CHECK: define linkonce_odr i32 @_ZN5test04testILi0EEEii
+ // CHECK-LABEL: define linkonce_odr i32 @_ZN5test04testILi0EEEii
template<int X> int test(int x) {
// CHECK: [[RET:%.*]] = alloca i32
// CHECK-NEXT: [[X:%.*]] = alloca i32
diff --git a/test/CodeGenCXX/implicit-copy-assign-operator.cpp b/test/CodeGenCXX/implicit-copy-assign-operator.cpp
index 79586fba9af1..267402122f82 100644
--- a/test/CodeGenCXX/implicit-copy-assign-operator.cpp
+++ b/test/CodeGenCXX/implicit-copy-assign-operator.cpp
@@ -40,7 +40,7 @@ void test_D(D d1, D d2) {
d1 = d2;
}
-// CHECK: define linkonce_odr %struct.D* @_ZN1DaSERS_
+// CHECK-LABEL: define linkonce_odr %struct.D* @_ZN1DaSERS_
// CHECK: {{call.*_ZN1AaSERS_}}
// CHECK: {{call.*_ZN1BaSERS_}}
// CHECK: {{call.*_ZN1CaSERKS_}}
diff --git a/test/CodeGenCXX/implicit-copy-constructor.cpp b/test/CodeGenCXX/implicit-copy-constructor.cpp
index 24e84d57b13d..bb04318e7307 100644
--- a/test/CodeGenCXX/implicit-copy-constructor.cpp
+++ b/test/CodeGenCXX/implicit-copy-constructor.cpp
@@ -40,7 +40,7 @@ void f(D d) {
D d2(d);
}
-// CHECK: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* %this, %struct.D*) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* %this, %struct.D*) unnamed_addr
// CHECK: call void @_ZN1AC1Ev
// CHECK: call void @_ZN1CC2ERS_1A
// CHECK: call void @_ZN1AD1Ev
diff --git a/test/CodeGenCXX/implicit-instantiation-1.cpp b/test/CodeGenCXX/implicit-instantiation-1.cpp
index 0c826e4b20d1..bf6a14150892 100644
--- a/test/CodeGenCXX/implicit-instantiation-1.cpp
+++ b/test/CodeGenCXX/implicit-instantiation-1.cpp
@@ -20,7 +20,7 @@ void foo(X<int> &xi, X<float> *xfp, int i, float f) {
// RUN: grep "linkonce_odr.*_ZN1XIfE1fEf" %t | count 1
xfp->f(f);
- // RUN: grep "linkonce_odr.*_ZN1XIfE1hEf" %t | count 0
+ // RUN: not grep "linkonce_odr.*_ZN1XIfE1hEf" %t
}
diff --git a/test/CodeGenCXX/inheriting-constructor.cpp b/test/CodeGenCXX/inheriting-constructor.cpp
index 0f3978492976..c99a20c730e4 100644
--- a/test/CodeGenCXX/inheriting-constructor.cpp
+++ b/test/CodeGenCXX/inheriting-constructor.cpp
@@ -11,18 +11,18 @@ struct C { template<typename T> C(T); };
struct D : C { using C::C; };
D d(123);
-// CHECK: define void @_ZN1BD0Ev
-// CHECK: define void @_ZN1BD1Ev
-// CHECK: define void @_ZN1BD2Ev
+// CHECK-LABEL: define void @_ZN1BD0Ev
+// CHECK-LABEL: define void @_ZN1BD1Ev
+// CHECK-LABEL: define void @_ZN1BD2Ev
-// CHECK: define linkonce_odr void @_ZN1BC1Ei(
+// CHECK-LABEL: define linkonce_odr void @_ZN1BC1Ei(
// CHECK: call void @_ZN1BC2Ei(
-// CHECK: define linkonce_odr void @_ZN1DC1IiEET_(
+// CHECK-LABEL: define linkonce_odr void @_ZN1DC1IiEET_(
// CHECK: call void @_ZN1DC2IiEET_(
-// CHECK: define linkonce_odr void @_ZN1DC2IiEET_(
+// CHECK-LABEL: define linkonce_odr void @_ZN1DC2IiEET_(
// CHECK: call void @_ZN1CC2IiEET_(
-// CHECK: define linkonce_odr void @_ZN1BC2Ei(
+// CHECK-LABEL: define linkonce_odr void @_ZN1BC2Ei(
// CHECK: call void @_ZN1AC2Ei(
diff --git a/test/CodeGenCXX/init-invariant.cpp b/test/CodeGenCXX/init-invariant.cpp
index 9eb19896b6bb..45816b28fb65 100644
--- a/test/CodeGenCXX/init-invariant.cpp
+++ b/test/CodeGenCXX/init-invariant.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-linux-gnu -emit-llvm %s -O0 -o - | FileCheck %s --check-prefix=CHECK-O0
+// RUN: %clang_cc1 -triple i686-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
// RUN: %clang_cc1 -triple i686-linux-gnu -emit-llvm %s -O1 -o - | FileCheck %s
// Check that we add an llvm.invariant.start to mark when a global becomes
@@ -54,7 +54,7 @@ void e() {
// CHECK: store {{.*}}, i32* @d
// CHECK: call {{.*}}@llvm.invariant.start(i64 4, i8* bitcast ({{.*}} @d to i8*))
-// CHECK: define void @_Z1ev(
+// CHECK-LABEL: define void @_Z1ev(
// CHECK: call void @_ZN1AC1Ev(%struct.A* @_ZZ1evE1a)
// CHECK: call {{.*}}@llvm.invariant.start(i64 4, i8* bitcast ({{.*}} @_ZZ1evE1a to i8*))
// CHECK-NOT: llvm.invariant.end
diff --git a/test/CodeGenCXX/inline-functions.cpp b/test/CodeGenCXX/inline-functions.cpp
index 8c011de28a02..9f8e536a3b0c 100644
--- a/test/CodeGenCXX/inline-functions.cpp
+++ b/test/CodeGenCXX/inline-functions.cpp
@@ -5,7 +5,7 @@ struct A {
inline void f();
};
-// CHECK-NOT: define void @_ZN1A1fEv
+// CHECK-NOT-LABEL: define void @_ZN1A1fEv
void A::f() { }
template<typename> struct B { };
@@ -19,13 +19,13 @@ void B<char>::f() { }
// We need a final CHECK line here.
-// CHECK: define void @_Z1fv
+// CHECK-LABEL: define void @_Z1fv
void f() { }
// <rdar://problem/8740363>
inline void f1(int);
-// CHECK: define linkonce_odr void @_Z2f1i
+// CHECK-LABEL: define linkonce_odr void @_Z2f1i
void f1(int) { }
void test_f1() { f1(17); }
@@ -38,7 +38,7 @@ namespace test1 {
void g() {}
};
- // CHECK: define linkonce_odr void @_ZN5test11C4funcEv(
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test11C4funcEv(
class C {
public:
@@ -65,5 +65,5 @@ namespace test2 {
A a;
f(a);
}
- // CHECK: define linkonce_odr void @_ZN5test21fERKNS_1AE
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test21fERKNS_1AE
}
diff --git a/test/CodeGenCXX/instantiate-temporaries.cpp b/test/CodeGenCXX/instantiate-temporaries.cpp
index 29cfc07e92d8..c08ea781b8cb 100644
--- a/test/CodeGenCXX/instantiate-temporaries.cpp
+++ b/test/CodeGenCXX/instantiate-temporaries.cpp
@@ -18,7 +18,7 @@ void call() {
Y().get();
}
-// CHECK: define weak_odr void @_Z4callIiEvv
+// CHECK-LABEL: define weak_odr void @_Z4callIiEvv
// CHECK: call void @_ZN1Y3getEv
// CHECK-NEXT: call void @_ZN1XD1Ev
// CHECK-NEXT: ret void
@@ -29,7 +29,7 @@ void compound_literal() {
(X2){};
}
-// CHECK: define weak_odr void @_Z16compound_literalIiEvv
+// CHECK-LABEL: define weak_odr void @_Z16compound_literalIiEvv
// CHECK: call void @_ZN1XC1Ev
// CHECK-NEXT: call void @_ZN2X2D1Ev
// CHECK-NEXT: ret void
diff --git a/test/CodeGenCXX/invalid.cpp b/test/CodeGenCXX/invalid.cpp
new file mode 100644
index 000000000000..d3462465809d
--- /dev/null
+++ b/test/CodeGenCXX/invalid.cpp
@@ -0,0 +1,11 @@
+// RUN: not %clang_cc1 -g -emit-llvm %s
+
+// Don't attempt to codegen invalid code that would lead to a crash
+
+// PR16933
+struct A;
+A *x;
+struct A {
+ B y;
+};
+A y;
diff --git a/test/CodeGenCXX/lambda-expressions-inside-auto-functions.cpp b/test/CodeGenCXX/lambda-expressions-inside-auto-functions.cpp
new file mode 100644
index 000000000000..0083f0826ecc
--- /dev/null
+++ b/test/CodeGenCXX/lambda-expressions-inside-auto-functions.cpp
@@ -0,0 +1,77 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -fblocks -emit-llvm -o - %s -fexceptions -std=c++1y | FileCheck %s
+
+// CHECK-LABEL: define void @_ZN19non_inline_function3fooEv
+// CHECK-LABEL: define internal void @"_ZZN19non_inline_function3fooEvENK3$_0clEi"(%class.anon
+// CHECK-LABEL: define internal signext i8 @"_ZZZN19non_inline_function3fooEvENK3$_0clEiENKUlcE_clEc"(%class.anon
+// CHECK-LABEL: define linkonce_odr void @_ZN19non_inline_function4foo2IiEEDav()
+namespace non_inline_function {
+auto foo() {
+ auto L = [](int a) {
+ return [](char b) {
+ return b;
+ };
+ };
+ L(3)('a');
+ return L;
+}
+
+template<typename T>
+auto foo2() {
+ return [](const T&) { return 42; };
+}
+
+auto use = foo2<int>();
+
+}
+//CHECK-LABEL: define linkonce_odr void @_ZN22inline_member_function1X3fooEv(%"struct.inline_member_function::X"* %this)
+//CHECK-LABEL: define linkonce_odr void @_ZZN22inline_member_function1X3fooEvENKUliE_clEi(%class.anon
+//CHECK-LABEL: define linkonce_odr signext i8 @_ZZZN22inline_member_function1X3fooEvENKUliE_clEiENKUlcE_clEc(%class.anon
+
+namespace inline_member_function {
+struct X {
+auto foo() {
+ auto L = [](int a) {
+ return [](char b) {
+ return b;
+ };
+ };
+ return L;
+}
+};
+
+auto run1 = X{}.foo()(3)('a');
+
+template<typename S>
+struct A {
+ template<typename T> static auto default_lambda() {
+ return [](const T&) { return 42; };
+ }
+
+ template<class U = decltype(default_lambda<S>())>
+ U func(U u = default_lambda<S>()) { return u; }
+
+ template<class T> auto foo() { return [](const T&) { return 42; }; }
+};
+//CHECK-LABEL: define linkonce_odr i32 @_ZZN22inline_member_function1AIdE14default_lambdaIdEEDavENKUlRKdE_clES5_(%class.anon
+int run2 = A<double>{}.func()(3.14);
+
+//CHECK-LABEL: define linkonce_odr i32 @_ZZN22inline_member_function1AIcE14default_lambdaIcEEDavENKUlRKcE_clES5_(%class.anon
+int run3 = A<char>{}.func()('a');
+} // end inline_member_function
+
+
+// CHECK-LABEL: define linkonce_odr void @_ZN15inline_function3fooEv()
+// CHECK: define linkonce_odr void @_ZZN15inline_function3fooEvENKUliE_clEi(%class.anon
+// CHECK: define linkonce_odr signext i8 @_ZZZN15inline_function3fooEvENKUliE_clEiENKUlcE_clEc(%class.anon
+namespace inline_function {
+inline auto foo() {
+ auto L = [](int a) {
+ return [](char b) {
+ return b;
+ };
+ };
+ return L;
+}
+auto use = foo()(3)('a');
+}
+
diff --git a/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp b/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp
new file mode 100644
index 000000000000..accc5d2c4c38
--- /dev/null
+++ b/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp
@@ -0,0 +1,50 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -fblocks -emit-llvm -o - %s -fexceptions -std=c++11 | FileCheck %s
+
+// CHECK-LABEL: define void @_ZN19non_inline_function3fooEv()
+// CHECK-LABEL: define internal void @"_ZZN19non_inline_function3fooEvENK3$_0clEi"(%class.anon
+// CHECK-LABEL: define internal signext i8 @"_ZZZN19non_inline_function3fooEvENK3$_0clEiENKUlcE_clEc"(%class.anon
+namespace non_inline_function {
+void foo() {
+ auto L = [](int a) {
+ return [](char b) {
+ return b;
+ };
+ };
+ L(3)('a');
+}
+}
+
+namespace non_template {
+ struct L {
+ int t = ([](int a) { return [](int b) { return b; };})(2)(3);
+ };
+ L l;
+}
+
+namespace lambdas_in_NSDMIs_template_class {
+template<class T>
+struct L {
+ T t2 = ([](int a) { return [](int b) { return b; };})(T{})(T{});
+};
+L<int> l;
+}
+
+// CHECK-LABEL: define linkonce_odr i32 @_ZN15inline_function3fooEv
+// CHECK: define linkonce_odr void @_ZZN15inline_function3fooEvENKUliE_clEi
+// CHECK: define linkonce_odr signext i8 @_ZZZN15inline_function3fooEvENKUliE_clEiENKUlcE_clEc
+namespace inline_function {
+inline int foo() {
+ auto L = [](int a) {
+ return [](char b) {
+ return b;
+ };
+ };
+ L(3)('a');
+}
+int use = foo();
+}
+// CHECK: define linkonce_odr void @_ZNK32lambdas_in_NSDMIs_template_class1LIiEUliE_clEi(%class.anon
+// CHECK: define linkonce_odr i32 @_ZZNK32lambdas_in_NSDMIs_template_class1LIiEUliE_clEiENKUliE_clEi(%class.anon
+
+// CHECK: define linkonce_odr void @_ZNK12non_template1L1tMUliE_clEi(%class.anon
+// CHECK: define linkonce_odr i32 @_ZZNK12non_template1L1tMUliE_clEiENKUliE_clEi(%class.anon
diff --git a/test/CodeGenCXX/lambda-expressions.cpp b/test/CodeGenCXX/lambda-expressions.cpp
index 68ae68fadbbb..2f9a4f2d4f55 100644
--- a/test/CodeGenCXX/lambda-expressions.cpp
+++ b/test/CodeGenCXX/lambda-expressions.cpp
@@ -11,27 +11,27 @@ void *use = &used;
extern "C" auto cvar = []{};
int a() { return []{ return 1; }(); }
-// CHECK: define i32 @_Z1av
+// CHECK-LABEL: define i32 @_Z1av
// CHECK: call i32 @"_ZZ1avENK3$_0clEv"
-// CHECK: define internal i32 @"_ZZ1avENK3$_0clEv"
+// CHECK-LABEL: define internal i32 @"_ZZ1avENK3$_0clEv"
// CHECK: ret i32 1
int b(int x) { return [x]{return x;}(); }
-// CHECK: define i32 @_Z1bi
+// CHECK-LABEL: define i32 @_Z1bi
// CHECK: store i32
// CHECK: load i32*
// CHECK: store i32
// CHECK: call i32 @"_ZZ1biENK3$_1clEv"
-// CHECK: define internal i32 @"_ZZ1biENK3$_1clEv"
+// CHECK-LABEL: define internal i32 @"_ZZ1biENK3$_1clEv"
// CHECK: load i32*
// CHECK: ret i32
int c(int x) { return [&x]{return x;}(); }
-// CHECK: define i32 @_Z1ci
+// CHECK-LABEL: define i32 @_Z1ci
// CHECK: store i32
// CHECK: store i32*
// CHECK: call i32 @"_ZZ1ciENK3$_2clEv"
-// CHECK: define internal i32 @"_ZZ1ciENK3$_2clEv"
+// CHECK-LABEL: define internal i32 @"_ZZ1ciENK3$_2clEv"
// CHECK: load i32**
// CHECK: load i32*
// CHECK: ret i32
@@ -39,32 +39,32 @@ int c(int x) { return [&x]{return x;}(); }
struct D { D(); D(const D&); int x; };
int d(int x) { D y[10]; [x,y] { return y[x].x; }(); }
-// CHECK: define i32 @_Z1di
+// CHECK-LABEL: define i32 @_Z1di
// CHECK: call void @_ZN1DC1Ev
// CHECK: icmp ult i64 %{{.*}}, 10
// CHECK: call void @_ZN1DC1ERKS_
// CHECK: call i32 @"_ZZ1diENK3$_3clEv"
-// CHECK: define internal i32 @"_ZZ1diENK3$_3clEv"
+// CHECK-LABEL: define internal i32 @"_ZZ1diENK3$_3clEv"
// CHECK: load i32*
// CHECK: load i32*
// CHECK: ret i32
struct E { E(); E(const E&); ~E(); int x; };
int e(E a, E b, bool cond) { [a,b,cond](){ return (cond ? a : b).x; }(); }
-// CHECK: define i32 @_Z1e1ES_b
+// CHECK-LABEL: define i32 @_Z1e1ES_b
// CHECK: call void @_ZN1EC1ERKS_
// CHECK: invoke void @_ZN1EC1ERKS_
// CHECK: invoke i32 @"_ZZ1e1ES_bENK3$_4clEv"
// CHECK: call void @"_ZZ1e1ES_bEN3$_4D1Ev"
// CHECK: call void @"_ZZ1e1ES_bEN3$_4D1Ev"
-// CHECK: define internal i32 @"_ZZ1e1ES_bENK3$_4clEv"
+// CHECK-LABEL: define internal i32 @"_ZZ1e1ES_bENK3$_4clEv"
// CHECK: trunc i8
// CHECK: load i32*
// CHECK: ret i32
void f() {
- // CHECK: define void @_Z1fv()
+ // CHECK-LABEL: define void @_Z1fv()
// CHECK: @"_ZZ1fvENK3$_5cvPFiiiEEv"
// CHECK-NEXT: store i32 (i32, i32)*
// CHECK-NEXT: ret void
@@ -74,7 +74,7 @@ void f() {
static int k;
int g() {
int &r = k;
- // CHECK: define internal i32 @"_ZZ1gvENK3$_6clEv"(
+ // CHECK-LABEL: define internal i32 @"_ZZ1gvENK3$_6clEv"(
// CHECK-NOT: }
// CHECK: load i32* @_ZL1k,
return [] { return r; } ();
@@ -100,7 +100,7 @@ void h() {
A (*h)() = [] { return A(); };
}
-// CHECK: define internal i32 @"_ZZ1fvEN3$_58__invokeEii"
+// CHECK-LABEL: define internal i32 @"_ZZ1fvEN3$_58__invokeEii"
// CHECK: store i32
// CHECK-NEXT: store i32
// CHECK-NEXT: load i32*
@@ -108,7 +108,7 @@ void h() {
// CHECK-NEXT: call i32 @"_ZZ1fvENK3$_5clEii"
// CHECK-NEXT: ret i32
-// CHECK: define internal void @"_ZZ1e1ES_bEN3$_4D2Ev"
+// CHECK-LABEL: define internal void @"_ZZ1e1ES_bEN3$_4D2Ev"
// <rdar://problem/12778708>
struct XXX {};
diff --git a/test/CodeGenCXX/linetable-cleanup.cpp b/test/CodeGenCXX/linetable-cleanup.cpp
index 4077af6d8e01..96b857225267 100644
--- a/test/CodeGenCXX/linetable-cleanup.cpp
+++ b/test/CodeGenCXX/linetable-cleanup.cpp
@@ -1,12 +1,18 @@
// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
-// Check the line numbers for cleanup code with EH in combinatin with
+// Check the line numbers for cleanup code with EH in combination with
// simple return expressions.
// CHECK: define {{.*}}foo
// CHECK: call void @_ZN1CD1Ev(%class.C* {{.*}}), !dbg ![[CLEANUP:[0-9]+]]
// CHECK: ret i32 0, !dbg ![[RET:[0-9]+]]
+// CHECK: define {{.*}}bar
+// CHECK: ret void, !dbg ![[RETBAR:[0-9]+]]
+
+// CHECK: define {{.*}}baz
+// CHECK: ret void, !dbg ![[RETBAZ:[0-9]+]]
+
class C {
public:
~C() {}
@@ -22,3 +28,31 @@ int foo()
return 0;
// CHECK: ![[RET]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
}
+
+void bar()
+{
+ if (!foo())
+ // CHECK: {{.*}} = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
+ return;
+
+ if (foo()) {
+ C c;
+ c.i = foo();
+ }
+ // Clang creates only a single ret instruction. Make sure it is at a useful line.
+ // CHECK: ![[RETBAR]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
+}
+
+void baz()
+{
+ if (!foo())
+ // CHECK: {{.*}} = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
+ return;
+
+ if (foo()) {
+ // no cleanup
+ // CHECK: {{.*}} = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
+ return;
+ }
+ // CHECK: ![[RETBAZ]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
+}
diff --git a/test/CodeGenCXX/linkage.cpp b/test/CodeGenCXX/linkage.cpp
new file mode 100644
index 000000000000..19f1b20773c0
--- /dev/null
+++ b/test/CodeGenCXX/linkage.cpp
@@ -0,0 +1,222 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -std=c++11 -O1 -disable-llvm-optzns %s -o - | FileCheck %s
+
+namespace test1 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN5test11fIZNS_1gEvE1SEEvT_(
+ template <typename T> void f(T) {}
+ inline void *g() {
+ struct S {
+ } s;
+ return reinterpret_cast<void *>(f<S>);
+ }
+ void *h() { return g(); }
+}
+
+namespace test2 {
+ // CHECK-DAG-LABEL: define internal void @_ZN5test21fIZNS_L1gEvE1SEEvT_(
+ template <typename T> void f(T) {}
+ static inline void *g() {
+ struct S {
+ } s;
+ return reinterpret_cast<void *>(f<S>);
+ }
+ void *h() { return g(); }
+}
+
+namespace test3 {
+ // CHECK-DAG-LABEL: define internal void @_ZN5test31fIZNS_1gEvE1SEEvT_(
+ template <typename T> void f(T) {}
+ void *g() {
+ struct S {
+ } s;
+ return reinterpret_cast<void *>(f<S>);
+ }
+ void *h() { return g(); }
+}
+
+namespace test4 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN5test41fIZNS_1gILi1EEEPvvE1SEEvT_(
+ template <typename T> void f(T) {}
+ template <int N> inline void *g() {
+ struct S {
+ } s;
+ return reinterpret_cast<void *>(f<S>);
+ }
+ extern template void *g<1>();
+ template void *g<1>();
+}
+
+namespace test5 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN5test51fIZNS_1gILi1EEEPvvE1SEEvT_(
+ template <typename T> void f(T) {}
+ template <int N> inline void *g() {
+ struct S {
+ } s;
+ return reinterpret_cast<void *>(f<S>);
+ }
+ extern template void *g<1>();
+ void *h() { return g<1>(); }
+}
+
+namespace test6 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN5test61fIZZNS_1gEvEN1S1hEvE1TEEvv(
+ template <typename T> void f() {}
+
+ inline void *g() {
+ struct S {
+ void *h() {
+ struct T {
+ };
+ return (void *)f<T>;
+ }
+ } s;
+ return s.h();
+ }
+
+ void *h() { return g(); }
+}
+
+namespace test7 {
+ // CHECK-DAG-LABEL: define internal void @_ZN5test71fIZZNS_1gEvEN1S1hEvE1TEEvv(
+ template <typename T> void f() {}
+
+ void *g() {
+ struct S {
+ void *h() {
+ struct T {
+ };
+ return (void *)f<T>;
+ }
+ } s;
+ return s.h();
+ }
+
+ void *h() { return g(); }
+}
+
+namespace test8 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN5test81fIZNS_1gEvE1SEEvT_(
+ template <typename T> void f(T) {}
+ inline void *g() {
+ enum S {
+ };
+ return reinterpret_cast<void *>(f<S>);
+ }
+ void *h() { return g(); }
+}
+
+namespace test9 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN5test91fIPZNS_1gEvE1SEEvT_(
+ template <typename T> void f(T) {}
+ inline void *g() {
+ struct S {
+ } s;
+ return reinterpret_cast<void *>(f<S*>);
+ }
+ void *h() { return g(); }
+}
+
+namespace test10 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN6test101fIPFZNS_1gEvE1SvEEEvT_(
+ template <typename T> void f(T) {}
+ inline void *g() {
+ struct S {
+ } s;
+ typedef S(*ftype)();
+ return reinterpret_cast<void *>(f<ftype>);
+ }
+ void *h() { return g(); }
+}
+
+namespace test11 {
+ // CHECK-DAG-LABEL: define internal void @_ZN6test111fIPFZNS_1gEvE1SPNS_12_GLOBAL__N_11IEEEEvT_(
+ namespace {
+ struct I {
+ };
+ }
+
+ template <typename T> void f(T) {}
+ inline void *g() {
+ struct S {
+ };
+ typedef S(*ftype)(I * x);
+ return reinterpret_cast<void *>(f<ftype>);
+ }
+ void *h() { return g(); }
+}
+
+namespace test12 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN6test123fooIZNS_3barIZNS_3zedEvE2S2EEPvvE2S1EEvv
+ template <typename T> void foo() {}
+ template <typename T> inline void *bar() {
+ enum S1 {
+ };
+ return reinterpret_cast<void *>(foo<S1>);
+ }
+ inline void *zed() {
+ enum S2 {
+ };
+ return reinterpret_cast<void *>(bar<S2>);
+ }
+ void *h() { return zed(); }
+}
+
+namespace test13 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZZN6test133fooEvEN1S3barEv(
+ inline void *foo() {
+ struct S {
+ static void bar() {}
+ };
+ return (void *)S::bar;
+ }
+ void *zed() { return foo(); }
+}
+
+namespace test14 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN6test143fooIZNS_1fEvE1SE3barILPS1_0EEEvv(
+ template <typename T> struct foo {
+ template <T *P> static void bar() {}
+ static void *g() { return (void *)bar<nullptr>; }
+ };
+ inline void *f() {
+ struct S {
+ };
+ return foo<S>::g();
+ }
+ void h() { f(); }
+}
+
+namespace test15 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN6test153zedIZNS_3fooIiEEPvvE3barEEvv(
+ template <class T> void zed() {}
+ template <class T> void *foo() {
+ class bar {
+ };
+ return reinterpret_cast<void *>(zed<bar>);
+ }
+ void test() { foo<int>(); }
+}
+
+namespace test16 {
+ // CHECK-DAG-LABEL: define linkonce_odr void @_ZN6test163zedIZNS_3fooIiE3barEvE1SEEvv(
+ template <class T> void zed() {}
+ template <class T> struct foo {
+ static void *bar();
+ };
+ template <class T> void *foo<T>::bar() {
+ class S {
+ };
+ return reinterpret_cast<void *>(zed<S>);
+ }
+ void *test() { return foo<int>::bar(); }
+}
+
+namespace test17 {
+ // CHECK-DAG: @_ZZN6test173fooILi42EEEPivE3bar = linkonce_odr
+ // CHECK-DAG-LABEL: define weak_odr i32* @_ZN6test173fooILi42EEEPiv(
+ template<int I>
+ int *foo() {
+ static int bar;
+ return &bar;
+ }
+ template int *foo<42>();
+}
diff --git a/test/CodeGenCXX/lpad-linetable.cpp b/test/CodeGenCXX/lpad-linetable.cpp
new file mode 100644
index 000000000000..dba2ad63b2dd
--- /dev/null
+++ b/test/CodeGenCXX/lpad-linetable.cpp
@@ -0,0 +1,69 @@
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -emit-llvm -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+// The landing pad should have the line number of the closing brace of the function.
+// rdar://problem/13888152
+// CHECK: ret i32
+// CHECK: landingpad {{.*}}
+// CHECK-NEXT: !dbg ![[LPAD:[0-9]+]]
+// CHECK: ![[LPAD]] = metadata !{i32 24, i32 0, metadata !{{.*}}, null}
+
+# 1 "/usr/include/c++/4.2.1/vector" 1 3
+typedef long unsigned int __darwin_size_t;
+typedef __darwin_size_t size_t;
+namespace std {
+ template<typename _Tp>
+ class allocator
+ {
+ public:
+ template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+ ~allocator() throw() { }
+ };
+ template<typename _Tp, typename _Alloc>
+ struct _Vector_base
+ {
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+ struct _Vector_impl
+ {
+ _Vector_impl(_Tp_alloc_type const& __a) { }
+ };
+ typedef _Alloc allocator_type;
+ _Vector_base(const allocator_type& __a)
+ : _M_impl(__a)
+ { }
+ ~_Vector_base() { }
+ _Vector_impl _M_impl;
+ };
+ template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+ class vector
+ : protected _Vector_base<_Tp, _Alloc>
+ {
+ typedef _Vector_base<_Tp, _Alloc> _Base;
+ public:
+ typedef _Tp value_type;
+ typedef size_t size_type;
+ typedef _Alloc allocator_type;
+ vector(const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { }
+ size_type
+ push_back(const value_type& __x)
+ {}
+ };
+}
+# 10 "main.cpp" 2
+
+
+
+
+int main (int argc, char const *argv[], char const *envp[])
+{ // 15
+ std::vector<long> longs;
+ std::vector<short> shorts;
+ for (int i=0; i<12; i++)
+ {
+ longs.push_back(i);
+ shorts.push_back(i);
+ }
+ return 0; // 23
+} // 24
diff --git a/test/CodeGenCXX/lvalue-bitcasts.cpp b/test/CodeGenCXX/lvalue-bitcasts.cpp
index 8c5fa4ad44bb..86355b27abbf 100644
--- a/test/CodeGenCXX/lvalue-bitcasts.cpp
+++ b/test/CodeGenCXX/lvalue-bitcasts.cpp
@@ -3,7 +3,7 @@
struct X { int i; float f; };
struct Y { X x; };
-// CHECK: define void @_Z21reinterpret_cast_testRiRfR1X
+// CHECK-LABEL: define void @_Z21reinterpret_cast_testRiRfR1X
void reinterpret_cast_test(int &ir, float &fr, X &xr) {
// CHECK: load float**
// CHECK: bitcast float*
@@ -48,7 +48,7 @@ void reinterpret_cast_test(int &ir, float &fr, X &xr) {
// CHECK: ret void
}
-// CHECK: define void @_Z6c_castRiRfR1X
+// CHECK-LABEL: define void @_Z6c_castRiRfR1X
void c_cast(int &ir, float &fr, X &xr) {
// CHECK: load float**
// CHECK: bitcast float*
@@ -93,7 +93,7 @@ void c_cast(int &ir, float &fr, X &xr) {
// CHECK: ret void
}
-// CHECK: define void @_Z15functional_castRiRfR1X
+// CHECK-LABEL: define void @_Z15functional_castRiRfR1X
void functional_cast(int &ir, float &fr, X &xr) {
typedef int &intref;
typedef float &floatref;
diff --git a/test/CodeGenCXX/mangle-98.cpp b/test/CodeGenCXX/mangle-98.cpp
index a9ab6ca42370..a329caf1d29d 100644
--- a/test/CodeGenCXX/mangle-98.cpp
+++ b/test/CodeGenCXX/mangle-98.cpp
@@ -2,11 +2,11 @@
template <bool B> struct S3 {};
-// CHECK: define void @_Z1f2S3ILb1EE
+// CHECK-LABEL: define void @_Z1f2S3ILb1EE
void f(S3<true>) {}
-// CHECK: define void @_Z1f2S3ILb0EE
+// CHECK-LABEL: define void @_Z1f2S3ILb0EE
void f(S3<false>) {}
-// CHECK: define void @_Z2f22S3ILb1EE
+// CHECK-LABEL: define void @_Z2f22S3ILb1EE
void f2(S3<100>) {}
diff --git a/test/CodeGenCXX/mangle-address-space.cpp b/test/CodeGenCXX/mangle-address-space.cpp
index ff23c206911c..4a4a1f3f56e9 100644
--- a/test/CodeGenCXX/mangle-address-space.cpp
+++ b/test/CodeGenCXX/mangle-address-space.cpp
@@ -1,12 +1,12 @@
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
-// CHECK: define void @_Z2f0Pc
+// CHECK-LABEL: define void @_Z2f0Pc
void f0(char *p) { }
-// CHECK: define void @_Z2f0PU3AS1c
+// CHECK-LABEL: define void @_Z2f0PU3AS1c
void f0(char __attribute__((address_space(1))) *p) { }
struct OpaqueType;
typedef OpaqueType __attribute__((address_space(100))) * OpaqueTypePtr;
-// CHECK: define void @_Z2f0PU5AS10010OpaqueType
+// CHECK-LABEL: define void @_Z2f0PU5AS10010OpaqueType
void f0(OpaqueTypePtr) { }
diff --git a/test/CodeGenCXX/mangle-alias-template.cpp b/test/CodeGenCXX/mangle-alias-template.cpp
index 5ace0b01cc2e..b6719c545233 100644
--- a/test/CodeGenCXX/mangle-alias-template.cpp
+++ b/test/CodeGenCXX/mangle-alias-template.cpp
@@ -15,7 +15,7 @@ template<typename,typename,typename> struct S {};
template<typename T, typename U> using U = S<T, int, U>;
template<typename...Ts> void h(U<Ts...>, Ts...);
-// CHECK: define void @_Z1zv(
+// CHECK-LABEL: define void @_Z1zv(
void z() {
vector<int> VI;
f(VI);
diff --git a/test/CodeGenCXX/mangle-exprs.cpp b/test/CodeGenCXX/mangle-exprs.cpp
index 2d7a883526db..e935f51a46b2 100644
--- a/test/CodeGenCXX/mangle-exprs.cpp
+++ b/test/CodeGenCXX/mangle-exprs.cpp
@@ -70,22 +70,22 @@ namespace Casts {
template <int N> T<N> f() { return T<N>(); }
- // CHECK: define weak_odr void @_ZN5Casts8implicitILj4EEEvPN9enable_ifIXleT_Li4EEvE4typeE
+ // CHECK-LABEL: define weak_odr void @_ZN5Casts8implicitILj4EEEvPN9enable_ifIXleT_Li4EEvE4typeE
template void implicit<4>(void*);
- // CHECK: define weak_odr void @_ZN5Casts6cstyleILj4EEEvPN9enable_ifIXleT_cvjLi4EEvE4typeE
+ // CHECK-LABEL: define weak_odr void @_ZN5Casts6cstyleILj4EEEvPN9enable_ifIXleT_cvjLi4EEvE4typeE
template void cstyle<4>(void*);
- // CHECK: define weak_odr void @_ZN5Casts10functionalILj4EEEvPN9enable_ifIXleT_cvjLi4EEvE4typeE
+ // CHECK-LABEL: define weak_odr void @_ZN5Casts10functionalILj4EEEvPN9enable_ifIXleT_cvjLi4EEvE4typeE
template void functional<4>(void*);
- // CHECK: define weak_odr void @_ZN5Casts7static_ILj4EEEvPN9enable_ifIXleT_cvjLi4EEvE4typeE
+ // CHECK-LABEL: define weak_odr void @_ZN5Casts7static_ILj4EEEvPN9enable_ifIXleT_cvjLi4EEvE4typeE
template void static_<4>(void*);
- // CHECK: define weak_odr void @_ZN5Casts1fILi6EEENS_1TIXT_EEEv
+ // CHECK-LABEL: define weak_odr void @_ZN5Casts1fILi6EEENS_1TIXT_EEEv
template T<6> f<6>();
- // CHECK: define weak_odr void @_ZN5Casts5auto_IiEEvDTnw_DapicvT__EEE(
+ // CHECK-LABEL: define weak_odr void @_ZN5Casts5auto_IiEEvDTnw_DapicvT__EEE(
template void auto_<int>(int*);
- // CHECK: define weak_odr void @_ZN5Casts7scalar_IiEEvDTcmcvT__Ecvi_EE(
+ // CHECK-LABEL: define weak_odr void @_ZN5Casts7scalar_IiEEvDTcmcvT__Ecvi_EE(
template void scalar_<int>(int);
}
@@ -93,10 +93,10 @@ namespace test1 {
short foo(short);
int foo(int);
- // CHECK: define linkonce_odr signext i16 @_ZN5test11aIsEEDTcl3foocvT__EEES1_(
+ // CHECK-LABEL: define linkonce_odr signext i16 @_ZN5test11aIsEEDTcl3foocvT__EEES1_(
template <class T> auto a(T t) -> decltype(foo(T())) { return foo(t); }
- // CHECK: define linkonce_odr signext i16 @_ZN5test11bIsEEDTcp3foocvT__EEES1_(
+ // CHECK-LABEL: define linkonce_odr signext i16 @_ZN5test11bIsEEDTcp3foocvT__EEES1_(
template <class T> auto b(T t) -> decltype((foo)(T())) { return (foo)(t); }
void test(short s) {
@@ -124,7 +124,7 @@ namespace test2 {
float baz(float(*)());
void fred(float(*)(), float);
- // CHECK: define void @_ZN5test211instantiateEv
+ // CHECK-LABEL: define void @_ZN5test211instantiateEv
void instantiate() {
// CHECK: call void @_ZN5test21aIPFfvEEEvT_DTclfL0p_EE(
a(foo, 0.0f);
@@ -156,7 +156,7 @@ namespace test3 {
int *member;
};
- // CHECK: define void @_ZN5test311instantiateEv
+ // CHECK-LABEL: define void @_ZN5test311instantiateEv
void instantiate() {
X x;
int *ip;
diff --git a/test/CodeGenCXX/mangle-extreme.cpp b/test/CodeGenCXX/mangle-extreme.cpp
index ef2d466e416c..9fa678a6f7d4 100644
--- a/test/CodeGenCXX/mangle-extreme.cpp
+++ b/test/CodeGenCXX/mangle-extreme.cpp
@@ -2,7 +2,7 @@
struct X { };
-// CHECK: define void @_Z1fPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP1XS13_S12_S11_S10_SZ_SY_SX_SW_SV_SU_ST_SS_SR_SQ_SP_SO_SN_SM_SL_SK_SJ_SI_SH_SG_SF_SE_SD_SC_SB_SA_S9_S8_S7_S6_S5_S4_S3_S2_S1_S0_S_(
+// CHECK-LABEL: define void @_Z1fPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP1XS13_S12_S11_S10_SZ_SY_SX_SW_SV_SU_ST_SS_SR_SQ_SP_SO_SN_SM_SL_SK_SJ_SI_SH_SG_SF_SE_SD_SC_SB_SA_S9_S8_S7_S6_S5_S4_S3_S2_S1_S0_S_(
void f(X****************************************,
X****************************************,
X***************************************,
diff --git a/test/CodeGenCXX/mangle-lambdas.cpp b/test/CodeGenCXX/mangle-lambdas.cpp
index 0bd5ad2a02ca..659b437a0ef3 100644
--- a/test/CodeGenCXX/mangle-lambdas.cpp
+++ b/test/CodeGenCXX/mangle-lambdas.cpp
@@ -1,11 +1,11 @@
// RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-macosx10.7.0 -emit-llvm -o - %s | FileCheck %s
// CHECK: @_ZZNK7PR12917IJiiEE1nMUlvE_clEvE1n = linkonce_odr global i32 0
-// CHECK: @_ZZN7PR12917IJicdEEC1EicdEd_N1nE = linkonce_odr global i32 0
-// CHECK: @_ZZN7PR12917IJicdEEC1EicdEd0_N1nE = linkonce_odr global i32 0
-// CHECK: @_ZZN7PR12917IJicdEEC1EicdEd1_N1nE = linkonce_odr global i32 0
+// CHECK: @_ZZZN7PR12917IJicdEEC1EicdEd_NKUlvE_clEvE1n = linkonce_odr global i32 0
+// CHECK: @_ZZZN7PR12917IJicdEEC1EicdEd0_NKUlvE_clEvE1n = linkonce_odr global i32 0
+// CHECK: @_ZZZN7PR12917IJicdEEC1EicdEd1_NKUlvE_clEvE1n = linkonce_odr global i32 0
-// CHECK: define linkonce_odr void @_Z11inline_funci
+// CHECK-LABEL: define linkonce_odr void @_Z11inline_funci
inline void inline_func(int n) {
// CHECK: call i32 @_ZZ11inline_funciENKUlvE_clEv
int i = []{ return 1; }();
@@ -41,7 +41,7 @@ struct S {
void S::g(int i = []{return 1;}(),
int j = []{return 2; }()) {}
-// CHECK: define void @_Z6test_S1S
+// CHECK-LABEL: define void @_Z6test_S1S
void test_S(S s) {
// CHECK: call i32 @_ZZN1S1fEiiEd0_NKUlvE_clEv
// CHECK-NEXT: call i32 @_ZZN1S1fEiiEd0_NKUlvE0_clEv
@@ -63,15 +63,15 @@ void test_S(S s) {
}
// Check the linkage of the lambda call operators used in test_S.
-// CHECK: define linkonce_odr i32 @_ZZN1S1fEiiEd0_NKUlvE_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZZN1S1fEiiEd0_NKUlvE_clEv
// CHECK: ret i32 1
-// CHECK: define linkonce_odr i32 @_ZZN1S1fEiiEd0_NKUlvE0_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZZN1S1fEiiEd0_NKUlvE0_clEv
// CHECK: ret i32 2
-// CHECK: define linkonce_odr i32 @_ZZN1S1fEiiEd_NKUlvE_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZZN1S1fEiiEd_NKUlvE_clEv
// CHECK: ret i32 3
-// CHECK: define internal i32 @"_ZNK1S3$_0clEv"
+// CHECK-LABEL: define internal i32 @"_ZNK1S3$_0clEv"
// CHECK: ret i32 1
-// CHECK: define internal i32 @"_ZNK1S3$_1clEv"
+// CHECK-LABEL: define internal i32 @"_ZNK1S3$_1clEv"
// CHECK: ret i32 2
template<typename T>
@@ -81,7 +81,7 @@ struct ST {
T = []{return T(3);}());
};
-// CHECK: define void @_Z7test_ST2STIdE
+// CHECK-LABEL: define void @_Z7test_ST2STIdE
void test_ST(ST<double> st) {
// CHECK: call double @_ZZN2STIdE1fEddEd0_NKUlvE_clEv
// CHECK-NEXT: call double @_ZZN2STIdE1fEddEd0_NKUlvE0_clEv
@@ -94,11 +94,11 @@ void test_ST(ST<double> st) {
}
// Check the linkage of the lambda call operators used in test_ST.
-// CHECK: define linkonce_odr double @_ZZN2STIdE1fEddEd0_NKUlvE_clEv
+// CHECK-LABEL: define linkonce_odr double @_ZZN2STIdE1fEddEd0_NKUlvE_clEv
// CHECK: ret double 1
-// CHECK: define linkonce_odr double @_ZZN2STIdE1fEddEd0_NKUlvE0_clEv
+// CHECK-LABEL: define linkonce_odr double @_ZZN2STIdE1fEddEd0_NKUlvE0_clEv
// CHECK: ret double 2
-// CHECK: define linkonce_odr double @_ZZN2STIdE1fEddEd_NKUlvE_clEv
+// CHECK-LABEL: define linkonce_odr double @_ZZN2STIdE1fEddEd_NKUlvE_clEv
// CHECK: ret double 3
template<typename T>
@@ -106,6 +106,7 @@ struct StaticMembers {
static T x;
static T y;
static T z;
+ static int (*f)();
};
template<typename T> int accept_lambda(T);
@@ -119,39 +120,47 @@ T StaticMembers<T>::y = []{return 3;}();
template<typename T>
T StaticMembers<T>::z = accept_lambda([]{return 4;});
-// CHECK: define internal void @__cxx_global_var_init()
+template<typename T>
+int (*StaticMembers<T>::f)() = []{return 5;};
+
+// CHECK-LABEL: define internal void @__cxx_global_var_init()
// CHECK: call i32 @_ZNK13StaticMembersIfE1xMUlvE_clEv
// CHECK-NEXT: call i32 @_ZNK13StaticMembersIfE1xMUlvE0_clEv
// CHECK-NEXT: add nsw
-// CHECK: define linkonce_odr i32 @_ZNK13StaticMembersIfE1xMUlvE_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZNK13StaticMembersIfE1xMUlvE_clEv
// CHECK: ret i32 1
-// CHECK: define linkonce_odr i32 @_ZNK13StaticMembersIfE1xMUlvE0_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZNK13StaticMembersIfE1xMUlvE0_clEv
// CHECK: ret i32 2
template float StaticMembers<float>::x;
-// CHECK: define internal void @__cxx_global_var_init1()
+// CHECK-LABEL: define internal void @__cxx_global_var_init1()
// CHECK: call i32 @_ZNK13StaticMembersIfE1yMUlvE_clEv
-// CHECK: define linkonce_odr i32 @_ZNK13StaticMembersIfE1yMUlvE_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZNK13StaticMembersIfE1yMUlvE_clEv
// CHECK: ret i32 3
template float StaticMembers<float>::y;
-// CHECK: define internal void @__cxx_global_var_init2()
+// CHECK-LABEL: define internal void @__cxx_global_var_init2()
// CHECK: call i32 @_Z13accept_lambdaIN13StaticMembersIfE1zMUlvE_EEiT_
// CHECK: declare i32 @_Z13accept_lambdaIN13StaticMembersIfE1zMUlvE_EEiT_()
template float StaticMembers<float>::z;
-// CHECK: define internal void @__cxx_global_var_init3
+// CHECK-LABEL: define internal void @__cxx_global_var_init3()
+// CHECK: call {{.*}} @_ZNK13StaticMembersIfE1fMUlvE_cvPFivEEv
+// CHECK-LABEL: define linkonce_odr i32 ()* @_ZNK13StaticMembersIfE1fMUlvE_cvPFivEEv
+template int (*StaticMembers<float>::f)();
+
+// CHECK-LABEL: define internal void @__cxx_global_var_init4
// CHECK: call i32 @"_ZNK13StaticMembersIdE3$_2clEv"
-// CHECK: define internal i32 @"_ZNK13StaticMembersIdE3$_2clEv"
+// CHECK-LABEL: define internal i32 @"_ZNK13StaticMembersIdE3$_2clEv"
// CHECK: ret i32 42
template<> double StaticMembers<double>::z = []{return 42; }();
template<typename T>
void func_template(T = []{ return T(); }());
-// CHECK: define void @_Z17use_func_templatev()
+// CHECK-LABEL: define void @_Z17use_func_templatev()
void use_func_template() {
- // CHECK: call i32 @"_ZZ13func_templateIiEvT_ENKS_IiE3$_3clEv"
+ // CHECK: call i32 @"_ZZ13func_templateIiEvT_ENK3$_3clEv"
func_template<int>();
}
@@ -183,7 +192,7 @@ namespace PR12123 {
};
void B::h() { f(); }
}
-// CHECK: define linkonce_odr %"struct.PR12123::A"* @_ZZN7PR121231B1fERKSt9type_infoEd_NKUlvE_clEv
+// CHECK-LABEL: define linkonce_odr %"struct.PR12123::A"* @_ZZN7PR121231B1fERKSt9type_infoEd_NKUlvE_clEv
namespace PR12808 {
template <typename> struct B {
@@ -196,11 +205,11 @@ namespace PR12808 {
void f() {
b<int>(1);
}
- // CHECK: define linkonce_odr void @_ZZN7PR128081bIiEEviENKS0_IiEUlvE_clEv
- // CHECK: define linkonce_odr i32 @_ZZZN7PR128081bIiEEviENKS0_IiEUlvE_clEvENKUlvE_clEv
+ // CHECK-LABEL: define linkonce_odr void @_ZZN7PR128081bIiEEviENKUlvE_clEv
+ // CHECK-LABEL: define linkonce_odr i32 @_ZZZN7PR128081bIiEEviENKUlvE_clEvENKUlvE_clEv
}
-// CHECK: define linkonce_odr void @_Z1fIZZNK23TestNestedInstantiationclEvENKUlvE_clEvEUlvE_EvT_
+// CHECK-LABEL: define linkonce_odr void @_Z1fIZZNK23TestNestedInstantiationclEvENKUlvE_clEvEUlvE_EvT_
struct Members {
int x = [] { return 1; }() + [] { return 2; }();
@@ -208,7 +217,7 @@ struct Members {
};
void test_Members() {
- // CHECK: define linkonce_odr void @_ZN7MembersC2Ev
+ // CHECK-LABEL: define linkonce_odr void @_ZN7MembersC2Ev
// CHECK: call i32 @_ZNK7Members1xMUlvE_clEv
// CHECK-NEXT: call i32 @_ZNK7Members1xMUlvE0_clE
// CHECK-NEXT: add nsw i32
@@ -232,21 +241,21 @@ void test_NestedInstantiation() {
}
// Check the linkage of the lambdas used in test_Members.
-// CHECK: define linkonce_odr i32 @_ZNK7Members1xMUlvE_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZNK7Members1xMUlvE_clEv
// CHECK: ret i32 1
-// CHECK: define linkonce_odr i32 @_ZNK7Members1xMUlvE0_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZNK7Members1xMUlvE0_clEv
// CHECK: ret i32 2
-// CHECK: define linkonce_odr i32 @_ZNK7Members1yMUlvE_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZNK7Members1yMUlvE_clEv
// CHECK: ret i32 3
// Check linkage of the various lambdas.
-// CHECK: define linkonce_odr i32 @_ZZ11inline_funciENKUlvE_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZZ11inline_funciENKUlvE_clEv
// CHECK: ret i32 1
-// CHECK: define linkonce_odr i32 @_ZZ11inline_funciENKUlvE0_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZZ11inline_funciENKUlvE0_clEv
// CHECK: ret i32
-// CHECK: define linkonce_odr double @_ZZ11inline_funciENKUlvE1_clEv
+// CHECK-LABEL: define linkonce_odr double @_ZZ11inline_funciENKUlvE1_clEv
// CHECK: ret double
-// CHECK: define linkonce_odr i32 @_ZZ11inline_funciENKUliE_clEi
+// CHECK-LABEL: define linkonce_odr i32 @_ZZ11inline_funciENKUliE_clEi
// CHECK: ret i32
-// CHECK: define linkonce_odr i32 @_ZZ11inline_funciENKUlvE2_clEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZZ11inline_funciENKUlvE2_clEv
// CHECK: ret i32 17
diff --git a/test/CodeGenCXX/mangle-local-class-names.cpp b/test/CodeGenCXX/mangle-local-class-names.cpp
index 332146076ae5..8b950fcd1776 100644
--- a/test/CodeGenCXX/mangle-local-class-names.cpp
+++ b/test/CodeGenCXX/mangle-local-class-names.cpp
@@ -55,3 +55,33 @@ void GORF (float IVAR1)
}
}
+// CHECK: @_ZZ12OmittingCodefEN4SSSSC1E_0RKf
+inline void OmittingCode(float x) {
+ if (0) {
+ struct SSSS {
+ float bv;
+ SSSS(const float& from): bv(from) { }
+ };
+
+ SSSS VAR1(x);
+ }
+
+ struct SSSS {
+ float bv;
+ SSSS(const float& from): bv(from) { }
+ };
+
+ SSSS VAR2(x);
+}
+void CallOmittingCode() { OmittingCode(1); }
+
+// CHECK: @_ZZ15LocalAnonStructvENUt0_1gEv
+inline void LocalAnonStruct() {
+ if (0) {
+ struct { void f() {} } x;
+ x.f();
+ }
+ struct { void g() {} } y;
+ y.g();
+}
+void CallLocalAnonStruct() { LocalAnonStruct(); }
diff --git a/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp b/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp
index d03ba5264975..50a238340e18 100644
--- a/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp
+++ b/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp
@@ -1,123 +1,240 @@
// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 | FileCheck -check-prefix=X64 %s
void foo(const unsigned int) {}
// CHECK: "\01?foo@@YAXI@Z"
+// X64: "\01?foo@@YAXI@Z"
void foo(const double) {}
// CHECK: "\01?foo@@YAXN@Z"
+// X64: "\01?foo@@YAXN@Z"
void bar(const volatile double) {}
// CHECK: "\01?bar@@YAXN@Z"
+// X64: "\01?bar@@YAXN@Z"
void foo_pad(char * x) {}
// CHECK: "\01?foo_pad@@YAXPAD@Z"
+// X64: "\01?foo_pad@@YAXPEAD@Z"
void foo_pbd(const char * x) {}
// CHECK: "\01?foo_pbd@@YAXPBD@Z"
+// X64: "\01?foo_pbd@@YAXPEBD@Z"
void foo_pcd(volatile char * x) {}
// CHECK: "\01?foo_pcd@@YAXPCD@Z"
+// X64: "\01?foo_pcd@@YAXPECD@Z"
void foo_qad(char * const x) {}
// CHECK: "\01?foo_qad@@YAXQAD@Z"
+// X64: "\01?foo_qad@@YAXQEAD@Z"
void foo_rad(char * volatile x) {}
// CHECK: "\01?foo_rad@@YAXRAD@Z"
+// X64: "\01?foo_rad@@YAXREAD@Z"
void foo_sad(char * const volatile x) {}
// CHECK: "\01?foo_sad@@YAXSAD@Z"
+// X64: "\01?foo_sad@@YAXSEAD@Z"
void foo_papad(char ** x) {}
// CHECK: "\01?foo_papad@@YAXPAPAD@Z"
+// X64: "\01?foo_papad@@YAXPEAPEAD@Z"
void foo_papbd(char const ** x) {}
// CHECK: "\01?foo_papbd@@YAXPAPBD@Z"
+// X64: "\01?foo_papbd@@YAXPEAPEBD@Z"
void foo_papcd(char volatile ** x) {}
// CHECK: "\01?foo_papcd@@YAXPAPCD@Z"
+// X64: "\01?foo_papcd@@YAXPEAPECD@Z"
void foo_pbqad(char * const* x) {}
// CHECK: "\01?foo_pbqad@@YAXPBQAD@Z"
+// X64: "\01?foo_pbqad@@YAXPEBQEAD@Z"
void foo_pcrad(char * volatile* x) {}
// CHECK: "\01?foo_pcrad@@YAXPCRAD@Z"
+// X64: "\01?foo_pcrad@@YAXPECREAD@Z"
void foo_qapad(char ** const x) {}
// CHECK: "\01?foo_qapad@@YAXQAPAD@Z"
+// X64: "\01?foo_qapad@@YAXQEAPEAD@Z"
void foo_rapad(char ** volatile x) {}
// CHECK: "\01?foo_rapad@@YAXRAPAD@Z"
+// X64: "\01?foo_rapad@@YAXREAPEAD@Z"
void foo_pbqbd(const char * const* x) {}
// CHECK: "\01?foo_pbqbd@@YAXPBQBD@Z"
+// X64: "\01?foo_pbqbd@@YAXPEBQEBD@Z"
void foo_pbqcd(volatile char * const* x) {}
// CHECK: "\01?foo_pbqcd@@YAXPBQCD@Z"
+// X64: "\01?foo_pbqcd@@YAXPEBQECD@Z"
void foo_pcrbd(const char * volatile* x) {}
// CHECK: "\01?foo_pcrbd@@YAXPCRBD@Z"
+// X64: "\01?foo_pcrbd@@YAXPECREBD@Z"
void foo_pcrcd(volatile char * volatile* x) {}
// CHECK: "\01?foo_pcrcd@@YAXPCRCD@Z"
+// X64: "\01?foo_pcrcd@@YAXPECRECD@Z"
void foo_aad(char &x) {}
// CHECK: "\01?foo_aad@@YAXAAD@Z"
+// X64: "\01?foo_aad@@YAXAEAD@Z"
void foo_abd(const char &x) {}
// CHECK: "\01?foo_abd@@YAXABD@Z"
+// X64: "\01?foo_abd@@YAXAEBD@Z"
void foo_aapad(char *&x) {}
// CHECK: "\01?foo_aapad@@YAXAAPAD@Z"
+// X64: "\01?foo_aapad@@YAXAEAPEAD@Z"
void foo_aapbd(const char *&x) {}
// CHECK: "\01?foo_aapbd@@YAXAAPBD@Z"
+// X64: "\01?foo_aapbd@@YAXAEAPEBD@Z"
void foo_abqad(char * const &x) {}
// CHECK: "\01?foo_abqad@@YAXABQAD@Z"
+// X64: "\01?foo_abqad@@YAXAEBQEAD@Z"
void foo_abqbd(const char * const &x) {}
// CHECK: "\01?foo_abqbd@@YAXABQBD@Z"
+// X64: "\01?foo_abqbd@@YAXAEBQEBD@Z"
void foo_aay144h(int (&x)[5][5]) {}
// CHECK: "\01?foo_aay144h@@YAXAAY144H@Z"
+// X64: "\01?foo_aay144h@@YAXAEAY144H@Z"
void foo_aay144cbh(const int (&x)[5][5]) {}
// CHECK: "\01?foo_aay144cbh@@YAXAAY144$$CBH@Z"
+// X64: "\01?foo_aay144cbh@@YAXAEAY144$$CBH@Z"
void foo_qay144h(int (&&x)[5][5]) {}
// CHECK: "\01?foo_qay144h@@YAX$$QAY144H@Z"
+// X64: "\01?foo_qay144h@@YAX$$QEAY144H@Z"
void foo_qay144cbh(const int (&&x)[5][5]) {}
// CHECK: "\01?foo_qay144cbh@@YAX$$QAY144$$CBH@Z"
+// X64: "\01?foo_qay144cbh@@YAX$$QEAY144$$CBH@Z"
void foo_p6ahxz(int x()) {}
// CHECK: "\01?foo_p6ahxz@@YAXP6AHXZ@Z"
+// X64: "\01?foo_p6ahxz@@YAXP6AHXZ@Z"
void foo_a6ahxz(int (&x)()) {}
// CHECK: "\01?foo_a6ahxz@@YAXA6AHXZ@Z"
+// X64: "\01?foo_a6ahxz@@YAXA6AHXZ@Z"
void foo_q6ahxz(int (&&x)()) {}
// CHECK: "\01?foo_q6ahxz@@YAX$$Q6AHXZ@Z"
+// X64: "\01?foo_q6ahxz@@YAX$$Q6AHXZ@Z"
void foo_qay04h(int x[5][5]) {}
// CHECK: "\01?foo_qay04h@@YAXQAY04H@Z"
+// X64: "\01?foo_qay04h@@YAXQEAY04H@Z"
void foo_qay04cbh(const int x[5][5]) {}
// CHECK: "\01?foo_qay04cbh@@YAXQAY04$$CBH@Z"
+// X64: "\01?foo_qay04cbh@@YAXQEAY04$$CBH@Z"
typedef double Vector[3];
void foo(Vector*) {}
// CHECK: "\01?foo@@YAXPAY02N@Z"
+// X64: "\01?foo@@YAXPEAY02N@Z"
void foo(Vector) {}
// CHECK: "\01?foo@@YAXQAN@Z"
+// X64: "\01?foo@@YAXQEAN@Z"
void foo_const(const Vector) {}
// CHECK: "\01?foo_const@@YAXQBN@Z"
+// X64: "\01?foo_const@@YAXQEBN@Z"
void foo_volatile(volatile Vector) {}
// CHECK: "\01?foo_volatile@@YAXQCN@Z"
+// X64: "\01?foo_volatile@@YAXQECN@Z"
void foo(Vector*, const Vector, const double) {}
// CHECK: "\01?foo@@YAXPAY02NQBNN@Z"
+// X64: "\01?foo@@YAXPEAY02NQEBNN@Z"
+
+typedef void (*ConstFunPtr)(int *const d);
+void foo_fnptrconst(ConstFunPtr f) { }
+// CHECK: "\01?foo_fnptrconst@@YAXP6AXQAH@Z@Z"
+// X64: "\01?foo_fnptrconst@@YAXP6AXQEAH@Z@Z"
+
+typedef void (*ArrayFunPtr)(int d[1]);
+void foo_fnptrarray(ArrayFunPtr f) { }
+// CHECK: "\01?foo_fnptrarray@@YAXP6AXQAH@Z@Z"
+// X64: "\01?foo_fnptrarray@@YAXP6AXQEAH@Z@Z"
+
+void foo_fnptrbackref1(ArrayFunPtr f1, ArrayFunPtr f2) { }
+// CHECK: "\01?foo_fnptrbackref1@@YAXP6AXQAH@Z1@Z"
+// X64: "\01?foo_fnptrbackref1@@YAXP6AXQEAH@Z1@Z"
+
+void foo_fnptrbackref2(ArrayFunPtr f1, ConstFunPtr f2) { }
+// CHECK: "\01?foo_fnptrbackref2@@YAXP6AXQAH@Z1@Z"
+// X64: "\01?foo_fnptrbackref2@@YAXP6AXQEAH@Z1@Z"
+
+typedef void (*NormalFunPtr)(int *d);
+void foo_fnptrbackref3(ArrayFunPtr f1, NormalFunPtr f2) { }
+// CHECK: "\01?foo_fnptrbackref3@@YAXP6AXQAH@Z1@Z"
+// X64: "\01?foo_fnptrbackref3@@YAXP6AXQEAH@Z1@Z"
+
+void foo_fnptrbackref4(NormalFunPtr f1, ArrayFunPtr f2) { }
+// CHECK: "\01?foo_fnptrbackref4@@YAXP6AXPAH@Z1@Z"
+// X64: "\01?foo_fnptrbackref4@@YAXP6AXPEAH@Z1@Z"
+
+ArrayFunPtr ret_fnptrarray() { return 0; }
+// CHECK: "\01?ret_fnptrarray@@YAP6AXQAH@ZXZ"
+// X64: "\01?ret_fnptrarray@@YAP6AXQEAH@ZXZ"
+
+// Test that we mangle the forward decl when we have a redeclaration with a
+// slightly different type.
+void mangle_fwd(char * const x);
+void mangle_fwd(char * x) {}
+// CHECK: "\01?mangle_fwd@@YAXQAD@Z"
+// X64: "\01?mangle_fwd@@YAXQEAD@Z"
+
+void mangle_no_fwd(char * x) {}
+// CHECK: "\01?mangle_no_fwd@@YAXPAD@Z"
+// X64: "\01?mangle_no_fwd@@YAXPEAD@Z"
+
+// The first argument gets mangled as-if it were written "int *const"
+// The second arg should not form a backref because it isn't qualified
+void mangle_no_backref0(int[], int *) {}
+// CHECK: "\01?mangle_no_backref0@@YAXQAHPAH@Z"
+// X64: "\01?mangle_no_backref0@@YAXQEAHPEAH@Z"
+
+void mangle_no_backref1(int[], int *const) {}
+// CHECK: "\01?mangle_no_backref1@@YAXQAHQAH@Z"
+// X64: "\01?mangle_no_backref1@@YAXQEAHQEAH@Z"
+
+typedef void fun_type(void);
+typedef void (*ptr_to_fun_type)(void);
+
+// Pointer to function types don't backref with function types
+void mangle_no_backref2(fun_type, ptr_to_fun_type) {}
+// CHECK: "\01?mangle_no_backref2@@YAXP6AXXZP6AXXZ@Z"
+// X64: "\01?mangle_no_backref2@@YAXP6AXXZP6AXXZ@Z"
+
+void mangle_yes_backref0(int[], int []) {}
+// CHECK: "\01?mangle_yes_backref0@@YAXQAH0@Z"
+// X64: "\01?mangle_yes_backref0@@YAXQEAH0@Z"
+
+void mangle_yes_backref1(int *const, int *const) {}
+// CHECK: "\01?mangle_yes_backref1@@YAXQAH0@Z"
+// X64: "\01?mangle_yes_backref1@@YAXQEAH0@Z"
+
+void mangle_yes_backref2(fun_type *const[], ptr_to_fun_type const[]) {}
+// CHECK: "\01?mangle_yes_backref2@@YAXQBQ6AXXZ0@Z"
+// X64: "\01?mangle_yes_backref2@@YAXQEBQ6AXXZ0@Z"
+
+void mangle_yes_backref3(ptr_to_fun_type *const, void (**const)(void)) {}
+// CHECK: "\01?mangle_yes_backref3@@YAXQAP6AXXZ0@Z"
+// X64: "\01?mangle_yes_backref3@@YAXQEAP6AXXZ0@Z"
diff --git a/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp b/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp
index fbc64923486b..e10cc8e32986 100644
--- a/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp
+++ b/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp
@@ -107,7 +107,7 @@ void call_l_foo(L* l) { l->foo(I<A>()); }
void foo(I<A> x) {}
// CHECK: "\01?foo@PR13207@@YAXV?$I@VA@PR13207@@@1@@Z"
void foo2(I<A> x, I<A> y) { }
-// CHECK "\01?foo2@PR13207@@YAXV?$I@VA@PR13207@@@1@0@Z"
+// CHECK: "\01?foo2@PR13207@@YAXV?$I@VA@PR13207@@@1@0@Z"
void bar(J<A,B> x) {}
// CHECK: "\01?bar@PR13207@@YAXV?$J@VA@PR13207@@VB@2@@1@@Z"
void spam(K<A,B,C> x) {}
@@ -163,3 +163,31 @@ void foobar(NC::Y<NB::Y<NA::Y<NA::X> > > x) {}
// CHECK: "\01?foobar@NC@PR13207@@YAXV?$Y@V?$Y@V?$Y@VX@NA@PR13207@@@NA@PR13207@@@NB@PR13207@@@12@@Z"
}
}
+
+// Function template names are not considered for backreferencing, but normal
+// function names are.
+namespace fn_space {
+struct RetVal { int hash; };
+template <typename T>
+RetVal fun_tmpl(const T &t) { return RetVal(); }
+RetVal fun_normal(int t) { return RetVal(); }
+void fun_instantiate() {
+ fun_normal(1);
+ fun_tmpl(1);
+}
+// CHECK: "\01?fun_normal@fn_space@@YA?AURetVal@1@H@Z"
+// CHECK: "\01??$fun_tmpl@H@fn_space@@YA?AURetVal@0@ABH@Z"
+
+template <typename T, RetVal (*F)(T)>
+RetVal fun_tmpl_recurse(T t) {
+ if (!t)
+ return RetVal();
+ return F(t - 1);
+}
+RetVal ident(int x) { return RetVal(); }
+void fun_instantiate2() {
+ fun_tmpl_recurse<int, fun_tmpl_recurse<int, ident> >(10);
+}
+// CHECK: "\01??$fun_tmpl_recurse@H$1??$fun_tmpl_recurse@H$1?ident@fn_space@@YA?AURetVal@2@H@Z@fn_space@@YA?AURetVal@1@H@Z@fn_space@@YA?AURetVal@0@H@Z"
+// CHECK: "\01??$fun_tmpl_recurse@H$1?ident@fn_space@@YA?AURetVal@2@H@Z@fn_space@@YA?AURetVal@0@H@Z"
+}
diff --git a/test/CodeGenCXX/mangle-ms-back-references.cpp b/test/CodeGenCXX/mangle-ms-back-references.cpp
index 5f93590cf2a2..4f1732688833 100644
--- a/test/CodeGenCXX/mangle-ms-back-references.cpp
+++ b/test/CodeGenCXX/mangle-ms-back-references.cpp
@@ -61,3 +61,8 @@ void h2(void (*f_ptr)(void *), void *arg) {}
PInt3Func h3(PInt3Func x, PInt3Func y, int* z) { return 0; }
// CHECK: "\01?h3@@YAP6APAHPAH0@ZP6APAH00@Z10@Z"
+
+namespace foo {
+void foo() { }
+// CHECK: "\01?foo@0@YAXXZ"
+}
diff --git a/test/CodeGenCXX/mangle-ms-templates.cpp b/test/CodeGenCXX/mangle-ms-templates.cpp
index 10e68248dc18..514f5739ffd5 100644
--- a/test/CodeGenCXX/mangle-ms-templates.cpp
+++ b/test/CodeGenCXX/mangle-ms-templates.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -fms-extensions -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -fdelayed-template-parsing -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -fdelayed-template-parsing -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
template<typename T>
class Class {
@@ -23,6 +24,18 @@ class IntTemplate {
IntTemplate() {}
};
+template<long long param>
+class LongLongTemplate {
+ public:
+ LongLongTemplate() {}
+};
+
+template<unsigned long long param>
+class UnsignedLongLongTemplate {
+ public:
+ UnsignedLongLongTemplate() {}
+};
+
template<>
class BoolTemplate<true> {
public:
@@ -33,65 +46,113 @@ class BoolTemplate<true> {
void template_mangling() {
Class<Typename> c1;
// CHECK: call {{.*}} @"\01??0?$Class@VTypename@@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@VTypename@@@@QEAA@XZ"
Class<const Typename> c1_const;
// CHECK: call {{.*}} @"\01??0?$Class@$$CBVTypename@@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@$$CBVTypename@@@@QEAA@XZ"
Class<volatile Typename> c1_volatile;
// CHECK: call {{.*}} @"\01??0?$Class@$$CCVTypename@@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@$$CCVTypename@@@@QEAA@XZ"
Class<const volatile Typename> c1_cv;
// CHECK: call {{.*}} @"\01??0?$Class@$$CDVTypename@@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@$$CDVTypename@@@@QEAA@XZ"
Class<Nested<Typename> > c2;
// CHECK: call {{.*}} @"\01??0?$Class@V?$Nested@VTypename@@@@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@V?$Nested@VTypename@@@@@@QEAA@XZ"
Class<int * const> c_intpc;
// CHECK: call {{.*}} @"\01??0?$Class@QAH@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@QEAH@@QEAA@XZ"
Class<int()> c_ft;
// CHECK: call {{.*}} @"\01??0?$Class@$$A6AHXZ@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@$$A6AHXZ@@QEAA@XZ"
Class<int[]> c_inti;
// CHECK: call {{.*}} @"\01??0?$Class@$$BY0A@H@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@$$BY0A@H@@QEAA@XZ"
Class<int[5]> c_int5;
// CHECK: call {{.*}} @"\01??0?$Class@$$BY04H@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@$$BY04H@@QEAA@XZ"
Class<const int[5]> c_intc5;
// CHECK: call {{.*}} @"\01??0?$Class@$$BY04$$CBH@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@$$BY04$$CBH@@QEAA@XZ"
Class<int * const[5]> c_intpc5;
// CHECK: call {{.*}} @"\01??0?$Class@$$BY04QAH@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$Class@$$BY04QEAH@@QEAA@XZ"
BoolTemplate<false> _false;
// CHECK: call {{.*}} @"\01??0?$BoolTemplate@$0A@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$BoolTemplate@$0A@@@QEAA@XZ"
BoolTemplate<true> _true;
// PR13158
_true.Foo(1);
// CHECK: call {{.*}} @"\01??0?$BoolTemplate@$00@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$BoolTemplate@$00@@QEAA@XZ"
// CHECK: call {{.*}} @"\01??$Foo@H@?$BoolTemplate@$00@@QAEXH@Z"
+// X64: call {{.*}} @"\01??$Foo@H@?$BoolTemplate@$00@@QEAAXH@Z"
IntTemplate<0> zero;
// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0A@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$0A@@@QEAA@XZ"
IntTemplate<5> five;
// CHECK: call {{.*}} @"\01??0?$IntTemplate@$04@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$04@@QEAA@XZ"
IntTemplate<11> eleven;
// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0L@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$0L@@@QEAA@XZ"
IntTemplate<256> _256;
// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0BAA@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$0BAA@@@QEAA@XZ"
IntTemplate<513> _513;
// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0CAB@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$0CAB@@@QEAA@XZ"
IntTemplate<1026> _1026;
// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0EAC@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$0EAC@@@QEAA@XZ"
IntTemplate<65535> ffff;
// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0PPPP@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$0PPPP@@@QEAA@XZ"
+
+ IntTemplate<-1> neg_1;
+// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?0@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$0?0@@QEAA@XZ"
+ IntTemplate<-9> neg_9;
+// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?8@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$0?8@@QEAA@XZ"
+ IntTemplate<-10> neg_10;
+// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?9@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$0?9@@QEAA@XZ"
+ IntTemplate<-11> neg_11;
+// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?L@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$IntTemplate@$0?L@@@QEAA@XZ"
+
+ LongLongTemplate<-9223372036854775807LL-1LL> int64_min;
+// CHECK: call {{.*}} @"\01??0?$LongLongTemplate@$0?IAAAAAAAAAAAAAAA@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$LongLongTemplate@$0?IAAAAAAAAAAAAAAA@@@QEAA@XZ"
+ LongLongTemplate<9223372036854775807LL> int64_max;
+// CHECK: call {{.*}} @"\01??0?$LongLongTemplate@$0HPPPPPPPPPPPPPPP@@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$LongLongTemplate@$0HPPPPPPPPPPPPPPP@@@QEAA@XZ"
+ UnsignedLongLongTemplate<18446744073709551615ULL> uint64_max;
+// CHECK: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QEAA@XZ"
+ UnsignedLongLongTemplate<(unsigned long long)-1> uint64_neg_1;
+// CHECK: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QAE@XZ"
+// X64: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QEAA@XZ"
}
namespace space {
template<class T> const T& foo(const T& l) { return l; }
}
// CHECK: "\01??$foo@H@space@@YAABHABH@Z"
+// X64: "\01??$foo@H@space@@YAAEBHAEBH@Z"
void use() {
space::foo(42);
@@ -108,4 +169,96 @@ void FunctionPointerTemplate() {
void spam() {
FunctionPointerTemplate<spam>();
// CHECK: "\01??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ"
+// X64: "\01??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ"
+}
+
+// Unlike Itanium, there is no character code to indicate an argument pack.
+// Tested with MSVC 2013, the first version which supports variadic templates.
+
+template <typename ...Ts> void variadic_fn_template(const Ts &...args) { }
+void variadic_fn_instantiate() {
+ variadic_fn_template(0, 1, 3, 4);
+ variadic_fn_template(0, 1, 'a', "b");
+}
+// CHECK: "\01??$variadic_fn_template@HHHH@@YAXABH000@Z"
+// CHECK: "\01??$variadic_fn_template@HHD$$BY01D@@YAXABH0ABDAAY01$$CBD@Z"
+
+template <typename ...Ts>
+struct VariadicClass {
+ VariadicClass() { }
+ int x;
+};
+void variadic_class_instantiate() {
+ VariadicClass<int, char, bool> a;
+ VariadicClass<bool, char, int> b;
+}
+// CHECK: call {{.*}} @"\01??0?$VariadicClass@HD_N@@QAE@XZ"
+// CHECK: call {{.*}} @"\01??0?$VariadicClass@_NDH@@QAE@XZ"
+
+template <typename T>
+struct Second {};
+
+template <typename T, template <class> class>
+struct Type {};
+
+template <template <class> class T>
+struct Type2 {};
+
+template <template <class> class T, bool B>
+struct Thing;
+
+template <template <class> class T>
+struct Thing<T, false> { };
+
+template <template <class> class T>
+struct Thing<T, true> { };
+
+void template_template_fun(Type<Thing<Second, true>, Second>) { }
+// CHECK: "\01?template_template_fun@@YAXU?$Type@U?$Thing@USecond@@$00@@USecond@@@@@Z"
+
+template <typename T>
+void template_template_specialization();
+
+template <>
+void template_template_specialization<void (Type<Thing<Second, true>, Second>)>() {
+}
+// CHECK: "\01??$template_template_specialization@$$A6AXU?$Type@U?$Thing@USecond@@$00@@USecond@@@@@Z@@YAXXZ"
+
+// PR16788
+template <decltype(nullptr)> struct S1 {};
+void f(S1<nullptr>) {}
+// CHECK: "\01?f@@YAXU?$S1@$0A@@@@Z"
+
+struct record {
+ int first;
+ int second;
+};
+template <const record &>
+struct type1 {
+};
+extern const record inst;
+void recref(type1<inst>) {}
+// CHECK: "\01?recref@@YAXU?$type1@$E?inst@@3Urecord@@B@@@Z"
+
+struct _GUID {};
+struct __declspec(uuid("{12345678-1234-1234-1234-1234567890aB}")) uuid;
+
+template <typename T, const _GUID *G = &__uuidof(T)>
+struct UUIDType1 {};
+
+template <typename T, const _GUID &G = __uuidof(T)>
+struct UUIDType2 {};
+
+void fun(UUIDType1<uuid> a) {}
+// CHECK: "\01?fun@@YAXU?$UUIDType1@Uuuid@@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z"
+void fun(UUIDType2<uuid> b) {}
+// CHECK: "\01?fun@@YAXU?$UUIDType2@Uuuid@@$E?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z"
+
+template <typename T> struct TypeWithFriendDefinition {
+ friend void FunctionDefinedWithInjectedName(TypeWithFriendDefinition<T>) {}
+};
+// CHECK: call {{.*}} @"\01?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z"
+void CallFunctionDefinedWithInjectedName() {
+ FunctionDefinedWithInjectedName(TypeWithFriendDefinition<int>());
}
+// CHECK: @"\01?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z"
diff --git a/test/CodeGenCXX/mangle-ms.cpp b/test/CodeGenCXX/mangle-ms.cpp
index 1b98a84823f4..68ec2b3baf68 100644
--- a/test/CodeGenCXX/mangle-ms.cpp
+++ b/test/CodeGenCXX/mangle-ms.cpp
@@ -1,57 +1,51 @@
-// RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
-// RUN: %clang_cc1 -fms-compatibility -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
-
-// CHECK: @"\01?a@@3HA"
-// CHECK: @"\01?b@N@@3HA"
-// CHECK: @"\01?anonymous@?A@N@@3HA"
-// CHECK: @c
-// CHECK: @"\01?d@foo@@0FB"
-// CHECK: @"\01?e@foo@@1JC"
-// CHECK: @"\01?f@foo@@2DD"
-// CHECK: @"\01?g@bar@@2HA"
-// CHECK: @"\01?h1@@3QAHA"
-// CHECK: @"\01?h2@@3QBHB"
-// CHECK: @"\01?i@@3PAY0BE@HA"
-// CHECK: @"\01?j@@3P6GHCE@ZA"
-// CHECK: @"\01?k@@3PTfoo@@DA"
-// CHECK: @"\01?l@@3P8foo@@AEHH@ZA"
-// CHECK: @"\01?color1@@3PANA"
-// CHECK: @"\01?color2@@3QBNB"
-// CHECK: @"\01?color3@@3QAY02$$CBNA"
-// CHECK: @"\01?color4@@3QAY02$$CBNA"
+// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 -std=c++11 | FileCheck %s
+// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 -std=c++11| FileCheck -check-prefix X64 %s
int a;
+// CHECK-DAG: @"\01?a@@3HA"
namespace N {
int b;
+// CHECK-DAG: @"\01?b@N@@3HA"
namespace {
int anonymous;
+// CHECK-DAG: @"\01?anonymous@?A@N@@3HA"
}
}
static int c;
+// CHECK-DAG: @c
+
int _c(void) {return N::anonymous + c;}
-// CHECK: @"\01?_c@@YAHXZ"
+// CHECK-DAG: @"\01?_c@@YAHXZ"
+// X64-DAG: @"\01?_c@@YAHXZ"
class foo {
static const short d;
+// CHECK-DAG: @"\01?d@foo@@0FB"
protected:
static volatile long e;
+// CHECK-DAG: @"\01?e@foo@@1JC"
public:
static const volatile char f;
+// CHECK-DAG: @"\01?f@foo@@2DD"
int operator+(int a);
foo(){}
-//CHECK: @"\01??0foo@@QAE@XZ"
+// CHECK-DAG: @"\01??0foo@@QAE@XZ"
+// X64-DAG: @"\01??0foo@@QEAA@XZ"
~foo(){}
-//CHECK: @"\01??1foo@@QAE@XZ"
+// CHECK-DAG: @"\01??1foo@@QAE@XZ"
+// X64-DAG: @"\01??1foo@@QEAA@XZ
foo(int i){}
-//CHECK: @"\01??0foo@@QAE@H@Z"
+// CHECK-DAG: @"\01??0foo@@QAE@H@Z"
+// X64-DAG: @"\01??0foo@@QEAA@H@Z"
foo(char *q){}
-//CHECK: @"\01??0foo@@QAE@PAD@Z"
+// CHECK-DAG: @"\01??0foo@@QAE@PAD@Z"
+// X64-DAG: @"\01??0foo@@QEAA@PEAD@Z"
static foo* static_method() { return 0; }
@@ -76,13 +70,16 @@ enum quux {
};
foo bar() { return foo(); }
-//CHECK: @"\01?bar@@YA?AVfoo@@XZ"
+// CHECK-DAG: @"\01?bar@@YA?AVfoo@@XZ"
+// X64-DAG: @"\01?bar@@YA?AVfoo@@XZ"
int foo::operator+(int a) {
-//CHECK: @"\01??Hfoo@@QAEHH@Z"
+// CHECK-DAG: @"\01??Hfoo@@QAEHH@Z"
+// X64-DAG: @"\01??Hfoo@@QEAAHH@Z"
foo::static_method();
-//CHECK: @"\01?static_method@foo@@SAPAV1@XZ"
+// CHECK-DAG: @"\01?static_method@foo@@SAPAV1@XZ"
+// X64-DAG: @"\01?static_method@foo@@SAPEAV1@XZ"
bar();
return a;
}
@@ -92,106 +89,278 @@ volatile long foo::e;
const volatile char foo::f = 'C';
int bar::g;
+// CHECK-DAG: @"\01?g@bar@@2HA"
extern int * const h1 = &a;
+// CHECK-DAG: @"\01?h1@@3QAHA"
extern const int * const h2 = &a;
+// CHECK-DAG: @"\01?h2@@3QBHB"
int i[10][20];
+// CHECK-DAG: @"\01?i@@3PAY0BE@HA"
int (__stdcall *j)(signed char, unsigned char);
+// CHECK-DAG: @"\01?j@@3P6GHCE@ZA"
const volatile char foo2::*k;
+// CHECK-DAG: @"\01?k@@3PTfoo@@DT1@"
+// X64-DAG: @"\01?k@@3PETfoo@@DET1@"
int (foo2::*l)(int);
+// CHECK-DAG: @"\01?l@@3P8foo@@AEHH@ZQ1@"
// Static functions are mangled, too.
// Also make sure calling conventions, arglists, and throw specs work.
static void __stdcall alpha(float a, double b) throw() {}
bool __fastcall beta(long long a, wchar_t b) throw(signed char, unsigned char) {
-// CHECK: @"\01?beta@@YI_N_J_W@Z"
+// CHECK-DAG: @"\01?beta@@YI_N_J_W@Z"
+// X64-DAG: @"\01?beta@@YA_N_J_W@Z"
alpha(0.f, 0.0);
return false;
}
-// CHECK: @"\01?alpha@@YGXMN@Z"
-// X64: @"\01?alpha@@YAXMN@Z"
+// CHECK-DAG: @"\01?alpha@@YGXMN@Z"
+// X64-DAG: @"\01?alpha@@YAXMN@Z"
// Make sure tag-type mangling works.
void gamma(class foo, struct bar, union baz, enum quux) {}
-// CHECK: @"\01?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z"
+// CHECK-DAG: @"\01?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z"
+// X64-DAG: @"\01?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z"
// Make sure pointer/reference-type mangling works.
void delta(int * const a, const long &) {}
-// CHECK: @"\01?delta@@YAXQAHABJ@Z"
+// CHECK-DAG: @"\01?delta@@YAXQAHABJ@Z"
+// X64-DAG: @"\01?delta@@YAXQEAHAEBJ@Z"
// Array mangling.
void epsilon(int a[][10][20]) {}
-// CHECK: @"\01?epsilon@@YAXQAY19BE@H@Z"
+// CHECK-DAG: @"\01?epsilon@@YAXQAY19BE@H@Z"
+// X64-DAG: @"\01?epsilon@@YAXQEAY19BE@H@Z"
void zeta(int (*)(int, int)) {}
-// CHECK: @"\01?zeta@@YAXP6AHHH@Z@Z"
+// CHECK-DAG: @"\01?zeta@@YAXP6AHHH@Z@Z"
+// X64-DAG: @"\01?zeta@@YAXP6AHHH@Z@Z"
// Blocks mangling (Clang extension). A block should be mangled slightly
// differently from a similar function pointer.
void eta(int (^)(int, int)) {}
-// CHECK: @"\01?eta@@YAXP_EAHHH@Z@Z"
+// CHECK-DAG: @"\01?eta@@YAXP_EAHHH@Z@Z"
typedef int theta_arg(int,int);
void theta(theta_arg^ block) {}
-// CHECK: @"\01?theta@@YAXP_EAHHH@Z@Z"
+// CHECK-DAG: @"\01?theta@@YAXP_EAHHH@Z@Z"
void operator_new_delete() {
char *ptr = new char;
-// CHECK: @"\01??2@YAPAXI@Z"
+// CHECK-DAG: @"\01??2@YAPAXI@Z"
delete ptr;
-// CHECK: @"\01??3@YAXPAX@Z"
+// CHECK-DAG: @"\01??3@YAXPAX@Z"
char *array = new char[42];
-// CHECK: @"\01??_U@YAPAXI@Z"
+// CHECK-DAG: @"\01??_U@YAPAXI@Z"
delete [] array;
-// CHECK: @"\01??_V@YAXPAX@Z"
+// CHECK-DAG: @"\01??_V@YAXPAX@Z"
}
// PR13022
void (redundant_parens)();
void redundant_parens_use() { redundant_parens(); }
-// CHECK: @"\01?redundant_parens@@YAXXZ"
+// CHECK-DAG: @"\01?redundant_parens@@YAXXZ"
+// X64-DAG: @"\01?redundant_parens@@YAXXZ"
// PR13047
typedef double RGB[3];
RGB color1;
+// CHECK-DAG: @"\01?color1@@3PANA"
extern const RGB color2 = {};
+// CHECK-DAG: @"\01?color2@@3QBNB"
extern RGB const color3[5] = {};
+// CHECK-DAG: @"\01?color3@@3QAY02$$CBNA"
extern RGB const ((color4)[5]) = {};
+// CHECK-DAG: @"\01?color4@@3QAY02$$CBNA"
+
+struct B;
+volatile int B::* volatile memptr1;
+// X64-DAG: @"\01?memptr1@@3RESB@@HES1@"
+volatile int B::* memptr2;
+// X64-DAG: @"\01?memptr2@@3PESB@@HES1@"
+int B::* volatile memptr3;
+// X64-DAG: @"\01?memptr3@@3REQB@@HEQ1@"
+typedef int (*fun)();
+volatile fun B::* volatile funmemptr1;
+// X64-DAG: @"\01?funmemptr1@@3RESB@@R6AHXZES1@"
+volatile fun B::* funmemptr2;
+// X64-DAG: @"\01?funmemptr2@@3PESB@@R6AHXZES1@"
+fun B::* volatile funmemptr3;
+// X64-DAG: @"\01?funmemptr3@@3REQB@@P6AHXZEQ1@"
+void (B::* volatile memptrtofun1)();
+// X64-DAG: @"\01?memptrtofun1@@3R8B@@EAAXXZEQ1@"
+const void (B::* memptrtofun2)();
+// X64-DAG: @"\01?memptrtofun2@@3P8B@@EAAXXZEQ1@"
+volatile void (B::* memptrtofun3)();
+// X64-DAG: @"\01?memptrtofun3@@3P8B@@EAAXXZEQ1@"
+int (B::* volatile memptrtofun4)();
+// X64-DAG: @"\01?memptrtofun4@@3R8B@@EAAHXZEQ1@"
+volatile int (B::* memptrtofun5)();
+// X64-DAG: @"\01?memptrtofun5@@3P8B@@EAA?CHXZEQ1@"
+const int (B::* memptrtofun6)();
+// X64-DAG: @"\01?memptrtofun6@@3P8B@@EAA?BHXZEQ1@"
+fun (B::* volatile memptrtofun7)();
+// X64-DAG: @"\01?memptrtofun7@@3R8B@@EAAP6AHXZXZEQ1@"
+volatile fun (B::* memptrtofun8)();
+// X64-DAG: @"\01?memptrtofun8@@3P8B@@EAAR6AHXZXZEQ1@"
+const fun (B::* memptrtofun9)();
+// X64-DAG: @"\01?memptrtofun9@@3P8B@@EAAQ6AHXZXZEQ1@"
// PR12603
enum E {};
-// CHECK: "\01?fooE@@YA?AW4E@@XZ"
+// CHECK-DAG: "\01?fooE@@YA?AW4E@@XZ"
+// X64-DAG: "\01?fooE@@YA?AW4E@@XZ"
E fooE() { return E(); }
class X {};
-// CHECK: "\01?fooX@@YA?AVX@@XZ"
+// CHECK-DAG: "\01?fooX@@YA?AVX@@XZ"
+// X64-DAG: "\01?fooX@@YA?AVX@@XZ"
X fooX() { return X(); }
namespace PR13182 {
extern char s0[];
- // CHECK: @"\01?s0@PR13182@@3PADA"
+ // CHECK-DAG: @"\01?s0@PR13182@@3PADA"
extern char s1[42];
- // CHECK: @"\01?s1@PR13182@@3PADA"
+ // CHECK-DAG: @"\01?s1@PR13182@@3PADA"
extern const char s2[];
- // CHECK: @"\01?s2@PR13182@@3QBDB"
+ // CHECK-DAG: @"\01?s2@PR13182@@3QBDB"
extern const char s3[42];
- // CHECK: @"\01?s3@PR13182@@3QBDB"
+ // CHECK-DAG: @"\01?s3@PR13182@@3QBDB"
extern volatile char s4[];
- // CHECK: @"\01?s4@PR13182@@3RCDC"
+ // CHECK-DAG: @"\01?s4@PR13182@@3RCDC"
extern const volatile char s5[];
- // CHECK: @"\01?s5@PR13182@@3SDDD"
+ // CHECK-DAG: @"\01?s5@PR13182@@3SDDD"
extern const char* const* s6;
- // CHECK: @"\01?s6@PR13182@@3PBQBDB"
+ // CHECK-DAG: @"\01?s6@PR13182@@3PBQBDB"
char foo() {
return s0[0] + s1[0] + s2[0] + s3[0] + s4[0] + s5[0] + s6[0][0];
}
}
+
+extern "C" inline void extern_c_func() {
+ static int local;
+// CHECK-DAG: @"\01?local@?1??extern_c_func@@9@4HA"
+// X64-DAG: @"\01?local@?1??extern_c_func@@9@4HA"
+}
+
+void call_extern_c_func() {
+ extern_c_func();
+}
+
+int main() { return 0; }
+// CHECK-DAG: @main
+// X64-DAG: @main
+
+int wmain() { return 0; }
+// CHECK-DAG: @wmain
+// X64-DAG: @wmain
+
+int WinMain() { return 0; }
+// CHECK-DAG: @WinMain
+// X64-DAG: @WinMain
+
+int wWinMain() { return 0; }
+// CHECK-DAG: @wWinMain
+// X64-DAG: @wWinMain
+
+int DllMain() { return 0; }
+// CHECK-DAG: @DllMain
+// X64-DAG: @DllMain
+
+inline int inline_function_with_local_type() {
+ static struct {
+ int a_field;
+ } static_variable_in_inline_function = { 20 }, second_static = { 40 };
+ // CHECK: @"\01?static_variable_in_inline_function@?1??inline_function_with_local_type@@YAHXZ@4U<unnamed-type-static_variable_in_inline_function>@?1??1@YAHXZ@A"
+
+ return static_variable_in_inline_function.a_field + second_static.a_field;
+}
+
+int call_inline_function_with_local_type() {
+ return inline_function_with_local_type();
+}
+
+template <typename T>
+inline int templated_inline_function_with_local_type() {
+ static struct {
+ int a_field;
+ } static_variable_in_templated_inline_function = { 20 },
+ second_static = { 40 };
+ // CHECK: @"\01?static_variable_in_templated_inline_function@?1???$templated_inline_function_with_local_type@H@@YAHXZ@4U<unnamed-type-static_variable_in_templated_inline_function>@?1???$templated_inline_function_with_local_type@H@@YAHXZ@A"
+
+ return static_variable_in_templated_inline_function.a_field +
+ second_static.a_field;
+}
+
+int call_templated_inline_function_with_local_type() {
+ return templated_inline_function_with_local_type<int>();
+}
+
+// PR17371
+struct OverloadedNewDelete {
+ // __cdecl
+ void *operator new(__SIZE_TYPE__);
+ void *operator new[](__SIZE_TYPE__);
+ void operator delete(void *);
+ void operator delete[](void *);
+ // __thiscall
+ int operator+(int);
+};
+
+void *OverloadedNewDelete::operator new(__SIZE_TYPE__ s) { return 0; }
+void *OverloadedNewDelete::operator new[](__SIZE_TYPE__ s) { return 0; }
+void OverloadedNewDelete::operator delete(void *) { }
+void OverloadedNewDelete::operator delete[](void *) { }
+int OverloadedNewDelete::operator+(int x) { return x; };
+
+// CHECK-DAG: ??2OverloadedNewDelete@@SAPAXI@Z
+// CHECK-DAG: ??_UOverloadedNewDelete@@SAPAXI@Z
+// CHECK-DAG: ??3OverloadedNewDelete@@SAXPAX@Z
+// CHECK-DAG: ??_VOverloadedNewDelete@@SAXPAX@Z
+// CHECK-DAG: ??HOverloadedNewDelete@@QAEHH@Z
+
+// X64-DAG: ??2OverloadedNewDelete@@SAPEAX_K@Z
+// X64-DAG: ??_UOverloadedNewDelete@@SAPEAX_K@Z
+// X64-DAG: ??3OverloadedNewDelete@@SAXPEAX@Z
+// X64-DAG: ??_VOverloadedNewDelete@@SAXPEAX@Z
+// X64-DAG: ??HOverloadedNewDelete@@QEAAHH@Z
+
+// Indirecting the function type through a typedef will require a calling
+// convention adjustment before building the method decl.
+
+typedef void *__thiscall OperatorNewType(__SIZE_TYPE__);
+typedef void __thiscall OperatorDeleteType(void *);
+
+struct TypedefNewDelete {
+ OperatorNewType operator new;
+ OperatorNewType operator new[];
+ OperatorDeleteType operator delete;
+ OperatorDeleteType operator delete[];
+};
+
+void *TypedefNewDelete::operator new(__SIZE_TYPE__ s) { return 0; }
+void *TypedefNewDelete::operator new[](__SIZE_TYPE__ s) { return 0; }
+void TypedefNewDelete::operator delete(void *) { }
+void TypedefNewDelete::operator delete[](void *) { }
+
+// CHECK-DAG: ??2TypedefNewDelete@@SAPAXI@Z
+// CHECK-DAG: ??_UTypedefNewDelete@@SAPAXI@Z
+// CHECK-DAG: ??3TypedefNewDelete@@SAXPAX@Z
+// CHECK-DAG: ??_VTypedefNewDelete@@SAXPAX@Z
+
+namespace PR18022 {
+
+struct { } a;
+decltype(a) fun(decltype(a) x, decltype(a)) { return x; }
+// CHECK-DAG: ?fun@PR18022@@YA?AU<unnamed-type-a>@1@U21@0@Z
+
+}
diff --git a/test/CodeGenCXX/mangle-neon-vectors.cpp b/test/CodeGenCXX/mangle-neon-vectors.cpp
index 3723deb19219..249ec2e99b69 100644
--- a/test/CodeGenCXX/mangle-neon-vectors.cpp
+++ b/test/CodeGenCXX/mangle-neon-vectors.cpp
@@ -1,6 +1,7 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple arm-none-linux-gnueabi -target-feature +neon %s -emit-llvm -o - | FileCheck %s
typedef float float32_t;
+typedef __fp16 float16_t;
typedef signed char poly8_t;
typedef short poly16_t;
typedef unsigned long long uint64_t;
@@ -11,8 +12,10 @@ typedef __attribute__((neon_vector_type(1))) uint64_t uint64x1_t;
typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t;
typedef __attribute__((neon_vector_type(2))) float32_t float32x2_t;
typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t;
-typedef __attribute__((neon_polyvector_type(16))) poly8_t poly8x16_t;
-typedef __attribute__((neon_polyvector_type(8))) poly16_t poly16x8_t;
+typedef __attribute__((neon_vector_type(4))) float16_t float16x4_t;
+typedef __attribute__((neon_vector_type(8))) float16_t float16x8_t;
+typedef __attribute__((neon_polyvector_type(16))) poly8_t poly8x16_t;
+typedef __attribute__((neon_polyvector_type(8))) poly16_t poly16x8_t;
// CHECK: 16__simd64_int32_t
void f1(int32x2_t v) { }
@@ -26,7 +29,11 @@ void f4(uint64x2_t v) { }
void f5(float32x2_t v) { }
// CHECK: 19__simd128_float32_t
void f6(float32x4_t v) { }
+// CHECK: 18__simd64_float16_t
+void f7(float16x4_t v) {}
+// CHECK: 19__simd128_float16_t
+void f8(float16x8_t v) {}
// CHECK: 17__simd128_poly8_t
-void f7(poly8x16_t v) { }
+void f9(poly8x16_t v) {}
// CHECK: 18__simd128_poly16_t
-void f8(poly16x8_t v) { }
+void f10(poly16x8_t v) {}
diff --git a/test/CodeGenCXX/mangle-nullptr-arg.cpp b/test/CodeGenCXX/mangle-nullptr-arg.cpp
index 07bf52fc9067..b55ea6dd2dd4 100644
--- a/test/CodeGenCXX/mangle-nullptr-arg.cpp
+++ b/test/CodeGenCXX/mangle-nullptr-arg.cpp
@@ -2,15 +2,15 @@
template<int *ip> struct IP {};
-// CHECK: define void @_Z5test12IPILPi0EE
+// CHECK-LABEL: define void @_Z5test12IPILPi0EE
void test1(IP<nullptr>) {}
struct X{ };
template<int X::*pm> struct PM {};
-// CHECK: define void @_Z5test22PMILM1Xi0EE
+// CHECK-LABEL: define void @_Z5test22PMILM1Xi0EE
void test2(PM<nullptr>) { }
-// CHECK: define void @_Z5test316DependentTypePtrIPiLS0_0EE
+// CHECK-LABEL: define void @_Z5test316DependentTypePtrIPiLS0_0EE
template<typename T, T x> struct DependentTypePtr {};
void test3(DependentTypePtr<int*,nullptr>) { }
diff --git a/test/CodeGenCXX/mangle-ref-qualifiers.cpp b/test/CodeGenCXX/mangle-ref-qualifiers.cpp
index ce2af502e482..4552c93ea686 100644
--- a/test/CodeGenCXX/mangle-ref-qualifiers.cpp
+++ b/test/CodeGenCXX/mangle-ref-qualifiers.cpp
@@ -5,17 +5,17 @@ struct X {
int h() const &&;
};
-// CHECK: define i32 @_ZNR1X1fEv
+// CHECK-LABEL: define i32 @_ZNR1X1fEv
int X::f() & { return 0; }
-// CHECK: define i32 @_ZNO1X1gEv
+// CHECK-LABEL: define i32 @_ZNO1X1gEv
int X::g() && { return 0; }
-// CHECK: define i32 @_ZNKO1X1hEv
+// CHECK-LABEL: define i32 @_ZNKO1X1hEv
int X::h() const && { return 0; }
-// CHECK: define void @_Z1fM1XFivREMS_FivOEMS_KFivOE
+// CHECK-LABEL: define void @_Z1fM1XFivREMS_FivOEMS_KFivOE
void f(int (X::*)() &, int (X::*)() &&, int (X::*)() const&&) { }
-// CHECK: define void @_Z1g1AIFivEES_IFivREES_IFivOEES_IKFivEES_IKFivREES_IKFivOEES_IVKFivEES_IVKFivREES_IVKFivOEE()
+// CHECK-LABEL: define void @_Z1g1AIFivEES_IFivREES_IFivOEES_IKFivEES_IKFivREES_IKFivOEES_IVKFivEES_IVKFivREES_IVKFivOEE()
template <class T> struct A {};
void g(A<int()>, A<int()&>, A<int()&&>,
A<int() const>, A<int() const &>, A<int() const &&>,
diff --git a/test/CodeGenCXX/mangle-subst-std.cpp b/test/CodeGenCXX/mangle-subst-std.cpp
index 04e3e84304e8..6277c7af21c4 100644
--- a/test/CodeGenCXX/mangle-subst-std.cpp
+++ b/test/CodeGenCXX/mangle-subst-std.cpp
@@ -15,8 +15,8 @@
namespace std {
struct A { A(); };
- // CHECK: define void @_ZNSt1AC1Ev(%"struct.std::A"* %this) unnamed_addr
- // CHECK: define void @_ZNSt1AC2Ev(%"struct.std::A"* %this) unnamed_addr
+ // CHECK-LABEL: define void @_ZNSt1AC1Ev(%"struct.std::A"* %this) unnamed_addr
+ // CHECK-LABEL: define void @_ZNSt1AC2Ev(%"struct.std::A"* %this) unnamed_addr
A::A() { }
};
@@ -24,14 +24,14 @@ namespace std {
template<typename> struct allocator { };
}
-// CHECK: define void @_Z1fSaIcESaIiE
+// CHECK-LABEL: define void @_Z1fSaIcESaIiE
void f(std::allocator<char>, std::allocator<int>) { }
namespace std {
template<typename, typename, typename> struct basic_string { };
}
-// CHECK: define void @_Z1fSbIcciE
+// CHECK-LABEL: define void @_Z1fSbIcciE
void f(std::basic_string<char, char, int>) { }
namespace std {
@@ -90,7 +90,7 @@ namespace std
}
// Make sure we don't treat the following like std::string
-// CHECK: define void @_Z1f12basic_stringIcSt11char_traitsIcESaIcEE
+// CHECK-LABEL: define void @_Z1f12basic_stringIcSt11char_traitsIcESaIcEE
template<typename, typename, typename> struct basic_string { };
typedef basic_string<char, std::char_traits<char>, std::allocator<char> > not_string;
void f(not_string) { }
@@ -106,7 +106,7 @@ namespace N {
namespace std {
struct A { void f(); };
- // CHECK: define void @_ZN1N3std1A1fEv
+ // CHECK-LABEL: define void @_ZN1N3std1A1fEv
void A::f() { }
}
}
diff --git a/test/CodeGenCXX/mangle-subst.cpp b/test/CodeGenCXX/mangle-subst.cpp
index d83a081dd76a..30360aeae317 100644
--- a/test/CodeGenCXX/mangle-subst.cpp
+++ b/test/CodeGenCXX/mangle-subst.cpp
@@ -2,19 +2,19 @@
struct X {};
-// CHECK: define void @_Z1f1XS_(
+// CHECK-LABEL: define void @_Z1f1XS_(
void f(X, X) { }
-// CHECK: define void @_Z1fR1XS0_(
+// CHECK-LABEL: define void @_Z1fR1XS0_(
void f(X&, X&) { }
-// CHECK: define void @_Z1fRK1XS1_(
+// CHECK-LABEL: define void @_Z1fRK1XS1_(
void f(const X&, const X&) { }
typedef void T();
struct S {};
-// CHECK: define void @_Z1fPFvvEM1SFvvE(
+// CHECK-LABEL: define void @_Z1fPFvvEM1SFvvE(
void f(T*, T (S::*)) {}
namespace A {
@@ -22,14 +22,14 @@ namespace A {
struct B { };
};
-// CHECK: define void @_Z1fN1A1AENS_1BE(
+// CHECK-LABEL: define void @_Z1fN1A1AENS_1BE(
void f(A::A a, A::B b) { }
struct C {
struct D { };
};
-// CHECK: define void @_Z1fN1C1DERS_PS_S1_(
+// CHECK-LABEL: define void @_Z1fN1C1DERS_PS_S1_(
void f(C::D, C&, C*, C&) { }
template<typename T>
diff --git a/test/CodeGenCXX/mangle-system-header.cpp b/test/CodeGenCXX/mangle-system-header.cpp
index 6716b58926d7..3ab5f96f6239 100644
--- a/test/CodeGenCXX/mangle-system-header.cpp
+++ b/test/CodeGenCXX/mangle-system-header.cpp
@@ -3,9 +3,9 @@
// PR5420
# 1 "fake_system_header.h" 1 3 4
-// CHECK: define void @_ZdlPvS_(
+// CHECK-LABEL: define void @_ZdlPvS_(
void operator delete (void*, void*) {}
// PR6217
-// CHECK: define void @_Z3barv()
+// CHECK-LABEL: define void @_Z3barv()
void bar() { }
diff --git a/test/CodeGenCXX/mangle-template.cpp b/test/CodeGenCXX/mangle-template.cpp
index 15a85c7bd2e5..3b7f3027f6c2 100644
--- a/test/CodeGenCXX/mangle-template.cpp
+++ b/test/CodeGenCXX/mangle-template.cpp
@@ -82,7 +82,7 @@ namespace test7 {
X(U*, typename int_c<(meta<T>::value + meta<U>::value)>::type *) { }
};
- // CHECK: define weak_odr {{.*}} @_ZN5test71XIiEC1IdEEPT_PNS_5int_cIXplL_ZNS_4metaIiE5valueEEsr4metaIS3_EE5valueEE4typeE(%"struct.test7::X"* %this, double*, float*) unnamed_addr
+ // CHECK: define weak_odr {{.*}} @_ZN5test71XIiEC1IdEEPT_PNS_5int_cIXplL_ZNS_4metaIiE5valueEEsr4metaIS3_EE5valueEE4typeE(
template X<int>::X(double*, float*);
}
@@ -101,7 +101,7 @@ namespace test8 {
template<typename T>
void f(int_c<meta<T>::type::value>) { }
- // CHECK: define weak_odr void @_ZN5test81fIiEEvNS_5int_cIXsr4metaIT_E4typeE5valueEEE
+ // CHECK-LABEL: define weak_odr void @_ZN5test81fIiEEvNS_5int_cIXsr4metaIT_E4typeE5valueEEE(
template void f<int>(int_c<sizeof(int)>);
}
@@ -160,13 +160,13 @@ namespace test12 {
const int n = 10;
template<typename T, T v> void test() {}
void use() {
- // CHECK: define internal void @_ZN6test124testIFivEXadL_ZNS_L1fEvEEEEvv(
+ // CHECK-LABEL: define internal void @_ZN6test124testIFivEXadL_ZNS_L1fEvEEEEvv(
test<int(), &f>();
- // CHECK: define internal void @_ZN6test124testIRFivELZNS_L1fEvEEEvv(
+ // CHECK-LABEL: define internal void @_ZN6test124testIRFivELZNS_L1fEvEEEvv(
test<int(&)(), f>();
- // CHECK: define internal void @_ZN6test124testIPKiXadL_ZNS_L1nEEEEEvv(
+ // CHECK-LABEL: define internal void @_ZN6test124testIPKiXadL_ZNS_L1nEEEEEvv(
test<const int*, &n>();
- // CHECK: define internal void @_ZN6test124testIRKiLZNS_L1nEEEEvv(
+ // CHECK-LABEL: define internal void @_ZN6test124testIRKiLZNS_L1nEEEEvv(
test<const int&, n>();
}
}
diff --git a/test/CodeGenCXX/mangle-unnamed.cpp b/test/CodeGenCXX/mangle-unnamed.cpp
index 53f381c3a011..a62bdd5393c4 100644
--- a/test/CodeGenCXX/mangle-unnamed.cpp
+++ b/test/CodeGenCXX/mangle-unnamed.cpp
@@ -80,7 +80,7 @@ template <class T> struct Test8 {
template <class T> void make_test8(T value) { Test8<T> t(value); }
void test8() { make_test8(T8); }
-// CHECK: define internal void @"_ZNV3$_35test9Ev"(
+// CHECK-LABEL: define internal void @"_ZNV3$_35test9Ev"(
typedef volatile struct {
void test9() volatile {}
} Test9;
@@ -89,4 +89,4 @@ void test9() {
a.test9();
}
-// CHECK: define internal void @"_ZN5Test8I3$_2EC1ES0_"(
+// CHECK-LABEL: define internal void @"_ZN5Test8I3$_2EC1ES0_"(
diff --git a/test/CodeGenCXX/mangle-valist.cpp b/test/CodeGenCXX/mangle-valist.cpp
index 73fd58e75e8a..0fcc1db73108 100644
--- a/test/CodeGenCXX/mangle-valist.cpp
+++ b/test/CodeGenCXX/mangle-valist.cpp
@@ -15,30 +15,30 @@ void Test2::test2(const char *fmt, va_list ap) {
// RUN: %clang_cc1 %s -emit-llvm -o - \
// RUN: -triple armv7-unknown-linux \
-// RUN: | FileCheck -check-prefix=MANGLE-ARM-AAPCS %s
+// RUN: | FileCheck -check-prefix=CHECK-MANGLE-ARM-AAPCS %s
// CHECK-MANGLE-ARM-AAPCS: @_ZN5test15test1EPKcSt9__va_list
// CHECK-MANGLE-ARM-AAPCS: @_ZN5Test25test2EPKcSt9__va_list
// RUN: %clang_cc1 %s -emit-llvm -o - \
// RUN: -triple armv7-unknown-linux -target-abi apcs-gnu \
-// RUN: | FileCheck -check-prefix=MANGLE-ARM-APCS %s
+// RUN: | FileCheck -check-prefix=CHECK-MANGLE-ARM-APCS %s
// CHECK-MANGLE-ARM-APCS: @_ZN5test15test1EPKcPv
// CHECK-MANGLE-ARM-APCS: @_ZN5Test25test2EPKcPv
// RUN: %clang_cc1 %s -emit-llvm -o - \
// RUN: -triple mipsel-unknown-linux \
-// RUN: | FileCheck -check-prefix=MANGLE-MIPSEL %s
+// RUN: | FileCheck -check-prefix=CHECK-MANGLE-MIPSEL %s
// CHECK-MANGLE-MIPSEL: @_ZN5test15test1EPKcPv
// CHECK-MANGLE-MIPSEL: @_ZN5Test25test2EPKcPv
// RUN: %clang_cc1 %s -emit-llvm -o - \
// RUN: -triple i686-unknown-linux \
-// RUN: | FileCheck -check-prefix=MANGLE-X86 %s
+// RUN: | FileCheck -check-prefix=CHECK-MANGLE-X86 %s
// CHECK-MANGLE-X86: @_ZN5test15test1EPKcPc
// CHECK-MANGLE-X86: @_ZN5Test25test2EPKcPc
// RUN: %clang_cc1 %s -emit-llvm -o - \
// RUN: -triple x86_64-unknown-linux \
-// RUN: | FileCheck -check-prefix=MANGLE-X86-64 %s
+// RUN: | FileCheck -check-prefix=CHECK-MANGLE-X86-64 %s
// CHECK-MANGLE-X86-64: @_ZN5test15test1EPKcP13__va_list_tag
// CHECK-MANGLE-X86-64: @_ZN5Test25test2EPKcP13__va_list_tag
diff --git a/test/CodeGenCXX/mangle-variadic-templates.cpp b/test/CodeGenCXX/mangle-variadic-templates.cpp
index b5bdae234445..264cc113cd57 100644
--- a/test/CodeGenCXX/mangle-variadic-templates.cpp
+++ b/test/CodeGenCXX/mangle-variadic-templates.cpp
@@ -9,59 +9,59 @@ template<typename ...Types> struct tuple { };
template<int ...Values> struct int_tuple { };
template<template<typename> class ...Templates> struct template_tuple { };
-// CHECK: define weak_odr void @_Z2f0IJEEv1XIXsZT_EJDpRT_EE
+// CHECK-LABEL: define weak_odr void @_Z2f0IJEEv1XIXsZT_EJDpRT_EE
template<typename ...Types>
void f0(X<sizeof...(Types), Types&...>) { }
template void f0(X<0>);
-// CHECK: define weak_odr void @_Z2f0IJifdEEv1XIXsZT_EJDpRT_EE
+// CHECK-LABEL: define weak_odr void @_Z2f0IJifdEEv1XIXsZT_EJDpRT_EE
template void f0<int, float, double>(X<3, int&, float&, double&>);
// Mangling for template argument packs
template<typename ...Types> void f1() {}
-// CHECK: define weak_odr void @_Z2f1IJEEvv
+// CHECK-LABEL: define weak_odr void @_Z2f1IJEEvv
template void f1<>();
-// CHECK: define weak_odr void @_Z2f1IJiEEvv
+// CHECK-LABEL: define weak_odr void @_Z2f1IJiEEvv
template void f1<int>();
-// CHECK: define weak_odr void @_Z2f1IJifEEvv
+// CHECK-LABEL: define weak_odr void @_Z2f1IJifEEvv
template void f1<int, float>();
// Mangling function parameter packs
template<typename ...Types> void f2(Types...) {}
-// CHECK: define weak_odr void @_Z2f2IJEEvDpT_
+// CHECK-LABEL: define weak_odr void @_Z2f2IJEEvDpT_
template void f2<>();
-// CHECK: define weak_odr void @_Z2f2IJiEEvDpT_
+// CHECK-LABEL: define weak_odr void @_Z2f2IJiEEvDpT_
template void f2<int>(int);
-// CHECK: define weak_odr void @_Z2f2IJifEEvDpT_
+// CHECK-LABEL: define weak_odr void @_Z2f2IJifEEvDpT_
template void f2<int, float>(int, float);
// Mangling non-trivial function parameter packs
template<typename ...Types> void f3(const Types *...) {}
-// CHECK: define weak_odr void @_Z2f3IJEEvDpPKT_
+// CHECK-LABEL: define weak_odr void @_Z2f3IJEEvDpPKT_
template void f3<>();
-// CHECK: define weak_odr void @_Z2f3IJiEEvDpPKT_
+// CHECK-LABEL: define weak_odr void @_Z2f3IJiEEvDpPKT_
template void f3<int>(const int*);
-// CHECK: define weak_odr void @_Z2f3IJifEEvDpPKT_
+// CHECK-LABEL: define weak_odr void @_Z2f3IJifEEvDpPKT_
template void f3<int, float>(const int*, const float*);
// Mangling of type pack expansions in a template argument
template<typename ...Types> tuple<Types...> f4() {}
-// CHECK: define weak_odr void @_Z2f4IJifdEE5tupleIJDpT_EEv
+// CHECK-LABEL: define weak_odr void @_Z2f4IJifdEE5tupleIJDpT_EEv
template tuple<int, float, double> f4();
// Mangling of type pack expansions in a function type
template<typename R, typename ...ArgTypes> identity<R(ArgTypes...)> f5() {}
-// CHECK: define weak_odr void @_Z2f5IiJifdEE8identityIFT_DpT0_EEv
+// CHECK-LABEL: define weak_odr void @_Z2f5IiJifdEE8identityIFT_DpT0_EEv
template identity<int(int, float, double)> f5();
// Mangling of non-type template argument expansions
template<int ...Values> int_tuple<Values...> f6() {}
-// CHECK: define weak_odr void @_Z2f6IJLi1ELi2ELi3EEE9int_tupleIJXspT_EEEv
+// CHECK-LABEL: define weak_odr void @_Z2f6IJLi1ELi2ELi3EEE9int_tupleIJXspT_EEEv
template int_tuple<1, 2, 3> f6();
// Mangling of template template argument expansions
template<template<typename> class ...Templates>
template_tuple<Templates...> f7() {}
-// CHECK: define weak_odr void @_Z2f7IJ8identity13add_referenceEE14template_tupleIJDpT_EEv
+// CHECK-LABEL: define weak_odr void @_Z2f7IJ8identity13add_referenceEE14template_tupleIJDpT_EEv
template template_tuple<identity, add_reference> f7();
diff --git a/test/CodeGenCXX/mangle-windows.cpp b/test/CodeGenCXX/mangle-windows.cpp
new file mode 100644
index 000000000000..c087616875c7
--- /dev/null
+++ b/test/CodeGenCXX/mangle-windows.cpp
@@ -0,0 +1,42 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft \
+// RUN: -triple=i386-pc-win32 | FileCheck --check-prefix=WIN %s
+//
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-mingw32 | \
+// RUN: FileCheck --check-prefix=ITANIUM %s
+
+void __stdcall f1(void) {}
+// WIN: define x86_stdcallcc void @"\01?f1@@YGXXZ"
+// ITANIUM: define x86_stdcallcc void @"\01__Z2f1v@0"
+
+void __fastcall f2(void) {}
+// WIN: define x86_fastcallcc void @"\01?f2@@YIXXZ"
+// ITANIUM: define x86_fastcallcc void @"\01@_Z2f2v@0"
+
+extern "C" void __stdcall f3(void) {}
+// WIN: define x86_stdcallcc void @"\01_f3@0"
+// ITANIUM: define x86_stdcallcc void @"\01_f3@0"
+
+extern "C" void __fastcall f4(void) {}
+// WIN: define x86_fastcallcc void @"\01@f4@0"
+// ITANIUM: define x86_fastcallcc void @"\01@f4@0"
+
+struct Foo {
+ void __stdcall foo();
+ static void __stdcall bar();
+};
+
+void Foo::foo() {}
+// WIN: define x86_stdcallcc void @"\01?foo@Foo@@QAGXXZ"
+// ITANIUM: define x86_stdcallcc void @"\01__ZN3Foo3fooEv@4"
+
+void Foo::bar() {}
+// WIN: define x86_stdcallcc void @"\01?bar@Foo@@SGXXZ"
+// ITANIUM: define x86_stdcallcc void @"\01__ZN3Foo3barEv@0"
+
+// Mostly a test that we don't crash and that the names start with a \01.
+// gcc on mingw produces __Zpp@4
+// cl produces _++@4
+extern "C" void __stdcall operator++(Foo &x) {
+}
+// WIN: define x86_stdcallcc void @"\01??E@YGXAAUFoo@@@Z"
+// ITANIUM: define x86_stdcallcc void @"\01__ZppR3Foo@4"
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp
index e7955a8ed910..d836f36c1818 100644
--- a/test/CodeGenCXX/mangle.cpp
+++ b/test/CodeGenCXX/mangle.cpp
@@ -9,37 +9,37 @@ struct Y { };
// CHECK: @_ZGVZN1N1gEvE1a = internal global
//CHECK: @pr5966_i = external global
-//CHECK: @_ZL8pr5966_i = internal global
+//CHECK: @_ZL8pr5966_j = internal global
-// CHECK: define zeroext i1 @_ZplRK1YRA100_P1X
+// CHECK-LABEL: define zeroext i1 @_ZplRK1YRA100_P1X
bool operator+(const Y&, X* (&xs)[100]) { return false; }
-// CHECK: define void @_Z1f1s
+// CHECK-LABEL: define void @_Z1f1s
typedef struct { int a; } s;
void f(s) { }
-// CHECK: define void @_Z1f1e
+// CHECK-LABEL: define void @_Z1f1e
typedef enum { foo } e;
void f(e) { }
-// CHECK: define void @_Z1f1u
+// CHECK-LABEL: define void @_Z1f1u
typedef union { int a; } u;
void f(u) { }
-// CHECK: define void @_Z1f1x
+// CHECK-LABEL: define void @_Z1f1x
typedef struct { int a; } x,y;
void f(y) { }
-// CHECK: define void @_Z1fv
+// CHECK-LABEL: define void @_Z1fv
void f() { }
-// CHECK: define void @_ZN1N1fEv
+// CHECK-LABEL: define void @_ZN1N1fEv
namespace N { void f() { } }
-// CHECK: define void @_ZN1N1N1fEv
+// CHECK-LABEL: define void @_ZN1N1N1fEv
namespace N { namespace N { void f() { } } }
-// CHECK: define void @unmangled_function
+// CHECK-LABEL: define void @unmangled_function
extern "C" { namespace N { void unmangled_function() { } } }
extern "C" { namespace N { int unmangled_variable = 10; } }
@@ -50,41 +50,41 @@ namespace N { int f(int, int) { static int b; return b; } }
namespace N { int h(); void g() { static int a = h(); } }
-// CHECK: define void @_Z1fno
+// CHECK-LABEL: define void @_Z1fno
void f(__int128_t, __uint128_t) { }
template <typename T> struct S1 {};
-// CHECK: define void @_Z1f2S1IiE
+// CHECK-LABEL: define void @_Z1f2S1IiE
void f(S1<int>) {}
-// CHECK: define void @_Z1f2S1IdE
+// CHECK-LABEL: define void @_Z1f2S1IdE
void f(S1<double>) {}
template <int N> struct S2 {};
-// CHECK: define void @_Z1f2S2ILi100EE
+// CHECK-LABEL: define void @_Z1f2S2ILi100EE
void f(S2<100>) {}
-// CHECK: define void @_Z1f2S2ILin100EE
+// CHECK-LABEL: define void @_Z1f2S2ILin100EE
void f(S2<-100>) {}
template <bool B> struct S3 {};
-// CHECK: define void @_Z1f2S3ILb1EE
+// CHECK-LABEL: define void @_Z1f2S3ILb1EE
void f(S3<true>) {}
-// CHECK: define void @_Z1f2S3ILb0EE
+// CHECK-LABEL: define void @_Z1f2S3ILb0EE
void f(S3<false>) {}
struct S;
-// CHECK: define void @_Z1fM1SKFvvE
+// CHECK-LABEL: define void @_Z1fM1SKFvvE
void f(void (S::*)() const) {}
-// CHECK: define void @_Z1fM1SFvvE
+// CHECK-LABEL: define void @_Z1fM1SFvvE
void f(void (S::*)()) {}
-// CHECK: define void @_Z1fi
+// CHECK-LABEL: define void @_Z1fi
void f(const int) { }
template<typename T, typename U> void ft1(U u, T t) { }
@@ -238,7 +238,7 @@ template<bool, typename> struct __enable_if {};
template<typename T> struct __enable_if<true, T> { typedef T __type; };
template<typename T>
-// CHECK: define linkonce_odr void @_ZN6PR57968__fill_aIiEENS_11__enable_ifIXntsr16__is_scalar_typeIT_EE7__valueEvE6__typeEv
+// CHECK-LABEL: define linkonce_odr void @_ZN6PR57968__fill_aIiEENS_11__enable_ifIXntsr16__is_scalar_typeIT_EE7__valueEvE6__typeEv
typename __enable_if<!__is_scalar_type<T>::__value, void>::__type __fill_a() { };
void f() { __fill_a<int>(); }
@@ -247,26 +247,26 @@ void f() { __fill_a<int>(); }
namespace Expressions {
// Unary operators.
-// CHECK: define weak_odr void @_ZN11Expressions2f1ILi1EEEvPAplngT_Li2E_i
+// CHECK-LABEL: define weak_odr void @_ZN11Expressions2f1ILi1EEEvPAplngT_Li2E_i
template <int i> void f1(int (*)[(-i) + 2]) { };
template void f1<1>(int (*)[1]);
-// CHECK: define weak_odr void @_ZN11Expressions2f2ILi1EEEvPApsT__i
+// CHECK-LABEL: define weak_odr void @_ZN11Expressions2f2ILi1EEEvPApsT__i
template <int i> void f2(int (*)[+i]) { };
template void f2<1>(int (*)[1]);
// Binary operators.
-// CHECK: define weak_odr void @_ZN11Expressions2f3ILi1EEEvPAplT_T__i
+// CHECK-LABEL: define weak_odr void @_ZN11Expressions2f3ILi1EEEvPAplT_T__i
template <int i> void f3(int (*)[i+i]) { };
template void f3<1>(int (*)[2]);
-// CHECK: define weak_odr void @_ZN11Expressions2f4ILi1EEEvPAplplLi2ET_T__i
+// CHECK-LABEL: define weak_odr void @_ZN11Expressions2f4ILi1EEEvPAplplLi2ET_T__i
template <int i> void f4(int (*)[2 + i+i]) { };
template void f4<1>(int (*)[4]);
// The ternary operator.
-// CHECK: define weak_odr void @_ZN11Expressions2f4ILb1EEEvPAquT_Li1ELi2E_i
+// CHECK-LABEL: define weak_odr void @_ZN11Expressions2f4ILb1EEEvPAquT_Li1ELi2E_i
template <bool b> void f4(int (*)[b ? 1 : 2]) { };
template void f4<true>(int (*)[1]);
}
@@ -280,13 +280,13 @@ struct Ops {
void *v;
};
-// CHECK: define %struct.Ops* @_ZN3OpsplERKS_
+// CHECK-LABEL: define %struct.Ops* @_ZN3OpsplERKS_
Ops& Ops::operator+(const Ops&) { return *this; }
-// CHECK: define %struct.Ops* @_ZN3OpsmiERKS_
+// CHECK-LABEL: define %struct.Ops* @_ZN3OpsmiERKS_
Ops& Ops::operator-(const Ops&) { return *this; }
-// CHECK: define %struct.Ops* @_ZN3OpsanERKS_
+// CHECK-LABEL: define %struct.Ops* @_ZN3OpsanERKS_
Ops& Ops::operator&(const Ops&) { return *this; }
-// CHECK: define %struct.Ops* @_ZN3OpsmlERKS_
+// CHECK-LABEL: define %struct.Ops* @_ZN3OpsmlERKS_
Ops& Ops::operator*(const Ops&) { return *this; }
// PR5861
@@ -302,11 +302,11 @@ template<typename T, typename = Policy<P, true> > class Alloc
T *allocate(int, const void*) { return 0; }
};
-// CHECK: define weak_odr i8* @_ZN6PR58615AllocIcNS_6PolicyINS_1PELb1EEEE8allocateEiPKv
+// CHECK-LABEL: define weak_odr i8* @_ZN6PR58615AllocIcNS_6PolicyINS_1PELb1EEEE8allocateEiPKv
template class Alloc<char>;
}
-// CHECK: define void @_Z1fU13block_pointerFiiiE
+// CHECK-LABEL: define void @_Z1fU13block_pointerFiiiE
void f(int (^)(int, int)) { }
void pr5966_foo() {
@@ -314,10 +314,10 @@ void pr5966_foo() {
pr5966_i = 0;
}
-static int pr5966_i;
+static int pr5966_j;
void pr5966_bar() {
- pr5966_i = 0;
+ pr5966_j = 0;
}
namespace test0 {
@@ -330,29 +330,29 @@ namespace test0 {
char buffer[1];
f(0.0, buffer);
}
- // CHECK: define void @_ZN5test05test0Ev()
- // CHECK: define linkonce_odr void @_ZN5test01fIdEEvT_RAszcl3ovlcvS1__EE_c(
+ // CHECK-LABEL: define void @_ZN5test05test0Ev()
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test01fIdEEvT_RAszcl3ovlcvS1__EE_c(
void test1() {
char buffer[sizeof(int)];
f(1, buffer);
}
- // CHECK: define void @_ZN5test05test1Ev()
- // CHECK: define linkonce_odr void @_ZN5test01fIiEEvT_RAszcl3ovlcvS1__EE_c(
+ // CHECK-LABEL: define void @_ZN5test05test1Ev()
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test01fIiEEvT_RAszcl3ovlcvS1__EE_c(
template <class T> void g(char (&buffer)[sizeof(T() + 5.0f)]) {}
void test2() {
char buffer[sizeof(float)];
g<float>(buffer);
}
- // CHECK: define linkonce_odr void @_ZN5test01gIfEEvRAszplcvT__ELf40a00000E_c(
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test01gIfEEvRAszplcvT__ELf40a00000E_c(
template <class T> void h(char (&buffer)[sizeof(T() + 5.0)]) {}
void test3() {
char buffer[sizeof(double)];
h<float>(buffer);
}
- // CHECK: define linkonce_odr void @_ZN5test01hIfEEvRAszplcvT__ELd4014000000000000E_c(
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test01hIfEEvRAszplcvT__ELd4014000000000000E_c(
template <class T> void j(char (&buffer)[sizeof(T().buffer)]) {}
struct A { double buffer[128]; };
@@ -360,25 +360,25 @@ namespace test0 {
char buffer[1024];
j<A>(buffer);
}
- // CHECK: define linkonce_odr void @_ZN5test01jINS_1AEEEvRAszdtcvT__E6buffer_c(
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test01jINS_1AEEEvRAszdtcvT__E6buffer_c(
template <class T> void k(char (&buffer)[sizeof(T() + 0.0f)]) {}
void test5() {
char buffer[sizeof(float)];
k<float>(buffer);
}
- // CHECK: define linkonce_odr void @_ZN5test01kIfEEvRAszplcvT__ELf00000000E_c(
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test01kIfEEvRAszplcvT__ELf00000000E_c(
}
namespace test1 {
template<typename T> struct X { };
template<template<class> class Y, typename T> void f(Y<T>) { }
- // CHECK: define weak_odr void @_ZN5test11fINS_1XEiEEvT_IT0_E
+ // CHECK-LABEL: define weak_odr void @_ZN5test11fINS_1XEiEEvT_IT0_E
template void f(X<int>);
}
-// CHECK: define internal void @_ZL27functionWithInternalLinkagev()
+// CHECK-LABEL: define internal void @_ZL27functionWithInternalLinkagev()
static void functionWithInternalLinkage() { }
void g() { functionWithInternalLinkage(); }
@@ -392,7 +392,7 @@ namespace test2 {
return read_member(obj);
}
- // CHECK: define linkonce_odr i32 @_ZN5test211read_memberINS_1AEEEDtptcvPT_Li0E6memberERS2_(
+ // CHECK-LABEL: define linkonce_odr i32 @_ZN5test211read_memberINS_1AEEEDtptcvPT_Li0E6memberERS2_(
}
// rdar://problem/9280586
@@ -402,16 +402,16 @@ namespace test3 {
struct Path2 : AmbiguousBase { double p; };
struct Derived : Path1, Path2 { };
- // CHECK: define linkonce_odr i32 @_ZN5test38get_ab_1INS_7DerivedEEEDtptcvPT_Li0Esr5Path1E2abERS2_(
+ // CHECK-LABEL: define linkonce_odr i32 @_ZN5test38get_ab_1INS_7DerivedEEEDtptcvPT_Li0Esr5Path1E2abERS2_(
template <class T> decltype(((T*) 0)->Path1::ab) get_ab_1(T &ref) { return ref.Path1::ab; }
- // CHECK: define linkonce_odr i32 @_ZN5test38get_ab_2INS_7DerivedEEEDtptcvPT_Li0Esr5Path2E2abERS2_(
+ // CHECK-LABEL: define linkonce_odr i32 @_ZN5test38get_ab_2INS_7DerivedEEEDtptcvPT_Li0Esr5Path2E2abERS2_(
template <class T> decltype(((T*) 0)->Path2::ab) get_ab_2(T &ref) { return ref.Path2::ab; }
- // CHECK: define linkonce_odr float @_ZN5test37get_p_1INS_7DerivedEEEDtptcvPT_Li0Esr5Path1E1pERS2_(
+ // CHECK-LABEL: define linkonce_odr float @_ZN5test37get_p_1INS_7DerivedEEEDtptcvPT_Li0Esr5Path1E1pERS2_(
template <class T> decltype(((T*) 0)->Path1::p) get_p_1(T &ref) { return ref.Path1::p; }
- // CHECK: define linkonce_odr double @_ZN5test37get_p_2INS_7DerivedEEEDtptcvPT_Li0Esr5Path2E1pERS2_(
+ // CHECK-LABEL: define linkonce_odr double @_ZN5test37get_p_2INS_7DerivedEEEDtptcvPT_Li0Esr5Path2E1pERS2_(
template <class T> decltype(((T*) 0)->Path2::p) get_p_2(T &ref) { return ref.Path2::p; }
Derived obj;
@@ -423,7 +423,7 @@ namespace test3 {
}
}
-// CHECK: define void @_ZN5test41gEPNS_3zedIXadL_ZNS_3foo3barEEEEE
+// CHECK-LABEL: define void @_ZN5test41gEPNS_3zedIXadL_ZNS_3foo3barEEEEE
namespace test4 {
struct foo { int bar; };
template <int (foo::*)>
@@ -431,7 +431,7 @@ namespace test4 {
void g(zed<&foo::bar>*)
{}
}
-// CHECK: define void @_ZN5test51gEPNS_3zedIXadL_ZNS_3foo3barEEEEE
+// CHECK-LABEL: define void @_ZN5test51gEPNS_3zedIXadL_ZNS_3foo3barEEEEE
namespace test5 {
struct foo { static int bar; };
template <int *>
@@ -439,7 +439,7 @@ namespace test5 {
void g(zed<&foo::bar>*)
{}
}
-// CHECK: define void @_ZN5test61gEPNS_3zedIXadL_ZNS_3foo3barEvEEEE
+// CHECK-LABEL: define void @_ZN5test61gEPNS_3zedIXadL_ZNS_3foo3barEvEEEE
namespace test6 {
struct foo { int bar(); };
template <int (foo::*)()>
@@ -447,7 +447,7 @@ namespace test6 {
void g(zed<&foo::bar>*)
{}
}
-// CHECK: define void @_ZN5test71gEPNS_3zedIXadL_ZNS_3foo3barEvEEEE
+// CHECK-LABEL: define void @_ZN5test71gEPNS_3zedIXadL_ZNS_3foo3barEvEEEE
namespace test7 {
struct foo { static int bar(); };
template <int (*f)()>
@@ -455,7 +455,7 @@ namespace test7 {
void g(zed<&foo::bar>*)
{}
}
-// CHECK: define weak_odr void @_ZN5test81AILZNS_1B5valueEEE3incEv
+// CHECK-LABEL: define weak_odr void @_ZN5test81AILZNS_1B5valueEEE3incEv
namespace test8 {
template <int &counter> class A { void inc() { counter++; } };
class B { public: static int value; };
@@ -482,7 +482,7 @@ namespace test10 {
template <char P1> struct S {};
template <char P2> void f(struct S<false ? 'a' : P2> ) {}
- // CHECK: define weak_odr void @_ZN6test101fILc3EEEvNS_1SIXquLb0ELc97ET_EEE(
+ // CHECK-LABEL: define weak_odr void @_ZN6test101fILc3EEEvNS_1SIXquLb0ELc97ET_EEE(
template void f<(char) 3>(struct S<3>);
}
@@ -512,7 +512,7 @@ namespace test13 {
template <template<class> class T> void foo(const A<T> &a) {}
- // CHECK: define weak_odr void @_ZN6test133fooINS_1BEEEvRKNS_1AIT_EE(
+ // CHECK-LABEL: define weak_odr void @_ZN6test133fooINS_1BEEEvRKNS_1AIT_EE(
template void foo(const A<B> &a);
}
@@ -521,7 +521,7 @@ namespace test14 {
struct S {
static int a(), x;
};
- // CHECK: define i32 @_ZN6test141S1aEv
+ // CHECK-LABEL: define i32 @_ZN6test141S1aEv
// CHECK: load i32* @_ZN6test141S1xE
int S::a() { return S::x; }
}
@@ -534,7 +534,7 @@ namespace test15 {
template <int I> void f(S<I + e>) {}
- // CHECK: define weak_odr void @_ZN6test151fILi7EEEvNS_1SIXplT_LNS_1EE3EEEE(
+ // CHECK-LABEL: define weak_odr void @_ZN6test151fILi7EEEvNS_1SIXplT_LNS_1EE3EEEE(
template void f<7>(S<7 + e>);
}
@@ -548,7 +548,7 @@ namespace test17 {
template <class T> A<sizeof(T::foo())> func(void);
- // CHECK: define void @_ZN6test174testEv()
+ // CHECK-LABEL: define void @_ZN6test174testEv()
// CHECK: call {{.*}} @_ZN6test174funcINS_1BEEENS_1AIXszclsrT_3fooEEEEv()
void test() {
func<B>();
@@ -577,10 +577,10 @@ namespace test18 {
template <typename T> void f(S<&T::operator&>) {}
template void f<A>(S<&A::operator&>);
- // CHECK: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_plEEE
- // CHECK: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_miEEE
- // CHECK: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_mlEEE
- // CHECK: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_anEEE
+ // CHECK-LABEL: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_plEEE
+ // CHECK-LABEL: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_miEEE
+ // CHECK-LABEL: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_mlEEE
+ // CHECK-LABEL: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_anEEE
}
// rdar://problem/8332117
@@ -599,13 +599,13 @@ namespace test19 {
template <typename T> void g (S<&T::operator int>) {}
template <typename T> void g (S<&T::template operator- <double> >) {}
- // CHECK: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_1fIiEEEE(
+ // CHECK-LABEL: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_1fIiEEEE(
template void g<A>(S<&A::f<int> >);
- // CHECK: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_plEEE(
+ // CHECK-LABEL: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_plEEE(
template void g<A>(S<&A::operator+>);
- // CHECK: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_cviEEE(
+ // CHECK-LABEL: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_cviEEE(
template void g<A>(S<&A::operator int>);
- // CHECK: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_miIdEEEE(
+ // CHECK-LABEL: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_miIdEEEE(
template void g<A>(S<&A::operator-<double> >);
}
@@ -613,23 +613,23 @@ namespace test20 {
template <class T> T *f(const T&);
template <class T> T *f(T*);
- // CHECK: define weak_odr void @_ZN6test205test0IiEEvDTcl1fIPT_ELi0EEE(
+ // CHECK-LABEL: define weak_odr void @_ZN6test205test0IiEEvDTcl1fIPT_ELi0EEE(
template <class T> void test0(decltype(f<T*>(0))) {}
template void test0<int>(decltype(f<int*>(0)));
- // CHECK: define weak_odr void @_ZN6test205test1IiEEvDTcl1fIEcvT__EEE(
+ // CHECK-LABEL: define weak_odr void @_ZN6test205test1IiEEvDTcl1fIEcvT__EEE(
template <class T> void test1(decltype(f<>(T()))) {}
template void test1<int>(decltype(f<>(int())));
}
// rdar:// 8620510
namespace test21 {
- // CHECK: define void @_ZN6test2112vla_arg_funcEiPA_i(
+ // CHECK-LABEL: define void @_ZN6test2112vla_arg_funcEiPA_i(
void vla_arg_func(int X, int a[X][X]) {}
}
namespace test22 {
- // CHECK: define void @_ZN6test221fEDn(
+ // CHECK-LABEL: define void @_ZN6test221fEDn(
void f(decltype(nullptr)) { }
}
@@ -637,12 +637,12 @@ namespace test22 {
namespace test23 {
typedef void * const vpc;
- // CHECK: define void @_ZN6test231fERA10_KPv(
+ // CHECK-LABEL: define void @_ZN6test231fERA10_KPv(
void f(vpc (&)[10]) {}
typedef vpc vpca5[5];
void f(vpca5 volatile (&)[10]) {}
- // CHECK: define void @_ZN6test231fERA10_A5_VKPv(
+ // CHECK-LABEL: define void @_ZN6test231fERA10_A5_VKPv(
}
namespace test24 {
@@ -652,10 +652,10 @@ namespace test24 {
foo();
}
- static char foo() {}
+ static char bar() {}
void test1() {
- // CHECK: call signext i8 @_ZN6test24L3fooEv()
- foo();
+ // CHECK: call signext i8 @_ZN6test24L3barEv()
+ bar();
}
}
@@ -757,11 +757,11 @@ namespace test31 { // instantiation-dependent mangling of decltype
void g(int);
template<class T> auto f3(T p)->decltype(g(p)) {}
- // CHECK: define weak_odr i32 @_ZN6test312f1IiEEiT_(
+ // CHECK-LABEL: define weak_odr i32 @_ZN6test312f1IiEEiT_(
template int f1(int);
- // CHECK: define weak_odr i32 @_ZN6test312f2IiEEDtfp_ET_
+ // CHECK-LABEL: define weak_odr i32 @_ZN6test312f2IiEEDtfp_ET_
template int f2(int);
- // CHECK: define weak_odr void @_ZN6test312f3IiEEDTcl1gfp_EET_
+ // CHECK-LABEL: define weak_odr void @_ZN6test312f3IiEEDTcl1gfp_EET_
template void f3(int);
}
@@ -802,14 +802,14 @@ namespace test34 {
template<typename T>
void f(decltype(sizeof(decltype(T() + T())))) {}
- // CHECK: define weak_odr void @_ZN6test341fIiEEvDTstDTplcvT__EcvS1__EEE
+ // CHECK-LABEL: define weak_odr void @_ZN6test341fIiEEvDTstDTplcvT__EcvS1__EEE
template void f<int>(decltype(sizeof(1)));
// Mangling for non-instantiation-dependent sizeof expressions.
template<unsigned N>
void f2(int (&)[N + sizeof(int*)]) {}
- // CHECK: define weak_odr void @_ZN6test342f2ILj4EEEvRAplT_Lm8E_i
+ // CHECK-LABEL: define weak_odr void @_ZN6test342f2ILj4EEEvRAplT_Lm8E_i
template void f2<4>(int (&)[4 + sizeof(int*)]);
// Mangling for non-instantiation-dependent sizeof expressions
@@ -817,7 +817,7 @@ namespace test34 {
template<unsigned long long N>
void f3(int (&)[N + sizeof(int*)]) {}
- // CHECK: define weak_odr void @_ZN6test342f3ILy4EEEvRAplT_Ly8E_i
+ // CHECK-LABEL: define weak_odr void @_ZN6test342f3ILy4EEEvRAplT_Ly8E_i
template void f3<4>(int (&)[4 + sizeof(int*)]);
// Mangling for instantiation-dependent sizeof() expressions as
@@ -826,7 +826,7 @@ namespace test34 {
template<typename T> void f4(::test34::A<sizeof(sizeof(decltype(T() + T())))>) { }
- // CHECK: define weak_odr void @_ZN6test342f4IiEEvNS_1AIXszstDTplcvT__EcvS2__EEEEE
+ // CHECK-LABEL: define weak_odr void @_ZN6test342f4IiEEvNS_1AIXszstDTplcvT__EcvS2__EEEEE
template void f4<int>(A<sizeof(sizeof(int))>);
}
@@ -839,7 +839,7 @@ namespace test35 {
template<typename T>
void f1(decltype(sizeof(&T::template operator+<int>))) {}
- // CHECK: define weak_odr void @_ZN6test352f1INS_1AEEEvDTszadsrT_plIiEE
+ // CHECK-LABEL: define weak_odr void @_ZN6test352f1INS_1AEEEvDTszadsrT_plIiEE
template void f1<A>(__SIZE_TYPE__);
}
@@ -864,14 +864,90 @@ namespace test37 {
};
template<typename T> void func(T) { }
void test() {
- // CHECK: define linkonce_odr void @_ZN6test374funcINS_3fooUt_EEEvT_
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test374funcINS_3fooUt_EEEvT_
func(foo().a);
- // CHECK: define linkonce_odr void @_ZN6test374funcINS_3fooUt0_EEEvT_
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test374funcINS_3fooUt0_EEEvT_
func(*foo::c());
- // CHECK: define linkonce_odr void @_ZN6test374funcINS_3fooUt1_EEEvT_
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test374funcINS_3fooUt1_EEEvT_
func(foo().d);
}
}
-// CHECK: define void @_Z6ASfuncPU3AS3i
+// CHECK-LABEL: define void @_Z6ASfuncPU3AS3i
void ASfunc(__attribute__((address_space(3))) int* x) {}
+
+namespace test38 {
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test384funcINS_3fooUt_EEEvT_
+ typedef struct {
+ struct {
+ } a;
+ } foo;
+
+ template <typename T> void func(T) {}
+ void test() { func(foo().a); }
+}
+
+namespace test39 {
+ // CHECK-LABEL: define internal void @"_ZN6test394funcINS_3$_03$_1EEEvT_"
+ typedef struct {
+ struct {} a;
+ } *foo;
+ template<typename T> void func(T) {}
+ void test(foo x) {
+ func(x->a);
+ }
+}
+
+namespace test40 {
+ // CHECK: i32* @_ZZN6test401fEvE1a_0
+ void h(int&);
+ inline void f() {
+ if (0) {
+ static int a;
+ }
+ static int a;
+ h(a);
+ };
+ void g() { f(); }
+}
+
+namespace test41 {
+ // CHECK: define linkonce_odr void @_ZN6test414funcINS_1XEEEvNS_3fooILi20ES1_EE
+ template <int i, class T> struct foo {
+ template <class T2 = T> friend void func(foo x) {}
+ };
+
+ struct X {};
+
+ void g() { func(foo<20, X>()); }
+}
+
+namespace test42 {
+ // CHECK: define linkonce_odr void @_ZN6test424funcINS_1XEEEvNS_3fooILi20ES1_EE
+ template <int i, template <class> class T> struct foo {
+ template <template <class> class T2 = T> friend void func(foo x) {}
+ };
+
+ template <class V> struct X {
+ };
+
+ void g() { func(foo<20, X>()); }
+}
+
+namespace test43 {
+ // CHECK-LABEL: define void @_ZN6test431gEPNS_3zedIXadL_ZNS_3fooUt_3barEEEEE
+ struct foo { union { int bar; }; };
+ template <int (foo::*)>
+ struct zed {};
+ void g(zed<&foo::bar>*)
+ {}
+}
+
+namespace test44 {
+ struct foo { void bar() __restrict { }; } obj;
+
+ void f() {
+ obj.bar();
+ }
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test443foo3barEv(%"struct.test44::foo"* %this)
+}
diff --git a/test/CodeGenCXX/member-expressions.cpp b/test/CodeGenCXX/member-expressions.cpp
index d9fb3940b05b..48502727be7f 100644
--- a/test/CodeGenCXX/member-expressions.cpp
+++ b/test/CodeGenCXX/member-expressions.cpp
@@ -58,7 +58,7 @@ namespace test4 {
extern C *c_ptr;
- // CHECK: define i32 @_ZN5test44testEv()
+ // CHECK-LABEL: define i32 @_ZN5test44testEv()
int test() {
// CHECK: load {{.*}} @_ZN5test45c_ptrE
// CHECK-NEXT: bitcast
diff --git a/test/CodeGenCXX/member-function-pointer-calls.cpp b/test/CodeGenCXX/member-function-pointer-calls.cpp
index f8960aac52ef..99162ebd5863 100644
--- a/test/CodeGenCXX/member-function-pointer-calls.cpp
+++ b/test/CodeGenCXX/member-function-pointer-calls.cpp
@@ -8,14 +8,14 @@ int f(A* a, int (A::*fp)()) {
return (a->*fp)();
}
-// CHECK: define i32 @_Z2g1v()
+// CHECK-LABEL: define i32 @_Z2g1v()
// CHECK: ret i32 1
int g1() {
A a;
return f(&a, &A::vf1);
}
-// CHECK: define i32 @_Z2g2v()
+// CHECK-LABEL: define i32 @_Z2g2v()
// CHECK: ret i32 2
int g2() {
A a;
diff --git a/test/CodeGenCXX/member-function-pointers.cpp b/test/CodeGenCXX/member-function-pointers.cpp
index 84b54b67d315..fb06fa77039d 100644
--- a/test/CodeGenCXX/member-function-pointers.cpp
+++ b/test/CodeGenCXX/member-function-pointers.cpp
@@ -4,6 +4,9 @@
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i386-unknown-unknown | FileCheck -check-prefix GLOBAL-LP32 %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv7-unknown-unknown | FileCheck -check-prefix GLOBAL-ARM %s
+// PNaCl uses the same representation of method pointers as ARM.
+// RUN: %clang_cc1 %s -emit-llvm -o - -triple=le32-unknown-nacl | FileCheck -check-prefix GLOBAL-ARM %s
+
struct A { int a; void f(); virtual void vf1(); virtual void vf2(); };
struct B { int b; virtual void g(); };
struct C : B, A { };
@@ -226,7 +229,7 @@ namespace test9 {
fooptr p;
};
- // CODE-LP64: define void @_ZN5test94testEv(
+ // CODE-LP64-LABEL: define void @_ZN5test94testEv(
// CODE-LP64: alloca i32
// CODE-LP64-NEXT: ret void
void test() {
diff --git a/test/CodeGenCXX/member-functions.cpp b/test/CodeGenCXX/member-functions.cpp
index 75b354cd0f93..1773c67fc863 100644
--- a/test/CodeGenCXX/member-functions.cpp
+++ b/test/CodeGenCXX/member-functions.cpp
@@ -5,11 +5,11 @@ struct C {
void g(int, ...);
};
-// CHECK: define void @_ZN1C1fEv
+// CHECK-LABEL: define void @_ZN1C1fEv
void C::f() {
}
-// CHECK: define void @_Z5test1v
+// CHECK-LABEL: define void @_Z5test1v
void test1() {
C c;
@@ -34,7 +34,7 @@ struct S {
virtual void v() {}
};
-// CHECK: define void @_ZN1S1fEv
+// CHECK-LABEL: define void @_ZN1S1fEv
void S::f() {
}
@@ -51,13 +51,13 @@ void test2() {
// CHECK: define linkonce_odr void @_ZN1SC1Ev{{.*}} unnamed_addr
// S::f_inline1()
-// CHECK: define linkonce_odr void @_ZN1S9f_inline1Ev
+// CHECK-LABEL: define linkonce_odr void @_ZN1S9f_inline1Ev
// S::f_inline2()
-// CHECK: define linkonce_odr void @_ZN1S9f_inline2Ev
+// CHECK-LABEL: define linkonce_odr void @_ZN1S9f_inline2Ev
// S::g()
-// CHECK: define linkonce_odr void @_ZN1S1gEv
+// CHECK-LABEL: define linkonce_odr void @_ZN1S1gEv
// S::~S()
// CHECK: define linkonce_odr void @_ZN1SD1Ev{{.*}} unnamed_addr
@@ -66,7 +66,7 @@ struct T {
T operator+(const T&);
};
-// CHECK: define void @_Z5test3v
+// CHECK-LABEL: define void @_Z5test3v
void test3() {
T t1, t2;
diff --git a/test/CodeGenCXX/member-init-anon-union.cpp b/test/CodeGenCXX/member-init-anon-union.cpp
index 4db31f0b83fd..bfe1667c8c6c 100644
--- a/test/CodeGenCXX/member-init-anon-union.cpp
+++ b/test/CodeGenCXX/member-init-anon-union.cpp
@@ -11,7 +11,7 @@ static union {
int f() { return a; }
-// CHECK: define internal void @__cxx_global_var_init
+// CHECK-LABEL: define internal void @__cxx_global_var_init
// CHECK-NOT: }
// CHECK: call {{.*}}@"[[CONSTRUCT_GLOBAL:.*]]C1Ev"
diff --git a/test/CodeGenCXX/member-initializers.cpp b/test/CodeGenCXX/member-initializers.cpp
index c22b99d60627..c98e6bf92362 100644
--- a/test/CodeGenCXX/member-initializers.cpp
+++ b/test/CodeGenCXX/member-initializers.cpp
@@ -12,7 +12,7 @@ struct B : A {
int i;
};
-// CHECK: define i32 @_Z1fv() #0
+// CHECK-LABEL: define i32 @_Z1fv() #0
int f() {
B b;
diff --git a/test/CodeGenCXX/member-templates.cpp b/test/CodeGenCXX/member-templates.cpp
index 7e4bdca77f38..c72dd6e5f528 100644
--- a/test/CodeGenCXX/member-templates.cpp
+++ b/test/CodeGenCXX/member-templates.cpp
@@ -15,8 +15,8 @@ struct B {
template<typename T> B::B(T) {}
-// CHECK: define weak_odr void @_ZN1BC1IiEET_(%struct.B* %this, i32) unnamed_addr
-// CHECK: define weak_odr void @_ZN1BC2IiEET_(%struct.B* %this, i32) unnamed_addr
+// CHECK-LABEL: define weak_odr void @_ZN1BC1IiEET_(%struct.B* %this, i32) unnamed_addr
+// CHECK-LABEL: define weak_odr void @_ZN1BC2IiEET_(%struct.B* %this, i32) unnamed_addr
template B::B(int);
template<typename T>
diff --git a/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp b/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp
new file mode 100644
index 000000000000..7407efed2f9d
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=i686-pc-win32 -o - %s 2>/dev/null | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=x86_64-pc-win32 -o - %s 2>/dev/null | FileCheck %s -check-prefix CHECK-X64
+
+struct B { char a; };
+struct A : virtual B {} a;
+
+// The <> indicate that the pointer is packed, which is required to support
+// microsoft layout in 32 bit mode, but not 64 bit mode.
+// CHECK: %struct.A = type <{ i32*, %struct.B }>
+// CHECK-X64: %struct.A = type { i32*, %struct.B }
diff --git a/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp
new file mode 100644
index 000000000000..92db9a789b3c
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -std=c++11 -fno-rtti -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+
+struct A {
+ constexpr A(int x) : x(x) {}
+ virtual void f();
+ int x;
+};
+
+A a(42);
+// CHECK: @"\01?a@@3UA@@A" = global { [1 x i8*]*, i32 } { [1 x i8*]* @"\01??_7A@@6B@", i32 42 }, align 4
+
+struct B {
+ constexpr B(int y) : y(y) {}
+ virtual void g();
+ int y;
+};
+
+struct C : A, B {
+ constexpr C() : A(777), B(13) {}
+};
+
+C c;
+// CHECK: @"\01?c@@3UC@@A" = global { [1 x i8*]*, i32, [1 x i8*]*, i32 } { [1 x i8*]* @"\01??_7C@@6BA@@@", i32 777, [1 x i8*]* @"\01??_7C@@6BB@@@", i32 13 }
diff --git a/test/CodeGenCXX/microsoft-abi-default-cc.cpp b/test/CodeGenCXX/microsoft-abi-default-cc.cpp
index 7f2fc0a89d7a..d7fba9911e1b 100644
--- a/test/CodeGenCXX/microsoft-abi-default-cc.cpp
+++ b/test/CodeGenCXX/microsoft-abi-default-cc.cpp
@@ -12,13 +12,13 @@
void foo();
void __cdecl foo();
void __cdecl foo() {}
-// GCABI: define void @_Z3foov()
+// GCABI-LABEL: define void @_Z3foov()
// MSABI: define void @"\01?foo@@YAXXZ"
void __cdecl bar();
void bar();
void bar() {}
-// GCABI: define void @_Z3barv()
+// GCABI-LABEL: define void @_Z3barv()
// MSABI: define void @"\01?bar@@YAXXZ"
// Test that it's OK to mark either the method declaration or method definition
@@ -33,15 +33,15 @@ public:
};
void METHOD_CC A::baz() {}
-// GCABI: define void @_ZN1A3bazEv
+// GCABI-LABEL: define void @_ZN1A3bazEv
// MSABI: define x86_thiscallcc void @"\01?baz@A@@QAEXXZ"
void A::qux() {}
-// GCABI: define void @_ZN1A3quxEv
+// GCABI-LABEL: define void @_ZN1A3quxEv
// MSABI: define x86_thiscallcc void @"\01?qux@A@@QAEXXZ"
void __cdecl static_baz() {}
-// GCABI: define void @_Z10static_bazv
+// GCABI-LABEL: define void @_Z10static_bazv
// MSABI: define void @"\01?static_baz@@YAXXZ"
void static_qux() {}
-// GCABI: define void @_Z10static_quxv
+// GCABI-LABEL: define void @_Z10static_quxv
// MSABI: define void @"\01?static_qux@@YAXXZ"
diff --git a/test/CodeGenCXX/microsoft-abi-exceptions.cpp b/test/CodeGenCXX/microsoft-abi-exceptions.cpp
new file mode 100644
index 000000000000..7757ea004359
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-exceptions.cpp
@@ -0,0 +1,157 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -cxx-abi microsoft -fexceptions -fno-rtti | FileCheck -check-prefix WIN32 %s
+
+struct A {
+ A();
+ ~A();
+ int a;
+};
+
+A getA();
+
+int TakesTwo(A a, A b);
+void HasEHCleanup() {
+ TakesTwo(getA(), getA());
+}
+
+// With exceptions, we need to clean up at least one of these temporaries.
+// WIN32: define void @"\01?HasEHCleanup@@YAXXZ"() {{.*}} {
+// First one doesn't have any cleanups, no need for invoke.
+// WIN32: call void @"\01?getA@@YA?AUA@@XZ"(%struct.A* sret %{{.*}})
+// If this call throws, we have to cleanup the first temporary.
+// WIN32: invoke void @"\01?getA@@YA?AUA@@XZ"(%struct.A* sret %{{.*}})
+// If this call throws, we already popped our cleanups
+// WIN32: call i32 @"\01?TakesTwo@@YAHUA@@0@Z"
+// WIN32: ret void
+//
+// There should be one dtor call for unwinding from the second getA.
+// WIN32: invoke x86_thiscallcc void @"\01??1A@@QAE@XZ"
+// WIN32: }
+
+void TakeRef(const A &a);
+int HasDeactivatedCleanups() {
+ return TakesTwo((TakeRef(A()), A()), (TakeRef(A()), A()));
+}
+
+// WIN32: define i32 @"\01?HasDeactivatedCleanups@@YAHXZ"() {{.*}} {
+// WIN32: %[[isactive:.*]] = alloca i1
+// WIN32: call x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"
+// WIN32: invoke void @"\01?TakeRef@@YAXABUA@@@Z"
+// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"(%struct.A* %[[arg1:.*]])
+// WIN32: store i1 true, i1* %[[isactive]]
+// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"
+// WIN32: invoke void @"\01?TakeRef@@YAXABUA@@@Z"
+// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"
+// WIN32: store i1 false, i1* %[[isactive]]
+// WIN32: invoke i32 @"\01?TakesTwo@@YAHUA@@0@Z"
+// Destroy the two const ref temporaries.
+// WIN32: invoke x86_thiscallcc void @"\01??1A@@QAE@XZ"
+// WIN32: call x86_thiscallcc void @"\01??1A@@QAE@XZ"
+// WIN32: ret i32
+//
+// Conditionally destroy arg1.
+// WIN32: %[[cond:.*]] = load i1* %[[isactive]]
+// WIN32: br i1 %[[cond]]
+// WIN32: invoke x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %[[arg1]])
+// WIN32: }
+
+// Test putting the cleanups inside a conditional.
+int CouldThrow();
+int HasConditionalCleanup(bool cond) {
+ return (cond ? TakesTwo(A(), A()) : CouldThrow());
+}
+
+// WIN32: define i32 @"\01?HasConditionalCleanup@@YAH_N@Z"(i1 zeroext %{{.*}}) {{.*}} {
+// WIN32: store i1 false
+// WIN32: br i1
+// No cleanups, so we call and then activate a cleanup if it succeeds.
+// WIN32: call x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"(%struct.A* %[[arg1:.*]])
+// WIN32: store i1 true
+// Now we have a cleanup for the first aggregate, so we invoke.
+// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"(%struct.A* %{{.*}})
+// Now we have no cleanups because TakeTwo will destruct both args.
+// WIN32: call i32 @"\01?TakesTwo@@YAHUA@@0@Z"
+// Still no cleanups, so call.
+// WIN32: call i32 @"\01?CouldThrow@@YAHXZ"()
+// Somewhere in the landing pad for our single invoke, call the dtor.
+// WIN32: invoke x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %[[arg1]])
+// WIN32: }
+
+// Now test both.
+int HasConditionalDeactivatedCleanups(bool cond) {
+ return (cond ? TakesTwo((TakeRef(A()), A()), (TakeRef(A()), A())) : CouldThrow());
+}
+
+// WIN32: define i32 @"\01?HasConditionalDeactivatedCleanups@@YAH_N@Z"{{.*}} {
+// WIN32: %[[arg1:.*]] = alloca %struct.A, align 4
+// WIN32: alloca i1
+// WIN32: %[[arg1_cond:.*]] = alloca i1
+// Start all four cleanups as deactivated.
+// WIN32: store i1 false
+// WIN32: store i1 false
+// WIN32: store i1 false
+// WIN32: store i1 false
+// WIN32: br i1
+// True condition.
+// WIN32: call x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"
+// WIN32: store i1 true
+// WIN32: invoke void @"\01?TakeRef@@YAXABUA@@@Z"
+// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"(%struct.A* %[[arg1]])
+// WIN32: store i1 true, i1* %[[arg1_cond]]
+// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"
+// WIN32: store i1 true
+// WIN32: invoke void @"\01?TakeRef@@YAXABUA@@@Z"
+// WIN32: invoke x86_thiscallcc %struct.A* @"\01??0A@@QAE@XZ"
+// WIN32: store i1 true
+// WIN32: store i1 false, i1* %[[arg1_cond]]
+// WIN32: invoke i32 @"\01?TakesTwo@@YAHUA@@0@Z"
+// False condition.
+// WIN32: invoke i32 @"\01?CouldThrow@@YAHXZ"()
+// Two normal cleanups for TakeRef args.
+// WIN32: invoke x86_thiscallcc void @"\01??1A@@QAE@XZ"
+// WIN32: call x86_thiscallcc void @"\01??1A@@QAE@XZ"
+// WIN32: ret i32
+//
+// Somewhere in the landing pad soup, we conditionally destroy arg1.
+// WIN32: %[[isactive:.*]] = load i1* %[[arg1_cond]]
+// WIN32: br i1 %[[isactive]]
+// WIN32: invoke x86_thiscallcc void @"\01??1A@@QAE@XZ"(%struct.A* %[[arg1]])
+// WIN32: }
+
+namespace crash_on_partial_destroy {
+struct A {
+ virtual ~A();
+};
+
+struct B : virtual A {
+ // Has an implicit destructor.
+};
+
+struct C : B {
+ C();
+};
+
+void foo();
+// We used to crash when emitting this.
+C::C() { foo(); }
+
+// Verify that we don't bother with a vbtable lookup when adjusting the this
+// pointer to call a base destructor from a constructor while unwinding.
+// WIN32-LABEL: define {{.*}} @"\01??0C@crash_on_partial_destroy@@QAE@XZ"{{.*}} {
+// WIN32: landingpad
+//
+// We shouldn't do any vbptr loads, just constant GEPs.
+// WIN32-NOT: load
+// WIN32: getelementptr i8* %{{.*}}, i32 4
+// WIN32-NOT: load
+// WIN32: bitcast i8* %{{.*}} to %"struct.crash_on_partial_destroy::B"*
+// WIN32: invoke x86_thiscallcc void @"\01??1B@crash_on_partial_destroy@@UAE@XZ"
+//
+// WIN32-NOT: load
+// WIN32: bitcast %"struct.crash_on_partial_destroy::C"* %{{.*}} to i8*
+// WIN32-NOT: load
+// WIN32: getelementptr inbounds i8* %{{.*}}, i64 4
+// WIN32-NOT: load
+// WIN32: bitcast i8* %{{.*}} to %"struct.crash_on_partial_destroy::A"*
+// WIN32: invoke x86_thiscallcc void @"\01??1A@crash_on_partial_destroy@@UAE@XZ"
+// WIN32: }
+}
diff --git a/test/CodeGenCXX/microsoft-abi-member-pointers.cpp b/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
index 3fffc9d72cb1..c0dcd3cf8316 100755
--- a/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
+++ b/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
@@ -1,16 +1,20 @@
// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// FIXME: Test x86_64 member pointers when codegen no longer asserts on records
+// with virtual bases.
struct B1 {
void foo();
int b;
};
struct B2 {
+ int b2;
void foo();
};
struct Single : B1 {
void foo();
};
struct Multiple : B1, B2 {
+ int m;
void foo();
};
struct Virtual : virtual B1 {
@@ -34,9 +38,11 @@ struct Polymorphic {
// offset.
struct NonZeroVBPtr : POD, Virtual {
int n;
+ void foo();
};
struct Unspecified;
+struct UnspecSingle;
// Check that we can lower the LLVM types and get the null initializers right.
int Single ::*s_d_memptr;
@@ -45,29 +51,95 @@ int Multiple ::*m_d_memptr;
int Virtual ::*v_d_memptr;
int NonZeroVBPtr::*n_d_memptr;
int Unspecified::*u_d_memptr;
-// CHECK: @"\01?s_d_memptr@@3PQSingle@@HA" = global i32 -1, align 4
-// CHECK: @"\01?p_d_memptr@@3PQPolymorphic@@HA" = global i32 0, align 4
-// CHECK: @"\01?m_d_memptr@@3PQMultiple@@HA" = global i32 -1, align 4
-// CHECK: @"\01?v_d_memptr@@3PQVirtual@@HA" = global { i32, i32 }
+int UnspecSingle::*us_d_memptr;
+// CHECK: @"\01?s_d_memptr@@3PQSingle@@HQ1@" = global i32 -1, align 4
+// CHECK: @"\01?p_d_memptr@@3PQPolymorphic@@HQ1@" = global i32 0, align 4
+// CHECK: @"\01?m_d_memptr@@3PQMultiple@@HQ1@" = global i32 -1, align 4
+// CHECK: @"\01?v_d_memptr@@3PQVirtual@@HQ1@" = global { i32, i32 }
// CHECK: { i32 0, i32 -1 }, align 4
-// CHECK: @"\01?n_d_memptr@@3PQNonZeroVBPtr@@HA" = global { i32, i32 }
+// CHECK: @"\01?n_d_memptr@@3PQNonZeroVBPtr@@HQ1@" = global { i32, i32 }
// CHECK: { i32 0, i32 -1 }, align 4
-// CHECK: @"\01?u_d_memptr@@3PQUnspecified@@HA" = global { i32, i32, i32 }
+// CHECK: @"\01?u_d_memptr@@3PQUnspecified@@HQ1@" = global { i32, i32, i32 }
+// CHECK: { i32 0, i32 0, i32 -1 }, align 4
+// CHECK: @"\01?us_d_memptr@@3PQUnspecSingle@@HQ1@" = global { i32, i32, i32 }
// CHECK: { i32 0, i32 0, i32 -1 }, align 4
void (Single ::*s_f_memptr)();
void (Multiple::*m_f_memptr)();
void (Virtual ::*v_f_memptr)();
-// CHECK: @"\01?s_f_memptr@@3P8Single@@AEXXZA" = global i8* null, align 4
-// CHECK: @"\01?m_f_memptr@@3P8Multiple@@AEXXZA" = global { i8*, i32 } zeroinitializer, align 4
-// CHECK: @"\01?v_f_memptr@@3P8Virtual@@AEXXZA" = global { i8*, i32, i32 } zeroinitializer, align 4
+// CHECK: @"\01?s_f_memptr@@3P8Single@@AEXXZQ1@" = global i8* null, align 4
+// CHECK: @"\01?m_f_memptr@@3P8Multiple@@AEXXZQ1@" = global { i8*, i32 } zeroinitializer, align 4
+// CHECK: @"\01?v_f_memptr@@3P8Virtual@@AEXXZQ1@" = global { i8*, i32, i32 } zeroinitializer, align 4
// We can define Unspecified after locking in the inheritance model.
-struct Unspecified : Virtual {
+struct Unspecified : Multiple, Virtual {
void foo();
int u;
};
+struct UnspecSingle {
+ void foo();
+};
+
+// Test memptr emission in a constant expression.
+namespace Const {
+void (Single ::*s_f_mp)() = &Single::foo;
+void (Multiple ::*m_f_mp)() = &B2::foo;
+void (Virtual ::*v_f_mp)() = &Virtual::foo;
+void (Unspecified::*u_f_mp)() = &Unspecified::foo;
+void (UnspecSingle::*us_f_mp)() = &UnspecSingle::foo;
+// CHECK: @"\01?s_f_mp@Const@@3P8Single@@AEXXZQ2@" =
+// CHECK: global i8* bitcast ({{.*}} @"\01?foo@Single@@QAEXXZ" to i8*), align 4
+// CHECK: @"\01?m_f_mp@Const@@3P8Multiple@@AEXXZQ2@" =
+// CHECK: global { i8*, i32 } { i8* bitcast ({{.*}} @"\01?foo@B2@@QAEXXZ" to i8*), i32 4 }, align 4
+// CHECK: @"\01?v_f_mp@Const@@3P8Virtual@@AEXXZQ2@" =
+// CHECK: global { i8*, i32, i32 } { i8* bitcast ({{.*}} @"\01?foo@Virtual@@QAEXXZ" to i8*), i32 0, i32 0 }, align 4
+// CHECK: @"\01?u_f_mp@Const@@3P8Unspecified@@AEXXZQ2@" =
+// CHECK: global { i8*, i32, i32, i32 } { i8* bitcast ({{.*}} @"\01?foo@Unspecified@@QAEXXZ" to i8*), i32 0, i32 12, i32 0 }, align 4
+// CHECK: @"\01?us_f_mp@Const@@3P8UnspecSingle@@AEXXZQ2@" =
+// CHECK: global { i8*, i32, i32, i32 } { i8* bitcast ({{.*}} @"\01?foo@UnspecSingle@@QAEXXZ" to i8*), i32 0, i32 0, i32 0 }, align 4
+}
+
+namespace CastParam {
+// This exercises ConstExprEmitter instead of ValueDecl::evaluateValue. The
+// extra reinterpret_cast for the parameter type requires more careful folding.
+// FIXME: Or does it? If reinterpret_casts are no-ops, we should be able to
+// strip them in evaluateValue() and just proceed as normal with an APValue.
+struct A {
+ int a;
+ void foo(A *p);
+};
+struct B { int b; };
+struct C : B, A { int c; };
+
+void (A::*ptr1)(void *) = (void (A::*)(void *)) &A::foo;
+// CHECK: @"\01?ptr1@CastParam@@3P8A@1@AEXPAX@ZQ21@" =
+// CHECK: global i8* bitcast (void ({{.*}})* @"\01?foo@A@CastParam@@QAEXPAU12@@Z" to i8*), align 4
+
+// Try a reinterpret_cast followed by a memptr conversion.
+void (C::*ptr2)(void *) = (void (C::*)(void *)) (void (A::*)(void *)) &A::foo;
+// CHECK: @"\01?ptr2@CastParam@@3P8C@1@AEXPAX@ZQ21@" =
+// CHECK: global { i8*, i32 } { i8* bitcast (void ({{.*}})* @"\01?foo@A@CastParam@@QAEXPAU12@@Z" to i8*), i32 4 }, align 4
+
+void (C::*ptr3)(void *) = (void (C::*)(void *)) (void (A::*)(void *)) (void (A::*)(A *)) 0;
+// CHECK: @"\01?ptr3@CastParam@@3P8C@1@AEXPAX@ZQ21@" =
+// CHECK: global { i8*, i32 } zeroinitializer, align 4
+
+struct D : C {
+ virtual void isPolymorphic();
+ int d;
+};
+
+// Try a cast that changes the inheritance model. Null for D is 0, but null for
+// C is -1. We need the cast to long in order to hit the non-APValue path.
+int C::*ptr4 = (int C::*) (int D::*) (long D::*) 0;
+// CHECK: @"\01?ptr4@CastParam@@3PQC@1@HQ21@" = global i32 -1, align 4
+
+// MSVC rejects this but we accept it.
+int C::*ptr5 = (int C::*) (long D::*) 0;
+// CHECK: @"\01?ptr5@CastParam@@3PQC@1@HQ21@" = global i32 -1, align 4
+}
+
struct UnspecWithVBPtr;
int UnspecWithVBPtr::*forceUnspecWithVBPtr;
struct UnspecWithVBPtr : B1, virtual B2 {
@@ -82,7 +154,7 @@ void EmitNonVirtualMemberPointers() {
void (Virtual ::*v_f_memptr)() = &Virtual::foo;
void (Unspecified::*u_f_memptr)() = &Unspecified::foo;
void (UnspecWithVBPtr::*u2_f_memptr)() = &UnspecWithVBPtr::foo;
-// CHECK: define void @"\01?EmitNonVirtualMemberPointers@@YAXXZ"() #0 {
+// CHECK: define void @"\01?EmitNonVirtualMemberPointers@@YAXXZ"() {{.*}} {
// CHECK: alloca i8*, align 4
// CHECK: alloca { i8*, i32 }, align 4
// CHECK: alloca { i8*, i32, i32 }, align 4
@@ -95,7 +167,7 @@ void EmitNonVirtualMemberPointers() {
// CHECK: { i8* bitcast (void (%{{.*}}*)* @"\01?foo@Virtual@@QAEXXZ" to i8*), i32 0, i32 0 },
// CHECK: { i8*, i32, i32 }* %{{.*}}, align 4
// CHECK: store { i8*, i32, i32, i32 }
-// CHECK: { i8* bitcast (void (%{{.*}}*)* @"\01?foo@Unspecified@@QAEXXZ" to i8*), i32 0, i32 0, i32 0 },
+// CHECK: { i8* bitcast (void (%{{.*}}*)* @"\01?foo@Unspecified@@QAEXXZ" to i8*), i32 0, i32 12, i32 0 },
// CHECK: { i8*, i32, i32, i32 }* %{{.*}}, align 4
// CHECK: store { i8*, i32, i32, i32 }
// CHECK: { i8* bitcast (void (%{{.*}}*)* @"\01?foo@UnspecWithVBPtr@@QAEXXZ" to i8*),
@@ -112,7 +184,7 @@ void podMemPtrs() {
if (memptr)
memptr = 0;
// Check that member pointers use the right offsets and that null is -1.
-// CHECK: define void @"\01?podMemPtrs@@YAXXZ"() #0 {
+// CHECK: define void @"\01?podMemPtrs@@YAXXZ"() {{.*}} {
// CHECK: %[[memptr:.*]] = alloca i32, align 4
// CHECK-NEXT: store i32 0, i32* %[[memptr]], align 4
// CHECK-NEXT: store i32 4, i32* %[[memptr]], align 4
@@ -132,7 +204,7 @@ void polymorphicMemPtrs() {
memptr = 0;
// Member pointers for polymorphic classes include the vtable slot in their
// offset and use 0 to represent null.
-// CHECK: define void @"\01?polymorphicMemPtrs@@YAXXZ"() #0 {
+// CHECK: define void @"\01?polymorphicMemPtrs@@YAXXZ"() {{.*}} {
// CHECK: %[[memptr:.*]] = alloca i32, align 4
// CHECK-NEXT: store i32 4, i32* %[[memptr]], align 4
// CHECK-NEXT: store i32 8, i32* %[[memptr]], align 4
@@ -233,7 +305,7 @@ int loadDataMemberPointerUnspecified(Unspecified *o, int Unspecified::*memptr) {
void callMemberPointerSingle(Single *o, void (Single::*memptr)()) {
(o->*memptr)();
// Just look for an indirect thiscall.
-// CHECK: define void @"\01?callMemberPointerSingle@@{{.*}} #0 {
+// CHECK: define void @"\01?callMemberPointerSingle@@{{.*}} {{.*}} {
// CHECK: call x86_thiscallcc void %{{.*}}(%{{.*}} %{{.*}})
// CHECK: ret void
// CHECK: }
@@ -241,7 +313,7 @@ void callMemberPointerSingle(Single *o, void (Single::*memptr)()) {
void callMemberPointerMultiple(Multiple *o, void (Multiple::*memptr)()) {
(o->*memptr)();
-// CHECK: define void @"\01?callMemberPointerMultiple@@{{.*}} #0 {
+// CHECK: define void @"\01?callMemberPointerMultiple@@{{.*}} {
// CHECK: %[[memptr0:.*]] = extractvalue { i8*, i32 } %{{.*}}, 0
// CHECK: %[[memptr1:.*]] = extractvalue { i8*, i32 } %{{.*}}, 1
// CHECK: %[[this_adjusted:.*]] = getelementptr inbounds i8* %{{.*}}, i32 %[[memptr1]]
@@ -255,7 +327,7 @@ void callMemberPointerMultiple(Multiple *o, void (Multiple::*memptr)()) {
void callMemberPointerVirtualBase(Virtual *o, void (Virtual::*memptr)()) {
(o->*memptr)();
// This shares a lot with virtual data member pointers.
-// CHECK: define void @"\01?callMemberPointerVirtualBase@@{{.*}} #0 {
+// CHECK: define void @"\01?callMemberPointerVirtualBase@@{{.*}} {
// CHECK: %[[memptr0:.*]] = extractvalue { i8*, i32, i32 } %{{.*}}, 0
// CHECK: %[[memptr1:.*]] = extractvalue { i8*, i32, i32 } %{{.*}}, 1
// CHECK: %[[memptr2:.*]] = extractvalue { i8*, i32, i32 } %{{.*}}, 2
@@ -361,3 +433,107 @@ bool unspecDataMemptrEq(int Unspecified::*l, int Unspecified::*r) {
// CHECK: ret i1
// CHECK: }
}
+
+void (Multiple::*convertB2FuncToMultiple(void (B2::*mp)()))() {
+ return mp;
+// CHECK: define i64 @"\01?convertB2FuncToMultiple@@YAP8Multiple@@AEXXZP8B2@@AEXXZ@Z"{{.*}} {
+// CHECK: store
+// CHECK: %[[mp:.*]] = load i8** %{{.*}}, align 4
+// CHECK: icmp ne i8* %[[mp]], null
+// CHECK: br i1 %{{.*}} label %{{.*}}, label %{{.*}}
+//
+// memptr.convert: ; preds = %entry
+// CHECK: insertvalue { i8*, i32 } undef, i8* %[[mp]], 0
+// CHECK: insertvalue { i8*, i32 } %{{.*}}, i32 4, 1
+// CHECK: br label
+//
+// memptr.converted: ; preds = %memptr.convert, %entry
+// CHECK: phi { i8*, i32 } [ zeroinitializer, %{{.*}} ], [ {{.*}} ]
+// CHECK: }
+}
+
+void (B2::*convertMultipleFuncToB2(void (Multiple::*mp)()))() {
+// FIXME: cl emits warning C4407 on this code because of the representation
+// change. We might want to do the same.
+ return static_cast<void (B2::*)()>(mp);
+// FIXME: We should return i8* instead of i32 here. The ptrtoint cast prevents
+// LLVM from optimizing away the branch. This is likely a bug in
+// lib/CodeGen/TargetInfo.cpp with how we classify memptr types for returns.
+//
+// CHECK: define i32 @"\01?convertMultipleFuncToB2@@YAP8B2@@AEXXZP8Multiple@@AEXXZ@Z"{{.*}} {
+// CHECK: store
+// CHECK: %[[src:.*]] = load { i8*, i32 }* %{{.*}}, align 4
+// CHECK: extractvalue { i8*, i32 } %[[src]], 0
+// CHECK: icmp ne i8* %{{.*}}, null
+// CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}
+//
+// memptr.convert: ; preds = %entry
+// CHECK: %[[fp:.*]] = extractvalue { i8*, i32 } %[[src]], 0
+// CHECK: br label
+//
+// memptr.converted: ; preds = %memptr.convert, %entry
+// CHECK: phi i8* [ null, %{{.*}} ], [ %[[fp]], %{{.*}} ]
+// CHECK: }
+}
+
+namespace Test1 {
+
+struct A { int a; };
+struct B { int b; };
+struct C : virtual A { int c; };
+struct D : B, C { int d; };
+
+void (D::*convertCToD(void (C::*mp)()))() {
+ return mp;
+// CHECK: define void @"\01?convertCToD@Test1@@YAP8D@1@AEXXZP8C@1@AEXXZ@Z"{{.*}} {
+// CHECK: store
+// CHECK: load { i8*, i32, i32 }* %{{.*}}, align 4
+// CHECK: extractvalue { i8*, i32, i32 } %{{.*}}, 0
+// CHECK: icmp ne i8* %{{.*}}, null
+// CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}
+//
+// memptr.convert: ; preds = %entry
+// CHECK: extractvalue { i8*, i32, i32 } %{{.*}}, 0
+// CHECK: extractvalue { i8*, i32, i32 } %{{.*}}, 1
+// CHECK: extractvalue { i8*, i32, i32 } %{{.*}}, 2
+// CHECK: %[[adj:.*]] = add nsw i32 %{{.*}}, 4
+// CHECK: insertvalue { i8*, i32, i32 } undef, i8* {{.*}}, 0
+// CHECK: insertvalue { i8*, i32, i32 } {{.*}}, i32 %[[adj]], 1
+// CHECK: insertvalue { i8*, i32, i32 } {{.*}}, i32 {{.*}}, 2
+// CHECK: br label
+//
+// memptr.converted: ; preds = %memptr.convert, %entry
+// CHECK: phi { i8*, i32, i32 } [ { i8* null, i32 0, i32 -1 }, {{.*}} ], [ {{.*}} ]
+// CHECK: }
+}
+
+}
+
+namespace Test2 {
+// Test that we dynamically convert between different null reps.
+
+struct A { int a; };
+struct B : A { int b; };
+struct C : A {
+ int c;
+ virtual void hasVfPtr();
+};
+
+int A::*reinterpret(int B::*mp) {
+ return reinterpret_cast<int A::*>(mp);
+// CHECK: define i32 @"\01?reinterpret@Test2@@YAPQA@1@HPQB@1@H@Z"{{.*}} {
+// CHECK-NOT: select
+// CHECK: ret i32
+// CHECK: }
+}
+
+int A::*reinterpret(int C::*mp) {
+ return reinterpret_cast<int A::*>(mp);
+// CHECK: define i32 @"\01?reinterpret@Test2@@YAPQA@1@HPQC@1@H@Z"{{.*}} {
+// CHECK: %[[mp:.*]] = load i32*
+// CHECK: %[[cmp:.*]] = icmp ne i32 %[[mp]], 0
+// CHECK: select i1 %[[cmp]], i32 %[[mp]], i32 -1
+// CHECK: }
+}
+
+}
diff --git a/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
new file mode 100644
index 000000000000..802f0ca24175
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
@@ -0,0 +1,201 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -mconstructor-aliases -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+
+struct Left {
+ virtual void left();
+};
+
+struct Right {
+ virtual void right();
+};
+
+struct ChildNoOverride : Left, Right {
+};
+
+struct ChildOverride : Left, Right {
+ virtual void left();
+ virtual void right();
+};
+
+extern "C" void foo(void *);
+
+void call_left_no_override(ChildNoOverride *child) {
+// CHECK: define void @"\01?call_left_no_override
+// CHECK: %[[CHILD:.*]] = load %struct.ChildNoOverride
+
+ child->left();
+// Only need to cast 'this' to Left*.
+// CHECK: %[[LEFT:.*]] = bitcast %struct.ChildNoOverride* %[[CHILD]] to %struct.Left*
+// CHECK: %[[VFPTR:.*]] = bitcast %struct.Left* %[[LEFT]] to void (%struct.Left*)***
+// CHECK: %[[VFTABLE:.*]] = load void (%struct.Left*)*** %[[VFPTR]]
+// CHECK: %[[VFUN:.*]] = getelementptr inbounds void (%struct.Left*)** %[[VFTABLE]], i64 0
+// CHECK: %[[VFUN_VALUE:.*]] = load void (%struct.Left*)** %[[VFUN]]
+// CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](%struct.Left* %[[LEFT]])
+// CHECK: ret
+}
+
+void ChildOverride::left() {
+// CHECK: define x86_thiscallcc void @"\01?left@ChildOverride@@UAEXXZ"(%struct.ChildOverride* %[[THIS:.*]])
+//
+// No need to adjust 'this' as the ChildOverride's layout begins with Left.
+// CHECK: %[[THIS_ADDR:.*]] = alloca %struct.ChildOverride*, align 4
+// CHECK: store %struct.ChildOverride* %[[THIS]], %struct.ChildOverride** %[[THIS_ADDR]], align 4
+
+ foo(this);
+// CHECK: %[[THIS:.*]] = load %struct.ChildOverride** %[[THIS_ADDR]]
+// CHECK: %[[THIS_i8:.*]] = bitcast %struct.ChildOverride* %[[THIS]] to i8*
+// CHECK: call void @foo(i8* %[[THIS_i8]])
+// CHECK: ret
+}
+
+void call_left_override(ChildOverride *child) {
+// CHECK: define void @"\01?call_left_override
+// CHECK: %[[CHILD:.*]] = load %struct.ChildOverride
+
+ child->left();
+// CHECK: %[[VFPTR:.*]] = bitcast %struct.ChildOverride* %[[CHILD]] to void (%struct.ChildOverride*)***
+// CHECK: %[[VFTABLE:.*]] = load void (%struct.ChildOverride*)*** %[[VFPTR]]
+// CHECK: %[[VFUN:.*]] = getelementptr inbounds void (%struct.ChildOverride*)** %[[VFTABLE]], i64 0
+// CHECK: %[[VFUN_VALUE:.*]] = load void (%struct.ChildOverride*)** %[[VFUN]]
+//
+// CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](%struct.ChildOverride* %[[CHILD]])
+// CHECK: ret
+}
+
+void call_right_no_override(ChildNoOverride *child) {
+// CHECK: define void @"\01?call_right_no_override
+// CHECK: %[[CHILD:.*]] = load %struct.ChildNoOverride
+
+ child->right();
+// When calling a right base's virtual method, one needs to adjust 'this' at
+// the caller site.
+//
+// CHECK: %[[CHILD_i8:.*]] = bitcast %struct.ChildNoOverride* %[[CHILD]] to i8*
+// CHECK: %[[RIGHT_i8:.*]] = getelementptr inbounds i8* %[[CHILD_i8]], i32 4
+// CHECK: %[[RIGHT:.*]] = bitcast i8* %[[RIGHT_i8]] to %struct.Right*
+//
+// CHECK: %[[VFPTR:.*]] = bitcast %struct.Right* %[[RIGHT]] to void (%struct.Right*)***
+// CHECK: %[[VFTABLE:.*]] = load void (%struct.Right*)*** %[[VFPTR]]
+// CHECK: %[[VFUN:.*]] = getelementptr inbounds void (%struct.Right*)** %[[VFTABLE]], i64 0
+// CHECK: %[[VFUN_VALUE:.*]] = load void (%struct.Right*)** %[[VFUN]]
+// CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](%struct.Right* %[[RIGHT]])
+// CHECK: ret
+}
+
+void ChildOverride::right() {
+// CHECK: define x86_thiscallcc void @"\01?right@ChildOverride@@UAEXXZ"(i8*
+//
+// ChildOverride::right gets 'this' cast to Right* in ECX (i.e. this+4) so we
+// need to adjust 'this' before use.
+//
+// CHECK: %[[THIS_ADDR:.*]] = alloca %struct.ChildOverride*, align 4
+// CHECK: %[[THIS_i8:.*]] = getelementptr inbounds i8* %[[ECX:.*]], i32 -4
+// CHECK: %[[THIS:.*]] = bitcast i8* %[[THIS_i8]] to %struct.ChildOverride*
+// CHECK: store %struct.ChildOverride* %[[THIS]], %struct.ChildOverride** %[[THIS_ADDR]], align 4
+
+ foo(this);
+// CHECK: %[[THIS:.*]] = load %struct.ChildOverride** %[[THIS_ADDR]]
+// CHECK: %[[THIS_PARAM:.*]] = bitcast %struct.ChildOverride* %[[THIS]] to i8*
+// CHECK: call void @foo(i8* %[[THIS_PARAM]])
+// CHECK: ret
+}
+
+void call_right_override(ChildOverride *child) {
+// CHECK: define void @"\01?call_right_override
+// CHECK: %[[CHILD:.*]] = load %struct.ChildOverride
+
+ child->right();
+// When calling a right child's virtual method, one needs to adjust 'this' at
+// the caller site.
+//
+// CHECK: %[[CHILD_i8:.*]] = bitcast %struct.ChildOverride* %[[CHILD]] to i8*
+//
+// CHECK: %[[VFPTR_i8:.*]] = getelementptr inbounds i8* %[[CHILD_i8]], i32 4
+// CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VFPTR_i8]] to void (i8*)***
+// CHECK: %[[VFTABLE:.*]] = load void (i8*)*** %[[VFPTR]]
+// CHECK: %[[VFUN:.*]] = getelementptr inbounds void (i8*)** %[[VFTABLE]], i64 0
+// CHECK: %[[VFUN_VALUE:.*]] = load void (i8*)** %[[VFUN]]
+//
+// CHECK: %[[CHILD_i8:.*]] = bitcast %struct.ChildOverride* %[[CHILD]] to i8*
+// CHECK: %[[RIGHT:.*]] = getelementptr inbounds i8* %[[CHILD_i8]], i32 4
+//
+// CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](i8* %[[RIGHT]])
+// CHECK: ret
+}
+
+struct GrandchildOverride : ChildOverride {
+ virtual void right();
+};
+
+void GrandchildOverride::right() {
+// CHECK: define x86_thiscallcc void @"\01?right@GrandchildOverride@@UAEXXZ"(i8*
+//
+// CHECK: %[[THIS_ADDR:.*]] = alloca %struct.GrandchildOverride*, align 4
+// CHECK: %[[THIS_i8:.*]] = getelementptr inbounds i8* %[[ECX:.*]], i32 -4
+// CHECK: %[[THIS:.*]] = bitcast i8* %[[THIS_i8]] to %struct.GrandchildOverride*
+// CHECK: store %struct.GrandchildOverride* %[[THIS]], %struct.GrandchildOverride** %[[THIS_ADDR]], align 4
+
+ foo(this);
+// CHECK: %[[THIS:.*]] = load %struct.GrandchildOverride** %[[THIS_ADDR]]
+// CHECK: %[[THIS_PARAM:.*]] = bitcast %struct.GrandchildOverride* %[[THIS]] to i8*
+// CHECK: call void @foo(i8* %[[THIS_PARAM]])
+// CHECK: ret
+}
+
+void call_grandchild_right(GrandchildOverride *obj) {
+ // Just make sure we don't crash.
+ obj->right();
+}
+
+void emit_ctors() {
+ Left l;
+ // CHECK: define {{.*}} @"\01??0Left@@QAE@XZ"
+ // CHECK-NOT: getelementptr
+ // CHECK: store [1 x i8*]* @"\01??_7Left@@6B@"
+ // CHECK: ret
+
+ Right r;
+ // CHECK: define {{.*}} @"\01??0Right@@QAE@XZ"
+ // CHECK-NOT: getelementptr
+ // CHECK: store [1 x i8*]* @"\01??_7Right@@6B@"
+ // CHECK: ret
+
+ ChildOverride co;
+ // CHECK: define {{.*}} @"\01??0ChildOverride@@QAE@XZ"
+ // CHECK: %[[THIS:.*]] = load %struct.ChildOverride**
+ // CHECK: %[[VFPTR:.*]] = bitcast %struct.ChildOverride* %[[THIS]] to [1 x i8*]**
+ // CHECK: store [1 x i8*]* @"\01??_7ChildOverride@@6BLeft@@@", [1 x i8*]** %[[VFPTR]]
+ // CHECK: %[[THIS_i8:.*]] = bitcast %struct.ChildOverride* %[[THIS]] to i8*
+ // CHECK: %[[VFPTR_i8:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i32 4
+ // CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VFPTR_i8]] to [1 x i8*]**
+ // CHECK: store [1 x i8*]* @"\01??_7ChildOverride@@6BRight@@@", [1 x i8*]** %[[VFPTR]]
+ // CHECK: ret
+
+ GrandchildOverride gc;
+ // CHECK: define {{.*}} @"\01??0GrandchildOverride@@QAE@XZ"
+ // CHECK: %[[THIS:.*]] = load %struct.GrandchildOverride**
+ // CHECK: %[[VFPTR:.*]] = bitcast %struct.GrandchildOverride* %[[THIS]] to [1 x i8*]**
+ // CHECK: store [1 x i8*]* @"\01??_7GrandchildOverride@@6BLeft@@@", [1 x i8*]** %[[VFPTR]]
+ // CHECK: %[[THIS_i8:.*]] = bitcast %struct.GrandchildOverride* %[[THIS]] to i8*
+ // CHECK: %[[VFPTR_i8:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i32 4
+ // CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VFPTR_i8]] to [1 x i8*]**
+ // CHECK: store [1 x i8*]* @"\01??_7GrandchildOverride@@6BRight@@@", [1 x i8*]** %[[VFPTR]]
+ // CHECK: ret
+}
+
+struct LeftWithNonVirtualDtor {
+ virtual void left();
+ ~LeftWithNonVirtualDtor();
+};
+
+struct AsymmetricChild : LeftWithNonVirtualDtor, Right {
+ virtual ~AsymmetricChild();
+};
+
+void call_asymmetric_child_complete_dtor() {
+ // CHECK-LABEL: define void @"\01?call_asymmetric_child_complete_dtor@@YAXXZ"
+ AsymmetricChild obj;
+ // CHECK: call x86_thiscallcc %struct.AsymmetricChild* @"\01??0AsymmetricChild@@QAE@XZ"(%struct.AsymmetricChild* %[[OBJ:.*]])
+ // CHECK-NOT: getelementptr
+ // CHECK: call x86_thiscallcc void @"\01??1AsymmetricChild@@UAE@XZ"(%struct.AsymmetricChild* %[[OBJ]])
+ // CHECK: ret
+}
diff --git a/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp b/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
index 060c1728586c..d0750e6ebe91 100644
--- a/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
+++ b/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-linux | FileCheck -check-prefix LINUX %s
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -cxx-abi microsoft | FileCheck -check-prefix WIN32 %s
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-win32 -cxx-abi microsoft | FileCheck -check-prefix WIN64 %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -cxx-abi microsoft -fno-rtti | FileCheck -check-prefix WIN32 %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-win32 -mconstructor-aliases -cxx-abi microsoft -fno-rtti | FileCheck -check-prefix WIN64 %s
struct Empty {};
@@ -22,6 +22,12 @@ struct SmallWithCtor {
int x;
};
+struct SmallWithDtor {
+ SmallWithDtor();
+ ~SmallWithDtor();
+ int x;
+};
+
struct SmallWithVftable {
int x;
virtual void foo();
@@ -43,70 +49,108 @@ struct Big {
// Returning structs that fit into a register.
Small small_return() { return Small(); }
-// LINUX: define void @_Z12small_returnv(%struct.Small* noalias sret %agg.result)
+// LINUX-LABEL: define void @_Z12small_returnv(%struct.Small* noalias sret %agg.result)
// WIN32: define i32 @"\01?small_return@@YA?AUSmall@@XZ"()
// WIN64: define i32 @"\01?small_return@@YA?AUSmall@@XZ"()
Medium medium_return() { return Medium(); }
-// LINUX: define void @_Z13medium_returnv(%struct.Medium* noalias sret %agg.result)
+// LINUX-LABEL: define void @_Z13medium_returnv(%struct.Medium* noalias sret %agg.result)
// WIN32: define i64 @"\01?medium_return@@YA?AUMedium@@XZ"()
// WIN64: define i64 @"\01?medium_return@@YA?AUMedium@@XZ"()
// Returning structs that fit into a register but are not POD.
SmallCpp11NotCpp03Pod small_non_pod_return() { return SmallCpp11NotCpp03Pod(); }
-// LINUX: define void @_Z20small_non_pod_returnv(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result)
+// LINUX-LABEL: define void @_Z20small_non_pod_returnv(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result)
// WIN32: define void @"\01?small_non_pod_return@@YA?AUSmallCpp11NotCpp03Pod@@XZ"(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result)
// WIN64: define void @"\01?small_non_pod_return@@YA?AUSmallCpp11NotCpp03Pod@@XZ"(%struct.SmallCpp11NotCpp03Pod* noalias sret %agg.result)
SmallWithCtor small_with_ctor_return() { return SmallWithCtor(); }
-// LINUX: define void @_Z22small_with_ctor_returnv(%struct.SmallWithCtor* noalias sret %agg.result)
+// LINUX-LABEL: define void @_Z22small_with_ctor_returnv(%struct.SmallWithCtor* noalias sret %agg.result)
// WIN32: define void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result)
// WIN64: define void @"\01?small_with_ctor_return@@YA?AUSmallWithCtor@@XZ"(%struct.SmallWithCtor* noalias sret %agg.result)
SmallWithVftable small_with_vftable_return() { return SmallWithVftable(); }
-// LINUX: define void @_Z25small_with_vftable_returnv(%struct.SmallWithVftable* noalias sret %agg.result)
+// LINUX-LABEL: define void @_Z25small_with_vftable_returnv(%struct.SmallWithVftable* noalias sret %agg.result)
// WIN32: define void @"\01?small_with_vftable_return@@YA?AUSmallWithVftable@@XZ"(%struct.SmallWithVftable* noalias sret %agg.result)
// WIN64: define void @"\01?small_with_vftable_return@@YA?AUSmallWithVftable@@XZ"(%struct.SmallWithVftable* noalias sret %agg.result)
MediumWithCopyCtor medium_with_copy_ctor_return() { return MediumWithCopyCtor(); }
-// LINUX: define void @_Z28medium_with_copy_ctor_returnv(%struct.MediumWithCopyCtor* noalias sret %agg.result)
+// LINUX-LABEL: define void @_Z28medium_with_copy_ctor_returnv(%struct.MediumWithCopyCtor* noalias sret %agg.result)
// WIN32: define void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result)
// WIN64: define void @"\01?medium_with_copy_ctor_return@@YA?AUMediumWithCopyCtor@@XZ"(%struct.MediumWithCopyCtor* noalias sret %agg.result)
// Returning a large struct that doesn't fit into a register.
Big big_return() { return Big(); }
-// LINUX: define void @_Z10big_returnv(%struct.Big* noalias sret %agg.result)
+// LINUX-LABEL: define void @_Z10big_returnv(%struct.Big* noalias sret %agg.result)
// WIN32: define void @"\01?big_return@@YA?AUBig@@XZ"(%struct.Big* noalias sret %agg.result)
// WIN64: define void @"\01?big_return@@YA?AUBig@@XZ"(%struct.Big* noalias sret %agg.result)
void small_arg(Small s) {}
-// LINUX: define void @_Z9small_arg5Small(%struct.Small* byval align 4 %s)
+// LINUX-LABEL: define void @_Z9small_arg5Small(%struct.Small* byval align 4 %s)
// WIN32: define void @"\01?small_arg@@YAXUSmall@@@Z"(%struct.Small* byval align 4 %s)
// WIN64: define void @"\01?small_arg@@YAXUSmall@@@Z"(i32 %s.coerce)
void medium_arg(Medium s) {}
-// LINUX: define void @_Z10medium_arg6Medium(%struct.Medium* byval align 4 %s)
+// LINUX-LABEL: define void @_Z10medium_arg6Medium(%struct.Medium* byval align 4 %s)
// WIN32: define void @"\01?medium_arg@@YAXUMedium@@@Z"(%struct.Medium* byval align 4 %s)
// WIN64: define void @"\01?medium_arg@@YAXUMedium@@@Z"(i64 %s.coerce)
void small_arg_with_ctor(SmallWithCtor s) {}
-// LINUX: define void @_Z19small_arg_with_ctor13SmallWithCtor(%struct.SmallWithCtor* byval align 4 %s)
+// LINUX-LABEL: define void @_Z19small_arg_with_ctor13SmallWithCtor(%struct.SmallWithCtor* byval align 4 %s)
// WIN32: define void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"(%struct.SmallWithCtor* byval align 4 %s)
// WIN64: define void @"\01?small_arg_with_ctor@@YAXUSmallWithCtor@@@Z"(i32 %s.coerce)
+// Test that dtors are invoked in the callee.
+void small_arg_with_dtor(SmallWithDtor s) {}
+// WIN32: define void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(%struct.SmallWithDtor* byval align 4 %s) {{.*}} {
+// WIN32: call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE@XZ"(%struct.SmallWithDtor* %s)
+// WIN32: }
+// WIN64: define void @"\01?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(%struct.SmallWithDtor* byval %s) {{.*}} {
+// WIN64: call void @"\01??1SmallWithDtor@@QEAA@XZ"(%struct.SmallWithDtor* %s)
+// WIN64: }
+
+// Test that references aren't destroyed in the callee.
+void ref_small_arg_with_dtor(const SmallWithDtor &s) { }
+// WIN32: define void @"\01?ref_small_arg_with_dtor@@YAXABUSmallWithDtor@@@Z"(%struct.SmallWithDtor* %s) {{.*}} {
+// WIN32-NOT: call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE@XZ"
+// WIN32: }
+
+// Test that temporaries passed by reference are destroyed in the caller.
+void temporary_ref_with_dtor() {
+ ref_small_arg_with_dtor(SmallWithDtor());
+}
+// WIN32: define void @"\01?temporary_ref_with_dtor@@YAXXZ"() {{.*}} {
+// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE@XZ"
+// WIN32: call void @"\01?ref_small_arg_with_dtor@@YAXABUSmallWithDtor@@@Z"
+// WIN32: call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE@XZ"
+// WIN32: }
+
+void takes_two_by_val_with_dtor(SmallWithDtor a, SmallWithDtor b);
+void eh_cleanup_arg_with_dtor() {
+ takes_two_by_val_with_dtor(SmallWithDtor(), SmallWithDtor());
+}
+// When exceptions are off, we don't have any cleanups. See
+// microsoft-abi-exceptions.cpp for these cleanups.
+// WIN32: define void @"\01?eh_cleanup_arg_with_dtor@@YAXXZ"() {{.*}} {
+// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE@XZ"
+// WIN32: call x86_thiscallcc %struct.SmallWithDtor* @"\01??0SmallWithDtor@@QAE@XZ"
+// WIN32: call void @"\01?takes_two_by_val_with_dtor@@YAXUSmallWithDtor@@0@Z"
+// WIN32-NOT: call x86_thiscallcc void @"\01??1SmallWithDtor@@QAE@XZ"
+// WIN32: }
+
void small_arg_with_vftable(SmallWithVftable s) {}
-// LINUX: define void @_Z22small_arg_with_vftable16SmallWithVftable(%struct.SmallWithVftable* %s)
+// LINUX-LABEL: define void @_Z22small_arg_with_vftable16SmallWithVftable(%struct.SmallWithVftable* %s)
// WIN32: define void @"\01?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(%struct.SmallWithVftable* byval align 4 %s)
// WIN64: define void @"\01?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(%struct.SmallWithVftable* byval %s)
void medium_arg_with_copy_ctor(MediumWithCopyCtor s) {}
-// LINUX: define void @_Z25medium_arg_with_copy_ctor18MediumWithCopyCtor(%struct.MediumWithCopyCtor* %s)
+// LINUX-LABEL: define void @_Z25medium_arg_with_copy_ctor18MediumWithCopyCtor(%struct.MediumWithCopyCtor* %s)
// WIN32: define void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* byval align 4 %s)
// WIN64: define void @"\01?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* byval %s)
void big_arg(Big s) {}
-// LINUX: define void @_Z7big_arg3Big(%struct.Big* byval align 4 %s)
+// LINUX-LABEL: define void @_Z7big_arg3Big(%struct.Big* byval align 4 %s)
// WIN32: define void @"\01?big_arg@@YAXUBig@@@Z"(%struct.Big* byval align 4 %s)
// WIN64: define void @"\01?big_arg@@YAXUBig@@@Z"(%struct.Big* %s)
@@ -167,3 +211,19 @@ void use_class() {
c.thiscall_method_arg(SmallWithCtor());
c.thiscall_method_arg(Big());
}
+
+struct X {
+ X();
+ ~X();
+};
+void g(X) {
+}
+// WIN32: define void @"\01?g@@YAXUX@@@Z"(%struct.X* byval align 4) {{.*}} {
+// WIN32: call x86_thiscallcc void @"\01??1X@@QAE@XZ"(%struct.X* %0)
+// WIN32: }
+void f() {
+ g(X());
+}
+// WIN32: define void @"\01?f@@YAXXZ"() {{.*}} {
+// WIN32-NOT: call {{.*}} @"\01??1X@@QAE@XZ"
+// WIN32: }
diff --git a/test/CodeGenCXX/microsoft-abi-static-initializers.cpp b/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
index 35e343bc4d3c..c0b972212357 100644
--- a/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
+++ b/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
@@ -1,19 +1,85 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -mconstructor-aliases -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+
+// CHECK: @llvm.global_ctors = appending global [2 x { i32, void ()* }]
+// CHECK: [{ i32, void ()* } { i32 65535, void ()* @"\01??__Efoo@?$B@H@@YAXXZ" },
+// CHECK: { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }]
struct S {
- S() {}
- ~S() {}
-} s;
+ S();
+ ~S();
+};
-// CHECK: define internal void [[INIT_s:@.*global_var.*]] [[NUW:#[0-9]+]]
+S s;
+
+// CHECK: define internal void @"\01??__Es@@YAXXZ"() [[NUW:#[0-9]+]]
// CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc %struct.S* @"\01??0S@@QAE@XZ"
-// CHECK: call i32 @atexit(void ()* @"__dtor_\01?s@@3US@@A")
+// CHECK: call i32 @atexit(void ()* @"\01??__Fs@@YAXXZ")
// CHECK: ret void
-// CHECK: define internal void @"__dtor_\01?s@@3US@@A"() [[NUW]] {
+// CHECK: define internal void @"\01??__Fs@@YAXXZ"() [[NUW]] {
// CHECK: call x86_thiscallcc void @"\01??1S@@QAE@XZ"
// CHECK: ret void
+void StaticLocal() {
+ static S TheS;
+}
+// CHECK-LABEL: define void @"\01?StaticLocal@@YAXXZ"()
+// CHECK: load i32* @"\01?$S1@?1??StaticLocal@@YAXXZ@4IA"
+// CHECK: store i32 {{.*}}, i32* @"\01?$S1@?1??StaticLocal@@YAXXZ@4IA"
+// CHECK: ret
+
+void MultipleStatics() {
+ static S S1;
+ static S S2;
+ static S S3;
+ static S S4;
+ static S S5;
+ static S S6;
+ static S S7;
+ static S S8;
+ static S S9;
+ static S S10;
+ static S S11;
+ static S S12;
+ static S S13;
+ static S S14;
+ static S S15;
+ static S S16;
+ static S S17;
+ static S S18;
+ static S S19;
+ static S S20;
+ static S S21;
+ static S S22;
+ static S S23;
+ static S S24;
+ static S S25;
+ static S S26;
+ static S S27;
+ static S S28;
+ static S S29;
+ static S S30;
+ static S S31;
+ static S S32;
+ static S S33;
+ static S S34;
+ static S S35;
+}
+// CHECK-LABEL: define void @"\01?MultipleStatics@@YAXXZ"()
+// CHECK: load i32* @"\01?$S1@?1??MultipleStatics@@YAXXZ@4IA"
+// CHECK: and i32 {{.*}}, 1
+// CHECK: and i32 {{.*}}, 2
+// CHECK: and i32 {{.*}}, 4
+// CHECK: and i32 {{.*}}, 8
+// CHECK: and i32 {{.*}}, 16
+// ...
+// CHECK: and i32 {{.*}}, -2147483648
+// CHECK: load i32* @"\01?$S1@?1??MultipleStatics@@YAXXZ@4IA1"
+// CHECK: and i32 {{.*}}, 1
+// CHECK: and i32 {{.*}}, 2
+// CHECK: and i32 {{.*}}, 4
+// CHECK: ret
+
// Force WeakODRLinkage by using templates
class A {
public:
@@ -29,26 +95,60 @@ class B {
template<typename T> A B<T>::foo;
+inline S &UnreachableStatic() {
+ if (0) {
+ static S s; // bit 1
+ return s;
+ }
+ static S s; // bit 2
+ return s;
+}
+
+// CHECK-LABEL: define linkonce_odr %struct.S* @"\01?UnreachableStatic@@YAAAUS@@XZ"()
+// CHECK: and i32 {{.*}}, 2
+// CHECK: or i32 {{.*}}, 2
+// CHECK: ret
+
+inline S &getS() {
+ static S TheS;
+ return TheS;
+}
+
+// CHECK-LABEL: define linkonce_odr %struct.S* @"\01?getS@@YAAAUS@@XZ"
+// CHECK: load i32* @"\01??_B?1??getS@@YAAAUS@@XZ@51"
+// CHECK: and i32 {{.*}}, 1
+// CHECK: icmp ne i32 {{.*}}, 0
+// CHECK: br i1
+// init:
+// CHECK: or i32 {{.*}}, 1
+// CHECK: store i32 {{.*}}, i32* @"\01??_B?1??getS@@YAAAUS@@XZ@51"
+// CHECK: call x86_thiscallcc %struct.S* @"\01??0S@@QAE@XZ"(%struct.S* @"\01?TheS@?1??getS@@YAAAUS@@XZ@4U2@A")
+// CHECK: call i32 @atexit(void ()* @"\01??__FTheS@?1??getS@@YAAAUS@@XZ@YAXXZ")
+// CHECK: br label
+// init.end:
+// CHECK: ret %struct.S* @"\01?TheS@?1??getS@@YAAAUS@@XZ@4U2@A"
+
void force_usage() {
+ UnreachableStatic();
+ getS();
(void)B<int>::foo; // (void) - force usage
}
-// CHECK: define internal void [[INIT_foo:@.*global_var.*]] [[NUW]]
+// CHECK: define internal void @"\01??__Efoo@?$B@H@@YAXXZ"() [[NUW]]
// CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc %class.A* @"\01??0A@@QAE@XZ"
-// CHECK: call i32 @atexit(void ()* [[FOO_DTOR:@"__dtor_.*foo@.*]])
+// CHECK: call i32 @atexit(void ()* @"\01??__Ffoo@?$B@H@@YAXXZ")
// CHECK: ret void
// CHECK: define linkonce_odr x86_thiscallcc %class.A* @"\01??0A@@QAE@XZ"
// CHECK: define linkonce_odr x86_thiscallcc void @"\01??1A@@QAE@XZ"
-// CHECK: define internal void [[FOO_DTOR]]
+// CHECK: define internal void @"\01??__Ffoo@?$B@H@@YAXXZ"
// CHECK: call x86_thiscallcc void @"\01??1A@@QAE@XZ"{{.*}}foo
// CHECK: ret void
// CHECK: define internal void @_GLOBAL__I_a() [[NUW]] {
-// CHECK: call void [[INIT_s]]
-// CHECK: call void [[INIT_foo]]
+// CHECK: call void @"\01??__Es@@YAXXZ"()
// CHECK: ret void
// CHECK: attributes [[NUW]] = { nounwind }
diff --git a/test/CodeGenCXX/microsoft-abi-structors-alias.cpp b/test/CodeGenCXX/microsoft-abi-structors-alias.cpp
new file mode 100644
index 000000000000..d54520fab72c
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-structors-alias.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 -fno-rtti -mconstructor-aliases | FileCheck %s
+
+namespace test1 {
+template <typename T> class A {
+ ~A() {}
+};
+template class A<char>;
+// CHECK: define weak_odr x86_thiscallcc void @"\01??1?$A@D@test1@@AAE@XZ"
+}
diff --git a/test/CodeGenCXX/microsoft-abi-structors.cpp b/test/CodeGenCXX/microsoft-abi-structors.cpp
index 864540d425ef..c2f1395f47df 100644
--- a/test/CodeGenCXX/microsoft-abi-structors.cpp
+++ b/test/CodeGenCXX/microsoft-abi-structors.cpp
@@ -1,27 +1,31 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 -fno-rtti > %t 2>&1
+// RUN: %clang_cc1 -emit-llvm %s -o - -mconstructor-aliases -cxx-abi microsoft -triple=i386-pc-win32 -fno-rtti > %t
// RUN: FileCheck %s < %t
-// Using a different check prefix as the inline destructors might be placed
-// anywhere in the output.
-// RUN: FileCheck --check-prefix=DTORS %s < %t
+// vftables are emitted very late, so do another pass to try to keep the checks
+// in source order.
+// RUN: FileCheck --check-prefix DTORS %s < %t
+//
+// RUN: %clang_cc1 -emit-llvm %s -o - -mconstructor-aliases -cxx-abi microsoft -triple=x86_64-pc-win32 -fno-rtti | FileCheck --check-prefix DTORS-X64 %s
namespace basic {
class A {
public:
A() { }
- ~A() { }
+ ~A();
};
void no_constructor_destructor_infinite_recursion() {
A a;
-// CHECK: define linkonce_odr x86_thiscallcc %"class.basic::A"* @"\01??0A@basic@@QAE@XZ"(%"class.basic::A"* %this)
+// CHECK: define linkonce_odr x86_thiscallcc %"class.basic::A"* @"\01??0A@basic@@QAE@XZ"(%"class.basic::A"* returned %this)
// CHECK: [[THIS_ADDR:%[.0-9A-Z_a-z]+]] = alloca %"class.basic::A"*, align 4
// CHECK-NEXT: store %"class.basic::A"* %this, %"class.basic::A"** [[THIS_ADDR]], align 4
// CHECK-NEXT: [[T1:%[.0-9A-Z_a-z]+]] = load %"class.basic::A"** [[THIS_ADDR]]
// CHECK-NEXT: ret %"class.basic::A"* [[T1]]
// CHECK-NEXT: }
+}
+A::~A() {
// Make sure that the destructor doesn't call itself:
// CHECK: define {{.*}} @"\01??1A@basic@@QAE@XZ"
// CHECK-NOT: call void @"\01??1A@basic@@QAE@XZ"
@@ -34,33 +38,29 @@ struct B {
// Tests that we can define constructors outside the class (PR12784).
B::B() {
- // CHECK: define x86_thiscallcc %"struct.basic::B"* @"\01??0B@basic@@QAE@XZ"(%"struct.basic::B"* %this)
+ // CHECK: define x86_thiscallcc %"struct.basic::B"* @"\01??0B@basic@@QAE@XZ"(%"struct.basic::B"* returned %this)
// CHECK: ret
}
struct C {
virtual ~C() {
-// Complete destructor first:
-// DTORS: define {{.*}} x86_thiscallcc void @"\01??1C@basic@@UAE@XZ"(%"struct.basic::C"* %this)
-
-// Then, the scalar deleting destructor (used in the vtable):
-// FIXME: add a test that verifies that the out-of-line scalar deleting
-// destructor is linkonce_odr too.
-// DTORS: define linkonce_odr x86_thiscallcc void @"\01??_GC@basic@@UAEPAXI@Z"(%"struct.basic::C"* %this, i1 zeroext %should_call_delete)
-// DTORS: %[[FROMBOOL:[0-9a-z]+]] = zext i1 %should_call_delete to i8
-// DTORS-NEXT: store i8 %[[FROMBOOL]], i8* %[[SHOULD_DELETE_VAR:[0-9a-z._]+]], align 1
-// DTORS: %[[SHOULD_DELETE_VALUE:[0-9a-z._]+]] = load i8* %[[SHOULD_DELETE_VAR]]
+// DTORS: define linkonce_odr x86_thiscallcc void @"\01??_GC@basic@@UAEPAXI@Z"(%"struct.basic::C"* %this, i32 %should_call_delete)
+// DTORS: store i32 %should_call_delete, i32* %[[SHOULD_DELETE_VAR:[0-9a-z._]+]], align 4
+// DTORS: %[[SHOULD_DELETE_VALUE:[0-9a-z._]+]] = load i32* %[[SHOULD_DELETE_VAR]]
// DTORS: call x86_thiscallcc void @"\01??1C@basic@@UAE@XZ"(%"struct.basic::C"* %[[THIS:[0-9a-z]+]])
-// DTORS-NEXT: %[[CONDITION:[0-9]+]] = icmp eq i8 %[[SHOULD_DELETE_VALUE]], 0
+// DTORS-NEXT: %[[CONDITION:[0-9]+]] = icmp eq i32 %[[SHOULD_DELETE_VALUE]], 0
// DTORS-NEXT: br i1 %[[CONDITION]], label %[[CONTINUE_LABEL:[0-9a-z._]+]], label %[[CALL_DELETE_LABEL:[0-9a-z._]+]]
//
// DTORS: [[CALL_DELETE_LABEL]]
// DTORS-NEXT: %[[THIS_AS_VOID:[0-9a-z]+]] = bitcast %"struct.basic::C"* %[[THIS]] to i8*
-// DTORS-NEXT: call void @"\01??3@YAXPAX@Z"(i8* %[[THIS_AS_VOID]]) [[NUW:#[0-9]+]]
+// DTORS-NEXT: call void @"\01??3@YAXPAX@Z"(i8* %[[THIS_AS_VOID]])
// DTORS-NEXT: br label %[[CONTINUE_LABEL]]
//
// DTORS: [[CONTINUE_LABEL]]
// DTORS-NEXT: ret void
+
+// Check that we do the mangling correctly on x64.
+// DTORS-X64: @"\01??_GC@basic@@UEAAPEAXI@Z"
}
virtual void foo();
};
@@ -71,19 +71,19 @@ void C::foo() {}
void check_vftable_offset() {
C c;
// The vftable pointer should point at the beginning of the vftable.
-// CHECK: [[THIS_PTR:%[0-9]+]] = bitcast %"struct.basic::C"* {{.*}} to i8***
-// CHECK: store i8** getelementptr inbounds ([2 x i8*]* @"\01??_7C@basic@@6B@", i64 0, i64 0), i8*** [[THIS_PTR]]
+// CHECK: [[THIS_PTR:%[0-9]+]] = bitcast %"struct.basic::C"* {{.*}} to [2 x i8*]**
+// CHECK: store [2 x i8*]* @"\01??_7C@basic@@6B@", [2 x i8*]** [[THIS_PTR]]
}
void call_complete_dtor(C *obj_ptr) {
// CHECK: define void @"\01?call_complete_dtor@basic@@YAXPAUC@1@@Z"(%"struct.basic::C"* %obj_ptr)
obj_ptr->~C();
// CHECK: %[[OBJ_PTR_VALUE:.*]] = load %"struct.basic::C"** %{{.*}}, align 4
-// CHECK-NEXT: %[[PVTABLE:.*]] = bitcast %"struct.basic::C"* %[[OBJ_PTR_VALUE]] to void (%"struct.basic::C"*, i1)***
-// CHECK-NEXT: %[[VTABLE:.*]] = load void (%"struct.basic::C"*, i1)*** %[[PVTABLE]]
-// CHECK-NEXT: %[[PVDTOR:.*]] = getelementptr inbounds void (%"struct.basic::C"*, i1)** %[[VTABLE]], i64 0
-// CHECK-NEXT: %[[VDTOR:.*]] = load void (%"struct.basic::C"*, i1)** %[[PVDTOR]]
-// CHECK-NEXT: call x86_thiscallcc void %[[VDTOR]](%"struct.basic::C"* %[[OBJ_PTR_VALUE]], i1 zeroext false)
+// CHECK-NEXT: %[[PVTABLE:.*]] = bitcast %"struct.basic::C"* %[[OBJ_PTR_VALUE]] to void (%"struct.basic::C"*, i32)***
+// CHECK-NEXT: %[[VTABLE:.*]] = load void (%"struct.basic::C"*, i32)*** %[[PVTABLE]]
+// CHECK-NEXT: %[[PVDTOR:.*]] = getelementptr inbounds void (%"struct.basic::C"*, i32)** %[[VTABLE]], i64 0
+// CHECK-NEXT: %[[VDTOR:.*]] = load void (%"struct.basic::C"*, i32)** %[[PVDTOR]]
+// CHECK-NEXT: call x86_thiscallcc void %[[VDTOR]](%"struct.basic::C"* %[[OBJ_PTR_VALUE]], i32 0)
// CHECK-NEXT: ret void
}
@@ -94,11 +94,11 @@ void call_deleting_dtor(C *obj_ptr) {
// CHECK: br i1 {{.*}}, label %[[DELETE_NULL:.*]], label %[[DELETE_NOTNULL:.*]]
// CHECK: [[DELETE_NOTNULL]]
-// CHECK-NEXT: %[[PVTABLE:.*]] = bitcast %"struct.basic::C"* %[[OBJ_PTR_VALUE]] to void (%"struct.basic::C"*, i1)***
-// CHECK-NEXT: %[[VTABLE:.*]] = load void (%"struct.basic::C"*, i1)*** %[[PVTABLE]]
-// CHECK-NEXT: %[[PVDTOR:.*]] = getelementptr inbounds void (%"struct.basic::C"*, i1)** %[[VTABLE]], i64 0
-// CHECK-NEXT: %[[VDTOR:.*]] = load void (%"struct.basic::C"*, i1)** %[[PVDTOR]]
-// CHECK-NEXT: call x86_thiscallcc void %[[VDTOR]](%"struct.basic::C"* %[[OBJ_PTR_VALUE]], i1 zeroext true)
+// CHECK-NEXT: %[[PVTABLE:.*]] = bitcast %"struct.basic::C"* %[[OBJ_PTR_VALUE]] to void (%"struct.basic::C"*, i32)***
+// CHECK-NEXT: %[[VTABLE:.*]] = load void (%"struct.basic::C"*, i32)*** %[[PVTABLE]]
+// CHECK-NEXT: %[[PVDTOR:.*]] = getelementptr inbounds void (%"struct.basic::C"*, i32)** %[[VTABLE]], i64 0
+// CHECK-NEXT: %[[VDTOR:.*]] = load void (%"struct.basic::C"*, i32)** %[[PVDTOR]]
+// CHECK-NEXT: call x86_thiscallcc void %[[VDTOR]](%"struct.basic::C"* %[[OBJ_PTR_VALUE]], i32 1)
// CHECK: ret void
}
@@ -119,8 +119,6 @@ struct D {
void use_D() { D c; }
-// DTORS: attributes [[NUW]] = { nounwind{{.*}} }
-
} // end namespace basic
@@ -136,7 +134,7 @@ struct B : A {
};
B::B() {
- // CHECK: define x86_thiscallcc %"struct.constructors::B"* @"\01??0B@constructors@@QAE@XZ"(%"struct.constructors::B"* %this)
+ // CHECK: define x86_thiscallcc %"struct.constructors::B"* @"\01??0B@constructors@@QAE@XZ"(%"struct.constructors::B"* returned %this)
// CHECK: call x86_thiscallcc %"struct.constructors::A"* @"\01??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}})
// CHECK: ret
}
@@ -146,7 +144,7 @@ struct C : virtual A {
};
C::C() {
- // CHECK: define x86_thiscallcc %"struct.constructors::C"* @"\01??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* %this, i32 %is_most_derived)
+ // CHECK: define x86_thiscallcc %"struct.constructors::C"* @"\01??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* returned %this, i32 %is_most_derived)
// TODO: make sure this works in the Release build too;
// CHECK: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4
// CHECK: %[[IS_MOST_DERIVED_VAL:.*]] = load i32* %[[IS_MOST_DERIVED_VAR]]
@@ -154,12 +152,19 @@ C::C() {
// CHECK: br i1 %[[SHOULD_CALL_VBASE_CTORS]], label %[[INIT_VBASES:.*]], label %[[SKIP_VBASES:.*]]
//
// CHECK: [[INIT_VBASES]]
- // CHECK-NEXT: bitcast %"struct.constructors::C"* %{{.*}} to %"struct.constructors::A"*
+ // CHECK-NEXT: %[[this_i8:.*]] = bitcast %"struct.constructors::C"* %{{.*}} to i8*
+ // CHECK-NEXT: %[[vbptr_off:.*]] = getelementptr inbounds i8* %[[this_i8]], i64 0
+ // CHECK-NEXT: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to [2 x i32]**
+ // CHECK-NEXT: store [2 x i32]* @"\01??_8C@constructors@@7B@", [2 x i32]** %[[vbptr]]
+ // CHECK-NEXT: bitcast %"struct.constructors::C"* %{{.*}} to i8*
+ // CHECK-NEXT: getelementptr inbounds i8* %{{.*}}, i64 4
+ // CHECK-NEXT: bitcast i8* %{{.*}} to %"struct.constructors::A"*
// CHECK-NEXT: call x86_thiscallcc %"struct.constructors::A"* @"\01??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}})
// CHECK-NEXT: br label %[[SKIP_VBASES]]
//
// CHECK: [[SKIP_VBASES]]
- // CHECK: @"\01??_7C@constructors@@6B@"
+ // Class C does not define or override methods, so shouldn't change the vfptr.
+ // CHECK-NOT: @"\01??_7C@constructors@@6B@"
// CHECK: ret
}
@@ -175,14 +180,20 @@ struct D : C {
};
D::D() {
- // CHECK: define x86_thiscallcc %"struct.constructors::D"* @"\01??0D@constructors@@QAE@XZ"(%"struct.constructors::D"* %this, i32 %is_most_derived) unnamed_addr
+ // CHECK: define x86_thiscallcc %"struct.constructors::D"* @"\01??0D@constructors@@QAE@XZ"(%"struct.constructors::D"* returned %this, i32 %is_most_derived) unnamed_addr
// CHECK: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4
// CHECK: %[[IS_MOST_DERIVED_VAL:.*]] = load i32* %[[IS_MOST_DERIVED_VAR]]
// CHECK: %[[SHOULD_CALL_VBASE_CTORS:.*]] = icmp ne i32 %[[IS_MOST_DERIVED_VAL]], 0
// CHECK: br i1 %[[SHOULD_CALL_VBASE_CTORS]], label %[[INIT_VBASES:.*]], label %[[SKIP_VBASES:.*]]
//
// CHECK: [[INIT_VBASES]]
- // CHECK-NEXT: bitcast %"struct.constructors::D"* %{{.*}} to %"struct.constructors::A"*
+ // CHECK-NEXT: %[[this_i8:.*]] = bitcast %"struct.constructors::D"* %{{.*}} to i8*
+ // CHECK-NEXT: %[[vbptr_off:.*]] = getelementptr inbounds i8* %[[this_i8]], i64 0
+ // CHECK-NEXT: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to [2 x i32]**
+ // CHECK-NEXT: store [2 x i32]* @"\01??_8D@constructors@@7B@", [2 x i32]** %[[vbptr]]
+ // CHECK-NEXT: bitcast %"struct.constructors::D"* %{{.*}} to i8*
+ // CHECK-NEXT: getelementptr inbounds i8* %{{.*}}, i64 4
+ // CHECK-NEXT: bitcast i8* %{{.*}} to %"struct.constructors::A"*
// CHECK-NEXT: call x86_thiscallcc %"struct.constructors::A"* @"\01??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}})
// CHECK-NEXT: br label %[[SKIP_VBASES]]
//
@@ -196,14 +207,23 @@ struct E : virtual C {
};
E::E() {
- // CHECK: define x86_thiscallcc %"struct.constructors::E"* @"\01??0E@constructors@@QAE@XZ"(%"struct.constructors::E"* %this, i32 %is_most_derived) unnamed_addr
+ // CHECK: define x86_thiscallcc %"struct.constructors::E"* @"\01??0E@constructors@@QAE@XZ"(%"struct.constructors::E"* returned %this, i32 %is_most_derived) unnamed_addr
// CHECK: store i32 %is_most_derived, i32* %[[IS_MOST_DERIVED_VAR:.*]], align 4
// CHECK: %[[IS_MOST_DERIVED_VAL:.*]] = load i32* %[[IS_MOST_DERIVED_VAR]]
// CHECK: %[[SHOULD_CALL_VBASE_CTORS:.*]] = icmp ne i32 %[[IS_MOST_DERIVED_VAL]], 0
// CHECK: br i1 %[[SHOULD_CALL_VBASE_CTORS]], label %[[INIT_VBASES:.*]], label %[[SKIP_VBASES:.*]]
//
// CHECK: [[INIT_VBASES]]
- // CHECK-NEXT: bitcast %"struct.constructors::E"* %{{.*}} to %"struct.constructors::A"*
+ // CHECK-NEXT: %[[this_i8:.*]] = bitcast %"struct.constructors::E"* %{{.*}} to i8*
+ // CHECK-NEXT: %[[offs:.*]] = getelementptr inbounds i8* %[[this_i8]], i64 0
+ // CHECK-NEXT: %[[vbptr_E:.*]] = bitcast i8* %[[offs]] to [3 x i32]**
+ // CHECK-NEXT: store [3 x i32]* @"\01??_8E@constructors@@7B01@@", [3 x i32]** %[[vbptr_E]]
+ // CHECK-NEXT: %[[offs:.*]] = getelementptr inbounds i8* %[[this_i8]], i64 4
+ // CHECK-NEXT: %[[vbptr_C:.*]] = bitcast i8* %[[offs]] to [2 x i32]**
+ // CHECK-NEXT: store [2 x i32]* @"\01??_8E@constructors@@7BC@1@@", [2 x i32]** %[[vbptr_C]]
+ // CHECK-NEXT: bitcast %"struct.constructors::E"* %{{.*}} to i8*
+ // CHECK-NEXT: getelementptr inbounds i8* %{{.*}}, i64 4
+ // CHECK-NEXT: bitcast i8* %{{.*}} to %"struct.constructors::A"*
// CHECK-NEXT: call x86_thiscallcc %"struct.constructors::A"* @"\01??0A@constructors@@QAE@XZ"(%"struct.constructors::A"* %{{.*}})
// CHECK: call x86_thiscallcc %"struct.constructors::C"* @"\01??0C@constructors@@QAE@XZ"(%"struct.constructors::C"* %{{.*}}, i32 0)
// CHECK-NEXT: br label %[[SKIP_VBASES]]
@@ -212,4 +232,70 @@ E::E() {
// CHECK: ret
}
+// PR16735 - even abstract classes should have a constructor emitted.
+struct F {
+ F();
+ virtual void f() = 0;
+};
+
+F::F() {}
+// CHECK: define x86_thiscallcc %"struct.constructors::F"* @"\01??0F@constructors@@QAE@XZ"
+
} // end namespace constructors
+
+namespace dtors {
+
+struct A {
+ ~A();
+};
+
+void call_nv_complete(A *a) {
+ a->~A();
+// CHECK: define void @"\01?call_nv_complete@dtors@@YAXPAUA@1@@Z"
+// CHECK: call x86_thiscallcc void @"\01??1A@dtors@@QAE@XZ"
+// CHECK: ret
+}
+
+// CHECK: declare x86_thiscallcc void @"\01??1A@dtors@@QAE@XZ"
+
+// Now try some virtual bases, where we need the complete dtor.
+
+struct B : virtual A { ~B(); };
+struct C : virtual A { ~C(); };
+struct D : B, C { ~D(); };
+
+void call_vbase_complete(D *d) {
+ d->~D();
+// CHECK: define void @"\01?call_vbase_complete@dtors@@YAXPAUD@1@@Z"
+// CHECK: call x86_thiscallcc void @"\01??_DD@dtors@@QAE@XZ"(%"struct.dtors::D"* %{{[^,]+}})
+// CHECK: ret
+}
+
+// The complete dtor should call the base dtors for D and the vbase A (once).
+// CHECK: define linkonce_odr x86_thiscallcc void @"\01??_DD@dtors@@QAE@XZ"
+// CHECK-NOT: call
+// CHECK: call x86_thiscallcc void @"\01??1D@dtors@@QAE@XZ"
+// CHECK-NOT: call
+// CHECK: call x86_thiscallcc void @"\01??1A@dtors@@QAE@XZ"
+// CHECK-NOT: call
+// CHECK: ret
+
+void destroy_d_complete() {
+ D d;
+// CHECK: define void @"\01?destroy_d_complete@dtors@@YAXXZ"
+// CHECK: call x86_thiscallcc void @"\01??_DD@dtors@@QAE@XZ"(%"struct.dtors::D"* %{{[^,]+}})
+// CHECK: ret
+}
+
+// FIXME: Clang manually inlines the deletion, so we don't get a call to the
+// deleting dtor (_G). The only way to call deleting dtors currently is through
+// a vftable.
+void call_nv_deleting_dtor(D *d) {
+ delete d;
+// CHECK: define void @"\01?call_nv_deleting_dtor@dtors@@YAXPAUD@1@@Z"
+// CHECK: call x86_thiscallcc void @"\01??_DD@dtors@@QAE@XZ"(%"struct.dtors::D"* %{{[^,]+}})
+// CHECK: call void @"\01??3@YAXPAX@Z"
+// CHECK: ret
+}
+
+}
diff --git a/test/CodeGenCXX/microsoft-abi-thunks.cpp b/test/CodeGenCXX/microsoft-abi-thunks.cpp
new file mode 100644
index 000000000000..f1bc385fdff2
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-thunks.cpp
@@ -0,0 +1,154 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 >%t 2>&1
+// RUN: FileCheck --check-prefix=MANGLING %s < %t
+// RUN: FileCheck --check-prefix=XMANGLING %s < %t
+// RUN: FileCheck --check-prefix=CODEGEN %s < %t
+// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 2>&1 | FileCheck --check-prefix=MANGLING-X64 %s
+
+void foo(void *);
+
+struct A {
+ virtual ~A();
+ virtual void public_f();
+ // Make sure we don't emit unneeded thunks:
+ // XMANGLING-NOT: @"\01?public_f@A@@QAEXXZ"
+ protected:
+ virtual void protected_f();
+ private:
+ virtual void private_f();
+};
+
+struct B {
+ virtual ~B();
+ virtual void public_f();
+ protected:
+ virtual void protected_f();
+ private:
+ virtual void private_f();
+};
+
+
+struct C : A, B {
+ C();
+
+ virtual ~C();
+ // MANGLING-DAG: @"\01??1C@@UAE@XZ"
+ // MANGLING-DAG: @"\01??_GC@@UAEPAXI@Z"
+ // MANGLING-DAG: @"\01??_EC@@W3AEPAXI@Z"
+ // MANGLING-X64-DAG: @"\01??1C@@UEAA@XZ"
+ // MANGLING-X64-DAG: @"\01??_GC@@UEAAPEAXI@Z"
+ // MANGLING-X64-DAG: @"\01??_EC@@W7EAAPEAXI@Z"
+
+ // Overrides public_f() of two subobjects with distinct vfptrs, thus needs a thunk.
+ virtual void public_f();
+ // MANGLING-DAG: @"\01?public_f@C@@UAEXXZ"
+ // MANGLING-DAG: @"\01?public_f@C@@W3AEXXZ"
+ // MANGLING-X64-DAG: @"\01?public_f@C@@UEAAXXZ"
+ // MANGLING-X64-DAG: @"\01?public_f@C@@W7EAAXXZ"
+ protected:
+ virtual void protected_f();
+ // MANGLING-DAG: @"\01?protected_f@C@@MAEXXZ"
+ // MANGLING-DAG: @"\01?protected_f@C@@O3AEXXZ"
+ // MANGLING-X64-DAG: @"\01?protected_f@C@@MEAAXXZ"
+ // MANGLING-X64-DAG: @"\01?protected_f@C@@O7EAAXXZ"
+
+ private:
+ virtual void private_f();
+ // MANGLING-DAG: @"\01?private_f@C@@EAEXXZ"
+ // MANGLING-DAG: @"\01?private_f@C@@G3AEXXZ"
+ // MANGLING-X64-DAG: @"\01?private_f@C@@EEAAXXZ"
+ // MANGLING-X64-DAG: @"\01?private_f@C@@G7EAAXXZ"
+};
+
+C::C() {} // Emits vftable and forces thunk generation.
+
+// CODEGEN-LABEL: define weak x86_thiscallcc void @"\01??_EC@@W3AEPAXI@Z"(%struct.C* %this, i32 %should_call_delete)
+// CODEGEN: getelementptr i8* {{.*}}, i32 -4
+// FIXME: should actually call _EC, not _GC.
+// CODEGEN: call x86_thiscallcc void @"\01??_GC@@UAEPAXI@Z"
+// CODEGEN: ret
+
+// CODEGEN-LABEL: define weak x86_thiscallcc void @"\01?public_f@C@@W3AEXXZ"(%struct.C*
+// CODEGEN: getelementptr i8* {{.*}}, i32 -4
+// CODEGEN: call x86_thiscallcc void @"\01?public_f@C@@UAEXXZ"(%struct.C*
+// CODEGEN: ret
+
+void zoo(C* obj) {
+ delete obj;
+}
+
+struct D {
+ virtual B* goo();
+};
+
+struct E : D {
+ E();
+ virtual C* goo();
+ // MANGLING-DAG: @"\01?goo@E@@UAEPAUC@@XZ"
+ // MANGLING-DAG: @"\01?goo@E@@QAEPAUB@@XZ"
+ // MANGLING-X64-DAG: @"\01?goo@E@@UEAAPEAUC@@XZ"
+ // MANGLING-X64-DAG: @"\01?goo@E@@QEAAPEAUB@@XZ"
+};
+
+E::E() {} // Emits vftable and forces thunk generation.
+
+// CODEGEN-LABEL: define weak x86_thiscallcc %struct.C* @"\01?goo@E@@QAEPAUB@@XZ"
+// CODEGEN: call x86_thiscallcc %struct.C* @"\01?goo@E@@UAEPAUC@@XZ"
+// CODEGEN: getelementptr inbounds i8* {{.*}}, i32 4
+// CODEGEN: ret
+
+struct F : virtual A, virtual B {
+ virtual void own_method();
+ virtual ~F();
+};
+
+F f; // Just make sure we don't crash, e.g. mangling the complete dtor.
+
+struct G : C { };
+
+struct H : E {
+ virtual G* goo();
+ // MANGLING-DAG: @"\01?goo@H@@UAEPAUG@@XZ"
+ // MANGLING-DAG: @"\01?goo@H@@QAEPAUB@@XZ"
+ // MANGLING-DAG: @"\01?goo@H@@QAEPAUC@@XZ"
+ // MANGLING-X64-DAG: @"\01?goo@H@@UEAAPEAUG@@XZ"
+ // MANGLING-X64-DAG: @"\01?goo@H@@QEAAPEAUB@@XZ"
+ // MANGLING-X64-DAG: @"\01?goo@H@@QEAAPEAUC@@XZ"
+};
+
+H h;
+
+struct I : D {
+ I();
+ virtual F* goo();
+};
+
+I::I() {} // Emits vftable and forces thunk generation.
+
+// CODEGEN-LABEL: define weak x86_thiscallcc %struct.{{[BF]}}* @"\01?goo@I@@QAEPAUB@@XZ"
+// CODEGEN: %[[ORIG_RET:.*]] = call x86_thiscallcc %struct.F* @"\01?goo@I@@UAEPAUF@@XZ"
+// CODEGEN: %[[ORIG_RET_i8:.*]] = bitcast %struct.F* %[[ORIG_RET]] to i8*
+// CODEGEN: %[[VBPTR_i8:.*]] = getelementptr inbounds i8* %[[ORIG_RET_i8]], i32 4
+// CODEGEN: %[[VBPTR:.*]] = bitcast i8* %[[VBPTR_i8]] to i8**
+// CODEGEN: %[[VBTABLE:.*]] = load i8** %[[VBPTR]]
+// CODEGEN: %[[VBASE_OFFSET_PTR_i8:.*]] = getelementptr inbounds i8* %[[VBTABLE]], i32 8
+// CODEGEN: %[[VBASE_OFFSET_PTR:.*]] = bitcast i8* %[[VBASE_OFFSET_PTR_i8]] to i32*
+// CODEGEN: %[[VBASE_OFFSET:.*]] = load i32* %[[VBASE_OFFSET_PTR]]
+// CODEGEN: %[[RES_i8:.*]] = getelementptr inbounds i8* %[[VBPTR_i8]], i32 %[[VBASE_OFFSET]]
+// CODEGEN: %[[RES:.*]] = bitcast i8* %[[RES_i8]] to %struct.F*
+// CODEGEN: phi %struct.F* {{.*}} %[[RES]]
+// CODEGEN: ret %struct.{{[BF]}}*
+
+namespace CrashOnThunksForAttributedType {
+// We used to crash on this because the type of foo is an AttributedType, not
+// FunctionType, and we had to look through the sugar.
+struct A {
+ virtual void __stdcall foo();
+};
+struct B {
+ virtual void __stdcall foo();
+};
+struct C : A, B {
+ virtual void __stdcall foo();
+};
+C c;
+}
diff --git a/test/CodeGenCXX/microsoft-abi-vbtables.cpp b/test/CodeGenCXX/microsoft-abi-vbtables.cpp
new file mode 100644
index 000000000000..6de556b1d814
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-vbtables.cpp
@@ -0,0 +1,479 @@
+// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -o - | FileCheck %s
+
+// See microsoft-abi-structors.cpp for constructor codegen tests.
+
+namespace Test1 {
+// Classic diamond, fully virtual.
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual A { int c; };
+struct D : virtual B, virtual C { int d; };
+D d; // Force vbtable emission.
+
+// Layout should be:
+// D: vbptr D
+// int d
+// A: int a
+// B: vbptr B
+// int b
+// C: vbptr C
+// int c
+
+// CHECK-DAG: @"\01??_8D@Test1@@7B01@@" = linkonce_odr unnamed_addr constant [4 x i32] [i32 0, i32 8, i32 12, i32 20]
+// CHECK-DAG: @"\01??_8D@Test1@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 -4]
+// CHECK-DAG: @"\01??_8D@Test1@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 -12]
+// CHECK-DAG: @"\01??_8C@Test1@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8]
+// CHECK-DAG: @"\01??_8B@Test1@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8]
+}
+
+namespace Test2 {
+// Classic diamond, only A is virtual.
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual A { int c; };
+struct D : B, C { int d; };
+D d; // Force vbtable emission.
+
+// Layout should be:
+// B: vbptr B
+// int b
+// C: vbptr C
+// int c
+// D: int d
+// A: int a
+
+// CHECK-DAG: @"\01??_8D@Test2@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 20]
+// CHECK-DAG: @"\01??_8D@Test2@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 12]
+// CHECK-DAG: @"\01??_8C@Test2@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8]
+// CHECK-DAG: @"\01??_8B@Test2@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8]
+}
+
+namespace Test3 {
+struct A { int a; };
+struct B { int b; };
+struct C : virtual A, virtual B { int c; };
+C c;
+
+// CHECK-DAG: @"\01??_8C@Test3@@7B@" = {{.*}} [3 x i32] [i32 0, i32 8, i32 12]
+}
+
+namespace Test4 {
+// Test reusing a vbptr from a non-virtual base.
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : B, virtual A { int c; };
+C c; // Force vbtable emission.
+
+// CHECK-DAG: @"\01??_8C@Test4@@7B@" = {{.*}} [2 x i32] [i32 0, i32 12]
+// CHECK-DAG: @"\01??_8B@Test4@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8]
+}
+
+namespace Test5 {
+// Test multiple base subobjects of the same type when that type has a virtual
+// base.
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : B { int c; };
+struct D : B, C { int d; };
+D d; // Force vbtable emission.
+
+// CHECK-DAG: @"\01??_8D@Test5@@7BB@1@@"
+// CHECK-DAG: @"\01??_8D@Test5@@7BC@1@@"
+// CHECK-DAG: @"\01??_8C@Test5@@7B@"
+// CHECK-DAG: @"\01??_8B@Test5@@7B@"
+}
+
+namespace Test6 {
+// Test that we skip unneeded base path component names.
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : B { int c; };
+struct D : B, C { int d; };
+struct E : D { int e; };
+struct F : E, B, C { int f; };
+struct G : F, virtual E { int g; };
+G g;
+
+// CHECK-DAG: @"\01??_8G@Test6@@7BB@1@E@1@F@1@@" =
+// CHECK-DAG: @"\01??_8G@Test6@@7BC@1@E@1@F@1@@" =
+// CHECK-DAG: @"\01??_8G@Test6@@7BB@1@F@1@@" =
+// CHECK-DAG: @"\01??_8G@Test6@@7BC@1@F@1@@" =
+// CHECK-DAG: @"\01??_8G@Test6@@7BB@1@E@1@@" =
+// CHECK-DAG: @"\01??_8G@Test6@@7BC@1@E@1@@" =
+// CHECK-DAG: @"\01??_8F@Test6@@7BB@1@E@1@@" = {{.*}} [2 x i32] [i32 0, i32 52]
+// CHECK-DAG: @"\01??_8F@Test6@@7BC@1@E@1@@" = {{.*}} [2 x i32] [i32 0, i32 44]
+// CHECK-DAG: @"\01??_8F@Test6@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 24]
+// CHECK-DAG: @"\01??_8F@Test6@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 16]
+// CHECK-DAG: @"\01??_8C@Test6@@7B@" = {{.*}} [2 x i32] [i32 0, i32 12]
+// CHECK-DAG: @"\01??_8B@Test6@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8]
+// CHECK-DAG: @"\01??_8E@Test6@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 28]
+// CHECK-DAG: @"\01??_8E@Test6@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 20]
+// CHECK-DAG: @"\01??_8D@Test6@@7BB@1@@" = {{.*}} [2 x i32] [i32 0, i32 24]
+// CHECK-DAG: @"\01??_8D@Test6@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 16]
+}
+
+namespace Test7 {
+// Test a non-virtual base which reuses the vbptr of another base.
+struct A { int a; };
+struct B { int b; };
+struct C { int c; };
+struct D : virtual A { int d; };
+struct E : B, D, virtual A, virtual C { int e; };
+E o;
+
+// CHECK-DAG: @"\01??_8E@Test7@@7B@" = {{.*}} [3 x i32] [i32 0, i32 12, i32 16]
+// CHECK-DAG: @"\01??_8D@Test7@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8]
+}
+
+namespace Test8 {
+// Test a virtual base which reuses the vbptr of another base.
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : B { int c; };
+struct D : virtual C { int d; };
+D o;
+
+// CHECK-DAG: @"\01??_8D@Test8@@7B01@@" = {{.*}} [3 x i32] [i32 0, i32 8, i32 12]
+// CHECK-DAG: @"\01??_8D@Test8@@7BC@1@@" = {{.*}} [2 x i32] [i32 0, i32 -4]
+// CHECK-DAG: @"\01??_8C@Test8@@7B@" = {{.*}} [2 x i32] [i32 0, i32 12]
+// CHECK-DAG: @"\01??_8B@Test8@@7B@" = {{.*}} [2 x i32] [i32 0, i32 8]
+}
+
+namespace Test9 {
+// D has to add to B's vbtable because D has more morally virtual bases than B.
+// D then takes B's vbptr and the vbtable is named for D, not B.
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual B { int c; };
+struct BB : B { int bb; }; // Indirection =/
+struct D : BB, C { int d; };
+struct E : virtual D { };
+E e;
+
+// CHECK-DAG: @"\01??_8E@Test9@@7B01@@" =
+// CHECK-DAG: @"\01??_8E@Test9@@7BD@1@@" =
+// CHECK-DAG: @"\01??_8E@Test9@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8E@Test9@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8D@Test9@@7B@" =
+// CHECK-DAG: @"\01??_8D@Test9@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8D@Test9@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8C@Test9@@7B01@@" =
+// CHECK-DAG: @"\01??_8C@Test9@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8BB@Test9@@7B@" =
+// CHECK-DAG: @"\01??_8B@Test9@@7B@" =
+}
+
+namespace Test10 {
+struct A { int a; };
+struct B { int b; };
+struct C : virtual A { int c; };
+struct D : B, C { int d; };
+D d;
+
+// CHECK-DAG: @"\01??_8D@Test10@@7B@" =
+// CHECK-DAG: @"\01??_8C@Test10@@7B@" =
+
+}
+
+namespace Test11 {
+// Typical diamond with an extra single inheritance indirection for B and C.
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual A { int c; };
+struct D : B { int d; };
+struct E : C { int e; };
+struct F : D, E { int f; };
+F f;
+
+// CHECK-DAG: @"\01??_8F@Test11@@7BD@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 28]
+// CHECK-DAG: @"\01??_8F@Test11@@7BE@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 16]
+// CHECK-DAG: @"\01??_8E@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 12]
+// CHECK-DAG: @"\01??_8C@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8]
+// CHECK-DAG: @"\01??_8D@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 12]
+// CHECK-DAG: @"\01??_8B@Test11@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8]
+
+}
+
+namespace Test12 {
+// Another vbptr inside a virtual base.
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual B { int c; };
+struct D : C, B { int d; };
+struct E : D, C, B { int e; };
+E e;
+
+// CHECK-DAG: @"\01??_8E@Test12@@7BC@1@D@1@@" =
+// CHECK-DAG: @"\01??_8E@Test12@@7BB@1@D@1@@" =
+// CHECK-DAG: @"\01??_8E@Test12@@7BD@1@@" =
+// CHECK-DAG: @"\01??_8E@Test12@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8E@Test12@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8C@Test12@@7B01@@" =
+// CHECK-DAG: @"\01??_8C@Test12@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8D@Test12@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8D@Test12@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8D@Test12@@7B@" =
+// CHECK-DAG: @"\01??_8B@Test12@@7B@" =
+}
+
+namespace Test13 {
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual B { int c; };
+struct D : virtual C { int d; };
+struct E : D, C, B { int e; };
+E e;
+
+// CHECK-DAG: @"\01??_8E@Test13@@7BD@1@@" =
+// CHECK-DAG: @"\01??_8E@Test13@@7BC@1@D@1@@" =
+// CHECK-DAG: @"\01??_8E@Test13@@7BB@1@D@1@@" =
+// CHECK-DAG: @"\01??_8E@Test13@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8E@Test13@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8D@Test13@@7B@" =
+// CHECK-DAG: @"\01??_8D@Test13@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8D@Test13@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8C@Test13@@7B01@@" =
+// CHECK-DAG: @"\01??_8C@Test13@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8B@Test13@@7B@" =
+}
+
+namespace Test14 {
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual B { int c; };
+struct D : virtual C { int d; };
+struct E : D, virtual C, virtual B { int e; };
+E e;
+
+// CHECK-DAG: @"\01??_8E@Test14@@7B@" =
+// CHECK-DAG: @"\01??_8E@Test14@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8E@Test14@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8D@Test14@@7B@" =
+// CHECK-DAG: @"\01??_8D@Test14@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8D@Test14@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8C@Test14@@7B01@@" =
+// CHECK-DAG: @"\01??_8C@Test14@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8B@Test14@@7B@" =
+}
+
+namespace Test15 {
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual A { int c; };
+struct D : virtual B { int d; };
+struct E : D, C, B { int e; };
+E e;
+
+// CHECK-DAG: @"\01??_8E@Test15@@7BD@1@@" =
+// CHECK-DAG: @"\01??_8E@Test15@@7BB@1@D@1@@" =
+// CHECK-DAG: @"\01??_8E@Test15@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8E@Test15@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8C@Test15@@7B@" =
+// CHECK-DAG: @"\01??_8D@Test15@@7B01@@" =
+// CHECK-DAG: @"\01??_8D@Test15@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8B@Test15@@7B@" =
+}
+
+namespace Test16 {
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual B { int c; }; // ambig
+struct D : virtual C { int d; };
+struct E : virtual D { int e; }; // ambig
+struct F : E, D, C, B { int f; }; // ambig
+F f;
+
+// CHECK-DAG: @"\01??_8F@Test16@@7BE@1@@" =
+// CHECK-DAG: @"\01??_8F@Test16@@7BD@1@E@1@@" =
+// CHECK-DAG: @"\01??_8F@Test16@@7BC@1@E@1@@" =
+// CHECK-DAG: @"\01??_8F@Test16@@7BB@1@E@1@@" =
+// CHECK-DAG: @"\01??_8F@Test16@@7BD@1@@" =
+// CHECK-DAG: @"\01??_8F@Test16@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8F@Test16@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8E@Test16@@7B01@@" =
+// CHECK-DAG: @"\01??_8E@Test16@@7BD@1@@" =
+// CHECK-DAG: @"\01??_8E@Test16@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8E@Test16@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8D@Test16@@7B@" =
+// CHECK-DAG: @"\01??_8D@Test16@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8D@Test16@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8C@Test16@@7B01@@" =
+// CHECK-DAG: @"\01??_8C@Test16@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8B@Test16@@7B@" =
+}
+
+namespace Test17 {
+// This test case has an interesting alternating pattern of using "vbtable of B"
+// and "vbtable of C for C". This may be the key to the underlying algorithm.
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual B { int c; }; // ambig
+struct D : virtual C { int d; };
+struct E : virtual D { int e; }; // ambig
+struct F : virtual E { int f; };
+struct G : virtual F { int g; }; // ambig
+struct H : virtual G { int h; };
+struct I : virtual H { int i; }; // ambig
+struct J : virtual I { int j; };
+struct K : virtual J { int k; }; // ambig
+K k;
+
+// CHECK-DAG: @"\01??_8K@Test17@@7B01@@" =
+// CHECK-DAG: @"\01??_8J@Test17@@7B@" =
+// CHECK-DAG: @"\01??_8I@Test17@@7B01@@" =
+// CHECK-DAG: @"\01??_8H@Test17@@7B@" =
+// CHECK-DAG: @"\01??_8G@Test17@@7B01@@" =
+// CHECK-DAG: @"\01??_8F@Test17@@7B@" =
+// CHECK-DAG: @"\01??_8E@Test17@@7B01@@" =
+// CHECK-DAG: @"\01??_8D@Test17@@7B@" =
+// CHECK-DAG: @"\01??_8C@Test17@@7B01@@" =
+// CHECK-DAG: @"\01??_8B@Test17@@7B@" =
+}
+
+namespace Test18 {
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : B { int c; };
+struct D : C, B { int d; };
+struct E : D, C, B { int e; };
+E e;
+
+// CHECK-DAG: @"\01??_8E@Test18@@7BC@1@D@1@@" =
+// CHECK-DAG: @"\01??_8E@Test18@@7BB@1@D@1@@" =
+// CHECK-DAG: @"\01??_8E@Test18@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8E@Test18@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8B@Test18@@7B@" =
+// CHECK-DAG: @"\01??_8C@Test18@@7B@" =
+// CHECK-DAG: @"\01??_8D@Test18@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8D@Test18@@7BB@1@@" =
+}
+
+namespace Test19 {
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : virtual B { int c; };
+struct D : virtual C, virtual B { int d; };
+struct E : virtual D, virtual C, virtual B { int e; };
+E e;
+
+// CHECK-DAG: @"\01??_8E@Test19@@7B01@@" =
+// CHECK-DAG: @"\01??_8E@Test19@@7BD@1@@" =
+// CHECK-DAG: @"\01??_8E@Test19@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8E@Test19@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8D@Test19@@7B@" =
+// CHECK-DAG: @"\01??_8D@Test19@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8D@Test19@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8C@Test19@@7B01@@" =
+// CHECK-DAG: @"\01??_8C@Test19@@7BB@1@@" =
+// CHECK-DAG: @"\01??_8B@Test19@@7B@" =
+}
+
+namespace Test20 {
+// E has no direct vbases, but it adds to C's vbtable anyway.
+struct A { int a; };
+struct B { int b; };
+struct C : virtual A { int c; };
+struct D : virtual B { int d; };
+struct E : C, D { int e; };
+E f;
+
+// CHECK-DAG: @"\01??_8E@Test20@@7BC@1@@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 20, i32 24]
+// CHECK-DAG: @"\01??_8E@Test20@@7BD@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 16]
+// CHECK-DAG: @"\01??_8D@Test20@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8]
+// CHECK-DAG: @"\01??_8C@Test20@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8]
+}
+
+namespace Test21 {
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C : B { int c; };
+struct D : B { int d; };
+struct E : C, D { int e; };
+struct F : virtual E { int f; };
+struct G : E { int g; };
+struct H : F, G { int h; };
+H h;
+
+// CHECK-DAG: @"\01??_8H@Test21@@7B@" =
+// CHECK-DAG: @"\01??_8H@Test21@@7BC@1@F@1@@" =
+// CHECK-DAG: @"\01??_8H@Test21@@7BD@1@F@1@@" =
+// CHECK-DAG: @"\01??_8H@Test21@@7BC@1@G@1@@" =
+// CHECK-DAG: @"\01??_8H@Test21@@7BD@1@G@1@@" =
+// CHECK-DAG: @"\01??_8G@Test21@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8G@Test21@@7BD@1@@" =
+// CHECK-DAG: @"\01??_8F@Test21@@7B@" =
+// CHECK-DAG: @"\01??_8F@Test21@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8F@Test21@@7BD@1@@" =
+// CHECK-DAG: @"\01??_8E@Test21@@7BC@1@@" =
+// CHECK-DAG: @"\01??_8E@Test21@@7BD@1@@" =
+// CHECK-DAG: @"\01??_8D@Test21@@7B@" =
+// CHECK-DAG: @"\01??_8B@Test21@@7B@" =
+// CHECK-DAG: @"\01??_8C@Test21@@7B@" =
+}
+
+namespace Test22 {
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C { int c; };
+struct D : B, virtual C { int d; };
+D d;
+
+// CHECK-DAG: @"\01??_8D@Test22@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 12, i32 16]
+// CHECK-DAG: @"\01??_8B@Test22@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8]
+}
+
+namespace Test23 {
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C { int c; };
+// Note the unusual order of bases. It forces C to be laid out before A.
+struct D : virtual C, B { int d; };
+D d;
+
+// CHECK-DAG: @"\01??_8D@Test23@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 16, i32 12]
+// CHECK-DAG: @"\01??_8B@Test23@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8]
+}
+
+namespace Test24 {
+struct A { int a; };
+struct B : virtual A { int b; };
+struct C { int c; };
+struct D : virtual C, B {
+ virtual void f(); // Issues a vfptr, but the vbptr is still shared with B.
+ int d;
+};
+D d;
+
+// CHECK-DAG: @"\01??_8D@Test24@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 0, i32 16, i32 12]
+// CHECK-DAG: @"\01??_8B@Test24@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 8]
+}
+
+namespace Test25 {
+struct A { int a; };
+struct B : virtual A {
+ virtual void f(); // Issues a vfptr.
+ int b;
+};
+struct C { int c; };
+struct D : virtual C, B { int d; };
+D d;
+
+// CHECK-DAG: @"\01??_8D@Test25@@7B@" = linkonce_odr unnamed_addr constant [3 x i32] [i32 -4, i32 16, i32 12]
+// CHECK-DAG: @"\01??_8B@Test25@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 -4, i32 8]
+}
+
+namespace Test26 {
+struct A { int a; };
+struct B { int b; };
+struct C { int c; };
+struct D : virtual A { int d; };
+struct E : virtual B {
+ virtual void foo(); // Issues a vfptr.
+ int e;
+};
+struct F: virtual C, D, E { int f; };
+F f;
+// F reuses the D's vbptr, even though D is laid out after E.
+// CHECK-DAG: @"\01??_8F@Test26@@7BD@1@@" = linkonce_odr unnamed_addr constant [4 x i32] [i32 0, i32 16, i32 12, i32 20]
+// CHECK-DAG: @"\01??_8F@Test26@@7BE@1@@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 -4, i32 28]
+}
diff --git a/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp b/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp
new file mode 100644
index 000000000000..8e23ade658c4
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp
@@ -0,0 +1,83 @@
+// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -o - | FileCheck %s
+
+// For now, just make sure x86_64 doesn't crash.
+// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=x86_64-pc-win32 -emit-llvm -o %t
+
+struct A {
+ virtual void f();
+};
+
+struct B {
+ virtual void f();
+};
+
+struct C : A, B {};
+
+struct D : virtual C {
+ D();
+ ~D();
+ virtual void f();
+ void g();
+ int xxx;
+};
+
+D::D() {} // Forces vftable emission.
+
+// CHECK-LABEL: define weak x86_thiscallcc void @"\01?f@D@@$4PPPPPPPM@A@AEXXZ"
+// CHECK: %[[ECX:.*]] = load %struct.D** %{{.*}}
+// CHECK: %[[ECX_i8:.*]] = bitcast %struct.D* %[[ECX]] to i8*
+// CHECK: %[[VTORDISP_PTR_i8:.*]] = getelementptr i8* %[[ECX_i8]], i32 -4
+// CHECK: %[[VTORDISP_PTR:.*]] = bitcast i8* %[[VTORDISP_PTR_i8]] to i32*
+// CHECK: %[[VTORDISP:.*]] = load i32* %[[VTORDISP_PTR]]
+// CHECK: %[[VTORDISP_NEG:.*]] = sub i32 0, %[[VTORDISP]]
+// CHECK: %[[ADJUSTED_i8:.*]] = getelementptr i8* %[[ECX_i8]], i32 %[[VTORDISP_NEG]]
+// CHECK: call x86_thiscallcc void @"\01?f@D@@UAEXXZ"(i8* %[[ADJUSTED_i8]])
+// CHECK: ret void
+
+// CHECK-LABEL: define weak x86_thiscallcc void @"\01?f@D@@$4PPPPPPPI@3AEXXZ"
+// CHECK: %[[ECX:.*]] = load %struct.D** %{{.*}}
+// CHECK: %[[ECX_i8:.*]] = bitcast %struct.D* %[[ECX]] to i8*
+// CHECK: %[[VTORDISP_PTR_i8:.*]] = getelementptr i8* %[[ECX_i8]], i32 -8
+// CHECK: %[[VTORDISP_PTR:.*]] = bitcast i8* %[[VTORDISP_PTR_i8]] to i32*
+// CHECK: %[[VTORDISP:.*]] = load i32* %[[VTORDISP_PTR]]
+// CHECK: %[[VTORDISP_NEG:.*]] = sub i32 0, %[[VTORDISP]]
+// CHECK: %[[VTORDISP_ADJUSTED_i8:.*]] = getelementptr i8* %[[ECX_i8]], i32 %[[VTORDISP_NEG]]
+// CHECK: %[[ADJUSTED_i8:.*]] = getelementptr i8* %[[VTORDISP_ADJUSTED_i8]], i32 -4
+// CHECK: call x86_thiscallcc void @"\01?f@D@@UAEXXZ"(i8* %[[ADJUSTED_i8]])
+// CHECK: ret void
+
+struct E : virtual A {
+ virtual void f();
+ ~E();
+};
+
+struct F {
+ virtual void z();
+};
+
+struct G : virtual F, virtual E {
+ int ggg;
+ G();
+ ~G();
+};
+
+G::G() {} // Forces vftable emission.
+
+// CHECK-LABEL: define weak x86_thiscallcc void @"\01?f@E@@$R4BA@M@PPPPPPPM@7AEXXZ"(i8*)
+// CHECK: %[[ECX:.*]] = load %struct.E** %{{.*}}
+// CHECK: %[[ECX_i8:.*]] = bitcast %struct.E* %[[ECX]] to i8*
+// CHECK: %[[VTORDISP_PTR_i8:.*]] = getelementptr i8* %[[ECX_i8]], i32 -4
+// CHECK: %[[VTORDISP_PTR:.*]] = bitcast i8* %[[VTORDISP_PTR_i8]] to i32*
+// CHECK: %[[VTORDISP:.*]] = load i32* %[[VTORDISP_PTR]]
+// CHECK: %[[VTORDISP_NEG:.*]] = sub i32 0, %[[VTORDISP]]
+// CHECK: %[[VTORDISP_ADJUSTED_i8:.*]] = getelementptr i8* %[[ECX_i8]], i32 %[[VTORDISP_NEG]]
+// CHECK: %[[VBPTR_i8:.*]] = getelementptr inbounds i8* %[[VTORDISP_ADJUSTED_i8]], i32 -16
+// CHECK: %[[VBPTR:.*]] = bitcast i8* %[[VBPTR_i8]] to i8**
+// CHECK: %[[VBTABLE:.*]] = load i8** %[[VBPTR]]
+// CHECK: %[[VBOFFSET_PTR_i8:.*]] = getelementptr inbounds i8* %[[VBTABLE]], i32 12
+// CHECK: %[[VBOFFSET_PTR:.*]] = bitcast i8* %[[VBOFFSET_PTR_i8]] to i32*
+// CHECK: %[[VBASE_OFFSET:.*]] = load i32* %[[VBOFFSET_PTR]]
+// CHECK: %[[VBASE:.*]] = getelementptr inbounds i8* %[[VBPTR_i8]], i32 %[[VBASE_OFFSET]]
+// CHECK: %[[ARG_i8:.*]] = getelementptr i8* %[[VBASE]], i32 8
+// CHECK: call x86_thiscallcc void @"\01?f@E@@UAEXXZ"(i8* %[[ARG_i8]])
+// CHECK: ret void
diff --git a/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
new file mode 100644
index 000000000000..7c223ca0a772
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
@@ -0,0 +1,314 @@
+// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -o %t
+// RUN: FileCheck %s < %t
+// RUN: FileCheck --check-prefix=CHECK2 %s < %t
+
+// For now, just make sure x86_64 doesn't crash.
+// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=x86_64-pc-win32 -emit-llvm -o %t
+
+struct VBase {
+ virtual ~VBase();
+ virtual void foo();
+ virtual void bar();
+ int field;
+};
+
+struct B : virtual VBase {
+ B();
+ virtual ~B();
+ virtual void foo();
+ virtual void bar();
+};
+
+B::B() {
+ // CHECK-LABEL: define x86_thiscallcc %struct.B* @"\01??0B@@QAE@XZ"
+ // CHECK: %[[THIS:.*]] = load %struct.B**
+ // CHECK: br i1 %{{.*}}, label %[[INIT_VBASES:.*]], label %[[SKIP_VBASES:.*]]
+
+ // Don't check the INIT_VBASES case as it's covered by the ctor tests.
+
+ // CHECK: %[[SKIP_VBASES]]
+ // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+ // CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i32 0
+ // ...
+ // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+ // CHECK: %[[VFPTR_i8:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i32 %{{.*}}
+ // CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VFPTR_i8]] to [3 x i8*]**
+ // CHECK: store [3 x i8*]* @"\01??_7B@@6B@", [3 x i8*]** %[[VFPTR]]
+
+ // Initialize vtorDisp:
+ // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+ // CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i32 0
+ // ...
+ // CHECK: %[[VBASE_OFFSET:.*]] = add nsw i32 0, %{{.*}}
+ // CHECK: %[[VTORDISP_VAL:.*]] = sub i32 %[[VBASE_OFFSET]], 8
+ // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+ // CHECK: %[[VBASE_i8:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i32 %[[VBASE_OFFSET]]
+ // CHECK: %[[VTORDISP_i8:.*]] = getelementptr i8* %[[VBASE_i8]], i32 -4
+ // CHECK: %[[VTORDISP_PTR:.*]] = bitcast i8* %[[VTORDISP_i8]] to i32*
+ // CHECK: store i32 %[[VTORDISP_VAL]], i32* %[[VTORDISP_PTR]]
+
+ // CHECK: ret
+}
+
+B::~B() {
+ // CHECK-LABEL: define x86_thiscallcc void @"\01??1B@@UAE@XZ"
+ // Adjust the this parameter:
+ // CHECK: %[[THIS_PARAM_i8:.*]] = bitcast %struct.B* {{.*}} to i8*
+ // CHECK: %[[THIS_i8:.*]] = getelementptr inbounds i8* %[[THIS_PARAM_i8]], i32 -8
+ // CHECK: %[[THIS:.*]] = bitcast i8* %[[THIS_i8]] to %struct.B*
+ // CHECK: store %struct.B* %[[THIS]], %struct.B** %[[THIS_ADDR:.*]], align 4
+ // CHECK: %[[THIS:.*]] = load %struct.B** %[[THIS_ADDR]]
+
+ // Restore the vfptr that could have been changed by a subclass.
+ // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+ // CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i32 0
+ // ...
+ // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+ // CHECK: %[[VFPTR_i8:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i32 %{{.*}}
+ // CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VFPTR_i8]] to [3 x i8*]**
+ // CHECK: store [3 x i8*]* @"\01??_7B@@6B@", [3 x i8*]** %[[VFPTR]]
+
+ // Initialize vtorDisp:
+ // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+ // CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i32 0
+ // ...
+ // CHECK: %[[VBASE_OFFSET:.*]] = add nsw i32 0, %{{.*}}
+ // CHECK: %[[VTORDISP_VAL:.*]] = sub i32 %[[VBASE_OFFSET]], 8
+ // CHECK: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+ // CHECK: %[[VBASE_i8:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i32 %[[VBASE_OFFSET]]
+ // CHECK: %[[VTORDISP_i8:.*]] = getelementptr i8* %[[VBASE_i8]], i32 -4
+ // CHECK: %[[VTORDISP_PTR:.*]] = bitcast i8* %[[VTORDISP_i8]] to i32*
+ // CHECK: store i32 %[[VTORDISP_VAL]], i32* %[[VTORDISP_PTR]]
+
+ foo(); // Avoid the "trivial destructor" optimization.
+
+ // CHECK: ret
+
+ // CHECK2-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_DB@@UAE@XZ"(%struct.B*
+ // CHECK2: %[[THIS:.*]] = load %struct.B** {{.*}}
+ // CHECK2: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+ // CHECK2: %[[B_i8:.*]] = getelementptr i8* %[[THIS_i8]], i32 8
+ // CHECK2: %[[B:.*]] = bitcast i8* %[[B_i8]] to %struct.B*
+ // CHECK2: call x86_thiscallcc void @"\01??1B@@UAE@XZ"(%struct.B* %[[B]])
+ // CHECK2: %[[THIS_i8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+ // CHECK2: %[[VBASE_i8:.*]] = getelementptr inbounds i8* %[[THIS_i8]], i64 8
+ // CHECK2: %[[VBASE:.*]] = bitcast i8* %[[VBASE_i8]] to %struct.VBase*
+ // CHECK2: call x86_thiscallcc void @"\01??1VBase@@UAE@XZ"(%struct.VBase* %[[VBASE]])
+ // CHECK2: ret
+
+ // CHECK2-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_GB@@UAEPAXI@Z"
+ // CHECK2: %[[THIS_PARAM_i8:.*]] = bitcast %struct.B* {{.*}} to i8*
+ // CHECK2: %[[THIS_i8:.*]] = getelementptr inbounds i8* %[[THIS_PARAM_i8:.*]], i32 -8
+ // CHECK2: %[[THIS:.*]] = bitcast i8* %[[THIS_i8]] to %struct.B*
+ // CHECK2: store %struct.B* %[[THIS]], %struct.B** %[[THIS_ADDR:.*]], align 4
+ // CHECK2: %[[THIS:.*]] = load %struct.B** %[[THIS_ADDR]]
+ // CHECK2: call x86_thiscallcc void @"\01??_DB@@UAE@XZ"(%struct.B* %[[THIS]])
+ // ...
+ // CHECK2: ret
+}
+
+void B::foo() {
+// CHECK-LABEL: define x86_thiscallcc void @"\01?foo@B@@UAEXXZ"(i8*
+//
+// B::foo gets 'this' cast to VBase* in ECX (i.e. this+8) so we
+// need to adjust 'this' before use.
+//
+// CHECK: %[[THIS_ADDR:.*]] = alloca %struct.B*, align 4
+// CHECK: %[[THIS_i8:.*]] = getelementptr inbounds i8* %[[ECX:.*]], i32 -8
+// CHECK: %[[THIS:.*]] = bitcast i8* %[[THIS_i8]] to %struct.B*
+// CHECK: store %struct.B* %[[THIS]], %struct.B** %[[THIS_ADDR]], align 4
+
+ field = 42;
+// CHECK: %[[THIS:.*]] = load %struct.B** %[[THIS_ADDR]]
+// CHECK: %[[THIS8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+// CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8* %[[THIS8]], i32 0
+// CHECK: %[[VBPTR8:.*]] = bitcast i8* %[[VBPTR]] to i8**
+// CHECK: %[[VBTABLE:.*]] = load i8** %[[VBPTR8]]
+// CHECK: %[[VBENTRY8:.*]] = getelementptr inbounds i8* %[[VBTABLE]], i32 4
+// CHECK: %[[VBENTRY:.*]] = bitcast i8* %[[VBENTRY8]] to i32*
+// CHECK: %[[VBOFFSET32:.*]] = load i32* %[[VBENTRY]]
+// CHECK: %[[VBOFFSET:.*]] = add nsw i32 0, %[[VBOFFSET32]]
+// CHECK: %[[THIS8:.*]] = bitcast %struct.B* %[[THIS]] to i8*
+// CHECK: %[[VBASE_i8:.*]] = getelementptr inbounds i8* %[[THIS8]], i32 %[[VBOFFSET]]
+// CHECK: %[[VBASE:.*]] = bitcast i8* %[[VBASE_i8]] to %struct.VBase*
+// CHECK: %[[FIELD:.*]] = getelementptr inbounds %struct.VBase* %[[VBASE]], i32 0, i32 1
+// CHECK: store i32 42, i32* %[[FIELD]], align 4
+//
+// CHECK: ret void
+}
+
+void call_vbase_bar(B *obj) {
+// CHECK-LABEL: define void @"\01?call_vbase_bar@@YAXPAUB@@@Z"(%struct.B* %obj)
+// CHECK: %[[OBJ:.*]] = load %struct.B
+
+ obj->bar();
+// When calling a vbase's virtual method, one needs to adjust 'this'
+// at the caller site.
+//
+// CHECK: %[[OBJ_i8:.*]] = bitcast %struct.B* %[[OBJ]] to i8*
+// CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8* %[[OBJ_i8]], i32 0
+// CHECK: %[[VBPTR8:.*]] = bitcast i8* %[[VBPTR]] to i8**
+// CHECK: %[[VBTABLE:.*]] = load i8** %[[VBPTR8]]
+// CHECK: %[[VBENTRY8:.*]] = getelementptr inbounds i8* %[[VBTABLE]], i32 4
+// CHECK: %[[VBENTRY:.*]] = bitcast i8* %[[VBENTRY8]] to i32*
+// CHECK: %[[VBOFFSET32:.*]] = load i32* %[[VBENTRY]]
+// CHECK: %[[VBOFFSET:.*]] = add nsw i32 0, %[[VBOFFSET32]]
+// CHECK: %[[VBASE_i8:.*]] = getelementptr inbounds i8* %[[OBJ_i8]], i32 %[[VBOFFSET]]
+// CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VBASE_i8]] to void (i8*)***
+// CHECK: %[[VFTABLE:.*]] = load void (i8*)*** %[[VFPTR]]
+// CHECK: %[[VFUN:.*]] = getelementptr inbounds void (i8*)** %[[VFTABLE]], i64 2
+// CHECK: %[[VFUN_VALUE:.*]] = load void (i8*)** %[[VFUN]]
+//
+// CHECK: %[[OBJ_i8:.*]] = bitcast %struct.B* %[[OBJ]] to i8*
+// CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8* %[[OBJ_i8]], i32 0
+// CHECK: %[[VBPTR8:.*]] = bitcast i8* %[[VBPTR]] to i8**
+// CHECK: %[[VBTABLE:.*]] = load i8** %[[VBPTR8]]
+// CHECK: %[[VBENTRY8:.*]] = getelementptr inbounds i8* %[[VBTABLE]], i32 4
+// CHECK: %[[VBENTRY:.*]] = bitcast i8* %[[VBENTRY8]] to i32*
+// CHECK: %[[VBOFFSET32:.*]] = load i32* %[[VBENTRY]]
+// CHECK: %[[VBOFFSET:.*]] = add nsw i32 0, %[[VBOFFSET32]]
+// CHECK: %[[VBASE:.*]] = getelementptr inbounds i8* %[[OBJ_i8]], i32 %[[VBOFFSET]]
+//
+// CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](i8* %[[VBASE]])
+//
+// CHECK: ret void
+}
+
+void delete_B(B *obj) {
+// CHECK-LABEL: define void @"\01?delete_B@@YAXPAUB@@@Z"(%struct.B* %obj)
+// CHECK: %[[OBJ:.*]] = load %struct.B
+
+ delete obj;
+// CHECK: %[[OBJ_i8:.*]] = bitcast %struct.B* %[[OBJ]] to i8*
+// CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8* %[[OBJ_i8]], i32 0
+// CHECK: %[[VBPTR8:.*]] = bitcast i8* %[[VBPTR]] to i8**
+// CHECK: %[[VBTABLE:.*]] = load i8** %[[VBPTR8]]
+// CHECK: %[[VBENTRY8:.*]] = getelementptr inbounds i8* %[[VBTABLE]], i32 4
+// CHECK: %[[VBENTRY:.*]] = bitcast i8* %[[VBENTRY8]] to i32*
+// CHECK: %[[VBOFFSET32:.*]] = load i32* %[[VBENTRY]]
+// CHECK: %[[VBOFFSET:.*]] = add nsw i32 0, %[[VBOFFSET32]]
+// CHECK: %[[VBASE_i8:.*]] = getelementptr inbounds i8* %[[OBJ_i8]], i32 %[[VBOFFSET]]
+// CHECK: %[[VFPTR:.*]] = bitcast i8* %[[VBASE_i8]] to void (%struct.B*, i32)***
+// CHECK: %[[VFTABLE:.*]] = load void (%struct.B*, i32)*** %[[VFPTR]]
+// CHECK: %[[VFUN:.*]] = getelementptr inbounds void (%struct.B*, i32)** %[[VFTABLE]], i64 0
+// CHECK: %[[VFUN_VALUE:.*]] = load void (%struct.B*, i32)** %[[VFUN]]
+//
+// CHECK: %[[OBJ_i8:.*]] = bitcast %struct.B* %[[OBJ]] to i8*
+// CHECK: %[[VBPTR:.*]] = getelementptr inbounds i8* %[[OBJ_i8]], i32 0
+// CHECK: %[[VBPTR8:.*]] = bitcast i8* %[[VBPTR]] to i8**
+// CHECK: %[[VBTABLE:.*]] = load i8** %[[VBPTR8]]
+// CHECK: %[[VBENTRY8:.*]] = getelementptr inbounds i8* %[[VBTABLE]], i32 4
+// CHECK: %[[VBENTRY:.*]] = bitcast i8* %[[VBENTRY8]] to i32*
+// CHECK: %[[VBOFFSET32:.*]] = load i32* %[[VBENTRY]]
+// CHECK: %[[VBOFFSET:.*]] = add nsw i32 0, %[[VBOFFSET32]]
+// CHECK: %[[VBASE_i8:.*]] = getelementptr inbounds i8* %[[OBJ_i8]], i32 %[[VBOFFSET]]
+// CHECK: %[[VBASE:.*]] = bitcast i8* %[[VBASE_i8]] to %struct.B*
+//
+// CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](%struct.B* %[[VBASE]], i32 1)
+// CHECK: ret void
+}
+
+void call_complete_dtor() {
+ // CHECK-LABEL: define void @"\01?call_complete_dtor@@YAXXZ"
+ B b;
+ // CHECK: call x86_thiscallcc %struct.B* @"\01??0B@@QAE@XZ"(%struct.B* %[[B:.*]], i32 1)
+ // CHECK-NOT: getelementptr
+ // CHECK: call x86_thiscallcc void @"\01??_DB@@UAE@XZ"(%struct.B* %[[B]])
+ // CHECK: ret
+}
+
+struct C : B {
+ C();
+ // has an implicit vdtor.
+};
+
+// Used to crash on an assertion.
+C::C() {
+// CHECK-LABEL: define x86_thiscallcc %struct.C* @"\01??0C@@QAE@XZ"
+}
+
+namespace multiple_vbases {
+struct A {
+ virtual void a();
+};
+
+struct B {
+ virtual void b();
+};
+
+struct C {
+ virtual void c();
+};
+
+struct D : virtual A, virtual B, virtual C {
+ virtual void a();
+ virtual void b();
+ virtual void c();
+ D();
+};
+
+D::D() {
+ // CHECK-LABEL: define x86_thiscallcc %"struct.multiple_vbases::D"* @"\01??0D@multiple_vbases@@QAE@XZ"
+ // Just make sure we emit 3 vtordisps after initializing vfptrs.
+ // CHECK: store [1 x i8*]* @"\01??_7D@multiple_vbases@@6BA@1@@", [1 x i8*]** %{{.*}}
+ // CHECK: store [1 x i8*]* @"\01??_7D@multiple_vbases@@6BB@1@@", [1 x i8*]** %{{.*}}
+ // CHECK: store [1 x i8*]* @"\01??_7D@multiple_vbases@@6BC@1@@", [1 x i8*]** %{{.*}}
+ // ...
+ // CHECK: store i32 %{{.*}}, i32* %{{.*}}
+ // CHECK: store i32 %{{.*}}, i32* %{{.*}}
+ // CHECK: store i32 %{{.*}}, i32* %{{.*}}
+ // CHECK: ret
+}
+}
+
+namespace diamond {
+struct A {
+ A();
+ virtual ~A();
+};
+
+struct B : virtual A {
+ B();
+ ~B();
+};
+
+struct C : virtual A {
+ C();
+ ~C();
+ int c1, c2, c3;
+};
+
+struct Z {
+ int z;
+};
+
+struct D : virtual Z, B, C {
+ D();
+ ~D();
+} d;
+
+D::~D() {
+ // CHECK-LABEL: define x86_thiscallcc void @"\01??1D@diamond@@UAE@XZ"(%"struct.diamond::D"*)
+ // CHECK: %[[ARG_i8:.*]] = bitcast %"struct.diamond::D"* %{{.*}} to i8*
+ // CHECK: %[[THIS_i8:.*]] = getelementptr inbounds i8* %[[ARG_i8]], i32 -24
+ // CHECK: %[[THIS:.*]] = bitcast i8* %[[THIS_i8]] to %"struct.diamond::D"*
+ // CHECK: store %"struct.diamond::D"* %[[THIS]], %"struct.diamond::D"** %[[THIS_VAL:.*]], align 4
+ // CHECK: %[[THIS:.*]] = load %"struct.diamond::D"** %[[THIS_VAL]]
+ // CHECK: %[[D_i8:.*]] = bitcast %"struct.diamond::D"* %[[THIS]] to i8*
+ // CHECK: %[[C_i8:.*]] = getelementptr inbounds i8* %[[D_i8]], i64 4
+ // CHECK: %[[C:.*]] = bitcast i8* %[[C_i8]] to %"struct.diamond::C"*
+ // CHECK: %[[C_i8:.*]] = bitcast %"struct.diamond::C"* %[[C]] to i8*
+ // CHECK: %[[ARG_i8:.*]] = getelementptr i8* %{{.*}}, i32 16
+ // FIXME: We might consider changing the dtor this parameter type to i8*.
+ // CHECK: %[[ARG:.*]] = bitcast i8* %[[ARG_i8]] to %"struct.diamond::C"*
+ // CHECK: call x86_thiscallcc void @"\01??1C@diamond@@UAE@XZ"(%"struct.diamond::C"* %[[ARG]])
+
+ // CHECK: %[[B:.*]] = bitcast %"struct.diamond::D"* %[[THIS]] to %"struct.diamond::B"*
+ // CHECK: %[[B_i8:.*]] = bitcast %"struct.diamond::B"* %[[B]] to i8*
+ // CHECK: %[[ARG_i8:.*]] = getelementptr i8* %[[B_i8]], i32 4
+ // CHECK: %[[ARG:.*]] = bitcast i8* %[[ARG_i8]] to %"struct.diamond::B"*
+ // CHECK: call x86_thiscallcc void @"\01??1B@diamond@@UAE@XZ"(%"struct.diamond::B"* %[[ARG]])
+ // CHECK: ret void
+}
+
+}
diff --git a/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp b/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
new file mode 100644
index 000000000000..51a04c89dcb7
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
@@ -0,0 +1,108 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK32
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=x86_64-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK64
+
+struct S {
+ int x, y, z;
+};
+
+struct C {
+ virtual void foo();
+ virtual int bar(int, double);
+ virtual S baz(int);
+};
+
+namespace {
+struct D {
+ virtual void foo();
+};
+}
+
+void f() {
+ void (C::*ptr)();
+ ptr = &C::foo;
+ ptr = &C::foo; // Don't crash trying to define the thunk twice :)
+
+ int (C::*ptr2)(int, double);
+ ptr2 = &C::bar;
+
+ S (C::*ptr3)(int);
+ ptr3 = &C::baz;
+
+ void (D::*ptr4)();
+ ptr4 = &D::foo;
+
+// CHECK32-LABEL: define void @"\01?f@@YAXXZ"()
+// CHECK32: store i8* bitcast (void (%struct.C*)* @"\01??_9C@@$BA@AE" to i8*), i8** %ptr
+// CHECK32: store i8* bitcast (i32 (%struct.C*, i32, double)* @"\01??_9C@@$B3AE" to i8*), i8** %ptr2
+// CHECK32: store i8* bitcast (void (%struct.S*, %struct.C*, i32)* @"\01??_9C@@$B7AE" to i8*), i8** %ptr3
+// CHECK32: store i8* bitcast (void (%"struct.<anonymous namespace>::D"*)* @"\01??_9D@?A@@$BA@AE" to i8*), i8** %ptr4
+// CHECK32: }
+//
+// CHECK64-LABEL: define void @"\01?f@@YAXXZ"()
+// CHECK64: store i8* bitcast (void (%struct.C*)* @"\01??_9C@@$BA@AA" to i8*), i8** %ptr
+// CHECK64: store i8* bitcast (i32 (%struct.C*, i32, double)* @"\01??_9C@@$B7AA" to i8*), i8** %ptr2
+// CHECK64: store i8* bitcast (void (%struct.S*, %struct.C*, i32)* @"\01??_9C@@$BBA@AA" to i8*), i8** %ptr3
+// CHECK64: store i8* bitcast (void (%"struct.<anonymous namespace>::D"*)* @"\01??_9D@?A@@$BA@AA" to i8*), i8** %ptr
+// CHECK64: }
+}
+
+
+// Thunk for calling the 1st virtual function in C with no parameters.
+// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@@$BA@AE"(%struct.C* %this) unnamed_addr
+// CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*)** %{{.*}}, i64 0
+// CHECK32: [[CALLEE:%.*]] = load void (%struct.C*)** [[VPTR]]
+// CHECK32: call x86_thiscallcc void [[CALLEE]](%struct.C* %{{.*}})
+// CHECK32: ret void
+// CHECK32: }
+//
+// CHECK64-LABEL: define linkonce_odr void @"\01??_9C@@$BA@AA"(%struct.C* %this) unnamed_addr
+// CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%struct.C*)** %{{.*}}, i64 0
+// CHECK64: [[CALLEE:%.*]] = load void (%struct.C*)** [[VPTR]]
+// CHECK64: call void [[CALLEE]](%struct.C* %{{.*}})
+// CHECK64: ret void
+// CHECK64: }
+
+// Thunk for calling the 2nd virtual function in C, taking int and double as parameters, returning int.
+// CHECK32-LABEL: define linkonce_odr x86_thiscallcc i32 @"\01??_9C@@$B3AE"(%struct.C* %this, i32, double) unnamed_addr
+// CHECK32: [[VPTR:%.*]] = getelementptr inbounds i32 (%struct.C*, i32, double)** %{{.*}}, i64 1
+// CHECK32: [[CALLEE:%.*]] = load i32 (%struct.C*, i32, double)** [[VPTR]]
+// CHECK32: [[CALL:%.*]] = call x86_thiscallcc i32 [[CALLEE]](%struct.C* %{{.*}}, i32 %{{.*}}, double %{{.*}})
+// CHECK32: ret i32 [[CALL]]
+// CHECK32: }
+//
+// CHECK64-LABEL: define linkonce_odr i32 @"\01??_9C@@$B7AA"(%struct.C* %this, i32, double) unnamed_addr
+// CHECK64: [[VPTR:%.*]] = getelementptr inbounds i32 (%struct.C*, i32, double)** %{{.*}}, i64 1
+// CHECK64: [[CALLEE:%.*]] = load i32 (%struct.C*, i32, double)** [[VPTR]]
+// CHECK64: [[CALL:%.*]] = call i32 [[CALLEE]](%struct.C* %{{.*}}, i32 %{{.*}}, double %{{.*}})
+// CHECK64: ret i32 [[CALL]]
+// CHECK64: }
+
+// Thunk for calling the 3rd virtual function in C, taking an int parameter, returning a struct.
+// CHECK32-LABEL: define linkonce_odr x86_thiscallcc void @"\01??_9C@@$B7AE"(%struct.S* noalias sret %agg.result, %struct.C* %this, i32) unnamed_addr
+// CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%struct.S*, %struct.C*, i32)** %{{.*}}, i64 2
+// CHECK32: [[CALLEE:%.*]] = load void (%struct.S*, %struct.C*, i32)** [[VPTR]]
+// CHECK32: call x86_thiscallcc void [[CALLEE]](%struct.S* sret %agg.result, %struct.C* %{{.*}}, i32 %{{.*}})
+// CHECK32: ret void
+// CHECK32: }
+//
+// CHECK64-LABEL: define linkonce_odr void @"\01??_9C@@$BBA@AA"(%struct.S* noalias sret %agg.result, %struct.C* %this, i32) unnamed_addr
+// CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%struct.S*, %struct.C*, i32)** %{{.*}}, i64 2
+// CHECK64: [[CALLEE:%.*]] = load void (%struct.S*, %struct.C*, i32)** [[VPTR]]
+// CHECK64: call void [[CALLEE]](%struct.S* sret %agg.result, %struct.C* %{{.*}}, i32 %{{.*}})
+// CHECK64: ret void
+// CHECK64: }
+
+// Thunk for calling the virtual function in internal class D.
+// CHECK32-LABEL: define internal x86_thiscallcc void @"\01??_9D@?A@@$BA@AE"(%"struct.<anonymous namespace>::D"* %this) unnamed_addr
+// CHECK32: [[VPTR:%.*]] = getelementptr inbounds void (%"struct.<anonymous namespace>::D"*)** %{{.*}}, i64 0
+// CHECK32: [[CALLEE:%.*]] = load void (%"struct.<anonymous namespace>::D"*)** [[VPTR]]
+// CHECK32: call x86_thiscallcc void [[CALLEE]](%"struct.<anonymous namespace>::D"* %{{.*}})
+// CHECK32: ret void
+// CHECK32: }
+//
+// CHECK64-LABEL: define internal void @"\01??_9D@?A@@$BA@AA"(%"struct.<anonymous namespace>::D"* %this) unnamed_addr
+// CHECK64: [[VPTR:%.*]] = getelementptr inbounds void (%"struct.<anonymous namespace>::D"*)** %{{.*}}, i64 0
+// CHECK64: [[CALLEE:%.*]] = load void (%"struct.<anonymous namespace>::D"*)** [[VPTR]]
+// CHECK64: call void [[CALLEE]](%"struct.<anonymous namespace>::D"* %{{.*}})
+// CHECK64: ret void
+// CHECK64: }
diff --git a/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp
new file mode 100644
index 000000000000..d93dee11cdee
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp
@@ -0,0 +1,579 @@
+// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -o %t.ll -fdump-vtable-layouts >%t
+
+// RUN: FileCheck --check-prefix=NO-THUNKS-Test1 %s < %t
+// RUN: FileCheck --check-prefix=NO-THUNKS-Test2 %s < %t
+// RUN: FileCheck --check-prefix=NO-THUNKS-Test3 %s < %t
+// RUN: FileCheck --check-prefix=NO-THUNKS-Test4 %s < %t
+// RUN: FileCheck --check-prefix=NO-THUNKS-Test5 %s < %t
+// RUN: FileCheck --check-prefix=NO-THUNKS-Test6 %s < %t
+// RUN: FileCheck --check-prefix=NO-THUNKS-Test7 %s < %t
+// RUN: FileCheck --check-prefix=NO-THUNKS-Test8 %s < %t
+// RUN: FileCheck --check-prefix=NO-THUNKS-Test9 %s < %t
+// RUN: FileCheck --check-prefix=PURE-VIRTUAL-Test1 %s < %t
+// RUN: FileCheck --check-prefix=THIS-THUNKS-Test1 %s < %t
+// RUN: FileCheck --check-prefix=THIS-THUNKS-Test2 %s < %t
+// RUN: FileCheck --check-prefix=THIS-THUNKS-Test3 %s < %t
+// RUN: FileCheck --check-prefix=VDTOR-THUNKS-Test3 %s < %t
+// RUN: FileCheck --check-prefix=VDTOR-THUNKS-Test5 %s < %t
+// RUN: FileCheck --check-prefix=VDTOR-THUNKS-Test6 %s < %t
+// RUN: FileCheck --check-prefix=VDTOR-THUNKS-Test7 %s < %t
+// RUN: FileCheck --check-prefix=RET-THUNKS-Test1 %s < %t
+// RUN: FileCheck --check-prefix=RET-THUNKS-Test2 %s < %t
+// RUN: FileCheck --check-prefix=RET-THUNKS-Test3 %s < %t
+// RUN: FileCheck --check-prefix=RET-THUNKS-Test4 %s < %t
+// RUN: FileCheck --check-prefix=RET-THUNKS-Test5 %s < %t
+// RUN: FileCheck --check-prefix=RET-THUNKS-Test6 %s < %t
+
+// RUN: FileCheck --check-prefix=MANGLING %s < %t.ll
+
+struct Empty {
+ // Doesn't have a vftable!
+};
+
+struct A {
+ virtual void f();
+};
+
+struct B {
+ virtual void g();
+ // Add an extra virtual method so it's easier to check for the absence of thunks.
+ virtual void h();
+};
+
+struct C {
+ virtual void g(); // Might "collide" with B::g if both are bases of some class.
+};
+
+
+namespace no_thunks {
+
+struct Test1: A, B {
+ // NO-THUNKS-Test1: VFTable for 'A' in 'no_thunks::Test1' (1 entries)
+ // NO-THUNKS-Test1-NEXT: 0 | void no_thunks::Test1::f()
+
+ // NO-THUNKS-Test1: VFTable for 'B' in 'no_thunks::Test1' (2 entries)
+ // NO-THUNKS-Test1-NEXT: 0 | void B::g()
+ // NO-THUNKS-Test1-NEXT: 1 | void B::h()
+
+ // NO-THUNKS-Test1: VFTable indices for 'no_thunks::Test1' (1 entries)
+ // NO-THUNKS-Test1-NEXT: 0 | void no_thunks::Test1::f()
+
+ // MANGLING-DAG: @"\01??_7Test1@no_thunks@@6BA@@@"
+ // MANGLING-DAG: @"\01??_7Test1@no_thunks@@6BB@@@"
+
+ // Overrides only the left child's method (A::f), needs no thunks.
+ virtual void f();
+};
+
+Test1 t1;
+
+struct Test2: A, B {
+ // NO-THUNKS-Test2: VFTable for 'A' in 'no_thunks::Test2' (1 entries)
+ // NO-THUNKS-Test2-NEXT: 0 | void A::f()
+
+ // NO-THUNKS-Test2: VFTable for 'B' in 'no_thunks::Test2' (2 entries)
+ // NO-THUNKS-Test2-NEXT: 0 | void no_thunks::Test2::g()
+ // NO-THUNKS-Test2-NEXT: 1 | void B::h()
+
+ // NO-THUNKS-Test2: VFTable indices for 'no_thunks::Test2' (1 entries).
+ // NO-THUNKS-Test2-NEXT: via vfptr at offset 4
+ // NO-THUNKS-Test2-NEXT: 0 | void no_thunks::Test2::g()
+
+ // Overrides only the right child's method (B::g), needs this adjustment but
+ // not thunks.
+ virtual void g();
+};
+
+Test2 t2;
+
+struct Test3: A, B {
+ // NO-THUNKS-Test3: VFTable for 'A' in 'no_thunks::Test3' (2 entries)
+ // NO-THUNKS-Test3-NEXT: 0 | void A::f()
+ // NO-THUNKS-Test3-NEXT: 1 | void no_thunks::Test3::i()
+
+ // NO-THUNKS-Test3: VFTable for 'B' in 'no_thunks::Test3' (2 entries)
+ // NO-THUNKS-Test3-NEXT: 0 | void B::g()
+ // NO-THUNKS-Test3-NEXT: 1 | void B::h()
+
+ // NO-THUNKS-Test3: VFTable indices for 'no_thunks::Test3' (1 entries).
+ // NO-THUNKS-Test3-NEXT: 1 | void no_thunks::Test3::i()
+
+ // Only adds a new method.
+ virtual void i();
+};
+
+Test3 t3;
+
+// Only the right base has a vftable, so it's laid out before the left one!
+struct Test4 : Empty, A {
+ // NO-THUNKS-Test4: VFTable for 'A' in 'no_thunks::Test4' (1 entries)
+ // NO-THUNKS-Test4-NEXT: 0 | void no_thunks::Test4::f()
+
+ // NO-THUNKS-Test4: VFTable indices for 'no_thunks::Test4' (1 entries).
+ // NO-THUNKS-Test4-NEXT: 0 | void no_thunks::Test4::f()
+
+ // MANGLING-DAG: @"\01??_7Test4@no_thunks@@6B@"
+
+ virtual void f();
+};
+
+Test4 t4;
+
+// 2-level structure with repeating subobject types, but no thunks needed.
+struct Test5: Test1, Test2 {
+ // NO-THUNKS-Test5: VFTable for 'A' in 'no_thunks::Test1' in 'no_thunks::Test5' (2 entries)
+ // NO-THUNKS-Test5-NEXT: 0 | void no_thunks::Test1::f()
+ // NO-THUNKS-Test5-NEXT: 1 | void no_thunks::Test5::z()
+
+ // NO-THUNKS-Test5: VFTable for 'B' in 'no_thunks::Test1' in 'no_thunks::Test5' (2 entries)
+ // NO-THUNKS-Test5-NEXT: 0 | void B::g()
+ // NO-THUNKS-Test5-NEXT: 1 | void B::h()
+
+ // NO-THUNKS-Test5: VFTable for 'A' in 'no_thunks::Test2' in 'no_thunks::Test5' (1 entries)
+ // NO-THUNKS-Test5-NEXT: 0 | void A::f()
+
+ // NO-THUNKS-Test5: VFTable for 'B' in 'no_thunks::Test2' in 'no_thunks::Test5' (2 entries)
+ // NO-THUNKS-Test5-NEXT: 0 | void no_thunks::Test2::g()
+ // NO-THUNKS-Test5-NEXT: 1 | void B::h()
+
+ // NO-THUNKS-Test5: VFTable indices for 'no_thunks::Test5' (1 entries).
+ // NO-THUNKS-Test5-NEXT: 1 | void no_thunks::Test5::z()
+
+ // MANGLING-DAG: @"\01??_7Test5@no_thunks@@6BA@@Test1@1@@"
+ // MANGLING-DAG: @"\01??_7Test5@no_thunks@@6BA@@Test2@1@@"
+ // MANGLING-DAG: @"\01??_7Test5@no_thunks@@6BB@@Test1@1@@"
+ // MANGLING-DAG: @"\01??_7Test5@no_thunks@@6BB@@Test2@1@@"
+
+ virtual void z();
+};
+
+Test5 t5;
+
+struct Test6: Test1 {
+ // NO-THUNKS-Test6: VFTable for 'A' in 'no_thunks::Test1' in 'no_thunks::Test6' (1 entries).
+ // NO-THUNKS-Test6-NEXT: 0 | void no_thunks::Test6::f()
+
+ // NO-THUNKS-Test6: VFTable for 'B' in 'no_thunks::Test1' in 'no_thunks::Test6' (2 entries).
+ // NO-THUNKS-Test6-NEXT: 0 | void B::g()
+ // NO-THUNKS-Test6-NEXT: 1 | void B::h()
+
+ // NO-THUNKS-Test6: VFTable indices for 'no_thunks::Test6' (1 entries).
+ // NO-THUNKS-Test6-NEXT: 0 | void no_thunks::Test6::f()
+
+ // MANGLING-DAG: @"\01??_7Test6@no_thunks@@6BA@@@"
+ // MANGLING-DAG: @"\01??_7Test6@no_thunks@@6BB@@@"
+
+ // Overrides both no_thunks::Test1::f and A::f.
+ virtual void f();
+};
+
+Test6 t6;
+
+struct Test7: Test2 {
+ // NO-THUNKS-Test7: VFTable for 'A' in 'no_thunks::Test2' in 'no_thunks::Test7' (1 entries).
+ // NO-THUNKS-Test7-NEXT: 0 | void A::f()
+
+ // NO-THUNKS-Test7: VFTable for 'B' in 'no_thunks::Test2' in 'no_thunks::Test7' (2 entries).
+ // NO-THUNKS-Test7-NEXT: 0 | void no_thunks::Test7::g()
+ // NO-THUNKS-Test7-NEXT: 1 | void B::h()
+
+ // NO-THUNKS-Test7: VFTable indices for 'no_thunks::Test7' (1 entries).
+ // NO-THUNKS-Test7-NEXT: via vfptr at offset 4
+ // NO-THUNKS-Test7-NEXT: 0 | void no_thunks::Test7::g()
+
+ // Overrides both no_thunks::Test2::g and B::g.
+ virtual void g();
+};
+
+Test7 t7;
+
+struct Test8: Test3 {
+ // NO-THUNKS-Test8: VFTable for 'A' in 'no_thunks::Test3' in 'no_thunks::Test8' (2 entries).
+ // NO-THUNKS-Test8-NEXT: 0 | void A::f()
+ // NO-THUNKS-Test8-NEXT: 1 | void no_thunks::Test3::i()
+
+ // NO-THUNKS-Test8: VFTable for 'B' in 'no_thunks::Test3' in 'no_thunks::Test8' (2 entries).
+ // NO-THUNKS-Test8-NEXT: 0 | void no_thunks::Test8::g()
+ // NO-THUNKS-Test8-NEXT: 1 | void B::h()
+
+ // NO-THUNKS-Test8: VFTable indices for 'no_thunks::Test8' (1 entries).
+ // NO-THUNKS-Test8-NEXT: via vfptr at offset 4
+ // NO-THUNKS-Test8-NEXT: 0 | void no_thunks::Test8::g()
+
+ // Overrides grandparent's B::g.
+ virtual void g();
+};
+
+Test8 t8;
+
+struct D : A {
+ virtual void g();
+};
+
+// Repeating subobject.
+struct Test9: A, D {
+ // NO-THUNKS-Test9: VFTable for 'A' in 'no_thunks::Test9' (2 entries).
+ // NO-THUNKS-Test9-NEXT: 0 | void A::f()
+ // NO-THUNKS-Test9-NEXT: 1 | void no_thunks::Test9::h()
+
+ // NO-THUNKS-Test9: VFTable for 'A' in 'no_thunks::D' in 'no_thunks::Test9' (2 entries).
+ // NO-THUNKS-Test9-NEXT: 0 | void A::f()
+ // NO-THUNKS-Test9-NEXT: 1 | void no_thunks::D::g()
+
+ // NO-THUNKS-Test9: VFTable indices for 'no_thunks::Test9' (1 entries).
+ // NO-THUNKS-Test9-NEXT: 1 | void no_thunks::Test9::h()
+
+ // MANGLING-DAG: @"\01??_7Test9@no_thunks@@6BA@@@"
+ // MANGLING-DAG: @"\01??_7Test9@no_thunks@@6BD@1@@"
+
+ virtual void h();
+};
+
+Test9 t9;
+}
+
+namespace pure_virtual {
+struct D {
+ virtual void g() = 0;
+ virtual void h();
+};
+
+
+struct Test1: A, D {
+ // PURE-VIRTUAL-Test1: VFTable for 'A' in 'pure_virtual::Test1' (1 entries)
+ // PURE-VIRTUAL-Test1-NEXT: 0 | void A::f()
+
+ // PURE-VIRTUAL-Test1: VFTable for 'pure_virtual::D' in 'pure_virtual::Test1' (2 entries)
+ // PURE-VIRTUAL-Test1-NEXT: 0 | void pure_virtual::Test1::g()
+ // PURE-VIRTUAL-Test1-NEXT: 1 | void pure_virtual::D::h()
+
+ // PURE-VIRTUAL-Test1: VFTable indices for 'pure_virtual::Test1' (1 entries).
+ // PURE-VIRTUAL-Test1-NEXT: via vfptr at offset 4
+ // PURE-VIRTUAL-Test1-NEXT: 0 | void pure_virtual::Test1::g()
+
+ // MANGLING-DAG: @"\01??_7Test1@pure_virtual@@6BA@@@"
+ // MANGLING-DAG: @"\01??_7Test1@pure_virtual@@6BD@1@@"
+
+ // Overrides only the right child's method (pure_virtual::D::g), needs this adjustment but
+ // not thunks.
+ virtual void g();
+};
+
+Test1 t1;
+}
+
+namespace this_adjustment {
+
+// Overrides methods of two bases at the same time, thus needing thunks.
+struct Test1 : B, C {
+ // THIS-THUNKS-Test1: VFTable for 'B' in 'this_adjustment::Test1' (2 entries).
+ // THIS-THUNKS-Test1-NEXT: 0 | void this_adjustment::Test1::g()
+ // THIS-THUNKS-Test1-NEXT: 1 | void B::h()
+
+ // THIS-THUNKS-Test1: VFTable for 'C' in 'this_adjustment::Test1' (1 entries).
+ // THIS-THUNKS-Test1-NEXT: 0 | void this_adjustment::Test1::g()
+ // THIS-THUNKS-Test1-NEXT: [this adjustment: -4 non-virtual]
+
+ // THIS-THUNKS-Test1: Thunks for 'void this_adjustment::Test1::g()' (1 entry).
+ // THIS-THUNKS-Test1-NEXT: 0 | [this adjustment: -4 non-virtual]
+
+ // THIS-THUNKS-Test1: VFTable indices for 'this_adjustment::Test1' (1 entries).
+ // THIS-THUNKS-Test1-NEXT: 0 | void this_adjustment::Test1::g()
+
+ // MANGLING-DAG: @"\01??_7Test1@this_adjustment@@6BB@@@"
+ // MANGLING-DAG: @"\01??_7Test1@this_adjustment@@6BC@@@"
+
+ virtual void g();
+};
+
+Test1 t1;
+
+struct Test2 : A, B, C {
+ // THIS-THUNKS-Test2: VFTable for 'A' in 'this_adjustment::Test2' (1 entries).
+ // THIS-THUNKS-Test2-NEXT: 0 | void A::f()
+
+ // THIS-THUNKS-Test2: VFTable for 'B' in 'this_adjustment::Test2' (2 entries).
+ // THIS-THUNKS-Test2-NEXT: 0 | void this_adjustment::Test2::g()
+ // THIS-THUNKS-Test2-NEXT: 1 | void B::h()
+
+ // THIS-THUNKS-Test2: VFTable for 'C' in 'this_adjustment::Test2' (1 entries).
+ // THIS-THUNKS-Test2-NEXT: 0 | void this_adjustment::Test2::g()
+ // THIS-THUNKS-Test2-NEXT: [this adjustment: -4 non-virtual]
+
+ // THIS-THUNKS-Test2: Thunks for 'void this_adjustment::Test2::g()' (1 entry).
+ // THIS-THUNKS-Test2-NEXT: 0 | [this adjustment: -4 non-virtual]
+
+ // THIS-THUNKS-Test2: VFTable indices for 'this_adjustment::Test2' (1 entries).
+ // THIS-THUNKS-Test2-NEXT: via vfptr at offset 4
+ // THIS-THUNKS-Test2-NEXT: 0 | void this_adjustment::Test2::g()
+
+ // MANGLING-DAG: @"\01??_7Test2@this_adjustment@@6BA@@@"
+ // MANGLING-DAG: @"\01??_7Test2@this_adjustment@@6BB@@@"
+ // MANGLING-DAG: @"\01??_7Test2@this_adjustment@@6BC@@@"
+
+ virtual void g();
+};
+
+Test2 t2;
+
+// Overrides methods of two bases at the same time, thus needing thunks.
+struct Test3: no_thunks::Test1, no_thunks::Test2 {
+ // THIS-THUNKS-Test3: VFTable for 'A' in 'no_thunks::Test1' in 'this_adjustment::Test3' (1 entries).
+ // THIS-THUNKS-Test3-NEXT: 0 | void this_adjustment::Test3::f()
+
+ // THIS-THUNKS-Test3: VFTable for 'B' in 'no_thunks::Test1' in 'this_adjustment::Test3' (2 entries).
+ // THIS-THUNKS-Test3-NEXT: 0 | void this_adjustment::Test3::g()
+ // THIS-THUNKS-Test3-NEXT: 1 | void B::h()
+
+ // THIS-THUNKS-Test3: VFTable for 'A' in 'no_thunks::Test2' in 'this_adjustment::Test3' (1 entries).
+ // THIS-THUNKS-Test3-NEXT: 0 | void this_adjustment::Test3::f()
+ // THIS-THUNKS-Test3-NEXT: [this adjustment: -8 non-virtual]
+
+ // THIS-THUNKS-Test3: Thunks for 'void this_adjustment::Test3::f()' (1 entry).
+ // THIS-THUNKS-Test3-NEXT: 0 | [this adjustment: -8 non-virtual]
+
+ // THIS-THUNKS-Test3: VFTable for 'B' in 'no_thunks::Test2' in 'this_adjustment::Test3' (2 entries).
+ // THIS-THUNKS-Test3-NEXT: 0 | void this_adjustment::Test3::g()
+ // THIS-THUNKS-Test3-NEXT: [this adjustment: -8 non-virtual]
+ // THIS-THUNKS-Test3-NEXT: 1 | void B::h()
+
+ // THIS-THUNKS-Test3: Thunks for 'void this_adjustment::Test3::g()' (1 entry).
+ // THIS-THUNKS-Test3-NEXT: 0 | [this adjustment: -8 non-virtual]
+
+ // THIS-THUNKS-Test3: VFTable indices for 'this_adjustment::Test3' (2 entries).
+ // THIS-THUNKS-Test3-NEXT: via vfptr at offset 0
+ // THIS-THUNKS-Test3-NEXT: 0 | void this_adjustment::Test3::f()
+ // THIS-THUNKS-Test3-NEXT: via vfptr at offset 4
+ // THIS-THUNKS-Test3-NEXT: 0 | void this_adjustment::Test3::g()
+
+ virtual void f();
+ virtual void g();
+};
+
+Test3 t3;
+}
+
+namespace vdtor {
+struct Test1 {
+ virtual ~Test1();
+ virtual void z1();
+};
+
+struct Test2 {
+ virtual ~Test2();
+};
+
+struct Test3 : Test1, Test2 {
+ // VDTOR-THUNKS-Test3: VFTable for 'vdtor::Test1' in 'vdtor::Test3' (2 entries).
+ // VDTOR-THUNKS-Test3-NEXT: 0 | vdtor::Test3::~Test3() [scalar deleting]
+ // VDTOR-THUNKS-Test3-NEXT: 1 | void vdtor::Test1::z1()
+
+ // VDTOR-THUNKS-Test3: VFTable for 'vdtor::Test2' in 'vdtor::Test3' (1 entries).
+ // VDTOR-THUNKS-Test3-NEXT: 0 | vdtor::Test3::~Test3() [scalar deleting]
+ // VDTOR-THUNKS-Test3-NEXT: [this adjustment: -4 non-virtual]
+
+ // VDTOR-THUNKS-Test3: Thunks for 'vdtor::Test3::~Test3()' (1 entry).
+ // VDTOR-THUNKS-Test3-NEXT: 0 | [this adjustment: -4 non-virtual]
+
+ // VDTOR-THUNKS-Test3: VFTable indices for 'vdtor::Test3' (1 entries).
+ // VDTOR-THUNKS-Test3-NEXT: 0 | vdtor::Test3::~Test3() [scalar deleting]
+ virtual ~Test3();
+};
+
+Test3 t3;
+
+struct Test4 {
+ // No virtual destructor here!
+ virtual void z4();
+};
+
+struct Test5 : Test4, Test2 {
+ // Implicit virtual dtor here!
+
+ // VDTOR-THUNKS-Test5: VFTable for 'vdtor::Test4' in 'vdtor::Test5' (1 entries).
+ // VDTOR-THUNKS-Test5-NEXT: 0 | void vdtor::Test4::z4()
+
+ // VDTOR-THUNKS-Test5: VFTable for 'vdtor::Test2' in 'vdtor::Test5' (1 entries).
+ // VDTOR-THUNKS-Test5-NEXT: 0 | vdtor::Test5::~Test5() [scalar deleting]
+ // VDTOR-THUNKS-Test5-NEXT: [this adjustment: -4 non-virtual]
+
+ // VDTOR-THUNKS-Test5: Thunks for 'vdtor::Test5::~Test5()' (1 entry).
+ // VDTOR-THUNKS-Test5-NEXT: 0 | [this adjustment: -4 non-virtual]
+
+ // VDTOR-THUNKS-Test5: VFTable indices for 'vdtor::Test5' (1 entries).
+ // VDTOR-THUNKS-Test5-NEXT: -- accessible via vfptr at offset 4 --
+ // VDTOR-THUNKS-Test5-NEXT: 0 | vdtor::Test5::~Test5() [scalar deleting]
+};
+
+Test5 t5;
+
+struct Test6 : Test4, Test2 {
+ // Implicit virtual dtor here!
+
+ // VDTOR-THUNKS-Test6: VFTable for 'vdtor::Test4' in 'vdtor::Test6' (1 entries).
+ // VDTOR-THUNKS-Test6-NEXT: 0 | void vdtor::Test4::z4()
+
+ // VDTOR-THUNKS-Test6: VFTable for 'vdtor::Test2' in 'vdtor::Test6' (1 entries).
+ // VDTOR-THUNKS-Test6-NEXT: 0 | vdtor::Test6::~Test6() [scalar deleting]
+ // VDTOR-THUNKS-Test6-NEXT: [this adjustment: -4 non-virtual]
+
+ // VDTOR-THUNKS-Test6: Thunks for 'vdtor::Test6::~Test6()' (1 entry).
+ // VDTOR-THUNKS-Test6-NEXT: 0 | [this adjustment: -4 non-virtual]
+
+ // VDTOR-THUNKS-Test6: VFTable indices for 'vdtor::Test6' (1 entries).
+ // VDTOR-THUNKS-Test6-NEXT: -- accessible via vfptr at offset 4 --
+ // VDTOR-THUNKS-Test6-NEXT: 0 | vdtor::Test6::~Test6() [scalar deleting]
+};
+
+Test6 t6;
+
+struct Test7 : Test5 {
+ // VDTOR-THUNKS-Test7: VFTable for 'vdtor::Test4' in 'vdtor::Test5' in 'vdtor::Test7' (1 entries).
+ // VDTOR-THUNKS-Test7-NEXT: 0 | void vdtor::Test4::z4()
+
+ // VDTOR-THUNKS-Test7: VFTable for 'vdtor::Test2' in 'vdtor::Test5' in 'vdtor::Test7' (1 entries).
+ // VDTOR-THUNKS-Test7-NEXT: 0 | vdtor::Test7::~Test7() [scalar deleting]
+ // VDTOR-THUNKS-Test7-NEXT: [this adjustment: -4 non-virtual]
+
+ // VDTOR-THUNKS-Test7: Thunks for 'vdtor::Test7::~Test7()' (1 entry).
+ // VDTOR-THUNKS-Test7-NEXT: 0 | [this adjustment: -4 non-virtual]
+
+ // VDTOR-THUNKS-Test7: VFTable indices for 'vdtor::Test7' (1 entries).
+ // VDTOR-THUNKS-Test7-NEXT: -- accessible via vfptr at offset 4 --
+ // VDTOR-THUNKS-Test7-NEXT: 0 | vdtor::Test7::~Test7() [scalar deleting]
+ virtual ~Test7();
+};
+
+Test7 t7;
+
+}
+
+namespace return_adjustment {
+
+struct Ret1 {
+ virtual C* foo();
+ virtual void z();
+};
+
+struct Test1 : Ret1 {
+ // RET-THUNKS-Test1: VFTable for 'return_adjustment::Ret1' in 'return_adjustment::Test1' (3 entries).
+ // RET-THUNKS-Test1-NEXT: 0 | this_adjustment::Test1 *return_adjustment::Test1::foo()
+ // RET-THUNKS-Test1-NEXT: [return adjustment: 4 non-virtual]
+ // RET-THUNKS-Test1-NEXT: 1 | void return_adjustment::Ret1::z()
+ // RET-THUNKS-Test1-NEXT: 2 | this_adjustment::Test1 *return_adjustment::Test1::foo()
+
+ // RET-THUNKS-Test1: VFTable indices for 'return_adjustment::Test1' (1 entries).
+ // RET-THUNKS-Test1-NEXT: 2 | this_adjustment::Test1 *return_adjustment::Test1::foo()
+
+ // MANGLING-DAG: @"\01??_7Test1@return_adjustment@@6B@"
+
+ virtual this_adjustment::Test1* foo();
+};
+
+Test1 t1;
+
+struct Ret2 : B, this_adjustment::Test1 { };
+
+struct Test2 : Test1 {
+ // RET-THUNKS-Test2: VFTable for 'return_adjustment::Ret1' in 'return_adjustment::Test1' in 'return_adjustment::Test2' (4 entries).
+ // RET-THUNKS-Test2-NEXT: 0 | return_adjustment::Ret2 *return_adjustment::Test2::foo()
+ // RET-THUNKS-Test2-NEXT: [return adjustment: 8 non-virtual]
+ // RET-THUNKS-Test2-NEXT: 1 | void return_adjustment::Ret1::z()
+ // RET-THUNKS-Test2-NEXT: 2 | return_adjustment::Ret2 *return_adjustment::Test2::foo()
+ // RET-THUNKS-Test2-NEXT: [return adjustment: 4 non-virtual]
+ // RET-THUNKS-Test2-NEXT: 3 | return_adjustment::Ret2 *return_adjustment::Test2::foo()
+
+ // RET-THUNKS-Test2: VFTable indices for 'return_adjustment::Test2' (1 entries).
+ // RET-THUNKS-Test2-NEXT: 3 | return_adjustment::Ret2 *return_adjustment::Test2::foo()
+
+ virtual Ret2* foo();
+};
+
+Test2 t2;
+
+struct Test3: B, Ret1 {
+ // RET-THUNKS-Test3: VFTable for 'B' in 'return_adjustment::Test3' (2 entries).
+ // RET-THUNKS-Test3-NEXT: 0 | void B::g()
+ // RET-THUNKS-Test3-NEXT: 1 | void B::h()
+
+ // RET-THUNKS-Test3: VFTable for 'return_adjustment::Ret1' in 'return_adjustment::Test3' (3 entries).
+ // RET-THUNKS-Test3-NEXT: 0 | this_adjustment::Test1 *return_adjustment::Test3::foo()
+ // RET-THUNKS-Test3-NEXT: [return adjustment: 4 non-virtual]
+ // RET-THUNKS-Test3-NEXT: 1 | void return_adjustment::Ret1::z()
+ // RET-THUNKS-Test3-NEXT: 2 | this_adjustment::Test1 *return_adjustment::Test3::foo()
+
+ // RET-THUNKS-Test3: VFTable indices for 'return_adjustment::Test3' (1 entries).
+ // RET-THUNKS-Test3-NEXT: via vfptr at offset 4
+ // RET-THUNKS-Test3-NEXT: 2 | this_adjustment::Test1 *return_adjustment::Test3::foo()
+
+ virtual this_adjustment::Test1* foo();
+};
+
+Test3 t3;
+
+struct Test4 : Test3 {
+ // RET-THUNKS-Test4: VFTable for 'B' in 'return_adjustment::Test3' in 'return_adjustment::Test4' (2 entries).
+ // RET-THUNKS-Test4-NEXT: 0 | void B::g()
+ // RET-THUNKS-Test4-NEXT: 1 | void B::h()
+
+ // RET-THUNKS-Test4: VFTable for 'return_adjustment::Ret1' in 'return_adjustment::Test3' in 'return_adjustment::Test4' (4 entries).
+ // RET-THUNKS-Test4-NEXT: 0 | return_adjustment::Ret2 *return_adjustment::Test4::foo()
+ // RET-THUNKS-Test4-NEXT: [return adjustment: 8 non-virtual]
+ // RET-THUNKS-Test4-NEXT: 1 | void return_adjustment::Ret1::z()
+ // RET-THUNKS-Test4-NEXT: 2 | return_adjustment::Ret2 *return_adjustment::Test4::foo()
+ // RET-THUNKS-Test4-NEXT: [return adjustment: 4 non-virtual]
+ // RET-THUNKS-Test4-NEXT: 3 | return_adjustment::Ret2 *return_adjustment::Test4::foo()
+
+ // RET-THUNKS-Test4: VFTable indices for 'return_adjustment::Test4' (1 entries).
+ // RET-THUNKS-Test4-NEXT: -- accessible via vfptr at offset 4 --
+ // RET-THUNKS-Test4-NEXT: 3 | return_adjustment::Ret2 *return_adjustment::Test4::foo()
+
+ virtual Ret2* foo();
+};
+
+Test4 t4;
+
+struct Test5 : Ret1, Test1 {
+ // RET-THUNKS-Test5: VFTable for 'return_adjustment::Ret1' in 'return_adjustment::Test5' (3 entries).
+ // RET-THUNKS-Test5-NEXT: 0 | return_adjustment::Ret2 *return_adjustment::Test5::foo()
+ // RET-THUNKS-Test5-NEXT: [return adjustment: 8 non-virtual]
+ // RET-THUNKS-Test5-NEXT: 1 | void return_adjustment::Ret1::z()
+ // RET-THUNKS-Test5-NEXT: 2 | return_adjustment::Ret2 *return_adjustment::Test5::foo()
+
+ // RET-THUNKS-Test5: VFTable for 'return_adjustment::Ret1' in 'return_adjustment::Test1' in 'return_adjustment::Test5' (4 entries).
+ // RET-THUNKS-Test5-NEXT: 0 | return_adjustment::Ret2 *return_adjustment::Test5::foo()
+ // RET-THUNKS-Test5-NEXT: [return adjustment: 8 non-virtual]
+ // RET-THUNKS-Test5-NEXT: [this adjustment: -4 non-virtual]
+ // RET-THUNKS-Test5-NEXT: 1 | void return_adjustment::Ret1::z()
+ // RET-THUNKS-Test5-NEXT: 2 | return_adjustment::Ret2 *return_adjustment::Test5::foo()
+ // RET-THUNKS-Test5-NEXT: [return adjustment: 4 non-virtual]
+ // RET-THUNKS-Test5-NEXT: [this adjustment: -4 non-virtual]
+ // RET-THUNKS-Test5-NEXT: 3 | return_adjustment::Ret2 *return_adjustment::Test5::foo()
+ // RET-THUNKS-Test5-NEXT: [this adjustment: -4 non-virtual]
+
+ // RET-THUNKS-Test5: VFTable indices for 'return_adjustment::Test5' (1 entries).
+ // RET-THUNKS-Test5-NEXT: 2 | return_adjustment::Ret2 *return_adjustment::Test5::foo()
+
+ virtual Ret2* foo();
+};
+
+Test5 t5;
+
+struct Ret3 : this_adjustment::Test1 { };
+
+struct Test6 : Test1 {
+ virtual Ret3* foo();
+ // RET-THUNKS-Test6: VFTable for 'return_adjustment::Ret1' in 'return_adjustment::Test1' in 'return_adjustment::Test6' (4 entries).
+ // RET-THUNKS-Test6-NEXT: 0 | return_adjustment::Ret3 *return_adjustment::Test6::foo()
+ // RET-THUNKS-Test6-NEXT: [return adjustment: 4 non-virtual]
+ // RET-THUNKS-Test6-NEXT: 1 | void return_adjustment::Ret1::z()
+ // RET-THUNKS-Test6-NEXT: 2 | return_adjustment::Ret3 *return_adjustment::Test6::foo()
+ // RET-THUNKS-Test6-NEXT: 3 | return_adjustment::Ret3 *return_adjustment::Test6::foo()
+
+ // RET-THUNKS-Test6: VFTable indices for 'return_adjustment::Test6' (1 entries).
+ // RET-THUNKS-Test6-NEXT: 3 | return_adjustment::Ret3 *return_adjustment::Test6::foo()
+};
+
+Test6 t6;
+
+}
diff --git a/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
index 5d430db54e2e..6fe12b0ef07b 100644
--- a/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
+++ b/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
@@ -1,5 +1,6 @@
-// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -fdump-vtable-layouts -o - > %t 2>&1
-// RUN: FileCheck --check-prefix=EMITS-VTABLE %s < %t
+// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -fdump-vtable-layouts -o %t.ll > %t
+// RUN: FileCheck --check-prefix=EMITS-VFTABLE %s < %t.ll
+// RUN: FileCheck --check-prefix=NO-VFTABLE %s < %t.ll
// RUN: FileCheck --check-prefix=CHECK-A %s < %t
// RUN: FileCheck --check-prefix=CHECK-B %s < %t
// RUN: FileCheck --check-prefix=CHECK-C %s < %t
@@ -7,107 +8,245 @@
// RUN: FileCheck --check-prefix=CHECK-E %s < %t
// RUN: FileCheck --check-prefix=CHECK-F %s < %t
// RUN: FileCheck --check-prefix=CHECK-G %s < %t
+// RUN: FileCheck --check-prefix=CHECK-I %s < %t
+// RUN: FileCheck --check-prefix=CHECK-J %s < %t
+// RUN: FileCheck --check-prefix=CHECK-K %s < %t
+// RUN: FileCheck --check-prefix=CHECK-L %s < %t
+// RUN: FileCheck --check-prefix=CHECK-M %s < %t
+// RUN: FileCheck --check-prefix=CHECK-N %s < %t
struct A {
- // CHECK-A: Vtable for 'A' (3 entries)
+ // CHECK-A: VFTable for 'A' (3 entries)
// CHECK-A-NEXT: 0 | void A::f()
// CHECK-A-NEXT: 1 | void A::g()
// CHECK-A-NEXT: 2 | void A::h()
- // EMITS-VTABLE: @"\01??_7A@@6B@" = unnamed_addr constant [3 x i8*]
+ // CHECK-A: VFTable indices for 'A' (3 entries)
+ // CHECK-A-NEXT: 0 | void A::f()
+ // CHECK-A-NEXT: 1 | void A::g()
+ // CHECK-A-NEXT: 2 | void A::h()
+
virtual void f();
virtual void g();
virtual void h();
int ia;
};
-void A::f() {}
+A a;
+// EMITS-VFTABLE-DAG: @"\01??_7A@@6B@" = linkonce_odr unnamed_addr constant [3 x i8*]
struct B : A {
- // CHECK-B: Vtable for 'B' (5 entries)
+ // CHECK-B: VFTable for 'A' in 'B' (5 entries)
// CHECK-B-NEXT: 0 | void B::f()
// CHECK-B-NEXT: 1 | void A::g()
// CHECK-B-NEXT: 2 | void A::h()
// CHECK-B-NEXT: 3 | void B::i()
// CHECK-B-NEXT: 4 | void B::j()
- // EMITS-VTABLE: @"\01??_7B@@6B@" = unnamed_addr constant [5 x i8*]
+ // CHECK-B: VFTable indices for 'B' (3 entries)
+ // CHECK-B-NEXT: 0 | void B::f()
+ // CHECK-B-NEXT: 3 | void B::i()
+ // CHECK-B-NEXT: 4 | void B::j()
+
virtual void f(); // overrides A::f()
virtual void i();
virtual void j();
};
-void B::f() {}
+B b;
+// EMITS-VFTABLE-DAG: @"\01??_7B@@6B@" = linkonce_odr unnamed_addr constant [5 x i8*]
struct C {
- // CHECK-C: Vtable for 'C' (2 entries)
+ // CHECK-C: VFTable for 'C' (2 entries)
// CHECK-C-NEXT: 0 | C::~C() [scalar deleting]
// CHECK-C-NEXT: 1 | void C::f()
- // CHECK-C: VTable indices for 'C' (2 entries).
+ // CHECK-C: VFTable indices for 'C' (2 entries).
// CHECK-C-NEXT: 0 | C::~C() [scalar deleting]
// CHECK-C-NEXT: 1 | void C::f()
- // Never used, so doesn't emit a vtable.
- virtual ~C();
+ virtual ~C();
virtual void f();
};
void C::f() {}
+// NO-VFTABLE-NOT: @"\01??_7C@@6B@"
struct D {
- // CHECK-D: Vtable for 'D' (2 entries)
+ // CHECK-D: VFTable for 'D' (2 entries)
+ // CHECK-D-NEXT: 0 | void D::f()
+ // CHECK-D-NEXT: 1 | D::~D() [scalar deleting]
+ // CHECK-D: VFTable indices for 'D' (2 entries)
// CHECK-D-NEXT: 0 | void D::f()
// CHECK-D-NEXT: 1 | D::~D() [scalar deleting]
- // EMITS-VTABLE: @"\01??_7D@@6B@" = unnamed_addr constant [2 x i8*]
- virtual void f();
+ virtual void f();
virtual ~D();
};
-void D::f() {}
+D d;
+// EMITS-VFTABLE-DAG: @"\01??_7D@@6B@" = linkonce_odr unnamed_addr constant [2 x i8*]
struct E : A {
- // CHECK-E: Vtable for 'E' (5 entries)
+ // CHECK-E: VFTable for 'A' in 'E' (5 entries)
// CHECK-E-NEXT: 0 | void A::f()
// CHECK-E-NEXT: 1 | void A::g()
// CHECK-E-NEXT: 2 | void A::h()
// CHECK-E-NEXT: 3 | E::~E() [scalar deleting]
// CHECK-E-NEXT: 4 | void E::i()
- // CHECK-E: VTable indices for 'E' (2 entries).
+ // CHECK-E: VFTable indices for 'E' (2 entries).
// CHECK-E-NEXT: 3 | E::~E() [scalar deleting]
// CHECK-E-NEXT: 4 | void E::i()
- // Never used, so doesn't emit a vtable.
+ // ~E would be the key method, but it isn't used, and MS ABI has no key
+ // methods.
virtual ~E();
virtual void i();
};
void E::i() {}
+// NO-VFTABLE-NOT: @"\01??_7E@@6B@"
struct F : A {
- // CHECK-F: Vtable for 'F' (5 entries)
+ // CHECK-F: VFTable for 'A' in 'F' (5 entries)
// CHECK-F-NEXT: 0 | void A::f()
// CHECK-F-NEXT: 1 | void A::g()
// CHECK-F-NEXT: 2 | void A::h()
// CHECK-F-NEXT: 3 | void F::i()
// CHECK-F-NEXT: 4 | F::~F() [scalar deleting]
- // CHECK-F: VTable indices for 'F' (2 entries).
+ // CHECK-F: VFTable indices for 'F' (2 entries).
// CHECK-F-NEXT: 3 | void F::i()
// CHECK-F-NEXT: 4 | F::~F() [scalar deleting]
- // EMITS-VTABLE: @"\01??_7F@@6B@" = unnamed_addr constant [5 x i8*]
+
virtual void i();
virtual ~F();
};
-void F::i() {}
+F f;
+// EMITS-VFTABLE-DAG: @"\01??_7F@@6B@" = linkonce_odr unnamed_addr constant [5 x i8*]
struct G : E {
- // CHECK-G: Vtable for 'G' (6 entries)
+ // CHECK-G: VFTable for 'A' in 'E' in 'G' (6 entries)
// CHECK-G-NEXT: 0 | void G::f()
// CHECK-G-NEXT: 1 | void A::g()
// CHECK-G-NEXT: 2 | void A::h()
// CHECK-G-NEXT: 3 | G::~G() [scalar deleting]
// CHECK-G-NEXT: 4 | void E::i()
// CHECK-G-NEXT: 5 | void G::j()
- // CHECK-G: VTable indices for 'G' (3 entries).
+ // CHECK-G: VFTable indices for 'G' (3 entries).
// CHECK-G-NEXT: 0 | void G::f()
// CHECK-G-NEXT: 3 | G::~G() [scalar deleting]
// CHECK-G-NEXT: 5 | void G::j()
- // Never used, so doesn't emit a vtable.
+
virtual void f(); // overrides A::f()
virtual ~G();
virtual void j();
};
void G::j() {}
+// NO-VFTABLE-NOT: @"\01??_7G@@6B@"
+
+// Test that the usual Itanium-style key method does not emit a vtable.
+struct H {
+ virtual void f();
+};
+void H::f() {}
+// NO-VFTABLE-NOT: @"\01??_7H@@6B@"
+
+struct Empty { };
+
+struct I : Empty {
+ // CHECK-I: VFTable for 'I' (2 entries)
+ // CHECK-I-NEXT: 0 | void I::f()
+ // CHECK-I-NEXT: 1 | void I::g()
+ virtual void f();
+ virtual void g();
+};
+
+I i;
+
+struct J {
+ // CHECK-J: VFTable for 'J' (6 entries)
+ // CHECK-J-NEXT: 0 | void J::foo(long)
+ // CHECK-J-NEXT: 1 | void J::foo(int)
+ // CHECK-J-NEXT: 2 | void J::foo(short)
+ // CHECK-J-NEXT: 3 | void J::bar(long)
+ // CHECK-J-NEXT: 4 | void J::bar(int)
+ // CHECK-J-NEXT: 5 | void J::bar(short)
+ virtual void foo(short);
+ virtual void bar(short);
+ virtual void foo(int);
+ virtual void bar(int);
+ virtual void foo(long);
+ virtual void bar(long);
+};
+
+J j;
+
+struct K : J {
+ // CHECK-K: VFTable for 'J' in 'K' (9 entries)
+ // CHECK-K-NEXT: 0 | void J::foo(long)
+ // CHECK-K-NEXT: 1 | void J::foo(int)
+ // CHECK-K-NEXT: 2 | void J::foo(short)
+ // CHECK-K-NEXT: 3 | void J::bar(long)
+ // CHECK-K-NEXT: 4 | void J::bar(int)
+ // CHECK-K-NEXT: 5 | void J::bar(short)
+ // CHECK-K-NEXT: 6 | void K::bar(double)
+ // CHECK-K-NEXT: 7 | void K::bar(float)
+ // CHECK-K-NEXT: 8 | void K::foo(float)
+ virtual void bar(float);
+ virtual void foo(float);
+ virtual void bar(double);
+};
+
+K k;
+
+struct L : J {
+ // CHECK-L: VFTable for 'J' in 'L' (9 entries)
+ // CHECK-L-NEXT: 0 | void J::foo(long)
+ // CHECK-L-NEXT: 1 | void L::foo(int)
+ // CHECK-L-NEXT: 2 | void J::foo(short)
+ // CHECK-L-NEXT: 3 | void J::bar(long)
+ // CHECK-L-NEXT: 4 | void J::bar(int)
+ // CHECK-L-NEXT: 5 | void J::bar(short)
+ // CHECK-L-NEXT: 6 | void L::foo(float)
+ // CHECK-L-NEXT: 7 | void L::bar(double)
+ // CHECK-L-NEXT: 8 | void L::bar(float)
+
+ // This case is interesting. Since the J::foo(int) override is the first method in
+ // the class, foo(float) precedes the bar(double) and bar(float) in the vftable.
+ virtual void foo(int);
+ virtual void bar(float);
+ virtual void foo(float);
+ virtual void bar(double);
+};
+
+L l;
+
+struct M : J {
+ // CHECK-M: VFTable for 'J' in 'M' (11 entries)
+ // CHECK-M-NEXT: 0 | void J::foo(long)
+ // CHECK-M-NEXT: 1 | void M::foo(int)
+ // CHECK-M-NEXT: 2 | void J::foo(short)
+ // CHECK-M-NEXT: 3 | void J::bar(long)
+ // CHECK-M-NEXT: 4 | void J::bar(int)
+ // CHECK-M-NEXT: 5 | void J::bar(short)
+ // CHECK-M-NEXT: 6 | void M::foo(float)
+ // CHECK-M-NEXT: 7 | void M::spam(long)
+ // CHECK-M-NEXT: 8 | void M::spam(int)
+ // CHECK-M-NEXT: 9 | void M::bar(double)
+ // CHECK-M-NEXT: 10 | void M::bar(float)
+
+ virtual void foo(int);
+ virtual void spam(int);
+ virtual void bar(float);
+ virtual void bar(double);
+ virtual void foo(float);
+ virtual void spam(long);
+};
+
+M m;
+
+struct N {
+ // CHECK-N: VFTable for 'N' (4 entries)
+ // CHECK-N-NEXT: 0 | void N::operator+(int)
+ // CHECK-N-NEXT: 1 | void N::operator+(short)
+ // CHECK-N-NEXT: 2 | void N::operator*(int)
+ // CHECK-N-NEXT: 3 | void N::operator*(short)
+ virtual void operator+(short);
+ virtual void operator*(short);
+ virtual void operator+(int);
+ virtual void operator*(int);
+};
+
+N n;
diff --git a/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp
new file mode 100644
index 000000000000..3fef0e409349
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp
@@ -0,0 +1,324 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -fdump-vtable-layouts %s -o %t.ll -cxx-abi microsoft -triple=i386-pc-win32 >%t
+// RUN: FileCheck --check-prefix=VTABLE-SIMPLE-A %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-SIMPLE-B %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-SIMPLE-C %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-A %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-B %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-C %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-E %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-F %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-G %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-EXTENDED-H %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-PR17738-A %s < %t
+// RUN: FileCheck --check-prefix=MANGLING %s < %t.ll
+
+// For now, just make sure x86_64 doesn't crash.
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -fdump-vtable-layouts %s -cxx-abi microsoft -triple=x86_64-pc-win32 >/dev/null
+
+struct V1 {
+ virtual void f();
+ virtual ~V1();
+};
+
+struct V2 {
+ virtual void f();
+ virtual ~V2();
+ int v;
+};
+
+struct Z {
+ virtual void g();
+ virtual ~Z();
+ int x;
+};
+
+struct V3 : Z, V2 {
+};
+
+struct V4 : Z, V1, V2 {
+ int y;
+};
+
+void use_somewhere_else(void*);
+
+namespace simple {
+// In case of a single-layer virtual inheritance, the "this" adjustment is done
+// staically:
+// struct A {
+// virtual void f(); // Expects "(A*)this" in ECX
+// };
+// struct B : virtual A {
+// virtual void f(); // Expects "(char*)(B*)this + 12" in ECX
+// virtual ~B(); // Might call f()
+// };
+//
+// If a class overrides a virtual function of its base and has a non-trivial
+// ctor/dtor that call(s) the virtual function (or may escape "this" to some
+// code that might call it), a virtual adjustment might be needed in case the
+// current class layout and the most derived class layout are different.
+// This is done using vtordisp thunks.
+//
+// A simple vtordisp{A,B} thunk for Method@Class is something like:
+// sub ecx, [ecx+A] // apply the vtordisp adjustment
+// sub ecx, B // apply the subobject adjustment, if needed.
+// jmp Method@Class
+
+struct A : virtual V1 {
+ // VTABLE-SIMPLE-A: VFTable for 'V1' in 'simple::A' (2 entries).
+ // VTABLE-SIMPLE-A-NEXT: 0 | void simple::A::f()
+ // VTABLE-SIMPLE-A-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+ // VTABLE-SIMPLE-A-NEXT: 1 | simple::A::~A() [scalar deleting]
+ // VTABLE-SIMPLE-A-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ virtual void f();
+ // MANGLING-DAG: @"\01?f@A@simple@@$4PPPPPPPM@A@AEXXZ"
+
+ virtual ~A();
+ // MANGLING-DAG: @"\01??_EA@simple@@$4PPPPPPPM@A@AEPAXI@Z"
+};
+
+A a;
+
+struct B : virtual V3 {
+ // VTABLE-SIMPLE-B: VFTable for 'Z' in 'V3' in 'simple::B' (2 entries).
+ // VTABLE-SIMPLE-B-NEXT: 0 | void Z::g()
+ // VTABLE-SIMPLE-B-NEXT: 1 | simple::B::~B() [scalar deleting]
+ // VTABLE-SIMPLE-B-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // VTABLE-SIMPLE-B: VFTable for 'V2' in 'V3' in 'simple::B' (2 entries).
+ // VTABLE-SIMPLE-B-NEXT: 0 | void simple::B::f()
+ // VTABLE-SIMPLE-B-NEXT: [this adjustment: vtordisp at -12, 0 non-virtual]
+ // VTABLE-SIMPLE-B-NEXT: 1 | simple::B::~B() [scalar deleting]
+ // VTABLE-SIMPLE-B-NEXT: [this adjustment: vtordisp at -12, -8 non-virtual]
+
+ // FIXME: The vtordisp thunk should only get emitted for a constructor
+ // if "this" leaves scope.
+ B() { use_somewhere_else(this); }
+
+ virtual void f();
+ // MANGLING-DAG: @"\01?f@B@simple@@$4PPPPPPPE@A@AEXXZ"
+
+ // Has an implicit destructor.
+ // MANGLING-DAG: @"\01??_EB@simple@@$4PPPPPPPE@7AEPAXI@Z"
+ // MANGLING-DAG: @"\01??_EB@simple@@$4PPPPPPPM@A@AEPAXI@Z"
+};
+
+B b;
+
+struct C : virtual V4 {
+ // VTABLE-SIMPLE-C: VFTable for 'Z' in 'V4' in 'simple::C' (2 entries).
+ // VTABLE-SIMPLE-C-NEXT: 0 | void Z::g()
+ // VTABLE-SIMPLE-C-NEXT: 1 | simple::C::~C() [scalar deleting]
+ // VTABLE-SIMPLE-C-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // VTABLE-SIMPLE-C: VFTable for 'V1' in 'V4' in 'simple::C' (2 entries).
+ // VTABLE-SIMPLE-C-NEXT: 0 | void simple::C::f()
+ // VTABLE-SIMPLE-C-NEXT: [this adjustment: vtordisp at -12, 0 non-virtual]
+ // VTABLE-SIMPLE-C-NEXT: 1 | simple::C::~C() [scalar deleting]
+ // VTABLE-SIMPLE-C-NEXT: [this adjustment: vtordisp at -12, -8 non-virtual]
+
+ // VTABLE-SIMPLE-C: VFTable for 'V2' in 'V4' in 'simple::C' (2 entries).
+ // VTABLE-SIMPLE-C-NEXT: 0 | void simple::C::f()
+ // VTABLE-SIMPLE-C-NEXT: [this adjustment: vtordisp at -16, -4 non-virtual]
+ // VTABLE-SIMPLE-C-NEXT: 1 | simple::C::~C() [scalar deleting]
+ // VTABLE-SIMPLE-C-NEXT: [this adjustment: vtordisp at -16, -12 non-virtual]
+
+ int x;
+ virtual void f();
+ // MANGLING-DAG: @"\01?f@C@simple@@$4PPPPPPPA@3AEXXZ"
+ // MANGLING-DAG: @"\01?f@C@simple@@$4PPPPPPPE@A@AEXXZ"
+ virtual ~C();
+ // MANGLING-DAG: @"\01??_EC@simple@@$4PPPPPPPA@M@AEPAXI@Z"
+ // MANGLING-DAG: @"\01??_EC@simple@@$4PPPPPPPE@7AEPAXI@Z"
+ // MANGLING-DAG: @"\01??_EC@simple@@$4PPPPPPPM@A@AEPAXI@Z"
+};
+
+C c;
+}
+
+namespace extended {
+// If a virtual function requires vtordisp adjustment and the final overrider
+// is defined in another vitual base of the most derived class,
+// we need to know two vbase offsets.
+// In this case, we should use the extended form of vtordisp thunks, called
+// vtordispex thunks.
+//
+// vtordispex{A,B,C,D} thunk for Method@Class is something like:
+// sub ecx, [ecx+C] // apply the vtordisp adjustment
+// sub ecx, A // jump to the vbtable of the most derived class
+// mov eax, [ecx] // load the vbtable address
+// add ecx, [eax+B] // lookup the final overrider's vbase offset
+// add ecx, D // apphy the subobject offset if needed
+// jmp Method@Class
+
+struct A : virtual simple::A {
+ // VTABLE-EXTENDED-A: VFTable for 'V1' in 'simple::A' in 'extended::A' (2 entries).
+ // VTABLE-EXTENDED-A-NEXT: 0 | void simple::A::f()
+ // VTABLE-EXTENDED-A-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // VTABLE-EXTENDED-A-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+ // VTABLE-EXTENDED-A-NEXT: 1 | extended::A::~A() [scalar deleting]
+ // VTABLE-EXTENDED-A-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // `vtordispex{8,8,4294967292,8}'
+ // MANGLING-DAG: @"\01?f@A@simple@@$R477PPPPPPPM@7AEXXZ"
+
+ virtual ~A();
+ // vtordisp{4294967292,0}
+ // MANGLING-DAG: @"\01??_EA@extended@@$4PPPPPPPM@A@AEPAXI@Z"
+};
+
+A a;
+
+struct B : virtual simple::A {
+ // This class has an implicit dtor. Vdtors don't require vtordispex thunks
+ // as the most derived class always has an implicit dtor,
+ // which is a final overrider.
+
+ // VTABLE-EXTENDED-B: VFTable for 'V1' in 'simple::A' in 'extended::B' (2 entries).
+ // ...
+ // VTABLE-EXTENDED-B: 1 | extended::B::~B() [scalar deleting]
+ // VTABLE-EXTENDED-B-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // vtordisp{4294967292,0}
+ // MANGLING-DAG: @"\01??_EB@extended@@$4PPPPPPPM@A@AEPAXI@Z"
+};
+
+B b;
+
+struct C : virtual simple::A {
+ // VTABLE-EXTENDED-C: VFTable for 'V1' in 'simple::A' in 'extended::C' (2 entries).
+ // VTABLE-EXTENDED-C-NEXT: 0 | void simple::A::f()
+ // VTABLE-EXTENDED-C-NEXT: [this adjustment: vtordisp at -4, vbptr at 12 to the left,
+ // VTABLE-EXTENDED-C-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+
+ // `vtordispex{12,8,4294967292,8}'
+ // MANGLING-DAG: @"\01?f@A@simple@@$R4M@7PPPPPPPM@7AEXXZ"
+ int x;
+ virtual ~C();
+ // MANGLING-DAG: @"\01??_EC@extended@@$4PPPPPPPM@A@AEPAXI@Z"
+};
+
+C c;
+
+struct D : virtual V2 {
+ virtual void f();
+ virtual ~D();
+ int x;
+};
+
+struct E : virtual D {
+ // VTABLE-EXTENDED-E: VFTable for 'V2' in 'extended::D' in 'extended::E' (2 entries).
+ // VTABLE-EXTENDED-E-NEXT: 0 | void extended::D::f()
+ // VTABLE-EXTENDED-E-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // VTABLE-EXTENDED-E-NEXT: vboffset at 8 in the vbtable, 12 non-virtual]
+
+ // `vtordispex{8,8,4294967292,12}'
+ // MANGLING-DAG: @"\01?f@D@extended@@$R477PPPPPPPM@M@AEXXZ"
+
+ virtual ~E();
+ // MANGLING-DAG: @"\01??_EE@extended@@$4PPPPPPPM@A@AEPAXI@Z"
+};
+
+E e;
+
+struct F : virtual Z, virtual D {
+ // VTABLE-EXTENDED-F: VFTable for 'V2' in 'extended::D' in 'extended::F' (2 entries).
+ // VTABLE-EXTENDED-F-NEXT: 0 | void extended::D::f()
+ // VTABLE-EXTENDED-F-NEXT: [this adjustment: vtordisp at -4, vbptr at 20 to the left,
+ // VTABLE-EXTENDED-F-NEXT: vboffset at 12 in the vbtable, 12 non-virtual]
+
+ // `vtordispex{20,12,4294967292,12}'
+ // MANGLING-DAG: @"\01?f@D@extended@@$R4BE@M@PPPPPPPM@M@AEXXZ"
+ int x;
+ virtual ~F();
+ // MANGLING-DAG: @"\01??_EF@extended@@$4PPPPPPPM@M@AEPAXI@Z"
+};
+
+F f;
+
+struct G : virtual simple::A {
+ // VTABLE-EXTENDED-G: VFTable for 'extended::G' (1 entries).
+ // VTABLE-EXTENDED-G-NEXT: 0 | void extended::G::g()
+
+ // VTABLE-EXTENDED-G: VFTable for 'V1' in 'simple::A' in 'extended::G' (2 entries).
+ // VTABLE-EXTENDED-G-NEXT: 0 | void simple::A::f()
+ // VTABLE-EXTENDED-G-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // VTABLE-EXTENDED-G-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+ // VTABLE-EXTENDED-G-NEXT: 1 | extended::G::~G() [scalar deleting]
+ // VTABLE-EXTENDED-G-NEXT: [this adjustment: vtordisp at -4, 0 non-virtual]
+
+ // Emits a G's own vfptr, thus moving the vbptr in the layout.
+ virtual void g();
+
+ virtual ~G();
+ // vtordisp{4294967292,0}
+ // MANGLING-DAG: @"\01??_EG@extended@@$4PPPPPPPM@A@AEPAXI@Z"
+};
+
+G g;
+
+struct H : Z, A {
+ // VTABLE-EXTENDED-H: VFTable for 'Z' in 'extended::H' (2 entries).
+ // VTABLE-EXTENDED-H-NEXT: 0 | void Z::g()
+ // VTABLE-EXTENDED-H-NEXT: 1 | extended::H::~H() [scalar deleting]
+
+ // VTABLE-EXTENDED-H: VFTable for 'V1' in 'simple::A' in 'extended::A' in 'extended::H' (2 entries).
+ // VTABLE-EXTENDED-H-NEXT: 0 | void simple::A::f()
+ // VTABLE-EXTENDED-H-NEXT: [this adjustment: vtordisp at -4, vbptr at 8 to the left,
+ // VTABLE-EXTENDED-H-NEXT: vboffset at 8 in the vbtable, 8 non-virtual]
+
+ // MANGLING-DAG: @"\01?f@A@simple@@$R477PPPPPPPM@7AEXXZ"
+ // MANGLING-DAG: @"\01??_EH@extended@@$4PPPPPPPM@BA@AEPAXI@Z"
+};
+
+H h;
+}
+
+namespace pr17738 {
+// These classes should have vtordispex thunks but MSVS CL miscompiles them.
+// Just do the right thing.
+
+struct A : virtual simple::B {
+ // VTABLE-PR17738-A: VFTable for 'V2' in 'V3' in 'simple::B' in 'pr17738::A' (2 entries).
+ // VTABLE-PR17738-A-NEXT: 0 | void simple::B::f()
+ // VTABLE-PR17738-A-NEXT: [this adjustment: vtordisp at -12, vbptr at 20 to the left,
+ // VTABLE-PR17738-A-NEXT: vboffset at 8 in the vbtable, 16 non-virtual]
+
+ // MANGLING-DAG: @"\01?f@B@simple@@$R4BE@7PPPPPPPE@BA@AEXXZ"
+ int a;
+ virtual ~A();
+};
+
+A a;
+}
+
+namespace access {
+struct A {
+ virtual ~A();
+protected:
+ virtual void prot();
+private:
+ virtual void priv();
+};
+
+struct B : virtual A {
+ virtual ~B();
+protected:
+ virtual void prot();
+ // MANGLING-DAG: @"\01?prot@B@access@@$2PPPPPPPM@A@AEXXZ"
+private:
+ virtual void priv();
+ // MANGLING-DAG: @"\01?priv@B@access@@$0PPPPPPPM@A@AEXXZ"
+};
+
+B b;
+
+struct C : virtual B {
+ virtual ~C();
+
+ // MANGLING-DAG: @"\01?prot@B@access@@$R277PPPPPPPM@7AEXXZ"
+ // MANGLING-DAG: @"\01?priv@B@access@@$R077PPPPPPPM@7AEXXZ"
+};
+
+C c;
+}
diff --git a/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
new file mode 100644
index 000000000000..b58a0b14cdcd
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
@@ -0,0 +1,575 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -o %t.ll -fdump-vtable-layouts %s -cxx-abi microsoft -triple=i386-pc-win32 >%t
+
+// RUN: FileCheck --check-prefix=VTABLE-C %s < %t
+// RUN: FileCheck --check-prefix=VTABLE-D %s < %t
+// RUN: FileCheck --check-prefix=TEST1 %s < %t
+// RUN: FileCheck --check-prefix=TEST2 %s < %t
+// RUN: FileCheck --check-prefix=TEST3 %s < %t
+// RUN: FileCheck --check-prefix=TEST4 %s < %t
+// RUN: FileCheck --check-prefix=TEST5 %s < %t
+// RUN: FileCheck --check-prefix=TEST6 %s < %t
+// RUN: FileCheck --check-prefix=TEST7 %s < %t
+// RUN: FileCheck --check-prefix=TEST8-X %s < %t
+// RUN: FileCheck --check-prefix=TEST8-Z %s < %t
+// RUN: FileCheck --check-prefix=TEST9-Y %s < %t
+// RUN: FileCheck --check-prefix=TEST9-Z %s < %t
+// RUN: FileCheck --check-prefix=TEST9-W %s < %t
+// RUN: FileCheck --check-prefix=TEST9-T %s < %t
+// RUN: FileCheck --check-prefix=TEST10 %s < %t
+// RUN: FileCheck --check-prefix=VDTORS-Y %s < %t
+// RUN: FileCheck --check-prefix=VDTORS-U %s < %t
+// RUN: FileCheck --check-prefix=VDTORS-V %s < %t
+// RUN: FileCheck --check-prefix=VDTORS-P %s < %t
+// RUN: FileCheck --check-prefix=RET-W %s < %t
+// RUN: FileCheck --check-prefix=RET-T %s < %t
+// RUN: FileCheck --check-prefix=RET-V %s < %t
+
+// RUN: FileCheck --check-prefix=MANGLING %s < %t.ll
+
+struct Empty { };
+
+struct A {
+ virtual void f();
+ virtual void z(); // Useful to check there are no thunks for f() when appropriate.
+};
+
+struct B {
+ virtual void g();
+};
+
+struct C: virtual A {
+ // VTABLE-C: VFTable for 'A' in 'C' (2 entries)
+ // VTABLE-C-NEXT: 0 | void C::f()
+ // VTABLE-C-NEXT: 1 | void A::z()
+
+ // VTABLE-C: VFTable indices for 'C' (1 entries)
+ // VTABLE-C-NEXT: vbtable index 1, vfptr at offset 0
+ // VTABLE-C-NEXT: 0 | void C::f()
+
+ // MANGLING-DAG: @"\01??_7C@@6B@"
+
+ virtual void f();
+};
+
+C c;
+
+struct D: virtual A {
+ // VTABLE-D: VFTable for 'D' (1 entries).
+ // VTABLE-D-NEXT: 0 | void D::h()
+
+ // VTABLE-D: VFTable for 'A' in 'D' (2 entries).
+ // VTABLE-D-NEXT: 0 | void D::f()
+ // VTABLE-D-NEXT: 1 | void A::z()
+
+ // VTABLE-D: VFTable indices for 'D' (2 entries).
+ // VTABLE-D-NEXT: via vfptr at offset 0
+ // VTABLE-D-NEXT: 0 | void D::h()
+ // VTABLE-D-NEXT: via vbtable index 1, vfptr at offset 0
+ // VTABLE-D-NEXT: 0 | void D::f()
+
+ // MANGLING-DAG: @"\01??_7D@@6B0@@"
+ // MANGLING-DAG: @"\01??_7D@@6BA@@@"
+
+ virtual void f();
+ virtual void h();
+};
+
+void D::h() {}
+D d;
+
+namespace Test1 {
+
+struct X { int x; };
+
+// X and A get reordered in the layout since X doesn't have a vfptr while A has.
+struct Y : X, A { };
+// MANGLING-DAG: @"\01??_7Y@Test1@@6B@"
+
+struct Z : virtual Y {
+ // TEST1: VFTable for 'A' in 'Test1::Y' in 'Test1::Z' (2 entries).
+ // TEST1-NEXT: 0 | void A::f()
+ // TEST1-NEXT: 1 | void A::z()
+
+ // TEST1-NOT: VFTable indices for 'Test1::Z'
+
+ // MANGLING-DAG: @"\01??_7Z@Test1@@6B@"
+};
+
+Z z;
+}
+
+namespace Test2 {
+
+struct X: virtual A, virtual B {
+ // TEST2: VFTable for 'Test2::X' (1 entries).
+ // TEST2-NEXT: 0 | void Test2::X::h()
+
+ // TEST2: VFTable for 'A' in 'Test2::X' (2 entries).
+ // TEST2-NEXT: 0 | void A::f()
+ // TEST2-NEXT: 1 | void A::z()
+
+ // TEST2: VFTable for 'B' in 'Test2::X' (1 entries).
+ // TEST2-NEXT: 0 | void B::g()
+
+ // TEST2: VFTable indices for 'Test2::X' (1 entries).
+ // TEST2-NEXT: 0 | void Test2::X::h()
+
+ // MANGLING-DAG: @"\01??_7X@Test2@@6B01@@"
+ // MANGLING-DAG: @"\01??_7X@Test2@@6BA@@@"
+ // MANGLING-DAG: @"\01??_7X@Test2@@6BB@@@"
+
+ virtual void h();
+};
+
+X x;
+}
+
+namespace Test3 {
+
+struct X : virtual A {
+ // MANGLING-DAG: @"\01??_7X@Test3@@6B@"
+};
+
+struct Y: virtual X {
+ // TEST3: VFTable for 'A' in 'Test3::X' in 'Test3::Y' (2 entries).
+ // TEST3-NEXT: 0 | void A::f()
+ // TEST3-NEXT: 1 | void A::z()
+
+ // TEST3-NOT: VFTable indices for 'Test3::Y'
+
+ // MANGLING-DAG: @"\01??_7Y@Test3@@6B@"
+};
+
+Y y;
+}
+
+namespace Test4 {
+
+struct X: virtual C {
+ // This one's interesting. C::f expects (A*) to be passed as 'this' and does
+ // ECX-=4 to cast to (C*). In X, C and A vbases are reordered, so the thunk
+ // should pass a pointer to the end of X in order
+ // for ECX-=4 to point at the C part.
+
+ // TEST4: VFTable for 'A' in 'C' in 'Test4::X' (2 entries).
+ // TEST4-NEXT: 0 | void C::f()
+ // TEST4-NEXT: [this adjustment: 8 non-virtual]
+ // TEST4-NEXT: 1 | void A::z()
+
+ // TEST4-NOT: VFTable indices for 'Test4::X'
+
+ // MANGLING-DAG: @"\01??_7X@Test4@@6B@"
+
+ // Also check the mangling of the thunk.
+ // MANGLING-DAG: define weak x86_thiscallcc void @"\01?f@C@@WPPPPPPPI@AEXXZ"
+};
+
+X x;
+}
+
+namespace Test5 {
+
+// New methods are added to the base's vftable.
+struct X : A {
+ // MANGLING-DAG: @"\01??_7X@Test5@@6B@"
+ virtual void g();
+};
+
+struct Y : virtual X {
+ // TEST5: VFTable for 'Test5::Y' (1 entries).
+ // TEST5-NEXT: 0 | void Test5::Y::h()
+
+ // TEST5: VFTable for 'A' in 'Test5::X' in 'Test5::Y' (3 entries).
+ // TEST5-NEXT: 0 | void A::f()
+ // TEST5-NEXT: 1 | void A::z()
+ // TEST5-NEXT: 2 | void Test5::X::g()
+
+ // TEST5: VFTable indices for 'Test5::Y' (1 entries).
+ // TEST5-NEXT: 0 | void Test5::Y::h()
+
+ // MANGLING-DAG: @"\01??_7Y@Test5@@6B01@@"
+ // MANGLING-DAG: @"\01??_7Y@Test5@@6BX@1@@"
+
+ virtual void h();
+};
+
+Y y;
+}
+
+namespace Test6 {
+
+struct X : A, virtual Empty {
+ // TEST6: VFTable for 'A' in 'Test6::X' (2 entries).
+ // TEST6-NEXT: 0 | void A::f()
+ // TEST6-NEXT: 1 | void A::z()
+
+ // TEST6-NOT: VFTable indices for 'Test6::X'
+
+ // MANGLING-DAG: @"\01??_7X@Test6@@6B@"
+};
+
+X x;
+}
+
+namespace Test7 {
+
+struct X : C {
+ // MANGLING-DAG: @"\01??_7X@Test7@@6B@"
+};
+
+struct Y : virtual X {
+ // TEST7: VFTable for 'A' in 'C' in 'Test7::X' in 'Test7::Y' (2 entries).
+ // TEST7-NEXT: 0 | void C::f()
+ // TEST7-NEXT: [this adjustment: 8 non-virtual]
+ // TEST7-NEXT: 1 | void A::z()
+
+ // TEST7: Thunks for 'void C::f()' (1 entry).
+ // TEST7-NEXT: 0 | [this adjustment: 8 non-virtual]
+
+ // TEST7-NOT: VFTable indices for 'Test7::Y'
+
+ // MANGLING-DAG: @"\01??_7Y@Test7@@6B@"
+};
+
+Y y;
+}
+
+namespace Test8 {
+
+// This is a typical diamond inheritance with a shared 'A' vbase.
+struct X : D, C {
+ // TEST8-X: VFTable for 'D' in 'Test8::X' (1 entries).
+ // TEST8-X-NEXT: 0 | void D::h()
+
+ // TEST8-X: VFTable for 'A' in 'D' in 'Test8::X' (2 entries).
+ // TEST8-X-NEXT: 0 | void Test8::X::f()
+ // TEST8-X-NEXT: 1 | void A::z()
+
+ // TEST8-X: VFTable indices for 'Test8::X' (1 entries).
+ // TEST8-X-NEXT: via vbtable index 1, vfptr at offset 0
+ // TEST8-X-NEXT: 0 | void Test8::X::f()
+
+ // MANGLING-DAG: @"\01??_7X@Test8@@6BA@@@"
+ // MANGLING-DAG: @"\01??_7X@Test8@@6BD@@@"
+
+ virtual void f();
+};
+
+X x;
+
+// Another diamond inheritance which led to AST crashes.
+struct Y : virtual A {};
+
+class Z : Y, C {
+ // TEST8-Z: VFTable for 'A' in 'Test8::Y' in 'Test8::Z' (2 entries).
+ // TEST8-Z-NEXT: 0 | void Test8::Z::f()
+ // TEST8-Z-NEXT: 1 | void A::z()
+
+ // TEST8-Z: VFTable indices for 'Test8::Z' (1 entries).
+ // TEST8-Z-NEXT: via vbtable index 1, vfptr at offset 0
+ // TEST8-Z-NEXT: 0 | void Test8::Z::f()
+ virtual void f();
+};
+Z z;
+}
+
+namespace Test9 {
+
+struct X : A { };
+
+struct Y : virtual X {
+ // TEST9-Y: VFTable for 'Test9::Y' (1 entries).
+ // TEST9-Y-NEXT: 0 | void Test9::Y::h()
+
+ // TEST9-Y: VFTable for 'A' in 'Test9::X' in 'Test9::Y' (2 entries).
+ // TEST9-Y-NEXT: 0 | void A::f()
+ // TEST9-Y-NEXT: 1 | void A::z()
+
+ // TEST9-Y: VFTable indices for 'Test9::Y' (1 entries).
+ // TEST9-Y-NEXT: 0 | void Test9::Y::h()
+
+ // MANGLING-DAG: @"\01??_7Y@Test9@@6B01@@"
+ // MANGLING-DAG: @"\01??_7Y@Test9@@6BX@1@@"
+
+ virtual void h();
+};
+
+Y y;
+
+struct Z : Y, virtual B {
+ // TEST9-Z: VFTable for 'Test9::Y' in 'Test9::Z' (1 entries).
+ // TEST9-Z-NEXT: 0 | void Test9::Y::h()
+
+ // TEST9-Z: VFTable for 'A' in 'Test9::X' in 'Test9::Y' in 'Test9::Z' (2 entries).
+ // TEST9-Z-NEXT: 0 | void A::f()
+ // TEST9-Z-NEXT: 1 | void A::z()
+
+ // TEST9-Z: VFTable for 'B' in 'Test9::Z' (1 entries).
+ // TEST9-Z-NEXT: 0 | void B::g()
+
+ // TEST9-Z-NOT: VFTable indices for 'Test9::Z'
+
+ // MANGLING-DAG: @"\01??_7Z@Test9@@6BX@1@@"
+ // MANGLING-DAG: @"\01??_7Z@Test9@@6BY@1@@"
+
+ // FIXME this one is wrong:
+ // INCORRECT MANGLING-DAG: @"\01??_7Z@Test9@@6BB@@@"
+ // MANGLING-DAG-SHOULD-BE: @"\01??_7Z@Test9@@6B@"
+};
+
+Z z;
+
+struct W : Z, D, virtual A, virtual B {
+ // TEST9-W: VFTable for 'Test9::Y' in 'Test9::Z' in 'Test9::W' (1 entries).
+ // TEST9-W-NEXT: 0 | void Test9::Y::h()
+
+ // TEST9-W: VFTable for 'A' in 'Test9::X' in 'Test9::Y' in 'Test9::Z' in 'Test9::W' (2 entries).
+ // TEST9-W-NEXT: 0 | void A::f()
+ // TEST9-W-NEXT: 1 | void A::z()
+
+ // TEST9-W: VFTable for 'B' in 'Test9::Z' in 'Test9::W' (1 entries).
+ // TEST9-W-NEXT: 0 | void B::g()
+
+ // TEST9-W: VFTable for 'D' in 'Test9::W' (1 entries).
+ // TEST9-W-NEXT: 0 | void D::h()
+
+ // TEST9-W: VFTable for 'A' in 'D' in 'Test9::W' (2 entries).
+ // TEST9-W-NEXT: 0 | void D::f()
+ // TEST9-W-NEXT: [this adjustment: -8 non-virtual]
+ // TEST9-W-NEXT: 1 | void A::z()
+
+ // TEST9-W: Thunks for 'void D::f()' (1 entry).
+ // TEST9-W-NEXT: 0 | [this adjustment: -8 non-virtual]
+
+ // TEST9-W-NOT: VFTable indices for 'Test9::W'
+
+ // MANGLING-DAG: @"\01??_7W@Test9@@6BA@@@"
+ // MANGLING-DAG: @"\01??_7W@Test9@@6BD@@@"
+ // MANGLING-DAG: @"\01??_7W@Test9@@6BX@1@@"
+
+ // FIXME: these two are wrong:
+ // INCORRECT MANGLING-DAG: @"\01??_7W@Test9@@6BB@@@"
+ // MANGLING-DAG-SHOULD-BE: @"\01??_7W@Test9@@6B@"
+ // INCORRECT MANGLING-DAG: @"\01??_7W@Test9@@6BY@1@Z@1@@"
+ // MANGLING-DAG-SHOULD-BE: @"\01??_7W@Test9@@6BY@1@@"
+};
+
+W w;
+
+struct T : Z, D, virtual A, virtual B {
+ // TEST9-T: VFTable for 'Test9::Y' in 'Test9::Z' in 'Test9::T' (1 entries).
+ // TEST9-T-NEXT: 0 | void Test9::T::h()
+
+ // TEST9-T: VFTable for 'A' in 'Test9::X' in 'Test9::Y' in 'Test9::Z' in 'Test9::T' (2 entries).
+ // TEST9-T-NEXT: 0 | void Test9::T::f()
+ // TEST9-T-NEXT: 1 | void Test9::T::z()
+
+ // TEST9-T: VFTable for 'B' in 'Test9::Z' in 'Test9::T' (1 entries).
+ // TEST9-T-NEXT: 0 | void Test9::T::g()
+
+ // TEST9-T: VFTable for 'D' in 'Test9::T' (1 entries).
+ // TEST9-T-NEXT: 0 | void Test9::T::h()
+ // TEST9-T-NEXT: [this adjustment: -8 non-virtual]
+
+ // TEST9-T: Thunks for 'void Test9::T::h()' (1 entry).
+ // TEST9-T-NEXT: 0 | [this adjustment: -8 non-virtual]
+
+ // TEST9-T: VFTable for 'A' in 'D' in 'Test9::T' (2 entries).
+ // TEST9-T-NEXT: 0 | void Test9::T::f()
+ // TEST9-T-NEXT: [this adjustment: -8 non-virtual]
+ // TEST9-T-NEXT: 1 | void Test9::T::z()
+ // TEST9-T-NEXT: [this adjustment: -8 non-virtual]
+
+ // TEST9-T: Thunks for 'void Test9::T::f()' (1 entry).
+ // TEST9-T-NEXT: 0 | [this adjustment: -8 non-virtual]
+
+ // TEST9-T: Thunks for 'void Test9::T::z()' (1 entry).
+ // TEST9-T-NEXT: 0 | [this adjustment: -8 non-virtual]
+
+ // TEST9-T: VFTable indices for 'Test9::T' (4 entries).
+ // TEST9-T-NEXT: via vfptr at offset 0
+ // TEST9-T-NEXT: 0 | void Test9::T::h()
+ // TEST9-T-NEXT: via vbtable index 1, vfptr at offset 0
+ // TEST9-T-NEXT: 0 | void Test9::T::f()
+ // TEST9-T-NEXT: 1 | void Test9::T::z()
+ // TEST9-T-NEXT: via vbtable index 2, vfptr at offset 0
+ // TEST9-T-NEXT: 0 | void Test9::T::g()
+
+ // MANGLING-DAG: @"\01??_7T@Test9@@6BA@@@"
+ // MANGLING-DAG: @"\01??_7T@Test9@@6BD@@@"
+ // MANGLING-DAG: @"\01??_7T@Test9@@6BX@1@@"
+
+ // FIXME: these two are wrong:
+ // INCORRECT MANGLING-DAG: @"\01??_7T@Test9@@6BB@@@"
+ // MANGLING-DAG-SHOULD-BE: @"\01??_7T@Test9@@6B@"
+ // INCORRECT MANGLING-DAG: @"\01??_7T@Test9@@6BY@1@Z@1@@"
+ // MANGLING-DAG-SHOULD-BE: @"\01??_7T@Test9@@6BY@1@@"
+
+ virtual void f();
+ virtual void g();
+ virtual void h();
+ virtual void z();
+};
+
+T t;
+}
+
+namespace Test10 {
+struct X : virtual C, virtual A {
+ // TEST10: VFTable for 'A' in 'C' in 'Test10::X' (2 entries).
+ // TEST10-NEXT: 0 | void Test10::X::f()
+ // TEST10-NEXT: 1 | void A::z()
+
+ // TEST10: VFTable indices for 'Test10::X' (1 entries).
+ // TEST10-NEXT: via vbtable index 1, vfptr at offset 0
+ // TEST10-NEXT: 0 | void Test10::X::f()
+ virtual void f();
+};
+
+void X::f() {}
+X x;
+}
+
+namespace vdtors {
+struct X {
+ virtual ~X();
+ virtual void zzz();
+};
+
+struct Y : virtual X {
+ // VDTORS-Y: VFTable for 'vdtors::X' in 'vdtors::Y' (2 entries).
+ // VDTORS-Y-NEXT: 0 | vdtors::Y::~Y() [scalar deleting]
+ // VDTORS-Y-NEXT: 1 | void vdtors::X::zzz()
+
+ // VDTORS-Y-NOT: Thunks for 'vdtors::Y::~Y()'
+ virtual ~Y();
+};
+
+Y y;
+
+struct Z {
+ virtual void z();
+};
+
+struct W : Z, X {
+ // Implicit virtual dtor.
+};
+
+struct U : virtual W {
+ // VDTORS-U: VFTable for 'vdtors::Z' in 'vdtors::W' in 'vdtors::U' (1 entries).
+ // VDTORS-U-NEXT: 0 | void vdtors::Z::z()
+
+ // VDTORS-U: VFTable for 'vdtors::X' in 'vdtors::W' in 'vdtors::U' (2 entries).
+ // VDTORS-U-NEXT: 0 | vdtors::U::~U() [scalar deleting]
+ // VDTORS-U-NEXT: [this adjustment: -4 non-virtual]
+ // VDTORS-U-NEXT: 1 | void vdtors::X::zzz()
+
+ // VDTORS-U: Thunks for 'vdtors::W::~W()' (1 entry).
+ // VDTORS-U-NEXT: 0 | [this adjustment: -4 non-virtual]
+
+ // VDTORS-U: VFTable indices for 'vdtors::U' (1 entries).
+ // VDTORS-U-NEXT: -- accessible via vbtable index 1, vfptr at offset 4 --
+ // VDTORS-U-NEXT: 0 | vdtors::U::~U() [scalar deleting]
+ virtual ~U();
+};
+
+U u;
+
+struct V : virtual W {
+ // VDTORS-V: VFTable for 'vdtors::Z' in 'vdtors::W' in 'vdtors::V' (1 entries).
+ // VDTORS-V-NEXT: 0 | void vdtors::Z::z()
+
+ // VDTORS-V: VFTable for 'vdtors::X' in 'vdtors::W' in 'vdtors::V' (2 entries).
+ // VDTORS-V-NEXT: 0 | vdtors::V::~V() [scalar deleting]
+ // VDTORS-V-NEXT: [this adjustment: -4 non-virtual]
+ // VDTORS-V-NEXT: 1 | void vdtors::X::zzz()
+
+ // VDTORS-V: Thunks for 'vdtors::W::~W()' (1 entry).
+ // VDTORS-V-NEXT: 0 | [this adjustment: -4 non-virtual]
+
+ // VDTORS-V: VFTable indices for 'vdtors::V' (1 entries).
+ // VDTORS-V-NEXT: -- accessible via vbtable index 1, vfptr at offset 4 --
+ // VDTORS-V-NEXT: 0 | vdtors::V::~V() [scalar deleting]
+};
+
+V v;
+
+struct T : virtual X {
+ virtual ~T();
+};
+
+struct P : T, Y {
+ // VDTORS-P: VFTable for 'vdtors::X' in 'vdtors::T' in 'vdtors::P' (2 entries).
+ // VDTORS-P-NEXT: 0 | vdtors::P::~P() [scalar deleting]
+ // VDTORS-P-NEXT: 1 | void vdtors::X::zzz()
+
+ // VDTORS-P-NOT: Thunks for 'vdtors::P::~P()'
+ virtual ~P();
+};
+
+P p;
+
+}
+
+namespace return_adjustment {
+
+struct X : virtual A {
+ virtual void f();
+};
+
+struct Y : virtual A, virtual X {
+ virtual void f();
+};
+
+struct Z {
+ virtual A* foo();
+};
+
+struct W : Z {
+ // RET-W: VFTable for 'return_adjustment::Z' in 'return_adjustment::W' (2 entries).
+ // RET-W-NEXT: 0 | return_adjustment::X *return_adjustment::W::foo()
+ // RET-W-NEXT: [return adjustment: vbase #1, 0 non-virtual]
+ // RET-W-NEXT: 1 | return_adjustment::X *return_adjustment::W::foo()
+
+ // RET-W: VFTable indices for 'return_adjustment::W' (1 entries).
+ // RET-W-NEXT: 1 | return_adjustment::X *return_adjustment::W::foo()
+
+ virtual X* foo();
+};
+
+W y;
+
+struct T : W {
+ // RET-T: VFTable for 'return_adjustment::Z' in 'return_adjustment::W' in 'return_adjustment::T' (3 entries).
+ // RET-T-NEXT: 0 | return_adjustment::Y *return_adjustment::T::foo()
+ // RET-T-NEXT: [return adjustment: vbase #1, 0 non-virtual]
+ // RET-T-NEXT: 1 | return_adjustment::Y *return_adjustment::T::foo()
+ // RET-T-NEXT: [return adjustment: vbase #2, 0 non-virtual]
+ // RET-T-NEXT: 2 | return_adjustment::Y *return_adjustment::T::foo()
+
+ // RET-T: VFTable indices for 'return_adjustment::T' (1 entries).
+ // RET-T-NEXT: 2 | return_adjustment::Y *return_adjustment::T::foo()
+
+ virtual Y* foo();
+};
+
+T t;
+
+struct U : virtual A {
+ virtual void g(); // adds a vfptr
+};
+
+struct V : Z {
+ // RET-V: VFTable for 'return_adjustment::Z' in 'return_adjustment::V' (2 entries).
+ // RET-V-NEXT: 0 | return_adjustment::U *return_adjustment::V::foo()
+ // RET-V-NEXT: [return adjustment: vbptr at offset 4, vbase #1, 0 non-virtual]
+ // RET-V-NEXT: 1 | return_adjustment::U *return_adjustment::V::foo()
+
+ // RET-V: VFTable indices for 'return_adjustment::V' (1 entries).
+ // RET-V-NEXT: 1 | return_adjustment::U *return_adjustment::V::foo()
+
+ virtual U* foo();
+};
+
+V v;
+}
diff --git a/test/CodeGenCXX/microsoft-interface.cpp b/test/CodeGenCXX/microsoft-interface.cpp
index 0b44bab73854..419075a86303 100644
--- a/test/CodeGenCXX/microsoft-interface.cpp
+++ b/test/CodeGenCXX/microsoft-interface.cpp
@@ -19,25 +19,25 @@ int fn() {
// CHECK: @_ZTV1S = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1S to i8*), i8* bitcast (i32 (%struct.S*)* @_ZN1S4testEv to i8*)]
-// CHECK: define i32 @_Z2fnv()
+// CHECK-LABEL: define i32 @_Z2fnv()
// CHECK: call void @_ZN1SC1Ev(%struct.S* %s)
// CHECK: %{{[.0-9A-Z_a-z]+}} = call i32 @_ZN1S4testEv(%struct.S* %s)
-// CHECK: define linkonce_odr void @_ZN1SC1Ev(%struct.S* %this)
+// CHECK-LABEL: define linkonce_odr void @_ZN1SC1Ev(%struct.S* %this)
// CHECK: call void @_ZN1SC2Ev(%struct.S* %{{[.0-9A-Z_a-z]+}})
-// CHECK: define linkonce_odr i32 @_ZN1S4testEv(%struct.S* %this)
+// CHECK-LABEL: define linkonce_odr i32 @_ZN1S4testEv(%struct.S* %this)
// CHECK: %{{[.0-9A-Z_a-z]+}} = call i32 @_ZN1I4testEv(%__interface.I* %{{[.0-9A-Z_a-z]+}})
-// CHECK: define linkonce_odr i32 @_ZN1I4testEv(%__interface.I* %this)
+// CHECK-LABEL: define linkonce_odr i32 @_ZN1I4testEv(%__interface.I* %this)
// CHECK: ret i32 1
-// CHECK: define linkonce_odr void @_ZN1SC2Ev(%struct.S* %this)
+// CHECK-LABEL: define linkonce_odr void @_ZN1SC2Ev(%struct.S* %this)
// CHECK: call void @_ZN1IC2Ev(%__interface.I* %{{[.0-9A-Z_a-z]+}})
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1S, i64 0, i64 2), i8*** %{{[.0-9A-Z_a-z]+}}
-// CHECK: define linkonce_odr void @_ZN1IC2Ev(%__interface.I* %this)
+// CHECK-LABEL: define linkonce_odr void @_ZN1IC2Ev(%__interface.I* %this)
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1I, i64 0, i64 2), i8*** %{{[.0-9A-Z_a-z]+}}
-// CHECK-NOT: define linkonce_odr %__interface.I* @_ZN1IaSERKS_(%__interface.I* %this, %__interface.I*)
-// CHECK-NOT: define linkonce_odr %__interface.I* @_ZN1IaSEOS_(%__interface.I* %this, %__interface.I*)
+// CHECK-NOT-LABEL: define linkonce_odr %__interface.I* @_ZN1IaSERKS_(%__interface.I* %this, %__interface.I*)
+// CHECK-NOT-LABEL: define linkonce_odr %__interface.I* @_ZN1IaSEOS_(%__interface.I* %this, %__interface.I*)
diff --git a/test/CodeGenCXX/microsoft-new.cpp b/test/CodeGenCXX/microsoft-new.cpp
new file mode 100644
index 000000000000..48e93d4aa0f8
--- /dev/null
+++ b/test/CodeGenCXX/microsoft-new.cpp
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -triple i686-pc-win32 -fms-compatibility %s -emit-llvm -o - | FileCheck %s
+
+#include <stddef.h>
+
+struct arbitrary_t {} arbitrary;
+void *operator new(size_t size, arbitrary_t);
+
+struct arbitrary2_t {} arbitrary2;
+void *operator new[](size_t size, arbitrary2_t);
+
+namespace PR13164 {
+ void f() {
+ // MSVC will fall back on the non-array operator new.
+ void *a;
+ int *p = new(arbitrary) int[4];
+ // CHECK: call i8* @_Znwj11arbitrary_t(i32 16, %struct.arbitrary_t*
+ }
+
+ struct S {
+ void *operator new[](size_t size, arbitrary_t);
+ };
+
+ void g() {
+ S *s = new(arbitrary) S[2];
+ // CHECK: call i8* @_ZN7PR131641SnaEj11arbitrary_t(i32 2, %struct.arbitrary_t*
+ S *s1 = new(arbitrary) S;
+ // CHECK: call i8* @_Znwj11arbitrary_t(i32 1, %struct.arbitrary_t*
+ }
+
+ struct T {
+ void *operator new(size_t size, arbitrary2_t);
+ };
+
+ void h() {
+ // This should still call the global operator new[].
+ T *t = new(arbitrary2) T[2];
+ // CHECK: call i8* @_Znaj12arbitrary2_t(i32 2, %struct.arbitrary2_t*
+ }
+}
diff --git a/test/CodeGenCXX/microsoft-uuidof-unsupported-target.cpp b/test/CodeGenCXX/microsoft-uuidof-unsupported-target.cpp
deleted file mode 100644
index 4f68aa34772c..000000000000
--- a/test/CodeGenCXX/microsoft-uuidof-unsupported-target.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-macosx10.8.0 -fms-extensions -verify
-
-typedef struct _GUID
-{
- unsigned long Data1;
- unsigned short Data2;
- unsigned short Data3;
- unsigned char Data4[8];
-} GUID;
-
-struct __declspec(uuid("87654321-4321-4321-4321-ba0987654321")) S { };
-
-GUID g = __uuidof(S); // expected-error {{__uuidof codegen is not supported on this architecture}}
diff --git a/test/CodeGenCXX/microsoft-uuidof.cpp b/test/CodeGenCXX/microsoft-uuidof.cpp
index 8eeb4490ac11..ab3d9b64c6f8 100644
--- a/test/CodeGenCXX/microsoft-uuidof.cpp
+++ b/test/CodeGenCXX/microsoft-uuidof.cpp
@@ -1,72 +1,112 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -triple=i386-pc-win32 -fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-GUID
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -fms-extensions | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -DWRONG_GUID -triple=i386-pc-win32 -fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-WRONG-GUID
-typedef struct _GUID
-{
+#ifdef DEFINE_GUID
+struct _GUID {
+#ifdef WRONG_GUID
+ unsigned int SomethingWentWrong;
+#else
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
-} GUID;
+#endif
+};
+#endif
+typedef struct _GUID GUID;
-struct __declspec(uuid("12345678-1234-1234-1234-1234567890ab")) S1 { } s1;
+struct __declspec(uuid("12345678-1234-1234-1234-1234567890aB")) S1 { } s1;
struct __declspec(uuid("87654321-4321-4321-4321-ba0987654321")) S2 { };
+struct __declspec(uuid("{12345678-1234-1234-1234-1234567890ac}")) Curly;
+
+#ifdef DEFINE_GUID
+// Make sure we can properly generate code when the UUID has curly braces on it.
+GUID thing = __uuidof(Curly);
+// CHECK-DEFINE-GUID: @thing = global %struct._GUID zeroinitializer, align 4
+// CHECK-DEFINE-WRONG-GUID: @thing = global %struct._GUID zeroinitializer, align 4
// This gets initialized in a static initializer.
-// CHECK: @g = global %struct._GUID zeroinitializer, align 4
+// CHECK-DEFINE-GUID: @g = global %struct._GUID zeroinitializer, align 4
+// CHECK-DEFINE-WRONG-GUID: @g = global %struct._GUID zeroinitializer, align 4
GUID g = __uuidof(S1);
+#endif
// First global use of __uuidof(S1) forces the creation of the global.
-// CHECK: @__uuid_12345678-1234-1234-1234-1234567890ab = private unnamed_addr constant %struct._GUID { i32 305419896, i16 4660, i16 4660, [8 x i8] c"\124\124Vx\90\AB" }
-// CHECK: @gr = constant %struct._GUID* @__uuid_12345678-1234-1234-1234-1234567890ab, align 4
+// CHECK: @_GUID_12345678_1234_1234_1234_1234567890ab = linkonce_odr constant { i32, i16, i16, [8 x i8] } { i32 305419896, i16 4660, i16 4660, [8 x i8] c"\124\124Vx\90\AB" }
+// CHECK: @gr = constant %struct._GUID* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to %struct._GUID*), align 4
const GUID& gr = __uuidof(S1);
-// CHECK: @gp = global %struct._GUID* @__uuid_12345678-1234-1234-1234-1234567890ab, align 4
+// CHECK: @gp = global %struct._GUID* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to %struct._GUID*), align 4
const GUID* gp = &__uuidof(S1);
+// CHECK: @cp = global %struct._GUID* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ac to %struct._GUID*), align 4
+const GUID* cp = &__uuidof(Curly);
+
// Special case: _uuidof(0)
-// CHECK: @zeroiid = constant %struct._GUID* @__uuid_00000000-0000-0000-0000-000000000000, align 4
+// CHECK: @zeroiid = constant %struct._GUID* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_00000000_0000_0000_0000_000000000000 to %struct._GUID*), align 4
const GUID& zeroiid = __uuidof(0);
// __uuidof(S2) hasn't been used globally yet, so it's emitted when it's used
// in a function and is emitted at the end of the globals section.
-// CHECK: @__uuid_87654321-4321-4321-4321-ba0987654321 = private unnamed_addr constant %struct._GUID { i32 -2023406815, i16 17185, i16 17185, [8 x i8] c"C!\BA\09\87eC!" }
+// CHECK: @_GUID_87654321_4321_4321_4321_ba0987654321 = linkonce_odr constant { i32, i16, i16, [8 x i8] } { i32 -2023406815, i16 17185, i16 17185, [8 x i8] c"C!\BA\09\87eC!" }
+
+// The static initializer for thing.
+// CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct._GUID* @thing to i8*), i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ac to i8*), i32 16, i32 4, i1 false)
+// CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct._GUID* @thing to i8*), i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ac to i8*), i32 4, i32 4, i1 false)
// The static initializer for g.
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct._GUID* @g to i8*), i8* bitcast (%struct._GUID* @__uuid_12345678-1234-1234-1234-1234567890ab to i8*), i32 16, i32 4, i1 false)
+// CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct._GUID* @g to i8*), i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i32 4, i1 false)
+// CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct._GUID* @g to i8*), i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i32 4, i1 false)
+#ifdef DEFINE_GUID
void fun() {
- // CHECK: %s1_1 = alloca %struct._GUID, align 4
- // CHECK: %s1_2 = alloca %struct._GUID, align 4
- // CHECK: %s1_3 = alloca %struct._GUID, align 4
+ // CHECK-DEFINE-GUID: %s1_1 = alloca %struct._GUID, align 4
+ // CHECK-DEFINE-WRONG-GUID: %s1_1 = alloca %struct._GUID, align 4
+ // CHECK-DEFINE-GUID: %s1_2 = alloca %struct._GUID, align 4
+ // CHECK-DEFINE-WRONG-GUID: %s1_2 = alloca %struct._GUID, align 4
+ // CHECK-DEFINE-GUID: %s1_3 = alloca %struct._GUID, align 4
+ // CHECK-DEFINE-WRONG-GUID: %s1_3 = alloca %struct._GUID, align 4
- // CHECK: [[U1:%.+]] = bitcast %struct._GUID* %s1_1 to i8*
- // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U1]], i8* bitcast (%struct._GUID* @__uuid_12345678-1234-1234-1234-1234567890ab to i8*), i32 16, i32 4, i1 false)
+ // CHECK-DEFINE-GUID: [[U1:%.+]] = bitcast %struct._GUID* %s1_1 to i8*
+ // CHECK-DEFINE-WRONG-GUID: [[U1:%.+]] = bitcast %struct._GUID* %s1_1 to i8*
+ // CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U1]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i32 4, i1 false)
+ // CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U1]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i32 4, i1 false)
GUID s1_1 = __uuidof(S1);
- // CHECK: [[U2:%.+]] = bitcast %struct._GUID* %s1_2 to i8*
- // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U2]], i8* bitcast (%struct._GUID* @__uuid_12345678-1234-1234-1234-1234567890ab to i8*), i32 16, i32 4, i1 false)
+ // CHECK-DEFINE-GUID: [[U2:%.+]] = bitcast %struct._GUID* %s1_2 to i8*
+ // CHECK-DEFINE-WRONG-GUID: [[U2:%.+]] = bitcast %struct._GUID* %s1_2 to i8*
+ // CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U2]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i32 4, i1 false)
+ // CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U2]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i32 4, i1 false)
GUID s1_2 = __uuidof(S1);
- // CHECK: [[U3:%.+]] = bitcast %struct._GUID* %s1_3 to i8*
- // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U3]], i8* bitcast (%struct._GUID* @__uuid_12345678-1234-1234-1234-1234567890ab to i8*), i32 16, i32 4, i1 false)
+ // CHECK-DEFINE-GUID: [[U3:%.+]] = bitcast %struct._GUID* %s1_3 to i8*
+ // CHECK-DEFINE-WRONG-GUID: [[U3:%.+]] = bitcast %struct._GUID* %s1_3 to i8*
+ // CHECK-DEFINE-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U3]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 16, i32 4, i1 false)
+ // CHECK-DEFINE-WRONG-GUID: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[U3]], i8* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab to i8*), i32 4, i32 4, i1 false)
GUID s1_3 = __uuidof(s1);
}
+#endif
void gun() {
- // CHECK: %s2_1 = alloca %struct._GUID, align 4
- // CHECK: %s2_2 = alloca %struct._GUID, align 4
+#ifdef DEFINE_GUID
+ // CHECK-DEFINE-GUID: %s2_1 = alloca %struct._GUID, align 4
+ // CHECK-DEFINE-WRONG-GUID: %s2_1 = alloca %struct._GUID, align 4
+ // CHECK-DEFINE-GUID: %s2_2 = alloca %struct._GUID, align 4
+ // CHECK-DEFINE-WRONG-GUID: %s2_2 = alloca %struct._GUID, align 4
+ GUID s2_1 = __uuidof(S2);
+ GUID s2_2 = __uuidof(S2);
+#endif
// CHECK: %r = alloca %struct._GUID*, align 4
// CHECK: %p = alloca %struct._GUID*, align 4
// CHECK: %zeroiid = alloca %struct._GUID*, align 4
- GUID s2_1 = __uuidof(S2);
- GUID s2_2 = __uuidof(S2);
- // CHECK: store %struct._GUID* @__uuid_87654321-4321-4321-4321-ba0987654321, %struct._GUID** %r, align 4
+ // CHECK: store %struct._GUID* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_87654321_4321_4321_4321_ba0987654321 to %struct._GUID*), %struct._GUID** %r, align 4
const GUID& r = __uuidof(S2);
- // CHECK: store %struct._GUID* @__uuid_87654321-4321-4321-4321-ba0987654321, %struct._GUID** %p, align 4
+ // CHECK: store %struct._GUID* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_87654321_4321_4321_4321_ba0987654321 to %struct._GUID*), %struct._GUID** %p, align 4
const GUID* p = &__uuidof(S2);
// Special case _uuidof(0), local scope version.
- // CHECK: store %struct._GUID* @__uuid_00000000-0000-0000-0000-000000000000, %struct._GUID** %zeroiid, align 4
+ // CHECK: store %struct._GUID* bitcast ({ i32, i16, i16, [8 x i8] }* @_GUID_00000000_0000_0000_0000_000000000000 to %struct._GUID*), %struct._GUID** %zeroiid, align 4
const GUID& zeroiid = __uuidof(0);
}
diff --git a/test/CodeGenCXX/move-assignment.cpp b/test/CodeGenCXX/move-assignment.cpp
new file mode 100644
index 000000000000..3653eab6b7da
--- /dev/null
+++ b/test/CodeGenCXX/move-assignment.cpp
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -emit-llvm -std=c++11 -o - %s -triple x86_64-pc-linux-gnu | FileCheck %s
+
+struct A {
+ A &operator=(A&&);
+};
+
+struct B {
+ A a;
+ int i;
+ bool b;
+ char c;
+ long l;
+ float f;
+};
+
+void test1() {
+ B b1, b2;
+ b1 = static_cast<B&&>(b2);
+}
+
+// CHECK-LABEL: define {{.*}} @_ZN1BaSEOS_
+// CHECK: call {{.*}} @_ZN1AaSEOS_
+// CHECK-NOT: store
+// CHECK: call {{.*}}memcpy{{.*}}, i64 24
+// CHECK-NOT: store
+// CHECK: ret
diff --git a/test/CodeGenCXX/ms-integer-static-data-members.cpp b/test/CodeGenCXX/ms-integer-static-data-members.cpp
new file mode 100644
index 000000000000..00beaa62f190
--- /dev/null
+++ b/test/CodeGenCXX/ms-integer-static-data-members.cpp
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 -emit-llvm -cxx-abi microsoft -triple=i386-pc-win32 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -DINLINE_INIT -emit-llvm -cxx-abi microsoft -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK-INLINE
+// RUN: %clang_cc1 -DREAL_DEFINITION -emit-llvm -cxx-abi microsoft -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK-OUTOFLINE
+// RUN: %clang_cc1 -DINLINE_INIT -DREAL_DEFINITION -emit-llvm -cxx-abi microsoft -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK-INLINE
+
+struct S {
+ // For MS ABI, we emit a linkonce_odr definition here, even though it's really just a declaration.
+#ifdef INLINE_INIT
+ static const int x = 5;
+#else
+ static const int x;
+#endif
+};
+
+const int *f() {
+ return &S::x;
+};
+
+#ifdef REAL_DEFINITION
+#ifdef INLINE_INIT
+const int S::x;
+#else
+const int S::x = 5;
+#endif
+#endif
+
+
+// Inline initialization.
+// CHECK-INLINE: @"\01?x@S@@2HB" = linkonce_odr constant i32 5, align 4
+
+// Out-of-line initialization.
+// CHECK-OUTOFLINE: @"\01?x@S@@2HB" = constant i32 5, align 4
+
+// No initialization.
+// CHECK: @"\01?x@S@@2HB" = external constant i32
diff --git a/test/CodeGenCXX/new-alias.cpp b/test/CodeGenCXX/new-alias.cpp
new file mode 100644
index 000000000000..7ddc1f988086
--- /dev/null
+++ b/test/CodeGenCXX/new-alias.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu -std=c++11 -o - %s | FileCheck %s
+
+using size_t = decltype(sizeof(0));
+
+extern "C" char *something(long long x) {
+}
+
+// CHECK: @_Znwm = alias i8* (i64)* @something
+void *operator new(size_t) __attribute__((alias("something")));
+
+// PR16715: don't assert here.
+// CHECK: call noalias i8* @_Znwm(i64 4){{$}}
+int *pr16715 = new int;
diff --git a/test/CodeGenCXX/new-array-init-exceptions.cpp b/test/CodeGenCXX/new-array-init-exceptions.cpp
index 5d9cc9fa636d..5cfb75744d54 100644
--- a/test/CodeGenCXX/new-array-init-exceptions.cpp
+++ b/test/CodeGenCXX/new-array-init-exceptions.cpp
@@ -7,7 +7,7 @@ struct Throws {
~Throws();
};
-// CHECK: define void @_Z7cleanupi
+// CHECK-LABEL: define void @_Z7cleanupi
void cleanup(int n) {
// CHECK: invoke void @_ZN6ThrowsC1Ei
// CHECK-NEXT: to label %{{[^ ]+}} unwind label %[[LPAD:[^ ]+]]
@@ -25,7 +25,7 @@ void cleanup(int n) {
}
-// CHECK: define void @_Z7cleanupv
+// CHECK-LABEL: define void @_Z7cleanupv
void cleanup() {
// CHECK: invoke void @_ZN6ThrowsC1Ei
// CHECK-NEXT: to label %{{[^ ]+}} unwind label %[[LPAD2:[^ ]+]]
diff --git a/test/CodeGenCXX/new-array-init.cpp b/test/CodeGenCXX/new-array-init.cpp
index 231df24781ae..0e925c0a67eb 100644
--- a/test/CodeGenCXX/new-array-init.cpp
+++ b/test/CodeGenCXX/new-array-init.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -std=c++11 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
-// CHECK: define void @_Z2fni
+// CHECK-LABEL: define void @_Z2fni
void fn(int n) {
// CHECK: icmp ult i{{32|64}} %{{[^ ]+}}, 3
// CHECK: store i32 1
@@ -11,21 +11,21 @@ void fn(int n) {
new int[n] { 1, 2, 3 };
}
-// CHECK: define void @_Z15const_underflowv
+// CHECK-LABEL: define void @_Z15const_underflowv
void const_underflow() {
// CHECK-NOT: icmp ult i{{32|64}} %{{[^ ]+}}, 3
// CHECK: call noalias i8* @_Zna{{.}}(i{{32|64}} -1)
new int[2] { 1, 2, 3 };
}
-// CHECK: define void @_Z11const_exactv
+// CHECK-LABEL: define void @_Z11const_exactv
void const_exact() {
// CHECK-NOT: icmp ult i{{32|64}} %{{[^ ]+}}, 3
// CHECK-NOT: icmp eq i32*
new int[3] { 1, 2, 3 };
}
-// CHECK: define void @_Z16const_sufficientv
+// CHECK-LABEL: define void @_Z16const_sufficientv
void const_sufficient() {
// CHECK-NOT: icmp ult i{{32|64}} %{{[^ ]+}}, 3
new int[4] { 1, 2, 3 };
diff --git a/test/CodeGenCXX/new.cpp b/test/CodeGenCXX/new.cpp
index e0523909a3db..91da77a0838a 100644
--- a/test/CodeGenCXX/new.cpp
+++ b/test/CodeGenCXX/new.cpp
@@ -2,9 +2,24 @@
typedef __typeof__(sizeof(0)) size_t;
+// Ensure that this declaration doesn't cause operator new to lose its
+// 'noalias' attribute.
+void *operator new[](size_t);
+
void t1() {
- int* a = new int;
+ delete new int;
+ delete [] new int [3];
+}
+
+// CHECK: declare noalias i8* @_Znwm(i64) [[ATTR_NOBUILTIN:#[^ ]*]]
+// CHECK: declare void @_ZdlPv(i8*) [[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]]
+// CHECK: declare noalias i8* @_Znam(i64) [[ATTR_NOBUILTIN]]
+// CHECK: declare void @_ZdaPv(i8*) [[ATTR_NOBUILTIN_NOUNWIND]]
+
+namespace std {
+ struct nothrow_t {};
}
+std::nothrow_t nothrow;
// Declare the reserved placement operators.
void *operator new(size_t, void*) throw();
@@ -12,6 +27,13 @@ void operator delete(void*, void*) throw();
void *operator new[](size_t, void*) throw();
void operator delete[](void*, void*) throw();
+// Declare the replaceable global allocation operators.
+void *operator new(size_t, const std::nothrow_t &) throw();
+void *operator new[](size_t, const std::nothrow_t &) throw();
+void operator delete(void *, const std::nothrow_t &) throw();
+void operator delete[](void *, const std::nothrow_t &) throw();
+
+
void t2(int* a) {
int* b = new (a) int;
}
@@ -77,10 +99,6 @@ void t8(int n) {
new U[n];
}
-// noalias
-// CHECK: declare noalias i8* @_Znam
-void *operator new[](size_t);
-
void t9() {
bool b;
@@ -98,7 +116,7 @@ A* t10() {
return new(1, 2, 3.45, 100) A;
}
-// CHECK: define void @_Z3t11i
+// CHECK-LABEL: define void @_Z3t11i
struct B { int a; };
struct Bmemptr { int Bmemptr::* memptr; int a; };
@@ -122,7 +140,7 @@ void t11(int n) {
struct Empty { };
// We don't need to initialize an empty class.
-// CHECK: define void @_Z3t12v
+// CHECK-LABEL: define void @_Z3t12v
void t12() {
// CHECK: call noalias i8* @_Znam
// CHECK-NOT: br
@@ -136,7 +154,7 @@ void t12() {
}
// Zero-initialization
-// CHECK: define void @_Z3t13i
+// CHECK-LABEL: define void @_Z3t13i
void t13(int n) {
// CHECK: call noalias i8* @_Znwm
// CHECK: store i32 0, i32*
@@ -171,7 +189,7 @@ void f() {
namespace test15 {
struct A { A(); ~A(); };
- // CHECK: define void @_ZN6test155test0EPv(
+ // CHECK-LABEL: define void @_ZN6test155test0EPv(
// CHECK: [[P:%.*]] = load i8*
// CHECK-NEXT: icmp eq i8* [[P]], null
// CHECK-NEXT: br i1
@@ -181,7 +199,7 @@ namespace test15 {
new (p) A();
}
- // CHECK: define void @_ZN6test155test1EPv(
+ // CHECK-LABEL: define void @_ZN6test155test1EPv(
// CHECK: [[P:%.*]] = load i8**
// CHECK-NEXT: icmp eq i8* [[P]], null
// CHECK-NEXT: br i1
@@ -199,7 +217,7 @@ namespace test15 {
// TODO: it's okay if all these size calculations get dropped.
// FIXME: maybe we should try to throw on overflow?
- // CHECK: define void @_ZN6test155test2EPvi(
+ // CHECK-LABEL: define void @_ZN6test155test2EPvi(
// CHECK: [[N:%.*]] = load i32*
// CHECK-NEXT: [[T0:%.*]] = sext i32 [[N]] to i64
// CHECK-NEXT: [[T1:%.*]] = icmp slt i64 [[T0]], 0
@@ -220,7 +238,7 @@ namespace test15 {
}
namespace PR10197 {
- // CHECK: define weak_odr void @_ZN7PR101971fIiEEvv()
+ // CHECK-LABEL: define weak_odr void @_ZN7PR101971fIiEEvv()
template<typename T>
void f() {
// CHECK: [[CALL:%.*]] = call noalias i8* @_Znwm
@@ -235,7 +253,7 @@ namespace PR10197 {
namespace PR11523 {
class MyClass;
typedef int MyClass::* NewTy;
- // CHECK: define i64* @_ZN7PR115231fEv
+ // CHECK-LABEL: define i64* @_ZN7PR115231fEv
// CHECK: store i64 -1
NewTy* f() { return new NewTy[2](); }
}
@@ -254,9 +272,69 @@ namespace PR11757 {
namespace PR13380 {
struct A { A() {} };
struct B : public A { int x; };
- // CHECK: define i8* @_ZN7PR133801fEv
+ // CHECK-LABEL: define i8* @_ZN7PR133801fEv
// CHECK: call noalias i8* @_Znam(
// CHECK: call void @llvm.memset.p0i8
// CHECK-NEXT: call void @_ZN7PR133801BC1Ev
void* f() { return new B[2](); }
}
+
+struct MyPlacementType {} mpt;
+void *operator new(size_t, MyPlacementType);
+
+namespace N3664 {
+ struct S { S() throw(int); };
+
+ // CHECK-LABEL-LABEL: define void @_ZN5N36641fEv
+ void f() {
+ // CHECK: call noalias i8* @_Znwm(i64 4) [[ATTR_BUILTIN_NEW:#[^ ]*]]
+ int *p = new int;
+ // CHECK: call void @_ZdlPv({{.*}}) [[ATTR_BUILTIN_DELETE:#[^ ]*]]
+ delete p;
+
+ // CHECK: call noalias i8* @_Znam(i64 12) [[ATTR_BUILTIN_NEW]]
+ int *q = new int[3];
+ // CHECK: call void @_ZdaPv({{.*}}) [[ATTR_BUILTIN_DELETE]]
+ delete [] p;
+
+ // CHECK: call i8* @_ZnamRKSt9nothrow_t(i64 3, {{.*}}) [[ATTR_BUILTIN_NOTHROW_NEW:#[^ ]*]]
+ (void) new (nothrow) S[3];
+
+ // CHECK: call i8* @_Znwm15MyPlacementType(i64 4){{$}}
+ (void) new (mpt) int;
+ }
+
+ // FIXME: Can we mark this noalias?
+ // CHECK: declare i8* @_ZnamRKSt9nothrow_t(i64, {{.*}}) [[ATTR_NOBUILTIN_NOUNWIND]]
+
+ // CHECK-LABEL-LABEL: define void @_ZN5N36641gEv
+ void g() {
+ // It's OK for there to be attributes here, so long as we don't have a
+ // 'builtin' attribute.
+ // CHECK: call noalias i8* @_Znwm(i64 4){{$}}
+ int *p = (int*)operator new(4);
+ // CHECK: call void @_ZdlPv({{.*}}) [[ATTR_NOUNWIND:#[^ ]*]]
+ operator delete(p);
+
+ // CHECK: call noalias i8* @_Znam(i64 12){{$}}
+ int *q = (int*)operator new[](12);
+ // CHECK: call void @_ZdaPv({{.*}}) [[ATTR_NOUNWIND]]
+ operator delete [](p);
+
+ // CHECK: call i8* @_ZnamRKSt9nothrow_t(i64 3, {{.*}}) [[ATTR_NOUNWIND]]
+ (void) operator new[](3, nothrow);
+ }
+}
+
+// CHECK-DAG: attributes [[ATTR_NOBUILTIN]] = {{[{].*}} nobuiltin {{.*[}]}}
+// CHECK-DAG: attributes [[ATTR_NOBUILTIN_NOUNWIND]] = {{[{].*}} nobuiltin nounwind {{.*[}]}}
+
+// CHECK: attributes [[ATTR_NOUNWIND]] =
+// CHECK-NOT: builtin
+// CHECK-NOT: attributes
+// CHECK: nounwind
+// CHECK-NOT: builtin
+// CHECK: attributes
+
+// CHECK-DAG: attributes [[ATTR_BUILTIN_NEW]] = {{[{].*}} builtin {{.*[}]}}
+// CHECK-DAG: attributes [[ATTR_BUILTIN_DELETE]] = {{[{].*}} builtin {{.*[}]}}
diff --git a/test/CodeGenCXX/no-opt-volatile-memcpy.cpp b/test/CodeGenCXX/no-opt-volatile-memcpy.cpp
index e542e4a9348c..d1e2e1d62190 100644
--- a/test/CodeGenCXX/no-opt-volatile-memcpy.cpp
+++ b/test/CodeGenCXX/no-opt-volatile-memcpy.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -O0 -triple=x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple=x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
// rdar://11861085
struct s {
@@ -14,7 +14,7 @@ void foo (void) {
gs = gs;
ls = gs;
}
-// CHECK: define void @_Z3foov()
+// CHECK-LABEL: define void @_Z3foov()
// CHECK: %[[LS:.*]] = alloca %struct.s, align 4
// CHECK-NEXT: %[[ZERO:.*]] = bitcast %struct.s* %[[LS]] to i8*
// CHECK-NEXT: %[[ONE:.*]] = bitcast %struct.s* %[[LS]] to i8*
@@ -34,7 +34,7 @@ void fee (void) {
s = s;
s.y = gs;
}
-// CHECK: define void @_Z3feev()
+// CHECK-LABEL: define void @_Z3feev()
// CHECK: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true)
// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true)
@@ -46,5 +46,5 @@ d gd;
void gorf(void) {
gd = gd;
}
-// CHECK: define void @_Z4gorfv()
+// CHECK-LABEL: define void @_Z4gorfv()
// CHECK: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.d* @gd, i32 0, i32 0, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.d* @gd, i32 0, i32 0, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true)
diff --git a/test/CodeGenCXX/noexcept.cpp b/test/CodeGenCXX/noexcept.cpp
new file mode 100644
index 000000000000..dd4cfda1d896
--- /dev/null
+++ b/test/CodeGenCXX/noexcept.cpp
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions -std=c++11 | FileCheck %s
+
+// rdar://11904428
+// Ensure that we call __cxa_begin_catch before calling
+// std::terminate in a noexcept function.
+namespace test0 {
+ void foo();
+
+ struct A {
+ A();
+ ~A();
+ };
+
+ void test() noexcept {
+ A a;
+ foo();
+ }
+}
+// CHECK-LABEL: define void @_ZN5test04testEv()
+// CHECK: [[EXN:%.*]] = alloca i8*
+// This goes to the terminate lpad.
+// CHECK: invoke void @_ZN5test01AC1Ev(
+// This goes to the cleanup-and-then-terminate lpad.
+// CHECK: invoke void @_ZN5test03fooEv()
+// Destructors don't throw by default in C++11.
+// CHECK: call void @_ZN5test01AD1Ev(
+// Cleanup lpad.
+// CHECK: [[T0:%.*]] = landingpad
+// CHECK-NEXT: catch i8* null
+// CHECK-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0
+// CHECK-NEXT: store i8* [[T1]], i8** [[EXN]]
+// (Calling this destructor is not technically required.)
+// CHECK: call void @_ZN5test01AD1Ev(
+// CHECK-NEXT: br label
+// The terminate landing pad jumps in here for some reason.
+// CHECK: [[T0:%.*]] = landingpad
+// CHECK-NEXT: catch i8* null
+// CHECK-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0
+// CHECK-NEXT: call void @__clang_call_terminate(i8* [[T1]])
+// CHECK-NEXT: unreachable
+// The terminate handler chained to by the cleanup lpad.
+// CHECK: [[T0:%.*]] = load i8** [[EXN]]
+// CHECK-NEXT: call void @__clang_call_terminate(i8* [[T0]])
+// CHECK-NEXT: unreachable
+
+// CHECK-LABEL: define linkonce_odr hidden void @__clang_call_terminate(
+// CHECK: call i8* @__cxa_begin_catch(
+// CHECK-NEXT: call void @_ZSt9terminatev()
+// CHECK-NEXT: unreachable
diff --git a/test/CodeGenCXX/nrvo.cpp b/test/CodeGenCXX/nrvo.cpp
index 747ab6db63eb..b83dd727e0bb 100644
--- a/test/CodeGenCXX/nrvo.cpp
+++ b/test/CodeGenCXX/nrvo.cpp
@@ -9,8 +9,8 @@ public:
~X();
};
-// CHECK: define void @_Z5test0v
-// CHECK-EH: define void @_Z5test0v
+// CHECK-LABEL: define void @_Z5test0v
+// CHECK-EH-LABEL: define void @_Z5test0v
X test0() {
X x;
// CHECK: call {{.*}} @_ZN1XC1Ev
@@ -21,8 +21,8 @@ X test0() {
return x;
}
-// CHECK: define void @_Z5test1b(
-// CHECK-EH: define void @_Z5test1b(
+// CHECK-LABEL: define void @_Z5test1b(
+// CHECK-EH-LABEL: define void @_Z5test1b(
X test1(bool B) {
// CHECK: tail call {{.*}} @_ZN1XC1Ev
// CHECK-NEXT: ret void
@@ -34,8 +34,8 @@ X test1(bool B) {
// CHECK-EH-NEXT: ret void
}
-// CHECK: define void @_Z5test2b
-// CHECK-EH: define void @_Z5test2b
+// CHECK-LABEL: define void @_Z5test2b
+// CHECK-EH-LABEL: define void @_Z5test2b
X test2(bool B) {
// No NRVO.
@@ -120,7 +120,7 @@ X test3(bool B) {
extern "C" void exit(int) throw();
-// CHECK: define void @_Z5test4b
+// CHECK-LABEL: define void @_Z5test4b
X test4(bool B) {
{
// CHECK: tail call {{.*}} @_ZN1XC1Ev
@@ -135,7 +135,7 @@ X test4(bool B) {
}
#ifdef __EXCEPTIONS
-// CHECK-EH: define void @_Z5test5
+// CHECK-EH-LABEL: define void @_Z5test5
void may_throw();
X test5() {
try {
@@ -150,7 +150,7 @@ X test5() {
#endif
// rdar://problem/10430868
-// CHECK: define void @_Z5test6v
+// CHECK-LABEL: define void @_Z5test6v
X test6() {
X a __attribute__((aligned(8)));
return a;
diff --git a/test/CodeGenCXX/override-layout.cpp b/test/CodeGenCXX/override-layout.cpp
index aba4c9179a6d..418c4ffab633 100644
--- a/test/CodeGenCXX/override-layout.cpp
+++ b/test/CodeGenCXX/override-layout.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fdump-record-layouts-simple %s 2> %t.layouts
-// RUN: %clang_cc1 -fdump-record-layouts-simple %s > %t.before 2>&1
-// RUN: %clang_cc1 -DPACKED= -DALIGNED16= -fdump-record-layouts-simple -foverride-record-layout=%t.layouts %s > %t.after 2>&1
+// RUN: %clang_cc1 -fdump-record-layouts-simple %s > %t.layouts
+// RUN: %clang_cc1 -fdump-record-layouts-simple %s > %t.before
+// RUN: %clang_cc1 -DPACKED= -DALIGNED16= -fdump-record-layouts-simple -foverride-record-layout=%t.layouts %s > %t.after
// RUN: diff -u %t.before %t.after
// RUN: FileCheck %s < %t.after
diff --git a/test/CodeGenCXX/partial-destruction.cpp b/test/CodeGenCXX/partial-destruction.cpp
index f232a159eda5..22daebe47baa 100644
--- a/test/CodeGenCXX/partial-destruction.cpp
+++ b/test/CodeGenCXX/partial-destruction.cpp
@@ -11,7 +11,7 @@ namespace test0 {
A as[10] = { 5, 7 };
opaque();
}
- // CHECK: define void @_ZN5test04testEv()
+ // CHECK-LABEL: define void @_ZN5test04testEv()
// CHECK: [[AS:%.*]] = alloca [10 x [[A:%.*]]], align
// CHECK-NEXT: [[ENDVAR:%.*]] = alloca [[A]]*
// CHECK-NEXT: [[EXN:%.*]] = alloca i8*
@@ -98,7 +98,7 @@ namespace test1 {
void test() {
B v = { 5, 6, 7, 8 };
}
- // CHECK: define void @_ZN5test14testEv()
+ // CHECK-LABEL: define void @_ZN5test14testEv()
// CHECK: [[V:%.*]] = alloca [[B:%.*]], align 4
// CHECK-NEXT: alloca i8*
// CHECK-NEXT: alloca i32
@@ -128,7 +128,7 @@ namespace test2 {
void test() {
A v[4][7];
- // CHECK: define void @_ZN5test24testEv()
+ // CHECK-LABEL: define void @_ZN5test24testEv()
// CHECK: [[V:%.*]] = alloca [4 x [7 x [[A:%.*]]]], align 1
// CHECK-NEXT: alloca i8*
// CHECK-NEXT: alloca i32
diff --git a/test/CodeGenCXX/pod-member-memcpys.cpp b/test/CodeGenCXX/pod-member-memcpys.cpp
index 534d5d19e99a..5c79568c2ace 100644
--- a/test/CodeGenCXX/pod-member-memcpys.cpp
+++ b/test/CodeGenCXX/pod-member-memcpys.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -std=c++03 -fexceptions -fcxx-exceptions -O1 -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -emit-llvm -std=c++03 -O0 -o - %s | FileCheck --check-prefix=CHECK-2 %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -std=c++03 -fexceptions -fcxx-exceptions -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -emit-llvm -std=c++03 -o - %s | FileCheck --check-prefix=CHECK-2 %s
struct POD {
int w, x, y, z;
@@ -108,61 +108,61 @@ CALL_AO(InnerClassMember)
CALL_AO(PackedMembers)
// Basic copy-assignment:
-// CHECK: define linkonce_odr %struct.Basic* @_ZN5BasicaSERKS_(%struct.Basic* %this, %struct.Basic*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
-// CHECK: tail call %struct.NonPOD* @_ZN6NonPODaSERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
-// CHECK: ret %struct.Basic* %this
+// CHECK-LABEL: define linkonce_odr %struct.Basic* @_ZN5BasicaSERKS_(%struct.Basic* %this, %struct.Basic*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: call %struct.NonPOD* @_ZN6NonPODaSERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: ret %struct.Basic*
// PODMember copy-assignment:
-// CHECK: define linkonce_odr %struct.PODMember* @_ZN9PODMemberaSERKS_(%struct.PODMember* %this, %struct.PODMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
-// CHECK: tail call %struct.NonPOD* @_ZN6NonPODaSERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
-// CHECK: ret %struct.PODMember* %this
+// CHECK-LABEL: define linkonce_odr %struct.PODMember* @_ZN9PODMemberaSERKS_(%struct.PODMember* %this, %struct.PODMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
+// CHECK: call %struct.NonPOD* @_ZN6NonPODaSERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: ret %struct.PODMember*
// PODLikeMember copy-assignment:
-// CHECK: define linkonce_odr %struct.PODLikeMember* @_ZN13PODLikeMemberaSERKS_(%struct.PODLikeMember* %this, %struct.PODLikeMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
-// CHECK: tail call %struct.NonPOD* @_ZN6NonPODaSERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
-// CHECK: ret %struct.PODLikeMember* %this
+// CHECK-LABEL: define linkonce_odr %struct.PODLikeMember* @_ZN13PODLikeMemberaSERKS_(%struct.PODLikeMember* %this, %struct.PODLikeMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
+// CHECK: call %struct.NonPOD* @_ZN6NonPODaSERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: ret %struct.PODLikeMember*
// ArrayMember copy-assignment:
-// CHECK: define linkonce_odr %struct.ArrayMember* @_ZN11ArrayMemberaSERKS_(%struct.ArrayMember* %this, %struct.ArrayMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}})
-// CHECK: tail call %struct.NonPOD* @_ZN6NonPODaSERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}})
-// CHECK: ret %struct.ArrayMember* %this
+// CHECK-LABEL: define linkonce_odr %struct.ArrayMember* @_ZN11ArrayMemberaSERKS_(%struct.ArrayMember* %this, %struct.ArrayMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}})
+// CHECK: call %struct.NonPOD* @_ZN6NonPODaSERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}})
+// CHECK: ret %struct.ArrayMember*
// VolatileMember copy-assignment:
-// CHECK: define linkonce_odr %struct.VolatileMember* @_ZN14VolatileMemberaSERKS_(%struct.VolatileMember* %this, %struct.VolatileMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK-LABEL: define linkonce_odr %struct.VolatileMember* @_ZN14VolatileMemberaSERKS_(%struct.VolatileMember* %this, %struct.VolatileMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
// CHECK: load volatile i32* {{.*}}, align 4
// CHECK: store volatile i32 {{.*}}, align 4
-// CHECK: tail call %struct.NonPOD* @_ZN6NonPODaSERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
-// CHECK: ret %struct.VolatileMember* %this
+// CHECK: call %struct.NonPOD* @_ZN6NonPODaSERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: ret %struct.VolatileMember*
// BitfieldMember copy-assignment:
-// CHECK: define linkonce_odr %struct.BitfieldMember* @_ZN14BitfieldMemberaSERKS_(%struct.BitfieldMember* %this, %struct.BitfieldMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
-// CHECK: tail call %struct.NonPOD* @_ZN6NonPODaSERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 3, i32 1{{.*}})
-// CHECK: ret %struct.BitfieldMember* %this
+// CHECK-LABEL: define linkonce_odr %struct.BitfieldMember* @_ZN14BitfieldMemberaSERKS_(%struct.BitfieldMember* %this, %struct.BitfieldMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: call %struct.NonPOD* @_ZN6NonPODaSERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 3, i32 1{{.*}})
+// CHECK: ret %struct.BitfieldMember*
// InnerClass copy-assignment:
-// CHECK: define linkonce_odr %struct.InnerClassMember* @_ZN16InnerClassMemberaSERKS_(%struct.InnerClassMember* %this, %struct.InnerClassMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
-// CHECK: tail call %struct.NonPOD* @_ZN6NonPODaSERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
-// CHECK: ret %struct.InnerClassMember* %this
+// CHECK-LABEL: define linkonce_odr %struct.InnerClassMember* @_ZN16InnerClassMemberaSERKS_(%struct.InnerClassMember* %this, %struct.InnerClassMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
+// CHECK: call %struct.NonPOD* @_ZN6NonPODaSERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: ret %struct.InnerClassMember*
// PackedMembers copy-assignment:
-// CHECK: define linkonce_odr %struct.PackedMembers* @_ZN13PackedMembersaSERKS_(%struct.PackedMembers* %this, %struct.PackedMembers*)
-// CHECK: tail call %struct.NonPOD* @_ZN6NonPODaSERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 1{{.*}})
-// CHECK: ret %struct.PackedMembers* %this
+// CHECK-LABEL: define linkonce_odr %struct.PackedMembers* @_ZN13PackedMembersaSERKS_(%struct.PackedMembers* %this, %struct.PackedMembers*)
+// CHECK: call %struct.NonPOD* @_ZN6NonPODaSERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 1{{.*}})
+// CHECK: ret %struct.PackedMembers*
// COPY-CONSTRUCTORS:
@@ -184,73 +184,73 @@ CALL_CC(PODMember)
CALL_CC(Basic)
// Basic copy-constructor:
-// CHECK: define linkonce_odr void @_ZN5BasicC2ERKS_(%struct.Basic* %this, %struct.Basic*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
-// CHECK: tail call void @_ZN6NonPODC1ERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK-LABEL: define linkonce_odr void @_ZN5BasicC2ERKS_(%struct.Basic* %this, %struct.Basic*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: call void @_ZN6NonPODC1ERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
// CHECK: ret void
// PODMember copy-constructor:
-// CHECK: define linkonce_odr void @_ZN9PODMemberC2ERKS_(%struct.PODMember* %this, %struct.PODMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
-// CHECK: tail call void @_ZN6NonPODC1ERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK-LABEL: define linkonce_odr void @_ZN9PODMemberC2ERKS_(%struct.PODMember* %this, %struct.PODMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
+// CHECK: call void @_ZN6NonPODC1ERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
// CHECK: ret void
// PODLikeMember copy-constructor:
-// CHECK: define linkonce_odr void @_ZN13PODLikeMemberC2ERKS_(%struct.PODLikeMember* %this, %struct.PODLikeMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
+// CHECK-LABEL: define linkonce_odr void @_ZN13PODLikeMemberC2ERKS_(%struct.PODLikeMember* %this, %struct.PODLikeMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
// CHECK: invoke void @_ZN6NonPODC1ERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
// CHECK: ret void
// CHECK: landingpad
// CHECK: invoke void @_ZN7PODLikeD1Ev
// ArrayMember copy-constructor:
-// CHECK: define linkonce_odr void @_ZN11ArrayMemberC2ERKS_(%struct.ArrayMember* %this, %struct.ArrayMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}})
-// CHECK: tail call void @_ZN6NonPODC1ERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}})
+// CHECK-LABEL: define linkonce_odr void @_ZN11ArrayMemberC2ERKS_(%struct.ArrayMember* %this, %struct.ArrayMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}})
+// CHECK: call void @_ZN6NonPODC1ERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 64, i32 4{{.*}})
// CHECK: ret void
// VolatileMember copy-constructor:
-// CHECK: define linkonce_odr void @_ZN14VolatileMemberC2ERKS_(%struct.VolatileMember* %this, %struct.VolatileMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK-LABEL: define linkonce_odr void @_ZN14VolatileMemberC2ERKS_(%struct.VolatileMember* %this, %struct.VolatileMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
// CHECK: load volatile i32* {{.*}}, align 4
// CHECK: store volatile i32 {{.*}}, align 4
-// CHECK: tail call void @_ZN6NonPODC1ERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: call void @_ZN6NonPODC1ERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
// CHECK: ret void
// BitfieldMember copy-constructor:
-// CHECK: define linkonce_odr void @_ZN14BitfieldMemberC2ERKS_(%struct.BitfieldMember* %this, %struct.BitfieldMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
-// CHECK: tail call void @_ZN6NonPODC1ERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 3, i32 1{{.*}})
+// CHECK-LABEL: define linkonce_odr void @_ZN14BitfieldMemberC2ERKS_(%struct.BitfieldMember* %this, %struct.BitfieldMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK: call void @_ZN6NonPODC1ERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 3, i32 1{{.*}})
// CHECK: ret void
// InnerClass copy-constructor:
-// CHECK: define linkonce_odr void @_ZN16InnerClassMemberC2ERKS_(%struct.InnerClassMember* %this, %struct.InnerClassMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
-// CHECK: tail call void @_ZN6NonPODC1ERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
+// CHECK-LABEL: define linkonce_odr void @_ZN16InnerClassMemberC2ERKS_(%struct.InnerClassMember* %this, %struct.InnerClassMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 32, i32 4{{.*}})
+// CHECK: call void @_ZN6NonPODC1ERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4{{.*}})
// CHECK: ret void
// ReferenceMember copy-constructor:
-// CHECK: define linkonce_odr void @_ZN15ReferenceMemberC2ERKS_(%struct.ReferenceMember* %this, %struct.ReferenceMember*)
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 8{{.*}})
-// CHECK: tail call void @_ZN6NonPODC1ERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 8{{.*}})
+// CHECK-LABEL: define linkonce_odr void @_ZN15ReferenceMemberC2ERKS_(%struct.ReferenceMember* %this, %struct.ReferenceMember*)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 8{{.*}})
+// CHECK: call void @_ZN6NonPODC1ERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 8{{.*}})
// CHECK: ret void
// BitfieldMember2 copy-constructor:
-// CHECK-2: define linkonce_odr void @_ZN15BitfieldMember2C2ERKS_(%struct.BitfieldMember2* %this, %struct.BitfieldMember2*)
+// CHECK-2-LABEL: define linkonce_odr void @_ZN15BitfieldMember2C2ERKS_(%struct.BitfieldMember2* %this, %struct.BitfieldMember2*)
// CHECK-2: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 4, i1 false)
// CHECK-2: call void @_ZN6NonPODC1ERKS_
// CHECK-2: ret void
// PackedMembers copy-assignment:
-// CHECK: define linkonce_odr void @_ZN13PackedMembersC2ERKS_(%struct.PackedMembers* %this, %struct.PackedMembers*)
-// CHECK: tail call void @_ZN6NonPODC1ERKS_
-// CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 1{{.*}})
+// CHECK-LABEL: define linkonce_odr void @_ZN13PackedMembersC2ERKS_(%struct.PackedMembers* %this, %struct.PackedMembers*)
+// CHECK: call void @_ZN6NonPODC1ERKS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}i64 16, i32 1{{.*}})
// CHECK: ret void
diff --git a/test/CodeGenCXX/pointers-to-data-members.cpp b/test/CodeGenCXX/pointers-to-data-members.cpp
index 7335c97dd975..f0199c851dcd 100644
--- a/test/CodeGenCXX/pointers-to-data-members.cpp
+++ b/test/CodeGenCXX/pointers-to-data-members.cpp
@@ -124,7 +124,7 @@ struct A {
A();
};
-// CHECK: define void @_ZN9ValueInit1AC2Ev(%"struct.ValueInit::A"* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN9ValueInit1AC2Ev(%"struct.ValueInit::A"* %this) unnamed_addr
// CHECK: store i64 -1, i64*
// CHECK: ret void
A::A() : a() {}
@@ -202,7 +202,7 @@ namespace BoolPtrToMember {
bool member;
};
- // CHECK: define i8* @_ZN15BoolPtrToMember1fERNS_1XEMS0_b
+ // CHECK-LABEL: define i8* @_ZN15BoolPtrToMember1fERNS_1XEMS0_b
bool &f(X &x, bool X::*member) {
// CHECK: {{bitcast.* to i8\*}}
// CHECK-NEXT: getelementptr inbounds i8*
@@ -249,7 +249,7 @@ namespace PR13097 {
};
A f();
X g() { return f().*&A::x; }
- // CHECK: define void @_ZN7PR130971gEv
+ // CHECK-LABEL: define void @_ZN7PR130971gEv
// CHECK: call void @_ZN7PR130971fEv
// CHECK-NOT: memcpy
// CHECK: call void @_ZN7PR130971XC1ERKS0_
diff --git a/test/CodeGenCXX/pr11676.cpp b/test/CodeGenCXX/pr11676.cpp
deleted file mode 100644
index 896751ad6e31..000000000000
--- a/test/CodeGenCXX/pr11676.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// RUN: %clang_cc1 %s -std=c++11 -emit-llvm-only
-// CHECK that we don't crash.
-
-// PR11676's example is ill-formed:
-/*
-union _XEvent {
-};
-void ProcessEvent() {
- _XEvent pluginEvent = _XEvent();
-}
-*/
-
-// Example from PR11665:
-void f() {
- union U { int field; } u = U();
- (void)U().field;
-}
diff --git a/test/CodeGenCXX/pr11797.cpp b/test/CodeGenCXX/pr11797.cpp
index 05221acc84f3..1098372ce389 100644
--- a/test/CodeGenCXX/pr11797.cpp
+++ b/test/CodeGenCXX/pr11797.cpp
@@ -5,4 +5,4 @@ namespace std __attribute__ ((__visibility__ ("default"))) {}
void foo() {
}
#pragma GCC visibility pop
-// CHECK: define void @_Z3foov()
+// CHECK-LABEL: define void @_Z3foov()
diff --git a/test/CodeGenCXX/pr12251.cpp b/test/CodeGenCXX/pr12251.cpp
index f3f2ec417e39..bb1c82dc8153 100644
--- a/test/CodeGenCXX/pr12251.cpp
+++ b/test/CodeGenCXX/pr12251.cpp
@@ -4,97 +4,97 @@
bool f(bool *x) {
return *x;
}
-// CHECK: define zeroext i1 @_Z1fPb
-// CHECK: load i8* %{{.*}}, align 1, !range !0
+// CHECK-LABEL: define zeroext i1 @_Z1fPb
+// CHECK: load i8* %{{[^ ]*}}, align 1, !range [[RANGE_i8_0_2:![^ ]*]]
// Only enum-tests follow. Ensure that after the bool test, no further range
// metadata shows up when strict enums are disabled.
-// NO-STRICT-ENUMS: define zeroext i1 @_Z1fPb
-// NO-STRICT-ENUMS: load i8* %{{.*}}, align 1, !range !0
+// NO-STRICT-ENUMS-LABEL: define zeroext i1 @_Z1fPb
+// NO-STRICT-ENUMS: load i8* %{{[^ ]*}}, align 1, !range
// NO-STRICT-ENUMS-NOT: !range
enum e1 { };
e1 g1(e1 *x) {
return *x;
}
-// CHECK: define i32 @_Z2g1P2e1
-// CHECK: load i32* %x, align 4, !range !1
+// CHECK-LABEL: define i32 @_Z2g1P2e1
+// CHECK: load i32* %x, align 4, !range [[RANGE_i32_0_1:![^ ]*]]
enum e2 { e2_a = 0 };
e2 g2(e2 *x) {
return *x;
}
-// CHECK: define i32 @_Z2g2P2e2
-// CHECK: load i32* %x, align 4, !range !1
+// CHECK-LABEL: define i32 @_Z2g2P2e2
+// CHECK: load i32* %x, align 4, !range [[RANGE_i32_0_1]]
enum e3 { e3_a = 16 };
e3 g3(e3 *x) {
return *x;
}
-// CHECK: define i32 @_Z2g3P2e3
-// CHECK: load i32* %x, align 4, !range !2
+// CHECK-LABEL: define i32 @_Z2g3P2e3
+// CHECK: load i32* %x, align 4, !range [[RANGE_i32_0_32:![^ ]*]]
enum e4 { e4_a = -16};
e4 g4(e4 *x) {
return *x;
}
-// CHECK: define i32 @_Z2g4P2e4
-// CHECK: load i32* %x, align 4, !range !3
+// CHECK-LABEL: define i32 @_Z2g4P2e4
+// CHECK: load i32* %x, align 4, !range [[RANGE_i32_m16_16:![^ ]*]]
enum e5 { e5_a = -16, e5_b = 16};
e5 g5(e5 *x) {
return *x;
}
-// CHECK: define i32 @_Z2g5P2e5
-// CHECK: load i32* %x, align 4, !range !4
+// CHECK-LABEL: define i32 @_Z2g5P2e5
+// CHECK: load i32* %x, align 4, !range [[RANGE_i32_m32_32:![^ ]*]]
enum e6 { e6_a = -1 };
e6 g6(e6 *x) {
return *x;
}
-// CHECK: define i32 @_Z2g6P2e6
-// CHECK: load i32* %x, align 4, !range !5
+// CHECK-LABEL: define i32 @_Z2g6P2e6
+// CHECK: load i32* %x, align 4, !range [[RANGE_i32_m1_1:![^ ]*]]
enum e7 { e7_a = -16, e7_b = 2};
e7 g7(e7 *x) {
return *x;
}
-// CHECK: define i32 @_Z2g7P2e7
-// CHECK: load i32* %x, align 4, !range !3
+// CHECK-LABEL: define i32 @_Z2g7P2e7
+// CHECK: load i32* %x, align 4, !range [[RANGE_i32_m16_16]]
enum e8 { e8_a = -17};
e8 g8(e8 *x) {
return *x;
}
-// CHECK: define i32 @_Z2g8P2e8
-// CHECK: load i32* %x, align 4, !range !4
+// CHECK-LABEL: define i32 @_Z2g8P2e8
+// CHECK: load i32* %x, align 4, !range [[RANGE_i32_m32_32:![^ ]*]]
enum e9 { e9_a = 17};
e9 g9(e9 *x) {
return *x;
}
-// CHECK: define i32 @_Z2g9P2e9
-// CHECK: load i32* %x, align 4, !range !2
+// CHECK-LABEL: define i32 @_Z2g9P2e9
+// CHECK: load i32* %x, align 4, !range [[RANGE_i32_0_32]]
enum e10 { e10_a = -16, e10_b = 32};
e10 g10(e10 *x) {
return *x;
}
-// CHECK: define i32 @_Z3g10P3e10
-// CHECK: load i32* %x, align 4, !range !6
+// CHECK-LABEL: define i32 @_Z3g10P3e10
+// CHECK: load i32* %x, align 4, !range [[RANGE_i32_m64_64:![^ ]*]]
enum e11 {e11_a = 4294967296 };
enum e11 g11(enum e11 *x) {
return *x;
}
-// CHECK: define i64 @_Z3g11P3e11
-// CHECK: load i64* %x, align {{[84]}}, !range !7
+// CHECK-LABEL: define i64 @_Z3g11P3e11
+// CHECK: load i64* %x, align {{[84]}}, !range [[RANGE_i64_0_2pow33:![^ ]*]]
enum e12 {e12_a = 9223372036854775808U };
enum e12 g12(enum e12 *x) {
return *x;
}
-// CHECK: define i64 @_Z3g12P3e12
+// CHECK-LABEL: define i64 @_Z3g12P3e12
// CHECK: load i64* %x, align {{[84]}}
// CHECK-NOT: range
// CHECK: ret
@@ -103,7 +103,7 @@ enum e13 : char {e13_a = -1 };
e13 g13(e13 *x) {
return *x;
}
-// CHECK: define signext i8 @_Z3g13P3e13
+// CHECK-LABEL: define signext i8 @_Z3g13P3e13
// CHECK: load i8* %x, align 1
// CHECK-NOT: range
// CHECK: ret
@@ -112,7 +112,7 @@ enum class e14 {e14_a = 1};
e14 g14(e14 *x) {
return *x;
}
-// CHECK: define i32 @_Z3g14P3e14
+// CHECK-LABEL: define i32 @_Z3g14P3e14
// CHECK: load i32* %x, align 4
// CHECK-NOT: range
// CHECK: ret
@@ -121,7 +121,7 @@ enum e15 { e15_a = 2147483648 };
e15 g15(e15 *x) {
return *x;
}
-// CHECK: define i32 @_Z3g15P3e15
+// CHECK-LABEL: define i32 @_Z3g15P3e15
// CHECK: load i32* %x, align 4
// CHECK-NOT: range
// CHECK: ret
@@ -130,17 +130,17 @@ enum e16 { e16_a = -2147483648 };
e16 g16(e16 *x) {
return *x;
}
-// CHECK: define i32 @_Z3g16P3e16
+// CHECK-LABEL: define i32 @_Z3g16P3e16
// CHECK: load i32* %x, align 4
// CHECK-NOT: range
// CHECK: ret
-// CHECK: !0 = metadata !{i8 0, i8 2}
-// CHECK: !1 = metadata !{i32 0, i32 1}
-// CHECK: !2 = metadata !{i32 0, i32 32}
-// CHECK: !3 = metadata !{i32 -16, i32 16}
-// CHECK: !4 = metadata !{i32 -32, i32 32}
-// CHECK: !5 = metadata !{i32 -1, i32 1}
-// CHECK: !6 = metadata !{i32 -64, i32 64}
-// CHECK: !7 = metadata !{i64 0, i64 8589934592}
+// CHECK: [[RANGE_i8_0_2]] = metadata !{i8 0, i8 2}
+// CHECK: [[RANGE_i32_0_1]] = metadata !{i32 0, i32 1}
+// CHECK: [[RANGE_i32_0_32]] = metadata !{i32 0, i32 32}
+// CHECK: [[RANGE_i32_m16_16]] = metadata !{i32 -16, i32 16}
+// CHECK: [[RANGE_i32_m32_32]] = metadata !{i32 -32, i32 32}
+// CHECK: [[RANGE_i32_m1_1]] = metadata !{i32 -1, i32 1}
+// CHECK: [[RANGE_i32_m64_64]] = metadata !{i32 -64, i32 64}
+// CHECK: [[RANGE_i64_0_2pow33]] = metadata !{i64 0, i64 8589934592}
diff --git a/test/CodeGenCXX/pr13396.cpp b/test/CodeGenCXX/pr13396.cpp
index 7d4e2ce74f04..3d582c51006b 100644
--- a/test/CodeGenCXX/pr13396.cpp
+++ b/test/CodeGenCXX/pr13396.cpp
@@ -7,13 +7,13 @@ struct foo {
};
foo::foo() {
- // CHECK: define void @_ZN3fooC1Ev(%struct.foo* inreg %this)
- // CHECK: define void @_ZN3fooC2Ev(%struct.foo* inreg %this)
+ // CHECK-LABEL: define void @_ZN3fooC1Ev(%struct.foo* inreg %this)
+ // CHECK-LABEL: define void @_ZN3fooC2Ev(%struct.foo* inreg %this)
}
foo::~foo() {
- // CHECK: define void @_ZN3fooD1Ev(%struct.foo* inreg %this)
- // CHECK: define void @_ZN3fooD2Ev(%struct.foo* inreg %this)
+ // CHECK-LABEL: define void @_ZN3fooD1Ev(%struct.foo* inreg %this)
+ // CHECK-LABEL: define void @_ZN3fooD2Ev(%struct.foo* inreg %this)
}
void dummy() {
@@ -21,6 +21,6 @@ void dummy() {
// older clangs accept:
// template foo::foo(int x);
foo x(10);
- // CHECK: define linkonce_odr void @_ZN3fooC1IiEET_(%struct.foo* inreg %this, i32 inreg %x)
- // CHECK: define linkonce_odr void @_ZN3fooC2IiEET_(%struct.foo* inreg %this, i32 inreg %x)
+ // CHECK-LABEL: define linkonce_odr void @_ZN3fooC1IiEET_(%struct.foo* inreg %this, i32 inreg %x)
+ // CHECK-LABEL: define linkonce_odr void @_ZN3fooC2IiEET_(%struct.foo* inreg %this, i32 inreg %x)
}
diff --git a/test/CodeGenCXX/pr9130.cpp b/test/CodeGenCXX/pr9130.cpp
index b28f3940e4e6..e726e5a80b0a 100644
--- a/test/CodeGenCXX/pr9130.cpp
+++ b/test/CodeGenCXX/pr9130.cpp
@@ -11,4 +11,4 @@ class nsVorbisState : public nsOggCodecState {
nsVorbisState::~nsVorbisState() {
}
-// CHECK: define linkonce_odr i32 @_ZN15nsOggCodecState9StartTimeEv
+// CHECK-LABEL: define linkonce_odr i32 @_ZN15nsOggCodecState9StartTimeEv
diff --git a/test/CodeGenCXX/pr9965.cpp b/test/CodeGenCXX/pr9965.cpp
index 0d267ff70372..c2d54e19215d 100644
--- a/test/CodeGenCXX/pr9965.cpp
+++ b/test/CodeGenCXX/pr9965.cpp
@@ -8,7 +8,7 @@ struct X : A // default constructor is not trivial
};
X<int> x;
-// CHECK: define internal void @__cxx_global_var_init()
+// CHECK-LABEL: define internal void @__cxx_global_var_init()
// CHECK: call {{.*}} @_ZN1XIiEC1Ev
// CHECK: define linkonce_odr {{.*}} @_ZN1XIiEC1Ev
// CHECK: define linkonce_odr {{.*}} @_ZN1XIiEC2Ev
diff --git a/test/CodeGenCXX/pragma-visibility.cpp b/test/CodeGenCXX/pragma-visibility.cpp
index 0640d4244eba..c0ba9046c8c4 100644
--- a/test/CodeGenCXX/pragma-visibility.cpp
+++ b/test/CodeGenCXX/pragma-visibility.cpp
@@ -28,8 +28,8 @@ template<> int x4<int>::y = 10;
template<int x> int f() { return x; }
extern "C" int g() { return f<3>(); }
#pragma GCC visibility pop
-// CHECK: define hidden i32 @g()
-// CHECK: define linkonce_odr hidden i32 @_Z1fILi3EEiv()
+// CHECK-LABEL: define hidden i32 @g()
+// CHECK-LABEL: define linkonce_odr hidden i32 @_Z1fILi3EEiv()
#pragma GCC visibility push(hidden)
template<class T> struct x5 {
@@ -37,19 +37,19 @@ template<class T> struct x5 {
};
#pragma GCC visibility pop
template<> void x5<int>::y() {}
-// CHECK: define hidden void @_ZN2x5IiE1yEv
+// CHECK-LABEL: define hidden void @_ZN2x5IiE1yEv
#pragma GCC visibility push(hidden)
namespace n __attribute((visibility("default"))) {
void f() {}
- // CHECK: define void @_ZN1n1fEv
+ // CHECK-LABEL: define void @_ZN1n1fEv
}
#pragma GCC visibility pop
namespace n __attribute((visibility("default"))) {
#pragma GCC visibility push(hidden)
void g() {}
- // CHECK: define hidden void @_ZN1n1gEv
+ // CHECK-LABEL: define hidden void @_ZN1n1gEv
#pragma GCC visibility pop
}
@@ -69,6 +69,6 @@ namespace test2 {
bar<foo>::f();
bar<int>::f();
}
- // CHECK: define linkonce_odr hidden void @_ZN5test23barINS_3fooEE1fEv
- // CHECK: define linkonce_odr void @_ZN5test23barIiE1fEv
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN5test23barINS_3fooEE1fEv
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test23barIiE1fEv
}
diff --git a/test/CodeGenCXX/pragma-weak.cpp b/test/CodeGenCXX/pragma-weak.cpp
index ed537ffcd297..c03307914040 100644
--- a/test/CodeGenCXX/pragma-weak.cpp
+++ b/test/CodeGenCXX/pragma-weak.cpp
@@ -10,22 +10,22 @@ int zex;
#pragma weak foo
struct S { void foo(); };
void S::foo() {}
-// CHECK: define void @_ZN1S3fooEv(
+// CHECK-LABEL: define void @_ZN1S3fooEv(
#pragma weak zed
namespace bar { void zed() {} }
-// CHECK: define void @_ZN3bar3zedEv(
+// CHECK-LABEL: define void @_ZN3bar3zedEv(
#pragma weak bah
void bah() {}
-// CHECK: define void @_Z3bahv(
+// CHECK-LABEL: define void @_Z3bahv(
#pragma weak baz
extern "C" void baz() {}
-// CHECK: define weak void @baz(
+// CHECK-LABEL: define weak void @baz(
#pragma weak _Z3baxv
void bax() {}
// GCC produces a weak symbol for this one, but it doesn't look like a good
// idea to expose the mangling to the pragma unless we really have to.
-// CHECK: define void @_Z3baxv(
+// CHECK-LABEL: define void @_Z3baxv(
diff --git a/test/CodeGenCXX/predefined-expr.cpp b/test/CodeGenCXX/predefined-expr.cpp
index 24ead8f8f478..9062ee095c3a 100644
--- a/test/CodeGenCXX/predefined-expr.cpp
+++ b/test/CodeGenCXX/predefined-expr.cpp
@@ -9,6 +9,8 @@
// CHECK: private unnamed_addr constant [57 x i8] c"void NonTypeTemplateParam<42>::size() const [Count = 42]\00"
// CHECK: private unnamed_addr constant [122 x i8] c"static void ClassWithTemplateTemplateParam<char, NS::ClassTemplate>::staticMember() [T = char, Param = NS::ClassTemplate]\00"
// CHECK: private unnamed_addr constant [106 x i8] c"void OuterClass<int *>::MiddleClass::InnerClass<float>::memberFunction(T, U) const [T = int *, U = float]\00"
+// CHECK: private unnamed_addr constant [51 x i8] c"void functionTemplateWithCapturedStmt(T) [T = int]\00"
+// CHECK: private unnamed_addr constant [76 x i8] c"auto functionTemplateWithLambda(int)::<anonymous class>::operator()() const\00"
// CHECK: private unnamed_addr constant [65 x i8] c"void functionTemplateWithUnnamedTemplateParameter(T) [T = float]\00"
// CHECK: private unnamed_addr constant [60 x i8] c"void functionTemplateExplicitSpecialization(T) [T = double]\00"
@@ -376,6 +378,23 @@ void functionTemplateWithUnnamedTemplateParameter(T t)
}
template <typename T>
+void functionTemplateWithLambda(T t)
+{
+ []() {
+ printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
+ } ();
+}
+
+template <typename T>
+void functionTemplateWithCapturedStmt(T t)
+{
+ #pragma clang __debug captured
+ {
+ printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
+ }
+}
+
+template <typename T>
class OuterClass
{
public:
@@ -500,6 +519,9 @@ int main() {
functionTemplateExplicitSpecialization(0.0);
functionTemplateWithUnnamedTemplateParameter<int, float>(0.0f);
+ functionTemplateWithLambda<int>(0);
+ functionTemplateWithCapturedStmt<int>(0);
+
OuterClass<int *>::MiddleClass::InnerClass<float> omi;
omi.memberFunction(0, 0.0f);
diff --git a/test/CodeGenCXX/ptr-to-member-function.cpp b/test/CodeGenCXX/ptr-to-member-function.cpp
index 3989c0362889..914a90a4be1a 100644
--- a/test/CodeGenCXX/ptr-to-member-function.cpp
+++ b/test/CodeGenCXX/ptr-to-member-function.cpp
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
// 13.3.3.2 Ranking implicit conversion sequences
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/reference-cast.cpp b/test/CodeGenCXX/reference-cast.cpp
index f157ae99f9a2..60ea393af96c 100644
--- a/test/CodeGenCXX/reference-cast.cpp
+++ b/test/CodeGenCXX/reference-cast.cpp
@@ -15,7 +15,7 @@ const int &lvalue_noop_cast() {
return 17;
}
-// CHECK: define i16* @_Z20lvalue_integral_castv()
+// CHECK-LABEL: define i16* @_Z20lvalue_integral_castv()
const short &lvalue_integral_cast() {
if (i == 0)
// CHECK: store i16 17, i16*
@@ -27,7 +27,7 @@ const short &lvalue_integral_cast() {
return 17;
}
-// CHECK: define i16* @_Z29lvalue_floating_integral_castv()
+// CHECK-LABEL: define i16* @_Z29lvalue_floating_integral_castv()
const short &lvalue_floating_integral_cast() {
if (i == 0)
// CHECK: store i16 17, i16*
@@ -39,7 +39,7 @@ const short &lvalue_floating_integral_cast() {
return 17.5;
}
-// CHECK: define float* @_Z29lvalue_integral_floating_castv()
+// CHECK-LABEL: define float* @_Z29lvalue_integral_floating_castv()
const float &lvalue_integral_floating_cast() {
if (i == 0)
// CHECK: store float 1.700000e+{{0*}}1, float*
@@ -51,7 +51,7 @@ const float &lvalue_integral_floating_cast() {
return 17;
}
-// CHECK: define float* @_Z20lvalue_floating_castv()
+// CHECK-LABEL: define float* @_Z20lvalue_floating_castv()
const float &lvalue_floating_cast() {
if (i == 0)
// CHECK: store float 1.700000e+{{0*}}1, float*
@@ -65,7 +65,7 @@ const float &lvalue_floating_cast() {
int get_int();
-// CHECK: define i8* @_Z24lvalue_integer_bool_castv()
+// CHECK-LABEL: define i8* @_Z24lvalue_integer_bool_castv()
const bool &lvalue_integer_bool_cast() {
if (i == 0)
// CHECK: call i32 @_Z7get_intv()
@@ -82,7 +82,7 @@ const bool &lvalue_integer_bool_cast() {
float get_float();
-// CHECK: define i8* @_Z25lvalue_floating_bool_castv()
+// CHECK-LABEL: define i8* @_Z25lvalue_floating_bool_castv()
const bool &lvalue_floating_bool_cast() {
if (i == 0)
// CHECK: call float @_Z9get_floatv()
@@ -107,7 +107,7 @@ typedef int (X::*pmf)(int);
pm get_pointer_to_member_data();
pmf get_pointer_to_member_function();
-// CHECK: define i8* @_Z26lvalue_ptrmem_to_bool_castv()
+// CHECK-LABEL: define i8* @_Z26lvalue_ptrmem_to_bool_castv()
const bool &lvalue_ptrmem_to_bool_cast() {
if (i == 0)
// CHECK: call i64 @_Z26get_pointer_to_member_datav()
@@ -125,7 +125,7 @@ const bool &lvalue_ptrmem_to_bool_cast() {
return get_pointer_to_member_data();
}
-// CHECK: define i8* @_Z27lvalue_ptrmem_to_bool_cast2v
+// CHECK-LABEL: define i8* @_Z27lvalue_ptrmem_to_bool_cast2v
const bool &lvalue_ptrmem_to_bool_cast2() {
if (i == 0)
// CHECK: {{call.*_Z30get_pointer_to_member_functionv}}
@@ -169,7 +169,7 @@ const _Complex float &f1() {
return get_complex_double();
}
-// CHECK: define i32 @_Z7pr10592RKi(i32*
+// CHECK-LABEL: define i32 @_Z7pr10592RKi(i32*
unsigned pr10592(const int &v) {
// CHECK: [[VADDR:%[a-zA-Z0-9.]+]] = alloca i32*
// CHECK-NEXT: [[REFTMP:%[a-zA-Z0-9.]+]] = alloca i32
@@ -189,7 +189,7 @@ namespace PR10650 {
unsigned long long test(Helper *obj) {
return static_cast<const unsigned long long&>(obj->id());
}
- // CHECK: define i64 @_ZN7PR106504testEPNS_6HelperE
+ // CHECK-LABEL: define i64 @_ZN7PR106504testEPNS_6HelperE
// CHECK: store i64
}
diff --git a/test/CodeGenCXX/references.cpp b/test/CodeGenCXX/references.cpp
index df5a33686e0d..ec7a3d5daa8f 100644
--- a/test/CodeGenCXX/references.cpp
+++ b/test/CodeGenCXX/references.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -verify -emit-llvm -o - %s | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-darwin -verify -emit-llvm -o - %s | FileCheck %s
void t1() {
- // CHECK: define void @_Z2t1v
+ // CHECK-LABEL: define void @_Z2t1v
// CHECK: [[REFLOAD:%.*]] = load i32** @a, align 8
// CHECK: load i32* [[REFLOAD]], align 4
extern int& a;
@@ -8,7 +8,7 @@ void t1() {
}
void t2(int& a) {
- // CHECK: define void @_Z2t2Ri
+ // CHECK-LABEL: define void @_Z2t2Ri
// CHECK: [[REFLOAD2:%.*]] = load i32** {{.*}}, align 8
// CHECK: load i32* [[REFLOAD2]], align 4
int b = a;
@@ -189,7 +189,7 @@ namespace N2 {
P getP();
- // CHECK: define void @_ZN2N21fEi
+ // CHECK-LABEL: define void @_ZN2N21fEi
// CHECK: call void @_ZN2N24getPEv
// CHECK: getelementptr inbounds
// CHECK: store i32 17
@@ -218,7 +218,7 @@ namespace N2 {
Z getZ();
- // CHECK: define void @_ZN2N21gEi
+ // CHECK-LABEL: define void @_ZN2N21gEi
// CHECK: call void @_ZN2N24getZEv
// CHECK: {{getelementptr inbounds.*i32 0, i32 0}}
// CHECK: {{getelementptr inbounds.*i32 0, i32 0}}
@@ -240,7 +240,7 @@ struct A {
~A();
};
-// CHECK: define internal void @__cxx_global_var_init
+// CHECK-LABEL: define internal void @__cxx_global_var_init
// CHECK: call void @_ZN2N31AC1Ei(%"struct.N3::A"* @_ZGRN2N35sA123E, i32 123)
// CHECK: call i32 @__cxa_atexit
// CHECK: ret void
@@ -255,7 +255,7 @@ struct A {
};
void f() {
- // CHECK: define void @_ZN2N41fEv
+ // CHECK-LABEL: define void @_ZN2N41fEv
// CHECK: call void @_ZN2N41AC1Ev(%"struct.N4::A"* @_ZGRZN2N41fEvE2ar)
// CHECK: call i32 @__cxa_atexit
// CHECK: ret void
@@ -279,7 +279,7 @@ void h() {
// PR9565
namespace PR9565 {
struct a { int a : 10, b : 10; };
- // CHECK: define void @_ZN6PR95651fEv()
+ // CHECK-LABEL: define void @_ZN6PR95651fEv()
void f() {
// CHECK: call void @llvm.memcpy
a x = { 0, 0 };
@@ -306,7 +306,7 @@ namespace PR9565 {
namespace N6 {
extern struct x {char& x;}y;
int a() { return y.x; }
- // CHECK: define i32 @_ZN2N61aEv
+ // CHECK-LABEL: define i32 @_ZN2N61aEv
// CHECK: [[REFLOAD3:%.*]] = load i8** getelementptr inbounds (%"struct.N6::x"* @_ZN2N61yE, i32 0, i32 0), align 8
// CHECK: load i8* [[REFLOAD3]], align 1
}
diff --git a/test/CodeGenCXX/return.cpp b/test/CodeGenCXX/return.cpp
index 43d40ae986ee..1975055fdb74 100644
--- a/test/CodeGenCXX/return.cpp
+++ b/test/CodeGenCXX/return.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -O0 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -O -o - %s | FileCheck %s --check-prefix=CHECK-OPT
// CHECK: @_Z9no_return
diff --git a/test/CodeGenCXX/rtti-layout.cpp b/test/CodeGenCXX/rtti-layout.cpp
index 7128c4e4d07b..0db257731f42 100644
--- a/test/CodeGenCXX/rtti-layout.cpp
+++ b/test/CodeGenCXX/rtti-layout.cpp
@@ -101,7 +101,7 @@ struct B {
static int (B::*d)[10];
};
-// CHECK: define i32 @_Z1fv()
+// CHECK-LABEL: define i32 @_Z1fv()
int f() {
// Vectors should be treated as fundamental types.
typedef short __v4hi __attribute__ ((__vector_size__ (8)));
diff --git a/test/CodeGenCXX/runtimecc.cpp b/test/CodeGenCXX/runtimecc.cpp
index 66d3f41589d1..646c61e0fd8f 100644
--- a/test/CodeGenCXX/runtimecc.cpp
+++ b/test/CodeGenCXX/runtimecc.cpp
@@ -20,7 +20,7 @@ namespace test0 {
};
A global;
-// CHECK: define internal arm_aapcscc void @__cxx_global_var_init()
+// CHECK-LABEL: define internal arm_aapcscc void @__cxx_global_var_init()
// CHECK: call arm_aapcscc [[A]]* @_ZN5test01AC1Ev([[A]]* @_ZN5test06globalE)
// CHECK-NEXT: call arm_aapcscc i32 @__cxa_atexit(void (i8*)* bitcast ([[A]]* ([[A]]*)* @_ZN5test01AD1Ev to void (i8*)*), i8* bitcast ([[A]]* @_ZN5test06globalE to i8*), i8* @__dso_handle) [[NOUNWIND:#[0-9]+]]
// CHECK-NEXT: ret void
@@ -33,7 +33,7 @@ namespace test1 {
throw 0;
}
-// CHECK: define arm_aapcscc void @_ZN5test14testEv()
+// CHECK-LABEL: define arm_aapcscc void @_ZN5test14testEv()
// CHECK: [[T0:%.*]] = call arm_aapcscc i8* @__cxa_allocate_exception(i32 4) [[NOUNWIND]]
// CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to i32*
// CHECK-NEXT: store i32 0, i32* [[T1]]
@@ -45,7 +45,7 @@ namespace test1 {
// CHECK: declare arm_aapcscc void @__cxa_throw(i8*, i8*, i8*)
-// CHECK: define internal arm_aapcscc void @_GLOBAL__I_a()
+// CHECK-LABEL: define internal arm_aapcscc void @_GLOBAL__I_a()
// CHECK: call arm_aapcscc void @__cxx_global_var_init()
diff --git a/test/CodeGenCXX/rvalue-references.cpp b/test/CodeGenCXX/rvalue-references.cpp
index b8d47dcfbe2f..2e0fa829ec90 100644
--- a/test/CodeGenCXX/rvalue-references.cpp
+++ b/test/CodeGenCXX/rvalue-references.cpp
@@ -7,7 +7,7 @@ struct B : Spacer, A { };
B &getB();
-// CHECK: define %struct.A* @_Z4getAv()
+// CHECK-LABEL: define %struct.A* @_Z4getAv()
// CHECK: call %struct.B* @_Z4getBv()
// CHECK-NEXT: bitcast %struct.B*
// CHECK-NEXT: getelementptr inbounds i8*
@@ -19,17 +19,17 @@ int &getIntLValue();
int &&getIntXValue();
int getIntPRValue();
-// CHECK: define i32* @_Z2f0v()
+// CHECK-LABEL: define i32* @_Z2f0v()
// CHECK: call i32* @_Z12getIntLValuev()
// CHECK-NEXT: ret i32*
int &&f0() { return static_cast<int&&>(getIntLValue()); }
-// CHECK: define i32* @_Z2f1v()
+// CHECK-LABEL: define i32* @_Z2f1v()
// CHECK: call i32* @_Z12getIntXValuev()
// CHECK-NEXT: ret i32*
int &&f1() { return static_cast<int&&>(getIntXValue()); }
-// CHECK: define i32* @_Z2f2v
+// CHECK-LABEL: define i32* @_Z2f2v
// CHECK: call i32 @_Z13getIntPRValuev()
// CHECK-NEXT: store i32 {{.*}}, i32*
// CHECK-NEXT: ret i32*
@@ -59,7 +59,7 @@ public:
C test();
-// CHECK: define void @_Z15elide_copy_initv
+// CHECK-LABEL: define void @_Z15elide_copy_initv
void elide_copy_init() {
ok = false;
// CHECK: call void @_Z4testv
@@ -68,7 +68,7 @@ void elide_copy_init() {
// CHECK-NEXT: ret void
}
-// CHECK: define void @_Z16test_move_returnv
+// CHECK-LABEL: define void @_Z16test_move_returnv
C test_move_return() {
// CHECK: call void @_ZN1CC1Ei
C a1(3);
@@ -94,7 +94,7 @@ namespace test1 {
B(int i);
};
- // CHECK: define void @_ZN5test11BC2Ei(
+ // CHECK-LABEL: define void @_ZN5test11BC2Ei(
// CHECK: [[T0:%.*]] = call i32* @_ZN5test14moveERi(
// CHECK-NEXT: [[T1:%.*]] = load i32* [[T0]]
// CHECK-NEXT: call void @_ZN5test11AC1Ei({{.*}}, i32 [[T1]])
diff --git a/test/CodeGenCXX/scoped-enums.cpp b/test/CodeGenCXX/scoped-enums.cpp
index c20faaaf2e96..159172d1662e 100644
--- a/test/CodeGenCXX/scoped-enums.cpp
+++ b/test/CodeGenCXX/scoped-enums.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -emit-llvm -o - %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm -o - %s | FileCheck %s
// PR9923
enum class Color { red, blue, green };
@@ -15,3 +15,10 @@ void h(Colour);
void i() {
h(Colour::grey);
}
+
+enum struct PR17103 : int { a = -1, b = 1 };
+bool cmp(PR17103 x, PR17103 y) { return x < y; }
+
+// CHECK-LABEL: @_Z3cmp7PR17103S_(
+// CHECK-NOT: }
+// CHECK: icmp slt
diff --git a/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp b/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
index 84697be4a4cd..29926b91b795 100644
--- a/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
+++ b/test/CodeGenCXX/skip-vtable-pointer-initialization.cpp
@@ -10,7 +10,7 @@ struct A {
~A();
};
-// CHECK: define void @_ZN5Test11AD2Ev
+// CHECK-LABEL: define void @_ZN5Test11AD2Ev
// CHECK-NOT: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test11AE, i64 0, i64 2), i8***
A::~A()
{
@@ -26,7 +26,7 @@ struct A {
~A();
};
-// CHECK: define void @_ZN5Test21AD2Ev
+// CHECK-LABEL: define void @_ZN5Test21AD2Ev
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test21AE, i64 0, i64 2), i8***
A::~A() {
f();
@@ -49,7 +49,7 @@ struct A {
Field field;
};
-// CHECK: define void @_ZN5Test31AD2Ev
+// CHECK-LABEL: define void @_ZN5Test31AD2Ev
// CHECK-NOT: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test31AE, i64 0, i64 2), i8***
A::~A() {
@@ -75,7 +75,7 @@ struct A {
Field field;
};
-// CHECK: define void @_ZN5Test41AD2Ev
+// CHECK-LABEL: define void @_ZN5Test41AD2Ev
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test41AE, i64 0, i64 2), i8***
A::~A()
{
@@ -99,7 +99,7 @@ struct A {
Field field;
};
-// CHECK: define void @_ZN5Test51AD2Ev
+// CHECK-LABEL: define void @_ZN5Test51AD2Ev
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test51AE, i64 0, i64 2), i8***
A::~A()
{
@@ -127,7 +127,7 @@ struct A {
Field field;
};
-// CHECK: define void @_ZN5Test61AD2Ev
+// CHECK-LABEL: define void @_ZN5Test61AD2Ev
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test61AE, i64 0, i64 2), i8***
A::~A()
{
@@ -153,7 +153,7 @@ struct A {
Field field;
};
-// CHECK: define void @_ZN5Test71AD2Ev
+// CHECK-LABEL: define void @_ZN5Test71AD2Ev
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test71AE, i64 0, i64 2), i8***
A::~A()
{
@@ -179,7 +179,7 @@ struct A {
Field field;
};
-// CHECK: define void @_ZN5Test81AD2Ev
+// CHECK-LABEL: define void @_ZN5Test81AD2Ev
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTVN5Test81AE, i64 0, i64 2), i8***
A::~A()
{
diff --git a/test/CodeGenCXX/static-data-member.cpp b/test/CodeGenCXX/static-data-member.cpp
index 4ad339db985b..eea979494843 100644
--- a/test/CodeGenCXX/static-data-member.cpp
+++ b/test/CodeGenCXX/static-data-member.cpp
@@ -42,7 +42,7 @@ namespace test2 {
template struct A<int>;
}
- // CHECK: define internal void @__cxx_global_var_init()
+ // CHECK-LABEL: define internal void @__cxx_global_var_init()
// CHECK: [[TMP:%.*]] = call i32 @_ZN5test23fooEv()
// CHECK-NEXT: store i32 [[TMP]], i32* @_ZN5test212_GLOBAL__N_11AIiE1xE, align 4
// CHECK-NEXT: ret void
@@ -60,7 +60,7 @@ namespace test3 {
template <class T> int A<T>::x = foo();
template struct A<int>;
- // CHECK: define internal void @__cxx_global_var_init1()
+ // CHECK-LABEL: define internal void @__cxx_global_var_init1()
// CHECK: [[GUARDBYTE:%.*]] = load i8* bitcast (i64* @_ZGVN5test31AIiE1xE to i8*)
// CHECK-NEXT: [[UNINITIALIZED:%.*]] = icmp eq i8 [[GUARDBYTE]], 0
// CHECK-NEXT: br i1 [[UNINITIALIZED]]
@@ -79,7 +79,7 @@ namespace test4 {
};
int f(A *a) {
- // CHECK: define i32 @_ZN5test41fEPNS_1AE
+ // CHECK-LABEL: define i32 @_ZN5test41fEPNS_1AE
// CHECK: ret i32 76
return a->n;
}
diff --git a/test/CodeGenCXX/static-init-1.cpp b/test/CodeGenCXX/static-init-1.cpp
index a926c0a2d32d..09bf7bfd5ca6 100644
--- a/test/CodeGenCXX/static-init-1.cpp
+++ b/test/CodeGenCXX/static-init-1.cpp
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -triple=x86_64-apple-darwin9 -emit-llvm %s -o %t
-// RUN: grep "call i32 @_Z5func1i" %t | count 3
+// RUN: %clang_cc1 -triple=x86_64-apple-darwin9 -emit-llvm %s -o - | FileCheck %s
extern "C" int printf(...);
@@ -9,15 +8,18 @@ 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);
+// CHECK: call i32 @_Z5func1i
int loader_2 = func2(++count);
static int loader_3 = func1(++count);
-
+// CHECK: call i32 @_Z5func1i
int main() {}
int loader_4 = func2(++count);
static int loader_5 = func1(++count);
int loader_6 = func2(++count);
+// CHECK: call i32 @_Z5func1i
+// CHECK-NOT: call i32 @_Z5func1i
diff --git a/test/CodeGenCXX/static-init-4.cpp b/test/CodeGenCXX/static-init-4.cpp
new file mode 100644
index 000000000000..a4bb987c8d3d
--- /dev/null
+++ b/test/CodeGenCXX/static-init-4.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -std=c++11 -S -emit-llvm -o - %s -triple x86_64-linux-gnu | FileCheck %s
+
+typedef __attribute__((vector_size(4*4))) float float32x4_t;
+union QDSUnion { float32x4_t q; float s[4]; };
+constexpr float32x4_t a = {1,2,3,4};
+QDSUnion t = {{(a)}};
+// CHECK: @t = global %union.QDSUnion { <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00> }
diff --git a/test/CodeGenCXX/static-init-pnacl.cpp b/test/CodeGenCXX/static-init-pnacl.cpp
new file mode 100644
index 000000000000..de35ec3847fa
--- /dev/null
+++ b/test/CodeGenCXX/static-init-pnacl.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm -triple=le32-unknown-nacl -o - %s | FileCheck %s
+
+int f();
+
+// Test that PNaCl uses the Itanium/x86 ABI in which the static
+// variable's guard variable is tested via "load i8 and compare with
+// zero" rather than the ARM ABI which uses "load i32 and test the
+// bottom bit".
+void g() {
+ static int a = f();
+}
+// CHECK: [[LOAD:%.*]] = load atomic i8* bitcast (i64* @_ZGVZ1gvE1a to i8*) acquire
+// CHECK-NEXT: [[GUARD:%.*]] = icmp eq i8 [[LOAD]], 0
+// CHECK-NEXT: br i1 [[GUARD]]
diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp
index 74278f7128c8..f522775c109e 100644
--- a/test/CodeGenCXX/static-init.cpp
+++ b/test/CodeGenCXX/static-init.cpp
@@ -54,7 +54,7 @@ namespace test0 {
}
namespace test1 {
- // CHECK: define internal i32 @_ZN5test1L6getvarEi(
+ // CHECK-LABEL: define internal i32 @_ZN5test1L6getvarEi(
static inline int getvar(int index) {
static const int var[] = { 1, 0, 2, 4 };
return var[index];
@@ -68,7 +68,7 @@ char base_req[] = { "foo" };
unsigned char base_req_uchar[] = { "bar" };
namespace union_static_local {
- // CHECK: define internal void @_ZZN18union_static_local4testEvEN1c4mainEv
+ // CHECK-LABEL: define internal void @_ZZN18union_static_local4testEvEN1c4mainEv
// CHECK: call void @_ZN18union_static_local1fEPNS_1xE(%"union.union_static_local::x"* bitcast ({ [2 x i8*] }* @_ZZN18union_static_local4testEvE3foo to %"union.union_static_local::x"*))
union x { long double y; const char *x[2]; };
void f(union x*);
@@ -103,14 +103,14 @@ namespace test2 {
B::B() {
static int x = foo();
}
- // CHECK: define void @_ZN5test21BC1Ev
+ // CHECK-LABEL: define void @_ZN5test21BC1Ev
// CHECK: load atomic i8* bitcast (i64* @_ZGVZN5test21BC1EvE1x to i8*) acquire,
// CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZN5test21BC1EvE1x)
// CHECK: [[T0:%.*]] = call i32 @_ZN5test23fooEv()
// CHECK: store i32 [[T0]], i32* @_ZZN5test21BC1EvE1x,
// CHECK: call void @__cxa_guard_release(i64* @_ZGVZN5test21BC1EvE1x)
- // CHECK: define void @_ZN5test21BC2Ev
+ // CHECK-LABEL: define void @_ZN5test21BC2Ev
// CHECK: load atomic i8* bitcast (i64* @_ZGVZN5test21BC1EvE1x to i8*) acquire,
// CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZN5test21BC1EvE1x)
// CHECK: [[T0:%.*]] = call i32 @_ZN5test23fooEv()
@@ -122,10 +122,10 @@ namespace test2 {
B::~B() {
static int y = foo();
}
- // CHECK: define void @_ZN5test21BD1Ev(
+ // CHECK-LABEL: define void @_ZN5test21BD1Ev(
// CHECK: call void @_ZN5test21BD2Ev(
- // CHECK: define void @_ZN5test21BD2Ev(
+ // CHECK-LABEL: define void @_ZN5test21BD2Ev(
// CHECK: load atomic i8* bitcast (i64* @_ZGVZN5test21BD1EvE1y to i8*) acquire,
// CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZN5test21BD1EvE1y)
// CHECK: [[T0:%.*]] = call i32 @_ZN5test23fooEv()
@@ -149,6 +149,6 @@ namespace test3 {
union U { char x; int i; };
static U u = { 'a' };
}
- // CHECK: define void @_ZN5test31BC1Ev(
- // CHECK: define void @_ZN5test31BC2Ev(
+ // CHECK-LABEL: define void @_ZN5test31BC1Ev(
+ // CHECK-LABEL: define void @_ZN5test31BC2Ev(
}
diff --git a/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp b/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp
index 94fd9aa12ced..50772bf647d1 100644
--- a/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp
+++ b/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp
@@ -1,6 +1,10 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -std=c++1y -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
// CHECK: ; ModuleID
-template<typename> struct A { static int a; };
+
+extern "C" int foo();
+
+template<typename T> struct A { static int a; };
+template<typename T> int A<T>::a = foo();
// CHECK-NOT: @_ZN1AIcE1aE
template<> int A<char>::a;
@@ -8,4 +12,85 @@ template<> int A<char>::a;
// CHECK: @_ZN1AIbE1aE = global i32 10
template<> int A<bool>::a = 10;
+// CHECK: @llvm.global_ctors = appending global [7 x { i32, void ()* }]
+// CHECK: [{ i32, void ()* } { i32 65535, void ()* @[[unordered1:[^ ]*]] },
+// CHECK: { i32, void ()* } { i32 65535, void ()* @[[unordered2:[^ ]*]] },
+// CHECK: { i32, void ()* } { i32 65535, void ()* @[[unordered3:[^ ]*]] },
+// CHECK: { i32, void ()* } { i32 65535, void ()* @[[unordered4:[^ ]*]] },
+// CHECK: { i32, void ()* } { i32 65535, void ()* @[[unordered5:[^ ]*]] },
+// CHECK: { i32, void ()* } { i32 65535, void ()* @[[unordered6:[^ ]*]] },
+// CHECK: { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }]
+
+template int A<short>::a; // Unordered
+int b = foo();
+int c = foo();
+int d = A<void>::a; // Unordered
+
+// An explicit specialization is ordered, and goes in __GLOBAL_I_a.
+template<> struct A<int> { static int a; };
+int A<int>::a = foo();
+
+template<typename T> struct S { static T x; static T y; };
+template<> int S<int>::x = foo();
+template<> int S<int>::y = S<int>::x;
+
+template<typename T> T x = foo();
+template short x<short>; // Unordered
+template<> int x<int> = foo();
+int e = x<char>; // Unordered
+
+namespace ns {
+template <typename T> struct a {
+ static int i;
+};
+template<typename T> int a<T>::i = foo();
+template struct a<int>;
+
+struct b {
+ template <typename T> static T i;
+};
+template<typename T> T b::i = foo();
+template int b::i<int>;
+}
+// CHECK: define internal void @[[unordered1]]
+// CHECK: call i32 @foo()
+// CHECK: store {{.*}} @_ZN1AIsE1aE
+// CHECK: ret
+
+// CHECK: define internal void @[[unordered2]]
+// CHECK: call i32 @foo()
+// CHECK: store {{.*}} @_Z1xIsE
+// CHECK: ret
+
+// CHECK: define internal void @[[unordered3]]
+// CHECK: call i32 @foo()
+// CHECK: store {{.*}} @_ZN2ns1aIiE1iE
+// CHECK: ret
+
+// CHECK: define internal void @[[unordered4]]
+// CHECK: call i32 @foo()
+// CHECK: store {{.*}} @_ZN2ns1b1iIiEE
+// CHECK: ret
+
+// CHECK: define internal void @[[unordered5]]
+// CHECK: call i32 @foo()
+// CHECK: store {{.*}} @_ZN1AIvE1aE
+// CHECK: ret
+
+// CHECK: define internal void @[[unordered6]]
+// CHECK: call i32 @foo()
+// CHECK: store {{.*}} @_Z1xIcE
+// CHECK: ret
+// CHECK: define internal void @_GLOBAL__I_a()
+// We call unique stubs for every ordered dynamic initializer in the TU.
+// CHECK: call
+// CHECK: call
+// CHECK: call
+// CHECK: call
+// CHECK: call
+// CHECK: call
+// CHECK: call
+// CHECK: call
+// CHECK-NOT: call
+// CHECK: ret
diff --git a/test/CodeGenCXX/stmtexpr.cpp b/test/CodeGenCXX/stmtexpr.cpp
index 1f0e4ac4bf29..5d4d6bcce458 100644
--- a/test/CodeGenCXX/stmtexpr.cpp
+++ b/test/CodeGenCXX/stmtexpr.cpp
@@ -73,3 +73,10 @@ int* foo5() {
return (({ a; }));
}
+// <rdar://problem/14074868>
+// Make sure this doesn't crash.
+int foo5(bool b) {
+ int y = 0;
+ y = ({ A a(1); if (b) goto G; a.i; });
+ G: return y;
+}
diff --git a/test/CodeGenCXX/template-anonymous-types.cpp b/test/CodeGenCXX/template-anonymous-types.cpp
index 3df487a33f3c..f4d6549e8338 100644
--- a/test/CodeGenCXX/template-anonymous-types.cpp
+++ b/test/CodeGenCXX/template-anonymous-types.cpp
@@ -19,19 +19,19 @@ template <typename T> int f(T t) {
void test() {
// Look for two instantiations, one for FOO's
// type and one for BAR's.
- // CHECK: define linkonce_odr i32 @_Z1fIN1SUt_EEiT_(i32 %t)
+ // CHECK-LABEL: define linkonce_odr i32 @_Z1fIN1SUt_EEiT_(i32 %t)
(void)f(S::FOO);
- // CHECK: define linkonce_odr i32 @_Z1fIN1SUt0_EEiT_(i32 %t)
+ // CHECK-LABEL: define linkonce_odr i32 @_Z1fIN1SUt0_EEiT_(i32 %t)
(void)f(S::BAR);
// Now check for the class template instantiations. Annoyingly, they are in
// reverse order.
//
// BAR's instantiation of X:
- // CHECK: define linkonce_odr i32 @_ZN1XIN1SUt0_EE1fEv(%struct.X* %this)
- // CHECK: define linkonce_odr void @_ZN1XIN1SUt0_EEC2ES1_(%struct.X* %this, i32 %t) unnamed_addr
+ // CHECK-LABEL: define linkonce_odr i32 @_ZN1XIN1SUt0_EE1fEv(%struct.X* %this)
+ // CHECK-LABEL: define linkonce_odr void @_ZN1XIN1SUt0_EEC2ES1_(%struct.X* %this, i32 %t) unnamed_addr
//
// FOO's instantiation of X:
- // CHECK: define linkonce_odr i32 @_ZN1XIN1SUt_EE1fEv(%struct.X.0* %this)
- // CHECK: define linkonce_odr void @_ZN1XIN1SUt_EEC2ES1_(%struct.X.0* %this, i32 %t) unnamed_addr
+ // CHECK-LABEL: define linkonce_odr i32 @_ZN1XIN1SUt_EE1fEv(%struct.X.0* %this)
+ // CHECK-LABEL: define linkonce_odr void @_ZN1XIN1SUt_EEC2ES1_(%struct.X.0* %this, i32 %t) unnamed_addr
}
diff --git a/test/CodeGenCXX/template-dependent-bind-temporary.cpp b/test/CodeGenCXX/template-dependent-bind-temporary.cpp
index cc1ce866fe2d..ca980c3ff685 100644
--- a/test/CodeGenCXX/template-dependent-bind-temporary.cpp
+++ b/test/CodeGenCXX/template-dependent-bind-temporary.cpp
@@ -18,7 +18,7 @@ void IntToString(T a)
}
int main() {
-// CHECK: define linkonce_odr void @_Z11IntToStringIcEvT_(
+// CHECK-LABEL: define linkonce_odr void @_Z11IntToStringIcEvT_(
IntToString('a');
}
diff --git a/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp b/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
index 2c62b60b1100..de86f10f6c30 100644
--- a/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
+++ b/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
@@ -2,8 +2,8 @@
// Verify that symbols are hidden.
// CHECK: @_ZN1CIiE5Inner6Inner26StaticE = weak_odr hidden global
-// CHECK: define weak_odr hidden void @_ZN1CIiE5Inner1fEv
-// CHECK: define weak_odr hidden void @_ZN1CIiE5Inner6Inner21gEv
+// CHECK-LABEL: define weak_odr hidden void @_ZN1CIiE5Inner1fEv
+// CHECK-LABEL: define weak_odr hidden void @_ZN1CIiE5Inner6Inner21gEv
template<typename T>
struct C {
diff --git a/test/CodeGenCXX/template-instantiation.cpp b/test/CodeGenCXX/template-instantiation.cpp
index b90716ba1ae6..80283a1edd04 100644
--- a/test/CodeGenCXX/template-instantiation.cpp
+++ b/test/CodeGenCXX/template-instantiation.cpp
@@ -13,16 +13,16 @@
// CHECK-NOT: _ZTVN5test31SIiEE
// CHECK-NOT: _ZTSN5test31SIiEE
-// CHECK: define linkonce_odr void @_ZN5test21CIiEC1Ev(%"class.test2::C"* %this) unnamed_addr
-// CHECK: define linkonce_odr void @_ZN5test21CIiE6foobarIdEEvT_(
-// CHECK: define available_externally void @_ZN5test21CIiE6zedbarEd(
-
-// CHECK: define linkonce_odr void @_ZN7PR106662g1ENS_1SILi1EEE()
-// CHECK: define linkonce_odr void @_ZN7PR106662g1ENS_1SILi2EEE()
-// CHECK: define linkonce_odr void @_ZN7PR106662g1ENS_1SILi3EEE()
-// CHECK: define linkonce_odr void @_ZN7PR106662g2ENS_1SILi1EEE()
-// CHECK: define linkonce_odr void @_ZN7PR106662g2ENS_1SILi2EEE()
-// CHECK: define linkonce_odr void @_ZN7PR106662g2ENS_1SILi3EEE()
+// CHECK-LABEL: define linkonce_odr void @_ZN5test21CIiEC1Ev(%"class.test2::C"* %this) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN5test21CIiE6foobarIdEEvT_(
+// CHECK-LABEL: define available_externally void @_ZN5test21CIiE6zedbarEd(
+
+// CHECK-LABEL: define linkonce_odr void @_ZN7PR106662g1ENS_1SILi1EEE()
+// CHECK-LABEL: define linkonce_odr void @_ZN7PR106662g1ENS_1SILi2EEE()
+// CHECK-LABEL: define linkonce_odr void @_ZN7PR106662g1ENS_1SILi3EEE()
+// CHECK-LABEL: define linkonce_odr void @_ZN7PR106662g2ENS_1SILi1EEE()
+// CHECK-LABEL: define linkonce_odr void @_ZN7PR106662g2ENS_1SILi2EEE()
+// CHECK-LABEL: define linkonce_odr void @_ZN7PR106662g2ENS_1SILi3EEE()
// CHECK: declare void @_ZN7PR106662h1ENS_1SILi1EEE()
// CHECK: declare void @_ZN7PR106662h1ENS_1SILi2EEE()
// CHECK: declare void @_ZN7PR106662h1ENS_1SILi3EEE()
diff --git a/test/CodeGenCXX/template-linkage.cpp b/test/CodeGenCXX/template-linkage.cpp
index 3acd12ef0bc5..a84affab7622 100644
--- a/test/CodeGenCXX/template-linkage.cpp
+++ b/test/CodeGenCXX/template-linkage.cpp
@@ -9,19 +9,19 @@ template<typename T> struct A {
// Explicit instantiations have external linkage.
-// CHECK: define weak_odr void @_ZN1AIiE1gEv(
+// CHECK-LABEL: define weak_odr void @_ZN1AIiE1gEv(
template void A<int>::g();
-// CHECK: define weak_odr void @_ZN1AIfE1fEf(
-// CHECK: define weak_odr void @_ZN1AIfE1gEv(
+// CHECK-LABEL: define weak_odr void @_ZN1AIfE1fEf(
+// CHECK-LABEL: define weak_odr void @_ZN1AIfE1gEv(
// FIXME: This should also emit the vtable.
template struct A<float>;
-// CHECK: define weak_odr void @_Z1fIiEvT_
+// CHECK-LABEL: define weak_odr void @_Z1fIiEvT_
template <typename T> void f(T) { }
template void f<int>(int);
-// CHECK: define weak_odr void @_Z1gIiEvT_
+// CHECK-LABEL: define weak_odr void @_Z1gIiEvT_
template <typename T> inline void g(T) { }
template void g<int>(int);
@@ -40,7 +40,7 @@ template<typename T> void X1<T>::blarg() { }
extern template struct X0<char>;
extern template struct X1<char>;
-// CHECK: define linkonce_odr void @_ZN2X1IcED1Ev(%struct.X1* %this) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN2X1IcED1Ev(%struct.X1* %this) unnamed_addr
void test_X1() {
X1<char> i1c;
}
diff --git a/test/CodeGenCXX/temporaries.cpp b/test/CodeGenCXX/temporaries.cpp
index a369c2e36976..e8a7a1f25596 100644
--- a/test/CodeGenCXX/temporaries.cpp
+++ b/test/CodeGenCXX/temporaries.cpp
@@ -1,4 +1,32 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -std=c++11 | FileCheck %s
+
+namespace PR16263 {
+ const unsigned int n = 1234;
+ extern const int &r = (const int&)n;
+ // CHECK: @_ZGRN7PR162631rE = private constant i32 1234,
+ // CHECK: @_ZN7PR162631rE = constant i32* @_ZGRN7PR162631rE,
+
+ extern const int &s = reinterpret_cast<const int&>(n);
+ // CHECK: @_ZN7PR16263L1nE = internal constant i32 1234, align 4
+ // CHECK: @_ZN7PR162631sE = constant i32* @_ZN7PR16263L1nE, align 8
+
+ struct A { int n; };
+ struct B { int n; };
+ struct C : A, B {};
+ extern const A &&a = (A&&)(A&&)(C&&)(C{});
+ // CHECK: @_ZGRN7PR162631aE = private global {{.*}} zeroinitializer,
+ // CHECK: @_ZN7PR162631aE = constant {{.*}} bitcast ({{.*}}* @_ZGRN7PR162631aE to
+
+ extern const int &&t = ((B&&)C{}).n;
+ // CHECK: @_ZGRN7PR162631tE = private global {{.*}} zeroinitializer,
+ // CHECK: @_ZN7PR162631tE = constant i32* {{.*}}* @_ZGRN7PR162631tE {{.*}} 4
+
+ struct D { double d; C c; };
+ extern const int &&u = (123, static_cast<B&&>(0, ((D&&)D{}).*&D::c).n);
+ // CHECK: @_ZGRN7PR162631uE = private global {{.*}} zeroinitializer
+ // CHECK: @_ZN7PR162631uE = constant i32* {{.*}} @_ZGRN7PR162631uE {{.*}} 12
+}
+
struct A {
A();
~A();
@@ -226,7 +254,7 @@ namespace PR5867 {
};
void f(S, int);
- // CHECK: define void @_ZN6PR58671gEv
+ // CHECK-LABEL: define void @_ZN6PR58671gEv
void g() {
// CHECK: call void @_ZN6PR58671SC1Ev
// CHECK-NEXT: call void @_ZN6PR58671fENS_1SEi
@@ -235,7 +263,7 @@ namespace PR5867 {
(f)(S(), 0);
}
- // CHECK: define linkonce_odr void @_ZN6PR58672g2IiEEvT_
+ // CHECK-LABEL: define linkonce_odr void @_ZN6PR58672g2IiEEvT_
template<typename T>
void g2(T) {
// CHECK: call void @_ZN6PR58671SC1Ev
@@ -256,7 +284,7 @@ namespace PR6199 {
struct B { operator A(); };
- // CHECK: define weak_odr void @_ZN6PR61992f2IiEENS_1AET_
+ // CHECK-LABEL: define weak_odr void @_ZN6PR61992f2IiEENS_1AET_
template<typename T> A f2(T) {
B b;
// CHECK: call void @_ZN6PR61991BcvNS_1AEEv
@@ -278,7 +306,7 @@ struct A {
int& f(int);
-// CHECK: define void @_ZN3T121gEv
+// CHECK-LABEL: define void @_ZN3T121gEv
void g() {
// CHECK: call void @_ZN3T121AC1Ev
// CHECK-NEXT: call i32 @_ZN3T121A1fEv(
@@ -325,7 +353,7 @@ namespace PR7556 {
struct A { ~A(); };
struct B { int i; ~B(); };
struct C { int C::*pm; ~C(); };
- // CHECK: define void @_ZN6PR75563fooEv()
+ // CHECK-LABEL: define void @_ZN6PR75563fooEv()
void foo() {
// CHECK: call void @_ZN6PR75561AD1Ev
A();
@@ -350,7 +378,7 @@ namespace Elision {
A fooA();
void takeA(A a);
- // CHECK: define void @_ZN7Elision5test0Ev()
+ // CHECK-LABEL: define void @_ZN7Elision5test0Ev()
void test0() {
// CHECK: [[I:%.*]] = alloca [[A:%.*]], align 8
// CHECK-NEXT: [[J:%.*]] = alloca [[A]], align 8
@@ -378,7 +406,7 @@ namespace Elision {
}
- // CHECK: define void @_ZN7Elision5test1EbNS_1AE(
+ // CHECK-LABEL: define void @_ZN7Elision5test1EbNS_1AE(
void test1(bool c, A x) {
// CHECK: [[I:%.*]] = alloca [[A]], align 8
// CHECK-NEXT: [[J:%.*]] = alloca [[A]], align 8
@@ -417,7 +445,7 @@ namespace Elision {
// CHECK: ret void
}
- // CHECK: define void @_ZN7Elision5test4Ev()
+ // CHECK-LABEL: define void @_ZN7Elision5test4Ev()
void test4() {
// CHECK: [[X:%.*]] = alloca [[A]], align 8
// CHECK-NEXT: [[XS:%.*]] = alloca [2 x [[A]]], align 16
@@ -493,7 +521,7 @@ namespace Elision {
namespace PR8623 {
struct A { A(int); ~A(); };
- // CHECK: define void @_ZN6PR86233fooEb(
+ // CHECK-LABEL: define void @_ZN6PR86233fooEb(
void foo(bool b) {
// CHECK: [[TMP:%.*]] = alloca [[A:%.*]], align 1
// CHECK-NEXT: [[LCONS:%.*]] = alloca i1
@@ -523,7 +551,7 @@ namespace PR8623 {
namespace PR11365 {
struct A { A(); ~A(); };
- // CHECK: define void @_ZN7PR113653fooEv(
+ // CHECK-LABEL: define void @_ZN7PR113653fooEv(
void foo() {
// CHECK: [[BEGIN:%.*]] = getelementptr inbounds [3 x [[A:%.*]]]* {{.*}}, i32 0, i32 0
// CHECK-NEXT: [[END:%.*]] = getelementptr inbounds [[A]]* [[BEGIN]], i64 3
@@ -542,7 +570,7 @@ namespace AssignmentOp {
struct A { ~A(); };
struct B { A operator=(const B&); };
struct C : B { B b1, b2; };
- // CHECK: define void @_ZN12AssignmentOp1fE
+ // CHECK-LABEL: define void @_ZN12AssignmentOp1fE
void f(C &c1, const C &c2) {
// CHECK: call {{.*}} @_ZN12AssignmentOp1CaSERKS0_(
c1 = c2;
@@ -558,3 +586,194 @@ namespace AssignmentOp {
// CHECK: call {{.*}} @_ZN12AssignmentOp1BaSERKS
// CHECK: call {{.*}} @_ZN12AssignmentOp1AD1Ev(
}
+
+namespace BindToSubobject {
+ struct A {
+ A();
+ ~A();
+ int a;
+ };
+
+ void f(), g();
+
+ // CHECK: call void @_ZN15BindToSubobject1AC1Ev({{.*}} @_ZGRN15BindToSubobject1aE)
+ // CHECK: call i32 @__cxa_atexit({{.*}} bitcast ({{.*}} @_ZN15BindToSubobject1AD1Ev to void (i8*)*), i8* bitcast ({{.*}} @_ZGRN15BindToSubobject1aE to i8*), i8* @__dso_handle)
+ // CHECK: store i32* getelementptr inbounds ({{.*}} @_ZGRN15BindToSubobject1aE, i32 0, i32 0), i32** @_ZN15BindToSubobject1aE, align 8
+ int &&a = A().a;
+
+ // CHECK: call void @_ZN15BindToSubobject1fEv()
+ // CHECK: call void @_ZN15BindToSubobject1AC1Ev({{.*}} @_ZGRN15BindToSubobject1bE)
+ // CHECK: call i32 @__cxa_atexit({{.*}} bitcast ({{.*}} @_ZN15BindToSubobject1AD1Ev to void (i8*)*), i8* bitcast ({{.*}} @_ZGRN15BindToSubobject1bE to i8*), i8* @__dso_handle)
+ // CHECK: store i32* getelementptr inbounds ({{.*}} @_ZGRN15BindToSubobject1bE, i32 0, i32 0), i32** @_ZN15BindToSubobject1bE, align 8
+ int &&b = (f(), A().a);
+
+ int A::*h();
+
+ // CHECK: call void @_ZN15BindToSubobject1fEv()
+ // CHECK: call void @_ZN15BindToSubobject1gEv()
+ // CHECK: call void @_ZN15BindToSubobject1AC1Ev({{.*}} @_ZGRN15BindToSubobject1cE)
+ // CHECK: call i32 @__cxa_atexit({{.*}} bitcast ({{.*}} @_ZN15BindToSubobject1AD1Ev to void (i8*)*), i8* bitcast ({{.*}} @_ZGRN15BindToSubobject1cE to i8*), i8* @__dso_handle)
+ // CHECK: call {{.*}} @_ZN15BindToSubobject1hE
+ // CHECK: getelementptr
+ // CHECK: store i32* {{.*}}, i32** @_ZN15BindToSubobject1cE, align 8
+ int &&c = (f(), (g(), A().*h()));
+
+ struct B {
+ int padding;
+ A a;
+ };
+
+ // CHECK: call void @_ZN15BindToSubobject1BC1Ev({{.*}} @_ZGRN15BindToSubobject1dE)
+ // CHECK: call i32 @__cxa_atexit({{.*}} bitcast ({{.*}} @_ZN15BindToSubobject1BD1Ev to void (i8*)*), i8* bitcast ({{.*}} @_ZGRN15BindToSubobject1dE to i8*), i8* @__dso_handle)
+ // CHECK: call {{.*}} @_ZN15BindToSubobject1hE
+ // CHECK: getelementptr {{.*}} getelementptr
+ // CHECK: store i32* {{.*}}, i32** @_ZN15BindToSubobject1dE, align 8
+ int &&d = (B().a).*h();
+}
+
+namespace Bitfield {
+ struct S { int a : 5; ~S(); };
+
+ // Do not lifetime extend the S() temporary here.
+ // CHECK: alloca
+ // CHECK: call {{.*}}memset
+ // CHECK: store i32 {{.*}}, i32* @_ZGRN8Bitfield1rE
+ // CHECK: call void @_ZN8Bitfield1SD1
+ // CHECK: store i32* @_ZGRN8Bitfield1rE, i32** @_ZN8Bitfield1rE, align 8
+ int &&r = S().a;
+}
+
+namespace Vector {
+ typedef __attribute__((vector_size(16))) int vi4a;
+ typedef __attribute__((ext_vector_type(4))) int vi4b;
+ struct S {
+ vi4a v;
+ vi4b w;
+ };
+ // CHECK: alloca
+ // CHECK: extractelement
+ // CHECK: store i32 {{.*}}, i32* @_ZGRN6Vector1rE
+ // CHECK: store i32* @_ZGRN6Vector1rE, i32** @_ZN6Vector1rE,
+ int &&r = S().v[1];
+
+ // CHECK: alloca
+ // CHECK: extractelement
+ // CHECK: store i32 {{.*}}, i32* @_ZGRN6Vector1sE
+ // CHECK: store i32* @_ZGRN6Vector1sE, i32** @_ZN6Vector1sE,
+ int &&s = S().w[1];
+ // FIXME PR16204: The following code leads to an assertion in Sema.
+ //int &&s = S().w.y;
+}
+
+namespace ImplicitTemporaryCleanup {
+ struct A { A(int); ~A(); };
+ void g();
+
+ // CHECK-LABEL: define void @_ZN24ImplicitTemporaryCleanup1fEv(
+ void f() {
+ // CHECK: call {{.*}} @_ZN24ImplicitTemporaryCleanup1AC1Ei(
+ A &&a = 0;
+
+ // CHECK: call {{.*}} @_ZN24ImplicitTemporaryCleanup1gEv(
+ g();
+
+ // CHECK: call {{.*}} @_ZN24ImplicitTemporaryCleanup1AD1Ev(
+ }
+}
+
+namespace MultipleExtension {
+ struct A { A(); ~A(); };
+ struct B { B(); ~B(); };
+ struct C { C(); ~C(); };
+ struct D { D(); ~D(); int n; C c; };
+ struct E { const A &a; B b; const C &c; ~E(); };
+
+ E &&e1 = { A(), B(), D().c };
+
+ // CHECK: call void @_ZN17MultipleExtension1AC1Ev({{.*}} @[[TEMPA:_ZGRN17MultipleExtension2e1E.*]])
+ // CHECK: call i32 @__cxa_atexit({{.*}} @_ZN17MultipleExtension1AD1Ev {{.*}} @[[TEMPA]]
+ // CHECK: store {{.*}} @[[TEMPA]], {{.*}} getelementptr inbounds ({{.*}} @[[TEMPE:_ZGRN17MultipleExtension2e1E.*]], i32 0, i32 0)
+
+ // CHECK: call void @_ZN17MultipleExtension1BC1Ev({{.*}} getelementptr inbounds ({{.*}} @[[TEMPE]], i32 0, i32 1))
+
+ // CHECK: call void @_ZN17MultipleExtension1DC1Ev({{.*}} @[[TEMPD:_ZGRN17MultipleExtension2e1E.*]])
+ // CHECK: call i32 @__cxa_atexit({{.*}} @_ZN17MultipleExtension1DD1Ev {{.*}} @[[TEMPD]]
+ // CHECK: store {{.*}} @[[TEMPD]], {{.*}} getelementptr inbounds ({{.*}} @[[TEMPE]], i32 0, i32 2)
+ // CHECK: call i32 @__cxa_atexit({{.*}} @_ZN17MultipleExtension1ED1Ev {{.*}} @[[TEMPE]]
+ // CHECK: store {{.*}} @[[TEMPE]], %"struct.MultipleExtension::E"** @_ZN17MultipleExtension2e1E, align 8
+
+ E e2 = { A(), B(), D().c };
+
+ // CHECK: call void @_ZN17MultipleExtension1AC1Ev({{.*}} @[[TEMPA:_ZGRN17MultipleExtension2e2E.*]])
+ // CHECK: call i32 @__cxa_atexit({{.*}} @_ZN17MultipleExtension1AD1Ev {{.*}} @[[TEMPA]]
+ // CHECK: store {{.*}} @[[TEMPA]], {{.*}} getelementptr inbounds ({{.*}} @[[E:_ZN17MultipleExtension2e2E]], i32 0, i32 0)
+
+ // CHECK: call void @_ZN17MultipleExtension1BC1Ev({{.*}} getelementptr inbounds ({{.*}} @[[E]], i32 0, i32 1))
+
+ // CHECK: call void @_ZN17MultipleExtension1DC1Ev({{.*}} @[[TEMPD:_ZGRN17MultipleExtension2e2E.*]])
+ // CHECK: call i32 @__cxa_atexit({{.*}} @_ZN17MultipleExtension1DD1Ev {{.*}} @[[TEMPD]]
+ // CHECK: store {{.*}} @[[TEMPD]], {{.*}} getelementptr inbounds ({{.*}} @[[E]], i32 0, i32 2)
+ // CHECK: call i32 @__cxa_atexit({{.*}} @_ZN17MultipleExtension1ED1Ev {{.*}} @[[E]]
+
+
+ void g();
+ // CHECK: define void @[[NS:_ZN17MultipleExtension]]1fEv(
+ void f() {
+ E &&e1 = { A(), B(), D().c };
+ // CHECK: %[[TEMPE1_A:.*]] = getelementptr inbounds {{.*}} %[[TEMPE1:.*]], i32 0, i32 0
+ // CHECK: call void @[[NS]]1AC1Ev({{.*}} %[[TEMPA1:.*]])
+ // CHECK: store {{.*}} %[[TEMPA1]], {{.*}} %[[TEMPE1_A]]
+ // CHECK: %[[TEMPE1_B:.*]] = getelementptr inbounds {{.*}} %[[TEMPE1]], i32 0, i32 1
+ // CHECK: call void @[[NS]]1BC1Ev({{.*}} %[[TEMPE1_B]])
+ // CHECK: %[[TEMPE1_C:.*]] = getelementptr inbounds {{.*}} %[[TEMPE1]], i32 0, i32 2
+ // CHECK: call void @[[NS]]1DC1Ev({{.*}} %[[TEMPD1:.*]])
+ // CHECK: %[[TEMPD1_C:.*]] = getelementptr inbounds {{.*}} %[[TEMPD1]], i32 0, i32 1
+ // CHECK: store {{.*}} %[[TEMPD1_C]], {{.*}} %[[TEMPE1_C]]
+ // CHECK: store {{.*}} %[[TEMPE1]], {{.*}} %[[E1:.*]]
+
+ g();
+ // CHECK: call void @[[NS]]1gEv()
+
+ E e2 = { A(), B(), D().c };
+ // CHECK: %[[TEMPE2_A:.*]] = getelementptr inbounds {{.*}} %[[E2:.*]], i32 0, i32 0
+ // CHECK: call void @[[NS]]1AC1Ev({{.*}} %[[TEMPA2:.*]])
+ // CHECK: store {{.*}} %[[TEMPA2]], {{.*}} %[[TEMPE2_A]]
+ // CHECK: %[[TEMPE2_B:.*]] = getelementptr inbounds {{.*}} %[[E2]], i32 0, i32 1
+ // CHECK: call void @[[NS]]1BC1Ev({{.*}} %[[TEMPE2_B]])
+ // CHECK: %[[TEMPE2_C:.*]] = getelementptr inbounds {{.*}} %[[E2]], i32 0, i32 2
+ // CHECK: call void @[[NS]]1DC1Ev({{.*}} %[[TEMPD2:.*]])
+ // CHECK: %[[TEMPD2_C:.*]] = getelementptr inbounds {{.*}} %[[TEMPD2]], i32 0, i32 1
+ // CHECK: store {{.*}} %[[TEMPD2_C]], {{.*}}* %[[TEMPE2_C]]
+
+ g();
+ // CHECK: call void @[[NS]]1gEv()
+
+ // CHECK: call void @[[NS]]1ED1Ev({{.*}} %[[E2]])
+ // CHECK: call void @[[NS]]1DD1Ev({{.*}} %[[TEMPD2]])
+ // CHECK: call void @[[NS]]1AD1Ev({{.*}} %[[TEMPA2]])
+ // CHECK: call void @[[NS]]1ED1Ev({{.*}} %[[TEMPE1]])
+ // CHECK: call void @[[NS]]1DD1Ev({{.*}} %[[TEMPD1]])
+ // CHECK: call void @[[NS]]1AD1Ev({{.*}} %[[TEMPA1]])
+ }
+}
+
+namespace PR14130 {
+ struct S { S(int); };
+ struct U { S &&s; };
+ U v { { 0 } };
+ // CHECK: call void @_ZN7PR141301SC1Ei({{.*}} @_ZGRN7PR141301vE, i32 0)
+ // CHECK: store {{.*}} @_ZGRN7PR141301vE, {{.*}} @_ZN7PR141301vE
+}
+
+namespace Ctor {
+ struct A { A(); ~A(); };
+ void f();
+ struct B {
+ A &&a;
+ B() : a{} { f(); }
+ } b;
+ // CHECK: define {{.*}}void @_ZN4Ctor1BC1Ev(
+ // CHECK: call void @_ZN4Ctor1AC1Ev(
+ // CHECK: call void @_ZN4Ctor1fEv(
+ // CHECK: call void @_ZN4Ctor1AD1Ev(
+}
diff --git a/test/CodeGenCXX/thiscall-struct-return.cpp b/test/CodeGenCXX/thiscall-struct-return.cpp
index ff531255bba9..a6be5aa494e1 100644
--- a/test/CodeGenCXX/thiscall-struct-return.cpp
+++ b/test/CodeGenCXX/thiscall-struct-return.cpp
@@ -1,7 +1,7 @@
// For MSVC ABI compatibility, all structures returned by value using the
// thiscall calling convention must use the hidden parameter.
//
-// RUN: %clang_cc1 -triple i386-PC-Win32 %s -fms-compatibility -O0 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple i386-PC-Win32 %s -fms-compatibility -emit-llvm -o - | FileCheck %s
// This structure would normally be returned via EAX
struct S {
@@ -29,7 +29,7 @@ public:
}
};
-// CHECK: define void @_Z4testv()
+// CHECK-LABEL: define void @_Z4testv()
void test( void ) {
// CHECK: call void @_ZN1CC1Ev(%class.C* [[C:%.+]])
C c;
diff --git a/test/CodeGenCXX/threadsafe-statics-exceptions.cpp b/test/CodeGenCXX/threadsafe-statics-exceptions.cpp
index 769d120be323..70decc98a109 100644
--- a/test/CodeGenCXX/threadsafe-statics-exceptions.cpp
+++ b/test/CodeGenCXX/threadsafe-statics-exceptions.cpp
@@ -7,7 +7,7 @@ struct X {
struct Y { };
-// CHECK: define void @_Z1fv
+// CHECK-LABEL: define void @_Z1fv
void f() {
// CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZ1fvE1x)
// CHECK: invoke void @_ZN1XC1Ev
diff --git a/test/CodeGenCXX/throw-expression-cleanup.cpp b/test/CodeGenCXX/throw-expression-cleanup.cpp
index e1ecd3804679..9944e161a817 100644
--- a/test/CodeGenCXX/throw-expression-cleanup.cpp
+++ b/test/CodeGenCXX/throw-expression-cleanup.cpp
@@ -14,7 +14,7 @@ void f() {
} catch (...) { }
}
-// CHECK: define void @_Z1fv
+// CHECK-LABEL: define void @_Z1fv
// CHECK: call void @_ZN5ErrorC1ERK1X
// CHECK: invoke void @__cxa_throw
// CHECK: landingpad
diff --git a/test/CodeGenCXX/throw-expressions.cpp b/test/CodeGenCXX/throw-expressions.cpp
index ba8a86881a63..d9bf8fdd59ea 100644
--- a/test/CodeGenCXX/throw-expressions.cpp
+++ b/test/CodeGenCXX/throw-expressions.cpp
@@ -23,7 +23,31 @@ int test4() {
int test5(bool x, bool y, int z) {
return (x ? throw 1 : y) ? z : throw 2;
}
-// CHECK: define i32 @_Z5test5bbi(
+// CHECK-LABEL: define i32 @_Z5test5bbi(
+// CHECK: br i1
+//
+// x.true:
+// CHECK: call void @__cxa_throw(
+// CHECK-NEXT: unreachable
+//
+// x.false:
+// CHECK: br i1
+//
+// y.true:
+// CHECK: load i32*
+// CHECK: br label
+//
+// y.false:
+// CHECK: call void @__cxa_throw(
+// CHECK-NEXT: unreachable
+//
+// end:
+// CHECK: ret i32
+
+int test6(bool x, bool y, int z) {
+ return (x ? throw 1 : y) ? z : (throw 2);
+}
+// CHECK-LABEL: define i32 @_Z5test6bbi(
// CHECK: br i1
//
// x.true:
diff --git a/test/CodeGenCXX/thunks-available-externally.cpp b/test/CodeGenCXX/thunks-available-externally.cpp
index dfdb786b18ee..01e494717ebf 100644
--- a/test/CodeGenCXX/thunks-available-externally.cpp
+++ b/test/CodeGenCXX/thunks-available-externally.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -O3 -o - | FileCheck %s
+// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm-only -O3
// Check that we don't assert on this case.
namespace Test1 {
@@ -58,15 +58,6 @@ static void f(B* b) {
b->f();
}
-// CHECK: define void @_ZN5Test21fEv()
-// CHECK: call void @_ZN5Test21C1fEv
-// CHECK: ret void
-// CHECK: define available_externally void @_ZThn16_N5Test21C1fEv
-void f() {
- C c;
- f(&c);
-}
-
}
// Test that we don't assert.
diff --git a/test/CodeGenCXX/thunks.cpp b/test/CodeGenCXX/thunks.cpp
index 6e58830c6aef..defb70681d93 100644
--- a/test/CodeGenCXX/thunks.cpp
+++ b/test/CodeGenCXX/thunks.cpp
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 %s -triple=x86_64-pc-linux-gnu -munwind-tables -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 %s -triple=x86_64-pc-linux-gnu -munwind-tables -fhidden-weak-vtables -emit-llvm -o - | FileCheck -check-prefix=HIDDEN %s
+// RUN: %clang_cc1 %s -triple=x86_64-pc-linux-gnu -munwind-tables -emit-llvm -o - -O1 -disable-llvm-optzns | FileCheck %s
+// RUN: %clang_cc1 %s -triple=x86_64-pc-linux-gnu -munwind-tables -fhidden-weak-vtables -emit-llvm -o - | FileCheck -check-prefix=CHECK-HIDDEN %s
namespace Test1 {
@@ -19,7 +20,7 @@ struct C : A, B {
virtual void f();
};
-// CHECK: define void @_ZThn8_N5Test11C1fEv(
+// CHECK-LABEL: define void @_ZThn8_N5Test11C1fEv(
void C::f() { }
}
@@ -37,7 +38,7 @@ struct B : virtual A {
virtual void f();
};
-// CHECK: define void @_ZTv0_n24_N5Test21B1fEv(
+// CHECK-LABEL: define void @_ZTv0_n24_N5Test21B1fEv(
void B::f() { }
}
@@ -82,7 +83,7 @@ struct __attribute__((visibility("protected"))) C : A, B {
virtual void f();
};
-// CHECK: define protected void @_ZThn8_N5Test41C1fEv(
+// CHECK-LABEL: define protected void @_ZThn8_N5Test41C1fEv(
void C::f() { }
}
@@ -165,7 +166,7 @@ namespace Test6 {
virtual X f();
};
- // CHECK: define void @_ZThn16_N5Test66Thunks1fEv
+ // CHECK-LABEL: define void @_ZThn16_N5Test66Thunks1fEv
// CHECK-NOT: memcpy
// CHECK: {{call void @_ZN5Test66Thunks1fEv.*sret}}
// CHECK: ret void
@@ -211,7 +212,7 @@ namespace Test7 {
void D::baz(X, X&, _Complex float, Small, Small&, Large) { }
- // CHECK: define void @_ZThn8_N5Test71D3bazENS_1XERS1_CfNS_5SmallERS4_NS_5LargeE(
+ // CHECK-LABEL: define void @_ZThn8_N5Test71D3bazENS_1XERS1_CfNS_5SmallERS4_NS_5LargeE(
// CHECK-NOT: memcpy
// CHECK: ret void
void testD() { D d; }
@@ -226,7 +227,7 @@ namespace Test8 {
// CHECK: define void @_ZN5Test81C6helperENS_6NonPODE([[NONPODTYPE:%.*]]*
void C::helper(NonPOD var) {}
- // CHECK: define void @_ZThn8_N5Test81C3barENS_6NonPODE(
+ // CHECK-LABEL: define void @_ZThn8_N5Test81C3barENS_6NonPODE(
// CHECK-NOT: load [[NONPODTYPE]]*
// CHECK-NOT: memcpy
// CHECK: ret void
@@ -250,8 +251,8 @@ namespace Test10 {
struct B { virtual void foo(); };
struct C : A, B { void foo() {} };
- // CHECK-HIDDEN: define linkonce_odr void @_ZN6Test101C3fooEv
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZThn8_N6Test101C3fooEv
+ // CHECK-HIDDEN-LABEL: define linkonce_odr void @_ZN6Test101C3fooEv
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZThn8_N6Test101C3fooEv
void test() {
C c;
@@ -342,10 +343,31 @@ namespace Test14 {
// CHECK: define void @_ZThn8_N6Test141C1fEv({{.*}}) unnamed_addr [[NUW:#[0-9]+]]
}
+// Varargs non-covariant thunk test.
+// PR18098
+namespace Test15 {
+ struct A {
+ virtual ~A();
+ };
+ struct B {
+ virtual void f(int x, ...);
+ };
+ struct C : A, B {
+ virtual void c();
+ virtual void f(int x, ...);
+ };
+ void C::c() {}
+
+ // C::c
+ // CHECK: declare void @_ZN6Test151C1fEiz
+ // non-virtual thunk to C::f
+ // CHECK: declare void @_ZThn8_N6Test151C1fEiz
+}
+
/**** The following has to go at the end of the file ****/
// This is from Test5:
-// CHECK: define linkonce_odr void @_ZTv0_n24_N5Test51B1fEv
-// CHECK: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv(
+// CHECK-LABEL: define linkonce_odr void @_ZTv0_n24_N5Test51B1fEv
+// CHECK-LABEL: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv(
// CHECK: attributes [[NUW]] = { nounwind uwtable{{.*}} }
diff --git a/test/CodeGenCXX/type_visibility.cpp b/test/CodeGenCXX/type_visibility.cpp
index 5c45611991ce..11e5091fd279 100644
--- a/test/CodeGenCXX/type_visibility.cpp
+++ b/test/CodeGenCXX/type_visibility.cpp
@@ -26,11 +26,11 @@ namespace temp0 {
};
template struct B<A>;
- // FUNS: define weak_odr void @_ZN5temp01BINS_1AEE3fooEv(
+ // FUNS-LABEL: define weak_odr void @_ZN5temp01BINS_1AEE3fooEv(
// VARS: @_ZTVN5temp01BINS_1AEEE = weak_odr unnamed_addr constant
// VARS: @_ZTSN5temp01BINS_1AEEE = weak_odr constant
// VARS: @_ZTIN5temp01BINS_1AEEE = weak_odr unnamed_addr constant
- // FUNS-HIDDEN: define weak_odr hidden void @_ZN5temp01BINS_1AEE3fooEv(
+ // FUNS-HIDDEN-LABEL: define weak_odr hidden void @_ZN5temp01BINS_1AEE3fooEv(
// VARS-HIDDEN: @_ZTVN5temp01BINS_1AEEE = weak_odr hidden unnamed_addr constant
// VARS-HIDDEN: @_ZTSN5temp01BINS_1AEEE = weak_odr hidden constant
// VARS-HIDDEN: @_ZTIN5temp01BINS_1AEEE = weak_odr hidden unnamed_addr constant
@@ -43,11 +43,11 @@ namespace temp1 {
};
template struct B<A>;
- // FUNS: define weak_odr void @_ZN5temp11BINS_1AEE3fooEv(
+ // FUNS-LABEL: define weak_odr void @_ZN5temp11BINS_1AEE3fooEv(
// VARS: @_ZTVN5temp11BINS_1AEEE = weak_odr unnamed_addr constant
// VARS: @_ZTSN5temp11BINS_1AEEE = weak_odr constant
// VARS: @_ZTIN5temp11BINS_1AEEE = weak_odr unnamed_addr constant
- // FUNS-HIDDEN: define weak_odr hidden void @_ZN5temp11BINS_1AEE3fooEv(
+ // FUNS-HIDDEN-LABEL: define weak_odr hidden void @_ZN5temp11BINS_1AEE3fooEv(
// VARS-HIDDEN: @_ZTVN5temp11BINS_1AEEE = weak_odr unnamed_addr constant
// VARS-HIDDEN: @_ZTSN5temp11BINS_1AEEE = weak_odr constant
// VARS-HIDDEN: @_ZTIN5temp11BINS_1AEEE = weak_odr unnamed_addr constant
@@ -60,11 +60,11 @@ namespace temp2 {
};
template struct B<A>;
- // FUNS: define weak_odr void @_ZN5temp21BINS_1AEE3fooEv(
+ // FUNS-LABEL: define weak_odr void @_ZN5temp21BINS_1AEE3fooEv(
// VARS: @_ZTVN5temp21BINS_1AEEE = weak_odr unnamed_addr constant
// VARS: @_ZTSN5temp21BINS_1AEEE = weak_odr constant
// VARS: @_ZTIN5temp21BINS_1AEEE = weak_odr unnamed_addr constant
- // FUNS-HIDDEN: define weak_odr hidden void @_ZN5temp21BINS_1AEE3fooEv(
+ // FUNS-HIDDEN-LABEL: define weak_odr hidden void @_ZN5temp21BINS_1AEE3fooEv(
// VARS-HIDDEN: @_ZTVN5temp21BINS_1AEEE = weak_odr hidden unnamed_addr constant
// VARS-HIDDEN: @_ZTSN5temp21BINS_1AEEE = weak_odr hidden constant
// VARS-HIDDEN: @_ZTIN5temp21BINS_1AEEE = weak_odr hidden unnamed_addr constant
@@ -77,11 +77,11 @@ namespace temp3 {
};
template struct B<A>;
- // FUNS: define weak_odr hidden void @_ZN5temp31BINS_1AEE3fooEv(
+ // FUNS-LABEL: define weak_odr hidden void @_ZN5temp31BINS_1AEE3fooEv(
// VARS: @_ZTVN5temp31BINS_1AEEE = weak_odr hidden unnamed_addr constant
// VARS: @_ZTSN5temp31BINS_1AEEE = weak_odr hidden constant
// VARS: @_ZTIN5temp31BINS_1AEEE = weak_odr hidden unnamed_addr constant
- // FUNS-HIDDEN: define weak_odr hidden void @_ZN5temp31BINS_1AEE3fooEv(
+ // FUNS-HIDDEN-LABEL: define weak_odr hidden void @_ZN5temp31BINS_1AEE3fooEv(
// VARS-HIDDEN: @_ZTVN5temp31BINS_1AEEE = weak_odr hidden unnamed_addr constant
// VARS-HIDDEN: @_ZTSN5temp31BINS_1AEEE = weak_odr hidden constant
// VARS-HIDDEN: @_ZTIN5temp31BINS_1AEEE = weak_odr hidden unnamed_addr constant
@@ -94,11 +94,11 @@ namespace temp4 {
};
template struct B<A>;
- // FUNS: define weak_odr void @_ZN5temp41BINS_1AEE3fooEv(
+ // FUNS-LABEL: define weak_odr void @_ZN5temp41BINS_1AEE3fooEv(
// VARS: @_ZTVN5temp41BINS_1AEEE = weak_odr hidden unnamed_addr constant
// VARS: @_ZTSN5temp41BINS_1AEEE = weak_odr hidden constant
// VARS: @_ZTIN5temp41BINS_1AEEE = weak_odr hidden unnamed_addr constant
- // FUNS-HIDDEN: define weak_odr hidden void @_ZN5temp41BINS_1AEE3fooEv(
+ // FUNS-HIDDEN-LABEL: define weak_odr hidden void @_ZN5temp41BINS_1AEE3fooEv(
// VARS-HIDDEN: @_ZTVN5temp41BINS_1AEEE = weak_odr hidden unnamed_addr constant
// VARS-HIDDEN: @_ZTSN5temp41BINS_1AEEE = weak_odr hidden constant
// VARS-HIDDEN: @_ZTIN5temp41BINS_1AEEE = weak_odr hidden unnamed_addr constant
@@ -110,11 +110,11 @@ namespace type0 {
};
void A::foo() {}
- // FUNS: define void @_ZN5type01A3fooEv(
+ // FUNS-LABEL: define void @_ZN5type01A3fooEv(
// VARS: @_ZTVN5type01AE = unnamed_addr constant
// VARS: @_ZTSN5type01AE = constant
// VARS: @_ZTIN5type01AE = unnamed_addr constant
- // FUNS-HIDDEN: define hidden void @_ZN5type01A3fooEv(
+ // FUNS-HIDDEN-LABEL: define hidden void @_ZN5type01A3fooEv(
// VARS-HIDDEN: @_ZTVN5type01AE = unnamed_addr constant
// VARS-HIDDEN: @_ZTSN5type01AE = constant
// VARS-HIDDEN: @_ZTIN5type01AE = unnamed_addr constant
@@ -126,11 +126,11 @@ namespace type1 {
};
void A::foo() {}
- // FUNS: define hidden void @_ZN5type11A3fooEv(
+ // FUNS-LABEL: define hidden void @_ZN5type11A3fooEv(
// VARS: @_ZTVN5type11AE = unnamed_addr constant
// VARS: @_ZTSN5type11AE = constant
// VARS: @_ZTIN5type11AE = unnamed_addr constant
- // FUNS-HIDDEN: define hidden void @_ZN5type11A3fooEv(
+ // FUNS-HIDDEN-LABEL: define hidden void @_ZN5type11A3fooEv(
// VARS-HIDDEN: @_ZTVN5type11AE = unnamed_addr constant
// VARS-HIDDEN: @_ZTSN5type11AE = constant
// VARS-HIDDEN: @_ZTIN5type11AE = unnamed_addr constant
@@ -142,11 +142,11 @@ namespace type2 {
};
void A::foo() {}
- // FUNS: define void @_ZN5type21A3fooEv(
+ // FUNS-LABEL: define void @_ZN5type21A3fooEv(
// VARS: @_ZTVN5type21AE = hidden unnamed_addr constant
// VARS: @_ZTSN5type21AE = hidden constant
// VARS: @_ZTIN5type21AE = hidden unnamed_addr constant
- // FUNS-HIDDEN: define hidden void @_ZN5type21A3fooEv(
+ // FUNS-HIDDEN-LABEL: define hidden void @_ZN5type21A3fooEv(
// VARS-HIDDEN: @_ZTVN5type21AE = hidden unnamed_addr constant
// VARS-HIDDEN: @_ZTSN5type21AE = hidden constant
// VARS-HIDDEN: @_ZTIN5type21AE = hidden unnamed_addr constant
@@ -158,11 +158,11 @@ namespace type3 {
};
void A::foo() {}
- // FUNS: define void @_ZN5type31A3fooEv(
+ // FUNS-LABEL: define void @_ZN5type31A3fooEv(
// VARS: @_ZTVN5type31AE = hidden unnamed_addr constant
// VARS: @_ZTSN5type31AE = hidden constant
// VARS: @_ZTIN5type31AE = hidden unnamed_addr constant
- // FUNS-HIDDEN: define void @_ZN5type31A3fooEv(
+ // FUNS-HIDDEN-LABEL: define void @_ZN5type31A3fooEv(
// VARS-HIDDEN: @_ZTVN5type31AE = hidden unnamed_addr constant
// VARS-HIDDEN: @_ZTSN5type31AE = hidden constant
// VARS-HIDDEN: @_ZTIN5type31AE = hidden unnamed_addr constant
diff --git a/test/CodeGenCXX/typeid.cpp b/test/CodeGenCXX/typeid.cpp
index a1bc967d74d2..9d212905e614 100644
--- a/test/CodeGenCXX/typeid.cpp
+++ b/test/CodeGenCXX/typeid.cpp
@@ -27,7 +27,10 @@ extern A &a;
// CHECK: @_ZN5Test14a_tiE = global
const std::type_info &a_ti = typeid(a);
-// CHECK: define i8* @_ZN5Test11fEv
+// CHECK: @_ZN5Test18A10_c_tiE = constant %"class.std::type_info"* bitcast ({ i8*, i8* }* @_ZTIA10_c to %"class.std::type_info"*), align 8
+const std::type_info &A10_c_ti = typeid(char const[10]);
+
+// CHECK-LABEL: define i8* @_ZN5Test11fEv
const char *f() {
try {
// CHECK: br i1
diff --git a/test/CodeGenCXX/unknown-anytype.cpp b/test/CodeGenCXX/unknown-anytype.cpp
index 902cc8de5c97..aacb8493ef3c 100644
--- a/test/CodeGenCXX/unknown-anytype.cpp
+++ b/test/CodeGenCXX/unknown-anytype.cpp
@@ -1,33 +1,45 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -funknown-anytype -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -funknown-anytype -emit-llvm -o %t %s
+// RUN: FileCheck -check-prefix COMMON %s < %t
+// RUN: FileCheck -check-prefix X86_64 %s < %t
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -funknown-anytype -emit-llvm -o %t %s
+// RUN: FileCheck -check-prefix COMMON %s < %t
+// RUN: FileCheck -check-prefix I386 %s < %t
+
+// x86-64 is the special case here because of its variadic convention.
+// We want to ensure that it always uses a variadic convention even if
+// other platforms do not.
+// rdar://13731520
int test0() {
extern __unknown_anytype test0_any;
- // CHECK: load i32* @test0_any
+ // COMMON: load i32* @test0_any
return (int) test0_any;
}
int test1() {
extern __unknown_anytype test1_any();
- // CHECK: call i32 @_Z9test1_anyv()
+ // COMMON: call i32 @_Z9test1_anyv()
return (int) test1_any();
}
extern "C" __unknown_anytype test2_any(...);
float test2() {
- // CHECK: call float (...)* @test2_any(double {{[^,]+}})
+ // X86_64: call float (double, ...)* @test2_any(double {{[^,]+}})
+ // I386: call float (double, ...)* @test2_any(double {{[^,]+}})
return (float) test2_any(0.5f);
}
extern "C" __unknown_anytype test2a_any(...);
float test2a() {
- // CHECK: call float (...)* @test2a_any(float {{[^,]+}})
+ // X86_64: call float (float, ...)* @test2a_any(float {{[^,]+}})
+ // I386: call float (float, ...)* @test2a_any(float {{[^,]+}})
return (float) test2a_any((float) 0.5f);
}
float test3() {
extern __unknown_anytype test3_any;
- // CHECK: [[FN:%.*]] = load float (i32)** @test3_any,
- // CHECK: call float [[FN]](i32 5)
+ // COMMON: [[FN:%.*]] = load float (i32)** @test3_any,
+ // COMMON: call float [[FN]](i32 5)
return ((float(*)(int)) test3_any)(5);
}
@@ -36,22 +48,22 @@ namespace test4 {
extern __unknown_anytype test4_any2;
int test() {
- // CHECK: load i32* @_ZN5test410test4_any1E
- // CHECK: load i8* @_ZN5test410test4_any2E
+ // COMMON: load i32* @_ZN5test410test4_any1E
+ // COMMON: load i8* @_ZN5test410test4_any2E
return (int) test4_any1 + (char) test4_any2;
}
}
extern "C" __unknown_anytype test5_any();
void test5() {
- // CHECK: call void @test5_any()
+ // COMMON: call void @test5_any()
return (void) test5_any();
}
extern "C" __unknown_anytype test6_any(float *);
long test6() {
- // CHECK: call i64 @test6_any(float* null)
- return (long) test6_any(0);
+ // COMMON: call i64 @test6_any(float* null)
+ return (long long) test6_any(0);
}
struct Test7 {
@@ -59,7 +71,7 @@ struct Test7 {
};
extern "C" __unknown_anytype test7_any(int);
Test7 test7() {
- // CHECK: call void @test7_any({{%.*}}* sret {{%.*}}, i32 5)
+ // COMMON: call void @test7_any({{%.*}}* sret {{%.*}}, i32 5)
return (Test7) test7_any(5);
}
@@ -71,29 +83,35 @@ struct Test8 {
};
void Test8::test() {
float f;
- // CHECK: call i32 @_ZN5Test83fooEv(
+ // COMMON: call i32 @_ZN5Test83fooEv(
f = (int) foo();
- // CHECK: call i32 @_ZN5Test83fooEi(
+ // COMMON: call i32 @_ZN5Test83fooEi(
f = (int) foo(5);
- // CHECK: call i32 @_ZN5Test83fooEv(
+ // COMMON: call i32 @_ZN5Test83fooEv(
f = (float) this->foo();
- // CHECK: call i32 @_ZN5Test83fooEi(
+ // COMMON: call i32 @_ZN5Test83fooEi(
f = (float) this->foo(5);
}
void test8(Test8 *p) {
double d;
- // CHECK: call i32 @_ZN5Test83fooEv(
+ // COMMON: call i32 @_ZN5Test83fooEv(
d = (double) p->foo();
- // CHECK: call i32 @_ZN5Test83fooEi(
+ // COMMON: call i32 @_ZN5Test83fooEi(
d = (double) p->foo(5);
- // CHECK: call i32 @_ZN5Test83fooEv(
+ // COMMON: call i32 @_ZN5Test83fooEv(
d = (bool) (*p).foo();
- // CHECK: call i32 @_ZN5Test83fooEi(
+ // COMMON: call i32 @_ZN5Test83fooEi(
d = (bool) (*p).foo(5);
}
extern "C" __unknown_anytype test9_foo;
void *test9() {
- // CHECK: ret i8* bitcast (i32* @test9_foo to i8*)
+ // COMMON: ret i8* bitcast (i32* @test9_foo to i8*)
return (int*) &test9_foo;
}
+
+// Don't explode on this.
+extern "C" __unknown_anytype test10_any(...);
+void test10() {
+ (void) test10_any(), (void) test10_any();
+}
diff --git a/test/CodeGenCXX/value-init.cpp b/test/CodeGenCXX/value-init.cpp
index 60dca99045ff..fad459b481bf 100644
--- a/test/CodeGenCXX/value-init.cpp
+++ b/test/CodeGenCXX/value-init.cpp
@@ -74,7 +74,7 @@ namespace ptrmem {
int S::*mem2;
};
- // CHECK: define i32 @_ZN6ptrmem4testEPNS_1SE
+ // CHECK-LABEL: define i32 @_ZN6ptrmem4testEPNS_1SE
int test(S *s) {
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64
// CHECK: getelementptr
@@ -99,7 +99,7 @@ struct Test2 {
struct Test3 : public Test { };
-// CHECK: define void @_ZN6PR98011fEv
+// CHECK-LABEL: define void @_ZN6PR98011fEv
void f() {
// CHECK-NOT: call void @llvm.memset.p0i8.i64
// CHECK: call void @_ZN6PR98014TestC1Ei
@@ -131,7 +131,7 @@ void f() {
namespace zeroinit {
struct S { int i; };
- // CHECK: define i32 @_ZN8zeroinit4testEv()
+ // CHECK-LABEL: define i32 @_ZN8zeroinit4testEv()
int test() {
// CHECK: call void @llvm.memset.p0i8.i64
// CHECK: ret i32 0
@@ -148,7 +148,7 @@ namespace zeroinit {
void f();
};
- // CHECK: define void @_ZN8zeroinit9testX0_X1Ev
+ // CHECK-LABEL: define void @_ZN8zeroinit9testX0_X1Ev
void testX0_X1() {
// CHECK: call void @llvm.memset.p0i8.i64
// CHECK-NEXT: call void @_ZN8zeroinit2X1C1Ev
@@ -169,7 +169,7 @@ namespace zeroinit {
};
- // CHECK: define void @_ZN8zeroinit9testX0_X3Ev
+ // CHECK-LABEL: define void @_ZN8zeroinit9testX0_X3Ev
void testX0_X3() {
// CHECK-NOT: call void @llvm.memset
// CHECK: call void @_ZN8zeroinit2X3IiEC1Ev
@@ -201,7 +201,7 @@ namespace test6 {
void test() {
A arr[10][20] = { 5 };
};
- // CHECK: define void @_ZN5test64testEv()
+ // CHECK-LABEL: define void @_ZN5test64testEv()
// CHECK: [[ARR:%.*]] = alloca [10 x [20 x [[A:%.*]]]],
// CHECK-NEXT: [[INNER:%.*]] = getelementptr inbounds [10 x [20 x [[A]]]]* [[ARR]], i64 0, i64 0
@@ -243,7 +243,7 @@ namespace PR11124 {
struct B : virtual A { int b; };
struct C : B { C(); };
C::C() : A(3), B() {}
- // CHECK: define void @_ZN7PR111241CC1Ev
+ // CHECK-LABEL: define void @_ZN7PR111241CC1Ev
// CHECK: call void @llvm.memset.p0i8.i64(i8* {{.*}}, i8 0, i64 12, i32 8, i1 false)
// CHECK-NEXT: call void @_ZN7PR111241BC2Ev
// Make sure C::C doesn't overwrite parts of A while it is zero-initializing B
@@ -251,18 +251,18 @@ namespace PR11124 {
struct B2 : virtual A { int B::*b; };
struct C2 : B2 { C2(); };
C2::C2() : A(3), B2() {}
- // CHECK: define void @_ZN7PR111242C2C1Ev
+ // CHECK-LABEL: define void @_ZN7PR111242C2C1Ev
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.*}}, i8* {{.*}}, i64 16, i32 8, i1 false)
// CHECK-NEXT: call void @_ZN7PR111242B2C2Ev
}
// Ensure we produce an i1 here, and don't assert.
-// CHECK: define void @_Z9r170806_bv(
+// CHECK-LABEL: define void @_Z9r170806_bv(
// CHECK: call void @_Z9r170806_ab(i1 zeroext false)
void r170806_a(bool b = bool());
void r170806_b() { r170806_a(); }
-// CHECK: define linkonce_odr void @_ZN8zeroinit2X3IiEC2Ev(%"struct.zeroinit::X3"* %this) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN8zeroinit2X3IiEC2Ev(%"struct.zeroinit::X3"* %this) unnamed_addr
// CHECK: call void @llvm.memset.p0i8.i64
// CHECK-NEXT: call void @_ZN8zeroinit2X2IiEC2Ev
// CHECK-NEXT: ret void
diff --git a/test/CodeGenCXX/vararg-conversion-ctor.cpp b/test/CodeGenCXX/vararg-conversion-ctor.cpp
index a49b1dba9961..e496f6dcd116 100644
--- a/test/CodeGenCXX/vararg-conversion-ctor.cpp
+++ b/test/CodeGenCXX/vararg-conversion-ctor.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm %s -o %t-64.ll
-// RUN: FileCheck -check-prefix LPLL64 --input-file=%t-64.ll %s
+// RUN: FileCheck -check-prefix CHECK-LPLL64 --input-file=%t-64.ll %s
extern "C" int printf(...);
diff --git a/test/CodeGenCXX/vararg-non-pod.cpp b/test/CodeGenCXX/vararg-non-pod.cpp
index 6c6f459ce505..9497179ddf05 100644
--- a/test/CodeGenCXX/vararg-non-pod.cpp
+++ b/test/CodeGenCXX/vararg-non-pod.cpp
@@ -8,7 +8,7 @@ struct X {
void vararg(...);
-// CHECK: define void @_Z4test1X
+// CHECK-LABEL: define void @_Z4test1X
void test(X x) {
// CHECK: call void @llvm.trap()
vararg(x);
diff --git a/test/CodeGenCXX/varargs.cpp b/test/CodeGenCXX/varargs.cpp
index af34336a0ae2..31bbee9863a5 100644
--- a/test/CodeGenCXX/varargs.cpp
+++ b/test/CodeGenCXX/varargs.cpp
@@ -7,7 +7,7 @@ namespace test0 {
// though there is no way to do a va_begin. Otherwise, the optimizer
// will warn about 'dropped arguments' at the call site.
- // CHECK: define i32 @_ZN5test05test1Ez(...)
+ // CHECK-LABEL: define i32 @_ZN5test05test1Ez(...)
int test1(...) {
return -1;
}
@@ -30,7 +30,7 @@ namespace test1 {
A x;
foo(x);
}
- // CHECK: define void @_ZN5test14testEv()
+ // CHECK-LABEL: define void @_ZN5test14testEv()
// CHECK: [[X:%.*]] = alloca [[A:%.*]], align 4
// CHECK-NEXT: [[TMP:%.*]] = alloca [[A]], align 4
// CHECK-NEXT: [[T0:%.*]] = bitcast [[A]]* [[TMP]] to i8*
diff --git a/test/CodeGenCXX/variadic-templates.cpp b/test/CodeGenCXX/variadic-templates.cpp
index c56bec33a0f8..4974b6517b89 100644
--- a/test/CodeGenCXX/variadic-templates.cpp
+++ b/test/CodeGenCXX/variadic-templates.cpp
@@ -5,7 +5,7 @@ int get_num_types(Types...) {
return sizeof...(Types);
}
-// CHECK: define weak_odr i32 @_Z13get_num_typesIJifdEEiDpT_
+// CHECK-LABEL: define weak_odr i32 @_Z13get_num_typesIJifdEEiDpT_
// CHECK: ret i32 3
template int get_num_types(int, float, double);
@@ -13,7 +13,7 @@ template int get_num_types(int, float, double);
namespace test1 {
template <class... T> void foo() {
int values[sizeof...(T)+1] = { T::value... };
- // CHECK: define linkonce_odr void @_ZN5test13fooIJEEEvv()
+ // CHECK-LABEL: define linkonce_odr void @_ZN5test13fooIJEEEvv()
// CHECK: alloca [1 x i32], align 4
}
diff --git a/test/CodeGenCXX/virt-dtor-gen.cpp b/test/CodeGenCXX/virt-dtor-gen.cpp
index 1a6c583c34f2..78a0b8193d74 100644
--- a/test/CodeGenCXX/virt-dtor-gen.cpp
+++ b/test/CodeGenCXX/virt-dtor-gen.cpp
@@ -7,4 +7,4 @@ class Foo {
};
Foo::~Foo() {}
-// CHECK: define void @_ZN3FooD0Ev(%class.Foo* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN3FooD0Ev(%class.Foo* %this) unnamed_addr
diff --git a/test/CodeGenCXX/virtual-base-cast.cpp b/test/CodeGenCXX/virtual-base-cast.cpp
index f469636b2265..40e68f672232 100644
--- a/test/CodeGenCXX/virtual-base-cast.cpp
+++ b/test/CodeGenCXX/virtual-base-cast.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -emit-llvm %s -o - -triple i686-pc-linux-gnu | FileCheck %s
+// RUN: %clang_cc1 -cxx-abi microsoft -emit-llvm %s -o - -triple i686-pc-win32 | FileCheck -check-prefix MSVC %s
struct A { int a; virtual int aa(); };
struct B { int b; virtual int bb(); };
@@ -17,6 +18,16 @@ A* a() { return x; }
// CHECK: load i32* [[CASTVBASEOFFSETPTRA]]
// CHECK: }
+// MSVC: @"\01?a@@YAPAUA@@XZ"() [[NUW:#[0-9]+]] {
+// MSVC: %[[vbptr_off:.*]] = getelementptr inbounds i8* {{.*}}, i32 0
+// MSVC: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to i8**
+// MSVC: %[[vbtable:.*]] = load i8** %[[vbptr]]
+// MSVC: %[[entry:.*]] = getelementptr inbounds i8* {{.*}}, i32 4
+// MSVC: %[[entry_i32:.*]] = bitcast i8* %[[entry]] to i32*
+// MSVC: %[[offset:.*]] = load i32* %[[entry_i32]]
+// MSVC: add nsw i32 0, %[[offset]]
+// MSVC: }
+
B* b() { return x; }
// CHECK: @_Z1bv() [[NUW]]
// CHECK: [[VBASEOFFSETPTRA:%[a-zA-Z0-9\.]+]] = getelementptr i8* {{.*}}, i64 -20
@@ -24,6 +35,18 @@ B* b() { return x; }
// CHECK: load i32* [[CASTVBASEOFFSETPTRA]]
// CHECK: }
+// Same as 'a' except we use a different vbtable offset.
+// MSVC: @"\01?b@@YAPAUB@@XZ"() [[NUW:#[0-9]+]] {
+// MSVC: %[[vbptr_off:.*]] = getelementptr inbounds i8* {{.*}}, i32 0
+// MSVC: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to i8**
+// MSVC: %[[vbtable:.*]] = load i8** %[[vbptr]]
+// MSVC: %[[entry:.*]] = getelementptr inbounds i8* {{.*}}, i32 8
+// MSVC: %[[entry_i32:.*]] = bitcast i8* %[[entry]] to i32*
+// MSVC: %[[offset:.*]] = load i32* %[[entry_i32]]
+// MSVC: add nsw i32 0, %[[offset]]
+// MSVC: }
+
+
BB* c() { return x; }
// CHECK: @_Z1cv() [[NUW]]
// CHECK: [[VBASEOFFSETPTRC:%[a-zA-Z0-9\.]+]] = getelementptr i8* {{.*}}, i64 -24
@@ -32,4 +55,35 @@ BB* c() { return x; }
// CHECK: add i32 [[VBASEOFFSETC]], 8
// CHECK: }
+// Same as 'a' except we use a different vbtable offset.
+// MSVC: @"\01?c@@YAPAUBB@@XZ"() [[NUW:#[0-9]+]] {
+// MSVC: %[[vbptr_off:.*]] = getelementptr inbounds i8* {{.*}}, i32 0
+// MSVC: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to i8**
+// MSVC: %[[vbtable:.*]] = load i8** %[[vbptr]]
+// MSVC: %[[entry:.*]] = getelementptr inbounds i8* {{.*}}, i32 16
+// MSVC: %[[entry_i32:.*]] = bitcast i8* %[[entry]] to i32*
+// MSVC: %[[offset:.*]] = load i32* %[[entry_i32]]
+// MSVC: add nsw i32 0, %[[offset]]
+// MSVC: }
+
+// Put the vbptr at a non-zero offset inside a non-virtual base.
+struct E { int e; };
+struct F : E, D { int f; };
+
+F* y;
+
+BB* d() { return y; }
+
+// Same as 'c' except the vbptr offset is 4, changing the initial GEP and the
+// final add.
+// MSVC: @"\01?d@@YAPAUBB@@XZ"() [[NUW:#[0-9]+]] {
+// MSVC: %[[vbptr_off:.*]] = getelementptr inbounds i8* {{.*}}, i32 4
+// MSVC: %[[vbptr:.*]] = bitcast i8* %[[vbptr_off]] to i8**
+// MSVC: %[[vbtable:.*]] = load i8** %[[vbptr]]
+// MSVC: %[[entry:.*]] = getelementptr inbounds i8* {{.*}}, i32 16
+// MSVC: %[[entry_i32:.*]] = bitcast i8* %[[entry]] to i32*
+// MSVC: %[[offset:.*]] = load i32* %[[entry_i32]]
+// MSVC: add nsw i32 4, %[[offset]]
+// MSVC: }
+
// CHECK: attributes [[NUW]] = { nounwind{{.*}} }
diff --git a/test/CodeGenCXX/virtual-base-destructor-call.cpp b/test/CodeGenCXX/virtual-base-destructor-call.cpp
index 2424d218d6b7..5014eaf2643b 100644
--- a/test/CodeGenCXX/virtual-base-destructor-call.cpp
+++ b/test/CodeGenCXX/virtual-base-destructor-call.cpp
@@ -18,34 +18,34 @@ int main() {
// basic_iostream's complete dtor calls its base dtor, then its
// virtual base's dtor.
-// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED1Ev(%struct.basic_iostream* %this) unnamed_addr
+// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED1Ev(%struct.basic_iostream* {{.*}}%this) unnamed_addr
// CHECK: call {{.*}} @_ZN14basic_iostreamIcED2Ev
// CHECK: call {{.*}} @_ZN9basic_iosD2Ev
// basic_iostream's base dtor calls its non-virtual base dtor.
-// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED2Ev(%struct.basic_iostream* %this, i8** %vtt) unnamed_addr
+// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED2Ev(%struct.basic_iostream* {{.*}}%this, i8** %vtt) unnamed_addr
// CHECK: call {{.*}} @_ZN13basic_istreamIcED2Ev
// CHECK: }
-// basic_iostream's deleting dtor calls its complete dtor, then
-// operator delete().
-// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED0Ev(%struct.basic_iostream* %this) unnamed_addr
-// CHECK: call {{.*}} @_ZN14basic_iostreamIcED1Ev
-// CHECK: call {{.*}} @_ZdlPv
-
// basic_istream's complete dtor calls the base dtor,
// then its virtual base's base dtor.
-// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED1Ev(%struct.basic_istream* %this) unnamed_addr
+// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED1Ev(%struct.basic_istream* {{.*}}%this) unnamed_addr
// CHECK: call {{.*}} @_ZN13basic_istreamIcED2Ev
// CHECK: call {{.*}} @_ZN9basic_iosD2Ev
// basic_istream's deleting dtor calls the complete dtor, then
// operator delete().
-// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED0Ev(%struct.basic_istream* %this) unnamed_addr
+// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED0Ev(%struct.basic_istream* {{.*}}%this) unnamed_addr
// CHECK: call {{.*}} @_ZN13basic_istreamIcED1Ev
// CHECK: call {{.*}} @_ZdlPv
+// basic_iostream's deleting dtor calls its complete dtor, then
+// operator delete().
+// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED0Ev(%struct.basic_iostream* {{.*}}%this) unnamed_addr
+// CHECK: call {{.*}} @_ZN14basic_iostreamIcED1Ev
+// CHECK: call {{.*}} @_ZdlPv
+
// basic_istream's base dtor is a no-op.
-// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED2Ev(%struct.basic_istream* %this, i8** %vtt) unnamed_addr
+// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED2Ev(%struct.basic_istream* {{.*}}%this, i8** %vtt) unnamed_addr
// CHECK-NOT: call
// CHECK: }
diff --git a/test/CodeGenCXX/virtual-bases.cpp b/test/CodeGenCXX/virtual-bases.cpp
index c9f13f853d1b..2878e95b52cd 100644
--- a/test/CodeGenCXX/virtual-bases.cpp
+++ b/test/CodeGenCXX/virtual-bases.cpp
@@ -5,23 +5,23 @@ struct A {
};
// CHECK: @_ZN1AC1Ev = alias {{.*}} @_ZN1AC2Ev
-// CHECK: define void @_ZN1AC2Ev(%struct.A* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN1AC2Ev(%struct.A* %this) unnamed_addr
A::A() { }
struct B : virtual A {
B();
};
-// CHECK: define void @_ZN1BC1Ev(%struct.B* %this) unnamed_addr
-// CHECK: define void @_ZN1BC2Ev(%struct.B* %this, i8** %vtt) unnamed_addr
+// CHECK-LABEL: define void @_ZN1BC1Ev(%struct.B* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN1BC2Ev(%struct.B* %this, i8** %vtt) unnamed_addr
B::B() { }
struct C : virtual A {
C(bool);
};
-// CHECK: define void @_ZN1CC1Eb(%struct.C* %this, i1 zeroext) unnamed_addr
-// CHECK: define void @_ZN1CC2Eb(%struct.C* %this, i8** %vtt, i1 zeroext) unnamed_addr
+// CHECK-LABEL: define void @_ZN1CC1Eb(%struct.C* %this, i1 zeroext) unnamed_addr
+// CHECK-LABEL: define void @_ZN1CC2Eb(%struct.C* %this, i8** %vtt, i1 zeroext) unnamed_addr
C::C(bool) { }
// PR6251
@@ -39,7 +39,7 @@ struct D : B, C {
D();
};
-// CHECK: define void @_ZN6PR62511DC1Ev(%"struct.PR6251::D"* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN6PR62511DC1Ev(%"struct.PR6251::D"* %this) unnamed_addr
// CHECK: call void @_ZN6PR62511AIcEC2Ev
// CHECK-NOT: call void @_ZN6PR62511AIcEC2Ev
// CHECK: ret void
diff --git a/test/CodeGenCXX/virtual-destructor-calls.cpp b/test/CodeGenCXX/virtual-destructor-calls.cpp
index 7ef50b23fa7c..ae3704f36928 100644
--- a/test/CodeGenCXX/virtual-destructor-calls.cpp
+++ b/test/CodeGenCXX/virtual-destructor-calls.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin10 -mconstructor-aliases | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin10 -mconstructor-aliases -O1 -disable-llvm-optzns | FileCheck %s
struct Member {
~Member();
@@ -21,12 +21,12 @@ struct B : A {
// CHECK: @_ZN1CD2Ev = alias bitcast {{.*}} @_ZN1BD2Ev
// Deleting dtor: defers to the complete dtor.
-// CHECK: define void @_ZN1BD0Ev(%struct.B* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN1BD0Ev(%struct.B* %this) unnamed_addr
// CHECK: call void @_ZN1BD1Ev
// CHECK: call void @_ZdlPv
// Base dtor: actually calls A's base dtor.
-// CHECK: define void @_ZN1BD2Ev(%struct.B* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN1BD2Ev(%struct.B* %this) unnamed_addr
// CHECK: call void @_ZN6MemberD1Ev
// CHECK: call void @_ZN1AD2Ev
@@ -41,7 +41,7 @@ C::~C() { }
// Complete dtor: just an alias (checked above).
// Deleting dtor: defers to the complete dtor.
-// CHECK: define void @_ZN1CD0Ev(%struct.C* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN1CD0Ev(%struct.C* %this) unnamed_addr
// CHECK: call void @_ZN1CD1Ev
// CHECK: call void @_ZdlPv
diff --git a/test/CodeGenCXX/virtual-functions-incomplete-types.cpp b/test/CodeGenCXX/virtual-functions-incomplete-types.cpp
index afa658f7d374..624c89dcdae4 100644
--- a/test/CodeGenCXX/virtual-functions-incomplete-types.cpp
+++ b/test/CodeGenCXX/virtual-functions-incomplete-types.cpp
@@ -9,7 +9,7 @@ struct B {
void B::f() { }
-// CHECK: define i32 @_ZN1D1gEv(%struct.D* %this)
+// CHECK-LABEL: define i32 @_ZN1D1gEv(%struct.D* %this)
// CHECK: declare void @_ZN1B1gEv()
struct C;
diff --git a/test/CodeGenCXX/visibility-hidden-extern-templates.cpp b/test/CodeGenCXX/visibility-hidden-extern-templates.cpp
index 7629b77c2cee..549e674740ff 100644
--- a/test/CodeGenCXX/visibility-hidden-extern-templates.cpp
+++ b/test/CodeGenCXX/visibility-hidden-extern-templates.cpp
@@ -14,13 +14,13 @@ extern template struct X<char>;
// <rdar://problem/8109763>
void test_X(X<int> xi, X<char> xc) {
- // CHECK: define weak_odr hidden void @_ZN1XIiE1fEv
+ // CHECK-LABEL: define weak_odr hidden void @_ZN1XIiE1fEv
xi.f();
- // CHECK: define weak_odr hidden void @_ZN1XIiE1gEv
+ // CHECK-LABEL: define weak_odr hidden void @_ZN1XIiE1gEv
xi.g();
// CHECK: declare void @_ZN1XIcE1fEv
xc.f();
- // CHECK: define available_externally void @_ZN1XIcE1gEv
+ // CHECK-LABEL: define available_externally void @_ZN1XIcE1gEv
xc.g();
}
diff --git a/test/CodeGenCXX/visibility-inlines-hidden.cpp b/test/CodeGenCXX/visibility-inlines-hidden.cpp
index e5bc743e4da9..7c0757b2829a 100644
--- a/test/CodeGenCXX/visibility-inlines-hidden.cpp
+++ b/test/CodeGenCXX/visibility-inlines-hidden.cpp
@@ -37,31 +37,31 @@ struct __attribute__((visibility("default"))) X2 {
extern template struct X1<float>;
void use(X0 *x0, X1<int> *x1, X2 *x2, X1<float> *x3) {
- // CHECK: define linkonce_odr void @_ZN2X02f1Ev
+ // CHECK-LABEL: define linkonce_odr void @_ZN2X02f1Ev
x0->f1();
- // CHECK: define linkonce_odr hidden void @_ZN2X02f2Ev
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN2X02f2Ev
x0->f2();
- // CHECK: define linkonce_odr hidden void @_ZN2X02f3Ev
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN2X02f3Ev
x0->f3();
- // CHECK: define linkonce_odr hidden void @_ZN2X02f5Ev
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN2X02f5Ev
X0::f5();
- // CHECK: define linkonce_odr hidden void @_ZN2X02f6Ev
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN2X02f6Ev
x0->X0::f6();
- // CHECK: define linkonce_odr void @_ZN2X1IiE2f1Ev
+ // CHECK-LABEL: define linkonce_odr void @_ZN2X1IiE2f1Ev
x1->f1();
- // CHECK: define linkonce_odr hidden void @_ZN2X1IiE2f2Ev
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN2X1IiE2f2Ev
x1->f2();
- // CHECK: define linkonce_odr hidden void @_ZN2X1IiE2f3Ev
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN2X1IiE2f3Ev
x1->f3();
- // CHECK: define linkonce_odr hidden void @_ZN2X1IiE2f4Ev
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN2X1IiE2f4Ev
x1->f4();
- // CHECK: define linkonce_odr hidden void @_ZN2X1IiE2f5Ev
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN2X1IiE2f5Ev
X1<int>::f5();
- // CHECK: define linkonce_odr hidden void @_ZN2X1IiE2f6Ev
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN2X1IiE2f6Ev
x1->X1::f6();
- // CHECK: define linkonce_odr hidden void @_ZN2X22f2Ev
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN2X22f2Ev
x2->f2();
- // CHECK: define available_externally void @_ZN2X1IfE2f2Ev
+ // CHECK-LABEL: define available_externally void @_ZN2X1IfE2f2Ev
x3->f2();
}
@@ -95,7 +95,7 @@ namespace test2 {
ns::foo<arg>();
}
- // CHECK: define available_externally void @_ZN5test22ns3fooINS_1BINS_1AEEEEEvv()
+ // CHECK-LABEL: define available_externally void @_ZN5test22ns3fooINS_1BINS_1AEEEEEvv()
}
namespace PR11642 {
@@ -106,7 +106,7 @@ namespace PR11642 {
};
extern template class Foo<int>;
template class Foo<int>;
- // CHECK: define weak_odr i32 @_ZN7PR116423FooIiE3fooEi
+ // CHECK-LABEL: define weak_odr i32 @_ZN7PR116423FooIiE3fooEi
}
// Test that clang implements the new gcc behaviour for inline functions.
@@ -122,9 +122,9 @@ namespace test3 {
foo();
zed<int>();
}
- // CHECK: define weak_odr void @_ZN5test33zedIfEEvv
- // CHECK: define linkonce_odr hidden void @_ZN5test33fooEv
- // CHECK: define linkonce_odr hidden void @_ZN5test33zedIiEEvv
+ // CHECK-LABEL: define weak_odr void @_ZN5test33zedIfEEvv
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN5test33fooEv
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN5test33zedIiEEvv
}
namespace test4 {
@@ -133,7 +133,7 @@ namespace test4 {
void bar() {
foo();
}
- // CHECK: define available_externally void @_ZN5test43fooE
+ // CHECK-LABEL: define available_externally void @_ZN5test43fooE
}
namespace test5 {
diff --git a/test/CodeGenCXX/visibility-ms-compat.cpp b/test/CodeGenCXX/visibility-ms-compat.cpp
index 58a8fed62e04..25446cdf06f9 100644
--- a/test/CodeGenCXX/visibility-ms-compat.cpp
+++ b/test/CodeGenCXX/visibility-ms-compat.cpp
@@ -22,7 +22,7 @@ namespace test0 {
};
void A::foo() { bar(); }
- // CHECK: define hidden void @_ZN5test01A3fooEv()
+ // CHECK-LABEL: define hidden void @_ZN5test01A3fooEv()
// CHECK: declare void @_ZN5test01A3barEv()
const std::type_info &ti = typeid(A);
@@ -38,7 +38,7 @@ namespace test1 {
};
void A::foo() { bar(); }
- // CHECK: define hidden void @_ZN5test11A3fooEv()
+ // CHECK-LABEL: define hidden void @_ZN5test11A3fooEv()
// CHECK: declare hidden void @_ZN5test11A3barEv()
const std::type_info &ti = typeid(A);
@@ -54,7 +54,7 @@ namespace test2 {
};
void A::foo() { bar(); }
- // CHECK: define void @_ZN5test21A3fooEv()
+ // CHECK-LABEL: define void @_ZN5test21A3fooEv()
// CHECK: declare void @_ZN5test21A3barEv()
const std::type_info &ti = typeid(A);
@@ -71,7 +71,7 @@ namespace test3 {
};
template void B<A>::foo();
- // CHECK: define weak_odr hidden void @_ZN5test31BINS_1AEE3fooEv()
+ // CHECK-LABEL: define weak_odr hidden void @_ZN5test31BINS_1AEE3fooEv()
// CHECK: declare void @_ZN5test31BINS_1AEE3barEv()
const std::type_info &ti = typeid(B<A>);
@@ -87,7 +87,7 @@ namespace test4 {
};
template void B<A>::foo();
- // CHECK: define weak_odr void @_ZN5test41BINS_1AEE3fooEv()
+ // CHECK-LABEL: define weak_odr void @_ZN5test41BINS_1AEE3fooEv()
// CHECK: declare void @_ZN5test41BINS_1AEE3barEv()
const std::type_info &ti = typeid(B<A>);
@@ -103,7 +103,7 @@ namespace test5 {
};
template void B<A>::foo();
- // CHECK: define weak_odr hidden void @_ZN5test51BINS_1AEE3fooEv()
+ // CHECK-LABEL: define weak_odr hidden void @_ZN5test51BINS_1AEE3fooEv()
// CHECK: declare hidden void @_ZN5test51BINS_1AEE3barEv()
const std::type_info &ti = typeid(B<A>);
diff --git a/test/CodeGenCXX/visibility.cpp b/test/CodeGenCXX/visibility.cpp
index 87add446ba7b..1c4d5bb8e7a8 100644
--- a/test/CodeGenCXX/visibility.cpp
+++ b/test/CodeGenCXX/visibility.cpp
@@ -139,12 +139,16 @@ namespace test27 {
// CHECK: @_ZGVZN6Test193fooIiEEvvE1a = linkonce_odr global i64
// CHECK-HIDDEN: @_ZZN6Test193fooIiEEvvE1a = linkonce_odr hidden global
// CHECK-HIDDEN: @_ZGVZN6Test193fooIiEEvvE1a = linkonce_odr hidden global i64
+// CHECK: @_ZZN6test681fC1EvE4test = linkonce_odr global
+// CHECK: @_ZGVZN6test681fC1EvE4test = linkonce_odr global
+// CHECK-HIDDEN: @_ZZN6test681fC1EvE4test = linkonce_odr hidden global
+// CHECK-HIDDEN: @_ZGVZN6test681fC1EvE4test = linkonce_odr hidden global
// CHECK-HIDDEN: @_ZTVN6Test161AIcEE = external unnamed_addr constant
// CHECK-HIDDEN: @_ZTTN6Test161AIcEE = external unnamed_addr constant
// CHECK: @_ZTVN5Test63fooE = linkonce_odr hidden unnamed_addr constant
namespace Test1 {
- // CHECK: define hidden void @_ZN5Test11fEv
+ // CHECK-LABEL: define hidden void @_ZN5Test11fEv
void HIDDEN f() { }
}
@@ -155,7 +159,7 @@ namespace Test2 {
};
// A::f is a member function of a hidden class.
- // CHECK: define hidden void @_ZN5Test21A1fEv
+ // CHECK-LABEL: define hidden void @_ZN5Test21A1fEv
void A::f() { }
}
@@ -167,7 +171,7 @@ namespace Test3 {
};
// B is a nested class where its parent class is hidden.
- // CHECK: define hidden void @_ZN5Test31A1B1fEv
+ // CHECK-LABEL: define hidden void @_ZN5Test31A1B1fEv
void A::B::f() { }
}
@@ -175,7 +179,7 @@ namespace Test4 HIDDEN {
int VariableInHiddenNamespace = 10;
// Test4::g is in a hidden namespace.
- // CHECK: define hidden void @_ZN5Test41gEv
+ // CHECK-LABEL: define hidden void @_ZN5Test41gEv
void g() { }
struct DEFAULT A {
@@ -183,7 +187,7 @@ namespace Test4 HIDDEN {
};
// A has default visibility.
- // CHECK: define void @_ZN5Test41A1fEv
+ // CHECK-LABEL: define void @_ZN5Test41A1fEv
void A::f() { }
}
@@ -191,13 +195,13 @@ namespace Test5 {
namespace NS HIDDEN {
// f is in NS which is hidden.
- // CHECK: define hidden void @_ZN5Test52NS1fEv()
+ // CHECK-LABEL: define hidden void @_ZN5Test52NS1fEv()
void f() { }
}
namespace NS {
// g is in NS, but this NS decl is not hidden.
- // CHECK: define void @_ZN5Test52NS1gEv
+ // CHECK-LABEL: define void @_ZN5Test52NS1gEv
void g() { }
}
}
@@ -231,7 +235,7 @@ namespace Test7 {
class B : public A {};
B b; // top of file
- // CHECK: define linkonce_odr hidden void @_ZN5Test74ArefILZNS_1aEEE3fooEv()
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN5Test74ArefILZNS_1aEEE3fooEv()
void test() {
Aref<a>::foo();
}
@@ -240,7 +244,7 @@ namespace Test7 {
namespace Test8 {
void foo();
void bar() {}
- // CHECK-HIDDEN: define hidden void @_ZN5Test83barEv()
+ // CHECK-HIDDEN-LABEL: define hidden void @_ZN5Test83barEv()
// CHECK-HIDDEN: declare void @_ZN5Test83fooEv()
void test() {
@@ -256,8 +260,8 @@ namespace Test9 {
void DEFAULT test9_fun(struct A *a) { }
struct A DEFAULT test9_var; // above
}
- // CHECK: define void @test9_fun(
- // CHECK-HIDDEN: define void @test9_fun(
+ // CHECK-LABEL: define void @test9_fun(
+ // CHECK-HIDDEN-LABEL: define void @test9_fun(
void test() {
A a = test9_var;
@@ -273,8 +277,8 @@ namespace Test10 {
void foo(A*);
};
- // CHECK: define void @_ZN6Test101B3fooEPNS_1AE(
- // CHECK-HIDDEN: define void @_ZN6Test101B3fooEPNS_1AE(
+ // CHECK-LABEL: define void @_ZN6Test101B3fooEPNS_1AE(
+ // CHECK-HIDDEN-LABEL: define void @_ZN6Test101B3fooEPNS_1AE(
void B::foo(A*) {}
}
@@ -291,10 +295,10 @@ namespace Test11 {
a.bar();
}
- // CHECK: define linkonce_odr void @_ZN6Test111A3fooEv(
- // CHECK: define linkonce_odr void @_ZN6Test111A3barEv(
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN6Test111A3fooEv(
- // CHECK-HIDDEN: define linkonce_odr void @_ZN6Test111A3barEv(
+ // CHECK-LABEL: define linkonce_odr void @_ZN6Test111A3fooEv(
+ // CHECK-LABEL: define linkonce_odr void @_ZN6Test111A3barEv(
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6Test111A3fooEv(
+ // CHECK-HIDDEN-LABEL: define linkonce_odr void @_ZN6Test111A3barEv(
}
// Tested at top of file.
@@ -481,7 +485,7 @@ namespace Test20 {
static void test1();
};
- // CHECK: define hidden void @_ZN6Test201AILj0EE5test0Ev()
+ // CHECK-LABEL: define hidden void @_ZN6Test201AILj0EE5test0Ev()
void A<0>::test0() {}
// CHECK: declare hidden void @_ZN6Test201AILj0EE5test1Ev()
@@ -495,7 +499,7 @@ namespace Test20 {
static void test3();
};
- // CHECK: define void @_ZN6Test201AILj1EE5test2Ev()
+ // CHECK-LABEL: define void @_ZN6Test201AILj1EE5test2Ev()
void A<1>::test2() {}
// CHECK: declare void @_ZN6Test201AILj1EE5test3Ev()
@@ -511,7 +515,7 @@ namespace Test20 {
static void test5();
};
- // CHECK: define linkonce_odr hidden void @_ZN6Test201BINS_1AILj2EEEE5test4Ev()
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6Test201BINS_1AILj2EEEE5test4Ev()
void test4() {
B<A<2> >::test4();
}
@@ -529,7 +533,7 @@ namespace test21 {
DEFAULT void foo() {}
};
- // CHECK: define weak_odr void @_ZN6test211AILNS_2EnE0EE3fooEv(
+ // CHECK-LABEL: define weak_odr void @_ZN6test211AILNS_2EnE0EE3fooEv(
template void A<en>::foo();
}
@@ -556,13 +560,13 @@ namespace test22 {
B<A2>::bar();
}
// CHECK: declare void @_ZN6test221BINS_2A1EE3fooEv()
- // CHECK: define linkonce_odr void @_ZN6test221BINS_2A1EE3barEv()
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test221BINS_2A1EE3barEv()
// CHECK: declare void @_ZN6test221BINS_2A2EE3fooEv()
- // CHECK: define linkonce_odr void @_ZN6test221BINS_2A2EE3barEv()
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test221BINS_2A2EE3barEv()
// CHECK-HIDDEN: declare void @_ZN6test221BINS_2A1EE3fooEv()
- // CHECK-HIDDEN: define linkonce_odr void @_ZN6test221BINS_2A1EE3barEv()
+ // CHECK-HIDDEN-LABEL: define linkonce_odr void @_ZN6test221BINS_2A1EE3barEv()
// CHECK-HIDDEN: declare void @_ZN6test221BINS_2A2EE3fooEv()
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN6test221BINS_2A2EE3barEv()
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test221BINS_2A2EE3barEv()
}
namespace PR10113 {
@@ -573,14 +577,14 @@ namespace PR10113 {
};
}
template class foo::bar<char>;
- // CHECK: define weak_odr void @_ZN7PR101133foo3barIcE3zedEv
- // CHECK-HIDDEN: define weak_odr void @_ZN7PR101133foo3barIcE3zedEv
+ // CHECK-LABEL: define weak_odr void @_ZN7PR101133foo3barIcE3zedEv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN7PR101133foo3barIcE3zedEv
struct zed {
};
template class foo::bar<zed>;
- // CHECK: define weak_odr void @_ZN7PR101133foo3barINS_3zedEE3zedEv
- // CHECK-HIDDEN: define weak_odr hidden void @_ZN7PR101133foo3barINS_3zedEE3zedEv
+ // CHECK-LABEL: define weak_odr void @_ZN7PR101133foo3barINS_3zedEE3zedEv
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN7PR101133foo3barINS_3zedEE3zedEv
}
namespace PR11690 {
@@ -589,13 +593,13 @@ namespace PR11690 {
}
};
template class DEFAULT Class<char>;
- // CHECK: define weak_odr void @_ZNK7PR116905ClassIcE4sizeEv
- // CHECK-HIDDEN: define weak_odr void @_ZNK7PR116905ClassIcE4sizeEv
+ // CHECK-LABEL: define weak_odr void @_ZNK7PR116905ClassIcE4sizeEv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZNK7PR116905ClassIcE4sizeEv
template<class T> void Method() {}
template DEFAULT void Method<char>();
- // CHECK: define weak_odr void @_ZN7PR116906MethodIcEEvv
- // CHECK-HIDDEN: define weak_odr void @_ZN7PR116906MethodIcEEvv
+ // CHECK-LABEL: define weak_odr void @_ZN7PR116906MethodIcEEvv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN7PR116906MethodIcEEvv
}
namespace PR11690_2 {
@@ -610,8 +614,8 @@ namespace PR11690_2 {
struct baz {
};
template class foo::zed<baz>;
- // CHECK: define weak_odr void @_ZN9PR11690_23foo3zedINS_3bazENS0_3barEE3barEv
- // CHECK-HIDDEN: define weak_odr hidden void @_ZN9PR11690_23foo3zedINS_3bazENS0_3barEE3barEv
+ // CHECK-LABEL: define weak_odr void @_ZN9PR11690_23foo3zedINS_3bazENS0_3barEE3barEv
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN9PR11690_23foo3zedINS_3bazENS0_3barEE3barEv
}
namespace test23 {
@@ -629,8 +633,8 @@ namespace test23 {
X<A> y;
y.f();
}
- // CHECK: define linkonce_odr void @_ZN6test231XINS_1AEE1fEv
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN6test231XINS_1AEE1fEv
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test231XINS_1AEE1fEv
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test231XINS_1AEE1fEv
}
namespace PR12001 {
@@ -643,8 +647,8 @@ namespace PR12001 {
void f() {
Bind(Version());
}
- // CHECK: define linkonce_odr void @_ZN7PR120014BindINS_7VersionEEEvRKT_
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN7PR120014BindINS_7VersionEEEvRKT_
+ // CHECK-LABEL: define linkonce_odr void @_ZN7PR120014BindINS_7VersionEEEvRKT_
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN7PR120014BindINS_7VersionEEEvRKT_
}
namespace test24 {
@@ -659,8 +663,8 @@ namespace test24 {
S s;
s.mem<A>();
}
- // CHECK: define linkonce_odr void @_ZN6test241S3memINS_1AEEEvv
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN6test241S3memINS_1AEEEvv
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test241S3memINS_1AEEEvv
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test241S3memINS_1AEEEvv
}
namespace test26 {
@@ -672,8 +676,8 @@ namespace test26 {
template<>
void C<int>::f() { }
- // CHECK: define void @_ZN6test261CIiE1fEv
- // CHECK-HIDDEN: define void @_ZN6test261CIiE1fEv
+ // CHECK-LABEL: define void @_ZN6test261CIiE1fEv
+ // CHECK-HIDDEN-LABEL: define void @_ZN6test261CIiE1fEv
}
namespace test31 {
@@ -697,8 +701,8 @@ namespace test32 {
};
void A::B::baz() {
}
- // CHECK: define void @_ZN6test321A1B3bazEv
- // CHECK-HIDDEN: define void @_ZN6test321A1B3bazEv
+ // CHECK-LABEL: define void @_ZN6test321A1B3bazEv
+ // CHECK-HIDDEN-LABEL: define void @_ZN6test321A1B3bazEv
}
namespace test33 {
@@ -709,8 +713,8 @@ namespace test33 {
struct HIDDEN zed {
};
template class DEFAULT foo<zed>;
- // CHECK: define weak_odr void @_ZN6test333fooINS_3zedEE3barEv
- // CHECK-HIDDEN: define weak_odr void @_ZN6test333fooINS_3zedEE3barEv
+ // CHECK-LABEL: define weak_odr void @_ZN6test333fooINS_3zedEE3barEv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN6test333fooINS_3zedEE3barEv
}
namespace test34 {
@@ -719,8 +723,8 @@ namespace test34 {
template<class T>
void bar() {}
template DEFAULT void bar<foo>();
- // CHECK: define weak_odr void @_ZN6test343barINS_3fooEEEvv
- // CHECK-HIDDEN: define weak_odr void @_ZN6test343barINS_3fooEEEvv
+ // CHECK-LABEL: define weak_odr void @_ZN6test343barINS_3fooEEEvv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN6test343barINS_3fooEEEvv
}
namespace test35 {
@@ -737,8 +741,8 @@ namespace test35 {
template class foo<zed>;
class DEFAULT zed {
};
- // CHECK: define weak_odr void @_ZN6test353fooINS_3zedEE3barEv
- // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test353fooINS_3zedEE3barEv
+ // CHECK-LABEL: define weak_odr void @_ZN6test353fooINS_3zedEE3barEv
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test353fooINS_3zedEE3barEv
}
namespace test36 {
@@ -749,8 +753,8 @@ namespace test36 {
class DEFAULT S1 {};
struct HIDDEN S2 {};
template class foo<S1, S2>;
- // CHECK: define weak_odr hidden void @_ZN6test363fooINS_2S1ENS_2S2EE3barEv
- // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test363fooINS_2S1ENS_2S2EE3barEv
+ // CHECK-LABEL: define weak_odr hidden void @_ZN6test363fooINS_2S1ENS_2S2EE3barEv
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test363fooINS_2S1ENS_2S2EE3barEv
}
namespace test37 {
@@ -759,8 +763,8 @@ namespace test37 {
template<class T>
DEFAULT void bar() {}
template DEFAULT void bar<foo>();
- // CHECK: define weak_odr void @_ZN6test373barINS_3fooEEEvv
- // CHECK-HIDDEN: define weak_odr void @_ZN6test373barINS_3fooEEEvv
+ // CHECK-LABEL: define weak_odr void @_ZN6test373barINS_3fooEEEvv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN6test373barINS_3fooEEEvv
}
namespace test38 {
@@ -771,8 +775,8 @@ namespace test38 {
struct HIDDEN zed {
};
template class foo<zed>;
- // CHECK: define weak_odr hidden void @_ZN6test383fooINS_3zedEE3barEv
- // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test383fooINS_3zedEE3barEv
+ // CHECK-LABEL: define weak_odr hidden void @_ZN6test383fooINS_3zedEE3barEv
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test383fooINS_3zedEE3barEv
}
namespace test39 {
@@ -790,19 +794,19 @@ namespace test39 {
template void A<hidden_t>::B<hidden_t>::temp<default_t>();
template void A<hidden_t>::B<hidden_t>::temp<hidden_t>();
- // CHECK: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E6hiddenEv
- // CHECK: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E6noattrEv
- // CHECK: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempINS_9default_tEEEvv
+ // CHECK-LABEL: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E6hiddenEv
+ // CHECK-LABEL: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E6noattrEv
+ // CHECK-LABEL: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempINS_9default_tEEEvv
// GCC produces a default for this one. Why?
- // CHECK: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempIS1_EEvv
+ // CHECK-LABEL: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempIS1_EEvv
- // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E6hiddenEv
- // CHECK-HIDDEN: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E6noattrEv
- // CHECK-HIDDEN: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempINS_9default_tEEEvv
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E6hiddenEv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E6noattrEv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempINS_9default_tEEEvv
// GCC produces a default for this one. Why?
- // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempIS1_EEvv
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempIS1_EEvv
}
namespace test42 {
@@ -817,8 +821,8 @@ namespace test42 {
};
void bar<foo>::zed() {
}
- // CHECK: define void @_ZN6test423barINS_3fooEE3zedEv
- // CHECK-HIDDEN: define void @_ZN6test423barINS_3fooEE3zedEv
+ // CHECK-LABEL: define void @_ZN6test423barINS_3fooEE3zedEv
+ // CHECK-HIDDEN-LABEL: define void @_ZN6test423barINS_3fooEE3zedEv
}
namespace test43 {
@@ -830,8 +834,8 @@ namespace test43 {
template <>
DEFAULT void bar<foo>() {
}
- // CHECK: define void @_ZN6test433barINS_3fooEEEvv
- // CHECK-HIDDEN: define void @_ZN6test433barINS_3fooEEEvv
+ // CHECK-LABEL: define void @_ZN6test433barINS_3fooEEEvv
+ // CHECK-HIDDEN-LABEL: define void @_ZN6test433barINS_3fooEEEvv
}
namespace test44 {
@@ -844,8 +848,8 @@ namespace test44 {
}
template struct DEFAULT foo<bar>;
foo<bar> x;
- // CHECK: define internal void @_ZN6test443fooINS_12_GLOBAL__N_13barEEC1Ev
- // CHECK-HIDDEN: define internal void @_ZN6test443fooINS_12_GLOBAL__N_13barEEC1Ev
+ // CHECK-LABEL: define internal void @_ZN6test443fooINS_12_GLOBAL__N_13barEEC1Ev
+ // CHECK-HIDDEN-LABEL: define internal void @_ZN6test443fooINS_12_GLOBAL__N_13barEEC1Ev
}
namespace test45 {
@@ -861,8 +865,8 @@ namespace test45 {
}
template struct DEFAULT foo<int>::bar<zed>;
foo<int>::bar<zed> x;
- // CHECK: define internal void @_ZN6test453fooIiE3barINS_12_GLOBAL__N_13zedEEC1Ev
- // CHECK-HIDDEN: define internal void @_ZN6test453fooIiE3barINS_12_GLOBAL__N_13zedEEC1Ev
+ // CHECK-LABEL: define internal void @_ZN6test453fooIiE3barINS_12_GLOBAL__N_13zedEEC1Ev
+ // CHECK-HIDDEN-LABEL: define internal void @_ZN6test453fooIiE3barINS_12_GLOBAL__N_13zedEEC1Ev
}
namespace test46 {
@@ -876,8 +880,8 @@ namespace test46 {
void zed() {
foo<bar>();
}
- // CHECK: define internal void @_ZN6test463fooINS_12_GLOBAL__N_13barEEEvv
- // CHECK-HIDDEN: define internal void @_ZN6test463fooINS_12_GLOBAL__N_13barEEEvv
+ // CHECK-LABEL: define internal void @_ZN6test463fooINS_12_GLOBAL__N_13barEEEvv
+ // CHECK-HIDDEN-LABEL: define internal void @_ZN6test463fooINS_12_GLOBAL__N_13barEEEvv
}
namespace test47 {
@@ -893,8 +897,8 @@ namespace test47 {
void baz() {
foo::bar<zed>();
}
- // CHECK: define internal void @_ZN6test473foo3barINS_12_GLOBAL__N_13zedEEEvv
- // CHECK-HIDDEN: define internal void @_ZN6test473foo3barINS_12_GLOBAL__N_13zedEEEvv
+ // CHECK-LABEL: define internal void @_ZN6test473foo3barINS_12_GLOBAL__N_13zedEEEvv
+ // CHECK-HIDDEN-LABEL: define internal void @_ZN6test473foo3barINS_12_GLOBAL__N_13zedEEEvv
}
namespace test49 {
@@ -914,8 +918,8 @@ namespace test49 {
};
template void bar::zed<&x>();
- // CHECK: define weak_odr hidden void @_ZN6test493bar3zedIXadL_ZNS_1xEEEEEvv
- // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test493bar3zedIXadL_ZNS_1xEEEEEvv
+ // CHECK-LABEL: define weak_odr hidden void @_ZN6test493bar3zedIXadL_ZNS_1xEEEEEvv
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test493bar3zedIXadL_ZNS_1xEEEEEvv
}
namespace test50 {
@@ -932,8 +936,8 @@ namespace test50 {
}
};
template void bar<&x>::zed();
- // CHECK: define weak_odr hidden void @_ZN6test503barIXadL_ZNS_1xEEEE3zedEv
- // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test503barIXadL_ZNS_1xEEEE3zedEv
+ // CHECK-LABEL: define weak_odr hidden void @_ZN6test503barIXadL_ZNS_1xEEEE3zedEv
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test503barIXadL_ZNS_1xEEEE3zedEv
}
namespace test51 {
@@ -948,8 +952,8 @@ namespace test51 {
void DEFAULT zed() {
}
template void zed<&x>();
- // CHECK: define weak_odr hidden void @_ZN6test513zedIXadL_ZNS_1xEEEEEvv
- // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test513zedIXadL_ZNS_1xEEEEEvv
+ // CHECK-LABEL: define weak_odr hidden void @_ZN6test513zedIXadL_ZNS_1xEEEEEvv
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test513zedIXadL_ZNS_1xEEEEEvv
}
namespace test52 {
@@ -967,8 +971,8 @@ namespace test52 {
void f() {
zed<nullptr>();
}
- // CHECK: define internal void @_ZN6test523zedILPNS_12_GLOBAL__N_13fooE0EEEvv
- // CHECK-HIDDEN: define internal void @_ZN6test523zedILPNS_12_GLOBAL__N_13fooE0EEEvv
+ // CHECK-LABEL: define internal void @_ZN6test523zedILPNS_12_GLOBAL__N_13fooE0EEEvv
+ // CHECK-HIDDEN-LABEL: define internal void @_ZN6test523zedILPNS_12_GLOBAL__N_13fooE0EEEvv
}
namespace test53 {
@@ -1070,8 +1074,8 @@ namespace test58 {
bar<foo>::zed();
}
#pragma GCC visibility pop
- // CHECK: define linkonce_odr hidden void @_ZN6test583barINS_3fooEE3zedEv
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN6test583barINS_3fooEE3zedEv
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test583barINS_3fooEE3zedEv
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test583barINS_3fooEE3zedEv
}
namespace test59 {
@@ -1082,12 +1086,12 @@ namespace test59 {
void test() {}
void use() {
test<&g, &f>();
- // CHECK: define linkonce_odr hidden void @_ZN6test594testIXadL_ZNS_1gEvEEXadL_ZNS_1fEvEEEEvv
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN6test594testIXadL_ZNS_1gEvEEXadL_ZNS_1fEvEEEEvv
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test594testIXadL_ZNS_1gEvEEXadL_ZNS_1fEvEEEEvv
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test594testIXadL_ZNS_1gEvEEXadL_ZNS_1fEvEEEEvv
test<&f, &g>();
- // CHECK: define linkonce_odr hidden void @_ZN6test594testIXadL_ZNS_1fEvEEXadL_ZNS_1gEvEEEEvv
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN6test594testIXadL_ZNS_1fEvEEXadL_ZNS_1gEvEEEEvv
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test594testIXadL_ZNS_1fEvEEXadL_ZNS_1gEvEEEEvv
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test594testIXadL_ZNS_1fEvEEXadL_ZNS_1gEvEEEEvv
}
}
@@ -1100,12 +1104,12 @@ namespace test60 {
void test() {}
void use() {
test<a, b>();
- // CHECK: define linkonce_odr hidden void @_ZN6test604testINS_1aENS_1bEEEvv
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN6test604testINS_1aENS_1bEEEvv
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test604testINS_1aENS_1bEEEvv
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test604testINS_1aENS_1bEEEvv
test<b, a>();
- // CHECK: define linkonce_odr hidden void @_ZN6test604testINS_1bENS_1aEEEvv
- // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN6test604testINS_1bENS_1aEEEvv
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test604testINS_1bENS_1aEEEvv
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test604testINS_1bENS_1aEEEvv
}
}
@@ -1167,8 +1171,8 @@ namespace test63 {
A::foo<E0>();
A::B<E0>::foo();
}
- // CHECK: define linkonce_odr hidden void @_ZN6test631A3fooILNS_1EE0EEEvv()
- // CHECK: define linkonce_odr hidden void @_ZN6test631A1BILNS_1EE0EE3fooEv()
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test631A3fooILNS_1EE0EEEvv()
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test631A1BILNS_1EE0EE3fooEv()
}
// Don't ignore the visibility of template arguments just because we
@@ -1180,7 +1184,7 @@ namespace test64 {
};
template class B<A>;
- // CHECK: define weak_odr hidden void @_ZN6test641BINS_1AEE3fooEv()
+ // CHECK-LABEL: define weak_odr hidden void @_ZN6test641BINS_1AEE3fooEv()
}
namespace test65 {
@@ -1196,23 +1200,23 @@ namespace test65 {
static void foo() {}
};
- // CHECK: define void @_ZN6test651BINS_1AEE4funcEv()
+ // CHECK-LABEL: define void @_ZN6test651BINS_1AEE4funcEv()
template <> DEFAULT void B<A>::func() {}
- // CHECK: define void @_ZN6test651BINS_1AEE6funcT2IS1_EEvv()
+ // CHECK-LABEL: define void @_ZN6test651BINS_1AEE6funcT2IS1_EEvv()
template <> template <> DEFAULT void B<A>::funcT2<A>() {}
- // CHECK: define linkonce_odr void @_ZN6test651BINS_1AEE6funcT1IiEEvv()
- // CHECK: define linkonce_odr hidden void @_ZN6test651BINS_1AEE6funcT1IS1_EEvv()
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test651BINS_1AEE6funcT1IiEEvv()
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test651BINS_1AEE6funcT1IS1_EEvv()
template <> template <class T> DEFAULT void B<A>::funcT1() {}
- // CHECK: define linkonce_odr void @_ZN6test651BINS_1AEE5Inner3fooEv()
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test651BINS_1AEE5Inner3fooEv()
template <> struct DEFAULT B<A>::Inner {
static void foo() {}
};
- // CHECK: define linkonce_odr void @_ZN6test651BINS_1AEE6InnerTIiE3fooEv()
- // CHECK: define linkonce_odr hidden void @_ZN6test651BINS_1AEE6InnerTIS1_E3fooEv()
+ // CHECK-LABEL: define linkonce_odr void @_ZN6test651BINS_1AEE6InnerTIiE3fooEv()
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test651BINS_1AEE6InnerTIS1_E3fooEv()
template <> template <class U> struct DEFAULT B<A>::InnerT {
static void foo() {}
};
@@ -1236,8 +1240,8 @@ namespace test66 {
class foo;
class DEFAULT foo;
template struct barT<foo>;
- // CHECK: define weak_odr void @_ZN6test664barTINS_3fooEE3zedEv
- // CHECK-HIDDEN: define weak_odr void @_ZN6test664barTINS_3fooEE3zedEv
+ // CHECK-LABEL: define weak_odr void @_ZN6test664barTINS_3fooEE3zedEv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN6test664barTINS_3fooEE3zedEv
template <int* I>
struct DEFAULT barI {
@@ -1246,8 +1250,8 @@ namespace test66 {
extern int I;
extern int I DEFAULT;
template struct barI<&I>;
- // CHECK: define weak_odr void @_ZN6test664barIIXadL_ZNS_1IEEEE3zedEv
- // CHECK-HIDDEN: define weak_odr void @_ZN6test664barIIXadL_ZNS_1IEEEE3zedEv
+ // CHECK-LABEL: define weak_odr void @_ZN6test664barIIXadL_ZNS_1IEEEE3zedEv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN6test664barIIXadL_ZNS_1IEEEE3zedEv
typedef void (*fType)(void);
template<fType F>
@@ -1257,8 +1261,8 @@ namespace test66 {
void F();
void F() DEFAULT;
template struct barF<F>;
- // CHECK: define weak_odr void @_ZN6test664barFIXadL_ZNS_1FEvEEE3zedEv
- // CHECK-HIDDEN: define weak_odr void @_ZN6test664barFIXadL_ZNS_1FEvEEE3zedEv
+ // CHECK-LABEL: define weak_odr void @_ZN6test664barFIXadL_ZNS_1FEvEEE3zedEv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN6test664barFIXadL_ZNS_1FEvEEE3zedEv
}
namespace test67 {
@@ -1274,6 +1278,34 @@ namespace test67 {
class DEFAULT foo;
template struct bar<foo>;
- // CHECK: define weak_odr void @_ZN6test673barINS_3fooEE3zedEv
- // CHECK-HIDDEN: define weak_odr void @_ZN6test673barINS_3fooEE3zedEv
+ // CHECK-LABEL: define weak_odr void @_ZN6test673barINS_3fooEE3zedEv
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN6test673barINS_3fooEE3zedEv
+}
+
+namespace test68 {
+ class A { public: ~A(); };
+ class f {
+ public:
+ f() {
+ static A test;
+ }
+ };
+ void g() {
+ f a;
+ }
+ // Check lines at top of file.
+}
+
+namespace test69 {
+ // PR18174
+ namespace foo {
+ void f();
+ }
+ namespace foo {
+ void f() {};
+ }
+ namespace foo __attribute__((visibility("hidden"))) {
+ }
+ // CHECK-LABEL: define void @_ZN6test693foo1fEv
+ // CHECK-HIDDEN-LABEL: define hidden void @_ZN6test693foo1fEv
}
diff --git a/test/CodeGenCXX/vla.cpp b/test/CodeGenCXX/vla.cpp
index b523c769d541..b22f21c3faf3 100644
--- a/test/CodeGenCXX/vla.cpp
+++ b/test/CodeGenCXX/vla.cpp
@@ -16,7 +16,7 @@ int f() {
// rdar://problem/9506377
void test0(void *array, int n) {
- // CHECK: define void @_Z5test0Pvi(
+ // CHECK-LABEL: define void @_Z5test0Pvi(
// CHECK: [[ARRAY:%.*]] = alloca i8*, align 8
// CHECK-NEXT: [[N:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[REF:%.*]] = alloca i16*, align 8
diff --git a/test/CodeGenCXX/volatile.cpp b/test/CodeGenCXX/volatile.cpp
index 6ebb2f11fca5..38c8829347c2 100644
--- a/test/CodeGenCXX/volatile.cpp
+++ b/test/CodeGenCXX/volatile.cpp
@@ -11,7 +11,7 @@ namespace test0 {
volatile A *array;
- // CHECK: define void @_ZN5test04testENS_1AE(
+ // CHECK-LABEL: define void @_ZN5test04testENS_1AE(
void test(A t) {
// CHECK: [[ARR:%.*]] = load [[A:%.*]]** @_ZN5test05arrayE, align 8
// CHECK-NEXT: [[IDX:%.*]] = getelementptr inbounds [[A]]* [[ARR]], i64 0
@@ -24,7 +24,7 @@ namespace test0 {
namespace test1 {
volatile int *x;
- // CHECK: define void @_ZN5test14testEv()
+ // CHECK-LABEL: define void @_ZN5test14testEv()
void test() {
// CHECK: [[TMP:%.*]] = load i32** @_ZN5test11xE, align 8
// CHECK-NEXT: ret void
diff --git a/test/CodeGenCXX/vtable-available-externally.cpp b/test/CodeGenCXX/vtable-available-externally.cpp
index 693b36abe502..282bd2a172ad 100644
--- a/test/CodeGenCXX/vtable-available-externally.cpp
+++ b/test/CodeGenCXX/vtable-available-externally.cpp
@@ -1,19 +1,11 @@
-// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -O3 -o %t
+// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -o %t
// RUN: FileCheck --check-prefix=CHECK-TEST1 %s < %t
// RUN: FileCheck --check-prefix=CHECK-TEST2 %s < %t
// RUN: FileCheck --check-prefix=CHECK-TEST5 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-TEST7 %s < %t
#include <typeinfo>
-// Test1::A's key function (f) is not defined in this translation
-// unit, but in order to devirtualize calls, we emit the v-table with
-// available_externally linkage.
-//
-// There's no real reason to do this to the RTTI, though.
-
-// CHECK-TEST1: @_ZTVN5Test11AE = available_externally
-// CHECK-TEST1: @_ZTIN5Test11AE = external constant i8*
+// CHECK-TEST1: @_ZTVN5Test11AE = external unnamed_addr constant
namespace Test1 {
struct A {
@@ -28,7 +20,7 @@ void f(A* a) {
a->f();
};
-// CHECK: define void @_ZN5Test11gEv
+// CHECK-LABEL: define void @_ZN5Test11gEv
// CHECK: call void @_ZN5Test11A1fEv
void g() {
A a;
@@ -106,7 +98,7 @@ void f() {
}
// PR9130, test that we emit a definition of A::f.
-// CHECK-TEST5: define linkonce_odr void @_ZN5Test51A1fEv
+// CHECK-TEST5-LABEL: define linkonce_odr void @_ZN5Test51A1fEv
namespace Test5 {
struct A {
@@ -159,14 +151,4 @@ struct c11 : c10, c1{
struct c28 : virtual c11{
void f6 ();
};
-
-// CHECK-TEST7: define void @_ZN5Test79check_c28Ev
-// CHECK-TEST7: call void @_ZN5Test73c282f6Ev
-// CHECK-TEST7: ret void
-void check_c28 () {
- c28 obj;
- c11 *ptr = &obj;
- ptr->f6 ();
-}
-
}
diff --git a/test/CodeGenCXX/vtable-layout.cpp b/test/CodeGenCXX/vtable-layout.cpp
index 1e831d2d8349..ca5384d6e031 100644
--- a/test/CodeGenCXX/vtable-layout.cpp
+++ b/test/CodeGenCXX/vtable-layout.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts > %t 2>&1
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts > %t
// RUN: FileCheck --check-prefix=CHECK-1 %s < %t
// RUN: FileCheck --check-prefix=CHECK-2 %s < %t
// RUN: FileCheck --check-prefix=CHECK-3 %s < %t
@@ -44,6 +44,7 @@
// RUN: FileCheck --check-prefix=CHECK-43 %s < %t
// RUN: FileCheck --check-prefix=CHECK-44 %s < %t
// RUN: FileCheck --check-prefix=CHECK-45 %s < %t
+// RUN: FileCheck --check-prefix=CHECK-46 %s < %t
// For now, just verify this doesn't crash.
namespace test0 {
@@ -61,6 +62,9 @@ namespace Test1 {
// CHECK-1-NEXT: 1 | Test1::A RTTI
// CHECK-1-NEXT: -- (Test1::A, 0) vtable address --
// CHECK-1-NEXT: 2 | void Test1::A::f()
+//
+// CHECK-1: VTable indices for 'Test1::A' (1 entries).
+// CHECK-1-NEXT: 0 | void Test1::A::f()
struct A {
virtual void f();
};
@@ -82,6 +86,15 @@ namespace Test2 {
// CHECK-2-NEXT: 6 | Test2::A::~A() [deleting]
// CHECK-2-NEXT: 7 | void Test2::A::h()
// CHECK-2-NEXT: 8 | Test2::A &Test2::A::operator=(const Test2::A &)
+//
+// CHECK-2: VTable indices for 'Test2::A' (7 entries).
+// CHECK-2-NEXT: 0 | void Test2::A::f()
+// CHECK-2-NEXT: 1 | void Test2::A::f() const
+// CHECK-2-NEXT: 2 | Test2::A *Test2::A::g(int)
+// CHECK-2-NEXT: 3 | Test2::A::~A() [complete]
+// CHECK-2-NEXT: 4 | Test2::A::~A() [deleting]
+// CHECK-2-NEXT: 5 | void Test2::A::h()
+// CHECK-2-NEXT: 6 | Test2::A &Test2::A::operator=(const Test2::A &)
struct A {
virtual void f();
virtual void f() const;
@@ -103,6 +116,12 @@ void A::f() { }
// CHECK-3-NEXT: 3 | void Test2::B::g() [pure]
// CHECK-3-NEXT: 4 | Test2::B::~B() [complete] [pure]
// CHECK-3-NEXT: 5 | Test2::B::~B() [deleting] [pure]
+//
+// CHECK-3: VTable indices for 'Test2::B' (4 entries).
+// CHECK-3-NEXT: 0 | void Test2::B::f()
+// CHECK-3-NEXT: 1 | void Test2::B::g()
+// CHECK-3-NEXT: 2 | Test2::B::~B() [complete]
+// CHECK-3-NEXT: 3 | Test2::B::~B() [deleting]
struct B {
virtual void f();
virtual void g() = 0;
@@ -123,6 +142,9 @@ namespace Test3 {
// CHECK-4-NEXT: 1 | Test3::A RTTI
// CHECK-4-NEXT: -- (Test3::A, 0) vtable address --
// CHECK-4-NEXT: 2 | void Test3::A::f()
+//
+// CHECK-4: VTable indices for 'Test3::A' (1 entries).
+// CHECK-4-NEXT: 0 | void Test3::A::f()
struct A {
virtual void f();
};
@@ -135,6 +157,10 @@ void A::f() { }
// CHECK-5-NEXT: -- (Test3::B, 0) vtable address --
// CHECK-5-NEXT: 2 | void Test3::B::f()
// CHECK-5-NEXT: 3 | void Test3::B::g()
+//
+// CHECK-5: VTable indices for 'Test3::B' (2 entries).
+// CHECK-5-NEXT: 0 | void Test3::B::f()
+// CHECK-5-NEXT: 1 | void Test3::B::g()
struct B : A {
virtual void f();
virtual void g();
@@ -149,6 +175,10 @@ void B::f() { }
// CHECK-6-NEXT: 2 | void Test3::A::f()
// CHECK-6-NEXT: 3 | void Test3::C::g()
// CHECK-6-NEXT: 4 | void Test3::C::h()
+//
+// CHECK-6: VTable indices for 'Test3::C' (2 entries).
+// CHECK-6-NEXT: 1 | void Test3::C::g()
+// CHECK-6-NEXT: 2 | void Test3::C::h()
struct C : A {
virtual void g();
virtual void h();
@@ -164,6 +194,11 @@ void C::g() { }
// CHECK-7-NEXT: 2 | void Test3::D::f()
// CHECK-7-NEXT: 3 | void Test3::D::g()
// CHECK-7-NEXT: 4 | void Test3::D::h()
+//
+// CHECK-7: VTable indices for 'Test3::D' (3 entries).
+// CHECK-7-NEXT: 0 | void Test3::D::f()
+// CHECK-7-NEXT: 1 | void Test3::D::g()
+// CHECK-7-NEXT: 2 | void Test3::D::h()
struct D : B {
virtual void f();
virtual void g();
@@ -193,7 +228,9 @@ struct A {
// CHECK-8-NEXT: 2 | Test4::R3 *Test4::B::f()
// CHECK-8-NEXT: [return adjustment: 4 non-virtual]
// CHECK-8-NEXT: 3 | Test4::R3 *Test4::B::f()
-
+//
+// CHECK-8: VTable indices for 'Test4::B' (1 entries).
+// CHECK-8-NEXT: 1 | Test4::R3 *Test4::B::f()
struct B : A {
virtual R3 *f();
};
@@ -215,6 +252,9 @@ struct C {
// CHECK-9-NEXT: 2 | Test4::V2 *Test4::D::f()
// CHECK-9-NEXT: [return adjustment: 0 non-virtual, -24 vbase offset offset]
// CHECK-9-NEXT: 3 | Test4::V2 *Test4::D::f()
+//
+// CHECK-9: VTable indices for 'Test4::D' (1 entries).
+// CHECK-9-NEXT: 1 | Test4::V2 *Test4::D::f()
struct D : C {
virtual V2 *f();
};
@@ -231,7 +271,9 @@ struct V3 : virtual R3 { int r3; };
// CHECK-10-NEXT: 2 | Test4::V3 *Test4::E::f()
// CHECK-10-NEXT: [return adjustment: 4 non-virtual, -24 vbase offset offset]
// CHECK-10-NEXT: 3 | Test4::V3 *Test4::E::f()
-
+//
+// CHECK-10: VTable indices for 'Test4::E' (1 entries).
+// CHECK-10-NEXT: 1 | Test4::V3 *Test4::E::f()
struct E : A {
virtual V3 *f();
};
@@ -247,6 +289,10 @@ V3 *E::f() { return 0;}
// CHECK-11-NEXT: 2 | Test4::R3 *Test4::F::f() [pure]
// CHECK-11-NEXT: 3 | void Test4::F::g()
// CHECK-11-NEXT: 4 | Test4::R3 *Test4::F::f() [pure]
+//
+// CHECK-11: VTable indices for 'Test4::F' (2 entries).
+// CHECK-11-NEXT: 1 | void Test4::F::g()
+// CHECK-11-NEXT: 2 | Test4::R3 *Test4::F::f()
struct F : A {
virtual void g();
virtual R3 *f() = 0;
@@ -289,6 +335,9 @@ struct B2 : A {
// CHECK-12-NEXT: -- (Test5::B2, 16) vtable address --
// CHECK-12-NEXT: 7 | void Test5::A::f()
// CHECK-12-NEXT: 8 | void Test5::B2::g()
+//
+// CHECK-12: VTable indices for 'Test5::C' (1 entries).
+// CHECK-12-NEXT: 2 | void Test5::C::h()
struct C : B1, B2 {
virtual void h();
};
@@ -319,6 +368,9 @@ struct A2 {
// CHECK-13-NEXT: -- (Test6::A2, 16) vtable address --
// CHECK-13-NEXT: 5 | void Test6::C::f()
// CHECK-13-NEXT: [this adjustment: -16 non-virtual]
+//
+// CHECK-13: VTable indices for 'Test6::C' (1 entries).
+// CHECK-13-NEXT: 0 | void Test6::C::f()
struct C : A1, A2 {
virtual void f();
};
@@ -360,6 +412,9 @@ struct C { virtual void c(); };
// CHECK-14-NEXT: -- (Test7::B2, 24) vtable address --
// CHECK-14-NEXT: 9 | void Test7::D::f()
// CHECK-14-NEXT: [this adjustment: -24 non-virtual]
+//
+// CHECK-14: VTable indices for 'Test7::D' (1 entries).
+// CHECK-14-NEXT: 1 | void Test7::D::f()
struct D : C, B1, B2 {
virtual void f();
};
@@ -379,7 +434,10 @@ struct A { };
// CHECK-15-NEXT: 1 | Test8::B RTTI
// CHECK-15-NEXT: -- (Test8::B, 0) vtable address --
// CHECK-15-NEXT: 2 | void Test8::B::f()
-struct B : A {
+//
+// CHECK-15: VTable indices for 'Test8::B' (1 entries).
+// CHECK-15-NEXT: 0 | void Test8::B::f()
+struct B : A {
virtual void f();
};
void B::f() { }
@@ -400,6 +458,9 @@ struct A2 { int a2; };
// CHECK-16-NEXT: 3 | Test9::B RTTI
// CHECK-16-NEXT: -- (Test9::B, 0) vtable address --
// CHECK-16-NEXT: 4 | void Test9::B::f()
+//
+// CHECK-16: VTable indices for 'Test9::B' (1 entries).
+// CHECK-16-NEXT: 0 | void Test9::B::f()
struct B : virtual A1, virtual A2 {
int b;
@@ -430,6 +491,9 @@ struct A2 { virtual void a2(); };
// CHECK-17-NEXT: 5 | Test10::C RTTI
// CHECK-17-NEXT: -- (Test10::A2, 8) vtable address --
// CHECK-17-NEXT: 6 | void Test10::A2::a2()
+//
+// CHECK-17: VTable indices for 'Test10::C' (1 entries).
+// CHECK-17-NEXT: 1 | void Test10::C::f()
struct B : A1, A2 {
int b;
};
@@ -461,6 +525,9 @@ struct B : A1, virtual A2 {
// CHECK-18-NEXT: 5 | vbase_offset (16)
// CHECK-18-NEXT: 6 | offset_to_top (-8)
// CHECK-18-NEXT: 7 | Test11::C RTTI
+//
+// CHECK-18: VTable indices for 'Test11::C' (1 entries).
+// CHECK-18-NEXT: 0 | void Test11::C::f()
struct C : virtual B {
virtual void f();
};
@@ -498,6 +565,10 @@ namespace Test12 {
// CHECK-19-NEXT: 17 | Test12::B RTTI
// CHECK-19-NEXT: -- (Test12::A3, 40) vtable address --
// CHECK-19-NEXT: 18 | void Test12::A3::a3()
+//
+// CHECK-19: VTable indices for 'Test12::B' (2 entries).
+// CHECK-19-NEXT: 0 | void Test12::B::f()
+// CHECK-19-NEXT: 1 | void Test12::B::a()
struct A1 {
virtual void a1();
int a;
@@ -548,6 +619,9 @@ struct B : virtual A {
// CHECK-20-NEXT: -- (Test13::B, 0) vtable address --
// CHECK-20-NEXT: -- (Test13::C, 0) vtable address --
// CHECK-20-NEXT: 5 | void Test13::C::f()
+//
+// CHECK-20: VTable indices for 'Test13::C' (1 entries).
+// CHECK-20-NEXT: 0 | void Test13::C::f()
struct C : virtual B, virtual A {
virtual void f();
};
@@ -577,6 +651,9 @@ struct C : virtual B { };
// CHECK-21-NEXT: -- (Test14::C, 0) vtable address --
// CHECK-21-NEXT: -- (Test14::D, 0) vtable address --
// CHECK-21-NEXT: 4 | void Test14::D::f()
+//
+// CHECK-21: VTable indices for 'Test14::D' (1 entries).
+// CHECK-21-NEXT: 0 | void Test14::D::f()
struct D : C, virtual B {
virtual void f();
};
@@ -608,6 +685,9 @@ struct C : virtual B { };
// CHECK-22-NEXT: -- (Test15::B, 8) vtable address --
// CHECK-22-NEXT: -- (Test15::C, 8) vtable address --
// CHECK-22-NEXT: 10 | void Test15::B::b()
+//
+// CHECK-22: VTable indices for 'Test15::D' (1 entries).
+// CHECK-22-NEXT: 1 | void Test15::D::f()
struct D : A, virtual B, virtual C {
virtual void f();
};
@@ -648,6 +728,11 @@ struct C : A, B { virtual ~C(); };
// CHECK-23-NEXT: [this adjustment: -8 non-virtual, -24 vcall offset offset]
// CHECK-23-NEXT: 14 | Test16::D::~D() [deleting]
// CHECK-23-NEXT: [this adjustment: -8 non-virtual, -24 vcall offset offset]
+//
+// CHECK-23: VTable indices for 'Test16::D' (3 entries).
+// CHECK-23-NEXT: 0 | void Test16::D::f()
+// CHECK-23-NEXT: 1 | Test16::D::~D() [complete]
+// CHECK-23-NEXT: 2 | Test16::D::~D() [deleting]
struct D : virtual C {
virtual void f();
};
@@ -683,6 +768,9 @@ struct D : virtual B, virtual C { virtual void f(); };
// CHECK-24-NEXT: -- (Test17::C, 8) vtable address --
// CHECK-24-NEXT: 12 | void Test17::E::f()
// CHECK-24-NEXT: [this adjustment: 0 non-virtual, -24 vcall offset offset]
+//
+// CHECK-24: VTable indices for 'Test17::E' (1 entries).
+// CHECK-24-NEXT: 0 | void Test17::E::f()
class E : virtual D {
virtual void f();
};
@@ -741,6 +829,10 @@ struct C : A, B {
// CHECK-25-NEXT: 22 | void Test18::D::f()
// CHECK-25-NEXT: [this adjustment: -8 non-virtual, -32 vcall offset offset]
// CHECK-25-NEXT: 23 | [unused] void Test18::C::g()
+//
+// CHECK-25: VTable indices for 'Test18::D' (2 entries).
+// CHECK-25-NEXT: 0 | void Test18::D::f()
+// CHECK-25-NEXT: 2 | void Test18::D::h()
// CHECK-25: Construction vtable for ('Test18::B', 0) in 'Test18::D' (7 entries).
// CHECK-25-NEXT: 0 | vbase_offset (0)
@@ -848,6 +940,9 @@ struct C {
// CHECK-26-NEXT: -- (Test19::A, 24) vtable address --
// CHECK-26-NEXT: 12 | void Test19::D::f()
// CHECK-26-NEXT: [this adjustment: 0 non-virtual, -24 vcall offset offset]
+//
+// CHECK-26: VTable indices for 'Test19::D' (1 entries).
+// CHECK-26-NEXT: 1 | void Test19::D::f()
struct D : C, B, virtual A {
virtual void f();
};
@@ -880,7 +975,11 @@ struct B : A { };
// CHECK-27-NEXT: -- (Test20::B, 8) vtable address --
// CHECK-27-NEXT: 7 | void Test20::C::f() [pure]
// CHECK-27-NEXT: 8 | void Test20::A::g()
-struct C : A, B {
+//
+// CHECK-27: VTable indices for 'Test20::C' (2 entries).
+// CHECK-27-NEXT: 0 | void Test20::C::f()
+// CHECK-27-NEXT: 2 | void Test20::C::h()
+struct C : A, B {
virtual void f() = 0;
virtual void h();
};
@@ -931,6 +1030,9 @@ class E : virtual C { };
// CHECK-28-NEXT: Test21::C | -48
// CHECK-28-NEXT: Test21::D | -56
// CHECK-28-NEXT: Test21::E | -64
+//
+// CHECK-28: VTable indices for 'Test21::F' (1 entries).
+// CHECK-28-NEXT: 0 | void Test21::F::f()
class F : virtual D, virtual E {
virtual void f();
};
@@ -960,6 +1062,9 @@ struct V2 : virtual V1 {
// CHECK-29-NEXT: 6 | offset_to_top (-16)
// CHECK-29-NEXT: 7 | Test22::C RTTI
// CHECK-29-NEXT: -- (Test22::V2, 16) vtable address --
+//
+// CHECK-29: VTable indices for 'Test22::C' (1 entries).
+// CHECK-29-NEXT: 0 | void Test22::C::f()
// CHECK-29: Construction vtable for ('Test22::V2', 16) in 'Test22::C' (3 entries).
// CHECK-29-NEXT: 0 | vbase_offset (-4)
@@ -1052,6 +1157,9 @@ struct C : virtual A { };
// CHECK-31-NEXT: 8 | Test24::D RTTI
// CHECK-31-NEXT: -- (Test24::C, 8) vtable address --
// CHECK-31-NEXT: 9 | [unused] void Test24::D::f()
+//
+// CHECK-31: VTable indices for 'Test24::D' (1 entries).
+// CHECK-31-NEXT: 0 | void Test24::D::f()
// CHECK-31: Construction vtable for ('Test24::B', 0) in 'Test24::D' (5 entries).
// CHECK-31-NEXT: 0 | vbase_offset (0)
@@ -1108,6 +1216,9 @@ struct B : virtual V { };
// CHECK-32-NEXT: 9 | Test25::C RTTI
// CHECK-32-NEXT: -- (Test25::B, 8) vtable address --
// CHECK-32-NEXT: 10 | [unused] void Test25::V::f()
+//
+// CHECK-32: VTable indices for 'Test25::C' (1 entries).
+// CHECK-32-NEXT: 1 | void Test25::C::g()
// CHECK-32: Construction vtable for ('Test25::A', 0) in 'Test25::C' (5 entries).
// CHECK-32-NEXT: 0 | vbase_offset (0)
@@ -1174,6 +1285,9 @@ struct C : virtual A {
// CHECK-33-NEXT: -- (Test26::C, 8) vtable address --
// CHECK-33-NEXT: 13 | void Test26::A::a()
// CHECK-33-NEXT: 14 | void Test26::C::b()
+//
+// CHECK-33: VTable indices for 'Test26::D' (1 entries).
+// CHECK-33-NEXT: 1 | void Test26::D::d()
// CHECK-33: Construction vtable for ('Test26::C', 8) in 'Test26::D' (7 entries).
// CHECK-33-NEXT: 0 | vcall_offset (0)
@@ -1232,6 +1346,9 @@ struct D : A, virtual B, C {
// CHECK-34-NEXT: 11 | Test27::E RTTI
// CHECK-34-NEXT: -- (Test27::B, 16) vtable address --
// CHECK-34-NEXT: 12 | void Test27::B::b()
+//
+// CHECK-34: VTable indices for 'Test27::E' (1 entries).
+// CHECK-34-NEXT: 2 | void Test27::E::e()
// CHECK-34: Construction vtable for ('Test27::D', 0) in 'Test27::E' (9 entries).
// CHECK-34-NEXT: 0 | vbase_offset (16)
@@ -1293,6 +1410,9 @@ struct D : virtual C {
// CHECK-35-NEXT: 12 | Test28::E RTTI
// CHECK-35-NEXT: -- (Test28::B, 16) vtable address --
// CHECK-35-NEXT: 13 | void Test28::B::b()
+//
+// CHECK-35: VTable indices for 'Test28::E' (1 entries).
+// CHECK-35-NEXT : 0 | void Test28::E::e()
// CHECK-35: Construction vtable for ('Test28::D', 0) in 'Test28::E' (13 entries).
// CHECK-35-NEXT: 0 | vbase_offset (8)
@@ -1342,6 +1462,9 @@ struct A {
// CHECK-36-NEXT: [return adjustment: 0 non-virtual, -24 vbase offset offset]
// CHECK-36-NEXT: [this adjustment: 0 non-virtual, -24 vcall offset offset]
// CHECK-36-NEXT: 5 | Test29::V2 *Test29::B::f()
+//
+// CHECK-36: VTable indices for 'Test29::B' (1 entries).
+// CHECK-36-NEXT: 1 | Test29::V2 *Test29::B::f()
struct B : virtual A {
virtual V2 *f();
};
@@ -1403,6 +1526,9 @@ struct C : A, virtual B {
// CHECK-37-NEXT: -- (Test31::C, 8) vtable address --
// CHECK-37-NEXT: 10 | void Test31::D::f()
// CHECK-37-NEXT: [this adjustment: 0 non-virtual, -24 vcall offset offset]
+//
+// CHECK-37: VTable indices for 'Test31::D' (1 entries).
+// CHECK-37-NEXT: 0 | void Test31::D::f()
struct D : virtual C {
virtual void f();
};
@@ -1494,6 +1620,9 @@ struct E : A, D {
// CHECK-39-NEXT: 28 | Test33::F RTTI
// CHECK-39-NEXT: -- (Test33::B, 24) vtable address --
// CHECK-39-NEXT: 29 | void Test33::B::b()
+//
+// CHECK-39: VTable indices for 'Test33::F' (1 entries).
+// CHECK-39-NEXT: 1 | void Test33::F::f()
struct F : virtual E, A {
virtual void f();
};
@@ -1631,12 +1760,15 @@ struct G : virtual E { };
// CHECK-41-NEXT: 29 | void Test35::C::c()
// CHECK-41-NEXT: 30 | void Test35::D::d()
// CHECK-41-NEXT: 31 | void Test35::E::e()
-
+//
// CHECK-41: Virtual base offset offsets for 'Test35::H' (4 entries).
// CHECK-41-NEXT: Test35::A | -32
// CHECK-41-NEXT: Test35::B | -24
// CHECK-41-NEXT: Test35::D | -56
// CHECK-41-NEXT: Test35::E | -64
+//
+// CHECK-41: VTable indices for 'Test35::H' (1 entries).
+// CHECK-41-NEXT: 2 | void Test35::H::h()
struct H : F, G {
virtual void h();
};
@@ -1676,6 +1808,9 @@ struct C : virtual A {
// CHECK-42-NEXT: -- (Test36::B, 8) vtable address --
// CHECK-42-NEXT: 11 | void Test36::C::f()
// CHECK-42-NEXT: [this adjustment: 0 non-virtual, -24 vcall offset offset]
+//
+// CHECK-42: VTable indices for 'Test36::D' (1 entries).
+// CHECK-42-NEXT: 1 | void Test36::D::g()
struct D : virtual B, C {
virtual void g();
};
@@ -1721,6 +1856,10 @@ namespace Test38 {
// CHECK-44-NEXT: -- (Test38::B, 0) vtable address --
// CHECK-44-NEXT: 5 | void *Test38::B::foo()
// CHECK-44-NEXT: 6 | const void *Test38::B::foo() const
+ //
+ // CHECK-44: VTable indices for 'Test38::B' (2 entries).
+ // CHECK-44-NEXT: 0 | void *Test38::B::foo()
+ // CHECK-44-NEXT: 1 | const void *Test38::B::foo() const
class B : virtual public A {
void *foo();
const void *foo() const;
@@ -1741,6 +1880,9 @@ namespace Test39 {
// CHECK-45-NEXT: -- (Test39::B, 0) vtable address --
// CHECK-45-NEXT: 2 | void Test39::A::foo() [deleted]
// CHECK-45-NEXT: 3 | void Test39::B::foo2()
+ //
+ // CHECK-45: VTable indices for 'Test39::B' (1 entries).
+ // CHECK-45-NEXT: 1 | void Test39::B::foo2()
struct B: A {
virtual void foo2();
};
@@ -1748,3 +1890,37 @@ namespace Test39 {
void B::foo2() {
}
}
+
+namespace Test40 {
+ struct A {
+ virtual void foo() = 0;
+ };
+
+ struct B : public A {
+ virtual void foo();
+ };
+
+ struct C: public B {
+ // CHECK-46: VTable indices for 'Test40::C' (8 entries).
+ // CHECK-46-NEXT: 1 | int Test40::C::f(int)
+ // CHECK-46-NEXT: 2 | int Test40::C::f()
+ // CHECK-46-NEXT: 3 | int Test40::C::g(int)
+ // CHECK-46-NEXT: 4 | int Test40::C::g()
+ // CHECK-46-NEXT: 5 | int Test40::C::h(int)
+ // CHECK-46-NEXT: 6 | int Test40::C::h()
+ // CHECK-46-NEXT: 7 | int Test40::C::i(int)
+ // CHECK-46-NEXT: 8 | int Test40::C::i()
+ virtual int f(int);
+ virtual int f();
+ virtual int g(int);
+ virtual int g();
+ virtual int h(int);
+ virtual int h();
+ virtual int i(int);
+ virtual int i();
+ };
+
+ class D : C {};
+
+ D d;
+}
diff --git a/test/CodeGenCXX/vtable-linkage.cpp b/test/CodeGenCXX/vtable-linkage.cpp
index b945e569afb6..c17e33387e52 100644
--- a/test/CodeGenCXX/vtable-linkage.cpp
+++ b/test/CodeGenCXX/vtable-linkage.cpp
@@ -1,24 +1,9 @@
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o %t
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -fhidden-weak-vtables -emit-llvm -o %t.hidden
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -disable-llvm-optzns -O3 -emit-llvm -o %t.opt
-// RUN: FileCheck --check-prefix=CHECK-1 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-2 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-2-HIDDEN %s < %t.hidden
-// RUN: FileCheck --check-prefix=CHECK-3 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-4 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-5 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-5-HIDDEN %s < %t.hidden
-// RUN: FileCheck --check-prefix=CHECK-6 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-6-HIDDEN %s < %t.hidden
-// RUN: FileCheck --check-prefix=CHECK-7 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-8 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-9 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-9-OPT %s < %t.opt
-// RUN: FileCheck --check-prefix=CHECK-10 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-10-OPT %s < %t.opt
-// RUN: FileCheck --check-prefix=CHECK-11 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-12 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-13 %s < %t
+// RUN: FileCheck --check-prefix=CHECK %s < %t
+// RUN: FileCheck --check-prefix=CHECK-HIDDEN %s < %t.hidden
+// RUN: FileCheck --check-prefix=CHECK-OPT %s < %t.opt
namespace {
struct A {
@@ -102,96 +87,94 @@ void use_F() {
// B has a key function that is not defined in this translation unit so its vtable
// has external linkage.
-// CHECK-1: @_ZTV1B = external unnamed_addr constant
+// CHECK-DAG: @_ZTV1B = external unnamed_addr constant
// C has no key function, so its vtable should have weak_odr linkage
// and hidden visibility (rdar://problem/7523229).
-// CHECK-2: @_ZTV1C = linkonce_odr unnamed_addr constant
-// CHECK-2: @_ZTS1C = linkonce_odr constant
-// CHECK-2: @_ZTI1C = linkonce_odr unnamed_addr constant
-// CHECK-2: @_ZTT1C = linkonce_odr unnamed_addr constant
-// CHECK-2-HIDDEN: @_ZTV1C = linkonce_odr hidden unnamed_addr constant
-// CHECK-2-HIDDEN: @_ZTS1C = linkonce_odr constant
-// CHECK-2-HIDDEN: @_ZTI1C = linkonce_odr hidden unnamed_addr constant
-// CHECK-2-HIDDEN: @_ZTT1C = linkonce_odr hidden unnamed_addr constant
+// CHECK-DAG: @_ZTV1C = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1C = linkonce_odr constant
+// CHECK-DAG: @_ZTI1C = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTT1C = linkonce_odr unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTV1C = linkonce_odr hidden unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTS1C = linkonce_odr constant
+// CHECK-HIDDEN-DAG: @_ZTI1C = linkonce_odr hidden unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTT1C = linkonce_odr hidden unnamed_addr constant
// D has a key function that is defined in this translation unit so its vtable is
// defined in the translation unit.
-// CHECK-3: @_ZTV1D = unnamed_addr constant
-// CHECK-3: @_ZTS1D = constant
-// CHECK-3: @_ZTI1D = unnamed_addr constant
+// CHECK-DAG: @_ZTV1D = unnamed_addr constant
+// CHECK-DAG: @_ZTS1D = constant
+// CHECK-DAG: @_ZTI1D = unnamed_addr constant
// E<char> is an explicit specialization with a key function defined
// in this translation unit, so its vtable should have external
// linkage.
-// CHECK-4: @_ZTV1EIcE = unnamed_addr constant
-// CHECK-4: @_ZTS1EIcE = constant
-// CHECK-4: @_ZTI1EIcE = unnamed_addr constant
+// CHECK-DAG: @_ZTV1EIcE = unnamed_addr constant
+// CHECK-DAG: @_ZTS1EIcE = constant
+// CHECK-DAG: @_ZTI1EIcE = unnamed_addr constant
// E<short> is an explicit template instantiation with a key function
// defined in this translation unit, so its vtable should have
// weak_odr linkage.
-// CHECK-5: @_ZTV1EIsE = weak_odr unnamed_addr constant
-// CHECK-5: @_ZTS1EIsE = weak_odr constant
-// CHECK-5: @_ZTI1EIsE = weak_odr unnamed_addr constant
-// CHECK-5-HIDDEN: @_ZTV1EIsE = weak_odr unnamed_addr constant
-// CHECK-5-HIDDEN: @_ZTS1EIsE = weak_odr constant
-// CHECK-5-HIDDEN: @_ZTI1EIsE = weak_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1EIsE = weak_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1EIsE = weak_odr constant
+// CHECK-DAG: @_ZTI1EIsE = weak_odr unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTV1EIsE = weak_odr unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTS1EIsE = weak_odr constant
+// CHECK-HIDDEN-DAG: @_ZTI1EIsE = weak_odr unnamed_addr constant
// F<short> is an explicit template instantiation without a key
// function, so its vtable should have weak_odr linkage
-// CHECK-6: @_ZTV1FIsE = weak_odr unnamed_addr constant
-// CHECK-6: @_ZTS1FIsE = weak_odr constant
-// CHECK-6: @_ZTI1FIsE = weak_odr unnamed_addr constant
-// CHECK-6-HIDDEN: @_ZTV1FIsE = weak_odr unnamed_addr constant
-// CHECK-6-HIDDEN: @_ZTS1FIsE = weak_odr constant
-// CHECK-6-HIDDEN: @_ZTI1FIsE = weak_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1FIsE = weak_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1FIsE = weak_odr constant
+// CHECK-DAG: @_ZTI1FIsE = weak_odr unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTV1FIsE = weak_odr unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTS1FIsE = weak_odr constant
+// CHECK-HIDDEN-DAG: @_ZTI1FIsE = weak_odr unnamed_addr constant
// E<long> is an implicit template instantiation with a key function
// defined in this translation unit, so its vtable should have
// linkonce_odr linkage.
-// CHECK-7: @_ZTV1EIlE = linkonce_odr unnamed_addr constant
-// CHECK-7: @_ZTS1EIlE = linkonce_odr constant
-// CHECK-7: @_ZTI1EIlE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1EIlE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1EIlE = linkonce_odr constant
+// CHECK-DAG: @_ZTI1EIlE = linkonce_odr unnamed_addr constant
// F<long> is an implicit template instantiation with no key function,
// so its vtable should have linkonce_odr linkage.
-// CHECK-8: @_ZTV1FIlE = linkonce_odr unnamed_addr constant
-// CHECK-8: @_ZTS1FIlE = linkonce_odr constant
-// CHECK-8: @_ZTI1FIlE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1FIlE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1FIlE = linkonce_odr constant
+// CHECK-DAG: @_ZTI1FIlE = linkonce_odr unnamed_addr constant
// F<int> is an explicit template instantiation declaration without a
// key function, so its vtable should have external linkage.
-// CHECK-9: @_ZTV1FIiE = external unnamed_addr constant
-// CHECK-9-OPT: @_ZTV1FIiE = available_externally unnamed_addr constant
+// CHECK-DAG: @_ZTV1FIiE = external unnamed_addr constant
+// CHECK-OPT-DAG: @_ZTV1FIiE = external unnamed_addr constant
// E<int> is an explicit template instantiation declaration. It has a
// key function that is not instantiated, so we should only reference
// its vtable, not define it.
-// CHECK-10: @_ZTV1EIiE = external unnamed_addr constant
-// CHECK-10-OPT: @_ZTV1EIiE = available_externally unnamed_addr constant
+// CHECK-DAG: @_ZTV1EIiE = external unnamed_addr constant
+// CHECK-OPT-DAG: @_ZTV1EIiE = external unnamed_addr constant
// The anonymous struct for e has no linkage, so the vtable should have
// internal linkage.
-// CHECK-11: @"_ZTV3$_0" = internal unnamed_addr constant
-// CHECK-11: @"_ZTS3$_0" = internal constant
-// CHECK-11: @"_ZTI3$_0" = internal unnamed_addr constant
+// CHECK-DAG: @"_ZTV3$_0" = internal unnamed_addr constant
+// CHECK-DAG: @"_ZTS3$_0" = internal constant
+// CHECK-DAG: @"_ZTI3$_0" = internal unnamed_addr constant
// The A vtable should have internal linkage since it is inside an anonymous
// namespace.
-// CHECK-12: @_ZTVN12_GLOBAL__N_11AE = internal unnamed_addr constant
-// CHECK-12: @_ZTSN12_GLOBAL__N_11AE = internal constant
-// CHECK-12: @_ZTIN12_GLOBAL__N_11AE = internal unnamed_addr constant
+// CHECK-DAG: @_ZTVN12_GLOBAL__N_11AE = internal unnamed_addr constant
+// CHECK-DAG: @_ZTSN12_GLOBAL__N_11AE = internal constant
+// CHECK-DAG: @_ZTIN12_GLOBAL__N_11AE = internal unnamed_addr constant
// F<char> is an explicit specialization without a key function, so
// its vtable should have linkonce_odr linkage.
-// CHECK-13: @_ZTV1FIcE = linkonce_odr unnamed_addr constant
-// CHECK-13: @_ZTS1FIcE = linkonce_odr constant
-// CHECK-13: @_ZTI1FIcE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1FIcE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1FIcE = linkonce_odr constant
+// CHECK-DAG: @_ZTI1FIcE = linkonce_odr unnamed_addr constant
-// RUN: FileCheck --check-prefix=CHECK-G %s < %t
-//
-// CHECK-G: @_ZTV1GIiE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1GIiE = linkonce_odr unnamed_addr constant
template <typename T>
class G {
public:
@@ -205,11 +188,9 @@ template <typename T>
void G<T>::f0() {}
void G_f0() { new G<int>(); }
-// RUN: FileCheck --check-prefix=CHECK-H %s < %t
-
// H<int> has a key function without a body but it's a template instantiation
// so its VTable must be emitted.
-// CHECK-H: @_ZTV1HIiE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1HIiE = linkonce_odr unnamed_addr constant
template <typename T>
class H {
public:
@@ -220,21 +201,15 @@ void use_H() {
H<int> h;
}
-// RUN: FileCheck --check-prefix=CHECK-I %s < %t
-// RUN: FileCheck --check-prefix=CHECK-I-OPT %s < %t.opt
-
// I<int> has an explicit instantiation declaration and needs a VTT and
-// construction vtables. We emit the VTT available_externally, but point it at
-// internal construction vtables because there is no way to form a reference to
-// the real construction vtables.
+// construction vtables.
-// CHECK-I: @_ZTV1IIiE = external unnamed_addr constant
-// CHECK-I: @_ZTT1IIiE = external unnamed_addr constant
-// CHECK-I-NOT: @_ZTC1IIiE
+// CHECK-DAG: @_ZTV1IIiE = external unnamed_addr constant
+// CHECK-DAG: @_ZTT1IIiE = external unnamed_addr constant
+// CHECK-NOT: @_ZTC1IIiE
//
-// CHECK-I-OPT: @_ZTV1IIiE = available_externally unnamed_addr constant
-// CHECK-I-OPT: @_ZTT1IIiE = available_externally unnamed_addr constant {{.*}} @_ZTC1IIiE0_6VBase2
-// CHECK-I-OPT: @_ZTC1IIiE0_6VBase2 = internal unnamed_addr constant
+// CHECK-OPT-DAG: @_ZTV1IIiE = external unnamed_addr constant
+// CHECK-OPT-DAG: @_ZTT1IIiE = external unnamed_addr constant
struct VBase1 { virtual void f(); }; struct VBase2 : virtual VBase1 {};
template<typename T>
struct I : VBase2 {};
diff --git a/test/CodeGenCXX/vtable-pointer-initialization.cpp b/test/CodeGenCXX/vtable-pointer-initialization.cpp
index 9b1eaa5ba775..85e08d8f0f9b 100644
--- a/test/CodeGenCXX/vtable-pointer-initialization.cpp
+++ b/test/CodeGenCXX/vtable-pointer-initialization.cpp
@@ -19,14 +19,14 @@ struct A : Base {
Field field;
};
-// CHECK: define void @_ZN1AC2Ev(%struct.A* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN1AC2Ev(%struct.A* %this) unnamed_addr
// CHECK: call void @_ZN4BaseC2Ev(
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2)
// CHECK: call void @_ZN5FieldC1Ev(
// CHECK: ret void
A::A() { }
-// CHECK: define void @_ZN1AD2Ev(%struct.A* %this) unnamed_addr
+// CHECK-LABEL: define void @_ZN1AD2Ev(%struct.A* %this) unnamed_addr
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2)
// CHECK: call void @_ZN5FieldD1Ev(
// CHECK: call void @_ZN4BaseD2Ev(
@@ -41,16 +41,16 @@ struct B : Base {
void f() { B b; }
-// CHECK: define linkonce_odr void @_ZN1BC1Ev(%struct.B* %this) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1BC1Ev(%struct.B* %this) unnamed_addr
// CHECK: call void @_ZN1BC2Ev(
-// CHECK: define linkonce_odr void @_ZN1BD1Ev(%struct.B* %this) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1BD1Ev(%struct.B* %this) unnamed_addr
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1B, i64 0, i64 2)
// CHECK: call void @_ZN5FieldD1Ev(
// CHECK: call void @_ZN4BaseD2Ev(
// CHECK: ret void
-// CHECK: define linkonce_odr void @_ZN1BC2Ev(%struct.B* %this) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1BC2Ev(%struct.B* %this) unnamed_addr
// CHECK: call void @_ZN4BaseC2Ev(
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1B, i64 0, i64 2)
// CHECK: call void @_ZN5FieldC1Ev
diff --git a/test/CodeGenCXX/x86_32-arguments.cpp b/test/CodeGenCXX/x86_32-arguments.cpp
index 4404de0f88e5..2c7234e038c9 100644
--- a/test/CodeGenCXX/x86_32-arguments.cpp
+++ b/test/CodeGenCXX/x86_32-arguments.cpp
@@ -6,9 +6,9 @@ struct S {
short s;
};
-// CHECK: define void @_Z1fv(%struct.S* noalias sret %
+// CHECK-LABEL: define void @_Z1fv(%struct.S* noalias sret %
S f() { return S(); }
-// CHECK: define void @_Z1f1S(%struct.S*)
+// CHECK-LABEL: define void @_Z1f1S(%struct.S*)
void f(S) { }
// Non-trivial dtors, should both be passed indirectly.
@@ -18,10 +18,10 @@ public:
double c;
};
-// CHECK: define void @_Z1gv(%class.C* noalias sret %
+// CHECK-LABEL: define void @_Z1gv(%class.C* noalias sret %
C g() { return C(); }
-// CHECK: define void @_Z1f1C(%class.C*)
+// CHECK-LABEL: define void @_Z1f1C(%class.C*)
void f(C) { }
@@ -29,7 +29,7 @@ void f(C) { }
// PR7058 - Missing byval on MI thunk definition.
-// CHECK: define void @_ZThn4_N18BasicAliasAnalysis13getModRefInfoE8CallSite
+// CHECK-LABEL: define void @_ZThn4_N18BasicAliasAnalysis13getModRefInfoE8CallSite
// ...
// CHECK: %struct.CallSite* byval align 4 %CS)
struct CallSite {
@@ -57,38 +57,38 @@ void BasicAliasAnalysis::getModRefInfo(CallSite CS) {
//
// PR7098.
-// CHECK: define i64 @_Z2f0v()
+// CHECK-LABEL: define i64 @_Z2f0v()
struct s0_0 { int x; };
struct s0_1 : s0_0 { int* y; };
s0_1 f0() { return s0_1(); }
-// CHECK: define i32 @_Z2f1v()
+// CHECK-LABEL: define i32 @_Z2f1v()
struct s1_0 { int x; };
struct s1_1 : s1_0 { };
s1_1 f1() { return s1_1(); }
-// CHECK: define double @_Z2f2v()
+// CHECK-LABEL: define double @_Z2f2v()
struct s2_0 { double x; };
struct s2_1 : s2_0 { };
s2_1 f2() { return s2_1(); }
-// CHECK: define double @_Z2f3v()
+// CHECK-LABEL: define double @_Z2f3v()
struct s3_0 { };
struct s3_1 { double x; };
struct s3_2 : s3_0, s3_1 { };
s3_2 f3() { return s3_2(); }
-// CHECK: define i64 @_Z2f4v()
+// CHECK-LABEL: define i64 @_Z2f4v()
struct s4_0 { float x; };
struct s4_1 { float x; };
struct s4_2 : s4_0, s4_1 { };
s4_2 f4() { return s4_2(); }
-// CHECK: define i32* @_Z2f5v()
+// CHECK-LABEL: define i32* @_Z2f5v()
struct s5 { s5(); int &x; };
s5 f5() { return s5(); }
-// CHECK: define i32 @_Z4f6_0M2s6i(i32 %a)
+// CHECK-LABEL: define i32 @_Z4f6_0M2s6i(i32 %a)
// CHECK: define i64 @_Z4f6_1M2s6FivE({ i32, i32 }* byval align 4)
// FIXME: It would be nice to avoid byval on the previous case.
struct s6 {};
@@ -97,19 +97,19 @@ typedef int (s6::*s6_mfp)();
s6_mdp f6_0(s6_mdp a) { return a; }
s6_mfp f6_1(s6_mfp a) { return a; }
-// CHECK: define double @_Z2f7v()
+// CHECK-LABEL: define double @_Z2f7v()
struct s7_0 { unsigned : 0; };
struct s7_1 { double x; };
struct s7 : s7_0, s7_1 { };
s7 f7() { return s7(); }
-// CHECK: define void @_Z2f8v(%struct.s8* noalias sret %agg.result)
+// CHECK-LABEL: define void @_Z2f8v(%struct.s8* noalias sret %agg.result)
struct s8_0 { };
struct s8_1 { double x; };
struct s8 { s8_0 a; s8_1 b; };
s8 f8() { return s8(); }
-// CHECK: define void @_Z2f9v(%struct.s9* noalias sret %agg.result)
+// CHECK-LABEL: define void @_Z2f9v(%struct.s9* noalias sret %agg.result)
struct s9_0 { unsigned : 0; };
struct s9_1 { double x; };
struct s9 { s9_0 a; s9_1 b; };
diff --git a/test/CodeGenCXX/x86_64-arguments.cpp b/test/CodeGenCXX/x86_64-arguments.cpp
index 672180363fca..2172e0810d75 100644
--- a/test/CodeGenCXX/x86_64-arguments.cpp
+++ b/test/CodeGenCXX/x86_64-arguments.cpp
@@ -3,28 +3,28 @@
// Basic base class test.
struct f0_s0 { unsigned a; };
struct f0_s1 : public f0_s0 { void *b; };
-// CHECK: define void @_Z2f05f0_s1(i32 %a0.coerce0, i8* %a0.coerce1)
+// CHECK-LABEL: define void @_Z2f05f0_s1(i32 %a0.coerce0, i8* %a0.coerce1)
void f0(f0_s1 a0) { }
// Check with two eight-bytes in base class.
struct f1_s0 { unsigned a; unsigned b; float c; };
struct f1_s1 : public f1_s0 { float d;};
-// CHECK: define void @_Z2f15f1_s1(i64 %a0.coerce0, <2 x float> %a0.coerce1)
+// CHECK-LABEL: define void @_Z2f15f1_s1(i64 %a0.coerce0, <2 x float> %a0.coerce1)
void f1(f1_s1 a0) { }
// Check with two eight-bytes in base class and merge.
struct f2_s0 { unsigned a; unsigned b; float c; };
struct f2_s1 : public f2_s0 { char d;};
-// CHECK: define void @_Z2f25f2_s1(i64 %a0.coerce0, i64 %a0.coerce1)
+// CHECK-LABEL: define void @_Z2f25f2_s1(i64 %a0.coerce0, i64 %a0.coerce1)
void f2(f2_s1 a0) { }
// PR5831
-// CHECK: define void @_Z2f34s3_1(i64 %x.coerce)
+// CHECK-LABEL: define void @_Z2f34s3_1(i64 %x.coerce)
struct s3_0 {};
struct s3_1 { struct s3_0 a; long b; };
void f3(struct s3_1 x) {}
-// CHECK: define i64 @_Z4f4_0M2s4i(i64 %a)
+// CHECK-LABEL: define i64 @_Z4f4_0M2s4i(i64 %a)
// CHECK: define {{.*}} @_Z4f4_1M2s4FivE(i64 %a.coerce0, i64 %a.coerce1)
struct s4 {};
typedef int s4::* s4_mdp;
@@ -41,7 +41,7 @@ struct StringRef {
void AddKeyword(StringRef, int x);
void foo() {
- // CHECK: define void @_ZN6PR75233fooEv()
+ // CHECK-LABEL: define void @_ZN6PR75233fooEv()
// CHECK: call void @_ZN6PR752310AddKeywordENS_9StringRefEi(i8* {{.*}}, i32 4)
AddKeyword(StringRef(), 4);
}
@@ -54,7 +54,7 @@ namespace PR7742 { // Also rdar://8250764
struct c2 : public s2 {};
- // CHECK: define <2 x float> @_ZN6PR77423fooEPNS_2c2E(%"struct.PR7742::c2"* %P)
+ // CHECK-LABEL: define <2 x float> @_ZN6PR77423fooEPNS_2c2E(%"struct.PR7742::c2"* %P)
c2 foo(c2 *P) {
return c2();
}
@@ -72,7 +72,7 @@ namespace PR5179 {
B1 b1;
};
- // CHECK: define i8* @_ZN6PR51793barENS_2B2E(i32* %b2.coerce)
+ // CHECK-LABEL: define i8* @_ZN6PR51793barENS_2B2E(i32* %b2.coerce)
const void *bar(B2 b2) {
return b2.b1.pa;
}
@@ -114,7 +114,7 @@ namespace test6 {
int test(outer x) {
return x.x + x.f;
}
- // CHECK: define i32 @_ZN5test64testENS_5outerE(i64 %x.coerce0, i32 %x.coerce1)
+ // CHECK-LABEL: define i32 @_ZN5test64testENS_5outerE(i64 %x.coerce0, i32 %x.coerce1)
}
namespace test7 {
diff --git a/test/CodeGenObjC/2010-02-09-DbgSelf.m b/test/CodeGenObjC/2010-02-09-DbgSelf.m
index e09adac161ec..9aebe3d619bc 100644
--- a/test/CodeGenObjC/2010-02-09-DbgSelf.m
+++ b/test/CodeGenObjC/2010-02-09-DbgSelf.m
@@ -1,5 +1,7 @@
-// RUN: %clang_cc1 -x objective-c -emit-llvm -g < %s | grep "\"self\", metadata"
+// RUN: %clang_cc1 -x objective-c -emit-llvm -g < %s | FileCheck %s
// Test to check that "self" argument is assigned a location.
+// CHECK: call void @llvm.dbg.declare(metadata !{%0** %{{[^}]+}}}, metadata [[SELF:![0-9]*]])
+// CHECK: [[SELF]] = {{.*}} ; [ DW_TAG_arg_variable ] [self]
@interface Foo
-(void) Bar: (int)x ;
diff --git a/test/CodeGenObjC/arc-block-copy-escape.m b/test/CodeGenObjC/arc-block-copy-escape.m
index 3ba742637515..afe7c0bdc18b 100644
--- a/test/CodeGenObjC/arc-block-copy-escape.m
+++ b/test/CodeGenObjC/arc-block-copy-escape.m
@@ -8,14 +8,14 @@ void use_int(int);
void test0(int i) {
block_t block = ^{ use_int(i); };
- // CHECK: define void @test0(
+ // CHECK-LABEL: define void @test0(
// CHECK: call i8* @objc_retainBlock(i8* {{%.*}}) [[NUW:#[0-9]+]], !clang.arc.copy_on_escape
// CHECK: ret void
}
void test1(int i) {
id block = ^{ use_int(i); };
- // CHECK: define void @test1(
+ // CHECK-LABEL: define void @test1(
// CHECK: call i8* @objc_retainBlock(i8* {{%.*}}) [[NUW]]
// CHECK-NOT: !clang.arc.copy_on_escape
// CHECK: ret void
diff --git a/test/CodeGenObjC/arc-blocks.m b/test/CodeGenObjC/arc-blocks.m
index c9ba2f615347..4ba3f05fd9f6 100644
--- a/test/CodeGenObjC/arc-blocks.m
+++ b/test/CodeGenObjC/arc-blocks.m
@@ -7,7 +7,7 @@ void test0(id (^maker)(void)) {
}
int (^test1(int x))(void) {
- // CHECK: define i32 ()* @test1(
+ // CHECK-LABEL: define i32 ()* @test1(
// CHECK: [[X:%.*]] = alloca i32,
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK-NEXT: store i32 {{%.*}}, i32* [[X]]
@@ -23,7 +23,7 @@ int (^test1(int x))(void) {
}
void test2(id x) {
-// CHECK: define void @test2(
+// CHECK-LABEL: define void @test2(
// CHECK: [[X:%.*]] = alloca i8*,
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK-NEXT: [[PARM:%.*]] = call i8* @objc_retain(i8* {{%.*}})
@@ -43,7 +43,7 @@ void test2(id x) {
extern void test2_helper(id (^)(void));
test2_helper(^{ return x; });
-// CHECK: define internal void @__copy_helper_block_
+// CHECK-LABEL: define internal void @__copy_helper_block_
// CHECK: [[T0:%.*]] = load i8**
// CHECK-NEXT: [[SRC:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]*
// CHECK-NEXT: [[T0:%.*]] = load i8**
@@ -53,7 +53,7 @@ void test2(id x) {
// CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) [[NUW]]
// CHECK-NEXT: ret void
-// CHECK: define internal void @__destroy_helper_block_
+// CHECK-LABEL: define internal void @__destroy_helper_block_
// CHECK: [[T0:%.*]] = load i8**
// CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]*
// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[T1]], i32 0, i32 5
@@ -66,7 +66,7 @@ void test3(void (^sink)(id*)) {
__strong id strong;
sink(&strong);
- // CHECK: define void @test3(
+ // CHECK-LABEL: define void @test3(
// CHECK: [[SINK:%.*]] = alloca void (i8**)*
// CHECK-NEXT: [[STRONG:%.*]] = alloca i8*
// CHECK-NEXT: [[TEMP:%.*]] = alloca i8*
@@ -108,7 +108,7 @@ void test4(void) {
__block id var = test4_source();
test4_helper(^{ var = 0; });
- // CHECK: define void @test4()
+ // CHECK-LABEL: define void @test4()
// CHECK: [[VAR:%.*]] = alloca [[BYREF_T:%.*]],
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 2
@@ -130,7 +130,7 @@ void test4(void) {
// CHECK-NEXT: call void @objc_release(i8* [[T0]])
// CHECK: ret void
- // CHECK: define internal void @__Block_byref_object_copy_
+ // CHECK-LABEL: define internal void @__Block_byref_object_copy_
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6
// CHECK-NEXT: load i8**
// CHECK-NEXT: bitcast i8* {{%.*}} to [[BYREF_T]]*
@@ -139,22 +139,22 @@ void test4(void) {
// CHECK-NEXT: store i8* [[T2]], i8** [[T0]]
// CHECK-NEXT: store i8* null, i8** [[T1]]
- // CHECK: define internal void @__Block_byref_object_dispose_
+ // CHECK-LABEL: define internal void @__Block_byref_object_dispose_
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6
// CHECK-NEXT: [[T1:%.*]] = load i8** [[T0]]
// CHECK-NEXT: call void @objc_release(i8* [[T1]])
- // CHECK: define internal void @__test4_block_invoke
+ // CHECK-LABEL: define internal void @__test4_block_invoke
// CHECK: [[SLOT:%.*]] = getelementptr inbounds {{.*}}, i32 0, i32 6
// CHECK-NEXT: [[T0:%.*]] = load i8** [[SLOT]], align 8
// CHECK-NEXT: store i8* null, i8** [[SLOT]],
// CHECK-NEXT: call void @objc_release(i8* [[T0]])
// CHECK-NEXT: ret void
- // CHECK: define internal void @__copy_helper_block_
+ // CHECK-LABEL: define internal void @__copy_helper_block_
// CHECK: call void @_Block_object_assign(i8* {{%.*}}, i8* {{%.*}}, i32 8)
- // CHECK: define internal void @__destroy_helper_block_
+ // CHECK-LABEL: define internal void @__destroy_helper_block_
// CHECK: call void @_Block_object_dispose(i8* {{%.*}}, i32 8)
}
@@ -164,7 +164,7 @@ void test5(void) {
__unsafe_unretained id var = test5_source();
test5_helper(^{ (void) var; });
- // CHECK: define void @test5()
+ // CHECK-LABEL: define void @test5()
// CHECK: [[VAR:%.*]] = alloca i8*
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK: [[T0:%.*]] = call i8* @test5_source()
@@ -187,7 +187,7 @@ void test6(void) {
__block __weak id var = test6_source();
test6_helper(^{ var = 0; });
- // CHECK: define void @test6()
+ // CHECK-LABEL: define void @test6()
// CHECK: [[VAR:%.*]] = alloca [[BYREF_T:%.*]],
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 2
@@ -209,27 +209,27 @@ void test6(void) {
// CHECK-NEXT: call void @objc_destroyWeak(i8** [[SLOT]])
// CHECK: ret void
- // CHECK: define internal void @__Block_byref_object_copy_
+ // CHECK-LABEL: define internal void @__Block_byref_object_copy_
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6
// CHECK-NEXT: load i8**
// CHECK-NEXT: bitcast i8* {{%.*}} to [[BYREF_T]]*
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6
// CHECK-NEXT: call void @objc_moveWeak(i8** [[T0]], i8** [[T1]])
- // CHECK: define internal void @__Block_byref_object_dispose_
+ // CHECK-LABEL: define internal void @__Block_byref_object_dispose_
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6
// CHECK-NEXT: call void @objc_destroyWeak(i8** [[T0]])
- // CHECK: define internal void @__test6_block_invoke
+ // CHECK-LABEL: define internal void @__test6_block_invoke
// CHECK: [[SLOT:%.*]] = getelementptr inbounds {{.*}}, i32 0, i32 6
// CHECK-NEXT: call i8* @objc_storeWeak(i8** [[SLOT]], i8* null)
// CHECK-NEXT: ret void
- // CHECK: define internal void @__copy_helper_block_
+ // CHECK-LABEL: define internal void @__copy_helper_block_
// 0x8 - FIELD_IS_BYREF (no FIELD_IS_WEAK because clang in control)
// CHECK: call void @_Block_object_assign(i8* {{%.*}}, i8* {{%.*}}, i32 8)
- // CHECK: define internal void @__destroy_helper_block_
+ // CHECK-LABEL: define internal void @__destroy_helper_block_
// 0x8 - FIELD_IS_BYREF (no FIELD_IS_WEAK because clang in control)
// CHECK: call void @_Block_object_dispose(i8* {{%.*}}, i32 8)
}
@@ -241,7 +241,7 @@ void test7(void) {
__weak id var = test7_source();
test7_helper(^{ test7_consume(var); });
- // CHECK: define void @test7()
+ // CHECK-LABEL: define void @test7()
// CHECK: [[VAR:%.*]] = alloca i8*,
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK: [[T0:%.*]] = call i8* @test7_source()
@@ -258,19 +258,19 @@ void test7(void) {
// CHECK-NEXT: call void @objc_destroyWeak(i8** [[VAR]])
// CHECK: ret void
- // CHECK: define internal void @__test7_block_invoke
+ // CHECK-LABEL: define internal void @__test7_block_invoke
// CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]]* {{%.*}}, i32 0, i32 5
// CHECK-NEXT: [[T0:%.*]] = call i8* @objc_loadWeakRetained(i8** [[SLOT]])
// CHECK-NEXT: call void @test7_consume(i8* [[T0]])
// CHECK-NEXT: call void @objc_release(i8* [[T0]])
// CHECK: ret void
- // CHECK: define internal void @__copy_helper_block_
+ // CHECK-LABEL: define internal void @__copy_helper_block_
// CHECK: getelementptr
// CHECK-NEXT: getelementptr
// CHECK-NEXT: call void @objc_copyWeak(
- // CHECK: define internal void @__destroy_helper_block_
+ // CHECK-LABEL: define internal void @__destroy_helper_block_
// CHECK: getelementptr
// CHECK-NEXT: call void @objc_destroyWeak(
}
@@ -311,7 +311,7 @@ id test9(void) {
return test9_produce();
}();
-// CHECK: define i8* @test9(
+// CHECK-LABEL: define i8* @test9(
// CHECK: load i8** getelementptr
// CHECK-NEXT: bitcast i8*
// CHECK-NEXT: call i8*
@@ -328,7 +328,7 @@ id test9(void) {
// when the initialization captures the variable.
void test10a(void) {
__block void (^block)(void) = ^{ block(); };
- // CHECK: define void @test10a()
+ // CHECK-LABEL: define void @test10a()
// CHECK: [[BYREF:%.*]] = alloca [[BYREF_T:%.*]],
// Zero-initialization before running the initializer.
@@ -362,7 +362,7 @@ void test10a(void) {
// We can also use _Block_object_assign/destroy with
// BLOCK_FIELD_IS_BLOCK as long as we don't pass BLOCK_BYREF_CALLER.
-// CHECK: define internal void @__Block_byref_object_copy
+// CHECK-LABEL: define internal void @__Block_byref_object_copy
// CHECK: [[D0:%.*]] = load i8** {{%.*}}
// CHECK-NEXT: [[D1:%.*]] = bitcast i8* [[D0]] to [[BYREF_T]]*
// CHECK-NEXT: [[D2:%.*]] = getelementptr inbounds [[BYREF_T]]* [[D1]], i32 0, i32 6
@@ -376,7 +376,7 @@ void test10a(void) {
// CHECK-NEXT: store void ()* [[T3]], void ()** [[D2]], align 8
// CHECK: ret void
-// CHECK: define internal void @__Block_byref_object_dispose
+// CHECK-LABEL: define internal void @__Block_byref_object_dispose
// CHECK: [[T0:%.*]] = load i8** {{%.*}}
// CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BYREF_T]]*
// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BYREF_T]]* [[T1]], i32 0, i32 6
@@ -391,7 +391,7 @@ void test10b(void) {
__block void (^block)(void);
block = ^{ block(); };
- // CHECK: define void @test10b()
+ // CHECK-LABEL: define void @test10b()
// CHECK: [[BYREF:%.*]] = alloca [[BYREF_T:%.*]],
// Zero-initialize.
@@ -427,7 +427,7 @@ void test11a(void) {
int x;
test11_helper(^{ (void) x; });
- // CHECK: define void @test11a()
+ // CHECK-LABEL: define void @test11a()
// CHECK: [[X:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], align 8
// CHECK: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to void ()*
@@ -444,7 +444,7 @@ void test11b(void) {
int x;
id b = ^{ (void) x; };
- // CHECK: define void @test11b()
+ // CHECK-LABEL: define void @test11b()
// CHECK: [[X:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[B:%.*]] = alloca i8*, align 8
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], align 8
@@ -487,7 +487,7 @@ void test13(id x) {
void (^b)(void) = (x ? ^{test13_helper(x);} : 0);
test13_use(b);
- // CHECK: define void @test13(
+ // CHECK-LABEL: define void @test13(
// CHECK: [[X:%.*]] = alloca i8*, align 8
// CHECK-NEXT: [[B:%.*]] = alloca void ()*, align 8
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:.*]], align 8
@@ -547,7 +547,7 @@ void test15(int a) {
void test16() {
void (^BLKVAR)(void) = ^{ BLKVAR(); };
- // CHECK: define void @test16(
+ // CHECK-LABEL: define void @test16(
// CHECK: [[BLKVAR:%.*]] = alloca void ()*, align 8
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5
@@ -567,7 +567,7 @@ id (^test17(id self, int which))(void) {
}
return (void*) 0;
}
-// CHECK: define i8* ()* @test17(
+// CHECK-LABEL: define i8* ()* @test17(
// CHECK: [[RET:%.*]] = alloca i8* ()*, align
// CHECK-NEXT: [[SELF:%.*]] = alloca i8*,
// CHECK: [[B0:%.*]] = alloca [[BLOCK:<.*>]], align
@@ -612,7 +612,7 @@ id (^test17(id self, int which))(void) {
// CHECK-NEXT: br label
void test18(id x) {
-// CHECK-UNOPT: define void @test18(
+// CHECK-UNOPT-LABEL: define void @test18(
// CHECK-UNOPT: [[X:%.*]] = alloca i8*,
// CHECK-UNOPT-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK-UNOPT-NEXT: store i8* null, i8** [[X]]
@@ -630,7 +630,7 @@ void test18(id x) {
extern void test18_helper(id (^)(void));
test18_helper(^{ return x; });
-// CHECK-UNOPT: define internal void @__copy_helper_block_
+// CHECK-UNOPT-LABEL: define internal void @__copy_helper_block_
// CHECK-UNOPT: [[T0:%.*]] = load i8**
// CHECK-UNOPT-NEXT: [[SRC:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]*
// CHECK-UNOPT-NEXT: [[T0:%.*]] = load i8**
@@ -642,7 +642,7 @@ void test18(id x) {
// CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[T1]], i8* [[T2]]) [[NUW]]
// CHECK-UNOPT-NEXT: ret void
-// CHECK-UNOPT: define internal void @__destroy_helper_block_
+// CHECK-UNOPT-LABEL: define internal void @__destroy_helper_block_
// CHECK-UNOPT: [[T0:%.*]] = load i8**
// CHECK-UNOPT-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]*
// CHECK-UNOPT-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[T1]], i32 0, i32 5
@@ -653,7 +653,7 @@ void test18(id x) {
// rdar://13588325
void test19_sink(void (^)(int));
void test19(void (^b)(void)) {
-// CHECK: define void @test19(
+// CHECK-LABEL: define void @test19(
// Prologue.
// CHECK: [[B:%.*]] = alloca void ()*,
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
diff --git a/test/CodeGenObjC/arc-bridged-cast.m b/test/CodeGenObjC/arc-bridged-cast.m
index eb9045d3d840..cdfe1dbfc55f 100644
--- a/test/CodeGenObjC/arc-bridged-cast.m
+++ b/test/CodeGenObjC/arc-bridged-cast.m
@@ -14,7 +14,7 @@ CFStringRef CFGetString(void);
id CreateSomething(void);
NSString *CreateNSString(void);
-// CHECK: define void @bridge_transfer_from_cf
+// CHECK-LABEL: define void @bridge_transfer_from_cf
void bridge_transfer_from_cf(int *i) {
// CHECK: store i32 7
*i = 7;
@@ -34,7 +34,7 @@ void bridge_transfer_from_cf(int *i) {
// CHECK-NEXT: ret void
}
-// CHECK: define void @bridge_from_cf
+// CHECK-LABEL: define void @bridge_from_cf
void bridge_from_cf(int *i) {
// CHECK: store i32 7
*i = 7;
@@ -53,7 +53,7 @@ void bridge_from_cf(int *i) {
// CHECK-NEXT: ret void
}
-// CHECK: define void @bridge_retained_of_cf
+// CHECK-LABEL: define void @bridge_retained_of_cf
void bridge_retained_of_cf(int *i) {
*i = 7;
// CHECK: call i8* @CreateSomething()
@@ -70,7 +70,7 @@ void bridge_retained_of_cf(int *i) {
// CHECK-NEXT: ret void
}
-// CHECK: define void @bridge_of_cf
+// CHECK-LABEL: define void @bridge_of_cf
void bridge_of_cf(int *i) {
// CHECK: store i32 7
*i = 7;
diff --git a/test/CodeGenObjC/arc-captured-32bit-block-var-layout-2.m b/test/CodeGenObjC/arc-captured-32bit-block-var-layout-2.m
index 3072316963ce..6ab02a916e8b 100644
--- a/test/CodeGenObjC/arc-captured-32bit-block-var-layout-2.m
+++ b/test/CodeGenObjC/arc-captured-32bit-block-var-layout-2.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple i386-apple-darwin -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-32.layout
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple i386-apple-darwin -print-ivar-layout -emit-llvm -o /dev/null %s > %t-32.layout
// RUN: FileCheck --input-file=%t-32.layout %s
// rdar://12184410
// rdar://12752901
diff --git a/test/CodeGenObjC/arc-captured-32bit-block-var-layout.m b/test/CodeGenObjC/arc-captured-32bit-block-var-layout.m
index 7ecdb4b1e9aa..45a894c38150 100644
--- a/test/CodeGenObjC/arc-captured-32bit-block-var-layout.m
+++ b/test/CodeGenObjC/arc-captured-32bit-block-var-layout.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple i386-apple-darwin -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-32.layout
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple i386-apple-darwin -print-ivar-layout -emit-llvm -o /dev/null %s > %t-32.layout
// RUN: FileCheck --input-file=%t-32.layout %s
// rdar://12184410
// rdar://12752901
diff --git a/test/CodeGenObjC/arc-captured-block-var-inlined-layout.m b/test/CodeGenObjC/arc-captured-block-var-inlined-layout.m
index 28c5bb4f5bf8..89e2b570b038 100644
--- a/test/CodeGenObjC/arc-captured-block-var-inlined-layout.m
+++ b/test/CodeGenObjC/arc-captured-block-var-inlined-layout.m
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
// RUN: FileCheck --input-file=%t-64.layout %s
-// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple i386-apple-darwin -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-32.layout
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple i386-apple-darwin -print-ivar-layout -emit-llvm -o /dev/null %s > %t-32.layout
// RUN: FileCheck -check-prefix=CHECK-i386 --input-file=%t-32.layout %s
// rdar://12184410
diff --git a/test/CodeGenObjC/arc-captured-block-var-layout.m b/test/CodeGenObjC/arc-captured-block-var-layout.m
index bc203072e788..42e6060dcc25 100644
--- a/test/CodeGenObjC/arc-captured-block-var-layout.m
+++ b/test/CodeGenObjC/arc-captured-block-var-layout.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.layout %s
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.layout %s
// rdar://12184410
// rdar://12752901
diff --git a/test/CodeGenObjC/arc-exceptions.m b/test/CodeGenObjC/arc-exceptions.m
index aa3d2f3640ca..dafffd81f506 100644
--- a/test/CodeGenObjC/arc-exceptions.m
+++ b/test/CodeGenObjC/arc-exceptions.m
@@ -11,7 +11,7 @@ void test0(void) {
} @catch (Ety *e) {
}
}
-// CHECK: define void @test0()
+// CHECK-LABEL: define void @test0()
// CHECK: [[E:%.*]] = alloca [[ETY:%.*]]*, align 8
// CHECK-NEXT: invoke void @test0_helper()
// CHECK: [[T0:%.*]] = call i8* @objc_begin_catch(
@@ -31,7 +31,7 @@ void test1(void) {
} @catch (__weak Ety *e) {
}
}
-// CHECK: define void @test1()
+// CHECK-LABEL: define void @test1()
// CHECK: [[E:%.*]] = alloca [[ETY:%.*]]*, align 8
// CHECK-NEXT: invoke void @test1_helper()
// CHECK: [[T0:%.*]] = call i8* @objc_begin_catch(
diff --git a/test/CodeGenObjC/arc-foreach.m b/test/CodeGenObjC/arc-foreach.m
index 176b28d3a278..44561818c94f 100644
--- a/test/CodeGenObjC/arc-foreach.m
+++ b/test/CodeGenObjC/arc-foreach.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -emit-llvm %s -o %t-64.s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// rdar://9503326
// rdar://9606600
@@ -22,7 +22,7 @@ void test0(NSArray *array) {
}
}
-// CHECK-LP64: define void @test0(
+// CHECK-LP64-LABEL: define void @test0(
// CHECK-LP64: [[ARRAY:%.*]] = alloca [[ARRAY_T:%.*]]*,
// CHECK-LP64-NEXT: [[X:%.*]] = alloca i8*,
// CHECK-LP64-NEXT: [[STATE:%.*]] = alloca [[STATE_T:%.*]],
@@ -82,7 +82,7 @@ void test0(NSArray *array) {
// CHECK-LP64-NEXT: call void @objc_storeStrong(i8** [[T0]], i8* null)
// CHECK-LP64-NEXT: ret void
-// CHECK-LP64: define internal void @__test0_block_invoke
+// CHECK-LP64-LABEL: define internal void @__test0_block_invoke
// CHECK-LP64: [[BLOCK:%.*]] = bitcast i8* {{%.*}} to [[BLOCK_T]]*
// CHECK-LP64-NOT: ret
// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5
@@ -95,7 +95,7 @@ void test1(NSArray *array) {
}
}
-// CHECK-LP64: define void @test1(
+// CHECK-LP64-LABEL: define void @test1(
// CHECK-LP64: alloca [[ARRAY_T:%.*]]*,
// CHECK-LP64-NEXT: [[X:%.*]] = alloca i8*,
// CHECK-LP64-NEXT: [[STATE:%.*]] = alloca [[STATE_T:%.*]],
@@ -128,7 +128,7 @@ void test2(Test2 *a) {
}
}
-// CHECK-LP64: define void @test2(
+// CHECK-LP64-LABEL: define void @test2(
// CHECK-LP64: [[T0:%.*]] = call [[ARRAY_T]]* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to [[ARRAY_T]]* (i8*, i8*)*)(
// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[ARRAY_T]]* [[T0]] to i8*
// CHECK-LP64-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]])
@@ -160,7 +160,7 @@ void test3(NSArray *array) {
use(x);
}
- // CHECK-LP64: define void @test3(
+ // CHECK-LP64-LABEL: define void @test3(
// CHECK-LP64: [[ARRAY:%.*]] = alloca [[ARRAY_T]]*, align 8
// CHECK-LP64-NEXT: [[X:%.*]] = alloca i8*, align 8
// CHECK-LP64: [[T0:%.*]] = load i8** [[X]], align 8
diff --git a/test/CodeGenObjC/arc-ivar-layout.m b/test/CodeGenObjC/arc-ivar-layout.m
index 90683149d5bb..62428f5aefc7 100644
--- a/test/CodeGenObjC/arc-ivar-layout.m
+++ b/test/CodeGenObjC/arc-ivar-layout.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// REQUIRES: x86-64-registered-target
// rdar://8991729
diff --git a/test/CodeGenObjC/arc-linetable-autorelease.m b/test/CodeGenObjC/arc-linetable-autorelease.m
new file mode 100644
index 000000000000..be05ec2fcd8e
--- /dev/null
+++ b/test/CodeGenObjC/arc-linetable-autorelease.m
@@ -0,0 +1,40 @@
+// RUN: %clang_cc1 -emit-llvm -fobjc-arc -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+// Ensure that the line info is making sense:
+// ARC cleanups should be at the closing '}'.
+@protocol NSObject
+@end
+
+@interface NSObject <NSObject> {}
+@end
+
+@protocol NSCopying
+@end
+
+@protocol NSCoding
+@end
+
+typedef double CGFloat;
+struct CGRect {};
+typedef struct CGRect CGRect;
+typedef CGRect NSRect;
+NSRect NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h);
+@interface NSBezierPath : NSObject <NSCopying, NSCoding>
++ (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect xRadius:(CGFloat)xRadius yRadius:(CGFloat)yRadius;
+@end
+@implementation AppDelegate : NSObject {}
+- (NSBezierPath *)_createBezierPathWithWidth:(CGFloat)width height:(CGFloat)height radius:(CGFloat)radius lineWidth:(CGFloat)lineWidth
+{
+ NSRect rect = NSMakeRect(0, 0, width, height);
+ NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:radius yRadius:radius];
+ CGFloat pattern[2];
+ // CHECK: define {{.*}}_createBezierPathWithWidth
+ // CHECK: load {{.*}} %path, align {{.*}}, !dbg ![[RET:[0-9]+]]
+ // CHECK: call void @objc_storeStrong{{.*}} !dbg ![[ARC1:[0-9]+]]
+ // CHECK: call {{.*}} @objc_autoreleaseReturnValue{{.*}} !dbg ![[ARC2:[0-9]+]]
+ // CHECK: ret {{.*}} !dbg ![[ARC2]]
+ // CHECK: ![[RET]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
+ return path;
+ // CHECK: ![[ARC1]] = metadata !{i32 [[@LINE+2]], i32 0, metadata !{{.*}}, null}
+ // CHECK: ![[ARC2]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
+}
+@end
diff --git a/test/CodeGenObjC/arc-literals.m b/test/CodeGenObjC/arc-literals.m
index 78c5d9d23721..19a5516dc7ca 100644
--- a/test/CodeGenObjC/arc-literals.m
+++ b/test/CodeGenObjC/arc-literals.m
@@ -12,7 +12,7 @@
// CHECK: c"dictionaryWithObjects:forKeys:count:\00"
// CHECK: c"prop\00"
-// CHECK: define void @test_numeric()
+// CHECK-LABEL: define void @test_numeric()
void test_numeric() {
// CHECK: {{call.*objc_msgSend.*i32 17}}
// CHECK: call i8* @objc_retainAutoreleasedReturnValue
@@ -33,7 +33,7 @@ void test_numeric() {
// CHECK-NEXT: ret void
}
-// CHECK: define void @test_array
+// CHECK-LABEL: define void @test_array
void test_array(id a, id b) {
// CHECK: [[A:%.*]] = alloca i8*,
// CHECK: [[B:%.*]] = alloca i8*,
@@ -65,7 +65,7 @@ void test_array(id a, id b) {
// CHECK-NEXT: ret void
}
-// CHECK: define void @test_dictionary
+// CHECK-LABEL: define void @test_dictionary
void test_dictionary(id k1, id o1, id k2, id o2) {
// CHECK: [[K1:%.*]] = alloca i8*,
// CHECK: [[O1:%.*]] = alloca i8*,
@@ -119,7 +119,7 @@ void test_dictionary(id k1, id o1, id k2, id o2) {
@property (retain) A* prop;
@end
-// CHECK: define void @test_property
+// CHECK-LABEL: define void @test_property
void test_property(B *b) {
// Retain parameter
// CHECK: call i8* @objc_retain
diff --git a/test/CodeGenObjC/arc-loadweakretained-release.m b/test/CodeGenObjC/arc-loadweakretained-release.m
index 00d25fac0db9..a84719d606de 100644
--- a/test/CodeGenObjC/arc-loadweakretained-release.m
+++ b/test/CodeGenObjC/arc-loadweakretained-release.m
@@ -42,7 +42,7 @@ void test1(int cond) {
test34_sink(cond ? &weak : 0);
}
-// CHECK: define void @test1(
+// CHECK-LABEL: define void @test1(
// CHECK: [[CONDADDR:%.*]] = alloca i32
// CHECK-NEXT: [[WEAK:%.*]] = alloca i8*
// CHECK-NEXT: [[INCRTEMP:%.*]] = alloca i8*
diff --git a/test/CodeGenObjC/arc-no-arc-exceptions.m b/test/CodeGenObjC/arc-no-arc-exceptions.m
index 008c848987e1..681891bf7dcc 100644
--- a/test/CodeGenObjC/arc-no-arc-exceptions.m
+++ b/test/CodeGenObjC/arc-no-arc-exceptions.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fblocks -fexceptions -fobjc-exceptions -O2 -disable-llvm-optzns -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fblocks -fexceptions -fobjc-exceptions -O0 -disable-llvm-optzns -o - %s | FileCheck -check-prefix=NO-METADATA %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fblocks -fexceptions -fobjc-exceptions -disable-llvm-optzns -o - %s | FileCheck -check-prefix=NO-METADATA %s
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fblocks -fexceptions -fobjc-exceptions -O2 -disable-llvm-optzns -o - %s -fobjc-arc-exceptions | FileCheck -check-prefix=NO-METADATA %s
// The front-end should emit clang.arc.no_objc_arc_exceptions in -fobjc-arc-exceptions
@@ -8,10 +8,10 @@
void thrower(void);
void not(void) __attribute__((nothrow));
-// CHECK: define void @test0(
+// CHECK-LABEL: define void @test0(
// CHECK: call void @thrower(), !clang.arc.no_objc_arc_exceptions !
// CHECK: call void @not() [[NUW:#[0-9]+]], !clang.arc.no_objc_arc_exceptions !
-// NO-METADATA: define void @test0(
+// NO-METADATA-LABEL: define void @test0(
// NO-METADATA-NOT: !clang.arc.no_objc_arc_exceptions
// NO-METADATA: }
void test0(void) {
@@ -19,10 +19,10 @@ void test0(void) {
not();
}
-// CHECK: define void @test1(
+// CHECK-LABEL: define void @test1(
// CHECK: call void @thrower(), !clang.arc.no_objc_arc_exceptions !
// CHECK: call void @not() [[NUW]], !clang.arc.no_objc_arc_exceptions !
-// NO-METADATA: define void @test1(
+// NO-METADATA-LABEL: define void @test1(
// NO-METADATA-NOT: !clang.arc.no_objc_arc_exceptions
// NO-METADATA: }
void test1(id x) {
@@ -33,10 +33,10 @@ void test1(id x) {
void NSLog(id, ...);
-// CHECK: define void @test2(
+// CHECK-LABEL: define void @test2(
// CHECK: invoke void (i8*, ...)* @NSLog(i8* bitcast (%struct.NSConstantString* @_unnamed_cfstring_ to i8*), i32* %{{.*}})
// CHECK: to label %{{.*}} unwind label %{{.*}}, !clang.arc.no_objc_arc_exceptions !
-// NO-METADATA: define void @test2(
+// NO-METADATA-LABEL: define void @test2(
// NO-METADATA-NOT: !clang.arc.no_objc_arc_exceptions
// NO-METADATA: }
void test2(void) {
@@ -46,10 +46,10 @@ void test2(void) {
}
}
-// CHECK: define void @test3(
+// CHECK-LABEL: define void @test3(
// CHECK: invoke void %{{.*}}(i8* %{{.*}})
// CHECK: to label %{{.*}} unwind label %{{.*}}, !clang.arc.no_objc_arc_exceptions !
-// NO-METADATA: define void @test3(
+// NO-METADATA-LABEL: define void @test3(
// NO-METADATA-NOT: !clang.arc.no_objc_arc_exceptions
// NO-METADATA: }
void test3(void) {
@@ -61,10 +61,10 @@ void test3(void) {
}
}
-// CHECK: define void @test4(
+// CHECK-LABEL: define void @test4(
// CHECK: invoke void %{{.*}}(i8* %{{.*}})
// CHECK: to label %{{.*}} unwind label %{{.*}}, !clang.arc.no_objc_arc_exceptions !
-// NO-METADATA: define void @test4(
+// NO-METADATA-LABEL: define void @test4(
// NO-METADATA-NOT: !clang.arc.no_objc_arc_exceptions
// NO-METADATA: }
void test4(void) {
diff --git a/test/CodeGenObjC/arc-precise-lifetime.m b/test/CodeGenObjC/arc-precise-lifetime.m
index 595a4f9fdf26..e15d5d4835ce 100644
--- a/test/CodeGenObjC/arc-precise-lifetime.m
+++ b/test/CodeGenObjC/arc-precise-lifetime.m
@@ -25,11 +25,12 @@ void test0() {
// rdar://problem/9821110
@interface Test1
- (char*) interior __attribute__((objc_returns_inner_pointer));
-// Should we allow this on properties?
+// Should we allow this on properties? Yes! see // rdar://14990439
+@property (nonatomic, readonly) char * PropertyReturnsInnerPointer __attribute__((objc_returns_inner_pointer));
@end
extern Test1 *test1_helper(void);
-// CHECK: define void @test1a()
+// CHECK-LABEL: define void @test1a()
void test1a(void) {
// CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper()
// CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8*
@@ -52,7 +53,7 @@ void test1a(void) {
char *c = [(ptr) interior];
}
-// CHECK: define void @test1b()
+// CHECK-LABEL: define void @test1b()
void test1b(void) {
// CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper()
// CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8*
@@ -73,12 +74,56 @@ void test1b(void) {
char *c = [ptr interior];
}
+void test1c(void) {
+ // CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper()
+ // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8*
+ // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]])
+ // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]*
+ // CHECK-NEXT: store [[TEST1]]* [[T3]]
+ // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]**
+ // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8*
+ // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutorelease(i8* [[T1]])
+ // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]*
+ // CHECK-NEXT: [[T4:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_
+ // CHECK-NEXT: [[T5:%.*]] = bitcast [[TEST1]]* [[T3]] to i8*
+ // CHECK-NEXT: [[T6:%.*]] = call i8* bitcast
+ // CHECK-NEXT: store i8* [[T6]], i8**
+ // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]**
+ // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8*
+ // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release
+ // CHECK-NEXT: ret void
+ Test1 *ptr = test1_helper();
+ char *pc = ptr.PropertyReturnsInnerPointer;
+}
+
+void test1d(void) {
+ // CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper()
+ // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8*
+ // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]])
+ // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]*
+ // CHECK-NEXT: store [[TEST1]]* [[T3]]
+ // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]**
+ // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST1]]* [[T0]] to i8*
+ // CHECK-NEXT: [[T3:%.*]] = call i8* @objc_retainAutorelease
+ // CHECK-NEXT: [[SIX:%.*]] = bitcast i8* [[T3]] to [[TEST1]]*
+ // CHECK-NEXT: [[SEVEN:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_
+ // CHECK-NEXT: [[EIGHT:%.*]] = bitcast [[TEST1]]* [[SIX]] to i8*
+ // CHECK-NEXT: [[CALL1:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[EIGHT]], i8* [[SEVEN]])
+ // CHECK-NEXT: store i8* [[CALL1]], i8**
+ // CHECK-NEXT: [[NINE:%.*]] = load [[TEST1]]**
+ // CHECK-NEXT: [[TEN:%.*]] = bitcast [[TEST1]]* [[NINE]] to i8*
+ // CHECK-NEXT: call void @objc_release(i8* [[TEN]])
+ // CHECK-NEXT: ret void
+ __attribute__((objc_precise_lifetime)) Test1 *ptr = test1_helper();
+ char *pc = ptr.PropertyReturnsInnerPointer;
+}
+
@interface Test2 {
@public
id ivar;
}
@end
-// CHECK: define void @test2(
+// CHECK-LABEL: define void @test2(
void test2(Test2 *x) {
x->ivar = 0;
// CHECK: [[X:%.*]] = alloca [[TEST2:%.*]]*
@@ -104,7 +149,7 @@ void test2(Test2 *x) {
// CHECK-NEXT: ret void
}
-// CHECK: define void @test3(i8*
+// CHECK-LABEL: define void @test3(i8*
void test3(PRECISE_LIFETIME id x) {
// CHECK: [[X:%.*]] = alloca i8*,
// CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retain(i8* {{%.*}}) [[NUW]]
diff --git a/test/CodeGenObjC/arc-property.m b/test/CodeGenObjC/arc-property.m
index dde02d7dd710..c3c7e2bc11ec 100644
--- a/test/CodeGenObjC/arc-property.m
+++ b/test/CodeGenObjC/arc-property.m
@@ -7,7 +7,7 @@
void test0(Test0 *t0, id value) {
t0.value = value;
}
-// CHECK: define void @test0(
+// CHECK-LABEL: define void @test0(
// CHECK: call void @objc_storeStrong
// CHECK: call void @objc_storeStrong
// CHECK: @objc_msgSend
diff --git a/test/CodeGenObjC/arc-related-result-type.m b/test/CodeGenObjC/arc-related-result-type.m
index e8b97012cdcc..72d287187920 100644
--- a/test/CodeGenObjC/arc-related-result-type.m
+++ b/test/CodeGenObjC/arc-related-result-type.m
@@ -6,7 +6,7 @@
void test0(Test0 *val) {
Test0 *x = [val self];
-// CHECK: define void @test0(
+// CHECK-LABEL: define void @test0(
// CHECK: [[VAL:%.*]] = alloca [[TEST0:%.*]]*
// CHECK-NEXT: [[X:%.*]] = alloca [[TEST0]]*
// CHECK-NEXT: store [[TEST0]]* null
diff --git a/test/CodeGenObjC/arc-ternary-op.m b/test/CodeGenObjC/arc-ternary-op.m
index f70e8864a047..217db8019417 100644
--- a/test/CodeGenObjC/arc-ternary-op.m
+++ b/test/CodeGenObjC/arc-ternary-op.m
@@ -3,7 +3,7 @@
void test0(_Bool cond) {
id test0_helper(void) __attribute__((ns_returns_retained));
- // CHECK: define void @test0(
+ // CHECK-LABEL: define void @test0(
// CHECK: [[COND:%.*]] = alloca i8,
// CHECK-NEXT: [[X:%.*]] = alloca i8*,
// CHECK-NEXT: [[RELVAL:%.*]] = alloca i8*
@@ -40,7 +40,7 @@ void test1(int cond) {
test1_sink(cond ? &strong : 0);
test1_sink(cond ? &weak : 0);
- // CHECK: define void @test1(
+ // CHECK-LABEL: define void @test1(
// CHECK: [[COND:%.*]] = alloca i32
// CHECK-NEXT: [[STRONG:%.*]] = alloca i8*
// CHECK-NEXT: [[WEAK:%.*]] = alloca i8*
@@ -106,7 +106,7 @@ void test2(int cond) {
for (id obj in cond ? test2_producer() : (void*) 0) {
}
- // CHECK: define void @test2(
+ // CHECK-LABEL: define void @test2(
// CHECK: [[COND:%.*]] = alloca i32,
// CHECK: alloca i8*
// CHECK: [[CLEANUP_SAVE:%.*]] = alloca i8*
diff --git a/test/CodeGenObjC/arc-unopt.m b/test/CodeGenObjC/arc-unopt.m
index 84f5d34b196e..c0e67dfd3b0f 100644
--- a/test/CodeGenObjC/arc-unopt.m
+++ b/test/CodeGenObjC/arc-unopt.m
@@ -55,7 +55,7 @@ void test5(void) {
if ((x = y))
y = 0;
-// CHECK: define void @test5()
+// CHECK-LABEL: define void @test5()
// CHECK: [[X:%.*]] = alloca [[TEST5:%.*]]*,
// CHECK-NEXT: [[Y:%.*]] = alloca [[TEST5:%.*]]*,
// CHECK-NEXT: store [[TEST5]]* null, [[TEST5]]** [[X]],
diff --git a/test/CodeGenObjC/arc-unoptimized-byref-var.m b/test/CodeGenObjC/arc-unoptimized-byref-var.m
index d3189e15d3d1..4a30c6af7f1c 100644
--- a/test/CodeGenObjC/arc-unoptimized-byref-var.m
+++ b/test/CodeGenObjC/arc-unoptimized-byref-var.m
@@ -3,7 +3,7 @@
void test19() {
__block id x;
-// CHECK-UNOPT: define internal void @__Block_byref_object_copy
+// CHECK-UNOPT-LABEL: define internal void @__Block_byref_object_copy
// CHECK-UNOPT: [[X:%.*]] = getelementptr inbounds [[BYREF_T:%.*]]* [[VAR:%.*]], i32 0, i32 6
// CHECK-UNOPT: [[X2:%.*]] = getelementptr inbounds [[BYREF_T:%.*]]* [[VAR1:%.*]], i32 0, i32 6
// CHECK-UNOPT-NEXT: [[SIX:%.*]] = load i8** [[X2]], align 8
diff --git a/test/CodeGenObjC/arc-with-atthrow.m b/test/CodeGenObjC/arc-with-atthrow.m
index 257037679af0..e5295159ce5e 100644
--- a/test/CodeGenObjC/arc-with-atthrow.m
+++ b/test/CodeGenObjC/arc-with-atthrow.m
@@ -9,7 +9,7 @@ void test() {
// TODO: We should probably emit this specific pattern without the reclaim.
-// CHECK: define void @test()
+// CHECK-LABEL: define void @test()
// CHECK: [[T0:%.*]] = call i8* @make()
// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
// CHECK-NEXT: [[T2:%.*]] = call i8* @objc_autorelease(i8* [[T1]])
diff --git a/test/CodeGenObjC/arc.m b/test/CodeGenObjC/arc.m
index 7262dc8d7b1c..00cdb6fcc529 100644
--- a/test/CodeGenObjC/arc.m
+++ b/test/CodeGenObjC/arc.m
@@ -32,7 +32,7 @@
// ARC-NATIVE: declare i8* @objc_autorelease(i8*)
// ARC-NATIVE: declare i8* @objc_retainAutorelease(i8*)
-// CHECK: define void @test0
+// CHECK-LABEL: define void @test0
void test0(id x) {
// CHECK: [[X:%.*]] = alloca i8*
// CHECK-NEXT: [[PARM:%.*]] = call i8* @objc_retain(i8* {{.*}})
@@ -42,7 +42,7 @@ void test0(id x) {
// CHECK-NEXT: ret void
}
-// CHECK: define i8* @test1(i8*
+// CHECK-LABEL: define i8* @test1(i8*
id test1(id x) {
// CHECK: [[X:%.*]] = alloca i8*
// CHECK-NEXT: [[Y:%.*]] = alloca i8*
@@ -94,7 +94,7 @@ id test1(id x) {
- (id) copy;
@end
-// CHECK: define void @test3_unelided()
+// CHECK-LABEL: define void @test3_unelided()
void test3_unelided() {
extern void test3_helper(void);
@@ -125,7 +125,7 @@ void test3_unelided() {
// CHECK-NEXT: ret void
}
-// CHECK: define void @test3()
+// CHECK-LABEL: define void @test3()
void test3() {
// CHECK: [[X:%.*]] = alloca i8*
@@ -166,7 +166,7 @@ void test3() {
// CHECK-NEXT: ret void
}
-// CHECK: define i8* @test4()
+// CHECK-LABEL: define i8* @test4()
id test4() {
// Call to +alloc.
// CHECK: load {{.*}}* @"\01L_OBJC_CLASSLIST_REFERENCES_
@@ -197,7 +197,7 @@ id test4() {
}
@end
-// CHECK: define void @test5
+// CHECK-LABEL: define void @test5
void test5(Test5 *x, id y) {
// Prologue.
// CHECK: [[X:%.*]] = alloca [[TEST5:%.*]]*,
@@ -241,7 +241,7 @@ void test5(Test5 *x, id y) {
}
id test6_helper(void) __attribute__((ns_returns_retained));
-// CHECK: define void @test6()
+// CHECK-LABEL: define void @test6()
void test6() {
// CHECK: [[X:%.*]] = alloca i8*
// CHECK-NEXT: [[CALL:%.*]] = call i8* @test6_helper()
@@ -253,7 +253,7 @@ void test6() {
}
void test7_helper(id __attribute__((ns_consumed)));
-// CHECK: define void @test7()
+// CHECK-LABEL: define void @test7()
void test7() {
// CHECK: [[X:%.*]] = alloca i8*
// CHECK-NEXT: store i8* null, i8** [[X]]
@@ -284,7 +284,7 @@ void test10() {
Test10 *x;
id y = x.me.me;
- // CHECK: define void @test10()
+ // CHECK-LABEL: define void @test10()
// CHECK: [[X:%.*]] = alloca [[TEST10:%.*]]*, align
// CHECK-NEXT: [[Y:%.*]] = alloca i8*, align
// CHECK-NEXT: store [[TEST10]]* null, [[TEST10]]** [[X]]
@@ -314,7 +314,7 @@ void test10() {
}
void test11(id (*f)(void) __attribute__((ns_returns_retained))) {
- // CHECK: define void @test11(
+ // CHECK-LABEL: define void @test11(
// CHECK: [[F:%.*]] = alloca i8* ()*, align
// CHECK-NEXT: [[X:%.*]] = alloca i8*, align
// CHECK-NEXT: store i8* ()* {{%.*}}, i8* ()** [[F]], align
@@ -330,7 +330,7 @@ void test11(id (*f)(void) __attribute__((ns_returns_retained))) {
void test12(void) {
extern id test12_helper(void);
- // CHECK: define void @test12()
+ // CHECK-LABEL: define void @test12()
// CHECK: [[X:%.*]] = alloca i8*, align
// CHECK-NEXT: [[Y:%.*]] = alloca i8*, align
@@ -358,7 +358,7 @@ void test12(void) {
// Indirect consuming calls.
void test13(void) {
- // CHECK: define void @test13()
+ // CHECK-LABEL: define void @test13()
// CHECK: [[X:%.*]] = alloca i8*, align
// CHECK-NEXT: store i8* null, i8** [[X]], align
id x;
@@ -458,7 +458,7 @@ void test13(void) {
@end
void test19() {
- // CHECK: define void @test19()
+ // CHECK-LABEL: define void @test19()
// CHECK: [[X:%.*]] = alloca [5 x i8*], align 16
// CHECK: call void @llvm.lifetime.start
// CHECK-NEXT: [[T0:%.*]] = bitcast [5 x i8*]* [[X]] to i8*
@@ -490,7 +490,7 @@ void test19() {
}
void test20(unsigned n) {
- // CHECK: define void @test20
+ // CHECK-LABEL: define void @test20
// CHECK: [[N:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[SAVED_STACK:%.*]] = alloca i8*
// CHECK-NEXT: store i32 {{%.*}}, i32* [[N]], align 4
@@ -531,7 +531,7 @@ void test20(unsigned n) {
}
void test21(unsigned n) {
- // CHECK: define void @test21
+ // CHECK-LABEL: define void @test21
// CHECK: [[N:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[SAVED_STACK:%.*]] = alloca i8*
// CHECK-NEXT: store i32 {{%.*}}, i32* [[N]], align 4
@@ -829,7 +829,7 @@ char *helper;
@end
__attribute__((ns_returns_retained)) id test32(void) {
-// CHECK: define i8* @test32()
+// CHECK-LABEL: define i8* @test32()
// CHECK: [[CALL:%.*]] = call i8* @test32_helper()
// CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[CALL]])
// CHECK-NEXT: ret i8* [[T0]]
@@ -932,7 +932,7 @@ void test33(Test33 *ptr) {
}
-// CHECK: define void @test36
+// CHECK-LABEL: define void @test36
void test36(id x) {
// CHECK: [[X:%.*]] = alloca i8*
@@ -960,7 +960,7 @@ void test37(void) {
Test37 *var;
test37_helper(&var);
- // CHECK: define void @test37()
+ // CHECK-LABEL: define void @test37()
// CHECK: [[VAR:%.*]] = alloca [[TEST37:%.*]]*,
// CHECK-NEXT: [[TEMP:%.*]] = alloca i8*
// CHECK-NEXT: store [[TEST37]]* null, [[TEST37]]** [[VAR]]
@@ -1037,7 +1037,7 @@ void test47(void) {
extern id test47_helper(void);
id x = x = test47_helper();
- // CHECK: define void @test47()
+ // CHECK-LABEL: define void @test47()
// CHECK: [[X:%.*]] = alloca i8*
// CHECK-NEXT: store i8* null, i8** [[X]]
// CHECK-NEXT: [[CALL:%.*]] = call i8* @test47_helper()
@@ -1057,7 +1057,7 @@ void test47(void) {
void test48(void) {
extern id test48_helper(void);
__weak id x = x = test48_helper();
- // CHECK: define void @test48()
+ // CHECK-LABEL: define void @test48()
// CHECK: [[X:%.*]] = alloca i8*
// CHECK-NEXT: [[T0:%.*]] = call i8* @objc_initWeak(i8** [[X]], i8* null)
// CHECK-NEXT: [[T1:%.*]] = call i8* @test48_helper()
@@ -1072,7 +1072,7 @@ void test48(void) {
void test49(void) {
extern id test49_helper(void);
__autoreleasing id x = x = test49_helper();
- // CHECK: define void @test49()
+ // CHECK-LABEL: define void @test49()
// CHECK: [[X:%.*]] = alloca i8*
// CHECK-NEXT: store i8* null, i8** [[X]]
// CHECK-NEXT: [[CALL:%.*]] = call i8* @test49_helper()
@@ -1113,13 +1113,16 @@ id test52(void) {
id test52_helper(int) __attribute__((ns_returns_retained));
return ({ int x = 5; test52_helper(x); });
-// CHECK: define i8* @test52()
+// CHECK-LABEL: define i8* @test52()
// CHECK: [[X:%.*]] = alloca i32
+// CHECK-NEXT: [[TMPALLOCA:%.*]] = alloca i8*
// CHECK-NEXT: store i32 5, i32* [[X]],
// CHECK-NEXT: [[T0:%.*]] = load i32* [[X]],
// CHECK-NEXT: [[T1:%.*]] = call i8* @test52_helper(i32 [[T0]])
-// CHECK-NEXT: [[T2:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[T1]])
-// CHECK-NEXT: ret i8* [[T2]]
+// CHECK-NEXT: store i8* [[T1]], i8** [[TMPALLOCA]]
+// CHECK-NEXT: [[T2:%.*]] = load i8** [[TMPALLOCA]]
+// CHECK-NEXT: [[T3:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[T2]])
+// CHECK-NEXT: ret i8* [[T3]]
}
// rdar://problem/9400644
@@ -1127,17 +1130,20 @@ void test53(void) {
id test53_helper(void);
id x = ({ id y = test53_helper(); y; });
(void) x;
-// CHECK: define void @test53()
+// CHECK-LABEL: define void @test53()
// CHECK: [[X:%.*]] = alloca i8*,
// CHECK-NEXT: [[Y:%.*]] = alloca i8*,
+// CHECK-NEXT: [[TMPALLOCA:%.*]] = alloca i8*,
// CHECK-NEXT: [[T0:%.*]] = call i8* @test53_helper()
// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
// CHECK-NEXT: store i8* [[T1]], i8** [[Y]],
// CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]],
// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]])
+// CHECK-NEXT: store i8* [[T1]], i8** [[TMPALLOCA]]
// CHECK-NEXT: [[T2:%.*]] = load i8** [[Y]]
// CHECK-NEXT: call void @objc_release(i8* [[T2]])
-// CHECK-NEXT: store i8* [[T1]], i8** [[X]],
+// CHECK-NEXT: [[T3:%.*]] = load i8** [[TMPALLOCA]]
+// CHECK-NEXT: store i8* [[T3]], i8** [[X]],
// CHECK-NEXT: load i8** [[X]],
// CHECK-NEXT: [[T0:%.*]] = load i8** [[X]]
// CHECK-NEXT: call void @objc_release(i8* [[T0]])
@@ -1145,7 +1151,7 @@ void test53(void) {
}
// <rdar://problem/9758798>
-// CHECK: define void @test54(i32 %first, ...)
+// CHECK-LABEL: define void @test54(i32 %first, ...)
void test54(int first, ...) {
__builtin_va_list arglist;
// CHECK: call void @llvm.va_start
@@ -1185,7 +1191,7 @@ void test54(int first, ...) {
@end
void test56_test(void) {
id x = [Test56 make];
- // CHECK: define void @test56_test()
+ // CHECK-LABEL: define void @test56_test()
// CHECK: [[X:%.*]] = alloca i8*, align 8
// CHECK: [[T0:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(
// CHECK-NEXT: store i8* [[T0]], i8** [[X]]
@@ -1239,7 +1245,7 @@ void test59(void) {
test59_body();
}
- // CHECK: define void @test59()
+ // CHECK-LABEL: define void @test59()
// CHECK: [[T0:%.*]] = call i8* @test59_getlock()
// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
// CHECK-NEXT: call i32 @objc_sync_enter(i8* [[T1]])
@@ -1257,7 +1263,7 @@ void test59(void) {
- (id) test61_id;
@end
void test61(void) {
- // CHECK: define void @test61()
+ // CHECK-LABEL: define void @test61()
// CHECK: [[Y:%.*]] = alloca i8*, align 8
extern id test61_make(void);
@@ -1287,7 +1293,7 @@ void test61(void) {
// rdar://problem/9891815
void test62(void) {
- // CHECK: define void @test62()
+ // CHECK-LABEL: define void @test62()
// CHECK: [[I:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[CLEANUP_VALUE:%.*]] = alloca i8*
// CHECK-NEXT: [[CLEANUP_REQUIRED:%.*]] = alloca i1
@@ -1359,7 +1365,7 @@ void test66(void) {
extern id test66_arg(void);
[test66_receiver() consume: test66_arg()];
}
-// CHECK: define void @test66()
+// CHECK-LABEL: define void @test66()
// CHECK: [[T0:%.*]] = call [[TEST66:%.*]]* @test66_receiver()
// CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST66]]* [[T0]] to i8*
// CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]])
@@ -1383,7 +1389,7 @@ Class test67_helper(void);
void test67(void) {
Class cl = test67_helper();
}
-// CHECK: define void @test67()
+// CHECK-LABEL: define void @test67()
// CHECK: [[CL:%.*]] = alloca i8*, align 8
// CHECK-NEXT: [[T0:%.*]] = call i8* @test67_helper()
// CHECK-NEXT: store i8* [[T0]], i8** [[CL]], align 8
@@ -1393,7 +1399,7 @@ Class test68_helper(void);
void test68(void) {
__strong Class cl = test67_helper();
}
-// CHECK: define void @test68()
+// CHECK-LABEL: define void @test68()
// CHECK: [[CL:%.*]] = alloca i8*, align 8
// CHECK-NEXT: [[T0:%.*]] = call i8* @test67_helper()
// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
@@ -1415,7 +1421,7 @@ void test68(void) {
// rdar://problem/10907547
void test70(id i) {
- // CHECK: define void @test70
+ // CHECK-LABEL: define void @test70
// CHECK: store i8* null, i8**
// CHECK: store i8* null, i8**
// CHECK: [[ID:%.*]] = call i8* @objc_retain(i8*
diff --git a/test/CodeGenObjC/assign.m b/test/CodeGenObjC/assign.m
index bdc99c635835..7d0c06f74353 100644
--- a/test/CodeGenObjC/assign.m
+++ b/test/CodeGenObjC/assign.m
@@ -12,7 +12,7 @@ struct s0 {
// Check that we get exactly the message sends we expect, and no more.
//
-// CHECK: define void @f0
+// CHECK-LABEL: define void @f0
void f0(C0 *a) {
// CHECK: objc_msgSend
int l0 = (a.x0 = 1);
diff --git a/test/CodeGenObjC/atomic-aggregate-property.m b/test/CodeGenObjC/atomic-aggregate-property.m
index 878255b0fb3f..1b9cb8f8e865 100644
--- a/test/CodeGenObjC/atomic-aggregate-property.m
+++ b/test/CodeGenObjC/atomic-aggregate-property.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s
-// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CHECK-LP64 %s
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CHECK-LP64 %s
// rdar: // 7849824
// <rdar://problem/12547611>
diff --git a/test/CodeGenObjC/auto-property-synthesize-protocol.m b/test/CodeGenObjC/auto-property-synthesize-protocol.m
index 49a4037e2645..e0c54894849a 100644
--- a/test/CodeGenObjC/auto-property-synthesize-protocol.m
+++ b/test/CodeGenObjC/auto-property-synthesize-protocol.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -fobjc-default-synthesize-properties -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -o - | FileCheck %s
// rdar://10907410
@protocol P
diff --git a/test/CodeGenObjC/autorelease.m b/test/CodeGenObjC/autorelease.m
index f89b81a8acb9..4b8101720123 100644
--- a/test/CodeGenObjC/autorelease.m
+++ b/test/CodeGenObjC/autorelease.m
@@ -39,7 +39,7 @@ int tryTo(int (*f)(void)) {
return 0;
}
}
-// CHECK: define i32 @tryTo(i32 ()*
+// CHECK-LABEL: define i32 @tryTo(i32 ()*
// CHECK: [[RET:%.*]] = alloca i32,
// CHECK: [[T0:%.*]] = call i8* @objc_autoreleasePoolPush()
// CHECK-NEXT: [[T1:%.*]] = load i32 ()** {{%.*}},
diff --git a/test/CodeGenObjC/bitfield-access.m b/test/CodeGenObjC/bitfield-access.m
index 597fe3567942..2b8039df9ec1 100644
--- a/test/CodeGenObjC/bitfield-access.m
+++ b/test/CodeGenObjC/bitfield-access.m
@@ -14,7 +14,7 @@
// Check that we don't try to use an i32 load here, which would reach beyond the
// end of the structure.
//
-// CHECK-I386: define i32 @f0(
+// CHECK-I386-LABEL: define i32 @f0(
// CHECK-I386: [[t0_0:%.*]] = load i8* {{.*}}, align 1
// CHECK-I386: lshr i8 [[t0_0]], 7
// CHECK-I386: }
@@ -24,7 +24,7 @@ int f0(I0 *a) {
// Check that we can handled straddled loads.
//
-// CHECK-ARM: define i32 @f1(
+// CHECK-ARM-LABEL: define i32 @f1(
// CHECK-ARM: [[t1_ptr:%.*]] = getelementptr
// CHECK-ARM: [[t1_base:%.*]] = bitcast i8* [[t1_ptr]] to i40*
// CHECK-ARM: [[t1_0:%.*]] = load i40* [[t1_base]], align 1
diff --git a/test/CodeGenObjC/bitfield-ivar-offsets.m b/test/CodeGenObjC/bitfield-ivar-offsets.m
index 7a07f27d2653..f17d56af19ce 100644
--- a/test/CodeGenObjC/bitfield-ivar-offsets.m
+++ b/test/CodeGenObjC/bitfield-ivar-offsets.m
@@ -6,7 +6,7 @@
// RUN: grep -F '@"OBJC_IVAR_$_I0._b3" = global i64 4, section "__DATA, __objc_ivar", align 8' %t
// RUN: grep -F '@"OBJC_IVAR_$_I0._y" = global i64 6, section "__DATA, __objc_ivar", align 8' %t
// RUN: grep -F '@"OBJC_IVAR_$_I0._b4" = global i64 7, section "__DATA, __objc_ivar", align 8' %t
-// RUN: grep -F '@"OBJC_IVAR_$_I0." = global' %t | count 0
+// RUN: not grep -F '@"OBJC_IVAR_$_I0." = global' %t
@interface I0 {
unsigned _b0:4;
diff --git a/test/CodeGenObjC/block-6.m b/test/CodeGenObjC/block-6.m
index 57b9ea3fa6ea..b04b1893191c 100644
--- a/test/CodeGenObjC/block-6.m
+++ b/test/CodeGenObjC/block-6.m
@@ -2,7 +2,7 @@
// rdar://8893785
void MYFUNC() {
-// CHECK: define void @MYFUNC()
+// CHECK-LABEL: define void @MYFUNC()
// CHECK: [[OBSERVER_SLOT:%.*]] = alloca [[OBSERVER_T:%.*]], align 8
// CHECK: [[T0:%.*]] = getelementptr inbounds [[OBSERVER_T]]* [[OBSERVER_SLOT]], i32 0, i32 1
diff --git a/test/CodeGenObjC/block-byref-debuginfo.m b/test/CodeGenObjC/block-byref-debuginfo.m
new file mode 100644
index 000000000000..88a8d8d50c1f
--- /dev/null
+++ b/test/CodeGenObjC/block-byref-debuginfo.m
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -g -triple x86_64-apple-darwin -emit-llvm %s -o - | FileCheck %s
+
+// rdar://problem/14386148
+// Test that the foo is aligned at an 8 byte boundary in the DWARF
+// expression (256) that locates it inside of the byref descriptor:
+// CHECK: metadata !"foo", i32 0, i64 {{[0-9]+}}, i64 64, i64 256, i32 0, metadata
+
+struct Foo {
+ unsigned char *data;
+};
+int func() {
+ __attribute__((__blocks__(byref))) struct Foo foo;
+ return 0;
+}
diff --git a/test/CodeGenObjC/block-byref-variable-layout.m b/test/CodeGenObjC/block-byref-variable-layout.m
index 9c8f6743be3d..a03617bce293 100644
--- a/test/CodeGenObjC/block-byref-variable-layout.m
+++ b/test/CodeGenObjC/block-byref-variable-layout.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -emit-llvm %s -o - | FileCheck %s
// rdar://12759433
@class NSString;
diff --git a/test/CodeGenObjC/block-var-layout.m b/test/CodeGenObjC/block-var-layout.m
index ab9523126c3d..0ad44daa0bdb 100644
--- a/test/CodeGenObjC/block-var-layout.m
+++ b/test/CodeGenObjC/block-var-layout.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.layout %s
+// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.layout %s
// rdar://12752901
struct S {
diff --git a/test/CodeGenObjC/blocks-1.m b/test/CodeGenObjC/blocks-1.m
index 99a11f91e4cd..0d2c35096ae4 100644
--- a/test/CodeGenObjC/blocks-1.m
+++ b/test/CodeGenObjC/blocks-1.m
@@ -4,7 +4,7 @@
// RUN: grep "__destroy_helper_block_" %t | count 4
// RUN: grep "__Block_byref_object_copy_" %t | count 2
// RUN: grep "__Block_byref_object_dispose_" %t | count 2
-// RUN: grep "i32 135)" %t | count 0
+// RUN: not grep "i32 135)" %t
// RUN: grep "_Block_object_assign" %t | count 4
// RUN: grep "objc_read_weak" %t | count 2
// RUN: grep "objc_assign_weak" %t | count 3
@@ -14,7 +14,7 @@
// RUN: grep "__destroy_helper_block_" %t | count 4
// RUN: grep "__Block_byref_object_copy_" %t | count 2
// RUN: grep "__Block_byref_object_dispose_" %t | count 2
-// RUN: grep "i32 135)" %t | count 0
+// RUN: not grep "i32 135)" %t
// RUN: grep "_Block_object_assign" %t | count 4
// RUN: grep "objc_read_weak" %t | count 2
// RUN: grep "objc_assign_weak" %t | count 3
diff --git a/test/CodeGenObjC/blocks.m b/test/CodeGenObjC/blocks.m
index 3718ad590a53..5245679dd42d 100644
--- a/test/CodeGenObjC/blocks.m
+++ b/test/CodeGenObjC/blocks.m
@@ -7,7 +7,7 @@ struct S {
@interface T
- - (int)foo: (T (^)(T*)) x;
+ - (int)foo: (T* (^)(T*)) x;
@end
void foo(T *P) {
@@ -43,7 +43,7 @@ void foo(T *P) {
@interface Test2 -(void) destroy; @end
void test2(Test2 *x) {
extern void test2_helper(void (^)(void));
- // CHECK: define void @test2(
+ // CHECK-LABEL: define void @test2(
// CHECK: [[X:%.*]] = alloca [[TEST2:%.*]]*,
// CHECK-NEXT: [[WEAKX:%.*]] = alloca [[WEAK_T:%.*]],
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
@@ -91,7 +91,7 @@ void test2(Test2 *x) {
// rdar://problem/9124263
// In the test above, check that the use in the invocation function
// doesn't require a read barrier.
-// CHECK: define internal void @__test2_block_invoke
+// CHECK-LABEL: define internal void @__test2_block_invoke
// CHECK: [[BLOCK:%.*]] = bitcast i8* {{%.*}} to [[BLOCK_T]]*
// CHECK-NOT: bitcast
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5
@@ -107,7 +107,7 @@ void test2(Test2 *x) {
void test3(void (^block)(int, ...)) {
block(0, 1, 2, 3);
}
-// CHECK: define void @test3(
+// CHECK-LABEL: define void @test3(
// CHECK: [[BLOCK:%.*]] = alloca void (i32, ...)*, align 4
// CHECK-NEXT: store void (i32, ...)*
// CHECK-NEXT: [[T0:%.*]] = load void (i32, ...)** [[BLOCK]], align 4
@@ -122,7 +122,7 @@ void test3(void (^block)(int, ...)) {
void test4(void (^block)()) {
block(0, 1, 2, 3);
}
-// CHECK: define void @test4(
+// CHECK-LABEL: define void @test4(
// CHECK: [[BLOCK:%.*]] = alloca void (...)*, align 4
// CHECK-NEXT: store void (...)*
// CHECK-NEXT: [[T0:%.*]] = load void (...)** [[BLOCK]], align 4
diff --git a/test/CodeGenObjC/builtins.m b/test/CodeGenObjC/builtins.m
index 0c5744805e6d..37d8c7a3e95d 100644
--- a/test/CodeGenObjC/builtins.m
+++ b/test/CodeGenObjC/builtins.m
@@ -3,5 +3,5 @@
void test0(id receiver, SEL sel, const char *str) {
short s = ((short (*)(id, SEL, const char*)) objc_msgSend)(receiver, sel, str);
}
-// CHECK: define void @test0(
+// CHECK-LABEL: define void @test0(
// CHECK: call signext i16 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i16 (i8*, i8*, i8*)*)(
diff --git a/test/CodeGenObjC/complex-property.m b/test/CodeGenObjC/complex-property.m
index 8c3aef9e24bd..d65d72fdd70c 100644
--- a/test/CodeGenObjC/complex-property.m
+++ b/test/CodeGenObjC/complex-property.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix CHECK-LP64 %s
// rdar: // 7351147
@interface A
diff --git a/test/CodeGenObjC/debug-info-block-line.m b/test/CodeGenObjC/debug-info-block-line.m
index 2192575bb78e..1965e1d7dcdc 100644
--- a/test/CodeGenObjC/debug-info-block-line.m
+++ b/test/CodeGenObjC/debug-info-block-line.m
@@ -1,5 +1,5 @@
// REQUIRES: x86-64-registered-target
-// RUN: %clang_cc1 -emit-llvm -fblocks -fobjc-default-synthesize-properties -fobjc-arc -O0 -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -fblocks -fobjc-arc -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
// rdar://11562117
typedef unsigned int NSUInteger;
diff --git a/test/CodeGenObjC/debug-info-blocks.m b/test/CodeGenObjC/debug-info-blocks.m
index 3d91c9ea5cd4..63068a9ca980 100644
--- a/test/CodeGenObjC/debug-info-blocks.m
+++ b/test/CodeGenObjC/debug-info-blocks.m
@@ -2,16 +2,31 @@
// rdar://problem/9279956
// Test that we generate the proper debug location for a captured self.
-// The second half of this patch is in llvm/tests/DebugInfo/debug-info-blocks.ll
+// The second half of this test is in llvm/tests/DebugInfo/debug-info-blocks.ll
// CHECK: define {{.*}}_block_invoke
// CHECK: %[[BLOCK:.*]] = bitcast i8* %.block_descriptor to <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>*, !dbg
// CHECK-NEXT: store <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>* %[[BLOCK]], <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>** %[[ALLOCA:.*]], align
// CHECK-NEXT: call void @llvm.dbg.declare(metadata !{<{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>** %[[ALLOCA]]}, metadata ![[SELF:[0-9]+]])
// CHECK-NEXT: call void @llvm.dbg.declare(metadata !{%1** %d}, metadata ![[D:[0-9]+]])
-// CHECK: ![[SELF]] = {{.*}} [ DW_TAG_auto_variable ] [self] [line 51]
-// CHECK: ![[D]] = {{.*}} [d] [line 49]
+// rdar://problem/14386148
+// Test that we don't emit bogus line numbers for the helper functions.
+// Test that we do emit scope info for the helper functions.
+// CHECK: define {{.*}} @__copy_helper_block_{{.*}}(i8*, i8*)
+// CHECK-NOT: ret
+// CHECK: call {{.*}}, !dbg ![[DBG_LINE:[0-9]+]]
+// CHECK-NOT: ret
+// CHECK: load {{.*}}, !dbg ![[COPY_LINE:[0-9]+]]
+// CHECK: define {{.*}} @__destroy_helper_block_{{.*}}(i8*)
+// CHECK-NOT: ret
+// CHECK: load {{.*}}, !dbg ![[DESTROY_LINE:[0-9]+]]
+
+// CHECK-DAG: [[DBG_LINE]] = metadata !{i32 0, i32 0, metadata ![[COPY_SP:[0-9]+]], null}
+// CHECK-DAG: [[COPY_LINE]] = metadata !{i32 0, i32 0, metadata ![[COPY_SP:[0-9]+]], null}
+// CHECK-DAG: [[COPY_SP]] = {{.*}}[ DW_TAG_subprogram ]{{.*}}[__copy_helper_block_]
+// CHECK-DAG: [[DESTROY_LINE]] = metadata !{i32 0, i32 0, metadata ![[DESTROY_SP:[0-9]+]], null}
+// CHECK-DAG: [[DESTROY_SP]] = {{.*}}[ DW_TAG_subprogram ]{{.*}}[__destroy_helper_block_]
typedef unsigned int NSUInteger;
@protocol NSObject
@@ -46,6 +61,8 @@ static void run(void (^block)(void))
{
if ((self = [super init])) {
run(^{
+ // CHECK-DAG: ![[SELF]] = {{.*}} [ DW_TAG_auto_variable ] [self] [line [[@LINE+4]]]
+ // CHECK-DAG: ![[D]] = {{.*}} [d] [line [[@LINE+1]]]
NSMutableDictionary *d = [[NSMutableDictionary alloc] init];
ivar = 42 + (int)[d count];
});
diff --git a/test/CodeGenObjC/debug-info-default-synth-ivar.m b/test/CodeGenObjC/debug-info-default-synth-ivar.m
index 30d751e67d1e..e9045eca4388 100644
--- a/test/CodeGenObjC/debug-info-default-synth-ivar.m
+++ b/test/CodeGenObjC/debug-info-default-synth-ivar.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-default-synthesize-properties -emit-llvm -g %s -o %t
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -g %s -o %t
// RUN: grep DW_TAG_member %t | count 5
// rdar://8493239
diff --git a/test/CodeGenObjC/debug-info-fwddecl.m b/test/CodeGenObjC/debug-info-fwddecl.m
index b41c485e1922..b43d7c0eb87c 100644
--- a/test/CodeGenObjC/debug-info-fwddecl.m
+++ b/test/CodeGenObjC/debug-info-fwddecl.m
@@ -2,4 +2,4 @@
@class ForwardObjcClass;
ForwardObjcClass *ptr = 0;
-// CHECK: {{.*}} [ DW_TAG_structure_type ] [ForwardObjcClass] [line 2, size 0, align 0, offset 0] [fwd]
+// CHECK: {{.*}} [ DW_TAG_structure_type ] [ForwardObjcClass] [line 2, size 0, align 0, offset 0] [decl]
diff --git a/test/CodeGenObjC/debug-info-id-with-protocol.m b/test/CodeGenObjC/debug-info-id-with-protocol.m
index db1a3ef74547..7e96baffdeea 100644
--- a/test/CodeGenObjC/debug-info-id-with-protocol.m
+++ b/test/CodeGenObjC/debug-info-id-with-protocol.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-default-synthesize-properties -emit-llvm -g %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -g %s -o - | FileCheck %s
__attribute((objc_root_class)) @interface NSObject {
id isa;
}
@@ -36,6 +36,6 @@ int main()
}
}
// Verify that the debug type for both variables is 'id'.
-// CHECK: metadata !{i32 {{[0-9]+}}, metadata !{{[0-9]+}}, metadata !"bad_carrier", metadata !{{[0-9]+}}, i32 {{[0-9]+}}, metadata ![[IDTYPE:[0-9]+]], i32 0, i32 0} ; [ DW_TAG_arg_variable ] [bad_carrier] [line 21]
-// CHECK: metadata !{i32 {{[0-9]+}}, metadata !{{[0-9]+}}, metadata !"good_carrier", metadata !{{[0-9]+}}, i32 {{[0-9]+}}, metadata !{{.*}}[[IDTYPE]], i32 0, i32 0} ; [ DW_TAG_arg_variable ] [good_carrier] [line 22]
+// CHECK: metadata !{i32 {{[0-9]+}}, metadata !{{[0-9]+}}, metadata !"bad_carrier", null, i32 {{[0-9]+}}, metadata ![[IDTYPE:[0-9]+]], i32 0, i32 0} ; [ DW_TAG_arg_variable ] [bad_carrier] [line 0]
+// CHECK: metadata !{i32 {{[0-9]+}}, metadata !{{[0-9]+}}, metadata !"good_carrier", null, i32 {{[0-9]+}}, metadata !{{.*}}[[IDTYPE]], i32 0, i32 0} ; [ DW_TAG_arg_variable ] [good_carrier] [line 0]
// CHECK !{{.*}}[[IDTYPE]] = metadata !{i32 {{[0-9]+}}, null, metadata !"id", metadata !{{[0-9]+}}, i32 !{{[0-9]+}}, i64 0, i64 0, i64 0, i32 0, metadata !{{[0-9]+}}} ; [ DW_TAG_typedef ] [id]
diff --git a/test/CodeGenObjC/debug-info-instancetype.m b/test/CodeGenObjC/debug-info-instancetype.m
new file mode 100644
index 000000000000..1c155179a382
--- /dev/null
+++ b/test/CodeGenObjC/debug-info-instancetype.m
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+// rdar://problem/13359718
+// Substitute the actual type for a method returning instancetype.
+@interface NSObject
++ (id)alloc;
+- (id)init;
+- (id)retain;
+@end
+
+@interface Foo : NSObject
++ (instancetype)defaultFoo;
+@end
+
+@implementation Foo
++(instancetype)defaultFoo {return 0;}
+// CHECK: ![[FOO:[0-9]+]] = metadata {{.*}}; [ DW_TAG_structure_type ] [Foo]
+// CHECK: metadata !"+[Foo defaultFoo]", metadata !"", i32 [[@LINE-2]], metadata ![[TYPE:[0-9]+]]
+// CHECK: ![[TYPE]] = {{.*}} metadata ![[RESULT:[0-9]+]], i32 {{.*}}, null, null, null} ; [ DW_TAG_subroutine_type ]
+// CHECK: ![[RESULT]] = metadata {{.*}}{metadata ![[FOOPTR:[0-9]+]],
+// CHECK: ![[FOOPTR]] = {{.*}}, metadata ![[FOO]]}{{.*}}[ DW_TAG_pointer_type ] {{.*}} [from Foo]
+@end
+
+
+int main (int argc, const char *argv[])
+{
+ Foo *foo = [Foo defaultFoo];
+ return 0;
+}
diff --git a/test/CodeGenObjC/debug-info-lifetime-crash.m b/test/CodeGenObjC/debug-info-lifetime-crash.m
new file mode 100644
index 000000000000..90382010fb6d
--- /dev/null
+++ b/test/CodeGenObjC/debug-info-lifetime-crash.m
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -cc1 -triple arm-apple-ios -emit-llvm -g -fblocks -fobjc-runtime=ios-7.0.0 -fobjc-arc %s -o - | FileCheck %s
+// rdar://problem/14990656
+@protocol NSObject
+- (id)copy;
+@end
+@class W;
+@interface View1
+@end
+@implementation Controller {
+ void (^Block)(void);
+}
+- (void)View:(View1 *)View foo:(W *)W
+{
+ // The debug type for these two will be identical, because we do not
+ // actually emit the ownership qualifier.
+ // CHECK-DAG: metadata !"weakSelf", metadata !{{[0-9]+}}, i32 [[@LINE+1]], metadata ![[SELFTY:[0-9]+]], i32 0, i32 0, {{.*}}} ; [ DW_TAG_auto_variable ] [weakSelf]
+ __attribute__((objc_ownership(weak))) __typeof(self) weakSelf = self;
+ Block = [^{
+ // CHECK-DAG: metadata !"strongSelf", metadata !{{[0-9]+}}, i32 [[@LINE+1]], metadata ![[SELFTY]], i32 0, i32 0} ; [ DW_TAG_auto_variable ] [strongSelf]
+ __attribute__((objc_ownership(strong))) __typeof(self) strongSelf = weakSelf;
+ } copy];
+}
+@end
diff --git a/test/CodeGenObjC/debug-info-property-accessors.m b/test/CodeGenObjC/debug-info-property-accessors.m
new file mode 100644
index 000000000000..4c7b98466a3e
--- /dev/null
+++ b/test/CodeGenObjC/debug-info-property-accessors.m
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -emit-llvm -x objective-c -g -triple x86_64-apple-macosx10.8.0 %s -o - | FileCheck %s
+//
+// rdar://problem/14035789
+//
+// Ensure we emit the names of explicit/renamed accessors even if they
+// are defined later in the implementation section.
+//
+// CHECK: metadata !{i32 {{.*}}, metadata !"blah", {{.*}} metadata !"isBlah", metadata !"", {{.*}}} ; [ DW_TAG_APPLE_property ] [blah]
+
+@class NSString;
+extern void NSLog(NSString *format, ...);
+typedef signed char BOOL;
+
+#define YES ((BOOL)1)
+#define NO ((BOOL)0)
+
+typedef unsigned int NSUInteger;
+
+@protocol NSObject
+@end
+
+@interface NSObject <NSObject>
+- (id)init;
++ (id)alloc;
+@end
+
+@interface Bar : NSObject
+@property int normal_property;
+@property (getter=isBlah, setter=setBlah:) BOOL blah;
+@end
+
+@implementation Bar
+@synthesize normal_property;
+
+- (BOOL) isBlah
+{
+ return YES;
+}
+- (void) setBlah: (BOOL) newBlah
+{
+ NSLog (@"Speak up, I didn't catch that.");
+}
+@end
+
+int
+main ()
+{
+ Bar *my_bar = [[Bar alloc] init];
+
+ if (my_bar.blah)
+ NSLog (@"It was true!!!");
+
+ my_bar.blah = NO;
+
+ return 0;
+}
diff --git a/test/CodeGenObjC/debug-info-property4.m b/test/CodeGenObjC/debug-info-property4.m
index 6d9973c3e0e2..71863a6b9f3b 100644
--- a/test/CodeGenObjC/debug-info-property4.m
+++ b/test/CodeGenObjC/debug-info-property4.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-default-synthesize-properties -masm-verbose -S -g %s -o - | FileCheck %s
+// RUN: %clang_cc1 -masm-verbose -S -g %s -o - | FileCheck %s
// CHECK: AT_APPLE_property_name
// CHECK-NOT: AT_APPLE_property_getter
diff --git a/test/CodeGenObjC/debug-info-property5.m b/test/CodeGenObjC/debug-info-property5.m
index 35215749ecd9..272aa5de0760 100644
--- a/test/CodeGenObjC/debug-info-property5.m
+++ b/test/CodeGenObjC/debug-info-property5.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-default-synthesize-properties -masm-verbose -S -g %s -o - | FileCheck %s
+// RUN: %clang_cc1 -masm-verbose -S -g %s -o - | FileCheck %s
// CHECK: AT_APPLE_property_name
// CHECK: AT_APPLE_property_getter
diff --git a/test/CodeGenObjC/debug-info-self.m b/test/CodeGenObjC/debug-info-self.m
index 7803467eab9a..8cbc0292f0ae 100644
--- a/test/CodeGenObjC/debug-info-self.m
+++ b/test/CodeGenObjC/debug-info-self.m
@@ -14,10 +14,6 @@
}
@end
-// It's weird that the first two parameters are recorded as being in a
-// different, ("<unknown>") file compared to the third parameter which is 'in'
-// the actual source file. (see the metadata node after the arg name in each
-// line)
-// CHECK: metadata !{i32 {{.*}}, metadata ![[CTOR:.*]], metadata !"self", metadata ![[UNKFILE:.*]], i32 16777227, metadata !{{.*}}, i32 1088, i32 0} ; [ DW_TAG_arg_variable ] [self] [line 11]
-// CHECK: metadata !{i32 {{.*}}, metadata ![[CTOR]], metadata !"_cmd", metadata ![[UNKFILE]], i32 33554443, metadata !{{.*}}, i32 64, i32 0} ; [ DW_TAG_arg_variable ] [_cmd] [line 11]
+// CHECK: metadata !{i32 {{.*}}, metadata ![[CTOR:.*]], metadata !"self", null, i32 16777216, metadata !{{.*}}, i32 1088, i32 0} ; [ DW_TAG_arg_variable ] [self] [line 0]
+// CHECK: metadata !{i32 {{.*}}, metadata ![[CTOR]], metadata !"_cmd", null, i32 33554432, metadata !{{.*}}, i32 64, i32 0} ; [ DW_TAG_arg_variable ] [_cmd] [line 0]
// CHECK: metadata !{i32 {{.*}}, metadata ![[CTOR]], metadata !"myarg", metadata !{{.*}}, i32 50331659, metadata !{{.*}}, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [myarg] [line 11]
diff --git a/test/CodeGenObjC/debuginfo-properties.m b/test/CodeGenObjC/debuginfo-properties.m
new file mode 100644
index 000000000000..9a3571458307
--- /dev/null
+++ b/test/CodeGenObjC/debuginfo-properties.m
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 -g -emit-llvm -triple x86_64-apple-darwin -o - %s | FileCheck %s
+// Check that we emit the correct method names for properties from a protocol.
+// rdar://problem/13798000
+@protocol NSObject
+- (id)init;
+@end
+@interface NSObject <NSObject> {}
+@end
+
+@class Selection;
+
+@protocol HasASelection <NSObject>
+@property (nonatomic, retain) Selection* selection;
+// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-1]]] [local] [def] [-[MyClass selection]]
+// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-2]]] [local] [def] [-[MyClass setSelection:]]
+// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-3]]] [local] [def] [-[OtherClass selection]]
+// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-4]]] [local] [def] [-[OtherClass setSelection:]]
+@end
+
+@interface MyClass : NSObject <HasASelection> {
+ Selection *_selection;
+}
+@end
+
+@implementation MyClass
+@synthesize selection = _selection;
+@end
+
+@interface OtherClass : NSObject <HasASelection> {
+ Selection *_selection;
+}
+@end
+@implementation OtherClass
+@synthesize selection = _selection;
+@end
diff --git a/test/CodeGenObjC/designated-initializers.m b/test/CodeGenObjC/designated-initializers.m
new file mode 100644
index 000000000000..80dfdf3602c6
--- /dev/null
+++ b/test/CodeGenObjC/designated-initializers.m
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
+
+// <rdar://problem/10465114>
+struct overwrite_string_struct {
+ char L[3];
+ int M;
+} overwrite_string[] = { { { @encode(void**) }, 1 }, [0].L[1] = 'x'};
+// CHECK: [3 x i8] c"^xv", i32 1
diff --git a/test/CodeGenObjC/encode-cstyle-method.m b/test/CodeGenObjC/encode-cstyle-method.m
index f3243a31487f..309089b9b602 100644
--- a/test/CodeGenObjC/encode-cstyle-method.m
+++ b/test/CodeGenObjC/encode-cstyle-method.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix CHECK-LP64 %s
// rdar: // 7445205
@interface Foo
diff --git a/test/CodeGenObjC/encode-test-6.m b/test/CodeGenObjC/encode-test-6.m
index b7feb14434bc..b7b37997e1fa 100644
--- a/test/CodeGenObjC/encode-test-6.m
+++ b/test/CodeGenObjC/encode-test-6.m
@@ -35,3 +35,21 @@ typedef BABugExample BABugExampleRedefinition;
@end
// CHECK: internal global [24 x i8] c"^{BABugExample=@}16
+
+// rdar://14408244
+@class SCNCamera;
+typedef SCNCamera C3DCamera;
+typedef struct
+{
+ C3DCamera *presentationInstance;
+} C3DCameraStorage;
+
+@interface SCNCamera
+@end
+
+@implementation SCNCamera
+{
+ C3DCameraStorage _storage;
+}
+@end
+// CHECK: internal global [39 x i8] c"{?=\22presentationInstance\22^{SCNCamera}}\00"
diff --git a/test/CodeGenObjC/encode-test.m b/test/CodeGenObjC/encode-test.m
index e8d65413740d..d6e7b6dfccad 100644
--- a/test/CodeGenObjC/encode-test.m
+++ b/test/CodeGenObjC/encode-test.m
@@ -159,7 +159,7 @@ struct f
int tt;
};
-// CHECK: @g10 = constant [14 x i8] c"{f=i[0{?=}]i}\00"
+// CHECK: @g10 = constant [14 x i8] c"{f=i[4{?=}]i}\00"
const char g10[] = @encode(struct f);
// rdar://9622422
diff --git a/test/CodeGenObjC/exceptions-nonfragile.m b/test/CodeGenObjC/exceptions-nonfragile.m
index 1f3892699839..212a1eedd45f 100644
--- a/test/CodeGenObjC/exceptions-nonfragile.m
+++ b/test/CodeGenObjC/exceptions-nonfragile.m
@@ -26,6 +26,6 @@ void test2(void) {
test2_helper();
}
- // CHECK: define void @test2()
+ // CHECK-LABEL: define void @test2()
// CHECK-NOT: call void @test2_helper()
}
diff --git a/test/CodeGenObjC/exceptions.m b/test/CodeGenObjC/exceptions.m
index 408b94d385fa..92f68292fff0 100644
--- a/test/CodeGenObjC/exceptions.m
+++ b/test/CodeGenObjC/exceptions.m
@@ -14,7 +14,7 @@ void f0() {
}
}
-// CHECK: define void @f1()
+// CHECK-LABEL: define void @f1()
void f1() {
extern void foo(void);
@@ -40,7 +40,7 @@ void f1() {
// Test that modifications to local variables are respected under
// optimization. rdar://problem/8160285
-// CHECK: define i32 @f2()
+// CHECK-LABEL: define i32 @f2()
int f2() {
extern void foo(void);
@@ -77,7 +77,7 @@ int f2() {
// Test that the cleanup destination is saved when entering a finally
// block. rdar://problem/8293901
-// CHECK: define void @f3()
+// CHECK-LABEL: define void @f3()
void f3() {
extern void f3_helper(int, int*);
@@ -130,7 +130,7 @@ void f3() {
void f4() {
extern void f4_help(int);
- // CHECK: define void @f4()
+ // CHECK-LABEL: define void @f4()
// CHECK: [[EXNDATA:%.*]] = alloca [[EXNDATA_T:%.*]], align
// CHECK: call void @objc_exception_try_enter([[EXNDATA_T]]* [[EXNDATA]])
// CHECK: call i32 @_setjmp
diff --git a/test/CodeGenObjC/extended-block-signature-encode.m b/test/CodeGenObjC/extended-block-signature-encode.m
index a380856da5f2..3db31fafc080 100644
--- a/test/CodeGenObjC/extended-block-signature-encode.m
+++ b/test/CodeGenObjC/extended-block-signature-encode.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fencode-extended-block-signature -emit-llvm %s -o - | FileCheck %s
-// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -emit-llvm %s -o - | FileCheck %s -check-prefix=BRIEF
+// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK-BRIEF
// rdar://12109031
@class NSString, NSArray;
diff --git a/test/CodeGenObjC/fp2ret.m b/test/CodeGenObjC/fp2ret.m
index 2e65332ec974..5f7c76d6cdd8 100644
--- a/test/CodeGenObjC/fp2ret.m
+++ b/test/CodeGenObjC/fp2ret.m
@@ -12,15 +12,15 @@
@end
-// CHECK-X86_32: define void @t0()
+// CHECK-X86_32-LABEL: define void @t0()
// CHECK-X86_32: call void bitcast {{.*}} @objc_msgSend_stret to
// CHECK-X86_32: }
//
-// CHECK-X86_64: define void @t0()
+// CHECK-X86_64-LABEL: define void @t0()
// CHECK-X86_64: call { x86_fp80, x86_fp80 } bitcast {{.*}} @objc_msgSend_fp2ret to
// CHECK-X86_64: }
//
-// CHECK-ARMV7: define void @t0()
+// CHECK-ARMV7-LABEL: define void @t0()
// CHECK-ARMV7: call i128 bitcast {{.*}} @objc_msgSend to
// CHECK-ARMV7: }
void t0() {
diff --git a/test/CodeGenObjC/fpret.m b/test/CodeGenObjC/fpret.m
index cabef108df48..7fe550177d4c 100644
--- a/test/CodeGenObjC/fpret.m
+++ b/test/CodeGenObjC/fpret.m
@@ -14,19 +14,19 @@
@end
-// CHECK-X86_32: define void @t0()
+// CHECK-X86_32-LABEL: define void @t0()
// CHECK-X86_32: call float bitcast {{.*}} @objc_msgSend_fpret to
// CHECK-X86_32: call double bitcast {{.*}} @objc_msgSend_fpret to
// CHECK-X86_32: call x86_fp80 bitcast {{.*}} @objc_msgSend_fpret to
// CHECK-X86_32: }
//
-// CHECK-X86_64: define void @t0()
+// CHECK-X86_64-LABEL: define void @t0()
// CHECK-X86_64: call float bitcast {{.*}} @objc_msgSend to
// CHECK-X86_64: call double bitcast {{.*}} @objc_msgSend to
// CHECK-X86_64: call x86_fp80 bitcast {{.*}} @objc_msgSend_fpret to
// CHECK-X86_64: }
//
-// CHECK-ARMV7: define void @t0()
+// CHECK-ARMV7-LABEL: define void @t0()
// CHECK-ARMV7: call float bitcast {{.*}} @objc_msgSend to
// CHECK-ARMV7: call double bitcast {{.*}} @objc_msgSend to
// CHECK-ARMV7: call double bitcast {{.*}} @objc_msgSend to
diff --git a/test/CodeGenObjC/gc.m b/test/CodeGenObjC/gc.m
index ce2611ecf8ae..729cf107a903 100644
--- a/test/CodeGenObjC/gc.m
+++ b/test/CodeGenObjC/gc.m
@@ -4,7 +4,7 @@ void test0(void) {
extern id test0_helper(void);
__attribute__((objc_precise_lifetime)) id x = test0_helper();
test0_helper();
- // CHECK: define void @test0()
+ // CHECK-LABEL: define void @test0()
// CHECK: [[T0:%.*]] = call i8* @test0_helper()
// CHECK-NEXT: store i8* [[T0]], i8** [[X:%.*]], align 8
// CHECK-NEXT: call i8* @test0_helper()
diff --git a/test/CodeGenObjC/id-isa-codegen.m b/test/CodeGenObjC/id-isa-codegen.m
index 8717ce2d0abb..fa0f0b097a00 100644
--- a/test/CodeGenObjC/id-isa-codegen.m
+++ b/test/CodeGenObjC/id-isa-codegen.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix LP64 %s
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix LP32 %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix CHECK-LP64 %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix CHECK-LP32 %s
typedef struct objc_class *Class;
diff --git a/test/CodeGenObjC/ivar-base-as-invariant-load.m b/test/CodeGenObjC/ivar-base-as-invariant-load.m
index 8b660cf483d9..19dc6587f553 100644
--- a/test/CodeGenObjC/ivar-base-as-invariant-load.m
+++ b/test/CodeGenObjC/ivar-base-as-invariant-load.m
@@ -23,7 +23,7 @@
@end
-// CHECK: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load !4
-// CHECK: [[T2:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load !4
-// CHECK: [[T3:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load !4
+// CHECK: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load !5
+// CHECK: [[T2:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load !5
+// CHECK: [[T3:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load !5
diff --git a/test/CodeGenObjC/ivar-invariant.m b/test/CodeGenObjC/ivar-invariant.m
index 7cafee70073f..ef17ffc12f78 100644
--- a/test/CodeGenObjC/ivar-invariant.m
+++ b/test/CodeGenObjC/ivar-invariant.m
@@ -40,7 +40,7 @@ void * variant_load_1(int i) {
return ptr;
}
-// CHECK: define i8* @variant_load_1(i32 %i)
+// CHECK-LABEL: define i8* @variant_load_1(i32 %i)
// CHECK: [[IVAR:%.*]] = load i64* @"OBJC_IVAR_$_Derived.member"{{$}}
@interface Container : Derived @end
@@ -61,7 +61,7 @@ void * variant_load_1(int i) {
}
@end
-// CHECK: define internal i8* @block_block_invoke
+// CHECK-LABEL: define internal i8* @block_block_invoke
// CHECK: load i64* @"OBJC_IVAR_$_ForBlock.foo"
id (^block)(ForBlock*) = ^(ForBlock* a) {
return a->foo;
diff --git a/test/CodeGenObjC/ivar-layout-array0-struct.m b/test/CodeGenObjC/ivar-layout-array0-struct.m
index 267f947f42b6..47373035214d 100644
--- a/test/CodeGenObjC/ivar-layout-array0-struct.m
+++ b/test/CodeGenObjC/ivar-layout-array0-struct.m
@@ -1,6 +1,6 @@
// REQUIRES: x86-64-registered-target
-// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -O0 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// rdar://8800513
@interface NSObject {
diff --git a/test/CodeGenObjC/ivar-layout-no-optimize.m b/test/CodeGenObjC/ivar-layout-no-optimize.m
index 46a7034a2249..17b519577f97 100644
--- a/test/CodeGenObjC/ivar-layout-no-optimize.m
+++ b/test/CodeGenObjC/ivar-layout-no-optimize.m
@@ -1,8 +1,8 @@
// REQUIRES: x86-64-registered-target
-// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -O0 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
-// RUN: %clang_cc1 -x objective-c++ -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -O0 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
+// RUN: %clang_cc1 -x objective-c++ -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
@interface NSObject {
id isa;
diff --git a/test/CodeGenObjC/local-static-block.m b/test/CodeGenObjC/local-static-block.m
index deea8bac13ea..b5b4534b8e47 100644
--- a/test/CodeGenObjC/local-static-block.m
+++ b/test/CodeGenObjC/local-static-block.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o %t-64.ll
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.ll %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.ll %s
// rdar: // 8390455
@class NSArray;
diff --git a/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m b/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m
index bb3a20bb291c..6ea656443a8b 100644
--- a/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m
+++ b/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fblocks -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
+// RUN: %clang_cc1 -fblocks -fobjc-runtime-has-weak -triple x86_64-apple-darwin -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
// RUN: FileCheck --input-file=%t-64.layout %s
-// RUN: %clang_cc1 -fblocks -fobjc-runtime-has-weak -triple i386-apple-darwin -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-32.layout
+// RUN: %clang_cc1 -fblocks -fobjc-runtime-has-weak -triple i386-apple-darwin -print-ivar-layout -emit-llvm -o /dev/null %s > %t-32.layout
// RUN: FileCheck -check-prefix=CHECK-i386 --input-file=%t-32.layout %s
// rdar://12184410
// rdar://12184410
diff --git a/test/CodeGenObjC/ns_consume_null_check.m b/test/CodeGenObjC/ns_consume_null_check.m
index 6a31a808f4c8..d4502ec04263 100644
--- a/test/CodeGenObjC/ns_consume_null_check.m
+++ b/test/CodeGenObjC/ns_consume_null_check.m
@@ -16,7 +16,7 @@ void test0(void) {
id obj = [NSObject new];
[x isEqual : obj];
}
-// CHECK: define void @test0()
+// CHECK-LABEL: define void @test0()
// CHECK: [[FIVE:%.*]] = call i8* @objc_retain
// CHECK-NEXT: [[SIX:%.*]] = bitcast
// CHECK-NEXT: [[SEVEN:%.*]] = icmp eq i8* [[SIX]], null
@@ -36,7 +36,7 @@ void test1(void) {
__weak id weakObj = obj;
_Complex float result = [x asComplexWithArg: obj];
}
-// CHECK: define void @test1()
+// CHECK-LABEL: define void @test1()
// CHECK: [[OBJ:%.*]] = alloca i8*, align 8
// CHECK-NEXT: [[WEAKOBJ:%.*]] = alloca i8*, align 8
// CHECK-NEXT: [[RESULT:%.*]] = alloca { float, float }, align 4
diff --git a/test/CodeGenObjC/null-objc-empty-vtable.m b/test/CodeGenObjC/null-objc-empty-vtable.m
new file mode 100644
index 000000000000..fe69ce1f69c1
--- /dev/null
+++ b/test/CodeGenObjC/null-objc-empty-vtable.m
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -emit-llvm -o - %s | FileCheck -check-prefix CHECK-OSX %s
+// RUN: %clang_cc1 -triple thumbv7-apple-ios3.0.0 -emit-llvm -o - %s | FileCheck -check-prefix CHECK-IOS %s
+// rdar://14802916
+
+@interface I
+@end
+
+@implementation I @end
+// CHECK-OSX: %struct._class_t* null, %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null
+// CHECK-IOS: %struct._class_t* null, %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null
diff --git a/test/CodeGenObjC/objc-gc-aggr-assign.m b/test/CodeGenObjC/objc-gc-aggr-assign.m
index 6c2baac0504b..eb11a4e1b33a 100644
--- a/test/CodeGenObjC/objc-gc-aggr-assign.m
+++ b/test/CodeGenObjC/objc-gc-aggr-assign.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix C %s
-// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CP %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CHECK-C %s
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o - %s | FileCheck -check-prefix CHECK-CP %s
static int count;
diff --git a/test/CodeGenObjC/objc-read-weak-byref.m b/test/CodeGenObjC/objc-read-weak-byref.m
index 94eca2899d9b..35b4de1cec2e 100644
--- a/test/CodeGenObjC/objc-read-weak-byref.m
+++ b/test/CodeGenObjC/objc-read-weak-byref.m
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
@interface NSObject
- copy;
diff --git a/test/CodeGenObjC/objc2-legacy-dispatch.m b/test/CodeGenObjC/objc2-legacy-dispatch.m
index a6b20000d802..aa944f89519f 100644
--- a/test/CodeGenObjC/objc2-legacy-dispatch.m
+++ b/test/CodeGenObjC/objc2-legacy-dispatch.m
@@ -1,15 +1,15 @@
// RUN: %clang_cc1 -fobjc-dispatch-method=mixed -triple i386-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK_NEW_DISPATCH %s
//
-// CHECK_NEW_DISPATCH: define void @f0
+// CHECK_NEW_DISPATCH-LABEL: define void @f0
// CHECK_NEW_DISPATCH: bitcast {{.*}}objc_msgSend_fixup_alloc
-// CHECK_NEW_DISPATCH: define void @f1
+// CHECK_NEW_DISPATCH-LABEL: define void @f1
// CHECK_NEW_DISPATCH: load {{.*}}OBJC_SELECTOR_REFERENCES
//
// RUN: %clang_cc1 -fobjc-dispatch-method=legacy -emit-llvm -o - %s | FileCheck -check-prefix=CHECK_OLD_DISPATCH %s
//
-// CHECK_OLD_DISPATCH: define void @f0
+// CHECK_OLD_DISPATCH-LABEL: define void @f0
// CHECK_OLD_DISPATCH: load {{.*}}OBJC_SELECTOR_REFERENCES
-// CHECK_OLD_DISPATCH: define void @f1
+// CHECK_OLD_DISPATCH-LABEL: define void @f1
// CHECK_OLD_DISPATCH: load {{.*}}OBJC_SELECTOR_REFERENCES
@interface A
diff --git a/test/CodeGenObjC/objc2-no-write-barrier.m b/test/CodeGenObjC/objc2-no-write-barrier.m
index ece6b9d582b7..16593f128d78 100644
--- a/test/CodeGenObjC/objc2-no-write-barrier.m
+++ b/test/CodeGenObjC/objc2-no-write-barrier.m
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
-// RUN: grep 'objc_assign' %t | count 0
+// RUN: not grep 'objc_assign' %t
// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
-// RUN: grep 'objc_assign' %t | count 0
+// RUN: not grep 'objc_assign' %t
typedef struct {
int ival;
diff --git a/test/CodeGenObjC/objc2-weak-block-call.m b/test/CodeGenObjC/objc2-weak-block-call.m
index 25434947d104..7c6881751dbe 100644
--- a/test/CodeGenObjC/objc2-weak-block-call.m
+++ b/test/CodeGenObjC/objc2-weak-block-call.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | FileCheck -check-prefix LP64 %s
-// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | FileCheck -check-prefix LP64 %s
+// RUN: %clang_cc1 -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-LP64 %s
+// RUN: %clang_cc1 -fblocks -fobjc-gc -triple i386-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-LP64 %s
@interface MyView
- (void)MyView_sharedInit;
diff --git a/test/CodeGenObjC/objc2-write-barrier-5.m b/test/CodeGenObjC/objc2-write-barrier-5.m
index 65a71a5a1d35..44af818a320e 100644
--- a/test/CodeGenObjC/objc2-write-barrier-5.m
+++ b/test/CodeGenObjC/objc2-write-barrier-5.m
@@ -1,8 +1,8 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
-// RUN: grep objc_assign_ivar %t | count 0
+// RUN: not grep objc_assign_ivar %t
// RUN: grep objc_assign_strongCast %t | count 8
// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
-// RUN: grep objc_assign_ivar %t | count 0
+// RUN: not grep objc_assign_ivar %t
// RUN: grep objc_assign_strongCast %t | count 8
@interface TestUnarchiver
diff --git a/test/CodeGenObjC/objfw.m b/test/CodeGenObjC/objfw.m
index 98e3fb02652d..8e72867fcde6 100644
--- a/test/CodeGenObjC/objfw.m
+++ b/test/CodeGenObjC/objfw.m
@@ -8,7 +8,7 @@
void test0(void) {
[Test0 test];
}
-// CHECK: define void @test0()
+// CHECK-LABEL: define void @test0()
// CHECK: [[T0:%.*]] = call i8* (i8*, i8*, ...)* (i8*, i8*)* @objc_msg_lookup(i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*),
// CHECK-NEXT: [[T1:%.*]] = bitcast i8* (i8*, i8*, ...)* [[T0]] to void (i8*, i8*)*
// CHECK-NEXT: call void [[T1]](i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*),
diff --git a/test/CodeGenObjC/property.m b/test/CodeGenObjC/property.m
index 6a438268c78f..e156270f66fe 100644
--- a/test/CodeGenObjC/property.m
+++ b/test/CodeGenObjC/property.m
@@ -54,7 +54,7 @@ int printf(const char *, ...);
@end
// Test that compound operations only compute the base once.
-// CHECK: define void @test2
+// CHECK-LABEL: define void @test2
A *test2_helper(void);
void test2() {
// CHECK: [[BASE:%.*]] = call [[A:%.*]]* @test2_helper()
@@ -94,7 +94,7 @@ void test3(test3_object *p) {
@interface Test4 {}
@property float f;
@end
-// CHECK: define void @test4
+// CHECK-LABEL: define void @test4
void test4(Test4 *t) {
extern int test4_printf(const char *, ...);
// CHECK: [[TMP:%.*]] = call float {{.*}} @objc_msgSend
diff --git a/test/CodeGenObjC/protocol-in-extended-class.m b/test/CodeGenObjC/protocol-in-extended-class.m
index b919d5fd234a..a5fb80eca4b9 100644
--- a/test/CodeGenObjC/protocol-in-extended-class.m
+++ b/test/CodeGenObjC/protocol-in-extended-class.m
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target,x86-64-registered-target
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
// RUN: %clang_cc1 -triple i386-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
@protocol MyProtocol
@end
diff --git a/test/CodeGenObjC/protocols-lazy.m b/test/CodeGenObjC/protocols-lazy.m
index 642f886a088b..fba7454b9549 100644
--- a/test/CodeGenObjC/protocols-lazy.m
+++ b/test/CodeGenObjC/protocols-lazy.m
@@ -1,11 +1,11 @@
// RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin8 -fobjc-runtime=macosx-fragile-10.5 -o %t %s
// No object generated
-// RUN: grep OBJC_PROTOCOL_P0 %t | count 0
+// RUN: not grep OBJC_PROTOCOL_P0 %t
@protocol P0;
// No object generated
-// RUN: grep OBJC_PROTOCOL_P1 %t | count 0
+// RUN: not grep OBJC_PROTOCOL_P1 %t
@protocol P1 -im1; @end
// Definition triggered by protocol reference.
@@ -16,7 +16,7 @@ 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: not grep OBJC_PROTOCOL_INSTANCE_METHODS_P3 %t
@protocol P3;
void f1() { id x = @protocol(P3); }
diff --git a/test/CodeGenObjC/related-result-type.m b/test/CodeGenObjC/related-result-type.m
index ef38661f94c0..cd7847421812 100644
--- a/test/CodeGenObjC/related-result-type.m
+++ b/test/CodeGenObjC/related-result-type.m
@@ -9,7 +9,7 @@
@interface NSString : NSObject
@end
-// CHECK: define void @test1()
+// CHECK-LABEL: define void @test1()
void test1() {
// CHECK: {{call.*@objc_msgSend}}
// CHECK: {{call.*@objc_msgSend}}
@@ -18,7 +18,7 @@ void test1() {
NSString *str1 = [[[NSString alloc] init] retain];
}
-// CHECK: define void @test2()
+// CHECK-LABEL: define void @test2()
void test2() {
// CHECK: {{call.*@objc_msgSend}}
// CHECK: {{call.*@objc_msgSend}}
diff --git a/test/CodeGenObjC/reorder-synthesized-ivars.m b/test/CodeGenObjC/reorder-synthesized-ivars.m
index 747265d15512..0f8cf6a3ea87 100644
--- a/test/CodeGenObjC/reorder-synthesized-ivars.m
+++ b/test/CodeGenObjC/reorder-synthesized-ivars.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-default-synthesize-properties -emit-llvm -x objective-c %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -x objective-c %s -o - | FileCheck %s
// rdar://13192366
typedef signed char BOOL;
@interface NSObject
diff --git a/test/CodeGenObjC/stret_lookup.m b/test/CodeGenObjC/stret_lookup.m
new file mode 100644
index 000000000000..6682fac7aefe
--- /dev/null
+++ b/test/CodeGenObjC/stret_lookup.m
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -DSTRET -triple x86_64-pc-linux-gnu -fobjc-runtime=objfw -emit-llvm -o - %s | FileCheck -check-prefix=HASSTRET %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fobjc-runtime=gcc -emit-llvm -o - %s | FileCheck -check-prefix=NOSTRET %s
+
+// Test stret lookup
+
+struct test {
+ char test[1024];
+};
+@interface Test0
++ (struct test)test;
+@end
+void test0(void) {
+ struct test t;
+#if (defined(STRET) && defined(__OBJFW_RUNTIME_ABI__)) || \
+ (!defined(STRET) && !defined(__OBJFW_RUNTIME_ABI__))
+ t = [Test0 test];
+#endif
+ (void)t;
+}
+
+// HASSTRET-LABEL: define void @test0()
+// HASSTRET: [[T0:%.*]] = call i8* (i8*, i8*, ...)* (i8*, i8*)* @objc_msg_lookup_stret(i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*),
+// HASSTRET-NEXT: [[T1:%.*]] = bitcast i8* (i8*, i8*, ...)* [[T0]] to void (%struct.test*, i8*, i8*)*
+// HASSTRET-NEXT: call void [[T1]](%struct.test* sret {{.*}}, i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*),
+
+// NOSTRET-LABEL: define void @test0()
+// NOSTRET: [[T0:%.*]] = call i8* (i8*, i8*, ...)* (i8*, i8*)* @objc_msg_lookup(i8*
+// NOSTRET-NEXT: [[T1:%.*]] = bitcast i8* (i8*, i8*, ...)* [[T0]] to void (%struct.test*, i8*, i8*)*
+// NOSTRET-NEXT: call void [[T1]](%struct.test* sret {{.*}}, i8* {{.*}}, i8* bitcast ([2 x { i8*, i8* }]*
diff --git a/test/CodeGenObjC/synchronized.m b/test/CodeGenObjC/synchronized.m
index e927882b3f73..015e55b8f8af 100644
--- a/test/CodeGenObjC/synchronized.m
+++ b/test/CodeGenObjC/synchronized.m
@@ -20,7 +20,7 @@
@end
-// CHECK: define void @foo(
+// CHECK-LABEL: define void @foo(
void foo(id a) {
// CHECK: [[A:%.*]] = alloca i8*
// CHECK: [[SYNC:%.*]] = alloca i8*
@@ -47,7 +47,7 @@ void foo(id a) {
}
-// CHECK: define i32 @f0(
+// CHECK-LABEL: define i32 @f0(
int f0(id a) {
// TODO: we can optimize the ret to a constant if we can figure out
// either that x isn't stored to within the synchronized block or
@@ -64,7 +64,7 @@ int f0(id a) {
return x;
}
-// CHECK: define void @f1(
+// CHECK-LABEL: define void @f1(
void f1(id a) {
// Check that the return doesn't go through the cleanup.
extern void opaque(void);
diff --git a/test/CodeGenObjC/tentative-cfconstantstring.m b/test/CodeGenObjC/tentative-cfconstantstring.m
index b7e1c4601fed..714c1a402336 100644
--- a/test/CodeGenObjC/tentative-cfconstantstring.m
+++ b/test/CodeGenObjC/tentative-cfconstantstring.m
@@ -34,7 +34,7 @@ static inline void _inlineFunction() {
// CHECK: @__CFConstantStringClassReference = common global [24 x i32] zeroinitializer, align 16
// CHECK: @_unnamed_cfstring_{{.*}} = private constant %struct.NSConstantString { i32* getelementptr inbounds ([24 x i32]* @__CFConstantStringClassReference, i32 0, i32 0)
-// CHECK: define internal void @_inlineFunction()
+// CHECK-LABEL: define internal void @_inlineFunction()
// CHECK: [[ZERO:%.*]] = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_
// CHECK-NEXT: [[ONE:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_"
// CHECK-NEXT: [[TWO:%.*]] = bitcast %struct._class_t* [[ZERO]] to i8*
diff --git a/test/CodeGenObjC/terminate.m b/test/CodeGenObjC/terminate.m
index 8728ec4598bf..4992b998b395 100644
--- a/test/CodeGenObjC/terminate.m
+++ b/test/CodeGenObjC/terminate.m
@@ -9,7 +9,7 @@ void test0(void) {
void *ptr __attribute__((cleanup(destroy)));
test0_helper();
- // CHECK-WITH: define void @test0()
+ // CHECK-WITH-LABEL: define void @test0()
// CHECK-WITH: [[PTR:%.*]] = alloca i8*,
// CHECK-WITH: call void @destroy(i8** [[PTR]])
// CHECK-WITH-NEXT: ret void
@@ -18,7 +18,7 @@ void test0(void) {
// CHECK-WITH-NEXT: catch i8* null
// CHECK-WITH-NEXT: call void @objc_terminate()
- // CHECK-WITHOUT: define void @test0()
+ // CHECK-WITHOUT-LABEL: define void @test0()
// CHECK-WITHOUT: [[PTR:%.*]] = alloca i8*,
// CHECK-WITHOUT: call void @destroy(i8** [[PTR]])
// CHECK-WITHOUT-NEXT: ret void
diff --git a/test/CodeGenObjC/x86_64-struct-return-gc.m b/test/CodeGenObjC/x86_64-struct-return-gc.m
index dab5b15e284e..9cb4b134e67d 100644
--- a/test/CodeGenObjC/x86_64-struct-return-gc.m
+++ b/test/CodeGenObjC/x86_64-struct-return-gc.m
@@ -5,7 +5,7 @@ struct Coerce {
struct Coerce coerce_func(void);
-// CHECK: define void @Coerce_test()
+// CHECK-LABEL: define void @Coerce_test()
void Coerce_test(void) {
struct Coerce c;
@@ -21,7 +21,7 @@ struct Indirect {
struct Indirect indirect_func(void);
-// CHECK: define void @Indirect_test()
+// CHECK-LABEL: define void @Indirect_test()
void Indirect_test(void) {
struct Indirect i;
diff --git a/test/CodeGenObjCXX/arc-attrs.mm b/test/CodeGenObjCXX/arc-attrs.mm
index 57ccb6cdeae0..0f0610f1721d 100644
--- a/test/CodeGenObjCXX/arc-attrs.mm
+++ b/test/CodeGenObjCXX/arc-attrs.mm
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-arc -O0 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-arc -o - %s | FileCheck %s
id makeObject1() __attribute__((ns_returns_retained));
id makeObject2() __attribute__((ns_returns_retained));
void releaseObject(__attribute__((ns_consumed)) id);
-// CHECK: define void @_Z10sanityTestv
+// CHECK-LABEL: define void @_Z10sanityTestv
void sanityTest() {
// CHECK: [[X:%.*]] = alloca i8*, align 8
// CHECK-NEXT: [[OBJ1:%.*]] = call i8* @_Z11makeObject1v()
@@ -28,7 +28,7 @@ T makeObjectT2() __attribute__((ns_returns_retained));
template <typename T>
void releaseObjectT(__attribute__((ns_consumed)) T);
-// CHECK: define void @_Z12templateTestv
+// CHECK-LABEL: define void @_Z12templateTestv
void templateTest() {
// CHECK: [[X:%.*]] = alloca i8*, align 8
// CHECK-NEXT: [[OBJ1:%.*]] = call i8* @_Z12makeObjectT1IU8__strongP11objc_objectET_v()
diff --git a/test/CodeGenObjCXX/arc-blocks.mm b/test/CodeGenObjCXX/arc-blocks.mm
index 810c0e09cc9d..ebb9d21c61f6 100644
--- a/test/CodeGenObjCXX/arc-blocks.mm
+++ b/test/CodeGenObjCXX/arc-blocks.mm
@@ -16,7 +16,7 @@ namespace test0 {
void foo() {
__block A v;
}
- // CHECK: define void @_ZN5test03fooEv()
+ // CHECK-LABEL: define void @_ZN5test03fooEv()
// CHECK: [[V:%.*]] = alloca [[BYREF_A:%.*]], align 8
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_A]]* [[V]], i32 0, i32 4
// CHECK-NEXT: store i8* bitcast (void (i8*, i8*)* [[COPY_HELPER:@.*]] to i8*), i8** [[T0]]
diff --git a/test/CodeGenObjCXX/arc-exceptions.mm b/test/CodeGenObjCXX/arc-exceptions.mm
index b5ed257e9485..0bb11d52ff60 100644
--- a/test/CodeGenObjCXX/arc-exceptions.mm
+++ b/test/CodeGenObjCXX/arc-exceptions.mm
@@ -11,7 +11,7 @@ void test0(void) {
} @catch (Ety *e) {
}
}
-// CHECK: define void @_Z5test0v()
+// CHECK-LABEL: define void @_Z5test0v()
// CHECK: [[E:%.*]] = alloca [[ETY:%.*]]*, align 8
// CHECK-NEXT: invoke void @_Z12test0_helperv()
// CHECK: [[T0:%.*]] = call i8* @objc_begin_catch(
@@ -31,7 +31,7 @@ void test1(void) {
} @catch (__weak Ety *e) {
}
}
-// CHECK: define void @_Z5test1v()
+// CHECK-LABEL: define void @_Z5test1v()
// CHECK: [[E:%.*]] = alloca [[ETY:%.*]]*, align 8
// CHECK-NEXT: invoke void @_Z12test1_helperv()
// CHECK: [[T0:%.*]] = call i8* @objc_begin_catch(
@@ -50,7 +50,7 @@ void test2(void) {
} catch (Ety *e) {
}
}
-// CHECK: define void @_Z5test2v()
+// CHECK-LABEL: define void @_Z5test2v()
// CHECK: [[E:%.*]] = alloca [[ETY:%.*]]*, align 8
// CHECK-NEXT: invoke void @_Z12test2_helperv()
// CHECK: [[T0:%.*]] = call i8* @__cxa_begin_catch(
@@ -70,7 +70,7 @@ void test3(void) {
} catch (Ety * __weak e) {
}
}
-// CHECK: define void @_Z5test3v()
+// CHECK-LABEL: define void @_Z5test3v()
// CHECK: [[E:%.*]] = alloca [[ETY:%.*]]*, align 8
// CHECK-NEXT: invoke void @_Z12test3_helperv()
// CHECK: [[T0:%.*]] = call i8* @__cxa_begin_catch(
@@ -93,7 +93,7 @@ namespace test4 {
A::A() {
throw 0;
}
- // CHECK: define void @_ZN5test41AC2Ev(
+ // CHECK-LABEL: define void @_ZN5test41AC2Ev(
// CHECK: [[THIS:%.*]] = load [[A:%.*]]** {{%.*}}
// Construct single.
// CHECK-NEXT: [[SINGLE:%.*]] = getelementptr inbounds [[A]]* [[THIS]], i32 0, i32 0
diff --git a/test/CodeGenObjCXX/arc-globals.mm b/test/CodeGenObjCXX/arc-globals.mm
index 958d1d872c28..84ea180bca7d 100644
--- a/test/CodeGenObjCXX/arc-globals.mm
+++ b/test/CodeGenObjCXX/arc-globals.mm
@@ -5,21 +5,21 @@
// autorelease pool.
id getObject();
-// CHECK: define internal void @__cxx_global_var_init
+// CHECK-LABEL: define internal void @__cxx_global_var_init
// CHECK: call i8* @_Z9getObjectv
// CHECK-NEXT: call i8* @objc_retainAutoreleasedReturnValue
// CHECK-NEXT: {{store i8*.*@global_obj}}
// CHECK-NEXT: ret void
id global_obj = getObject();
-// CHECK: define internal void @__cxx_global_var_init
+// CHECK-LABEL: define internal void @__cxx_global_var_init
// CHECK: call i8* @_Z9getObjectv
// CHECK-NEXT: call i8* @objc_retainAutoreleasedReturnValue
// CHECK-NEXT: {{store i8*.*@global_obj2}}
// CHECK-NEXT: ret void
id global_obj2 = getObject();
-// CHECK: define internal void @_GLOBAL__I_a
+// CHECK-LABEL: define internal void @_GLOBAL__I_a
// CHECK: call i8* @objc_autoreleasePoolPush()
// CHECK-NEXT: call void @__cxx_global_var_init
// CHECK-NEXT: call void @__cxx_global_var_init1
diff --git a/test/CodeGenObjCXX/arc-mangle.mm b/test/CodeGenObjCXX/arc-mangle.mm
index c2b5817c73b3..10c4f68451f8 100644
--- a/test/CodeGenObjCXX/arc-mangle.mm
+++ b/test/CodeGenObjCXX/arc-mangle.mm
@@ -1,25 +1,25 @@
// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -emit-llvm -o - %s | FileCheck %s
-// CHECK: define void @_Z1fPU8__strongP11objc_object(i8**)
+// CHECK-LABEL: define void @_Z1fPU8__strongP11objc_object(i8**)
void f(__strong id *) {}
-// CHECK: define void @_Z1fPU6__weakP11objc_object(i8**)
+// CHECK-LABEL: define void @_Z1fPU6__weakP11objc_object(i8**)
void f(__weak id *) {}
-// CHECK: define void @_Z1fPU15__autoreleasingP11objc_object(i8**)
+// CHECK-LABEL: define void @_Z1fPU15__autoreleasingP11objc_object(i8**)
void f(__autoreleasing id *) {}
-// CHECK: define void @_Z1fPP11objc_object(i8**)
+// CHECK-LABEL: define void @_Z1fPP11objc_object(i8**)
void f(__unsafe_unretained id *) {}
-// CHECK: define void @_Z1fPKU8__strongP11objc_object(i8**)
+// CHECK-LABEL: define void @_Z1fPKU8__strongP11objc_object(i8**)
void f(const __strong id *) {}
-// CHECK: define void @_Z1fPKU6__weakP11objc_object(i8**)
+// CHECK-LABEL: define void @_Z1fPKU6__weakP11objc_object(i8**)
void f(const __weak id *) {}
-// CHECK: define void @_Z1fPKU15__autoreleasingP11objc_object(i8**)
+// CHECK-LABEL: define void @_Z1fPKU15__autoreleasingP11objc_object(i8**)
void f(const __autoreleasing id *) {}
-// CHECK: define void @_Z1fPKP11objc_object(i8**)
+// CHECK-LABEL: define void @_Z1fPKP11objc_object(i8**)
void f(const __unsafe_unretained id *) {}
template<unsigned N> struct unsigned_c { };
-// CHECK: define weak_odr void @_Z1gIKvEvP10unsigned_cIXplszv1U8__bridgecvPT_v1U8__bridgecvP11objc_objectcvS3_Li0ELi1EEE
+// CHECK-LABEL: define weak_odr void @_Z1gIKvEvP10unsigned_cIXplszv1U8__bridgecvPT_v1U8__bridgecvP11objc_objectcvS3_Li0ELi1EEE
template<typename T>void g(unsigned_c<sizeof((__bridge T*)(__bridge id)(T*)0) + 1>*) {}
template void g<const void>(unsigned_c<sizeof(id) + 1> *);
diff --git a/test/CodeGenObjCXX/arc-move.mm b/test/CodeGenObjCXX/arc-move.mm
index cf3051dd1fe6..0a8286ded438 100644
--- a/test/CodeGenObjCXX/arc-move.mm
+++ b/test/CodeGenObjCXX/arc-move.mm
@@ -31,7 +31,7 @@ typename remove_reference<T>::type&& move(T &&x) {
return static_cast<typename remove_reference<T>::type&&>(x);
}
-// CHECK: define void @_Z12library_moveRU8__strongP11objc_objectS2_
+// CHECK-LABEL: define void @_Z12library_moveRU8__strongP11objc_objectS2_
void library_move(__strong id &x, __strong id &y) {
// CHECK: call i8** @_Z4moveIRU8__strongP11objc_objectEON16remove_referenceIT_E4typeEOS5_
// CHECK: load i8**
@@ -44,7 +44,7 @@ void library_move(__strong id &x, __strong id &y) {
x = move(y);
}
-// CHECK: define void @_Z12library_moveRU8__strongP11objc_object
+// CHECK-LABEL: define void @_Z12library_moveRU8__strongP11objc_object
void library_move(__strong id &y) {
// CHECK: [[Y:%[a-zA-Z0-9]+]] = call i8** @_Z4moveIRU8__strongP11objc_objectEON16remove_referenceIT_E4typeEOS5_
// Load the object
@@ -62,7 +62,7 @@ void library_move(__strong id &y) {
// CHECK-NEXT: ret void
}
-// CHECK: define void @_Z10const_moveRKU8__strongP11objc_object(
+// CHECK-LABEL: define void @_Z10const_moveRKU8__strongP11objc_object(
void const_move(const __strong id &x) {
// CHECK: [[Y:%.*]] = alloca i8*,
// CHECK: [[X:%.*]] = call i8** @_Z4moveIRKU8__strongP11objc_objectEON16remove_referenceIT_E4typeEOS5_(
diff --git a/test/CodeGenObjCXX/arc-new-delete.mm b/test/CodeGenObjCXX/arc-new-delete.mm
index c061e5dbdff8..9d42b03a7c4c 100644
--- a/test/CodeGenObjCXX/arc-new-delete.mm
+++ b/test/CodeGenObjCXX/arc-new-delete.mm
@@ -3,7 +3,7 @@
typedef __strong id strong_id;
typedef __weak id weak_id;
-// CHECK: define void @_Z8test_newP11objc_object
+// CHECK-LABEL: define void @_Z8test_newP11objc_object
void test_new(id invalue) {
// CHECK: [[INVALUEADDR:%.*]] = alloca i8*
// CHECK-NEXT: store i8* null, i8** [[INVALUEADDR]]
@@ -40,7 +40,7 @@ void test_new(id invalue) {
// CHECK: ret void
}
-// CHECK: define void @_Z14test_array_new
+// CHECK-LABEL: define void @_Z14test_array_new
void test_array_new() {
// CHECK: call noalias i8* @_Znam
// CHECK: store i64 17, i64*
@@ -54,7 +54,7 @@ void test_array_new() {
// CHECK: ret void
}
-// CHECK: define void @_Z11test_deletePU8__strongP11objc_objectPU6__weakS0_
+// CHECK-LABEL: define void @_Z11test_deletePU8__strongP11objc_objectPU6__weakS0_
void test_delete(__strong id *sptr, __weak id *wptr) {
// CHECK: br i1
// CHECK: load i8**
@@ -69,7 +69,7 @@ void test_delete(__strong id *sptr, __weak id *wptr) {
// CHECK: ret void
}
-// CHECK: define void @_Z17test_array_deletePU8__strongP11objc_objectPU6__weakS0_
+// CHECK-LABEL: define void @_Z17test_array_deletePU8__strongP11objc_objectPU6__weakS0_
void test_array_delete(__strong id *sptr, __weak id *wptr) {
// CHECK: icmp eq i8** [[BEGIN:%.*]], null
// CHECK: [[LEN:%.*]] = load i64* {{%.*}}
diff --git a/test/CodeGenObjCXX/arc-pseudo-destructors.mm b/test/CodeGenObjCXX/arc-pseudo-destructors.mm
index 2f8d9e1878bb..0a69487b9e7c 100644
--- a/test/CodeGenObjCXX/arc-pseudo-destructors.mm
+++ b/test/CodeGenObjCXX/arc-pseudo-destructors.mm
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -fblocks -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s | FileCheck %s
-// CHECK: define void @_Z28test_objc_object_pseudo_dtorPU8__strongP11objc_objectPU6__weakS0_
+// CHECK-LABEL: define void @_Z28test_objc_object_pseudo_dtorPU8__strongP11objc_objectPU6__weakS0_
void test_objc_object_pseudo_dtor(__strong id *ptr, __weak id *wptr) {
// CHECK: load i8***
// CHECK-NEXT: load i8**
diff --git a/test/CodeGenObjCXX/arc-references.mm b/test/CodeGenObjCXX/arc-references.mm
index 121077435da3..10e7f64198db 100644
--- a/test/CodeGenObjCXX/arc-references.mm
+++ b/test/CodeGenObjCXX/arc-references.mm
@@ -7,7 +7,7 @@ id getObject();
void callee();
// Lifetime extension for binding a reference to an rvalue
-// CHECK: define void @_Z5test0v()
+// CHECK-LABEL: define void @_Z5test0v()
void test0() {
// CHECK: call i8* @_Z9getObjectv
// CHECK-NEXT: call i8* @objc_retainAutoreleasedReturnValue
@@ -25,7 +25,7 @@ void test0() {
}
// No lifetime extension when we're binding a reference to an lvalue.
-// CHECK: define void @_Z5test1RU8__strongP11objc_objectRU6__weakS0_
+// CHECK-LABEL: define void @_Z5test1RU8__strongP11objc_objectRU6__weakS0_
void test1(__strong id &x, __weak id &y) {
// CHECK-NOT: release
const __strong id &ref1 = x;
@@ -47,7 +47,7 @@ void test3() {
// CHECK-NEXT: ret void
}
-// CHECK: define void @_Z5test4RU8__strongP11objc_object
+// CHECK-LABEL: define void @_Z5test4RU8__strongP11objc_object
void test4(__strong id &x) {
// CHECK: call i8* @objc_retain
__strong A* const &ar = x;
@@ -59,7 +59,7 @@ void test4(__strong id &x) {
void sink(__strong A* &&);
-// CHECK: define void @_Z5test5RU8__strongP11objc_object
+// CHECK-LABEL: define void @_Z5test5RU8__strongP11objc_object
void test5(__strong id &x) {
// CHECK: [[REFTMP:%.*]] = alloca {{%.*}}*, align 8
// CHECK: [[OBJ_ID:%.*]] = call i8* @objc_retain(
@@ -75,7 +75,7 @@ void test5(__strong id &x) {
// CHECK-NEXT: ret void
}
-// CHECK: define internal void @__cxx_global_var_init(
+// CHECK-LABEL: define internal void @__cxx_global_var_init(
// CHECK: call i8* @_Z9getObjectv
// CHECK-NEXT: call i8* @objc_retainAutoreleasedReturnValue
const __strong id &global_ref = getObject();
diff --git a/test/CodeGenObjCXX/arc-special-member-functions.mm b/test/CodeGenObjCXX/arc-special-member-functions.mm
index 0b34538d13ef..49077ffec494 100644
--- a/test/CodeGenObjCXX/arc-special-member-functions.mm
+++ b/test/CodeGenObjCXX/arc-special-member-functions.mm
@@ -12,14 +12,14 @@ struct ObjCBlockMember {
int (^bp)(int);
};
-// CHECK: define void @_Z42test_ObjCMember_default_construct_destructv(
+// CHECK-LABEL: define void @_Z42test_ObjCMember_default_construct_destructv(
void test_ObjCMember_default_construct_destruct() {
// CHECK: call void @_ZN10ObjCMemberC1Ev
// CHECK: call void @_ZN10ObjCMemberD1Ev
ObjCMember m1;
}
-// CHECK: define void @_Z39test_ObjCMember_copy_construct_destruct10ObjCMember
+// CHECK-LABEL: define void @_Z39test_ObjCMember_copy_construct_destruct10ObjCMember
void test_ObjCMember_copy_construct_destruct(ObjCMember m1) {
// CHECK: call void @_ZN10ObjCMemberC1ERKS_
// CHECK: call void @_ZN10ObjCMemberD1Ev
@@ -27,7 +27,7 @@ void test_ObjCMember_copy_construct_destruct(ObjCMember m1) {
// CHECK: ret void
}
-// CHECK: define void @_Z27test_ObjCMember_copy_assign10ObjCMemberS_
+// CHECK-LABEL: define void @_Z27test_ObjCMember_copy_assign10ObjCMemberS_
void test_ObjCMember_copy_assign(ObjCMember m1, ObjCMember m2) {
// CHECK: {{call.*_ZN10ObjCMemberaSERKS_}}
m1 = m2;
@@ -39,7 +39,7 @@ void test_ObjCMember_copy_assign(ObjCMember m1, ObjCMember m2) {
// CHECK: call void @objc_storeStrong
// CHECK: ret
-// CHECK: define void @_Z47test_ObjCArrayMember_default_construct_destructv
+// CHECK-LABEL: define void @_Z47test_ObjCArrayMember_default_construct_destructv
void test_ObjCArrayMember_default_construct_destruct() {
// CHECK: call void @_ZN15ObjCArrayMemberC1Ev
ObjCArrayMember m1;
@@ -47,7 +47,7 @@ void test_ObjCArrayMember_default_construct_destruct() {
// CHECK: ret void
}
-// CHECK: define void @_Z44test_ObjCArrayMember_copy_construct_destruct15ObjCArrayMember
+// CHECK-LABEL: define void @_Z44test_ObjCArrayMember_copy_construct_destruct15ObjCArrayMember
void test_ObjCArrayMember_copy_construct_destruct(ObjCArrayMember m1) {
// CHECK: call void @_ZN15ObjCArrayMemberC1ERKS_
ObjCArrayMember m2 = m1;
@@ -67,7 +67,7 @@ void test_ObjCArrayMember_copy_assign(ObjCArrayMember m1, ObjCArrayMember m2) {
// CHECK-NEXT: br label
// CHECK: ret
-// CHECK: define void @_Z47test_ObjCBlockMember_default_construct_destructv
+// CHECK-LABEL: define void @_Z47test_ObjCBlockMember_default_construct_destructv
void test_ObjCBlockMember_default_construct_destruct() {
// CHECK: call void @_ZN15ObjCBlockMemberC1Ev
ObjCBlockMember m;
@@ -75,7 +75,7 @@ void test_ObjCBlockMember_default_construct_destruct() {
// CHECK-NEXT: ret void
}
-// CHECK: define void @_Z44test_ObjCBlockMember_copy_construct_destruct15ObjCBlockMember
+// CHECK-LABEL: define void @_Z44test_ObjCBlockMember_copy_construct_destruct15ObjCBlockMember
void test_ObjCBlockMember_copy_construct_destruct(ObjCBlockMember m1) {
// CHECK: call void @_ZN15ObjCBlockMemberC1ERKS_
ObjCBlockMember m2 = m1;
@@ -83,7 +83,7 @@ void test_ObjCBlockMember_copy_construct_destruct(ObjCBlockMember m1) {
// CHECK-NEXT: ret void
}
-// CHECK: define void @_Z32test_ObjCBlockMember_copy_assign15ObjCBlockMemberS_
+// CHECK-LABEL: define void @_Z32test_ObjCBlockMember_copy_assign15ObjCBlockMemberS_
void test_ObjCBlockMember_copy_assign(ObjCBlockMember m1, ObjCBlockMember m2) {
// CHECK: {{call.*_ZN15ObjCBlockMemberaSERKS_}}
m1 = m2;
@@ -105,22 +105,22 @@ void test_ObjCBlockMember_copy_assign(ObjCBlockMember m1, ObjCBlockMember m2) {
// CHECK-NEXT: ret
// Implicitly-generated copy constructor for ObjCBlockMember
-// CHECK: define linkonce_odr void @_ZN15ObjCBlockMemberC2ERKS_
+// CHECK-LABEL: define linkonce_odr void @_ZN15ObjCBlockMemberC2ERKS_
// CHECK: call i8* @objc_retainBlock
// CHECK: ret
// Implicitly-generated destructor for ObjCBlockMember
-// CHECK: define linkonce_odr void @_ZN15ObjCBlockMemberD2Ev
+// CHECK-LABEL: define linkonce_odr void @_ZN15ObjCBlockMemberD2Ev
// CHECK: call void @objc_storeStrong(i8*
// CHECK: ret
// Implicitly-generated default constructor for ObjCBlockMember
-// CHECK: define linkonce_odr void @_ZN15ObjCBlockMemberC2Ev
+// CHECK-LABEL: define linkonce_odr void @_ZN15ObjCBlockMemberC2Ev
// CHECK: store {{.*}} null,
// CHECK-NEXT: ret void
// Implicitly-generated copy constructor for ObjCArrayMember
-// CHECK: define linkonce_odr void @_ZN15ObjCArrayMemberC2ERKS_
+// CHECK-LABEL: define linkonce_odr void @_ZN15ObjCArrayMemberC2ERKS_
// CHECK: br i1
// CHECK: call i8* @objc_retain
// CHECK-NEXT: store i8*
@@ -128,7 +128,7 @@ void test_ObjCBlockMember_copy_assign(ObjCBlockMember m1, ObjCBlockMember m2) {
// CHECK: ret
// Implicitly-generated destructor for ObjCArrayMember
-// CHECK: define linkonce_odr void @_ZN15ObjCArrayMemberD2Ev
+// CHECK-LABEL: define linkonce_odr void @_ZN15ObjCArrayMemberD2Ev
// CHECK: [[BEGIN:%.*]] = getelementptr inbounds [2 x [3 x i8*]]*
// CHECK-NEXT: [[END:%.*]] = getelementptr inbounds i8** [[BEGIN]], i64 6
// CHECK-NEXT: br label
@@ -140,24 +140,24 @@ void test_ObjCBlockMember_copy_assign(ObjCBlockMember m1, ObjCBlockMember m2) {
// CHECK: ret void
// Implicitly-generated default constructor for ObjCArrayMember
-// CHECK: define linkonce_odr void @_ZN15ObjCArrayMemberC2Ev
+// CHECK-LABEL: define linkonce_odr void @_ZN15ObjCArrayMemberC2Ev
// CHECK: call void @llvm.memset.p0i8.i64
// CHECK: ret
// Implicitly-generated copy constructor for ObjCMember
-// CHECK: define linkonce_odr void @_ZN10ObjCMemberC2ERKS_
+// CHECK-LABEL: define linkonce_odr void @_ZN10ObjCMemberC2ERKS_
// CHECK-NOT: objc_release
// CHECK: call i8* @objc_retain
// CHECK-NEXT: store i8*
// CHECK-NEXT: ret void
// Implicitly-generated destructor for ObjCMember
-// CHECK: define linkonce_odr void @_ZN10ObjCMemberD2Ev
+// CHECK-LABEL: define linkonce_odr void @_ZN10ObjCMemberD2Ev
// CHECK: call void @objc_storeStrong
// CHECK: ret void
// Implicitly-generated default constructor for ObjCMember
-// CHECK: define linkonce_odr void @_ZN10ObjCMemberC2Ev
+// CHECK-LABEL: define linkonce_odr void @_ZN10ObjCMemberC2Ev
// CHECK-NOT: objc_release
// CHECK: store i8* null
// CHECK-NEXT: ret void
diff --git a/test/CodeGenObjCXX/arc.mm b/test/CodeGenObjCXX/arc.mm
index e3e86a0b0d53..e31b0943b75e 100644
--- a/test/CodeGenObjCXX/arc.mm
+++ b/test/CodeGenObjCXX/arc.mm
@@ -55,7 +55,7 @@ void test34(int cond) {
test34_sink(cond ? &strong : 0);
test34_sink(cond ? &weak : 0);
- // CHECK: define void @_Z6test34i(
+ // CHECK-LABEL: define void @_Z6test34i(
// CHECK: [[COND:%.*]] = alloca i32
// CHECK-NEXT: [[STRONG:%.*]] = alloca i8*
// CHECK-NEXT: [[WEAK:%.*]] = alloca i8*
@@ -118,7 +118,7 @@ struct Test35_Helper {
id makeObject4();
};
-// CHECK: define void @_Z6test3513Test35_HelperPS_
+// CHECK-LABEL: define void @_Z6test3513Test35_HelperPS_
void test35(Test35_Helper x0, Test35_Helper *x0p) {
// CHECK: call i8* @_ZN13Test35_Helper11makeObject1Ev
// CHECK-NOT: call i8* @objc_retain
@@ -146,7 +146,7 @@ void test35(Test35_Helper x0, Test35_Helper *x0p) {
// CHECK-NEXT: ret void
}
-// CHECK: define void @_Z7test35b13Test35_HelperPS_
+// CHECK-LABEL: define void @_Z7test35b13Test35_HelperPS_
void test35b(Test35_Helper x0, Test35_Helper *x0p) {
// CHECK: call i8* @_ZN13Test35_Helper11makeObject3Ev
// CHECK: call i8* @objc_retain
@@ -174,7 +174,7 @@ void test35b(Test35_Helper x0, Test35_Helper *x0p) {
}
// rdar://problem/9603128
-// CHECK: define i8* @_Z6test36P11objc_object(
+// CHECK-LABEL: define i8* @_Z6test36P11objc_object(
id test36(id z) {
// CHECK: objc_retain
// CHECK: objc_retain
@@ -196,7 +196,7 @@ template <class T> void test37(T *a) {
}
extern template void test37<Test37>(Test37 *a);
template void test37<Test37>(Test37 *a);
-// CHECK: define weak_odr void @_Z6test37I6Test37EvPT_(
+// CHECK-LABEL: define weak_odr void @_Z6test37I6Test37EvPT_(
// CHECK: [[T0:%.*]] = call [[NSARRAY]]* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to [[NSARRAY]]* (i8*, i8*)*)(
// CHECK-NEXT: [[T1:%.*]] = bitcast [[NSARRAY]]* [[T0]] to i8*
// CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]])
@@ -224,7 +224,7 @@ void send_release() {
[Test37 array];
}
-// CHECK: define weak_odr void @_Z12send_releaseIiEvv(
+// CHECK-LABEL: define weak_odr void @_Z12send_releaseIiEvv(
// CHECK: call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
// CHECK-NEXT: bitcast
// CHECK-NEXT: call i8* @objc_retainAutoreleasedReturnValue
@@ -240,7 +240,7 @@ Test37 *instantiate_init() {
return result;
}
-// CHECK: define weak_odr %2* @_Z16instantiate_initIiEP6Test37v
+// CHECK-LABEL: define weak_odr %2* @_Z16instantiate_initIiEP6Test37v
// CHECK: call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
// CHECK: call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
// CHECK: call i8* @objc_retain
@@ -257,7 +257,7 @@ template <class T> class Test38 {
^{ (void) x; }, ({ x; });
}
};
-// CHECK: define weak_odr void @_ZN6Test38IiE4testEi(
+// CHECK-LABEL: define weak_odr void @_ZN6Test38IiE4testEi(
template class Test38<int>;
// rdar://problem/11964832
@@ -272,7 +272,7 @@ class Test39 : Test39_base1, Test39_base2 { // base2 is at non-zero offset
};
id Test39::bar() { return 0; }
// Note lack of autorelease.
-// CHECK: define i8* @_ZThn8_N6Test393barEv(
+// CHECK-LABEL: define i8* @_ZThn8_N6Test393barEv(
// CHECK: call i8* @_ZN6Test393barEv(
// CHECK-NEXT: ret i8*
@@ -287,7 +287,7 @@ template <class T> void test40_helper() {
[Test40 foo: &x];
};
template void test40_helper<int>();
-// CHECK: define weak_odr void @_Z13test40_helperIiEvv()
+// CHECK-LABEL: define weak_odr void @_Z13test40_helperIiEvv()
// CHECK: [[X:%.*]] = alloca i8*
// CHECK-NEXT: [[TEMP:%.*]] = alloca i8*
// CHECK-NEXT: store i8* null, i8** [[X]]
diff --git a/test/CodeGenObjCXX/block-var-layout.mm b/test/CodeGenObjCXX/block-var-layout.mm
index 08dbc02affbd..793d4b99aad6 100644
--- a/test/CodeGenObjCXX/block-var-layout.mm
+++ b/test/CodeGenObjCXX/block-var-layout.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -x objective-c++ -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fobjc-gc -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout
// RUN: FileCheck --input-file=%t-64.layout %s
// rdar://12184410
// rdar://12752901
diff --git a/test/CodeGenObjCXX/catch-id-type.mm b/test/CodeGenObjCXX/catch-id-type.mm
index 2d6cccc0f129..0a2b940ff16e 100644
--- a/test/CodeGenObjCXX/catch-id-type.mm
+++ b/test/CodeGenObjCXX/catch-id-type.mm
@@ -31,7 +31,7 @@ id FUNC() {
catch( id error )
{
// CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
- // CHECK-NEXT: catch i8* bitcast ({ i8*, i8*, i32, i8* }* @_ZTIP4INTF to i8*)
+ // CHECK-NEXT: catch i8* bitcast ({ i8*, i8*, i32, i8* }* @_ZTIPU11objcproto1P4INTF to i8*)
// CHECK-NEXT: catch i8* bitcast ({ i8*, i8*, i32, i8* }* @_ZTIP11objc_object to i8*)
// CHECK-NEXT: catch i8* bitcast ({ i8*, i8*, i32, i8* }* @_ZTIP10objc_class to i8*)
error = error;
diff --git a/test/CodeGenObjCXX/encode.mm b/test/CodeGenObjCXX/encode.mm
index 1b6a241fcffa..075d7909d596 100644
--- a/test/CodeGenObjCXX/encode.mm
+++ b/test/CodeGenObjCXX/encode.mm
@@ -201,3 +201,26 @@ struct Y : Empty {
// CHECK: @g8 = constant [14 x i8] c"{Y={X=[10i]}}\00"
extern const char g8[] = @encode(Y);
+
+
+class dynamic_class {
+public:
+ virtual ~dynamic_class();
+};
+@interface has_dynamic_class_ivar
+@end
+@implementation has_dynamic_class_ivar {
+ dynamic_class dynamic_class_ivar;
+}
+@end
+// CHECK: internal global [41 x i8] c"{dynamic_class=\22_vptr$dynamic_class\22^^?}\00"
+
+namespace PR17142 {
+ struct A { virtual ~A(); };
+ struct B : virtual A { int y; };
+ struct C { virtual ~C(); int z; };
+ struct D : C, B { int a; };
+ struct E : D {};
+ // CHECK: @_ZN7PR171421xE = constant [14 x i8] c"{E=^^?i^^?ii}\00"
+ extern const char x[] = @encode(E);
+}
diff --git a/test/CodeGenObjCXX/exceptions-legacy.mm b/test/CodeGenObjCXX/exceptions-legacy.mm
index a31ba36660ab..5de90bbb5611 100644
--- a/test/CodeGenObjCXX/exceptions-legacy.mm
+++ b/test/CodeGenObjCXX/exceptions-legacy.mm
@@ -12,7 +12,7 @@ void test0(id obj) {
foo();
}
}
-// CHECK: define void @_Z5test0P11objc_object(
+// CHECK-LABEL: define void @_Z5test0P11objc_object(
// Enter the @synchronized block.
// CHECK: call i32 @objc_sync_enter(i8* [[OBJ:%.*]])
// CHECK: call void @objc_exception_try_enter([[BUF_T:%.*]]* [[BUF:%.*]])
@@ -52,7 +52,7 @@ void test1(id obj, bool *failed) {
*failed = true;
}
}
-// CHECK: define void @_Z5test1P11objc_objectPb(
+// CHECK-LABEL: define void @_Z5test1P11objc_objectPb(
// Enter the @try block.
// CHECK: call void @objc_exception_try_enter([[BUF_T]]* [[BUF:%.*]])
// CHECK-NEXT: [[T0:%.*]] = getelementptr [[BUF_T]]* [[BUF]], i32 0, i32 0, i32 0
diff --git a/test/CodeGenObjCXX/exceptions.mm b/test/CodeGenObjCXX/exceptions.mm
index 031c22204d8b..a62a82b08cbd 100644
--- a/test/CodeGenObjCXX/exceptions.mm
+++ b/test/CodeGenObjCXX/exceptions.mm
@@ -5,7 +5,7 @@ void opaque();
namespace test0 {
- // CHECK: define void @_ZN5test03fooEv
+ // CHECK-LABEL: define void @_ZN5test03fooEv
void foo() {
try {
// CHECK: invoke void @_Z6opaquev
diff --git a/test/CodeGenObjCXX/gc.mm b/test/CodeGenObjCXX/gc.mm
index a504892bcbdf..1659dbf7a445 100644
--- a/test/CodeGenObjCXX/gc.mm
+++ b/test/CodeGenObjCXX/gc.mm
@@ -9,7 +9,7 @@ namespace test0 {
};
A::A() : x(test0::x) {}
-// CHECK: define void @_ZN5test01AC2Ev(
+// CHECK-LABEL: define void @_ZN5test01AC2Ev(
// CHECK: [[THIS:%.*]] = alloca [[TEST0:%.*]]*, align 8
// CHECK-NEXT: store
// CHECK-NEXT: [[T0:%.*]] = load [[TEST0]]** [[THIS]]
diff --git a/test/CodeGenObjCXX/implicit-copy-assign-operator.mm b/test/CodeGenObjCXX/implicit-copy-assign-operator.mm
index a5ce78960914..88837c1713ba 100644
--- a/test/CodeGenObjCXX/implicit-copy-assign-operator.mm
+++ b/test/CodeGenObjCXX/implicit-copy-assign-operator.mm
@@ -43,7 +43,7 @@ void test_D(D d1, D d2) {
d1 = d2;
}
-// CHECK-OBJ: define linkonce_odr %struct.D* @_ZN1DaSERS_
+// CHECK-OBJ-LABEL: define linkonce_odr %struct.D* @_ZN1DaSERS_
// CHECK-OBJ: {{call.*_ZN1AaSERS_}}
// CHECK-OBJ: {{call.*_ZN1BaSERS_}}
// CHECK-OBJ: {{call.*_ZN1CaSERKS_}}
diff --git a/test/CodeGenObjCXX/implicit-copy-constructor.mm b/test/CodeGenObjCXX/implicit-copy-constructor.mm
index 5cd6f42a6c42..6dbd39e15223 100644
--- a/test/CodeGenObjCXX/implicit-copy-constructor.mm
+++ b/test/CodeGenObjCXX/implicit-copy-constructor.mm
@@ -41,7 +41,7 @@ void f(D d) {
D d2(d);
}
-// CHECK: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* %this, %struct.D*) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* %this, %struct.D*) unnamed_addr
// CHECK: call void @_ZN1AC1Ev
// CHECK: call void @_ZN1CC2ERS_1A
// CHECK: call void @_ZN1AD1Ev
diff --git a/test/CodeGenObjCXX/lambda-expressions.mm b/test/CodeGenObjCXX/lambda-expressions.mm
index c73e1727d637..2468eb1e71a4 100644
--- a/test/CodeGenObjCXX/lambda-expressions.mm
+++ b/test/CodeGenObjCXX/lambda-expressions.mm
@@ -6,16 +6,16 @@ fp f() { auto x = []{ return 3; }; return x; }
// MRC: @"\01L_OBJC_METH_VAR_NAME{{.*}}" = internal global [5 x i8] c"copy\00"
// MRC: @"\01L_OBJC_METH_VAR_NAME{{.*}}" = internal global [12 x i8] c"autorelease\00"
-// MRC: define i32 ()* @_Z1fv(
-// MRC: define internal i32 ()* @"_ZZ1fvENK3$_0cvU13block_pointerFivEEv"
+// MRC-LABEL: define i32 ()* @_Z1fv(
+// MRC-LABEL: define internal i32 ()* @"_ZZ1fvENK3$_0cvU13block_pointerFivEEv"
// MRC: store i8* bitcast (i8** @_NSConcreteStackBlock to i8*)
// MRC: store i8* bitcast (i32 (i8*)* @"___ZZ1fvENK3$_0cvU13block_pointerFivEEv_block_invoke" to i8*)
// MRC: call i32 ()* (i8*, i8*)* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i32 ()* (i8*, i8*)*)
// MRC: call i32 ()* (i8*, i8*)* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i32 ()* (i8*, i8*)*)
// MRC: ret i32 ()*
-// ARC: define i32 ()* @_Z1fv(
-// ARC: define internal i32 ()* @"_ZZ1fvENK3$_0cvU13block_pointerFivEEv"
+// ARC-LABEL: define i32 ()* @_Z1fv(
+// ARC-LABEL: define internal i32 ()* @"_ZZ1fvENK3$_0cvU13block_pointerFivEEv"
// ARC: store i8* bitcast (i8** @_NSConcreteStackBlock to i8*)
// ARC: store i8* bitcast (i32 (i8*)* @"___ZZ1fvENK3$_0cvU13block_pointerFivEEv_block_invoke" to i8*)
// ARC: call i8* @objc_retainBlock
@@ -35,7 +35,7 @@ void f2() { global = []{ return 3; }; }
// ARC: store i8* bitcast (i32 (i8*)* @___Z2f2v_block_invoke to i8*),
// ARC: call i8* @objc_retainBlock
// ARC: call void @objc_release
-// ARC: define internal i32 @___Z2f2v_block_invoke
+// ARC-LABEL: define internal i32 @___Z2f2v_block_invoke
// ARC: call i32 @"_ZZ2f2vENK3$_1clEv
template <class T> void take_lambda(T &&lambda) { lambda(); }
@@ -60,6 +60,33 @@ void take_block(void (^block)()) { block(); }
}
@end
-// ARC: attributes [[NUW]] = { nounwind{{.*}} }
+// Check lines for BlockInLambda test below
+// ARC-LABEL: define internal i32 @___ZZN13BlockInLambda1X1fEvENKUlvE_clEv_block_invoke
+// ARC: [[Y:%.*]] = getelementptr inbounds %"struct.BlockInLambda::X"* {{.*}}, i32 0, i32 1
+// ARC-NEXT: [[YVAL:%.*]] = load i32* [[Y]], align 4
+// ARC-NEXT: ret i32 [[YVAL]]
+
+typedef int (^fptr)();
+template<typename T> struct StaticMembers {
+ static fptr f;
+};
+template<typename T>
+fptr StaticMembers<T>::f = [] { auto f = []{return 5;}; return fptr(f); }();
+template fptr StaticMembers<float>::f;
+// ARC-LABEL: define linkonce_odr i32 ()* @_ZZNK13StaticMembersIfE1fMUlvE_clEvENKUlvE_cvU13block_pointerFivEEv
+
+namespace BlockInLambda {
+ struct X {
+ int x,y;
+ void f() {
+ [this]{return ^{return y;}();}();
+ };
+ };
+ void g(X& x) {
+ x.f();
+ };
+}
+
+// ARC: attributes [[NUW]] = { nounwind{{.*}} }
// MRC: attributes [[NUW]] = { nounwind{{.*}} }
diff --git a/test/CodeGenObjCXX/literals.mm b/test/CodeGenObjCXX/literals.mm
index b8946fa3f805..f21bba75f374 100644
--- a/test/CodeGenObjCXX/literals.mm
+++ b/test/CodeGenObjCXX/literals.mm
@@ -14,7 +14,7 @@ struct Y {
operator id() const;
};
-// CHECK: define void @_Z10test_arrayv
+// CHECK-LABEL: define void @_Z10test_arrayv
void test_array() {
// CHECK: [[OBJECTS:%[a-zA-Z0-9.]+]] = alloca [2 x i8*]
@@ -60,7 +60,7 @@ void test_array() {
// CHECK: unreachable
}
-// CHECK: define weak_odr void @_Z24test_array_instantiationIiEvv
+// CHECK-LABEL: define weak_odr void @_Z24test_array_instantiationIiEvv
template<typename T>
void test_array_instantiation() {
// CHECK: [[OBJECTS:%[a-zA-Z0-9.]+]] = alloca [2 x i8*]
diff --git a/test/CodeGenObjCXX/mangle-blocks.mm b/test/CodeGenObjCXX/mangle-blocks.mm
index 892c8afedebf..405e5282cda7 100644
--- a/test/CodeGenObjCXX/mangle-blocks.mm
+++ b/test/CodeGenObjCXX/mangle-blocks.mm
@@ -1,19 +1,22 @@
// RUN: %clang_cc1 -emit-llvm -fblocks -o - -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s | FileCheck %s
-// CHECK: @_ZGVN3foo22___Z3foov_block_invoke5valueE = internal global i64 0
+// CHECK: @_ZGVZZ3foovEUb_E5value = internal global i64 0
+// CHECK: @_ZZZN26externally_visible_statics1S3fooEiEd_Ub_E1k = linkonce_odr global i32 0
+// CHECK: @_ZZ26externally_visible_statics1S1xMUb_E1j = linkonce_odr global i32 0
+// CHECK: @_ZZZN26externally_visible_statics10inlinefuncEvEUb_E1i = linkonce_odr global i32 0
int f();
void foo() {
- // CHECK: define internal i32 @___Z3foov_block_invoke
- // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVN3foo22___Z3foov_block_invoke5valueE
+ // CHECK-LABEL: define internal i32 @___Z3foov_block_invoke
+ // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZZ3foovEUb_E5value
(void)^(int x) {
static int value = f();
return x + value;
};
}
-// CHECK: define internal i32 @i_block_invoke
+// CHECK-LABEL: define internal i32 @i_block_invoke
int i = ^(int x) { return x;}(i);
@interface A
@@ -24,7 +27,7 @@ int i = ^(int x) { return x;}(i);
- (void)method {
// CHECK: define internal signext i8 @"__11-[A method]_block_invoke"
(void)^(int x) {
- // CHECK: @"_ZN11-[A method]28__11-[A method]_block_invoke4nameE"
+ // CHECK: @"_ZZZ11-[A method]EUb0_E4name"
static const char *name = "hello";
return name[x];
};
@@ -39,12 +42,44 @@ void foo(int) {
}
namespace N {
- // CHECK: define internal signext i8 @___Z3fooi_block_invoke
+ // CHECK-LABEL: define internal signext i8 @___Z3fooi_block_invoke
void bar() {
(void)^(int x) {
- // CHECK: @_ZN1N3bar26___ZN1N3barEv_block_invoke4nameE
+ // CHECK: @_ZZZN1N3barEvEUb2_E4name
static const char *name = "hello";
return name[x];
};
}
}
+
+class C {
+ C();
+};
+C::C() {
+ (void)^(int x) {
+ // CHECK: @_ZZZN1CC1EvEUb3_E5nameb
+ static const char *nameb = "hello";
+ return nameb[x];
+ };
+}
+
+int f();
+namespace externally_visible_statics {
+ inline void inlinefunc() {
+ ^{
+ static int i = f();
+ }();
+ }
+ struct S {
+ int x = ^{
+ static int j = f();
+ return j;
+ }();
+ void foo(int y = ^{ static int k = f(); return k; }()) {}
+ };
+ void g() {
+ inlinefunc();
+ S s;
+ s.foo();
+ }
+}
diff --git a/test/CodeGenObjCXX/mangle.mm b/test/CodeGenObjCXX/mangle.mm
index 45a93a196dcb..5b944caf1f41 100644
--- a/test/CodeGenObjCXX/mangle.mm
+++ b/test/CodeGenObjCXX/mangle.mm
@@ -78,3 +78,23 @@ void test2(Test2 *t) {
Test2Template<decltype(t.dimension)> t1;
Test2Template<decltype(t->alt_axis)> t2;
}
+
+@protocol P;
+void overload1(A<P>*) {}
+// CHECK-LABEL: define void @_Z9overload1PU11objcproto1P1A
+void overload1(const A<P>*) {}
+// CHECK-LABEL: define void @_Z9overload1PKU11objcproto1P1A
+void overload1(A<P>**) {}
+// CHECK-LABEL: define void @_Z9overload1PPU11objcproto1P1A
+void overload1(A<P>*const*) {}
+// CHECK-LABEL: define void @_Z9overload1PKPU11objcproto1P1A
+void overload1(A<P>***) {}
+// CHECK-LABEL: define void @_Z9overload1PPPU11objcproto1P1A
+void overload1(void (f)(A<P>*)) {}
+// CHECK-LABEL: define void @_Z9overload1PFvPU11objcproto1P1AE
+
+template<typename T> struct X { void f(); };
+template<> void X<A*>::f() {}
+// CHECK-LABEL: define void @_ZN1XIP1AE1fEv
+template<> void X<A<P>*>::f() {}
+// CHECK-LABEL: define void @_ZN1XIPU11objcproto1P1AE1fEv
diff --git a/test/CodeGenObjCXX/message.mm b/test/CodeGenObjCXX/message.mm
index 1268a79d63b7..af3d81f16c98 100644
--- a/test/CodeGenObjCXX/message.mm
+++ b/test/CodeGenObjCXX/message.mm
@@ -15,7 +15,7 @@ namespace test0 {
[a foo];
}
template void foo<int>();
- // CHECK: define weak_odr void @_ZN5test03fooIiEEvv()
+ // CHECK-LABEL: define weak_odr void @_ZN5test03fooIiEEvv()
// CHECK: [[T0:%.*]] = call [[TEST0:%.*]]* @_ZN5test01AcvP5Test0Ev(
// CHECK-NEXT: [[T1:%.*]] = load i8**
// CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST0]]* [[T0]] to i8*
diff --git a/test/CodeGenObjCXX/nrvo.mm b/test/CodeGenObjCXX/nrvo.mm
index 47460c2fb3db..0a7dff50c5a0 100644
--- a/test/CodeGenObjCXX/nrvo.mm
+++ b/test/CodeGenObjCXX/nrvo.mm
@@ -22,7 +22,7 @@ struct X {
X blocksNRVO() {
return ^{
- // CHECK: define internal void @___Z10blocksNRVOv_block_invoke
+ // CHECK-LABEL: define internal void @___Z10blocksNRVOv_block_invoke
X x;
// CHECK: tail call void @_ZN1XC1Ev
// CHECK-NEXT: ret void
diff --git a/test/CodeGenObjCXX/objc-container-subscripting-1.mm b/test/CodeGenObjCXX/objc-container-subscripting-1.mm
index c0dd0f8bae4d..48c5f5cc2cf2 100644
--- a/test/CodeGenObjCXX/objc-container-subscripting-1.mm
+++ b/test/CodeGenObjCXX/objc-container-subscripting-1.mm
@@ -34,7 +34,7 @@ template <class T> void test2(NSMutableArray *a) {
a[10] = 0;
}
template void test2<int>(NSMutableArray*);
-// CHECK: define weak_odr void @_Z5test2IiEvP14NSMutableArray
+// CHECK-LABEL: define weak_odr void @_Z5test2IiEvP14NSMutableArray
// CHECK: @objc_msgSend
// CHECK: ret void
@@ -44,7 +44,7 @@ template <class T> void test3(NSMutableArray *a) {
}
template void test3<int>(NSMutableArray*);
-// CHECK: define weak_odr void @_Z5test3IiEvP14NSMutableArray
+// CHECK-LABEL: define weak_odr void @_Z5test3IiEvP14NSMutableArray
// CHECK: @objc_msgSend
// CHECK: ret void
diff --git a/test/CodeGenObjCXX/objc-container-subscripting.mm b/test/CodeGenObjCXX/objc-container-subscripting.mm
index dfe48e9d6dc8..d9069023b951 100644
--- a/test/CodeGenObjCXX/objc-container-subscripting.mm
+++ b/test/CodeGenObjCXX/objc-container-subscripting.mm
@@ -33,7 +33,7 @@ template <class T> void test2(NSMutableArray *a) {
a[10] = 0;
}
template void test2<int>(NSMutableArray*);
-// CHECK: define weak_odr void @_Z5test2IiEvP14NSMutableArray
+// CHECK-LABEL: define weak_odr void @_Z5test2IiEvP14NSMutableArray
// CHECK: @objc_msgSend
// CHECK: ret void
@@ -43,11 +43,11 @@ template <class T> void test3(NSMutableArray *a) {
}
template void test3<int>(NSMutableArray*);
-// CHECK: define weak_odr void @_Z5test3IiEvP14NSMutableArray
+// CHECK-LABEL: define weak_odr void @_Z5test3IiEvP14NSMutableArray
// CHECK: @objc_msgSend
// CHECK: ret void
-// CHECK: define void @_Z11static_dataP14NSMutableArray
+// CHECK-LABEL: define void @_Z11static_dataP14NSMutableArray
void static_data(NSMutableArray *array) {
// CHECK: call i32 @__cxa_guard_acquire
// CHECK: {{call i8*.*@objc_msgSend }}
diff --git a/test/CodeGenObjCXX/property-dot-reference.mm b/test/CodeGenObjCXX/property-dot-reference.mm
index e64b397cc026..be6742aef25f 100644
--- a/test/CodeGenObjCXX/property-dot-reference.mm
+++ b/test/CodeGenObjCXX/property-dot-reference.mm
@@ -50,7 +50,7 @@ void test2() {
void(obj.myProperty);
void(obj.myGetter);
}
-// CHECK: define void @_Z5test2v()
+// CHECK-LABEL: define void @_Z5test2v()
// CHECK: call i32 bitcast
// CHECK: call double bitcast
// CHECK: call i32 bitcast
diff --git a/test/CodeGenObjCXX/property-object-reference-2.mm b/test/CodeGenObjCXX/property-object-reference-2.mm
index 25bfdf848d3a..542967c48e65 100644
--- a/test/CodeGenObjCXX/property-object-reference-2.mm
+++ b/test/CodeGenObjCXX/property-object-reference-2.mm
@@ -29,7 +29,7 @@ struct TCPPObject
@synthesize MyProperty1 = _cppObject1;
@end
-// CHECK: define internal void @__copy_helper_atomic_property_(
+// CHECK-LABEL: define internal void @__copy_helper_atomic_property_(
// CHECK: [[TWO:%.*]] = load %struct.TCPPObject** [[ADDR:%.*]], align 8
// CHECK: [[THREE:%.*]] = load %struct.TCPPObject** [[ADDR1:%.*]], align 8
// CHECK: [[CALL:%.*]] = call i32 @_Z7DEFAULTv()
@@ -43,7 +43,7 @@ struct TCPPObject
// CHECK: call void @objc_copyCppObjectAtomic(i8* [[THREE]], i8* [[TWO]], i8* bitcast (void (%struct.TCPPObject*, %struct.TCPPObject*)* @__copy_helper_atomic_property_ to i8*))
// CHECK: ret void
-// CHECK: define internal void @__assign_helper_atomic_property_(
+// CHECK-LABEL: define internal void @__assign_helper_atomic_property_(
// CHECK: [[TWO:%.*]] = load %struct.TCPPObject** [[ADDR:%.*]], align 8
// CHECK: [[THREE:%.*]] = load %struct.TCPPObject** [[ADDR1:%.*]], align 8
// CHECK: [[CALL:%.*]] = call %struct.TCPPObject* @_ZN10TCPPObjectaSERKS_(%struct.TCPPObject* [[TWO]], %struct.TCPPObject* [[THREE]])
diff --git a/test/CodeGenObjCXX/property-objects.mm b/test/CodeGenObjCXX/property-objects.mm
index a3c2ed37466e..88e992c81a4b 100644
--- a/test/CodeGenObjCXX/property-objects.mm
+++ b/test/CodeGenObjCXX/property-objects.mm
@@ -54,7 +54,7 @@ struct CGRect {
@end
-// CHECK: define i32 @main
+// CHECK-LABEL: define i32 @main
// CHECK: call void @_ZN1SC1ERKS_(%class.S* [[AGGTMP:%[a-zA-Z0-9\.]+]], %class.S* {{%[a-zA-Z0-9\.]+}})
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %class.S*)*)(i8* {{%[a-zA-Z0-9\.]+}}, i8* {{%[a-zA-Z0-9\.]+}}, %class.S* [[AGGTMP]])
// CHECK-NEXT: ret i32 0
@@ -66,7 +66,7 @@ int main() {
}
// rdar://8379892
-// CHECK: define void @_Z1fP1A
+// CHECK-LABEL: define void @_Z1fP1A
// CHECK: call void @_ZN1XC1Ev(%struct.X* [[LVTEMP:%[a-zA-Z0-9\.]+]])
// CHECK: call void @_ZN1XC1ERKS_(%struct.X* [[AGGTMP:%[a-zA-Z0-9\.]+]], %struct.X* [[LVTEMP]])
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %struct.X*)*)({{.*}} %struct.X* [[AGGTMP]])
diff --git a/test/CodeGenObjCXX/property-reference.mm b/test/CodeGenObjCXX/property-reference.mm
index 0e4897b74947..a4af90010b3b 100644
--- a/test/CodeGenObjCXX/property-reference.mm
+++ b/test/CodeGenObjCXX/property-reference.mm
@@ -64,7 +64,7 @@ template <class T> void test2(Test2 *a) {
a.prop += x;
}
template void test2<int>(Test2*);
-// CHECK: define weak_odr void @_Z5test2IiEvP5Test2(
+// CHECK-LABEL: define weak_odr void @_Z5test2IiEvP5Test2(
// CHECK: [[X:%.*]] = alloca i32,
// CHECK: @objc_msgSend
// CHECK: store i32 {{%.*}}, i32* [[X]],
@@ -83,7 +83,7 @@ template <class T> void test3(Test2 *a) {
a.prop += (sizeof(T), x);
}
template void test3<int>(Test2*);
-// CHECK: define weak_odr void @_Z5test3IiEvP5Test2(
+// CHECK-LABEL: define weak_odr void @_Z5test3IiEvP5Test2(
// CHECK: [[X:%.*]] = alloca i32,
// CHECK: @objc_msgSend
// CHECK: store i32 {{%.*}}, i32* [[X]],
diff --git a/test/CodeGenObjCXX/references.mm b/test/CodeGenObjCXX/references.mm
index 6265c7be7613..39abd8a305f6 100644
--- a/test/CodeGenObjCXX/references.mm
+++ b/test/CodeGenObjCXX/references.mm
@@ -17,7 +17,7 @@ struct A { ~A(); };
@end
-// CHECK: define void @_Z1fP1B
+// CHECK-LABEL: define void @_Z1fP1B
// CHECK: objc_msgSend to
// CHECK-NOT: call void @_ZN1AD1Ev
// CHECK: ret void
diff --git a/test/CodeGenObjCXX/rtti.mm b/test/CodeGenObjCXX/rtti.mm
index 72de3ac98016..e458f090a768 100644
--- a/test/CodeGenObjCXX/rtti.mm
+++ b/test/CodeGenObjCXX/rtti.mm
@@ -38,14 +38,14 @@ int main() {
const std::type_info &t5 = typeid(c);
const std::type_info &t6 = typeid(*c);
- // CHECK: store {{.*}} @_ZTIP11objc_object
- // CHECK: store {{.*}} @_ZTI11objc_object
+ // CHECK: store {{.*}} @_ZTIPU11objcproto1P11objc_object
+ // CHECK: store {{.*}} @_ZTIU11objcproto1P11objc_object
id<P> i2 = 0;
const std::type_info &t7 = typeid(i2);
const std::type_info &t8 = typeid(*i2);
- // CHECK: store {{.*}} @_ZTIP10objc_class
- // CHECK: store {{.*}} @_ZTI10objc_class
+ // CHECK: store {{.*}} @_ZTIPU11objcproto1P10objc_class
+ // CHECK: store {{.*}} @_ZTIU11objcproto1P10objc_class
Class<P> c2 = 0;
const std::type_info &t9 = typeid(c2);
const std::type_info &t10 = typeid(*c2);
diff --git a/test/CodeGenObjCXX/unknown-anytype.mm b/test/CodeGenObjCXX/unknown-anytype.mm
index 0e146d42c9ee..4731fcc76dfe 100644
--- a/test/CodeGenObjCXX/unknown-anytype.mm
+++ b/test/CodeGenObjCXX/unknown-anytype.mm
@@ -6,7 +6,7 @@
void test0(A *a) {
(void) [a test0: (float) 2.0];
}
-// CHECK: define void @_Z5test0P1A(
+// CHECK-LABEL: define void @_Z5test0P1A(
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, float)*)(
@interface B
@@ -15,6 +15,6 @@ void test0(A *a) {
void test1(B *b) {
(void) [b test1: (float) 2.0];
}
-// CHECK: define void @_Z5test1P1B(
+// CHECK-LABEL: define void @_Z5test1P1B(
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, float)*)(
diff --git a/test/CodeGenOpenCL/address-spaces-mangling.cl b/test/CodeGenOpenCL/address-spaces-mangling.cl
new file mode 100644
index 000000000000..3c7a5183636c
--- /dev/null
+++ b/test/CodeGenOpenCL/address-spaces-mangling.cl
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s
+// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s
+
+// We can't name this f as private is equivalent to default
+// no specifier given address space so we get multiple definition
+// warnings, but we do want it for comparison purposes.
+__attribute__((overloadable))
+void ff(int *arg) { }
+// ASMANG: @_Z2ffPi
+// NOASMANG: @_Z2ffPi
+
+__attribute__((overloadable))
+void f(private int *arg) { }
+// ASMANG: @_Z1fPi
+// NOASMANG: @_Z1fPi
+
+__attribute__((overloadable))
+void f(global int *arg) { }
+// ASMANG: @_Z1fPU3AS1i
+// NOASMANG: @_Z1fPU8CLglobali
+
+__attribute__((overloadable))
+void f(local int *arg) { }
+// ASMANG: @_Z1fPU3AS2i
+// NOASMANG: @_Z1fPU7CLlocali
+
+__attribute__((overloadable))
+void f(constant int *arg) { }
+// ASMANG: @_Z1fPU3AS3i
+// NOASMANG: @_Z1fPU10CLconstanti
diff --git a/test/CodeGenOpenCL/kernel-attributes.cl b/test/CodeGenOpenCL/kernel-attributes.cl
index 1166f9384fa4..0825ffc0336f 100644
--- a/test/CodeGenOpenCL/kernel-attributes.cl
+++ b/test/CodeGenOpenCL/kernel-attributes.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -O0 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
typedef unsigned int uint4 __attribute__((ext_vector_type(4)));
diff --git a/test/CodeGenOpenCL/local.cl b/test/CodeGenOpenCL/local.cl
index b4bd0085dfad..b5c67d9af9c7 100644
--- a/test/CodeGenOpenCL/local.cl
+++ b/test/CodeGenOpenCL/local.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -ffake-address-space-map -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -emit-llvm -o - | FileCheck %s
__kernel void foo(void) {
// CHECK: @foo.i = internal addrspace(2)
@@ -6,7 +6,7 @@ __kernel void foo(void) {
++i;
}
-// CHECK: define void @_Z3barPU3AS2i
+// CHECK-LABEL: define void @_Z3barPU7CLlocali
__kernel void __attribute__((__overloadable__)) bar(local int *x) {
*x = 5;
}
diff --git a/test/CodeGenOpenCL/opencl_types.cl b/test/CodeGenOpenCL/opencl_types.cl
index b1e558db9b9c..7e99fc548ec5 100644
--- a/test/CodeGenOpenCL/opencl_types.cl
+++ b/test/CodeGenOpenCL/opencl_types.cl
@@ -22,7 +22,7 @@ void fnc3(image3d_t img) {}
// CHECK: @fnc3(%opencl.image3d_t*
void fnc4smp(sampler_t s) {}
-// CHECK: define void @fnc4smp(i32
+// CHECK-LABEL: define void @fnc4smp(i32
kernel void foo(image1d_t img) {
sampler_t smp = 5;
diff --git a/test/CodeGenOpenCL/ptx-calls.cl b/test/CodeGenOpenCL/ptx-calls.cl
index d9904513e518..00f2a0e4c042 100644
--- a/test/CodeGenOpenCL/ptx-calls.cl
+++ b/test/CodeGenOpenCL/ptx-calls.cl
@@ -2,12 +2,12 @@
void device_function() {
}
-// CHECK: define void @device_function()
+// CHECK-LABEL: define void @device_function()
__kernel void kernel_function() {
device_function();
}
-// CHECK: define void @kernel_function()
+// CHECK-LABEL: define void @kernel_function()
// CHECK: call void @device_function()
// CHECK: !{{[0-9]+}} = metadata !{void ()* @kernel_function, metadata !"kernel", i32 1}
diff --git a/test/CodeGenOpenCL/ptx-kernels.cl b/test/CodeGenOpenCL/ptx-kernels.cl
index 07648e401507..49d207f023c8 100644
--- a/test/CodeGenOpenCL/ptx-kernels.cl
+++ b/test/CodeGenOpenCL/ptx-kernels.cl
@@ -2,10 +2,10 @@
void device_function() {
}
-// CHECK: define void @device_function()
+// CHECK-LABEL: define void @device_function()
__kernel void kernel_function() {
}
-// CHECK: define void @kernel_function()
+// CHECK-LABEL: define void @kernel_function()
// CHECK: !{{[0-9]+}} = metadata !{void ()* @kernel_function, metadata !"kernel", i32 1}
diff --git a/test/CodeGenOpenCL/str_literals.cl b/test/CodeGenOpenCL/str_literals.cl
new file mode 100644
index 000000000000..78a93056b98d
--- /dev/null
+++ b/test/CodeGenOpenCL/str_literals.cl
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - -ffake-address-space-map | FileCheck %s
+
+__constant char * __constant x = "hello world";
+__constant char * __constant y = "hello world";
+
+// CHECK: addrspace(3) unnamed_addr constant
+// CHECK-NOT: addrspace(3) unnamed_addr constant
+// CHECK: @x = addrspace(3) global i8 addrspace(3)*
+// CHECK: @y = addrspace(3) global i8 addrspace(3)*
diff --git a/test/CodeGenOpenCL/vector_odd.cl b/test/CodeGenOpenCL/vector_odd.cl
new file mode 100644
index 000000000000..c44328bfaa71
--- /dev/null
+++ b/test/CodeGenOpenCL/vector_odd.cl
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 %s -O0 -emit-llvm -o - | FileCheck %s
+
+typedef unsigned char __attribute__((ext_vector_type(3))) uchar3;
+
+//CHECK: {{%.*}} = shufflevector <3 x i8> {{%.*}}, <3 x i8> <i8 1, i8 1, i8 undef>, <3 x i32> <i32 0, i32 3, i32 2>
+
+kernel void test_odd_vector1 (uchar3 lhs)
+{
+ lhs.odd = 1;
+}
+
+//CHECK: {{%.*}} = shufflevector <3 x i8> {{%.*}}, <3 x i8> <i8 2, i8 2, i8 undef>, <3 x i32> <i32 0, i32 1, i32 3>
+
+kernel void test_odd_vector2 (uchar3 lhs)
+{
+ lhs.hi = 2;
+}
diff --git a/test/Coverage/codegen-next.m b/test/Coverage/codegen-next.m
index 8f6645df515a..7b907fea0e1e 100644
--- a/test/Coverage/codegen-next.m
+++ b/test/Coverage/codegen-next.m
@@ -1,4 +1,12 @@
-// RUN: %clang_cc1 -emit-llvm -fobjc-exceptions -o %t %s
-// RUN: %clang_cc1 -g -emit-llvm -fobjc-exceptions -o %t %s
+// RUN: %clang_cc1 -emit-llvm -fobjc-exceptions -triple x86_64-apple-darwin -o %t %s
+// RUN: %clang_cc1 -g -emit-llvm -fobjc-exceptions -triple x86_64-apple-darwin -o %t %s
+
+// An error could be seen for targeting x86_64-win32;
+//
+// Bitcast requires types of same width
+// %7 = bitcast i32 %6 to i64
+//
+// Then, This test should be excluded on x86_64-win32.
+// REQUIRES: LP64
#include "objc-language-features.inc"
diff --git a/test/Coverage/html-diagnostics.c b/test/Coverage/html-diagnostics.c
index 4f1b0e3763b8..410ee2acd5fd 100644
--- a/test/Coverage/html-diagnostics.c
+++ b/test/Coverage/html-diagnostics.c
@@ -2,6 +2,9 @@
// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t %s
// RUN: cat %t/*.html | FileCheck %s
+// Because of the glob (*.html)
+// REQUIRES: shell
+
// CHECK: <h3>Annotated Source Code</h3>
// Without tweaking expr, the expr would hit to the line below
diff --git a/test/Driver/B-opt.c b/test/Driver/B-opt.c
index a0b9a11162dd..6759353174d0 100644
--- a/test/Driver/B-opt.c
+++ b/test/Driver/B-opt.c
@@ -3,20 +3,20 @@
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir1 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-TRIPLE %s
-// CHECK-B-OPT-TRIPLE: "{{.*}}/Inputs/B_opt_tree/dir1/i386-unknown-linux-ld"
+// CHECK-B-OPT-TRIPLE: "{{.*}}/Inputs/B_opt_tree/dir1{{/|\\}}i386-unknown-linux-ld"
//
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-DIR %s
-// CHECK-B-OPT-DIR: "{{.*}}/Inputs/B_opt_tree/dir2/ld"
+// CHECK-B-OPT-DIR: "{{.*}}/Inputs/B_opt_tree/dir2{{/|\\}}ld"
//
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir3/prefix- 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-PREFIX %s
-// CHECK-B-OPT-PREFIX: "{{.*}}/Inputs/B_opt_tree/dir3/prefix-ld"
+// CHECK-B-OPT-PREFIX: "{{.*}}/Inputs/B_opt_tree/dir3{{/|\\}}prefix-ld"
//
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir3/prefix- \
// RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-MULT %s
-// CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3/prefix-ld"
+// CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3{{/|\\}}prefix-ld"
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-as b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-as
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-as
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld
new file mode 120000
index 000000000000..7e0a9cfe2ddb
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld
@@ -0,0 +1 @@
+i386-unknown-linux-gnu-ld.gold \ No newline at end of file
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld.bfd b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld.bfd
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld.bfd
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld.gold b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld.gold
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld.gold
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-as b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-as
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-as
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld
new file mode 120000
index 000000000000..ce36ac093b61
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld
@@ -0,0 +1 @@
+x86_64-unknown-linux-gnu-ld.gold \ No newline at end of file
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld.bfd b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld.bfd
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld.bfd
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld.gold b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld.gold
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld.gold
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/as b/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/as
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/as
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld b/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld
new file mode 120000
index 000000000000..6cd03701cdda
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld
@@ -0,0 +1 @@
+ld.gold \ No newline at end of file
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld.bfd b/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld.bfd
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld.bfd
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld.gold b/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld.gold
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld.gold
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/lib/.keep b/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/lib/.keep
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/crtbegin.o b/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/crtbegin.o
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbegin.o b/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbegin.o
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbeginT.o b/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbeginT.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbeginT.o
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtfastmath.o b/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtfastmath.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtfastmath.o
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/as b/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/as
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/as
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld b/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld
new file mode 120000
index 000000000000..6cd03701cdda
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld
@@ -0,0 +1 @@
+ld.gold \ No newline at end of file
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.bfd b/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.bfd
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.bfd
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.gold b/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.gold
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.gold
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/lib/.keep b/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/lib/.keep
diff --git a/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crt0.o b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crt0.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crt0.o
diff --git a/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtbegin.o b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtbegin.o
diff --git a/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtbeginS.o b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtbeginS.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtbeginS.o
diff --git a/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtend.o b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtend.o
diff --git a/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtendS.o b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtendS.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtendS.o
diff --git a/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crti.o b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crti.o
diff --git a/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtn.o b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/basic_netbsd_tree/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/libtest.so b/test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/libtest.so
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/libtest.so
diff --git a/test/Driver/Inputs/file.prof b/test/Driver/Inputs/file.prof
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/file.prof
diff --git a/test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtbegin.o b/test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtbegin.o
diff --git a/test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/.keep b/test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/.keep
diff --git a/test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/x86_64-pc-linux-gnu/lib/.keep b/test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/x86_64-pc-linux-gnu/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/gentoo_linux_gcc_4.6.2_tree/usr/x86_64-pc-linux-gnu/lib/.keep
diff --git a/test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/crtbegin.o b/test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/crtbegin.o
diff --git a/test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6/.keep b/test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6/.keep
diff --git a/test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/x86_64-pc-linux-gnu/lib/.keep b/test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/x86_64-pc-linux-gnu/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/gentoo_linux_gcc_4.6.4_tree/usr/x86_64-pc-linux-gnu/lib/.keep
diff --git a/test/Driver/Inputs/lit.local.cfg b/test/Driver/Inputs/lit.local.cfg
deleted file mode 100644
index e6f55eef7af5..000000000000
--- a/test/Driver/Inputs/lit.local.cfg
+++ /dev/null
@@ -1 +0,0 @@
-config.suffixes = []
diff --git a/test/Driver/Inputs/mips_fsf_tree/bin/.keep b/test/Driver/Inputs/mips_fsf_tree/bin/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/bin/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/el/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/include-fixed/.keep b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/include-fixed/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/include-fixed/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/include/.keep b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/include/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/include/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/el/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/micromips/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/el/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips16/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/el/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/el/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/mips16/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips32/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/el/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/64/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/el/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/el/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/64/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/el/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/fp64/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/mips64r2/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/nan2008/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/nan2008/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/nan2008/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/nan2008/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/nan2008/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/nan2008/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/sof/crtbegin.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/sof/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/sof/crtbegin.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/sof/crtend.o b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/sof/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/lib/gcc/mips-mti-linux-gnu/4.9.0/sof/crtend.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/backward/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/backward/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/backward/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/fp64/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/fp64/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/fp64/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/nan2008/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/nan2008/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/nan2008/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/sof/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/sof/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/sof/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/el/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/el/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/micromips/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/el/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips16/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/el/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/el/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/mips16/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips32/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/el/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/64/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/el/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/el/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/64/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/el/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/fp64/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/fp64/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/fp64/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/mips64r2/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/nan2008/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/nan2008/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/nan2008/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/sof/.keep b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/sof/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/mips-mti-linux-gnu/lib/sof/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/inclide/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/inclide/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/inclide/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/inclide/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/inclide/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/inclide/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/inclide/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/inclide/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/inclide/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/micromips/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips16/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/mips16/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips32/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/el/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/fp64/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/mips64r2/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/nan2008/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/sof/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/include/bits/.keep b/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/include/bits/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/include/bits/.keep
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crt1.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crt1.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crti.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crti.o
diff --git a/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crtn.o b/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/mips_fsf_tree/sysroot/usr/lib/crtn.o
diff --git a/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/as b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/as
new file mode 120000
index 000000000000..0065315cfd1d
--- /dev/null
+++ b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/as
@@ -0,0 +1 @@
+i386-unknown-linux-gnu-as \ No newline at end of file
diff --git a/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/i386-unknown-linux-gnu-as b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/i386-unknown-linux-gnu-as
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/i386-unknown-linux-gnu-as
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/i386-unknown-linux-gnu-ld b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/i386-unknown-linux-gnu-ld
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/i386-unknown-linux-gnu-ld
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/ld b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/ld
new file mode 120000
index 000000000000..9e5574285c70
--- /dev/null
+++ b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/ld
@@ -0,0 +1 @@
+i386-unknown-linux-gnu-ld \ No newline at end of file
diff --git a/test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/as b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/as
new file mode 120000
index 000000000000..2aa12fdef916
--- /dev/null
+++ b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/as
@@ -0,0 +1 @@
+../../bin/i386-unknown-linux-gnu-as \ No newline at end of file
diff --git a/test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/ld b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/ld
new file mode 120000
index 000000000000..5aeaff619662
--- /dev/null
+++ b/test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/ld
@@ -0,0 +1 @@
+../../bin/i386-unknown-linux-gnu-ld \ No newline at end of file
diff --git a/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/as b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/as
new file mode 120000
index 000000000000..477cbc9635fc
--- /dev/null
+++ b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/as
@@ -0,0 +1 @@
+x86_64-unknown-linux-gnu-as \ No newline at end of file
diff --git a/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/ld b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/ld
new file mode 120000
index 000000000000..5343caf34d8f
--- /dev/null
+++ b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/ld
@@ -0,0 +1 @@
+x86_64-unknown-linux-gnu-ld \ No newline at end of file
diff --git a/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/x86_64-unknown-linux-gnu-as b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/x86_64-unknown-linux-gnu-as
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/x86_64-unknown-linux-gnu-as
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld
new file mode 100755
index 000000000000..b23e55619b2f
--- /dev/null
+++ b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/as b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/as
new file mode 120000
index 000000000000..84a9113f2671
--- /dev/null
+++ b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/as
@@ -0,0 +1 @@
+../../bin/x86_64-unknown-linux-gnu-as \ No newline at end of file
diff --git a/test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/ld b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/ld
new file mode 120000
index 000000000000..c417e3afaa49
--- /dev/null
+++ b/test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/ld
@@ -0,0 +1 @@
+../../bin/x86_64-unknown-linux-gnu-ld \ No newline at end of file
diff --git a/test/Driver/Inputs/ubuntu_13.04_multiarch_tree/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/crtbegin.o b/test/Driver/Inputs/ubuntu_13.04_multiarch_tree/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/crtbegin.o
new file mode 100644
index 000000000000..c6cac69265af
--- /dev/null
+++ b/test/Driver/Inputs/ubuntu_13.04_multiarch_tree/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/crtbegin.o
@@ -0,0 +1 @@
+empty
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/lib/.keep b/test/Driver/Inputs/x86-64_ubuntu_13.10/lib/.keep
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/lib/.keep
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crt1.o b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crt1.o
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crti.o b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crti.o
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crtn.o b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabi/lib/crtn.o
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crt1.o b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crt1.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crt1.o
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crti.o b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crti.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crti.o
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crtn.o b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crtn.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/arm-linux-gnueabihf/lib/crtn.o
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/crtbegin.o b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/crtbegin.o
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/crtend.o b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/crtend.o
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/crtbegin.o b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/crtbegin.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/crtbegin.o
diff --git a/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/crtend.o b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/crtend.o
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Driver/Inputs/x86-64_ubuntu_13.10/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/crtend.o
diff --git a/test/Driver/O.c b/test/Driver/O.c
new file mode 100644
index 000000000000..a7dedc860cfc
--- /dev/null
+++ b/test/Driver/O.c
@@ -0,0 +1,10 @@
+// Test that we parse and translate the -O option correctly.
+
+// RUN: %clang -O -### %s 2>&1 | FileCheck -check-prefix=CHECK-O %s
+// CHECK-O: -O2
+
+// RUN: %clang -O0 -### %s 2>&1 | FileCheck -check-prefix=CHECK-O0 %s
+// CHECK-O0: -O0
+
+// RUN: %clang -O1 -### %s 2>&1 | FileCheck -check-prefix=CHECK-O1 %s
+// CHECK-O1: -O1
diff --git a/test/Driver/Wp-args.c b/test/Driver/Wp-args.c
index 1d1af24804a1..e01e2a2651f0 100644
--- a/test/Driver/Wp-args.c
+++ b/test/Driver/Wp-args.c
@@ -1,7 +1,7 @@
// Check that we extract -MD from '-Wp,-MD,FOO', which is used by a number of
// major projects (e.g., FireFox and the Linux Kernel).
-// RUN: %clang --target i386-pc-linux-gnu -### \
+// RUN: %clang -target i386-pc-linux-gnu -### \
// RUN: -Wp,-MD,FOO.d -fsyntax-only %s 2> %t
// RUN: FileCheck < %t %s
//
@@ -12,7 +12,7 @@
//
// PR4062
-// RUN: %clang --target i386-pc-linux-gnu -### \
+// RUN: %clang -target i386-pc-linux-gnu -### \
// RUN: -Wp,-MMD -fsyntax-only %s 2> %t
// RUN: FileCheck -check-prefix MMD < %t %s
diff --git a/test/Driver/Xarch.c b/test/Driver/Xarch.c
index 2523f5acac01..34f9340dd68f 100644
--- a/test/Driver/Xarch.c
+++ b/test/Driver/Xarch.c
@@ -1,7 +1,7 @@
// RUN: %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -O2 %s -S -### 2> %t.log
// RUN: grep ' "-O2" ' %t.log | count 1
// RUN: %clang -target i386-apple-darwin9 -m64 -Xarch_i386 -O2 %s -S -### 2> %t.log
-// RUN: grep ' "-O2" ' %t.log | count 0
+// RUN: not grep ' "-O2" ' %t.log
// RUN: grep "argument unused during compilation: '-Xarch_i386 -O2'" %t.log
// RUN: not %clang -target 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
diff --git a/test/Driver/Xlinker-args.c b/test/Driver/Xlinker-args.c
index d89d5bad1aaf..4285af7944b5 100644
--- a/test/Driver/Xlinker-args.c
+++ b/test/Driver/Xlinker-args.c
@@ -14,3 +14,11 @@
// DARWIN-NOT: --no-demangle
// DARWIN: "one" "two" "three" "four"
// LINUX: "--no-demangle" "one" "two" "three" "four"
+
+// Check that we forward '-Xlinker' and '-Wl,' on Windows.
+// RUN: %clang -target i686-pc-win32 -### \
+// RUN: -Xlinker one -Wl,two %s 2>&1 | \
+// RUN: FileCheck -check-prefix=WIN %s
+// WIN: link.exe
+// WIN: "one"
+// WIN: "two"
diff --git a/test/Driver/aarch64-cpus.c b/test/Driver/aarch64-cpus.c
new file mode 100644
index 000000000000..799ce1042a0e
--- /dev/null
+++ b/test/Driver/aarch64-cpus.c
@@ -0,0 +1,10 @@
+// Check target CPUs are correctly passed.
+
+// RUN: %clang -target aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s
+// GENERIC: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic"
+
+// RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s
+// CA53: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a53"
+
+// RUN: %clang -target aarch64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57 %s
+// CA57: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a57"
diff --git a/test/Driver/aarch64-mfpu.c b/test/Driver/aarch64-mfpu.c
new file mode 100644
index 000000000000..234401bcb211
--- /dev/null
+++ b/test/Driver/aarch64-mfpu.c
@@ -0,0 +1,26 @@
+// Test that different values of -mfpu pick correct AArch64 FPU target-feature(s).
+
+// RUN: %clang -target aarch64-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NEON %s
+// CHECK-NEON: "-target-feature" "+neon"
+
+// RUN: %clang -target aarch64-linux-eabi -mfpu=fp-armv8 %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FP-ARMV8 %s
+// CHECK-FP-ARMV8: "-target-feature" "+fp-armv8"
+
+// RUN: %clang -target aarch64-linux-eabi -mfpu=neon-fp-armv8 %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NEON-FP-ARMV8 %s
+// CHECK-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
+// CHECK-NEON-FP-ARMV8: "-target-feature" "+neon"
+
+// RUN: %clang -target aarch64-linux-eabi -mfpu=crypto-neon-fp-armv8 %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CRYPTO-NEON-FP-ARMV8 %s
+// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
+// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+neon"
+// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+crypto"
+
+// RUN: %clang -target aarch64-linux-eabi -mfpu=none %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-FP %s
+// CHECK-NO-FP: "-target-feature" "-fp-armv8"
+// CHECK-NO-FP: "-target-feature" "-crypto"
+// CHECK-NO-FP: "-target-feature" "-neon"
diff --git a/test/Driver/altivec-asm.S b/test/Driver/altivec-asm.S
new file mode 100644
index 000000000000..4143d520f4a8
--- /dev/null
+++ b/test/Driver/altivec-asm.S
@@ -0,0 +1,3 @@
+// RUN: %clang -target powerpc64-linux-gnu -maltivec -S %s -o - | FileCheck %s
+// Verify that assembling an empty file does not auto-include altivec.h.
+// CHECK-NOT: static vector
diff --git a/test/Driver/arc.c b/test/Driver/arc.c
index 4c99e5773acc..97d00baf4cc9 100644
--- a/test/Driver/arc.c
+++ b/test/Driver/arc.c
@@ -1,9 +1,9 @@
-// RUN: %clang -ObjC -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
-// RUN: %clang -x objective-c -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
-// RUN: %clang -x objective-c++ -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
-// RUN: %clang -x c -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
-// RUN: %clang -x c++ -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
-// RUN: %clang -x objective-c -target x86_64-apple-darwin11 -mmacosx-version-min=10.5 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix UNSUPPORTED %s
+// RUN: not %clang -ObjC -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang -x objective-c -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang -x objective-c++ -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang -x c -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
+// RUN: not %clang -x c++ -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
+// RUN: not %clang -x objective-c -target x86_64-apple-darwin11 -mmacosx-version-min=10.5 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix UNSUPPORTED %s
// Just to test clang is working.
# foo
diff --git a/test/Driver/arch.c b/test/Driver/arch.c
index df9a3e10e02e..f113c1dfa5c2 100644
--- a/test/Driver/arch.c
+++ b/test/Driver/arch.c
@@ -1,3 +1,5 @@
-// RUN: %clang -target armv7a-unknown-linux-gnueabi -S -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang -target armv7a-unknown-linux-gnueabi -S -emit-llvm %s -o - | FileCheck %s --check-prefix=V7
+// RUN: %clang -target armv8a-unknown-linux-gnueabi -S -emit-llvm %s -o - | FileCheck %s --check-prefix=V8
-// CHECK: target triple = "armv7-unknown-linux-gnueabi"
+// V7: target triple = "armv7-unknown-linux-gnueabi"
+// V8: target triple = "armv8-unknown-linux-gnueabi"
diff --git a/test/Driver/arm-alignment.c b/test/Driver/arm-alignment.c
new file mode 100644
index 000000000000..e3ab276212a3
--- /dev/null
+++ b/test/Driver/arm-alignment.c
@@ -0,0 +1,25 @@
+// RUN: %clang -target arm-none-gnueabi -munaligned-access -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-UNALIGNED < %t %s
+
+// RUN: %clang -target arm-none-gnueabi -mstrict-align -munaligned-access -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-UNALIGNED < %t %s
+
+// RUN: %clang -target arm-none-gnueabi -mno-unaligned-access -munaligned-access -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-UNALIGNED < %t %s
+
+// CHECK-UNALIGNED: "-backend-option" "-arm-no-strict-align"
+
+
+// RUN: %clang -target arm-none-gnueabi -mno-unaligned-access -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-ALIGNED < %t %s
+
+// RUN: %clang -target arm-none-gnueabi -mstrict-align -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-ALIGNED < %t %s
+
+// RUN: %clang -target arm-none-gnueabi -munaligned-access -mno-unaligned-access -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-ALIGNED < %t %s
+
+// RUN: %clang -target arm-none-gnueabi -munaligned-access -mstrict-align -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-ALIGNED < %t %s
+
+// CHECK-ALIGNED: "-backend-option" "-arm-strict-align"
diff --git a/test/Driver/arm-cortex-cpus.c b/test/Driver/arm-cortex-cpus.c
index 6fa649aa392a..bd833cbdd009 100644
--- a/test/Driver/arm-cortex-cpus.c
+++ b/test/Driver/arm-cortex-cpus.c
@@ -1,3 +1,4 @@
+// ================== Check default Cortex CPU on each major architecture
// RUN: %clang -target armv6m-apple-darwin -arch armv6m -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V6M %s
// CHECK-V6M: "-cc1"{{.*}} "-triple" "thumbv6m-{{.*}} "-target-cpu" "cortex-m0"
@@ -6,3 +7,39 @@
// RUN: %clang -target armv7em-apple-darwin -arch armv7em -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V7EM %s
// CHECK-V7EM: "-cc1"{{.*}} "-triple" "thumbv7em-{{.*}} "-target-cpu" "cortex-m4"
+
+// RUN: %clang -target armv7a-linux-gnueabi -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V7A %s
+// CHECK-V7A: "-cc1"{{.*}} "-triple" "armv7-{{.*}} "-target-cpu" "cortex-a8"
+
+// RUN: %clang -target armv7r-linux-gnueabi -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V7R %s
+// CHECK-V7R: "-cc1"{{.*}} "-triple" "armv7r-{{.*}} "-target-cpu" "cortex-r4"
+
+// RUN: %clang -target armv8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V8A %s
+// RUN: %clang -target armv8a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V8A %s
+// CHECK-V8A: "-cc1"{{.*}} "-triple" "armv8-{{.*}}" "-target-cpu" "cortex-a53"
+
+// ================== Check default Architecture on each Cortex CPU
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a5 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a7 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a9 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a12 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-a15 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7A %s
+// CHECK-CPUV7A: "-cc1"{{.*}} "-triple" "armv7-{{.*}}
+
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m0 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV6M %s
+// CHECK-CPUV6M: "-cc1"{{.*}} "-triple" "thumbv6m-{{.*}}
+
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7M %s
+// CHECK-CPUV7M: "-cc1"{{.*}} "-triple" "armv7m-{{.*}}
+
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7EM %s
+// CHECK-CPUV7EM: "-cc1"{{.*}} "-triple" "armv7em-{{.*}}
+
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-r4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7R %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-r5 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV7R %s
+// CHECK-CPUV7R: "-cc1"{{.*}} "-triple" "armv7r-{{.*}}
+
+// RUN: %clang -target arm -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s
+// RUN: %clang -target arm -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s
+// CHECK-CPUV8A: "-cc1"{{.*}} "-triple" "armv8-{{.*}}
diff --git a/test/Driver/arm-fixed-r9.c b/test/Driver/arm-fixed-r9.c
new file mode 100644
index 000000000000..0a95d8779780
--- /dev/null
+++ b/test/Driver/arm-fixed-r9.c
@@ -0,0 +1,4 @@
+// RUN: %clang -target arm-none-gnueeabi -ffixed-r9 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-R9 < %t %s
+
+// CHECK-FIXED-R9: "-backend-option" "-arm-reserve-r9"
diff --git a/test/Driver/arm-hwdiv.c b/test/Driver/arm-hwdiv.c
new file mode 100644
index 000000000000..b3617ce53452
--- /dev/null
+++ b/test/Driver/arm-hwdiv.c
@@ -0,0 +1,39 @@
+// Test that different values of -mhwdiv pick correct ARM hwdiv target-feature(s).
+
+// RUN: %clang -### -target arm %s -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
+// CHECK-DEFAULT-NOT: "-target-feature" "+hwdiv"
+// CHECK-DEFAULT-NOT: "-target-feature" "+hwdiv-arm"
+
+// RUN: %clang -### -target arm %s -mhwdiv=arm -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ARM %s
+// CHECK-ARM: "-target-feature" "+hwdiv-arm"
+// CHECK-ARM: "-target-feature" "-hwdiv"
+
+// RUN: %clang -### -target arm %s -mhwdiv=thumb -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-THUMB %s
+// CHECK-THUMB: "-target-feature" "-hwdiv-arm"
+// CHECK-THUMB: "-target-feature" "+hwdiv"
+
+// RUN: %clang -### -target arm %s -mhwdiv=arm,thumb -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ARM-THUMB %s
+// CHECK-ARM-THUMB: "-target-feature" "+hwdiv-arm"
+// CHECK-ARM-THUMB: "-target-feature" "+hwdiv"
+
+// RUN: %clang -### -target arm %s -mhwdiv=thumb,arm -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-THUMB-ARM %s
+// CHECK-THUMB-ARM: "-target-feature" "+hwdiv-arm"
+// CHECK-THUMB-ARM: "-target-feature" "+hwdiv"
+
+// RUN: %clang -### -target arm %s -mhwdiv=none -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NONE %s
+// CHECK-NONE: "-target-feature" "-hwdiv-arm"
+// CHECK-NONE: "-target-feature" "-hwdiv"
+
+// Also check the alternative syntax.
+
+// RUN: %clang -### -target arm %s --mhwdiv arm -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ALT %s
+// CHECK-ALT: "-target-feature" "+hwdiv-arm"
+// CHECK-ALT: "-target-feature" "-hwdiv"
+
diff --git a/test/Driver/arm-mfpmath.c b/test/Driver/arm-mfpmath.c
deleted file mode 100644
index 0421046c5bc8..000000000000
--- a/test/Driver/arm-mfpmath.c
+++ /dev/null
@@ -1,29 +0,0 @@
-// Test different values of -mfpmath.
-
-// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp %s -### -c -o %t.o 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-VFP %s
-// CHECK-VFP: "-target-feature" "-neonfp"
-
-// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp2 %s -### -c -o %t.o 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-VFP2 %s
-// CHECK-VFP2: "-target-feature" "-neonfp"
-
-// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp3 %s -### -c -o %t.o 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
-// CHECK-VFP3: "-target-feature" "-neonfp"
-
-// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp4 %s -### -c -o %t.o 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-VFP4 %s
-// CHECK-VFP4: "-target-feature" "-neonfp"
-
-// RUN: %clang -target arm-apple-darwin10 -mfpmath=neon %s -### -c -o %t.o 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-NEON %s
-// CHECK-NEON: "-target-feature" "+neonfp"
-
-// RUN: %clang -target arm-apple-darwin10 -mfpmath=foo %s -### -c -o %t.o 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-ERROR %s
-// CHECK-ERROR: clang compiler does not support '-mfpmath=foo'
-
-// RUN: %clang -target arm-apple-darwin10 -mcpu=arm1136j-s -mfpmath=neon %s -### -c -o %t.o 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-MCPU-ERROR %s
-// CHECK-MCPU-ERROR: error: invalid feature '-mfpmath=neon' for CPU 'arm1136j-s'
diff --git a/test/Driver/arm-mfpu.c b/test/Driver/arm-mfpu.c
index f51c41ed3f8a..765b2982156a 100644
--- a/test/Driver/arm-mfpu.c
+++ b/test/Driver/arm-mfpu.c
@@ -46,3 +46,41 @@
// RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
// CHECK-SOFT-FLOAT: "-target-feature" "-neon"
+
+// RUN: %clang -target armv8 -mfpu=fp-armv8 %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ARMV8-SOFT-FLOAT %s
+// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "+fp-armv8"
+// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-crypto"
+// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-neon"
+
+// RUN: %clang -target armv8-linux-gnueabihf -mfpu=fp-armv8 %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FP-ARMV8 %s
+// CHECK-FP-ARMV8-NOT: "-target-feature" "+neon"
+// CHECK-FP-ARMV8: "-target-feature" "+fp-armv8"
+// CHECK-FP-ARMV8: "-target-feature" "-neon"
+// CHECK-FP-ARMV8: "-target-feature" "-crypto"
+
+// RUN: %clang -target armv8-linux-gnueabihf -mfpu=neon-fp-armv8 %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NEON-FP-ARMV8 %s
+// CHECK-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
+// CHECK-NEON-FP-ARMV8: "-target-feature" "+neon"
+// CHECK-NEON-FP-ARMV8: "-target-feature" "-crypto"
+
+// RUN: %clang -target armv8-linux-gnueabihf -mfpu=crypto-neon-fp-armv8 %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CRYPTO-NEON-FP-ARMV8 %s
+// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+fp-armv8"
+// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+neon"
+// CHECK-CRYPTO-NEON-FP-ARMV8: "-target-feature" "+crypto"
+
+// RUN: %clang -target armv8-linux-gnueabi -mfpu=none %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-FP %s
+// CHECK-NO-FP: "-target-feature" "-vfp2"
+// CHECK-NO-FP: "-target-feature" "-vfp3"
+// CHECK-NO-FP: "-target-feature" "-vfp4"
+// CHECK-NO-FP: "-target-feature" "-fp-armv8"
+// CHECK-NO-FP: "-target-feature" "-crypto"
+// CHECK-NO-FP: "-target-feature" "-neon"
+
+// RUN: %clang -target arm-linux-gnueabihf %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-HF %s
+// CHECK-HF: "-target-cpu" "arm1136jf-s"
diff --git a/test/Driver/arm-restrict-it.c b/test/Driver/arm-restrict-it.c
new file mode 100644
index 000000000000..c2a776046b68
--- /dev/null
+++ b/test/Driver/arm-restrict-it.c
@@ -0,0 +1,15 @@
+// RUN: %clang -target arm-none-gnueabi -mrestrict-it -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-RESTRICTED < %t %s
+
+// RUN: %clang -target armv8a-none-gnueabi -mrestrict-it -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-RESTRICTED < %t %s
+
+// CHECK-RESTRICTED: "-backend-option" "-arm-restrict-it"
+
+// RUN: %clang -target arm-none-gnueabi -mno-restrict-it -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-NO-RESTRICTED < %t %s
+
+// RUN: %clang -target armv8a-none-gnueabi -mno-restrict-it -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-NO-RESTRICTED < %t %s
+
+// CHECK-NO-RESTRICTED: "-backend-option" "-arm-no-restrict-it"
diff --git a/test/Driver/armv8-crc.c b/test/Driver/armv8-crc.c
new file mode 100644
index 000000000000..bee75355cd79
--- /dev/null
+++ b/test/Driver/armv8-crc.c
@@ -0,0 +1,8 @@
+// RUN: %clang -target armv8 -mcrc -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-V8-CRC < %t %s
+// CHECK-V8-CRC: "-target-feature" "+crc"
+
+// RUN: %clang -target armv8 -mnocrc -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-V8-NOCRC < %t %s
+// CHECK-V8-NOCRC: "-target-feature" "-crc"
+
diff --git a/test/Driver/at_file.c b/test/Driver/at_file.c
index 4ad2a5fde3d6..0541ece88b1f 100644
--- a/test/Driver/at_file.c
+++ b/test/Driver/at_file.c
@@ -1,5 +1,7 @@
// RUN: %clang -E %s @%s.args -o %t.log
// RUN: FileCheck --input-file=%t.log %s
+// RUN: %clang -E %s @%s.args.utf16le -o %t.log
+// RUN: FileCheck --input-file=%t.log %s
// CHECK: bar1
// CHECK-NEXT: bar2 zed2
@@ -13,6 +15,8 @@
// CHECK-NEXT: foo10"bar10"zed10
// CHECK: bar
// CHECK: zed12
+// CHECK: one\two
+// CHECK: c:\foo\bar.c
foo1
foo2
@@ -28,3 +32,5 @@ foo10
bar
#endif
foo12
+foo13
+foo14
diff --git a/test/Driver/at_file.c.args b/test/Driver/at_file.c.args
index 9a2b4ee93bd3..8739000e3c57 100644
--- a/test/Driver/at_file.c.args
+++ b/test/Driver/at_file.c.args
@@ -9,3 +9,5 @@
-Dfoo10=foo10\"bar10\"zed10
-D foo11
-Dfoo12=zed12\
+-Dfoo13='one\\two'
+-Dfoo14='c:\foo\bar.c'
diff --git a/test/Driver/at_file.c.args.utf16le b/test/Driver/at_file.c.args.utf16le
new file mode 100644
index 000000000000..c219c603a76a
--- /dev/null
+++ b/test/Driver/at_file.c.args.utf16le
Binary files differ
diff --git a/test/Driver/bounds-checking.c b/test/Driver/bounds-checking.c
index a4f97e820b4c..fdd20ca374ef 100644
--- a/test/Driver/bounds-checking.c
+++ b/test/Driver/bounds-checking.c
@@ -1,11 +1,11 @@
// RUN: %clang -fsanitize=bounds -### -fsyntax-only %s 2> %t
// RUN: FileCheck -check-prefix=CHECK < %t %s
-// CHECK: "-fsanitize=bounds"
+// CHECK: "-fsanitize=array-bounds,local-bounds"
// RUN: %clang -fbounds-checking -### -fsyntax-only %s 2> %t
// RUN: FileCheck -check-prefix=CHECK-OLD < %t %s
-// CHECK-OLD: "-fsanitize=bounds"
+// CHECK-OLD: "-fsanitize=local-bounds"
// RUN: %clang -fbounds-checking=3 -### -fsyntax-only %s 2> %t
// RUN: FileCheck -check-prefix=CHECK-OLD2 < %t %s
-// CHECK-OLD2: "-fsanitize=bounds"
+// CHECK-OLD2: "-fsanitize=local-bounds"
diff --git a/test/Driver/ccc-add-args.c b/test/Driver/ccc-add-args.c
deleted file mode 100644
index d9a16cbfb460..000000000000
--- a/test/Driver/ccc-add-args.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: env CCC_ADD_ARGS="-ccc-echo,-ccc-print-options,,-v" %clang -### 2>&1 | FileCheck %s
-// CHECK: Option 0 - Name: "-ccc-echo", Values: {}
-// CHECK: Option 1 - Name: "-ccc-print-options", Values: {}
-// CHECK: Option 2 - Name: "-v", Values: {}
-// CHECK: Option 3 - Name: "-###", Values: {}
diff --git a/test/Driver/ccc-as-cpp.c b/test/Driver/ccc-as-cpp.c
index feead5191db1..6c004338eda7 100644
--- a/test/Driver/ccc-as-cpp.c
+++ b/test/Driver/ccc-as-cpp.c
@@ -1,6 +1,3 @@
-// REQUIRES: shell
-// RUN: ln -sf %clang %T/clang-cpp
-
// PR13529: Don't crash.
-// RUN: %T/clang-cpp -lfoo -M %s 2>&1 | FileCheck --check-prefix=CHECK-PR13529 %s
+// RUN: %clang_cpp -lfoo -M %s 2>&1 | FileCheck --check-prefix=CHECK-PR13529 %s
// CHECK-PR13529: warning: -lfoo: 'linker' input unused in cpp mode
diff --git a/test/Driver/cl-fallback.c b/test/Driver/cl-fallback.c
new file mode 100644
index 000000000000..2433072a0250
--- /dev/null
+++ b/test/Driver/cl-fallback.c
@@ -0,0 +1,41 @@
+// Don't attempt slash switches on msys bash.
+// REQUIRES: shell-preserves-root
+
+// Note: %s must be preceded by --, otherwise it may be interpreted as a
+// command-line option, e.g. on Mac where %s is commonly under /Users.
+
+// RUN: %clang_cl /fallback /Dfoo=bar /Ubaz /Ifoo /O0 /Ox /GR /GR- /LD /LDd \
+// RUN: /MD /MDd /MTd /MT /FImyheader.h -### -- %s 2>&1 | FileCheck %s
+// CHECK: "-fdiagnostics-format" "msvc-fallback"
+// CHECK: ||
+// CHECK: cl.exe
+// CHECK: "/nologo"
+// CHECK: "/c"
+// CHECK: "/W0"
+// CHECK: "-D" "foo=bar"
+// CHECK: "-U" "baz"
+// CHECK: "-I" "foo"
+// CHECK: "/Ox"
+// CHECK: "/GR-"
+// CHECK: "/FImyheader.h"
+// CHECK: "/LD"
+// CHECK: "/LDd"
+// CHECK: "/MT"
+// CHECK: "/Tc" "{{.*cl-fallback.c}}"
+// CHECK: "/Fo{{.*cl-fallback.*.obj}}"
+
+// RUN: %clang_cl /fallback /Od -### -- %s 2>&1 | FileCheck -check-prefix=O0 %s
+// O0: cl.exe
+// O0: "/Od"
+// RUN: %clang_cl /fallback /O1 -### -- %s 2>&1 | FileCheck -check-prefix=O1 %s
+// O1: cl.exe
+// O1: "-O1"
+// RUN: %clang_cl /fallback /O2 -### -- %s 2>&1 | FileCheck -check-prefix=O2 %s
+// O2: cl.exe
+// O2: "-O2"
+// RUN: %clang_cl /fallback /Os -### -- %s 2>&1 | FileCheck -check-prefix=Os %s
+// Os: cl.exe
+// Os: "-Os"
+// RUN: %clang_cl /fallback /Ox -### -- %s 2>&1 | FileCheck -check-prefix=Ox %s
+// Ox: cl.exe
+// Ox: "/Ox"
diff --git a/test/Driver/cl-inputs.c b/test/Driver/cl-inputs.c
new file mode 100644
index 000000000000..d6ee520257d5
--- /dev/null
+++ b/test/Driver/cl-inputs.c
@@ -0,0 +1,35 @@
+// Don't attempt slash switches on msys bash.
+// REQUIRES: shell-preserves-root
+
+// Note: %s must be preceded by --, otherwise it may be interpreted as a
+// command-line option, e.g. on Mac where %s is commonly under /Users.
+
+// RUN: %clang_cl /TC -### -- %s 2>&1 | FileCheck -check-prefix=TC %s
+// TC: "-x" "c"
+// TC-NOT: warning
+// TC-NOT: note
+
+// RUN: %clang_cl /TP -### -- %s 2>&1 | FileCheck -check-prefix=TP %s
+// TP: "-x" "c++"
+// TP-NOT: warning
+// TP-NOT: note
+
+// RUN: %clang_cl -### /Tc%s /TP -- %s 2>&1 | FileCheck -check-prefix=Tc %s
+// RUN: %clang_cl -### /TP /Tc%s -- %s 2>&1 | FileCheck -check-prefix=Tc %s
+// Tc: "-x" "c"
+// Tc: "-x" "c++"
+// Tc-NOT: warning
+// Tc-NOT: note
+
+// RUN: %clang_cl -### /Tp%s /TC -- %s 2>&1 | FileCheck -check-prefix=Tp %s
+// RUN: %clang_cl -### /TC /Tp%s -- %s 2>&1 | FileCheck -check-prefix=Tp %s
+// Tp: "-x" "c++"
+// Tp: "-x" "c"
+// Tp-NOT: warning
+// Tp-NOT: note
+
+// RUN: %clang_cl /TP /TC /TP -### -- %s 2>&1 | FileCheck -check-prefix=WARN %s
+// WARN: warning: overriding '/TP' option with '/TC'
+// WARN: warning: overriding '/TC' option with '/TP'
+// WARN: note: The last /TC or /TP option takes precedence over earlier instances
+// WARN-NOT: note
diff --git a/test/Driver/cl-link.c b/test/Driver/cl-link.c
new file mode 100644
index 000000000000..24e0702c8ab3
--- /dev/null
+++ b/test/Driver/cl-link.c
@@ -0,0 +1,33 @@
+// Don't attempt slash switches on msys bash.
+// REQUIRES: shell-preserves-root
+
+// Note: %s must be preceded by -- or bound to another option, otherwise it may
+// be interpreted as a command-line option, e.g. on Mac where %s is commonly
+// under /Users.
+
+// RUN: %clang_cl /Tc%s -### /link foo bar baz 2>&1 | FileCheck --check-prefix=LINK %s
+// LINK: link.exe
+// LINK: "foo"
+// LINK: "bar"
+// LINK: "baz"
+
+// RUN: %clang_cl /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN %s
+// ASAN: link.exe
+// ASAN: "-debug"
+// ASAN: "-incremental:no"
+// ASAN: "{{.*}}clang_rt.asan-i386.lib"
+// ASAN: "{{.*}}cl-link{{.*}}.obj"
+
+// RUN: %clang_cl /LD -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
+// RUN: %clang_cl /LDd -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
+// DLL: link.exe
+// "-dll"
+
+// RUN: %clang_cl /LD /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-DLL %s
+// RUN: %clang_cl /LDd /Tc%s -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-DLL %s
+// ASAN-DLL: link.exe
+// ASAN-DLL: "-dll"
+// ASAN-DLL: "-debug"
+// ASAN-DLL: "-incremental:no"
+// ASAN-DLL: "{{.*}}clang_rt.asan_dll_thunk-i386.lib"
+// ASAN-DLL: "{{.*}}cl-link{{.*}}.obj"
diff --git a/test/Driver/cl-options.c b/test/Driver/cl-options.c
new file mode 100644
index 000000000000..01032bb38eec
--- /dev/null
+++ b/test/Driver/cl-options.c
@@ -0,0 +1,238 @@
+// Don't attempt slash switches on msys bash.
+// REQUIRES: shell-preserves-root
+
+// Note: %s must be preceded by --, otherwise it may be interpreted as a
+// command-line option, e.g. on Mac where %s is commonly under /Users.
+
+
+// Alias options:
+
+// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=C %s
+// C: -c
+
+// RUN: %clang_cl /Dfoo=bar -### -- %s 2>&1 | FileCheck -check-prefix=D %s
+// RUN: %clang_cl /D foo=bar -### -- %s 2>&1 | FileCheck -check-prefix=D %s
+// D: "-D" "foo=bar"
+
+// RTTI is on by default; just check that we don't error.
+// RUN: %clang_cl /Zs /GR -- %s 2>&1
+
+// RUN: %clang_cl /GR- -### -- %s 2>&1 | FileCheck -check-prefix=GR_ %s
+// GR_: -fno-rtti
+
+// RUN: %clang_cl /Imyincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s
+// RUN: %clang_cl /I myincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s
+// SLASH_I: "-I" "myincludedir"
+
+// RUN: %clang_cl /J -### -- %s 2>&1 | FileCheck -check-prefix=J %s
+// J: -fno-signed-char
+
+// RUN: %clang_cl /Ofoo -### -- %s 2>&1 | FileCheck -check-prefix=O %s
+// O: -Ofoo
+
+// RUN: %clang_cl /Ob0 -### -- %s 2>&1 | FileCheck -check-prefix=Ob0 %s
+// Ob0: -fno-inline
+
+// RUN: %clang_cl /Od -### -- %s 2>&1 | FileCheck -check-prefix=Od %s
+// Od: -O0
+
+// RUN: %clang_cl /Oi- /Oi -### -- %s 2>&1 | FileCheck -check-prefix=Oi %s
+// Oi-NOT: -fno-builtin
+
+// RUN: %clang_cl /Oi- -### -- %s 2>&1 | FileCheck -check-prefix=Oi_ %s
+// Oi_: -fno-builtin
+
+// RUN: %clang_cl /Os -### -- %s 2>&1 | FileCheck -check-prefix=Os %s
+// Os: -Os
+
+// RUN: %clang_cl /Ot -### -- %s 2>&1 | FileCheck -check-prefix=Ot %s
+// Ot: -O2
+
+// RUN: %clang_cl /Ox -### -- %s 2>&1 | FileCheck -check-prefix=Ox %s
+// Ox: -O3
+
+// RUN: %clang_cl /Zs /Oy -- %s 2>&1
+
+// RUN: %clang_cl /Oy- -### -- %s 2>&1 | FileCheck -check-prefix=Oy_ %s
+// Oy_: -mdisable-fp-elim
+
+// RUN: %clang_cl /P -### -- %s 2>&1 | FileCheck -check-prefix=P %s
+// P: -E
+
+// RUN: %clang_cl /showIncludes -### -- %s 2>&1 | FileCheck -check-prefix=showIncludes %s
+// showIncludes: --show-includes
+
+// RUN: %clang_cl /Umymacro -### -- %s 2>&1 | FileCheck -check-prefix=U %s
+// RUN: %clang_cl /U mymacro -### -- %s 2>&1 | FileCheck -check-prefix=U %s
+// U: "-U" "mymacro"
+
+// RUN: %clang_cl /W0 -### -- %s 2>&1 | FileCheck -check-prefix=W0 %s
+// W0: -w
+
+// RUN: %clang_cl /W1 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
+// RUN: %clang_cl /W2 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
+// RUN: %clang_cl /W3 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
+// RUN: %clang_cl /W4 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
+// RUN: %clang_cl /Wall -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
+// W1: -Wall
+
+// RUN: %clang_cl /WX -### -- %s 2>&1 | FileCheck -check-prefix=WX %s
+// WX: -Werror
+
+// RUN: %clang_cl /WX- -### -- %s 2>&1 | FileCheck -check-prefix=WX_ %s
+// WX_: -Wno-error
+
+// RUN: %clang_cl /w -### -- %s 2>&1 | FileCheck -check-prefix=w %s
+// w: -w
+
+// RUN: %clang_cl /Zs -### -- %s 2>&1 | FileCheck -check-prefix=Zs %s
+// Zs: -fsyntax-only
+
+// RUN: %clang_cl /FIasdf.h -### -- %s 2>&1 | FileCheck -check-prefix=FI %s
+// FI: "-include" "asdf.h"
+
+// RUN: %clang_cl /FI asdf.h -### -- %s 2>&1 | FileCheck -check-prefix=FI_ %s
+// FI_: "-include" "asdf.h"
+
+// We forward any unrecognized -W diagnostic options to cc1.
+// RUN: %clang_cl -Wunused-pragmas -### -- %s 2>&1 | FileCheck -check-prefix=WJoined %s
+// WJoined: "-cc1"
+// WJoined: "-Wunused-pragmas"
+
+
+// Ignored options. Check that we don't get "unused during compilation" errors.
+// (/Zs is for syntax-only, /WX is for -Werror)
+// RUN: %clang_cl /Zs /WX \
+// RUN: /analyze- \
+// RUN: /errorReport:foo \
+// RUN: /FS \
+// RUN: /GF \
+// RUN: /GS- \
+// RUN: /kernel- \
+// RUN: /nologo \
+// RUN: /Ob1 \
+// RUN: /Ob2 \
+// RUN: /RTC1 \
+// RUN: /sdl \
+// RUN: /sdl- \
+// RUN: /vmg \
+// RUN: /w12345 \
+// RUN: /wd1234 \
+// RUN: /Zc:forScope \
+// RUN: /Zc:wchar_t \
+// RUN: -- %s
+
+// Ignored options and compile-only options are ignored for link jobs.
+// RUN: touch %t.obj
+// RUN: %clang_cl /nologo -### -- %t.obj 2>&1 | FileCheck -check-prefix=LINKUNUSED %s
+// RUN: %clang_cl /Dfoo -### -- %t.obj 2>&1 | FileCheck -check-prefix=LINKUNUSED %s
+// RUN: %clang_cl /MD -### -- %t.obj 2>&1 | FileCheck -check-prefix=LINKUNUSED %s
+// LINKUNUSED-NOT: argument unused during compilation
+
+// Support ignoring warnings about unused arguments.
+// RUN: %clang_cl /Abracadabra -Qunused-arguments -### -- %s 2>&1 | FileCheck -check-prefix=UNUSED %s
+// UNUSED-NOT: warning
+
+// Unsupported but parsed options. Check that we don't error on them.
+// (/Zs is for syntax-only)
+// RUN: %clang_cl /Zs \
+// RUN: /AIfoo \
+// RUN: /arch:sse2 \
+// RUN: /clr:pure \
+// RUN: /docname \
+// RUN: /E \
+// RUN: /EHsc \
+// RUN: /EP \
+// RUN: /F \
+// RUN: /FA \
+// RUN: /FAc \
+// RUN: /Fafilename \
+// RUN: /FAs \
+// RUN: /FAu \
+// RUN: /favor:blend \
+// RUN: /FC \
+// RUN: /Fdfoo \
+// RUN: /Fifoo \
+// RUN: /Fmfoo \
+// RUN: /FpDebug\main.pch \
+// RUN: /fp:precise \
+// RUN: /Frfoo \
+// RUN: /FRfoo \
+// RUN: /FU foo \
+// RUN: /Fx \
+// RUN: /G1 \
+// RUN: /G2 \
+// RUN: /GA \
+// RUN: /Gd \
+// RUN: /Ge \
+// RUN: /Gh \
+// RUN: /GH \
+// RUN: /GL \
+// RUN: /GL- \
+// RUN: /Gm \
+// RUN: /Gm- \
+// RUN: /Gr \
+// RUN: /GS \
+// RUN: /Gs1000 \
+// RUN: /GT \
+// RUN: /GX \
+// RUN: /Gy \
+// RUN: /Gy- \
+// RUN: /Gz \
+// RUN: /GZ \
+// RUN: /H \
+// RUN: /homeparams \
+// RUN: /hotpatch \
+// RUN: /kernel \
+// RUN: /LN \
+// RUN: /MP \
+// RUN: /o foo.obj \
+// RUN: /ofoo.obj \
+// RUN: /openmp \
+// RUN: /Qfast_transcendentals \
+// RUN: /QIfist \
+// RUN: /Qimprecise_fwaits \
+// RUN: /Qpar \
+// RUN: /Qvec-report:2 \
+// RUN: /u \
+// RUN: /V \
+// RUN: /vd2 \
+// RUN: /vmb \
+// RUN: /vmm \
+// RUN: /vms \
+// RUN: /vmv \
+// RUN: /volatile \
+// RUN: /wfoo \
+// RUN: /WL \
+// RUN: /Wp64 \
+// RUN: /X \
+// RUN: /Y- \
+// RUN: /Yc \
+// RUN: /Ycstdafx.h \
+// RUN: /Yd \
+// RUN: /Yl- \
+// RUN: /Ylfoo \
+// RUN: /Yustdafx.h \
+// RUN: /Z7 \
+// RUN: /Za \
+// RUN: /Zc:auto \
+// RUN: /Zc:wchar_t- \
+// RUN: /Ze \
+// RUN: /Zg \
+// RUN: /Zi \
+// RUN: /ZI \
+// RUN: /Zl \
+// RUN: /Zp \
+// RUN: /ZW:nostdlib \
+// RUN: -- %s 2>&1
+
+// We support -Xclang for forwarding options to cc1.
+// RUN: %clang_cl -Xclang hellocc1 -### -- %s 2>&1 | FileCheck -check-prefix=Xclang %s
+// Xclang: "-cc1"
+// Xclang: "hellocc1"
+
+// We support -m32 and -m64.
+// RUN: %clang_cl /Zs /WX -m32 -m64 -- %s
+
+
+void f() { }
diff --git a/test/Driver/cl-outputs.c b/test/Driver/cl-outputs.c
new file mode 100644
index 000000000000..2ceaa85471b1
--- /dev/null
+++ b/test/Driver/cl-outputs.c
@@ -0,0 +1,107 @@
+// Don't attempt slash switches on msys bash.
+// REQUIRES: shell-preserves-root
+
+// Note: %s must be preceded by --, otherwise it may be interpreted as a
+// command-line option, e.g. on Mac where %s is commonly under /Users.
+
+// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULT %s
+// DEFAULT: "-o" "cl-outputs.obj"
+
+// RUN: %clang_cl /Foa -### -- %s 2>&1 | FileCheck -check-prefix=FoNAME %s
+// FoNAME: "-o" "a.obj"
+
+// RUN: %clang_cl /Foa.ext /Fob.ext -### -- %s 2>&1 | FileCheck -check-prefix=FoNAMEEXT %s
+// FoNAMEEXT: "-o" "b.ext"
+
+// RUN: %clang_cl /Fofoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FoDIR %s
+// FoDIR: "-o" "foo.dir{{[/\\]+}}cl-outputs.obj"
+
+// RUN: %clang_cl /Fofoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FoDIRNAME %s
+// FoDIRNAME: "-o" "foo.dir{{[/\\]+}}a.obj"
+
+// RUN: %clang_cl /Fofoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FoDIRNAMEEXT %s
+// FoDIRNAMEEXT: "-o" "foo.dir{{[/\\]+}}a.ext"
+
+// RUN: %clang_cl /Fo.. -### -- %s 2>&1 | FileCheck -check-prefix=FoCRAZY %s
+// FoCRAZY: "-o" "..obj"
+
+// RUN: %clang_cl /Fo -### 2>&1 | FileCheck -check-prefix=FoMISSINGARG %s
+// FoMISSINGARG: error: argument to '/Fo' is missing (expected 1 value)
+
+// RUN: %clang_cl /Foa.obj -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEERROR %s
+// CHECK-MULTIPLESOURCEERROR: error: cannot specify '/Foa.obj' when compiling multiple source files
+
+// RUN: %clang_cl /Fomydir/ -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEOK %s
+// CHECK-MULTIPLESOURCEOK: "-o" "mydir{{[/\\]+}}cl-outputs.obj"
+
+
+// RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULTEXE %s
+// DEFAULTEXE: cl-outputs.exe
+
+// RUN: %clang_cl /LD -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULTDLL %s
+// RUN: %clang_cl /LDd -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULTDLL %s
+// DEFAULTDLL: "-out:cl-outputs.dll"
+// DEFAULTDLL: "-implib:cl-outputs.lib"
+
+// RUN: %clang_cl /Fefoo -### -- %s 2>&1 | FileCheck -check-prefix=FeNOEXT %s
+// FeNOEXT: "-out:foo.exe"
+
+// RUN: %clang_cl /Fefoo /LD -### -- %s 2>&1 | FileCheck -check-prefix=FeNOEXTDLL %s
+// RUN: %clang_cl /Fefoo /LDd -### -- %s 2>&1 | FileCheck -check-prefix=FeNOEXTDLL %s
+// FeNOEXTDLL: "-out:foo.dll"
+// FeNOEXTDLL: "-implib:foo.lib"
+
+// RUN: %clang_cl /Fefoo.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeEXT %s
+// FeEXT: "-out:foo.ext"
+
+// RUN: %clang_cl /LD /Fefoo.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeEXTDLL %s
+// RUN: %clang_cl /LDd /Fefoo.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeEXTDLL %s
+// FeEXTDLL: "-out:foo.ext"
+// FeEXTDLL: "-implib:foo.lib"
+
+// RUN: %clang_cl /Fefoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FeDIR %s
+// FeDIR: "-out:foo.dir{{[/\\]+}}cl-outputs.exe"
+
+// RUN: %clang_cl /LD /Fefoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRDLL %s
+// RUN: %clang_cl /LDd /Fefoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRDLL %s
+// FeDIRDLL: "-out:foo.dir{{[/\\]+}}cl-outputs.dll"
+// FeDIRDLL: "-implib:foo.dir{{[/\\]+}}cl-outputs.lib"
+
+// RUN: %clang_cl /Fefoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAME %s
+// FeDIRNAME: "-out:foo.dir{{[/\\]+}}a.exe"
+
+// RUN: %clang_cl /LD /Fefoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAMEDLL %s
+// RUN: %clang_cl /LDd /Fefoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAMEDLL %s
+// FeDIRNAMEDLL: "-out:foo.dir{{[/\\]+}}a.dll"
+// FeDIRNAMEDLL: "-implib:foo.dir{{[/\\]+}}a.lib"
+
+// RUN: %clang_cl /Fefoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAMEEXT %s
+// FeDIRNAMEEXT: "-out:foo.dir{{[/\\]+}}a.ext"
+
+// RUN: %clang_cl /LD /Fefoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAMEEXTDLL %s
+// RUN: %clang_cl /LDd /Fefoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAMEEXTDLL %s
+// FeDIRNAMEEXTDLL: "-out:foo.dir{{[/\\]+}}a.ext"
+// FeDIRNAMEEXTDLL: "-implib:foo.dir{{[/\\]+}}a.lib"
+
+// RUN: %clang_cl /Fe -### 2>&1 | FileCheck -check-prefix=FeMISSINGARG %s
+// FeMISSINGARG: error: argument to '/Fe' is missing (expected 1 value)
+
+// RUN: %clang_cl /Fefoo /Febar -### -- %s 2>&1 | FileCheck -check-prefix=FeOVERRIDE %s
+// FeOVERRIDE: "-out:bar.exe"
+
+
+// RUN: %clang_cl /FA -### -- %s 2>&1 | FileCheck -check-prefix=FA %s
+// FA: "-o" "cl-outputs.asm"
+// RUN: %clang_cl /FA /Fafoo -### -- %s 2>&1 | FileCheck -check-prefix=FaNAME %s
+// RUN: %clang_cl /Fafoo -### -- %s 2>&1 | FileCheck -check-prefix=FaNAME %s
+// FaNAME: "-o" "foo.asm"
+// RUN: %clang_cl /FA /Faa.ext /Fab.ext -### -- %s 2>&1 | FileCheck -check-prefix=FaNAMEEXT %s
+// FaNAMEEXT: "-o" "b.ext"
+// RUN: %clang_cl /FA /Fafoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FaDIR %s
+// FaDIR: "-o" "foo.dir{{[/\\]+}}cl-outputs.asm"
+// RUN: %clang_cl /FA /Fafoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FaDIRNAME %s
+// FaDIRNAME: "-o" "foo.dir{{[/\\]+}}a.asm"
+// RUN: %clang_cl /FA /Fafoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FaDIRNAMEEXT %s
+// FaDIRNAMEEXT: "-o" "foo.dir{{[/\\]+}}a.ext"
+// RUN: %clang_cl /Faa.asm -### -- %s %s 2>&1 | FileCheck -check-prefix=FaMULTIPLESOURCE %s
+// FaMULTIPLESOURCE: error: cannot specify '/Faa.asm' when compiling multiple source files
diff --git a/test/Driver/cl-runtime-flags.c b/test/Driver/cl-runtime-flags.c
new file mode 100644
index 000000000000..8367531f9ccb
--- /dev/null
+++ b/test/Driver/cl-runtime-flags.c
@@ -0,0 +1,89 @@
+// Don't attempt slash switches on msys bash.
+// REQUIRES: shell-preserves-root
+
+// Note: %s must be preceded by --, otherwise it may be interpreted as a
+// command-line option, e.g. on Mac where %s is commonly under /Users.
+
+// First check that regular clang doesn't do any of this stuff.
+// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-CLANG %s
+// CHECK-CLANG-NOT: "-D_DEBUG"
+// CHECK-CLANG-NOT: "-D_MT"
+// CHECK-CLANG-NOT: "-D_DLL"
+// CHECK-CLANG-NOT: --dependent-lib
+
+// RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=CHECK-MT %s
+// RUN: %clang_cl -### /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-MT %s
+// CHECK-MT-NOT: "-D_DEBUG"
+// CHECK-MT: "-D_MT"
+// CHECK-MT-NOT: "-D_DLL"
+// CHECK-MT: "--dependent-lib=libcmt"
+// CHECK-MT: "--dependent-lib=oldnames"
+
+// RUN: %clang_cl -### /MTd -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTd %s
+// RUN: %clang_cl -### /LD /MTd -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTd %s
+// CHECK-MTd: "-D_DEBUG"
+// CHECK-MTd: "-D_MT"
+// CHECK-MTd-NOT: "-D_DLL"
+// CHECK-MTd: "--dependent-lib=libcmtd"
+// CHECK-MTd: "--dependent-lib=oldnames"
+
+// RUN: %clang_cl -### /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-MD %s
+// CHECK-MD-NOT: "-D_DEBUG"
+// CHECK-MD: "-D_MT"
+// CHECK-MD: "-D_DLL"
+// CHECK-MD: "--dependent-lib=msvcrt"
+// CHECK-MD: "--dependent-lib=oldnames"
+
+// RUN: %clang_cl -### /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-MDd %s
+// CHECK-MDd: "-D_DEBUG"
+// CHECK-MDd: "-D_MT"
+// CHECK-MDd: "-D_DLL"
+// CHECK-MDd: "--dependent-lib=msvcrtd"
+// CHECK-MDd: "--dependent-lib=oldnames"
+
+// RUN: %clang_cl -### /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LD %s
+// RUN: %clang_cl -### /LD /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-LD %s
+// CHECK-LD-NOT: "-D_DEBUG"
+// CHECK-LD: "-D_MT"
+// CHECK-LD-NOT: "-D_DLL"
+// CHECK-LD: "--dependent-lib=libcmt"
+
+// RUN: %clang_cl -### /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDd %s
+// RUN: %clang_cl -### /LDd /MTd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDd %s
+// CHECK-LDd: "-D_DEBUG"
+// CHECK-LDd: "-D_MT"
+// CHECK-LDd-NOT: "-D_DLL"
+// CHECK-LDd: "--dependent-lib=libcmtd"
+
+// RUN: %clang_cl -### /LDd /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMT %s
+// RUN: %clang_cl -### /MT /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMT %s
+// CHECK-LDdMT: "-D_DEBUG"
+// CHECK-LDdMT: "-D_MT"
+// CHECK-LDdMT-NOT: "-D_DLL"
+// CHECK-LDdMT: "--dependent-lib=libcmt"
+
+// RUN: %clang_cl -### /LD /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMD %s
+// RUN: %clang_cl -### /MD /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMD %s
+// CHECK-LDMD-NOT: "-D_DEBUG"
+// CHECK-LDMD: "-D_MT"
+// CHECK-LDMD: "-D_DLL"
+// CHECK-LDMD: "--dependent-lib=msvcrt"
+
+// RUN: %clang_cl -### /LDd /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMD %s
+// RUN: %clang_cl -### /MD /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMD %s
+// CHECK-LDdMD: "-D_DEBUG"
+// CHECK-LDdMD: "-D_MT"
+// CHECK-LDdMD: "-D_DLL"
+// CHECK-LDdMD: "--dependent-lib=msvcrt"
+
+// RUN: %clang_cl -### /LD /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s
+// RUN: %clang_cl -### /MDd /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s
+// RUN: %clang_cl -### /LDd /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s
+// RUN: %clang_cl -### /MDd /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s
+// CHECK-LDMDd: "-D_DEBUG"
+// CHECK-LDMDd: "-D_MT"
+// CHECK-LDMDd: "-D_DLL"
+// CHECK-LDMDd: "--dependent-lib=msvcrtd"
+
+// RUN: %clang_cl /MD /MT -### -- %s 2>&1 | FileCheck -check-prefix=MTOVERRIDE %s
+// MTOVERRIDE: "--dependent-lib=libcmt"
diff --git a/test/Driver/cl.c b/test/Driver/cl.c
new file mode 100644
index 000000000000..4fd406439797
--- /dev/null
+++ b/test/Driver/cl.c
@@ -0,0 +1,35 @@
+// Don't attempt slash switches on msys bash.
+// REQUIRES: shell-preserves-root
+
+// Note: we have to quote the /? option, otherwise some shells will try to
+// expand the ? into a one-letter filename in the root directory, and make
+// the test fail is such a file or directory exists.
+
+// Note: %s must be preceded by --, otherwise it may be interpreted as a
+// command-line option, e.g. on Mac where %s is commonly under /Users.
+
+// Check that clang-cl options are not available by default.
+// RUN: %clang -help | FileCheck %s -check-prefix=DEFAULT
+// DEFAULT-NOT: CL.EXE COMPATIBILITY OPTIONS
+// DEFAULT-NOT: {{/[?]}}
+// DEFAULT-NOT: /help
+// RUN: not %clang "/?"
+// RUN: not %clang -?
+// RUN: not %clang /help
+
+// Check that /? and /help are available as clang-cl options.
+// RUN: %clang_cl "/?" | FileCheck %s -check-prefix=CL
+// RUN: %clang_cl /help | FileCheck %s -check-prefix=CL
+// RUN: %clang_cl -help | FileCheck %s -check-prefix=CL
+// CL: CL.EXE COMPATIBILITY OPTIONS
+// CL: {{/[?]}}
+// CL: /help
+
+// Options which are not "core" clang options nor cl.exe compatible options
+// are not available in clang-cl.
+// DEFAULT: -fapple-kext
+// CL-NOT: -fapple-kext
+
+// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=COMPILE %s
+// COMPILE: "-cxx-abi" "microsoft"
+// COMPILE: "-fdiagnostics-format" "msvc"
diff --git a/test/Driver/clang-g-opts.c b/test/Driver/clang-g-opts.c
index f5d09fda3dd8..9ca1fd38e407 100644
--- a/test/Driver/clang-g-opts.c
+++ b/test/Driver/clang-g-opts.c
@@ -1,9 +1,16 @@
// RUN: %clang -### -S %s 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s
-// RUN: %clang -### -S %s -g 2>&1 | FileCheck --check-prefix=CHECK-WITH-G %s
+// RUN: %clang -### -S %s -g -target x86_64-linux-gnu 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WITH-G %s
+// RUN: %clang -### -S %s -g -target x86_64-apple-darwin 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DARWIN %s
// RUN: %clang -### -S %s -g0 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s
// RUN: %clang -### -S %s -g -g0 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s
-// RUN: %clang -### -S %s -g0 -g 2>&1 | FileCheck --check-prefix=CHECK-WITH-G %s
+// RUN: %clang -### -S %s -g0 -g -target x86_64-linux-gnu 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WITH-G %s
+// RUN: %clang -### -S %s -g0 -g -target x86_64-apple-darwin 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DARWIN %s
// CHECK-WITHOUT-G-NOT: "-g"
// CHECK-WITH-G: "-g"
+// CHECK-WITH-G-DARWIN: "-gdwarf-2"
diff --git a/test/Driver/clang-translation.c b/test/Driver/clang-translation.c
index 3b2b7e81f916..09303841c34b 100644
--- a/test/Driver/clang-translation.c
+++ b/test/Driver/clang-translation.c
@@ -19,6 +19,10 @@
// RUN: FileCheck -check-prefix=CORE2 %s
// CORE2: "-target-cpu"
// CORE2: "core2"
+// RUN: %clang -target x86_64h-apple-darwin -### -S %s -o %t.s 2>&1 | \
+// RUN: FileCheck -check-prefix=AVX2 %s
+// AVX2: "-target-cpu"
+// AVX2: "core-avx2"
// RUN: %clang -target x86_64-apple-darwin10 -### -S %s -arch armv7 2>&1 | \
// RUN: FileCheck -check-prefix=ARMV7_DEFAULT %s
@@ -33,10 +37,10 @@
// RUN: -msoft-float 2>&1 | FileCheck -check-prefix=ARMV7_SOFTFLOAT %s
// ARMV7_SOFTFLOAT: clang
// ARMV7_SOFTFLOAT: "-cc1"
-// ARMV7_SOFTFLOAT: "-msoft-float"
-// ARMV7_SOFTFLOAT: "-mfloat-abi" "soft"
// ARMV7_SOFTFLOAT: "-target-feature"
// ARMV7_SOFTFLOAT: "-neon"
+// ARMV7_SOFTFLOAT: "-msoft-float"
+// ARMV7_SOFTFLOAT: "-mfloat-abi" "soft"
// ARMV7_SOFTFLOAT: "-x" "c"
// RUN: %clang -target x86_64-apple-darwin10 -### -S %s -arch armv7 \
diff --git a/test/Driver/clang_f_opts.c b/test/Driver/clang_f_opts.c
index 5451945515a4..8bf53e5e6dc3 100644
--- a/test/Driver/clang_f_opts.c
+++ b/test/Driver/clang_f_opts.c
@@ -15,11 +15,11 @@
// CHECK-OPTIONS2: -fno-show-source-location
// RUN: %clang -### -S -Wwrite-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s
+// RUN: %clang -### -S -Weverything %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s
// WRITE-STRINGS1: -fconst-strings
// RUN: %clang -### -S -Wwrite-strings -Wno-write-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s
+// RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s
// WRITE-STRINGS2-NOT: -fconst-strings
-// RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS3 %s
-// WRITE-STRINGS3: -fconst-strings
// RUN: %clang -### -x c++ -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
// RUN: %clang -### -x c++ -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
@@ -37,6 +37,23 @@
// FP-CONTRACT-FAST-CHECK: -ffp-contract=fast
// FP-CONTRACT-OFF-CHECK: -ffp-contract=off
+// RUN: %clang -### -S -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s
+// RUN: %clang -### -S -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s
+// RUN: %clang -### -S -fno-unroll-loops -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s
+// RUN: %clang -### -S -funroll-loops -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s
+// CHECK-UNROLL-LOOPS: "-funroll-loops"
+// CHECK-NO-UNROLL-LOOPS: "-fno-unroll-loops"
+
+// RUN: %clang -### -S -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s
+// RUN: %clang -### -S -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s
+// RUN: %clang -### -S -fno-reroll-loops -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s
+// RUN: %clang -### -S -freroll-loops -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s
+// CHECK-REROLL-LOOPS: "-freroll-loops"
+// CHECK-NO-REROLL-LOOPS-NOT: "-freroll-loops"
+
+// RUN: %clang -### -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s
+// CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
+
// RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
// RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
// RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
@@ -45,6 +62,17 @@
// RUN: %clang -### -S -fno-tree-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
// RUN: %clang -### -S -fno-tree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
// RUN: %clang -### -S -ftree-vectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
+// RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
+// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
+// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
+// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
+// RUN: %clang -### -S -fno-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
+// RUN: %clang -### -S -O1 -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
+// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
+// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
+// RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
+// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
+// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
// CHECK-VECTORIZE: "-vectorize-loops"
// CHECK-NO-VECTORIZE-NOT: "-vectorize-loops"
@@ -71,3 +99,49 @@
// CHECK-EXTENDED-IDENTIFIERS: "-cc1"
// CHECK-EXTENDED-IDENTIFIERS-NOT: "-fextended-identifiers"
// CHECK-NO-EXTENDED-IDENTIFIERS: error: unsupported option '-fno-extended-identifiers'
+
+// RUN: %clang -### -S -fno-pascal-strings -mpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-M-PASCAL-STRINGS %s
+// CHECK-M-PASCAL-STRINGS: "-fpascal-strings"
+
+// RUN: %clang -### -S -fpascal-strings -mno-pascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-NO-M-PASCAL-STRINGS %s
+// CHECK-NO-M-PASCAL-STRINGS-NOT: "-fpascal-strings"
+
+// RUN: %clang -### -S -O4 %s 2>&1 | FileCheck -check-prefix=CHECK-MAX-O %s
+// CHECK-MAX-O: warning: -O4 is equivalent to -O3
+// CHECK-MAX-O: -O3
+
+// RUN: %clang -S -O20 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-O %s
+// CHECK-INVALID-O: warning: optimization level '-O20' is unsupported; using '-O3' instead
+
+// Test that we don't error on these.
+// RUN: %clang -### -S -Werror \
+// RUN: -falign-functions -falign-functions=2 -fno-align-functions \
+// RUN: -fasynchronous-unwind-tables -fno-asynchronous-unwind-tables \
+// RUN: -fbuiltin -fno-builtin \
+// RUN: -fdiagnostics-show-location=once \
+// RUN: -ffloat-store -fno-float-store \
+// RUN: -feliminate-unused-debug-types -fno-eliminate-unused-debug-types \
+// RUN: -fgcse -fno-gcse \
+// RUN: -fident -fno-ident \
+// RUN: -fimplicit-templates -fno-implicit-templates \
+// RUN: -fivopts -fno-ivopts \
+// RUN: -fnon-call-exceptions -fno-non-call-exceptions \
+// RUN: -fpermissive -fno-permissive \
+// RUN: -fprefetch-loop-arrays -fno-prefetch-loop-arrays \
+// RUN: -fprofile-correction -fno-profile-correction \
+// RUN: -fprofile-dir=bar \
+// RUN: -fprofile-use -fprofile-use=zed -fno-profile-use \
+// RUN: -fprofile-values -fno-profile-values \
+// RUN: -frounding-math -fno-rounding-math \
+// RUN: -fsee -fno-see \
+// RUN: -ftracer -fno-tracer \
+// RUN: -funroll-all-loops -fno-unroll-all-loops \
+// RUN: -fuse-ld=gold \
+// RUN: -fno-builtin-foobar \
+// RUN: -fno-builtin-strcat -fno-builtin-strcpy \
+// RUN: -fno-var-tracking \
+// RUN: -fno-unsigned-char \
+// RUN: -fno-signed-char \
+// RUN: -fstrength-reduce -fno-strength-reduce \
+// RUN: %s 2>&1 | FileCheck --check-prefix=IGNORE %s
+// IGNORE-NOT: error: unknown argument
diff --git a/test/Driver/color-diagnostics.c b/test/Driver/color-diagnostics.c
index deff5119a0f7..ebf614eeb1a3 100644
--- a/test/Driver/color-diagnostics.c
+++ b/test/Driver/color-diagnostics.c
@@ -1,53 +1,57 @@
// RUN: %clang -fcolor-diagnostics -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=CD %s
+// RUN: | FileCheck --check-prefix=CHECK-CD %s
// CHECK-CD: clang{{.*}}" "-fcolor-diagnostics"
// RUN: %clang -fno-color-diagnostics -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=NCD %s
+// RUN: | FileCheck --check-prefix=CHECK-NCD %s
// CHECK-NCD-NOT: clang{{.*}}" "-fcolor-diagnostics"
// RUN: %clang -fdiagnostics-color -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=DC %s
+// RUN: | FileCheck --check-prefix=CHECK-DC %s
// CHECK-DC: clang{{.*}}" "-fcolor-diagnostics"
// RUN: %clang -fno-diagnostics-color -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=NDC %s
+// RUN: | FileCheck --check-prefix=CHECK-NDC %s
// CHECK-NDC-NOT: clang{{.*}}" "-fcolor-diagnostics"
// RUN: %clang -fdiagnostics-color=always -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=DCE_A %s
+// RUN: | FileCheck --check-prefix=CHECK-DCE_A %s
// CHECK-DCE_A: clang{{.*}}" "-fcolor-diagnostics"
// RUN: %clang -fdiagnostics-color=never -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=DCE_N %s
+// RUN: | FileCheck --check-prefix=CHECK-DCE_N %s
// CHECK-DCE_N-NOT: clang{{.*}}" "-fcolor-diagnostics"
// The test doesn't run in a PTY, so "auto" defaults to off.
// RUN: %clang -fdiagnostics-color=auto -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=DCE_AUTO %s
+// RUN: | FileCheck --check-prefix=CHECK-DCE_AUTO %s
// CHECK-DCE_AUTO-NOT: clang{{.*}}" "-fcolor-diagnostics"
// RUN: %clang -fdiagnostics-color=foo -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=DCE_FOO %s
+// RUN: | FileCheck --check-prefix=CHECK-DCE_FOO %s
// CHECK-DCE_FOO: error: the clang compiler does not support '-fdiagnostics-color=foo'
// Check that the last flag wins.
// RUN: %clang -fno-color-diagnostics -fdiagnostics-color -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=NCD_DC_S %s
+// RUN: | FileCheck --check-prefix=CHECK-NCD_DC_S %s
// CHECK-NCD_DC_S: clang{{.*}}" "-fcolor-diagnostics"
// RUN: %clang -fcolor-diagnostics -fno-diagnostics-color -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=CD_NDC_S %s
+// RUN: | FileCheck --check-prefix=CHECK-CD_NDC_S %s
// CHECK-CD_NDC_S-NOT: clang{{.*}}" "-fcolor-diagnostics"
// RUN: %clang -fdiagnostics-color -fno-color-diagnostics -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=DC_NCD_S %s
+// RUN: | FileCheck --check-prefix=CHECK-DC_NCD_S %s
// CHECK-DC_NCD_S-NOT: clang{{.*}}" "-fcolor-diagnostics"
// RUN: %clang -fno-diagnostics-color -fcolor-diagnostics -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=NDC_CD_S %s
+// RUN: | FileCheck --check-prefix=CHECK-NDC_CD_S %s
// CHECK-NDC_CD_S: clang{{.*}}" "-fcolor-diagnostics"
// RUN: %clang -fcolor-diagnostics -fdiagnostics-color=auto -### -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=CD_DCE_AUTO_S %s
+// RUN: | FileCheck --check-prefix=CHECK-CD_DCE_AUTO_S %s
// CHECK-CD_DCE_AUTO_S-NOT: clang{{.*}}" "-fcolor-diagnostics"
+
+// RUN: %clang -fansi-escape-codes -### -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-AEC %s
+// CHECK-AEC: clang{{.*}}" "-fansi-escape-codes"
diff --git a/test/Driver/coverage-ld.c b/test/Driver/coverage-ld.c
new file mode 100644
index 000000000000..cbb7dd472410
--- /dev/null
+++ b/test/Driver/coverage-ld.c
@@ -0,0 +1,19 @@
+// Test coverage ld flags.
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target i386-unknown-linux --coverage \
+// RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LINUX-I386 %s
+//
+// CHECK-LINUX-I386: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
+// CHECK-LINUX-I386: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-i386.a" {{.*}} "-lc"
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-unknown-linux --coverage \
+// RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LINUX-X86-64 %s
+//
+// CHECK-LINUX-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
+// CHECK-LINUX-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.profile-x86_64.a" {{.*}} "-lc"
diff --git a/test/Driver/crash-report.c b/test/Driver/crash-report.c
index 975e9a8a714f..95c57f238e0a 100644
--- a/test/Driver/crash-report.c
+++ b/test/Driver/crash-report.c
@@ -1,21 +1,29 @@
// RUN: rm -rf %t
// RUN: mkdir %t
-// RUN: env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 %clang -fsyntax-only %s \
+// RUN: not env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 %clang -fsyntax-only %s \
// RUN: -F/tmp/ -I /tmp/ -idirafter /tmp/ -iquote /tmp/ -isystem /tmp/ \
// RUN: -iprefix /the/prefix -iwithprefix /tmp -iwithprefixbefore /tmp/ \
-// RUN: -internal-isystem /tmp/ -internal-externc-isystem /tmp/ \
+// RUN: -Xclang -internal-isystem -Xclang /tmp/ \
+// RUN: -Xclang -internal-externc-isystem -Xclang /tmp/ \
// RUN: -DFOO=BAR 2>&1 | FileCheck %s
// RUN: cat %t/crash-report-*.c | FileCheck --check-prefix=CHECKSRC %s
// RUN: cat %t/crash-report-*.sh | FileCheck --check-prefix=CHECKSH %s
// REQUIRES: crash-recovery
-// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH=1 %clang -fsyntax-only -x c /dev/null 2>&1 | FileCheck %s
+// because of the glob (*.c, *.sh)
+// REQUIRES: shell
+
+// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH=1 %clang -fsyntax-only -x c /dev/null 2>&1 | FileCheck %s
+
+// FIXME: Investigating. "fatal error: file 'nul' modified since it was first processed"
+// XFAIL: mingw32
#pragma clang __debug parser_crash
// CHECK: Preprocessed source(s) and associated run script(s) are located at:
// CHECK-NEXT: note: diagnostic msg: {{.*}}.c
FOO
// CHECKSRC: FOO
+// CHECKSH: -cc1
// CHECKSH: -D "FOO=BAR"
// CHECKSH-NOT: -F/tmp/
// CHECKSH-NOT: -I /tmp/
diff --git a/test/Driver/cross-linux.c b/test/Driver/cross-linux.c
new file mode 100644
index 000000000000..3013d80f4c1e
--- /dev/null
+++ b/test/Driver/cross-linux.c
@@ -0,0 +1,95 @@
+// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
+// RUN: --gcc-toolchain=%S/Inputs/basic_cross_linux_tree/usr \
+// RUN: --target=i386-unknown-linux-gnu \
+// RUN: | FileCheck --check-prefix=CHECK-I386 %s
+// CHECK-I386: "-cc1" "-triple" "i386-unknown-linux-gnu"
+// CHECK-I386: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/../../../../i386-unknown-linux-gnu/bin{{/|\\}}as" "--32"
+// CHECK-I386: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/../../../../i386-unknown-linux-gnu/bin{{/|\\}}ld" {{.*}} "-m" "elf_i386"
+//
+// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
+// RUN: --gcc-toolchain=%S/Inputs/basic_cross_linux_tree/usr \
+// RUN: --target=x86_64-unknown-linux-gnu \
+// RUN: | FileCheck --check-prefix=CHECK-X86-64 %s
+// CHECK-X86-64: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
+// CHECK-X86-64: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\}}as" "--64"
+// CHECK-X86-64: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\}}ld" {{.*}} "-m" "elf_x86_64"
+//
+// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
+// RUN: --gcc-toolchain=%S/Inputs/basic_cross_linux_tree/usr \
+// RUN: --target=x86_64-unknown-linux-gnu -m32 \
+// RUN: | FileCheck --check-prefix=CHECK-I386 %s
+//
+// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
+// RUN: --gcc-toolchain=%S/Inputs/basic_cross_linux_tree/usr \
+// RUN: --target=i386-unknown-linux-gnu -m64 \
+// RUN: | FileCheck --check-prefix=CHECK-X86-64 %s
+//
+// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_32bit_linux_tree/usr \
+// RUN: --target=i386-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-MULTI32-I386 %s
+// CHECK-MULTI32-I386: "-cc1" "-triple" "i386-unknown-linux"
+// CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\}}as" "--32"
+// CHECK-MULTI32-I386: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\}}ld"
+// CHECK-MULTI32-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
+// CHECK-MULTI32-I386: "-m" "elf_i386"
+// CHECK-MULTI32-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o"
+// CHECK-MULTI32-I386: "-L[[gcc_install]]"
+// CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib32"
+// CHECK-MULTI32-I386: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib"
+// CHECK-MULTI32-I386: "-L[[sysroot]]/lib"
+// CHECK-MULTI32-I386: "-L[[sysroot]]/usr/lib"
+//
+// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_32bit_linux_tree/usr \
+// RUN: --target=x86_64-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-MULTI32-X86-64 %s
+// CHECK-MULTI32-X86-64: "-cc1" "-triple" "x86_64-unknown-linux"
+// CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\}}as" "--64"
+// CHECK-MULTI32-X86-64: "{{.*}}/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/bin{{/|\\}}ld"
+// CHECK-MULTI32-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
+// CHECK-MULTI32-X86-64: "-m" "elf_x86_64"
+// CHECK-MULTI32-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_32bit_linux_tree/usr/lib/gcc/i386-unknown-linux/4.6.0]]/64{{/|\\\\}}crtbegin.o"
+// CHECK-MULTI32-X86-64: "-L[[gcc_install]]/64"
+// CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib/../lib64"
+// CHECK-MULTI32-X86-64: "-L[[gcc_install]]"
+// CHECK-MULTI32-X86-64: "-L[[gcc_install]]/../../../../i386-unknown-linux/lib"
+// CHECK-MULTI32-X86-64: "-L[[sysroot]]/lib"
+// CHECK-MULTI32-X86-64: "-L[[sysroot]]/usr/lib"
+//
+// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \
+// RUN: --target=i386-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-MULTI64-I386 %s
+// CHECK-MULTI64-I386: "-cc1" "-triple" "i386-unknown-linux"
+// CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\}}as" "--32"
+// CHECK-MULTI64-I386: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\}}ld"
+// CHECK-MULTI64-I386: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
+// CHECK-MULTI64-I386: "-m" "elf_i386"
+// CHECK-MULTI64-I386: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]/32{{/|\\\\}}crtbegin.o"
+// CHECK-MULTI64-I386: "-L[[gcc_install]]/32"
+// CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib32"
+// CHECK-MULTI64-I386: "-L[[gcc_install]]"
+// CHECK-MULTI64-I386: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib"
+// CHECK-MULTI64-I386: "-L[[sysroot]]/lib"
+// CHECK-MULTI64-I386: "-L[[sysroot]]/usr/lib"
+//
+// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \
+// RUN: --target=x86_64-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-MULTI64-X86-64 %s
+// CHECK-MULTI64-X86-64: "-cc1" "-triple" "x86_64-unknown-linux"
+// CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\}}as" "--64"
+// CHECK-MULTI64-X86-64: "{{.*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/bin{{/|\\}}ld"
+// CHECK-MULTI64-X86-64: "--sysroot=[[sysroot:.*/Inputs/basic_linux_tree]]"
+// CHECK-MULTI64-X86-64: "-m" "elf_x86_64"
+// CHECK-MULTI64-X86-64: "crti.o" "[[gcc_install:.*/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0]]{{/|\\\\}}crtbegin.o"
+// CHECK-MULTI64-X86-64: "-L[[gcc_install]]"
+// CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib/../lib64"
+// CHECK-MULTI64-X86-64: "-L[[gcc_install]]/../../../../x86_64-unknown-linux/lib"
+// CHECK-MULTI64-X86-64: "-L[[sysroot]]/lib"
+// CHECK-MULTI64-X86-64: "-L[[sysroot]]/usr/lib"
diff --git a/test/Driver/darwin-as.c b/test/Driver/darwin-as.c
index 92c76414a72b..58c850eb9b45 100644
--- a/test/Driver/darwin-as.c
+++ b/test/Driver/darwin-as.c
@@ -1,17 +1,17 @@
// RUN: %clang -target i386-apple-darwin10 -### -x assembler -c %s \
// RUN: -no-integrated-as -static -dynamic 2>%t
-// RUN: FileCheck -check-prefix=STATIC_AND_DYNAMIC-32 --input-file %t %s
+// RUN: FileCheck -check-prefix=CHECK-STATIC_AND_DYNAMIC-32 --input-file %t %s
//
-// CHECK-STATIC_AND_DYNAMIC-32: as{{(.exe)?}}" "-arch" "i386" "-force_cpusubtype_ALL" "-static" "-o"
+// CHECK-STATIC_AND_DYNAMIC-32: as{{(.exe)?}}" "-Q" "-arch" "i386" "-force_cpusubtype_ALL" "-static" "-o"
// RUN: %clang -target x86_64-apple-darwin10 -### -x assembler -c %s \
// RUN: -no-integrated-as -static 2>%t
-// RUN: FileCheck -check-prefix=STATIC-64 --input-file %t %s
+// RUN: FileCheck -check-prefix=CHECK-STATIC-64 --input-file %t %s
//
-// CHECK-STATIC-64: as{{(.exe)?}}" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o"
+// CHECK-STATIC-64: as{{(.exe)?}}" "-Q" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o"
// RUN: %clang -target x86_64-apple-darwin10 -### \
// RUN: -arch armv6 -no-integrated-as -x assembler -c %s 2>%t
-// RUN: FileCheck -check-prefix=ARMV6 --input-file %t %s
+// RUN: FileCheck -check-prefix=CHECK-ARMV6 --input-file %t %s
//
-// CHECK-ARMV6: as{{(.exe)?}}" "-arch" "armv6" "-o"
+// CHECK-ARMV6: as{{(.exe)?}}" "-Q" "-arch" "armv6" "-o"
diff --git a/test/Driver/darwin-dsymutil.c b/test/Driver/darwin-dsymutil.c
index 440986639a0a..b8c3083c9353 100644
--- a/test/Driver/darwin-dsymutil.c
+++ b/test/Driver/darwin-dsymutil.c
@@ -35,7 +35,7 @@
// RUN: touch %t.o
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: -o foo %t.o -g 2> %t
-// RUN: grep "Dsymutil" %t | count 0
+// RUN: not grep "Dsymutil" %t
// Check that we put the .dSYM in the right place.
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
diff --git a/test/Driver/darwin-eabi.c b/test/Driver/darwin-eabi.c
new file mode 100644
index 000000000000..1288fa40608c
--- /dev/null
+++ b/test/Driver/darwin-eabi.c
@@ -0,0 +1,12 @@
+// RUN: %clang -arch armv7 -target thumbv7-apple-darwin-eabi -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-AAPCS
+// RUN: %clang -arch armv7s -target thumbv7-apple-ios -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-APCS
+// RUN: %clang -arch armv7s -target thumbv7-apple-darwin -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-APCS
+// RUN: %clang -arch armv6m -target thumbv7-apple-darwin -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-DARWIN-EABI
+// RUN: %clang -arch armv7m -target thumbv7-apple-darwin -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-DARWIN-EABI
+// RUN: %clang -arch armv7em -target thumbv7-apple-darwin -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-DARWIN-EABI
+
+// CHECK-DARWIN-EABI: "-triple" "{{thumbv[67]e?m}}-apple-darwin-eabi"
+// CHECK-IOS: "-triple" "thumbv7" "thumbv7-apple-ios
+
+// CHECK-AAPCS: "-target-abi" "aapcs"
+// CHECK-APCS: "-target-abi" "apcs-gnu"
diff --git a/test/Driver/darwin-ld.c b/test/Driver/darwin-ld.c
index cd511e034f13..d6c5170496ba 100644
--- a/test/Driver/darwin-ld.c
+++ b/test/Driver/darwin-ld.c
@@ -130,3 +130,17 @@
// RUN: FileCheck -check-prefix=LINK_PG %s < %t.log
// LINK_PG: -lgcrt1.o
// LINK_PG: -no_new_main
+
+// RUN: %clang -target x86_64-apple-darwin12 -rdynamic -### %t.o \
+// RUN: -mlinker-version=100 2> %t.log
+// RUN: FileCheck -check-prefix=LINK_NO_EXPORT_DYNAMIC %s < %t.log
+// LINK_NO_EXPORT_DYNAMIC: {{ld(.exe)?"}}
+// LINK_NO_EXPORT_DYNAMIC-NOT: "-export_dynamic"
+
+// RUN: %clang -target x86_64-apple-darwin12 -rdynamic -### %t.o \
+// RUN: -mlinker-version=137 2> %t.log
+// RUN: FileCheck -check-prefix=LINK_EXPORT_DYNAMIC %s < %t.log
+// LINK_EXPORT_DYNAMIC: {{ld(.exe)?"}}
+// LINK_EXPORT_DYNAMIC: "-export_dynamic"
+
+
diff --git a/test/Driver/darwin-objc-defaults.m b/test/Driver/darwin-objc-defaults.m
index 6265cfb41f10..1742deb1b12e 100644
--- a/test/Driver/darwin-objc-defaults.m
+++ b/test/Driver/darwin-objc-defaults.m
@@ -4,7 +4,7 @@
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch i386 -mmacosx-version-min=10.5 2> %t
-// RUN: FileCheck --check-prefix CHECK-I386_OSX10_5 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-I386_OSX10_5 < %t %s
// CHECK-CHECK-I386_OSX10_5: "-cc1"
// CHECK-CHECK-I386_OSX10_5: -fobjc-runtime=macosx-fragile-10.5
@@ -13,7 +13,7 @@
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch i386 -mmacosx-version-min=10.6 2> %t
-// RUN: FileCheck --check-prefix CHECK-I386_OSX10_6 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-I386_OSX10_6 < %t %s
// CHECK-CHECK-I386_OSX10_6: "-cc1"
// CHECK-CHECK-I386_OSX10_6: -fobjc-runtime=macosx-fragile-10.6
@@ -22,7 +22,7 @@
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch i386 -miphoneos-version-min=3.0 2> %t
-// RUN: FileCheck --check-prefix CHECK-I386_IPHONE3_0 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-I386_IPHONE3_0 < %t %s
// CHECK-CHECK-I386_IPHONE3_0: "-cc1"
// CHECK-CHECK-I386_IPHONE3_0: -fobjc-runtime=ios-3.0
@@ -33,36 +33,33 @@
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch x86_64 -mmacosx-version-min=10.5 2> %t
-// RUN: FileCheck --check-prefix CHECK-X86_64_OSX10_5 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-X86_64_OSX10_5 < %t %s
// CHECK-CHECK-X86_64_OSX10_5: "-cc1"
// CHECK-CHECK-X86_64_OSX10_5: -fobjc-runtime=macosx-10.5
-// CHECK-CHECK-X86_64_OSX10_5: -fobjc-dispatch-method=non-legacy
// CHECK-CHECK-X86_64_OSX10_5: darwin-objc-defaults
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch x86_64 -mmacosx-version-min=10.6 2> %t
-// RUN: FileCheck --check-prefix CHECK-X86_64_OSX10_6 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-X86_64_OSX10_6 < %t %s
// CHECK-CHECK-X86_64_OSX10_6: "-cc1"
// CHECK-CHECK-X86_64_OSX10_6: -fobjc-runtime=macosx-10.6
-// CHECK-CHECK-X86_64_OSX10_6: -fobjc-dispatch-method=mixed
// CHECK-CHECK-X86_64_OSX10_6: darwin-objc-defaults
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch x86_64 -miphoneos-version-min=3.0 2> %t
-// RUN: FileCheck --check-prefix CHECK-X86_64_IPHONE3_0 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-X86_64_IPHONE3_0 < %t %s
// CHECK-CHECK-X86_64_IPHONE3_0: "-cc1"
// CHECK-CHECK-X86_64_IPHONE3_0: -fobjc-runtime=ios-3.0
-// CHECK-CHECK-X86_64_IPHONE3_0: -fobjc-dispatch-method=mixed
// CHECK-CHECK-X86_64_IPHONE3_0: darwin-objc-defaults
// armv7
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch armv7 -mmacosx-version-min=10.5 2> %t
-// RUN: FileCheck --check-prefix CHECK-ARMV7_OSX10_5 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-ARMV7_OSX10_5 < %t %s
// CHECK-CHECK-ARMV7_OSX10_5: "-cc1"
// CHECK-CHECK-ARMV7_OSX10_5: -fobjc-runtime=macosx-10.5
@@ -71,7 +68,7 @@
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch armv7 -mmacosx-version-min=10.6 2> %t
-// RUN: FileCheck --check-prefix CHECK-ARMV7_OSX10_6 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-ARMV7_OSX10_6 < %t %s
// CHECK-CHECK-ARMV7_OSX10_6: "-cc1"
// CHECK-CHECK-ARMV7_OSX10_6: -fobjc-runtime=macosx-10.6
@@ -80,7 +77,7 @@
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch armv7 -miphoneos-version-min=3.0 2> %t
-// RUN: FileCheck --check-prefix CHECK-ARMV7_IPHONE3_0 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-ARMV7_IPHONE3_0 < %t %s
// CHECK-CHECK-ARMV7_IPHONE3_0: "-cc1"
// CHECK-CHECK-ARMV7_IPHONE3_0: -fobjc-runtime=ios-3.0
diff --git a/test/Driver/darwin-objc-options.m b/test/Driver/darwin-objc-options.m
index 77501ab1b914..a90a12d733d6 100644
--- a/test/Driver/darwin-objc-options.m
+++ b/test/Driver/darwin-objc-options.m
@@ -2,7 +2,7 @@
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch x86_64 -fobjc-abi-version=1 2> %t
-// RUN: FileCheck --check-prefix CHECK-X86_64_ABI1 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-X86_64_ABI1 < %t %s
// CHECK-CHECK-X86_64_ABI1: "-cc1"
// CHECK-CHECK-X86_64_ABI1: -fobjc-runtime=macosx-fragile-10.6.0
@@ -11,7 +11,7 @@
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch i386 -fobjc-abi-version=2 2> %t
-// RUN: FileCheck --check-prefix CHECK-I386_ABI2 < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-I386_ABI2 < %t %s
// CHECK-CHECK-I386_ABI2: "-cc1"
// CHECK-CHECK-I386_ABI2: -fobjc-runtime=macosx-10.6.0
@@ -22,7 +22,7 @@
// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch i386 -fobjc-runtime=ios-5.0 2> %t
-// RUN: FileCheck --check-prefix CHECK-I386_IOS < %t %s
+// RUN: FileCheck --check-prefix CHECK-CHECK-I386_IOS < %t %s
// CHECK-CHECK-I386_IOS: "-cc1"
// CHECK-CHECK-I386_IOS: -fobjc-runtime=ios-5.0
diff --git a/test/Driver/darwin-sanitizer-ld.c b/test/Driver/darwin-sanitizer-ld.c
index 98b37e96fe2e..85cfb73c4a34 100644
--- a/test/Driver/darwin-sanitizer-ld.c
+++ b/test/Driver/darwin-sanitizer-ld.c
@@ -5,8 +5,16 @@
// RUN: | FileCheck --check-prefix=CHECK-ASAN %s
// CHECK-ASAN: "{{.*}}ld{{(.exe)?}}"
-// CHECK-ASAN: libclang_rt.asan_osx_dynamic.dylib"
// CHECK-ASAN: stdc++
+// CHECK-ASAN: libclang_rt.asan_osx_dynamic.dylib"
+
+// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
+// RUN: -fsanitize=address -mios-simulator-version-min=7.0 %s -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ASAN-IOSSIM %s
+
+// CHECK-ASAN-IOSSIM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-ASAN-IOSSIM: lc++
+// CHECK-ASAN-IOSSIM: libclang_rt.asan_iossim_dynamic.dylib"
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: -fPIC -shared -fsanitize=address %s -o %t.so 2>&1 \
@@ -14,10 +22,7 @@
// CHECK-DYN-ASAN: "{{.*}}ld{{(.exe)?}}"
// CHECK-DYN-ASAN: "-dylib"
-// CHECK-DYN-ASAN-NOT: libclang_rt.asan_osx_dynamic.dylib
-// CHECK-DYN-ASAN: "-undefined"
-// CHECK-DYN-ASAN: "dynamic_lookup"
-// CHECK-DYN-ASAN-NOT: libclang_rt.asan_osx_dynamic.dylib
+// CHECK-DYN-ASAN: libclang_rt.asan_osx_dynamic.dylib
// RUN: %clang -no-canonical-prefixes -### -target x86_64-darwin \
// RUN: -fsanitize=undefined %s -o %t.o 2>&1 \
diff --git a/test/Driver/darwin-verify-debug.c b/test/Driver/darwin-verify-debug.c
index 677419a20c5b..c419cef589d1 100644
--- a/test/Driver/darwin-verify-debug.c
+++ b/test/Driver/darwin-verify-debug.c
@@ -31,4 +31,4 @@
// RUN: touch %t.o
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: -verify -o foo %t.o -g 2> %t
-// RUN: grep "Verify" %t | count 0
+// RUN: not grep "Verify" %t
diff --git a/test/Driver/debug-main-file.S b/test/Driver/debug-main-file.S
index 8c154a32df17..9127df09f3f3 100644
--- a/test/Driver/debug-main-file.S
+++ b/test/Driver/debug-main-file.S
@@ -1,4 +1,3 @@
-// REQUIRES: clang-driver
// RUN: %clang -### -c -save-temps -integrated-as -g %s 2>&1 \
// RUN: | FileCheck %s
diff --git a/test/Driver/debug-options-as.c b/test/Driver/debug-options-as.c
index 0b639b2959cb..74a544c1c4b0 100644
--- a/test/Driver/debug-options-as.c
+++ b/test/Driver/debug-options-as.c
@@ -1,6 +1,3 @@
-// cygming have not supported integrated-as yet.
-// REQUIRES: clang-driver
-//
// Check to make sure clang is somewhat picky about -g options.
// (Delived from debug-options.c)
// rdar://10383444
diff --git a/test/Driver/debug-options.c b/test/Driver/debug-options.c
index ca77abf9fd30..1f890b2e67f4 100644
--- a/test/Driver/debug-options.c
+++ b/test/Driver/debug-options.c
@@ -1,13 +1,33 @@
// Check to make sure clang is somewhat picky about -g options.
// rdar://10383444
-// RUN: %clang -### -c -g %s 2>&1 | FileCheck -check-prefix=G %s
-// RUN: %clang -### -c -g2 %s 2>&1 | FileCheck -check-prefix=G %s
-// RUN: %clang -### -c -g3 %s 2>&1 | FileCheck -check-prefix=G %s
-// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=G %s
-// RUN: %clang -### -c -ggdb1 %s 2>&1 | FileCheck -check-prefix=G %s
-// RUN: %clang -### -c -ggdb3 %s 2>&1 | FileCheck -check-prefix=G %s
-// RUN: %clang -### -c -gdwarf-2 %s 2>&1 | FileCheck -check-prefix=G %s
+// RUN: %clang -### -c -g %s -target x86_64-linux-gnu 2>&1 \
+ | FileCheck -check-prefix=G %s
+// RUN: %clang -### -c -g2 %s -target x86_64-linux-gnu 2>&1 \
+ | FileCheck -check-prefix=G %s
+// RUN: %clang -### -c -g3 %s -target x86_64-linux-gnu 2>&1 \
+ | FileCheck -check-prefix=G %s
+// RUN: %clang -### -c -ggdb %s -target x86_64-linux-gnu 2>&1 \
+ | FileCheck -check-prefix=G %s
+// RUN: %clang -### -c -ggdb1 %s -target x86_64-linux-gnu 2>&1 \
+ | FileCheck -check-prefix=G %s
+// RUN: %clang -### -c -ggdb3 %s -target x86_64-linux-gnu 2>&1 \
+ | FileCheck -check-prefix=G %s
+
+// RUN: %clang -### -c -g %s -target x86_64-apple-darwin 2>&1 \
+ | FileCheck -check-prefix=G_DARWIN %s
+// RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin 2>&1 \
+ | FileCheck -check-prefix=G_DARWIN %s
+// RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin 2>&1 \
+ | FileCheck -check-prefix=G_DARWIN %s
+// RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin 2>&1 \
+ | FileCheck -check-prefix=G_DARWIN %s
+// RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin 2>&1 \
+ | FileCheck -check-prefix=G_DARWIN %s
+// RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin 2>&1 \
+ | FileCheck -check-prefix=G_DARWIN %s
+
+// RUN: %clang -### -c -gdwarf-2 %s 2>&1 | FileCheck -check-prefix=G_D2 %s
//
// RUN: %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_NO %s
// RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
@@ -15,18 +35,29 @@
//
// RUN: %clang -### -c -gline-tables-only %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
-// RUN: %clang -### -c -gline-tables-only -g %s 2>&1 \
+// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \
// RUN: | FileCheck -check-prefix=G_ONLY %s
+// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin 2>&1 \
+// RUN: | FileCheck -check-prefix=G_ONLY_DARWIN %s
// RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_NO %s
//
// RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches \
-// RUN: -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \
-// RUN: | not grep "argument unused during compilation"
+// RUN: -gstrict-dwarf -gno-strict-dwarf -fdebug-types-section \
+// RUN: -fno-debug-types-section %s 2>&1 \
+// RUN: | FileCheck -check-prefix=GIGNORE %s
+//
+// RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GOPT %s
//
// G: "-cc1"
// G: "-g"
//
+// G_DARWIN: "-cc1"
+// G_DARWIN: "-gdwarf-2"
+//
+// G_D2: "-cc1"
+// G_D2: "-gdwarf-2"
+//
// G_NO: "-cc1"
// G_NO-NOT: "-g"
//
@@ -40,5 +71,14 @@
// G_ONLY: "-g"
// G_ONLY-NOT: "-gline-tables-only"
//
+// G_ONLY_DARWIN: "-cc1"
+// G_ONLY_DARWIN-NOT: "-gline-tables-only"
+// G_ONLY_DARWIN: "-gdwarf-2"
+// G_ONLY_DARWIN-NOT: "-gline-tables-only"
+//
// GLTO_NO: "-cc1"
// GLTO_NO-NOT: "-gline-tables-only"
+//
+// GIGNORE-NOT: "argument unused during compilation"
+//
+// GOPT: -generate-gnu-dwarf-pub-sections
diff --git a/test/Driver/debug-unsupported.c b/test/Driver/debug-unsupported.c
index acbd7673a321..1804a9cc51b5 100644
--- a/test/Driver/debug-unsupported.c
+++ b/test/Driver/debug-unsupported.c
@@ -1,13 +1,13 @@
-// RUN: %clang -c -gstabs %s 2>&1 | FileCheck %s
-// RUN: %clang -c -gstabs+ %s 2>&1 | FileCheck %s
-// RUN: %clang -c -gcoff %s 2>&1 | FileCheck %s
-// RUN: %clang -c -gxcoff %s 2>&1 | FileCheck %s
-// RUN: %clang -c -gxcoff+ %s 2>&1 | FileCheck %s
-// RUN: %clang -c -gvms %s 2>&1 | FileCheck %s
-// RUN: %clang -c -gstabs1 %s 2>&1 | FileCheck %s
-// RUN: %clang -c -gcoff2 %s 2>&1 | FileCheck %s
-// RUN: %clang -c -gxcoff3 %s 2>&1 | FileCheck %s
-// RUN: %clang -c -gvms0 %s 2>&1 | FileCheck %s
-// RUN: %clang -c -gtoggle %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gstabs %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gstabs+ %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gcoff %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gxcoff %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gxcoff+ %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gvms %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gstabs1 %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gcoff2 %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gxcoff3 %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gvms0 %s 2>&1 | FileCheck %s
+// RUN: not %clang -c -gtoggle %s 2>&1 | FileCheck %s
//
// CHECK: error: unsupported option
diff --git a/test/Driver/dyld-prefix.c b/test/Driver/dyld-prefix.c
new file mode 100644
index 000000000000..317d64449da6
--- /dev/null
+++ b/test/Driver/dyld-prefix.c
@@ -0,0 +1,9 @@
+// REQUIRES: shell-preserves-root
+
+// RUN: touch %t.o
+
+// RUN: %clang -target i386-unknown-linux --dyld-prefix /foo -### %t.o 2>&1 | FileCheck --check-prefix=CHECK-32 %s
+// CHECK-32: "-dynamic-linker" "/foo/lib/ld-linux.so.2"
+
+// RUN: %clang -target x86_64-unknown-linux --dyld-prefix /foo -### %t.o 2>&1 | FileCheck --check-prefix=CHECK-64 %s
+// CHECK-64: "-dynamic-linker" "/foo/lib64/ld-linux-x86-64.so.2"
diff --git a/test/Driver/emit-llvm.c b/test/Driver/emit-llvm.c
deleted file mode 100644
index 76ea05926c96..000000000000
--- a/test/Driver/emit-llvm.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// Check that -O4 is only honored as the effective -O option.
-// <rdar://problem/7046672> clang/loader problem
-
-// RUN: %clang -ccc-print-phases -c -O4 -O0 %s 2> %t
-// RUN: FileCheck --check-prefix=O4_AND_O0 %s < %t
-
-// O4_AND_O0: 0: input, "{{.*}}", c
-// O4_AND_O0: 1: preprocessor, {0}, cpp-output
-// O4_AND_O0: 2: compiler, {1}, assembler
-// O4_AND_O0: 3: assembler, {2}, object
diff --git a/test/Driver/fast-math.c b/test/Driver/fast-math.c
index 91af2e1dce45..eba25c8fe85e 100644
--- a/test/Driver/fast-math.c
+++ b/test/Driver/fast-math.c
@@ -42,18 +42,14 @@
// CHECK-MATH-ERRNO: "-cc1"
// CHECK-MATH-ERRNO: "-fmath-errno"
//
-// RUN: %clang -### -fno-fast-math -fmath-errno -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-MATH-ERRNO %s
-// CHECK-NO-FAST-MATH-MATH-ERRNO: "-cc1"
-// CHECK-NO-FAST-MATH-MATH-ERRNO: "-fmath-errno"
-//
-// RUN: %clang -### -fmath-errno -fno-fast-math -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO-NO-FAST-MATH %s
-// CHECK-MATH-ERRNO-NO-FAST-MATH: "-cc1"
-// CHECK-MATH-ERRNO-NO-FAST-MATH-NOT: "-fmath-errno"
-//
// RUN: %clang -### -fmath-errno -fno-math-errno -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
+// CHECK-NO-MATH-ERRNO: "-cc1"
+// CHECK-NO-MATH-ERRNO-NOT: "-fmath-errno"
+//
+// Target defaults for -fmath-errno (reusing the above checks).
+// RUN: %clang -### -target i686-unknown-linux -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
// RUN: %clang -### -target i686-apple-darwin -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
// RUN: %clang -### -target x86_64-unknown-freebsd -c %s 2>&1 \
@@ -64,8 +60,26 @@
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
// RUN: %clang -### -target x86_64-unknown-dragonfly -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
-// CHECK-NO-MATH-ERRNO: "-cc1"
-// CHECK-NO-MATH-ERRNO-NOT: "-fmath-errno"
+//
+// Check that -ffast-math disables -fmath-errno, and -fno-fast-math merely
+// preserves the target default. Also check various flag set operations between
+// the two flags. (Resuses above checks.)
+// RUN: %clang -### -ffast-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
+// RUN: %clang -### -fmath-errno -ffast-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
+// RUN: %clang -### -ffast-math -fmath-errno -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
+// RUN: %clang -### -target i686-unknown-linux -fno-fast-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
+// RUN: %clang -### -target i686-unknown-linux -fno-math-errno -fno-fast-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
+// RUN: %clang -### -target i686-apple-darwin -fno-fast-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
+// RUN: %clang -### -target i686-apple-darwin -fno-math-errno -fno-fast-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
+// RUN: %clang -### -fno-fast-math -fno-math-errno -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
//
// RUN: %clang -### -fno-math-errno -fassociative-math -freciprocal-math \
// RUN: -fno-signed-zeros -fno-trapping-math -c %s 2>&1 \
diff --git a/test/Driver/fpack-struct.c b/test/Driver/fpack-struct.c
index cc75da5bc0f8..da98ae948b7b 100644
--- a/test/Driver/fpack-struct.c
+++ b/test/Driver/fpack-struct.c
@@ -1,7 +1,7 @@
// RUN: %clang -fpack-struct -### %s 2> %t
// RUN: FileCheck < %t %s
// RUN: %clang -fpack-struct=8 -### %s 2> %t
-// RUN: FileCheck < %t %s --check-prefix=EQ
+// RUN: FileCheck < %t %s --check-prefix=CHECK-EQ
// CHECK: "-cc1"
// CHECK: "-fpack-struct=1"
diff --git a/test/Driver/frame-pointer.c b/test/Driver/frame-pointer.c
index 6be395c59880..1d63f2c42920 100644
--- a/test/Driver/frame-pointer.c
+++ b/test/Driver/frame-pointer.c
@@ -11,6 +11,20 @@
// RUN: %clang -target x86_64-pc-linux -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK3-64 %s
// RUN: %clang -target x86_64-pc-linux -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-64 %s
+// Trust the above to get the optimizations right, and just test other targets
+// that want this by default.
+// RUN: %clang -target s390x-pc-linux -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-64 %s
+// RUN: %clang -target s390x-pc-linux -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-64 %s
+
+// RUN: %clang -target mips-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target mips-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s
+// RUN: %clang -target mipsel-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target mipsel-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s
+// RUN: %clang -target mips64-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target mips64-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s
+// RUN: %clang -target mips64el-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target mips64el-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s
+
// CHECK0-32: -mdisable-fp-elim
// CHECK1-32-NOT: -mdisable-fp-elim
// CHECK2-32-NOT: -mdisable-fp-elim
diff --git a/test/Driver/freebsd.c b/test/Driver/freebsd.c
index cc7244396176..d1d9ea8a5106 100644
--- a/test/Driver/freebsd.c
+++ b/test/Driver/freebsd.c
@@ -107,3 +107,7 @@
// CHECK-ARM-EABI-NOT: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions"
// CHECK-ARM-EABI: as{{.*}}" "-mfpu=softvfp" "-meabi=5"
// CHECK-ARM-EABI-NOT: as{{.*}}" "-matpcs"
+
+// RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto -o %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-LTO %s
+// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so
diff --git a/test/Driver/freebsd.cc b/test/Driver/freebsd.cc
new file mode 100644
index 000000000000..dea3267233cc
--- /dev/null
+++ b/test/Driver/freebsd.cc
@@ -0,0 +1,6 @@
+// RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd10.0 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-TEN %s
+// RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd9.2 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NINE %s
+// CHECK-TEN: -lc++
+// CHECK-NINE: -lstdc++
diff --git a/test/Driver/fsanitize-blacklist.c b/test/Driver/fsanitize-blacklist.c
index 5327bc16a340..690bc877952a 100644
--- a/test/Driver/fsanitize-blacklist.c
+++ b/test/Driver/fsanitize-blacklist.c
@@ -1,18 +1,26 @@
// General blacklist usage.
-// RUN: %clang -fsanitize=address -fsanitize-blacklist=%s %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST
+
+// PR12920
+// REQUIRES: clang-driver, shell
+
+// RUN: echo "fun:foo" > %t.good
+// RUN: echo "badline" > %t.bad
+
+// RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST
// CHECK-BLACKLIST: -fsanitize-blacklist
// Ignore -fsanitize-blacklist flag if there is no -fsanitize flag.
-// RUN: %clang -fsanitize-blacklist=%s %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE
+// RUN: %clang -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE
// CHECK-NO-SANITIZE-NOT: -fsanitize-blacklist
// Flag -fno-sanitize-blacklist wins if it is specified later.
-// RUN: %clang -fsanitize=address -fsanitize-blacklist=%s -fno-sanitize-blacklist %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-BLACKLIST
+// RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-BLACKLIST
// CHECK-NO-BLACKLIST-NOT: -fsanitize-blacklist
// Driver barks on unexisting blacklist files.
// RUN: %clang -fno-sanitize-blacklist -fsanitize-blacklist=unexisting.txt %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SUCH-FILE
// CHECK-NO-SUCH-FILE: error: no such file or directory: 'unexisting.txt'
-// PR12920
-// REQUIRES: clang-driver
+// Driver properly reports malformed blacklist files.
+// RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.bad %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BAD-BLACKLIST
+// CHECK-BAD-BLACKLIST: error: malformed sanitizer blacklist
diff --git a/test/Driver/fsanitize.c b/test/Driver/fsanitize.c
index 0e7522b54837..2d079236f574 100644
--- a/test/Driver/fsanitize.c
+++ b/test/Driver/fsanitize.c
@@ -1,27 +1,33 @@
// RUN: %clang -target x86_64-linux-gnu -fcatch-undefined-behavior %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP
// RUN: %clang -target x86_64-linux-gnu -fsanitize-undefined-trap-on-error -fsanitize=undefined-trap %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP
-// CHECK-UNDEFINED-TRAP: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|bounds|enum|bool),?){14}"}}
+// CHECK-UNDEFINED-TRAP: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool),?){14}"}}
// CHECK-UNDEFINED-TRAP: "-fsanitize-undefined-trap-on-error"
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED
-// CHECK-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|bounds|enum|bool),?){15}"}}
+// CHECK-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool),?){16}"}}
+
+// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-DARWIN
+// CHECK-UNDEFINED-DARWIN: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool),?){15}"}}
// RUN: %clang -target x86_64-linux-gnu -fsanitize=integer %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-INTEGER
// CHECK-INTEGER: "-fsanitize={{((signed-integer-overflow|unsigned-integer-overflow|integer-divide-by-zero|shift),?){4}"}}
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,undefined -fno-thread-sanitizer -fno-sanitize=float-cast-overflow,vptr,bool,enum %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-UNDEFINED
-// CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|object-size|bounds),?){11}"}}
+// CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|unreachable|return|vla-bound|alignment|null|object-size|array-bounds),?){12}"}}
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address-full %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FULL
// CHECK-ASAN-FULL: "-fsanitize={{((address|init-order|use-after-return|use-after-scope),?){4}"}}
-// RUN: %clang -target x86_64-linux-gnu -fno-sanitize=init-order -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-IMPLIED-INIT-ORDER
-// CHECK-ASAN-IMPLIED-INIT-ORDER: "-fsanitize={{((address|init-order),?){2}"}}
+// RUN: %clang -target x86_64-linux-gnu -fno-sanitize=init-order,use-after-return -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-IMPLIED-INIT-ORDER-UAR
+// CHECK-ASAN-IMPLIED-INIT-ORDER-UAR: "-fsanitize={{((address|init-order|use-after-return),?){3}"}}
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fno-sanitize=init-order %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-NO-IMPLIED-INIT-ORDER
// CHECK-ASAN-NO-IMPLIED-INIT-ORDER-NOT: init-order
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fno-sanitize=use-after-return %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-NO-IMPLIED-UAR
+// CHECK-ASAN-NO-IMPLIED-UAR-NOT: use-after-return
+
// RUN: %clang -target x86_64-linux-gnu -fcatch-undefined-behavior -fno-sanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-NO-TRAP-ERROR
// CHECK-UNDEFINED-NO-TRAP-ERROR: '-fcatch-undefined-behavior' not allowed with '-fno-sanitize-undefined-trap-on-error'
@@ -50,6 +56,12 @@
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANM-SANT
// CHECK-SANM-SANT: '-fsanitize=thread' not allowed with '-fsanitize=memory'
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANT
+// CHECK-SANL-SANT: '-fsanitize=leak' not allowed with '-fsanitize=thread'
+
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANM
+// CHECK-SANL-SANM: '-fsanitize=leak' not allowed with '-fsanitize=memory'
+
// RUN: %clang -target x86_64-linux-gnu -faddress-sanitizer -fthread-sanitizer -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-TSAN
// CHECK-ASAN-TSAN: '-faddress-sanitizer' not allowed with '-fthread-sanitizer'
@@ -87,12 +99,12 @@
// OK
// RUN: %clang -target x86_64-linux-gnu -fcatch-undefined-behavior -fthread-sanitizer -fno-thread-sanitizer -faddress-sanitizer -fno-address-sanitizer -fbounds-checking -### %s 2>&1 | FileCheck %s --check-prefix=CHECK-DEPRECATED
-// CHECK-DEPRECATED: argument '-fcatch-undefined-behavior' is deprecated, use '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error' instead
-// CHECK-DEPRECATED: argument '-fthread-sanitizer' is deprecated, use '-fsanitize=thread' instead
-// CHECK-DEPRECATED: argument '-fno-thread-sanitizer' is deprecated, use '-fno-sanitize=thread' instead
-// CHECK-DEPRECATED: argument '-faddress-sanitizer' is deprecated, use '-fsanitize=address' instead
+// CHECK-DEPRECATED: argument '-fbounds-checking' is deprecated, use '-fsanitize=local-bounds' instead
// CHECK-DEPRECATED: argument '-fno-address-sanitizer' is deprecated, use '-fno-sanitize=address' instead
-// CHECK-DEPRECATED: argument '-fbounds-checking' is deprecated, use '-fsanitize=bounds' instead
+// CHECK-DEPRECATED: argument '-faddress-sanitizer' is deprecated, use '-fsanitize=address' instead
+// CHECK-DEPRECATED: argument '-fno-thread-sanitizer' is deprecated, use '-fno-sanitize=thread' instead
+// CHECK-DEPRECATED: argument '-fthread-sanitizer' is deprecated, use '-fsanitize=thread' instead
+// CHECK-DEPRECATED: argument '-fcatch-undefined-behavior' is deprecated, use '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error' instead
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-NO-PIE
// CHECK-TSAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2"
@@ -114,6 +126,9 @@
// CHECK-ANDROID-ASAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2"
// CHECK-ANDROID-ASAN-NO-PIE: "-pie"
+// RUN: %clang -target arm-linux-androideabi %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-NO-ASAN
+// CHECK-ANDROID-NO-ASAN: "-mrelocation-model" "static"
+
// RUN: %clang -target arm-linux-androideabi -fsanitize=address -fsanitize-address-zero-base-shadow %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-ASAN-ZERO-BASE
// CHECK-ANDROID-ASAN-ZERO-BASE-NOT: argument unused during compilation
@@ -127,3 +142,40 @@
// RUN: %clang -target x86_64-linux-gnu %s -fsanitize-recover -fno-sanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER
// CHECK-RECOVER-NOT: sanitize-recover
// CHECK-NO-RECOVER: "-fno-sanitize-recover"
+
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL
+// CHECK-SANL: "-fsanitize=leak"
+
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,leak -fno-sanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANL-NO-SANA
+// CHECK-SANA-SANL-NO-SANA: "-fsanitize=leak"
+
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN
+// CHECK-MSAN: "-fno-assume-sane-operator-new"
+
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=zzz %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DIAG1
+// CHECK-DIAG1: unsupported argument 'zzz' to option 'fsanitize='
+// CHECK-DIAG1-NOT: unsupported argument 'zzz' to option 'fsanitize='
+
+// RUN: %clang -target i686-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-X86
+// CHECK-MSAN-X86: error: unsupported option '-fsanitize=memory' for target 'i686--linux-gnu'
+
+// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-DARWIN
+// CHECK-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10'
+
+// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fno-sanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NOMSAN-DARWIN
+// CHECK-MSAN-NOMSAN-DARWIN-NOT: unsupported option
+
+// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fsanitize=thread,memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-TSAN-MSAN-DARWIN
+// CHECK-MSAN-TSAN-MSAN-DARWIN: unsupported option '-fsanitize=thread,memory' for target 'x86_64-apple-darwin10'
+// CHECK-MSAN-TSAN-MSAN-DARWIN-NOT: unsupported option
+
+// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=thread,memory -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MSAN-MSAN-DARWIN
+// CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10'
+// CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=thread' for target 'x86_64-apple-darwin10'
+// CHECK-TSAN-MSAN-MSAN-DARWIN-NOT: unsupported option
+
+// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-DARWIN
+// CHECK-FSAN-DARWIN: unsupported option '-fsanitize=function' for target 'x86_64-apple-darwin10'
+
+// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-DARWIN
+// CHECK-FSAN-UBSAN-DARWIN: unsupported option '-fsanitize=function' for target 'x86_64-apple-darwin10'
diff --git a/test/Driver/gcc-toolchain.cpp b/test/Driver/gcc-toolchain.cpp
index e122dac9b97d..aa0e078160ef 100644
--- a/test/Driver/gcc-toolchain.cpp
+++ b/test/Driver/gcc-toolchain.cpp
@@ -1,7 +1,13 @@
// Test that gcc-toolchain option is working correctly
//
// RUN: %clangxx -no-canonical-prefixes %s -### -o %t 2>&1 \
-// RUN: -target i386-unknown-linux \
+// RUN: --target=i386-unknown-linux \
+// RUN: --gcc-toolchain=%S/Inputs/ubuntu_11.04_multiarch_tree/usr \
+// RUN: | FileCheck %s
+//
+// Additionally check that the legacy spelling of the flag works.
+// RUN: %clangxx -no-canonical-prefixes %s -### -o %t 2>&1 \
+// RUN: --target=i386-unknown-linux \
// RUN: -gcc-toolchain %S/Inputs/ubuntu_11.04_multiarch_tree/usr \
// RUN: | FileCheck %s
//
@@ -18,6 +24,6 @@
// the same precise formatting of the path as the '-internal-system' flags
// above, so we just blanket wildcard match the 'crtbegin.o'.
// CHECK: "{{[^"]*}}ld{{(.exe)?}}"
-// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/crtbegin.o"
+// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
// CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5"
// CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.."
diff --git a/test/Driver/gcc-version-debug.c b/test/Driver/gcc-version-debug.c
new file mode 100644
index 000000000000..ff38c2805238
--- /dev/null
+++ b/test/Driver/gcc-version-debug.c
@@ -0,0 +1,6 @@
+// RUN: %clang -v --target=i386-unknown-linux \
+// RUN: --sysroot=%S/Inputs/debian_multiarch_tree 2>&1 | FileCheck %s
+
+// CHECK: Found candidate GCC installation: {{.*}}Inputs{{.}}debian_multiarch_tree{{.}}usr{{.}}lib{{.}}gcc{{.}}i686-linux-gnu{{.}}4.5
+// CHECK-NEXT: Found candidate GCC installation: {{.*}}Inputs{{.}}debian_multiarch_tree{{.}}usr{{.}}lib{{.}}gcc{{.}}x86_64-linux-gnu{{.}}4.5
+// CHECK-NEXT: Selected GCC installation: {{.*}}Inputs{{.}}debian_multiarch_tree{{.}}usr{{.}}lib{{.}}gcc{{.}}i686-linux-gnu{{.}}4.5
diff --git a/test/Driver/gcc_forward.c b/test/Driver/gcc_forward.c
index 8eead214feef..b9933d7fb376 100644
--- a/test/Driver/gcc_forward.c
+++ b/test/Driver/gcc_forward.c
@@ -1,13 +1,44 @@
// Check that we don't try to forward -Xclang or -mlinker-version to GCC.
+// PR12920 -- Check also we may not forward W_Group options to GCC.
//
// RUN: %clang -target powerpc-unknown-unknown \
-// RUN: -c %s \
+// RUN: %s \
+// RUN: -Wall -Wdocumentation \
// RUN: -Xclang foo-bar \
+// RUN: -march=x86_64 \
// RUN: -mlinker-version=10 -### 2> %t
// RUN: FileCheck < %t %s
//
-// CHECK: gcc{{.*}}"
+// clang-cc1
+// CHECK: "-Wall" "-Wdocumentation"
+// CHECK: "-o" "{{[^"]+}}.s"
+//
+// gcc-as
+// CHECK: gcc{{[^"]*}}"
+// CHECK-NOT: "-mlinker-version=10"
+// CHECK-NOT: "-Xclang"
+// CHECK-NOT: "foo-bar"
+// CHECK-NOT: "-Wall"
+// CHECK-NOT: "-Wdocumentation"
+// CHECK: -march
+// CHECK-NOT: "-mlinker-version=10"
+// CHECK-NOT: "-Xclang"
+// CHECK-NOT: "foo-bar"
+// CHECK-NOT: "-Wall"
+// CHECK-NOT: "-Wdocumentation"
+// CHECK: "-o" "{{[^"]+}}.o"
+//
+// gcc-ld
+// CHECK: gcc{{[^"]*}}"
+// CHECK-NOT: "-mlinker-version=10"
+// CHECK-NOT: "-Xclang"
+// CHECK-NOT: "foo-bar"
+// CHECK-NOT: "-Wall"
+// CHECK-NOT: "-Wdocumentation"
+// CHECK: -march
// CHECK-NOT: "-mlinker-version=10"
// CHECK-NOT: "-Xclang"
// CHECK-NOT: "foo-bar"
-// CHECK: gcc_forward
+// CHECK-NOT: "-Wall"
+// CHECK-NOT: "-Wdocumentation"
+// CHECK: "-o" "a.out"
diff --git a/test/Driver/gfortran.f90 b/test/Driver/gfortran.f90
new file mode 100644
index 000000000000..d531f59cd35b
--- /dev/null
+++ b/test/Driver/gfortran.f90
@@ -0,0 +1,244 @@
+! Test that Clang can forward all of the flags which are documented as
+! being supported by gfortran to GCC when falling back to GCC for
+! a fortran input file.
+!
+! RUN: %clang -no-canonical-prefixes -target i386-linux -### %s -o %t 2>&1 \
+! RUN: -Aquestion=answer \
+! RUN: -A-question=answer \
+! RUN: -C \
+! RUN: -CC \
+! RUN: -Dmacro \
+! RUN: -Dmacro=value \
+! RUN: -H \
+! RUN: -Isome/directory \
+! RUN: -Jsome/other/directory \
+! RUN: -P \
+! RUN: -Umacro \
+! RUN: -Waliasing \
+! RUN: -Walign-commons \
+! RUN: -Wall \
+! RUN: -Wampersand \
+! RUN: -Warray-bounds \
+! RUN: -Wc-binding-type \
+! RUN: -Wcharacter-truncation \
+! RUN: -Wconversion \
+! RUN: -Wfunction-elimination \
+! RUN: -Wimplicit-interface \
+! RUN: -Wimplicit-procedure \
+! RUN: -Wintrinsic-shadow \
+! RUN: -Wintrinsics-std \
+! RUN: -Wline-truncation \
+! RUN: -Wreal-q-constant \
+! RUN: -Wrealloc-lhs \
+! RUN: -Wsurprising \
+! RUN: -Wtabs \
+! RUN: -Wtarget-lifetime \
+! RUN: -Wunderflow \
+! RUN: -Wunused-parameter \
+! RUN: -cpp \
+! RUN: -dD \
+! RUN: -dI \
+! RUN: -dM \
+! RUN: -dN \
+! RUN: -dU \
+! RUN: -faggressive-function-elimination \
+! RUN: -falign-commons \
+! RUN: -fall-intrinsics \
+! RUN: -fautomatic \
+! RUN: -fbackslash \
+! RUN: -fbacktrace \
+! RUN: -fblas-matmul-limit=42 \
+! RUN: -fbounds-check \
+! RUN: -fcheck-array-temporaries \
+! RUN: -fcheck=all \
+! RUN: -fcoarray=none \
+! RUN: -fconvert=foobar \
+! RUN: -fcray-pointer \
+! RUN: -fd-lines-as-code \
+! RUN: -fd-lines-as-comments \
+! RUN: -fdefault-double-8 \
+! RUN: -fdefault-integer-8 \
+! RUN: -fdefault-real-8 \
+! RUN: -fdollar-ok \
+! RUN: -fdump-fortran-optimized \
+! RUN: -fdump-fortran-original \
+! RUN: -fdump-parse-tree \
+! RUN: -fexternal-blas \
+! RUN: -ff2c \
+! RUN: -ffixed-form \
+! RUN: -ffixed-line-length-42 \
+! RUN: -ffpe-trap=list \
+! RUN: -ffree-form \
+! RUN: -ffree-line-length-42 \
+! RUN: -ffrontend-optimize \
+! RUN: -fimplicit-none \
+! RUN: -finit-character=n \
+! RUN: -finit-integer=n \
+! RUN: -finit-local-zero \
+! RUN: -finit-logical=false \
+! RUN: -finit-real=zero \
+! RUN: -finteger-4-integer-8 \
+! RUN: -fintrinsic-modules-path \
+! RUN: -fmax-array-constructor=42 \
+! RUN: -fmax-errors=42 \
+! RUN: -fmax-identifier-length \
+! RUN: -fmax-stack-var-size=42 \
+! RUN: -fmax-subrecord-length=42 \
+! RUN: -fmodule-private \
+! RUN: -fopenmp \
+! RUN: -fpack-derived \
+! RUN: -fprotect-parens \
+! RUN: -frange-check \
+! RUN: -freal-4-real-10 \
+! RUN: -freal-4-real-16 \
+! RUN: -freal-4-real-8 \
+! RUN: -freal-8-real-10 \
+! RUN: -freal-8-real-16 \
+! RUN: -freal-8-real-4 \
+! RUN: -frealloc-lhs \
+! RUN: -frecord-marker=42 \
+! RUN: -frecursive \
+! RUN: -frepack-arrays \
+! RUN: -fsecond-underscore \
+! RUN: -fshort-enums \
+! RUN: -fsign-zero \
+! RUN: -fstack-arrays \
+! RUN: -fsyntax-only \
+! RUN: -funderscoring \
+! RUN: -fwhole-file \
+! RUN: -fworking-directory \
+! RUN: -imultilib \
+! RUN: -iprefix \
+! RUN: -iquote \
+! RUN: -isysroot \
+! RUN: -isystem \
+! RUN: -nocpp \
+! RUN: -nostdinc \
+! RUN: -pedantic \
+! RUN: -pedantic-errors \
+! RUN: -static-libgfortran \
+! RUN: -std=f90 \
+! RUN: -undef \
+! RUN: | FileCheck %s
+!
+! FIXME: Several of these shouldn't necessarily be rendered separately
+! when passing to GCC... Hopefully their driver handles this.
+!
+! CHECK: "-Aquestion=answer"
+! CHECK: "-A-question=answer"
+! CHECK: "-C"
+! CHECK: "-CC"
+! CHECK: "-D" "macro"
+! CHECK: "-D" "macro=value"
+! CHECK: "-H"
+! CHECK: "-I" "some/directory"
+! CHECK: "-Jsome/other/directory"
+! CHECK: "-P"
+! CHECK: "-U" "macro"
+! CHECK: "-Waliasing"
+! CHECK: "-Walign-commons"
+! CHECK: "-Wall"
+! CHECK: "-Wampersand"
+! CHECK: "-Warray-bounds"
+! CHECK: "-Wc-binding-type"
+! CHECK: "-Wcharacter-truncation"
+! CHECK: "-Wconversion"
+! CHECK: "-Wfunction-elimination"
+! CHECK: "-Wimplicit-interface"
+! CHECK: "-Wimplicit-procedure"
+! CHECK: "-Wintrinsic-shadow"
+! CHECK: "-Wintrinsics-std"
+! CHECK: "-Wline-truncation"
+! CHECK: "-Wreal-q-constant"
+! CHECK: "-Wrealloc-lhs"
+! CHECK: "-Wsurprising"
+! CHECK: "-Wtabs"
+! CHECK: "-Wtarget-lifetime"
+! CHECK: "-Wunderflow"
+! CHECK: "-Wunused-parameter"
+! CHECK: "-cpp"
+! CHECK: "-dD"
+! CHECK: "-dI"
+! CHECK: "-dM"
+! CHECK: "-dN"
+! CHECK: "-dU"
+! CHECK: "-faggressive-function-elimination"
+! CHECK: "-falign-commons"
+! CHECK: "-fall-intrinsics"
+! CHECK: "-fautomatic"
+! CHECK: "-fbackslash"
+! CHECK: "-fbacktrace"
+! CHECK: "-fblas-matmul-limit=42"
+! CHECK: "-fbounds-check"
+! CHECK: "-fcheck-array-temporaries"
+! CHECK: "-fcheck=all"
+! CHECK: "-fcoarray=none"
+! CHECK: "-fconvert=foobar"
+! CHECK: "-fcray-pointer"
+! CHECK: "-fd-lines-as-code"
+! CHECK: "-fd-lines-as-comments"
+! CHECK: "-fdefault-double-8"
+! CHECK: "-fdefault-integer-8"
+! CHECK: "-fdefault-real-8"
+! CHECK: "-fdollar-ok"
+! CHECK: "-fdump-fortran-optimized"
+! CHECK: "-fdump-fortran-original"
+! CHECK: "-fdump-parse-tree"
+! CHECK: "-fexternal-blas"
+! CHECK: "-ff2c"
+! CHECK: "-ffixed-form"
+! CHECK: "-ffixed-line-length-42"
+! CHECK: "-ffpe-trap=list"
+! CHECK: "-ffree-form"
+! CHECK: "-ffree-line-length-42"
+! CHECK: "-ffrontend-optimize"
+! CHECK: "-fimplicit-none"
+! CHECK: "-finit-character=n"
+! CHECK: "-finit-integer=n"
+! CHECK: "-finit-local-zero"
+! CHECK: "-finit-logical=false"
+! CHECK: "-finit-real=zero"
+! CHECK: "-finteger-4-integer-8"
+! CHECK: "-fintrinsic-modules-path"
+! CHECK: "-fmax-array-constructor=42"
+! CHECK: "-fmax-errors=42"
+! CHECK: "-fmax-identifier-length"
+! CHECK: "-fmax-stack-var-size=42"
+! CHECK: "-fmax-subrecord-length=42"
+! CHECK: "-fmodule-private"
+! CHECK: "-fopenmp"
+! CHECK: "-fpack-derived"
+! CHECK: "-fprotect-parens"
+! CHECK: "-frange-check"
+! CHECK: "-freal-4-real-10"
+! CHECK: "-freal-4-real-16"
+! CHECK: "-freal-4-real-8"
+! CHECK: "-freal-8-real-10"
+! CHECK: "-freal-8-real-16"
+! CHECK: "-freal-8-real-4"
+! CHECK: "-frealloc-lhs"
+! CHECK: "-frecord-marker=42"
+! CHECK: "-frecursive"
+! CHECK: "-frepack-arrays"
+! CHECK: "-fsecond-underscore"
+! CHECK: "-fshort-enums"
+! CHECK: "-fsign-zero"
+! CHECK: "-fstack-arrays"
+! CHECK: "-funderscoring"
+! CHECK: "-fwhole-file"
+! CHECK: "-fworking-directory"
+! CHECK: "-imultilib"
+! CHECK: "-iprefix"
+! CHECK: "-iquote"
+! CHECK: "-isysroot"
+! CHECK: "-isystem"
+! CHECK: "-nocpp"
+! CHECK: "-nostdinc"
+! CHECK: "-pedantic"
+! CHECK: "-pedantic-errors"
+! CHECK: "-static-libgfortran"
+! CHECK: "-std=f90"
+! CHECK: "-undef"
+!
+! Clang understands this one and orders it weirdly.
+! CHECK: "-fsyntax-only"
diff --git a/test/Driver/hexagon-toolchain-elf.c b/test/Driver/hexagon-toolchain-elf.c
index 1a2650d16ebc..f60c61c9c355 100644
--- a/test/Driver/hexagon-toolchain-elf.c
+++ b/test/Driver/hexagon-toolchain-elf.c
@@ -11,17 +11,17 @@
// CHECK001: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK002 %s
-// CHECK002: "-cc1" {{.*}} "-internal-isystem" "[[INSTALL_DIR:.*]]/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0"
+// CHECK002: "-cc1" {{.*}} "-internal-isystem" "[[INSTALL_DIR:.*]]/Inputs/hexagon_tree/qc/bin/../../gnu{{/|\\\\}}hexagon/include/c++/4.4.0"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
// -----------------------------------------------------------------------------
// Test -nostdinc, -nostdlibinc, -nostdinc++
@@ -36,7 +36,7 @@
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
@@ -47,9 +47,9 @@
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -nostdlibinc \
// RUN: %s 2>&1 \
@@ -59,16 +59,16 @@
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -nostdinc++ \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK006 %s
// CHECK006: "-cc1"
// CHECK006-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0"
-// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
// -----------------------------------------------------------------------------
// Test -march=<archname> -mcpu=<archname> -mv<number>
@@ -79,8 +79,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK007 %s
// CHECK007: "-cc1" {{.*}} "-target-cpu" "hexagonv3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv3"
+// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v3"
+// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv3"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
@@ -88,8 +88,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK008 %s
// CHECK008: "-cc1" {{.*}} "-target-cpu" "hexagonv5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv5"
+// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v5"
+// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv5"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
@@ -97,30 +97,30 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK009 %s
// CHECK009: "-cc1" {{.*}} "-target-cpu" "hexagonv2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv2"
+// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v2"
+// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv2"
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK010 %s
// CHECK010: "-cc1" {{.*}} "-target-cpu" "hexagonv4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv4"
+// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v4"
+// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv4"
-// RUN: %clang -march=hexagonv2 -target hexagon-unknown-elf \
+// RUN: not %clang -march=hexagonv2 -target hexagon-unknown-elf \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
-// RUN: %clang -mcpu=hexagonv2 -target hexagon-unknown-elf \
+// RUN: not %clang -mcpu=hexagonv2 -target hexagon-unknown-elf \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
-// RUN: %clang -mv2 -target hexagon-unknown-elf \
+// RUN: not %clang -mv2 -target hexagon-unknown-elf \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
// CHECK-UNKNOWN-V2: error: unknown target CPU 'hexagonv2'
-// RUN: %clang -march=hexagonv3 -target hexagon-unknown-elf \
+// RUN: not %clang -march=hexagonv3 -target hexagon-unknown-elf \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
-// RUN: %clang -mcpu=hexagonv3 -target hexagon-unknown-elf \
+// RUN: not %clang -mcpu=hexagonv3 -target hexagon-unknown-elf \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
-// RUN: %clang -mv3 -target hexagon-unknown-elf \
+// RUN: not %clang -mv3 -target hexagon-unknown-elf \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
// CHECK-UNKNOWN-V3: error: unknown target CPU 'hexagonv3'
@@ -136,8 +136,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK011 %s
// CHECK011: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK011-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK011-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK011-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK011-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK011-NOT: "-static"
// CHECK011-NOT: "-shared"
// CHECK011: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -155,13 +155,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Defaults for C++
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK012 %s
// CHECK012: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK012-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK012-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK012-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK012-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK012-NOT: "-static"
// CHECK012-NOT: "-shared"
// CHECK012: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -186,8 +186,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK013 %s
// CHECK013: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK013-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK013-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK013-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK013-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK013: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK013: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK013: "{{.*}}/hexagon/lib/v4/init.o"
@@ -210,8 +210,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK014 %s
// CHECK014: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK014-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK014-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK014-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK014-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK014: "-static"
// CHECK014: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK014: "{{.*}}/hexagon/lib/v4/crt0.o"
@@ -231,8 +231,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK015 %s
// CHECK015: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK015-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK015-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK015-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK015-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK015: "-shared" "-call_shared"
// CHECK015-NOT: crt0_standalone.o
// CHECK015-NOT: crt0.o
@@ -261,8 +261,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK016 %s
// CHECK016: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK016-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK016-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK016-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK016-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK016: "-shared" "-call_shared" "-static"
// CHECK016-NOT: crt0_standalone.o
// CHECK016-NOT: crt0.o
@@ -287,14 +287,14 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// -nostdlib, -nostartfiles, -nodefaultlibs
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -nostdlib \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK017 %s
// CHECK017: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK017-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK017-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK017-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK017-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK017-NOT: crt0_standalone.o
// CHECK017-NOT: crt0.o
// CHECK017-NOT: init.o
@@ -313,14 +313,14 @@
// CHECK017-NOT: "--end-group"
// CHECK017-NOT: fini.o
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -nostartfiles \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK018 %s
// CHECK018: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK018-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK018-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK018-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK018-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK018-NOT: crt0_standalone.o
// CHECK018-NOT: crt0.o
// CHECK018-NOT: init.o
@@ -339,14 +339,14 @@
// CHECK018: "--end-group"
// CHECK018-NOT: fini.o
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -nodefaultlibs \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK019 %s
// CHECK019: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK019-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK019-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK019-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK019-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK019: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK019: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK019: "{{.*}}/hexagon/lib/v4/init.o"
@@ -374,8 +374,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK020 %s
// CHECK020: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK020-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK020-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK020-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK020-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK020-NOT: "-static"
// CHECK020-NOT: "-shared"
// CHECK020-NOT: crt0_standalone.o
@@ -399,8 +399,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK021 %s
// CHECK021: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK021-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK021-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK021-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK021-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK021-NOT: "-static"
// CHECK021-NOT: "-shared"
// CHECK021: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -421,7 +421,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Other args to pass to linker
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \
+// RUN: %clangxx -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -s \
// RUN: -Tbss 0xdead -Tdata 0xbeef -Ttext 0xcafe \
@@ -431,8 +431,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK022 %s
// CHECK022: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK022-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK022-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK022-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK022-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK022: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK022: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK022: "{{.*}}/hexagon/lib/v4/init.o"
@@ -459,9 +459,9 @@
// RUN: | FileCheck -check-prefix=CHECK023 %s
// CHECK023: "{{.*}}clang{{.*}}" "-cc1"
// CHECK023: "-mrelocation-model" "static"
-// CHECK023-NEXT: "{{.*}}/bin/hexagon-as"
+// CHECK023-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
// CHECK023-NOT: "-G{{[0-9]+}}"
-// CHECK023-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK023-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK023-NOT: "-G{{[0-9]+}}"
// RUN: %clang -### -target hexagon-unknown-elf \
@@ -477,16 +477,16 @@
// RUN: %clang -### -target hexagon-unknown-elf \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -fPIC \
-// RUN: -msmall_data_threshold=8 \
+// RUN: -msmall-data-threshold=8 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK024 %s
// CHECK024: "{{.*}}clang{{.*}}" "-cc1"
// CHECK024-NOT: "-mrelocation-model" "static"
// CHECK024: "-pic-level" "{{[12]}}"
// CHECK024: "-mllvm" "-hexagon-small-data-threshold=0"
-// CHECK024-NEXT: "{{.*}}/bin/hexagon-as"
+// CHECK024-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
// CHECK024: "-G0"
-// CHECK024-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK024-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK024: "-G0"
// RUN: %clang -### -target hexagon-unknown-elf \
@@ -507,9 +507,9 @@
// CHECK025: "{{.*}}clang{{.*}}" "-cc1"
// CHECK025: "-mrelocation-model" "static"
// CHECK025: "-mllvm" "-hexagon-small-data-threshold=8"
-// CHECK025-NEXT: "{{.*}}/bin/hexagon-as"
+// CHECK025-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
// CHECK025: "-G8"
-// CHECK025-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK025-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK025: "-G8"
// -----------------------------------------------------------------------------
@@ -521,8 +521,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK026 %s
// CHECK026: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK026-NEXT: "{{.*}}/bin/hexagon-as"
-// CHECK026-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK026-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK026-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK026: "-pie"
// RUN: %clang -### -target hexagon-unknown-elf \
@@ -531,8 +531,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK027 %s
// CHECK027: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK027-NEXT: "{{.*}}/bin/hexagon-as"
-// CHECK027-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK027-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK027-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK027-NOT: "-pie"
// -----------------------------------------------------------------------------
@@ -545,8 +545,8 @@
// CHECK028: "{{.*}}clang{{.*}}" "-cc1"
// CHECK028: "-mqdsp6-compat"
// CHECK028: "-Wreturn-type"
-// CHECK028-NEXT: "{{.*}}/bin/hexagon-as"
-// CHECK028-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK028-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK028-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// -----------------------------------------------------------------------------
// Test Assembler related args
@@ -559,6 +559,6 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK029 %s
// CHECK029: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK029-NEXT: "{{.*}}/bin/hexagon-as"
+// CHECK029-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
// CHECK029: "--noexecstack" "--trap" "--keep-locals"
-// CHECK029-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK029-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
diff --git a/test/Driver/hexagon-toolchain.c b/test/Driver/hexagon-toolchain.c
index 3e66f354c443..f3d7e25aa9dc 100644
--- a/test/Driver/hexagon-toolchain.c
+++ b/test/Driver/hexagon-toolchain.c
@@ -11,17 +11,17 @@
// CHECK001: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \
+// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK002 %s
-// CHECK002: "-cc1" {{.*}} "-internal-isystem" "[[INSTALL_DIR:.*]]/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0"
+// CHECK002: "-cc1" {{.*}} "-internal-isystem" "[[INSTALL_DIR:.*]]/Inputs/hexagon_tree/qc/bin/../../gnu{{/|\\\\}}hexagon/include/c++/4.4.0"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
// -----------------------------------------------------------------------------
// Test -nostdinc, -nostdlibinc, -nostdinc++
@@ -36,7 +36,7 @@
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
@@ -47,9 +47,9 @@
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \
+// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -nostdlibinc \
// RUN: %s 2>&1 \
@@ -59,16 +59,16 @@
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include"
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed"
// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include"
-// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \
+// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -nostdinc++ \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK006 %s
// CHECK006: "-cc1"
// CHECK006-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0"
-// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"
+// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"
// -----------------------------------------------------------------------------
// Test -march=<archname> -mcpu=<archname> -mv<number>
@@ -79,8 +79,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK007 %s
// CHECK007: "-cc1" {{.*}} "-target-cpu" "hexagonv3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v3"
-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv3"
+// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v3"
+// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv3"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
@@ -88,8 +88,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK008 %s
// CHECK008: "-cc1" {{.*}} "-target-cpu" "hexagonv5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v5"
-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv5"
+// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v5"
+// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv5"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
@@ -97,30 +97,30 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK009 %s
// CHECK009: "-cc1" {{.*}} "-target-cpu" "hexagonv2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v2"
-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv2"
+// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v2"
+// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv2"
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK010 %s
// CHECK010: "-cc1" {{.*}} "-target-cpu" "hexagonv4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v4"
-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv4"
+// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-as"{{.*}} "-march=v4"
+// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin{{/|\\}}hexagon-ld"{{.*}} "-mv4"
-// RUN: %clang -march=hexagonv2 -target hexagon-unknown-linux \
+// RUN: not %clang -march=hexagonv2 -target hexagon-unknown-linux \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
-// RUN: %clang -mcpu=hexagonv2 -target hexagon-unknown-linux \
+// RUN: not %clang -mcpu=hexagonv2 -target hexagon-unknown-linux \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
-// RUN: %clang -mv2 -target hexagon-unknown-linux \
+// RUN: not %clang -mv2 -target hexagon-unknown-linux \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s
// CHECK-UNKNOWN-V2: error: unknown target CPU 'hexagonv2'
-// RUN: %clang -march=hexagonv3 -target hexagon-unknown-linux \
+// RUN: not %clang -march=hexagonv3 -target hexagon-unknown-linux \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
-// RUN: %clang -mcpu=hexagonv3 -target hexagon-unknown-linux \
+// RUN: not %clang -mcpu=hexagonv3 -target hexagon-unknown-linux \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
-// RUN: %clang -mv3 -target hexagon-unknown-linux \
+// RUN: not %clang -mv3 -target hexagon-unknown-linux \
// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s
// CHECK-UNKNOWN-V3: error: unknown target CPU 'hexagonv3'
@@ -136,8 +136,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK011 %s
// CHECK011: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK011-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK011-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK011-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK011-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK011-NOT: "-static"
// CHECK011-NOT: "-shared"
// CHECK011: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -155,13 +155,13 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Defaults for C++
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \
+// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK012 %s
// CHECK012: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK012-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK012-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK012-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK012-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK012-NOT: "-static"
// CHECK012-NOT: "-shared"
// CHECK012: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -186,8 +186,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK013 %s
// CHECK013: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK013-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK013-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK013-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK013-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK013: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK013: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK013: "{{.*}}/hexagon/lib/v4/init.o"
@@ -210,8 +210,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK014 %s
// CHECK014: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK014-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK014-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK014-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK014-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK014: "-static"
// CHECK014: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK014: "{{.*}}/hexagon/lib/v4/crt0.o"
@@ -231,8 +231,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK015 %s
// CHECK015: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK015-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK015-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK015-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK015-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK015: "-shared" "-call_shared"
// CHECK015-NOT: crt0_standalone.o
// CHECK015-NOT: crt0.o
@@ -261,8 +261,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK016 %s
// CHECK016: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK016-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK016-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK016-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK016-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK016: "-shared" "-call_shared" "-static"
// CHECK016-NOT: crt0_standalone.o
// CHECK016-NOT: crt0.o
@@ -287,14 +287,14 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// -nostdlib, -nostartfiles, -nodefaultlibs
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \
+// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -nostdlib \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK017 %s
// CHECK017: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK017-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK017-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK017-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK017-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK017-NOT: crt0_standalone.o
// CHECK017-NOT: crt0.o
// CHECK017-NOT: init.o
@@ -313,14 +313,14 @@
// CHECK017-NOT: "--end-group"
// CHECK017-NOT: fini.o
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \
+// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -nostartfiles \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK018 %s
// CHECK018: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK018-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK018-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK018-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK018-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK018-NOT: crt0_standalone.o
// CHECK018-NOT: crt0.o
// CHECK018-NOT: init.o
@@ -339,14 +339,14 @@
// CHECK018: "--end-group"
// CHECK018-NOT: fini.o
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \
+// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -nodefaultlibs \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK019 %s
// CHECK019: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK019-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK019-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK019-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK019-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK019: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK019: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK019: "{{.*}}/hexagon/lib/v4/init.o"
@@ -374,8 +374,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK020 %s
// CHECK020: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK020-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK020-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK020-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK020-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK020-NOT: "-static"
// CHECK020-NOT: "-shared"
// CHECK020-NOT: crt0_standalone.o
@@ -399,8 +399,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK021 %s
// CHECK021: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK021-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK021-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK021-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK021-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK021-NOT: "-static"
// CHECK021-NOT: "-shared"
// CHECK021: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
@@ -421,7 +421,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Other args to pass to linker
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \
+// RUN: %clangxx -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -s \
// RUN: -Tbss 0xdead -Tdata 0xbeef -Ttext 0xcafe \
@@ -431,8 +431,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK022 %s
// CHECK022: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK022-NEXT: "{{.*}}/bin/hexagon-as"{{.*}}
-// CHECK022-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK022-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"{{.*}}
+// CHECK022-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK022: "{{.*}}/hexagon/lib/v4/crt0_standalone.o"
// CHECK022: "{{.*}}/hexagon/lib/v4/crt0.o"
// CHECK022: "{{.*}}/hexagon/lib/v4/init.o"
@@ -459,9 +459,9 @@
// RUN: | FileCheck -check-prefix=CHECK023 %s
// CHECK023: "{{.*}}clang{{.*}}" "-cc1"
// CHECK023: "-mrelocation-model" "static"
-// CHECK023-NEXT: "{{.*}}/bin/hexagon-as"
+// CHECK023-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
// CHECK023-NOT: "-G{{[0-9]+}}"
-// CHECK023-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK023-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK023-NOT: "-G{{[0-9]+}}"
// RUN: %clang -### -target hexagon-unknown-linux \
@@ -477,16 +477,16 @@
// RUN: %clang -### -target hexagon-unknown-linux \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
// RUN: -fPIC \
-// RUN: -msmall_data_threshold=8 \
+// RUN: -msmall-data-threshold=8 \
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK024 %s
// CHECK024: "{{.*}}clang{{.*}}" "-cc1"
// CHECK024-NOT: "-mrelocation-model" "static"
// CHECK024: "-pic-level" "{{[12]}}"
// CHECK024: "-mllvm" "-hexagon-small-data-threshold=0"
-// CHECK024-NEXT: "{{.*}}/bin/hexagon-as"
+// CHECK024-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
// CHECK024: "-G0"
-// CHECK024-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK024-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK024: "-G0"
// RUN: %clang -### -target hexagon-unknown-linux \
@@ -507,9 +507,9 @@
// CHECK025: "{{.*}}clang{{.*}}" "-cc1"
// CHECK025: "-mrelocation-model" "static"
// CHECK025: "-mllvm" "-hexagon-small-data-threshold=8"
-// CHECK025-NEXT: "{{.*}}/bin/hexagon-as"
+// CHECK025-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
// CHECK025: "-G8"
-// CHECK025-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK025-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK025: "-G8"
// -----------------------------------------------------------------------------
@@ -521,8 +521,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK026 %s
// CHECK026: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK026-NEXT: "{{.*}}/bin/hexagon-as"
-// CHECK026-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK026-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK026-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK026: "-pie"
// RUN: %clang -### -target hexagon-unknown-linux \
@@ -531,8 +531,8 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK027 %s
// CHECK027: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK027-NEXT: "{{.*}}/bin/hexagon-as"
-// CHECK027-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK027-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK027-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// CHECK027-NOT: "-pie"
// -----------------------------------------------------------------------------
@@ -545,8 +545,8 @@
// CHECK028: "{{.*}}clang{{.*}}" "-cc1"
// CHECK028: "-mqdsp6-compat"
// CHECK028: "-Wreturn-type"
-// CHECK028-NEXT: "{{.*}}/bin/hexagon-as"
-// CHECK028-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK028-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
+// CHECK028-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
// -----------------------------------------------------------------------------
// Test Assembler related args
@@ -559,6 +559,6 @@
// RUN: %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK029 %s
// CHECK029: "{{.*}}clang{{.*}}" "-cc1"
-// CHECK029-NEXT: "{{.*}}/bin/hexagon-as"
+// CHECK029-NEXT: "{{.*}}/bin{{/|\\}}hexagon-as"
// CHECK029: "--noexecstack" "--trap" "--keep-locals"
-// CHECK029-NEXT: "{{.*}}/bin/hexagon-ld"
+// CHECK029-NEXT: "{{.*}}/bin{{/|\\}}hexagon-ld"
diff --git a/test/Driver/ident_md.c b/test/Driver/ident_md.c
new file mode 100644
index 000000000000..d7da31707f04
--- /dev/null
+++ b/test/Driver/ident_md.c
@@ -0,0 +1,6 @@
+// RUN: %clang %s -emit-llvm -S -o - | FileCheck %s
+// Verify that clang version appears in the llvm.ident metadata.
+
+// CHECK: !llvm.ident = !{!0}
+// CHECK: !0 = metadata !{metadata !{{.*}}
+
diff --git a/test/Driver/immediate-options.c b/test/Driver/immediate-options.c
index 2b54ecf7c150..f50ccae64217 100644
--- a/test/Driver/immediate-options.c
+++ b/test/Driver/immediate-options.c
@@ -1,6 +1,14 @@
-// RUN: %clang --help | grep isystem
-// RUN: %clang --help | not grep ast-dump
-// RUN: %clang --help | not grep ccc-cxx
-// RUN: %clang --help-hidden | grep ccc-cxx
-// RUN: %clang -dumpversion
-// RUN: %clang -print-search-dirs
+// RUN: %clang --help | FileCheck %s -check-prefix=HELP
+// HELP: isystem
+// HELP-NOT: ast-dump
+// HELP-NOT: driver-mode
+
+// RUN: %clang --help-hidden | FileCheck %s -check-prefix=HELP-HIDDEN
+// HELP-HIDDEN: driver-mode
+
+// RUN: %clang -dumpversion | FileCheck %s -check-prefix=DUMPVERSION
+// DUMPVERSION: 4.2.1
+
+// RUN: %clang -print-search-dirs | FileCheck %s -check-prefix=PRINT-SEARCH-DIRS
+// PRINT-SEARCH-DIRS: programs: ={{.*}}
+// PRINT-SEARCH-DIRS: libraries: ={{.*}}
diff --git a/test/Driver/inhibit-downstream-commands.c b/test/Driver/inhibit-downstream-commands.c
index 5e46708cfe89..ceb245e4f1c9 100644
--- a/test/Driver/inhibit-downstream-commands.c
+++ b/test/Driver/inhibit-downstream-commands.c
@@ -1,4 +1,4 @@
-// RUN: %clang -no-integrated-as %s 2>&1 | FileCheck %s
+// RUN: not %clang -no-integrated-as %s 2>&1 | FileCheck %s
// CHECK: error: unknown type name 'invalid'
// CHECK-NOT: clang: error: assembler command failed
// CHECK-NOT: clang: error: linker command failed
diff --git a/test/Driver/integrated-as.c b/test/Driver/integrated-as.c
index 2045e8b559c6..e73174e878f8 100644
--- a/test/Driver/integrated-as.c
+++ b/test/Driver/integrated-as.c
@@ -1,7 +1,4 @@
// RUN: %clang -### -c -save-temps -integrated-as %s 2>&1 | FileCheck %s
-// gcc is invoked instead of clang-cc1as with gcc-driver -save-temps.
-// REQUIRES: clang-driver
-
// CHECK: cc1as
-// CHECK: -relax-all
+// CHECK: -mrelax-all
diff --git a/test/Driver/integrated-as.s b/test/Driver/integrated-as.s
index d614418276b8..0843cf93457b 100644
--- a/test/Driver/integrated-as.s
+++ b/test/Driver/integrated-as.s
@@ -1,6 +1,33 @@
// RUN: %clang -### -c -integrated-as %s 2>&1 | FileCheck %s
-
-// REQUIRES: clang-driver
-
// CHECK: cc1as
// CHECK-NOT: -relax-all
+
+// RUN: %clang -### -c -integrated-as -Wa,-L %s 2>&1 | FileCheck --check-prefix=OPT_L %s
+// OPT_L: msave-temp-labels
+
+// RUN: not %clang -c -integrated-as -Wa,--compress-debug-sections %s 2>&1 | FileCheck --check-prefix=INVALID %s
+// INVALID: error: unsupported argument '--compress-debug-sections' to option 'Wa,'
+
+// RUN: %clang -### -target x86_64-linux-gnu -c -integrated-as %s -fsanitize=address 2>&1 %s | FileCheck --check-prefix=SANITIZE %s
+// SANITIZE: argument unused during compilation: '-fsanitize=address'
+
+// Test that -I params in -Wa, and -Xassembler args are passed to integrated assembler
+// RUN: %clang -### -c -integrated-as %s -Wa,-I,foo_dir 2>&1 %s | FileCheck --check-prefix=WA_INCLUDE1 %s
+// WA_INCLUDE1: cc1as
+// WA_INCLUDE1: "-I" "foo_dir"
+
+// RUN: %clang -### -c -integrated-as %s -Wa,-Ifoo_dir 2>&1 %s | FileCheck --check-prefix=WA_INCLUDE2 %s
+// WA_INCLUDE2: cc1as
+// WA_INCLUDE2: "-Ifoo_dir"
+
+// RUN: %clang -### -c -integrated-as %s -Wa,-I -Wa,foo_dir 2>&1 %s | FileCheck --check-prefix=WA_INCLUDE3 %s
+// WA_INCLUDE3: cc1as
+// WA_INCLUDE3: "-I" "foo_dir"
+
+// RUN: %clang -### -c -integrated-as %s -Xassembler -I -Xassembler foo_dir 2>&1 %s | FileCheck --check-prefix=XA_INCLUDE1 %s
+// XA_INCLUDE1: cc1as
+// XA_INCLUDE1: "-I" "foo_dir"
+
+// RUN: %clang -### -c -integrated-as %s -Xassembler -Ifoo_dir 2>&1 %s | FileCheck --check-prefix=XA_INCLUDE2 %s
+// XA_INCLUDE2: cc1as
+// XA_INCLUDE2: "-Ifoo_dir"
diff --git a/test/Driver/invalid-o-level.c b/test/Driver/invalid-o-level.c
deleted file mode 100644
index d5242c7ac066..000000000000
--- a/test/Driver/invalid-o-level.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: not %clang_cc1 %s -O900 2> %t.log
-// RUN: FileCheck %s -input-file=%t.log
-
-// CHECK: invalid value '900' in '-O900'
diff --git a/test/Driver/le32-toolchain.c b/test/Driver/le32-toolchain.c
new file mode 100644
index 000000000000..bab550262edd
--- /dev/null
+++ b/test/Driver/le32-toolchain.c
@@ -0,0 +1,4 @@
+// RUN: %clang -### -target le32-unknown-nacl %s 2>&1 | FileCheck -check-prefix=CHECK-DEFAULT %s
+
+// CHECK-DEFAULT: "-cc1" {{.*}} "-fno-math-builtin"
+
diff --git a/test/Driver/le32-unknown-nacl.cpp b/test/Driver/le32-unknown-nacl.cpp
index 61388c5ca186..e029f667a192 100644
--- a/test/Driver/le32-unknown-nacl.cpp
+++ b/test/Driver/le32-unknown-nacl.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang -target le32-unknown-nacl -ccc-echo %s -emit-llvm-only -c 2>&1 | FileCheck %s -check-prefix=ECHO
+// RUN: %clang -target le32-unknown-nacl -### %s -emit-llvm-only -c 2>&1 | FileCheck %s -check-prefix=ECHO
// RUN: %clang -target le32-unknown-nacl %s -emit-llvm -S -c -o - | FileCheck %s
// RUN: %clang -target le32-unknown-nacl %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS
-// ECHO: {{.*}} -cc1 {{.*}}le32-unknown-nacl.c
+// ECHO: {{.*}} "-cc1" {{.*}}le32-unknown-nacl.c
// Check platform defines
#include <stdarg.h>
diff --git a/test/Driver/linux-as.c b/test/Driver/linux-as.c
index b3265da23478..a449b7b65380 100644
--- a/test/Driver/linux-as.c
+++ b/test/Driver/linux-as.c
@@ -1,56 +1,70 @@
-// Check passing options to the assembler for ARM targets.
+// Check passing options to the assembler for various linux targets.
//
// RUN: %clang -target arm-linux -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM %s
+// RUN: | FileCheck -check-prefix=CHECK-ARM %s
// CHECK-ARM: as{{(.exe)?}}" "-mfloat-abi=soft"
//
// RUN: %clang -target arm-linux -mcpu=cortex-a8 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM-MCPU %s
+// RUN: | FileCheck -check-prefix=CHECK-ARM-MCPU %s
// CHECK-ARM-MCPU: as{{(.exe)?}}" "-mfloat-abi=soft" "-mcpu=cortex-a8"
//
// RUN: %clang -target arm-linux -mfpu=neon -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM-MFPU %s
+// RUN: | FileCheck -check-prefix=CHECK-ARM-MFPU %s
// CHECK-ARM-MFPU: as{{(.exe)?}}" "-mfloat-abi=soft" "-mfpu=neon"
//
// RUN: %clang -target arm-linux -march=armv7-a -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM-MARCH %s
+// RUN: | FileCheck -check-prefix=CHECK-ARM-MARCH %s
// CHECK-ARM-MARCH: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armv7-a"
//
// RUN: %clang -target arm-linux -mcpu=cortex-a8 -mfpu=neon -march=armv7-a -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM-ALL %s
+// RUN: | FileCheck -check-prefix=CHECK-ARM-ALL %s
// CHECK-ARM-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armv7-a" "-mcpu=cortex-a8" "-mfpu=neon"
//
// RUN: %clang -target armv7-linux -mcpu=cortex-a8 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM-TARGET %s
+// RUN: | FileCheck -check-prefix=CHECK-ARM-TARGET %s
// CHECK-ARM-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8"
//
+// RUN: %clang -target armv8-linux -mcpu=cortex-a53 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-ARM-TARGET-V8 %s
+// CHECK-ARM-TARGET-V8: as{{(.exe)?}}" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53"
+//
// RUN: %clang -target arm-linux -mfloat-abi=hard -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM-MFLOAT-ABI %s
+// RUN: | FileCheck -check-prefix=CHECK-ARM-MFLOAT-ABI %s
// CHECK-ARM-MFLOAT-ABI: as{{(.exe)?}}" "-mfloat-abi=hard"
//
// RUN: %clang -target arm-linux-androideabi -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM-ANDROID %s
+// RUN: | FileCheck -check-prefix=CHECK-ARM-ANDROID %s
// CHECK-ARM-ANDROID: as{{(.exe)?}}" "-mfloat-abi=soft"
//
// RUN: %clang -target arm-linux-androideabi -march=armv7-a -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM-ANDROID-SOFTFP %s
+// RUN: | FileCheck -check-prefix=CHECK-ARM-ANDROID-SOFTFP %s
// CHECK-ARM-ANDROID-SOFTFP: as{{(.exe)?}}" "-mfloat-abi=softfp" "-march=armv7-a"
//
// RUN: %clang -target arm-linux-eabi -mhard-float -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=ARM-HARDFP %s
+// RUN: | FileCheck -check-prefix=CHECK-ARM-HARDFP %s
// CHECK-ARM-HARDFP: as{{(.exe)?}}" "-mfloat-abi=hard"
//
// RUN: %clang -target ppc-linux -mcpu=invalid-cpu -### \
// RUN: -no-integrated-as -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix=PPC-NO-MCPU %s
+// RUN: | FileCheck -check-prefix=CHECK-PPC-NO-MCPU %s
// CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu"
+//
+// RUN: %clang -target s390x-linux -### -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-Z-DEFAULT-ARCH %s
+// CHECK-Z-DEFAULT-ARCH: as{{.*}} "-march=z10"
+//
+// RUN: %clang -target s390x-linux -march=z196 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-Z-ARCH-Z196 %s
+// CHECK-Z-ARCH-Z196: as{{.*}} "-march=z196"
diff --git a/test/Driver/linux-header-search.cpp b/test/Driver/linux-header-search.cpp
index d09f5b27ae9d..8955ed71d3c2 100644
--- a/test/Driver/linux-header-search.cpp
+++ b/test/Driver/linux-header-search.cpp
@@ -12,7 +12,7 @@
// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/i686-linux-gnu"
// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/backward"
// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
-// CHECK-UBUNTU-11-04: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
+// CHECK-UBUNTU-11-04: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include"
// CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/include"
// CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
//
@@ -26,11 +26,25 @@
// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward"
// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/c++/4.7"
// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
-// CHECK-UBUNTU-13-04: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
+// CHECK-UBUNTU-13-04: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include"
// CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu"
// CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/include"
// CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
//
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN: -target arm-linux-gnueabihf \
+// RUN: --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \
+// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-13-04-CROSS %s
+// CHECK-UBUNTU-13-04-CROSS: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
+// CHECK-UBUNTU-13-04-CROSS: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/c++/4.7"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/c++/4.7/backward"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/arm-linux-gnueabihf/c++/4.7"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-externc-isystem" "[[SYSROOT]]/include"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+//
// Test Ubuntu/Debian's new version of multiarch, with -m32.
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-unknown-linux-gnu -m32 \
@@ -55,7 +69,7 @@
// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/i686-linux-gnu"
// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/backward"
// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
-// CHECK-DEBIAN-X86: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
+// CHECK-DEBIAN-X86: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include"
// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/i386-linux-gnu"
// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/include"
// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
@@ -69,7 +83,7 @@
// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/x86_64-linux-gnu"
// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/backward"
// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
-// CHECK-DEBIAN-X86-64: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
+// CHECK-DEBIAN-X86-64: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include"
// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu"
// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/include"
// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
@@ -83,7 +97,7 @@
// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/powerpc-linux-gnu"
// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/backward"
// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
-// CHECK-DEBIAN-PPC: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
+// CHECK-DEBIAN-PPC: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include"
// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc-linux-gnu"
// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/include"
// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
@@ -97,7 +111,36 @@
// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/powerpc64-linux-gnu"
// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/backward"
// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
-// CHECK-DEBIAN-PPC64: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
+// CHECK-DEBIAN-PPC64: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include"
// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc64-linux-gnu"
// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/include"
// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+//
+// Test Gentoo's weirdness both before and after they changed it in their GCC
+// 4.6.4 release.
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN: -target x86_64-unknown-linux-gnu \
+// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.6.2_tree \
+// RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-6-2 %s
+// CHECK-GENTOO-4-6-2: "{{.*}}clang{{.*}}" "-cc1"
+// CHECK-GENTOO-4-6-2: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4"
+// CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/x86_64-pc-linux-gnu"
+// CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/backward"
+// CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
+// CHECK-GENTOO-4-6-2: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include"
+// CHECK-GENTOO-4-6-2: "-internal-externc-isystem" "[[SYSROOT]]/include"
+// CHECK-GENTOO-4-6-2: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN: -target x86_64-unknown-linux-gnu \
+// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.6.4_tree \
+// RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-6-4 %s
+// CHECK-GENTOO-4-6-4: "{{.*}}clang{{.*}}" "-cc1"
+// CHECK-GENTOO-4-6-4: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6"
+// CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6/x86_64-pc-linux-gnu"
+// CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6/backward"
+// CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
+// CHECK-GENTOO-4-6-4: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include"
+// CHECK-GENTOO-4-6-4: "-internal-externc-isystem" "[[SYSROOT]]/include"
+// CHECK-GENTOO-4-6-4: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c
index ebac718b33b8..755fa04055e5 100644
--- a/test/Driver/linux-ld.c
+++ b/test/Driver/linux-ld.c
@@ -2,12 +2,12 @@
// sysroot to make these tests independent of the host system.
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-unknown-linux \
+// RUN: --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
// CHECK-LD-32-NOT: warning:
// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/crtbegin.o"
+// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
@@ -15,7 +15,7 @@
// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target x86_64-unknown-linux \
+// RUN: --target=x86_64-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
// CHECK-LD-64-NOT: warning:
@@ -23,7 +23,7 @@
// CHECK-LD-64: "--eh-frame-hdr"
// CHECK-LD-64: "-m" "elf_x86_64"
// CHECK-LD-64: "-dynamic-linker"
-// CHECK-LD-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o"
+// CHECK-LD-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
@@ -34,7 +34,7 @@
// CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target x86_64-unknown-linux \
+// RUN: --target=x86_64-unknown-linux \
// RUN: -static-libgcc \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC-LIBGCC %s
@@ -43,7 +43,7 @@
// CHECK-LD-64-STATIC-LIBGCC: "--eh-frame-hdr"
// CHECK-LD-64-STATIC-LIBGCC: "-m" "elf_x86_64"
// CHECK-LD-64-STATIC-LIBGCC: "-dynamic-linker"
-// CHECK-LD-64-STATIC-LIBGCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o"
+// CHECK-LD-64-STATIC-LIBGCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
@@ -54,7 +54,7 @@
// CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target x86_64-unknown-linux \
+// RUN: --target=x86_64-unknown-linux \
// RUN: -static \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
@@ -64,7 +64,7 @@
// CHECK-LD-64-STATIC: "-m" "elf_x86_64"
// CHECK-LD-64-STATIC-NOT: "-dynamic-linker"
// CHECK-LD-64-STATIC: "-static"
-// CHECK-LD-64-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbeginT.o"
+// CHECK-LD-64-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbeginT.o"
// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
@@ -74,17 +74,17 @@
//
// Check that flags can be combined. The -static dominates.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target x86_64-unknown-linux \
+// RUN: --target=x86_64-unknown-linux \
// RUN: -static-libgcc -static \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-unknown-linux -m32 \
+// RUN: --target=i386-unknown-linux -m32 \
// RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-32-TO-32 %s
// CHECK-32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-32-TO-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/crtbegin.o"
+// CHECK-32-TO-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib32"
// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib32"
@@ -96,11 +96,11 @@
// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-unknown-linux -m64 \
+// RUN: --target=i386-unknown-linux -m64 \
// RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-32-TO-64 %s
// CHECK-32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-32-TO-64: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/64/crtbegin.o"
+// CHECK-32-TO-64: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/64{{/|\\\\}}crtbegin.o"
// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/64"
// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib64"
// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib64"
@@ -113,11 +113,11 @@
// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target x86_64-unknown-linux -m64 \
+// RUN: --target=x86_64-unknown-linux -m64 \
// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-64-TO-64 %s
// CHECK-64-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-64-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o"
+// CHECK-64-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib64"
// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib64"
@@ -129,11 +129,11 @@
// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target x86_64-unknown-linux -m32 \
+// RUN: --target=x86_64-unknown-linux -m32 \
// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-64-TO-32 %s
// CHECK-64-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-64-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32/crtbegin.o"
+// CHECK-64-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o"
// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32"
// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib32"
// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib32"
@@ -146,12 +146,12 @@
// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target x86_64-unknown-linux -m32 \
-// RUN: -gcc-toolchain %S/Inputs/multilib_64bit_linux_tree/usr \
+// RUN: --target=x86_64-unknown-linux -m32 \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \
// RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-64-TO-32-SYSROOT %s
// CHECK-64-TO-32-SYSROOT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-64-TO-32-SYSROOT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32/crtbegin.o"
+// CHECK-64-TO-32-SYSROOT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o"
// CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32"
// CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib/../lib32"
// CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib/../lib32"
@@ -160,67 +160,67 @@
// CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-unknown-linux -m32 \
+// RUN: --target=i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-32 %s
// CHECK-INSTALL-DIR-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-INSTALL-DIR-32: "{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0/crtbegin.o"
+// CHECK-INSTALL-DIR-32: "{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0{{/|\\\\}}crtbegin.o"
// CHECK-INSTALL-DIR-32: "-L{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0"
//
// Check that with 64-bit builds, we don't actually use the install directory
// as its version of GCC is lower than our sysrooted version.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target x86_64-unknown-linux -m64 \
+// RUN: --target=x86_64-unknown-linux -m64 \
// RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-64 %s
// CHECK-INSTALL-DIR-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-INSTALL-DIR-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o"
+// CHECK-INSTALL-DIR-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
// CHECK-INSTALL-DIR-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
//
// Check that we support unusual patch version formats, including missing that
// component.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-unknown-linux -m32 \
+// RUN: --target=i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing1/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION1 %s
// CHECK-GCC-VERSION1: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-GCC-VERSION1: "{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7/crtbegin.o"
+// CHECK-GCC-VERSION1: "{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7{{/|\\\\}}crtbegin.o"
// CHECK-GCC-VERSION1: "-L{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-unknown-linux -m32 \
+// RUN: --target=i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing2/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION2 %s
// CHECK-GCC-VERSION2: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-GCC-VERSION2: "{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x/crtbegin.o"
+// CHECK-GCC-VERSION2: "{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x{{/|\\\\}}crtbegin.o"
// CHECK-GCC-VERSION2: "-L{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-unknown-linux -m32 \
+// RUN: --target=i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing3/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION3 %s
// CHECK-GCC-VERSION3: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-GCC-VERSION3: "{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5/crtbegin.o"
+// CHECK-GCC-VERSION3: "{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5{{/|\\\\}}crtbegin.o"
// CHECK-GCC-VERSION3: "-L{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-unknown-linux -m32 \
+// RUN: --target=i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing4/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION4 %s
// CHECK-GCC-VERSION4: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-GCC-VERSION4: "{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99/crtbegin.o"
+// CHECK-GCC-VERSION4: "{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99{{/|\\\\}}crtbegin.o"
// CHECK-GCC-VERSION4: "-L{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99"
//
// Test a very broken version of multiarch that shipped in Ubuntu 11.04.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-unknown-linux \
+// RUN: --target=i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
// CHECK-UBUNTU-11-04: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-UBUNTU-11-04: "{{.*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/crtbegin.o"
+// CHECK-UBUNTU-11-04: "{{.*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
// CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5"
// CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../i386-linux-gnu"
// CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu"
@@ -230,60 +230,94 @@
//
// Check multi arch support on Ubuntu 12.04 LTS.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target arm-unknown-linux-gnueabihf \
+// RUN: --target=arm-unknown-linux-gnueabihf \
// RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM-HF %s
// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf/crt1.o"
-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf/crti.o"
-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/crtbegin.o"
+// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crt1.o"
+// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crti.o"
+// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtbegin.o"
// CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3"
// CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf"
// CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/lib/arm-linux-gnueabihf"
// CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabihf"
// CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../.."
-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/crtend.o"
-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf/crtn.o"
+// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtend.o"
+// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crtn.o"
+//
+// Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabihf.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=arm-linux-gnueabihf \
+// RUN: --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
+// RUN: | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM-HF %s
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-dynamic-linker" "/lib/ld-linux-armhf.so.3"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtbegin.o"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/lib/../lib"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/../lib"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtend.o"
+// CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crtn.o"
+//
+// Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabi.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=arm-linux-gnueabi \
+// RUN: --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
+// RUN: | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM %s
+// CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "-dynamic-linker" "/lib/ld-linux.so.3"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtbegin.o"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/lib/../lib"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/../lib"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtend.o"
+// CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crtn.o"
//
// Check fedora 18 on arm.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target armv7-unknown-linux-gnueabihf \
+// RUN: --target=armv7-unknown-linux-gnueabihf \
// RUN: --sysroot=%S/Inputs/fedora_18_tree \
// RUN: | FileCheck --check-prefix=CHECK-FEDORA-18-ARM-HF %s
// CHECK-FEDORA-18-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../crt1.o"
-// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../crti.o"
-// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/crtbegin.o"
+// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crt1.o"
+// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crti.o"
+// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtbegin.o"
// CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2"
-// CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../.."
-// CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/lib"
-// CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib"
-// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/crtend.o"
-// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../crtn.o"
+// CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib"
+// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtend.o"
+// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crtn.o"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target arm-unknown-linux-gnueabi \
+// RUN: --target=arm-unknown-linux-gnueabi \
// RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM %s
// CHECK-UBUNTU-12-04-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi/crt1.o"
-// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi/crti.o"
-// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/crtbegin.o"
+// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crt1.o"
+// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crti.o"
+// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtbegin.o"
// CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1"
// CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi"
// CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/lib/arm-linux-gnueabi"
// CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabi"
// CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../.."
-// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/crtend.o"
-// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi/crtn.o"
+// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtend.o"
+// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crtn.o"
//
// Test the setup that shipped in SUSE 10.3 on ppc64.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target powerpc64-suse-linux \
+// RUN: --target=powerpc64-suse-linux \
// RUN: --sysroot=%S/Inputs/suse_10.3_ppc64_tree \
// RUN: | FileCheck --check-prefix=CHECK-SUSE-10-3-PPC64 %s
// CHECK-SUSE-10-3-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-SUSE-10-3-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64/crtbegin.o"
+// CHECK-SUSE-10-3-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64{{/|\\\\}}crtbegin.o"
// CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64"
// CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib64"
// CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/lib/../lib64"
@@ -291,14 +325,14 @@
//
// Check dynamic-linker for different archs
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -target arm-linux-gnueabi \
+// RUN: --target=arm-linux-gnueabi \
// RUN: | FileCheck --check-prefix=CHECK-ARM %s
// CHECK-ARM: "{{.*}}ld{{(.exe)?}}"
// CHECK-ARM: "-m" "armelf_linux_eabi"
// CHECK-ARM: "-dynamic-linker" "{{.*}}/lib/ld-linux.so.3"
//
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -target arm-linux-gnueabihf \
+// RUN: --target=arm-linux-gnueabihf \
// RUN: | FileCheck --check-prefix=CHECK-ARM-HF %s
// CHECK-ARM-HF: "{{.*}}ld{{(.exe)?}}"
// CHECK-ARM-HF: "-m" "armelf_linux_eabi"
@@ -308,42 +342,42 @@
// and provide correct path to the dynamic linker and emulation mode when build
// for MIPS platforms.
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu \
+// RUN: --target=mips-linux-gnu \
// RUN: | FileCheck --check-prefix=CHECK-MIPS %s
// CHECK-MIPS: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPS: "-m" "elf32btsmip"
// CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1"
// CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu \
+// RUN: --target=mipsel-linux-gnu \
// RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s
// CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPSEL: "-m" "elf32ltsmip"
// CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib/ld.so.1"
// CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -target mips64-linux-gnu \
+// RUN: --target=mips64-linux-gnu \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s
// CHECK-MIPS64: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPS64: "-m" "elf64btsmip"
// CHECK-MIPS64: "-dynamic-linker" "{{.*}}/lib64/ld.so.1"
// CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -target mips64el-linux-gnu \
+// RUN: --target=mips64el-linux-gnu \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s
// CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPS64EL: "-m" "elf64ltsmip"
// CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/lib64/ld.so.1"
// CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -target mips64-linux-gnu -mabi=n32 \
+// RUN: --target=mips64-linux-gnu -mabi=n32 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64-N32 %s
// CHECK-MIPS64-N32: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPS64-N32: "-m" "elf32btsmipn32"
// CHECK-MIPS64-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1"
// CHECK-MIPS64-N32-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -target mips64el-linux-gnu -mabi=n32 \
+// RUN: --target=mips64el-linux-gnu -mabi=n32 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-N32 %s
// CHECK-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPS64EL-N32: "-m" "elf32ltsmipn32"
@@ -352,11 +386,11 @@
//
// Thoroughly exercise the Debian multiarch environment.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i686-linux-gnu \
+// RUN: --target=i686-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s
// CHECK-DEBIAN-X86: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-X86: "{{.*}}/usr/lib/gcc/i686-linux-gnu/4.5/crtbegin.o"
+// CHECK-DEBIAN-X86: "{{.*}}/usr/lib/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5"
// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../i386-linux-gnu"
// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu"
@@ -364,11 +398,11 @@
// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/lib"
// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target x86_64-linux-gnu \
+// RUN: --target=x86_64-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s
// CHECK-DEBIAN-X86-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-X86-64: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.5/crtbegin.o"
+// CHECK-DEBIAN-X86-64: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5"
// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../x86_64-linux-gnu"
// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu"
@@ -376,11 +410,11 @@
// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/lib"
// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target powerpc-linux-gnu \
+// RUN: --target=powerpc-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s
// CHECK-DEBIAN-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-PPC: "{{.*}}/usr/lib/gcc/powerpc-linux-gnu/4.5/crtbegin.o"
+// CHECK-DEBIAN-PPC: "{{.*}}/usr/lib/gcc/powerpc-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5"
// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../powerpc-linux-gnu"
// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/powerpc-linux-gnu"
@@ -388,11 +422,11 @@
// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/lib"
// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target powerpc64-linux-gnu \
+// RUN: --target=powerpc64-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s
// CHECK-DEBIAN-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-linux-gnu/4.5/crtbegin.o"
+// CHECK-DEBIAN-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5"
// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../powerpc64-linux-gnu"
// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/powerpc64-linux-gnu"
@@ -400,11 +434,11 @@
// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/lib"
// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu \
+// RUN: --target=mips-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS %s
// CHECK-DEBIAN-MIPS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-MIPS: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/crtbegin.o"
+// CHECK-DEBIAN-MIPS: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../../mips-linux-gnu"
// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/mips-linux-gnu"
@@ -412,11 +446,11 @@
// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/lib"
// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu \
+// RUN: --target=mipsel-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPSEL %s
// CHECK-DEBIAN-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/crtbegin.o"
+// CHECK-DEBIAN-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../../mipsel-linux-gnu"
// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/mipsel-linux-gnu"
@@ -424,44 +458,44 @@
// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/lib"
// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips64-linux-gnu \
+// RUN: --target=mips64-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64 %s
// CHECK-DEBIAN-MIPS64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-MIPS64: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/64/crtbegin.o"
+// CHECK-DEBIAN-MIPS64: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/64"
// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/lib"
// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips64el-linux-gnu \
+// RUN: --target=mips64el-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL %s
// CHECK-DEBIAN-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/64/crtbegin.o"
+// CHECK-DEBIAN-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/64"
// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/lib"
// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips64-linux-gnu -mabi=n32 \
+// RUN: --target=mips64-linux-gnu -mabi=n32 \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64-N32 %s
// CHECK-DEBIAN-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-MIPS64-N32: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/n32/crtbegin.o"
+// CHECK-DEBIAN-MIPS64-N32: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/n32"
// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/lib"
// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips64el-linux-gnu -mabi=n32 \
+// RUN: --target=mips64el-linux-gnu -mabi=n32 \
// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL-N32 %s
// CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/n32/crtbegin.o"
+// CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/n32"
// CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
// CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
@@ -470,123 +504,123 @@
//
// Test linker invocation on Android.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target arm-linux-androideabi \
+// RUN: --target=arm-linux-androideabi \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target arm-linux-android \
+// RUN: --target=arm-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-android \
+// RUN: --target=mipsel-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-linux-android \
+// RUN: --target=i386-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-ANDROID: "{{.*}}/crtbegin_dynamic.o"
+// CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o"
// CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib"
// CHECK-ANDROID-NOT: "gcc_s"
// CHECK-ANDROID: "-lgcc"
// CHECK-ANDROID: "-ldl"
// CHECK-ANDROID-NOT: "gcc_s"
-// CHECK-ANDROID: "{{.*}}/crtend_android.o"
+// CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target arm-linux-androideabi \
+// RUN: --target=arm-linux-androideabi \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target arm-linux-android \
+// RUN: --target=arm-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-android \
+// RUN: --target=mipsel-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-linux-android \
+// RUN: --target=i386-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// CHECK-ANDROID-SO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-ANDROID-SO: "-Bsymbolic"
-// CHECK-ANDROID-SO: "{{.*}}/crtbegin_so.o"
+// CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtbegin_so.o"
// CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib"
// CHECK-ANDROID-SO-NOT: "gcc_s"
// CHECK-ANDROID-SO: "-lgcc"
// CHECK-ANDROID-SO: "-ldl"
// CHECK-ANDROID-SO-NOT: "gcc_s"
-// CHECK-ANDROID-SO: "{{.*}}/crtend_so.o"
+// CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target arm-linux-androideabi \
+// RUN: --target=arm-linux-androideabi \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target arm-linux-android \
+// RUN: --target=arm-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-android \
+// RUN: --target=mipsel-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-linux-android \
+// RUN: --target=i386-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
// CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-ANDROID-STATIC: "{{.*}}/crtbegin_static.o"
+// CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtbegin_static.o"
// CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib"
// CHECK-ANDROID-STATIC-NOT: "gcc_s"
// CHECK-ANDROID-STATIC: "-lgcc"
// CHECK-ANDROID-STATIC-NOT: "-ldl"
// CHECK-ANDROID-STATIC-NOT: "gcc_s"
-// CHECK-ANDROID-STATIC: "{{.*}}/crtend_android.o"
+// CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target arm-linux-androideabi \
+// RUN: --target=arm-linux-androideabi \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target arm-linux-android \
+// RUN: --target=arm-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-android \
+// RUN: --target=mipsel-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-linux-android \
+// RUN: --target=i386-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// CHECK-ANDROID-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-ANDROID-PIE: "{{.*}}/crtbegin_dynamic.o"
+// CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o"
// CHECK-ANDROID-PIE: "-L[[SYSROOT]]/usr/lib"
// CHECK-ANDROID-PIE-NOT: "gcc_s"
// CHECK-ANDROID-PIE: "-lgcc"
// CHECK-ANDROID-PIE-NOT: "gcc_s"
-// CHECK-ANDROID-PIE: "{{.*}}/crtend_android.o"
+// CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtend_android.o"
//
// Check linker invocation on Debian 6 MIPS 32/64-bit.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu \
+// RUN: --target=mipsel-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_6_mips_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPSEL %s
// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib/crt1.o"
-// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib/crti.o"
-// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/crtbegin.o"
+// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crt1.o"
+// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crti.o"
+// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4"
// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib"
// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib/../lib"
@@ -596,13 +630,13 @@
// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips64el-linux-gnu \
+// RUN: --target=mips64el-linux-gnu \
// RUN: --sysroot=%S/Inputs/debian_6_mips_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL %s
// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64/crt1.o"
-// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64/crti.o"
-// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/64/crtbegin.o"
+// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crt1.o"
+// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crti.o"
+// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/64{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/64"
// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64"
// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib/../lib64"
@@ -612,13 +646,13 @@
// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips64el-linux-gnu -mabi=n32 \
+// RUN: --target=mips64el-linux-gnu -mabi=n32 \
// RUN: --sysroot=%S/Inputs/debian_6_mips_tree \
// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-N32 %s
// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32/crt1.o"
-// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32/crti.o"
-// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/n32/crtbegin.o"
+// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crt1.o"
+// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crti.o"
+// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/n32{{/|\\\\}}crtbegin.o"
// CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/n32"
// CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32"
// CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib/../lib32"
@@ -629,41 +663,47 @@
//
// Test linker invocation for Freescale SDK (OpenEmbedded).
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target powerpc-fsl-linux \
+// RUN: --target=powerpc-fsl-linux \
// RUN: --sysroot=%S/Inputs/freescale_ppc_tree \
// RUN: | FileCheck --check-prefix=CHECK-FSL-PPC %s
// CHECK-FSL-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-FSL-PPC: "-m" "elf32ppclinux"
-// CHECK-FSL-PPC: "{{.*}}/crt1.o"
-// CHECK-FSL-PPC: "{{.*}}/crtbegin.o"
+// CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crt1.o"
+// CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crtbegin.o"
// CHECK-FSL-PPC: "-L[[SYSROOT]]/usr/lib"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target powerpc64-fsl-linux \
+// RUN: --target=powerpc64-fsl-linux \
// RUN: --sysroot=%S/Inputs/freescale_ppc64_tree \
// RUN: | FileCheck --check-prefix=CHECK-FSL-PPC64 %s
// CHECK-FSL-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK-FSL-PPC64: "-m" "elf64ppc"
-// CHECK-FSL-PPC64: "{{.*}}/crt1.o"
-// CHECK-FSL-PPC64: "{{.*}}/crtbegin.o"
+// CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crt1.o"
+// CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crtbegin.o"
// CHECK-FSL-PPC64: "-L[[SYSROOT]]/usr/lib64/powerpc64-fsl-linux/4.6.2/../.."
//
// Check that crtfastmath.o is linked with -ffast-math.
-// RUN: %clang -target x86_64-unknown-linux -### %s \
+// RUN: %clang --target=x86_64-unknown-linux -### %s \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
-// RUN: %clang -target x86_64-unknown-linux -### %s -ffast-math \
+// RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
-// RUN: %clang -target x86_64-unknown-linux -### %s -funsafe-math-optimizations\
+// RUN: %clang --target=x86_64-unknown-linux -### %s -funsafe-math-optimizations\
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
-// RUN: %clang -target x86_64-unknown-linux -### %s -ffast-math -fno-fast-math \
+// RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -fno-fast-math \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
// We don't have crtfastmath.o in the i386 tree, use it to check that file
// detection works.
-// RUN: %clang -target i386-unknown-linux -### %s -ffast-math \
+// RUN: %clang --target=i386-unknown-linux -### %s -ffast-math \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
-// CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtfastmath.o
+// CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtfastmath.o
// CHECK-NOCRTFASTMATH-NOT: crtfastmath.o
+
+// Check that we link in gcrt1.o when compiling with -pg
+// RUN: %clang -pg --target=x86_64-unknown-linux -### %s \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
+// RUN: | FileCheck --check-prefix=CHECK-PG %s
+// CHECK-PG: gcrt1.o
diff --git a/test/Driver/lit.local.cfg b/test/Driver/lit.local.cfg
index a62ea1a09983..d69e6ec1312c 100644
--- a/test/Driver/lit.local.cfg
+++ b/test/Driver/lit.local.cfg
@@ -1 +1,5 @@
-config.suffixes = ['.c', '.cpp', '.h', '.m', '.mm', '.S', '.s']
+config.suffixes = ['.c', '.cpp', '.h', '.m', '.mm', '.S', '.s', '.f90', '.f95']
+config.substitutions = list(config.substitutions)
+config.substitutions.insert(0,
+ ('%clang_cc1',
+ """*** Do not use 'clang -cc1' in Driver tests. ***""") )
diff --git a/test/Driver/lto.c b/test/Driver/lto.c
index 22b47882691d..91524bf78b1d 100644
--- a/test/Driver/lto.c
+++ b/test/Driver/lto.c
@@ -1,11 +1,8 @@
-// -emit-llvm, -flto, and -O4 all cause a switch to llvm-bc object files.
+// -flto causes a switch to llvm-bc object files.
// RUN: %clang -ccc-print-phases -c %s -flto 2> %t.log
// RUN: grep '2: compiler, {1}, lto-bc' %t.log
-// RUN: %clang -ccc-print-phases -c %s -O4 2> %t.log
-// RUN: grep '2: compiler, {1}, lto-bc' %t.log
-// and -emit-llvm doesn't alter pipeline (unfortunately?).
-// RUN: %clang -ccc-print-phases %s -emit-llvm 2> %t.log
+// RUN: %clang -ccc-print-phases %s -flto 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}, lto-bc' %t.log
@@ -13,11 +10,13 @@
// llvm-bc and llvm-ll outputs need to match regular suffixes
// (unfortunately).
-// RUN: %clang %s -emit-llvm -save-temps -### 2> %t.log
+// RUN: %clang %s -flto -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: %clang %s -flto -S -### 2> %t.log
// RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log
+// RUN: not %clang %s -emit-llvm 2>&1 | FileCheck --check-prefix=LLVM-LINK %s
+// LLVM-LINK: -emit-llvm cannot be used when linking
diff --git a/test/Driver/m_and_mm.c b/test/Driver/m_and_mm.c
index eab2a04986a9..18cf7abfa629 100644
--- a/test/Driver/m_and_mm.c
+++ b/test/Driver/m_and_mm.c
@@ -1,3 +1,3 @@
// RUN: %clang -### \
// RUN: -M -MM %s 2> %t
-// RUN: grep '"-sys-header-deps"' %t | count 0
+// RUN: not grep '"-sys-header-deps"' %t
diff --git a/test/Driver/mips-as.c b/test/Driver/mips-as.c
index 216b65607e06..df925f1a17d4 100644
--- a/test/Driver/mips-as.c
+++ b/test/Driver/mips-as.c
@@ -115,3 +115,35 @@
// RUN: | FileCheck -check-prefix=MIPS-NDSPR2 %s
// MIPS-NDSPR2: as{{(.exe)?}}"
// MIPS-NDSPR2-NOT: "-mdspr2"
+//
+// RUN: %clang -target mips-linux-gnu -mnan=legacy -mnan=2008 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-NAN2008 %s
+// MIPS-NAN2008: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-EB" "-mnan=2008"
+//
+// RUN: %clang -target mips-linux-gnu -mnan=2008 -mnan=legacy -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-NAN-LEGACY %s
+// MIPS-NAN-LEGACY: as{{(.exe)?}}"
+// MIPS-NAN_LEGACY-NOT: "-mnan={{.*}}"
+//
+// RUN: %clang -target mips-linux-gnu -mfp64 -mfp32 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-MFP32 %s
+// MIPS-MFP32: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-EB" "-mfp32"
+//
+// RUN: %clang -target mips-linux-gnu -mfp32 -mfp64 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-MFP64 %s
+// MIPS-MFP64: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-EB" "-mfp64"
+//
+// RUN: %clang -target mips-linux-gnu -mno-msa -mmsa -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-MSA %s
+// MIPS-MSA: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-EB" "-mmsa"
+//
+// RUN: %clang -target mips-linux-gnu -mmsa -mno-msa -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-NMSA %s
+// MIPS-NMSA: as{{(.exe)?}}"
+// MIPS-NMSA-NOT: "-mmsa"
diff --git a/test/Driver/mips-cs-header-search.cpp b/test/Driver/mips-cs-header-search.cpp
index e59fadca585c..5538031670db 100644
--- a/test/Driver/mips-cs-header-search.cpp
+++ b/test/Driver/mips-cs-header-search.cpp
@@ -2,8 +2,8 @@
//
// = Big-endian, hard float
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-32 %s
// CHECK-BE-HF-32: "-internal-isystem"
// CHECK-BE-HF-32: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -18,8 +18,8 @@
//
// = Big-endian, hard float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -mips16 \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu -mips16 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-16 %s
// CHECK-BE-HF-16: "-internal-isystem"
// CHECK-BE-HF-16: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -34,8 +34,8 @@
//
// = Big-endian, hard float, micromips
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -mmicromips \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu -mmicromips \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-MICRO %s
// CHECK-BE-HF-MICRO: "-internal-isystem"
// CHECK-BE-HF-MICRO: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -50,8 +50,8 @@
//
// = Big-endian, soft float
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -msoft-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-32 %s
// CHECK-BE-SF-32: "-internal-isystem"
// CHECK-BE-SF-32: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -66,8 +66,8 @@
//
// = Big-endian, soft float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -msoft-float -mips16 \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu -msoft-float -mips16 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-16 %s
// CHECK-BE-SF-16: "-internal-isystem"
// CHECK-BE-SF-16: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -82,8 +82,8 @@
//
// = Big-endian, soft float, micromips
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -msoft-float -mmicromips \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu -msoft-float -mmicromips \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-MICRO %s
// CHECK-BE-SF-MICRO: "-internal-isystem"
// CHECK-BE-SF-MICRO: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -98,8 +98,8 @@
//
// = Big-endian, hard float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mips64-linux-gnu \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips64-linux-gnu \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-64 %s
// CHECK-BE-HF-64: "-internal-isystem"
// CHECK-BE-HF-64: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -114,8 +114,8 @@
//
// = Big-endian, soft float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mips64-linux-gnu -msoft-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips64-linux-gnu -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-64 %s
// CHECK-BE-SF-64: "-internal-isystem"
// CHECK-BE-SF-64: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -130,8 +130,8 @@
//
// = Little-endian, hard float
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mhard-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-32 %s
// CHECK-EL-HF-32: "-internal-isystem"
// CHECK-EL-HF-32: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -146,8 +146,8 @@
//
// = Little-endian, hard float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mips16 \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mips16 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-16 %s
// CHECK-EL-HF-16: "-internal-isystem"
// CHECK-EL-HF-16: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -162,8 +162,8 @@
//
// = Little-endian, hard float, micromips
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mmicromips \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mmicromips \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-MICRO %s
// CHECK-EL-HF-MICRO: "-internal-isystem"
// CHECK-EL-HF-MICRO: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -178,8 +178,8 @@
//
// = Little-endian, soft float
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mfloat-abi=soft \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mfloat-abi=soft \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-32 %s
// CHECK-EL-SF-32: "-internal-isystem"
// CHECK-EL-SF-32: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -194,8 +194,8 @@
//
// = Little-endian, soft float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mips16 -msoft-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mips16 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-16 %s
// CHECK-EL-SF-16: "-internal-isystem"
// CHECK-EL-SF-16: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -210,8 +210,8 @@
//
// = Little-endian, soft float, micromips
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mmicromips -msoft-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mmicromips -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-MICRO %s
// CHECK-EL-SF-MICRO: "-internal-isystem"
// CHECK-EL-SF-MICRO: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -226,8 +226,8 @@
//
// = Little-endian, hard float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mips64el-linux-gnu \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips64el-linux-gnu \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-64 %s
// CHECK-EL-HF-64: "-internal-isystem"
// CHECK-EL-HF-64: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
@@ -242,8 +242,8 @@
//
// = Little-endian, soft float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
-// RUN: -target mips64el-linux-gnu -msoft-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips64el-linux-gnu -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-64 %s
// CHECK-EL-SF-64: "-internal-isystem"
// CHECK-EL-SF-64: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3"
diff --git a/test/Driver/mips-cs-ld.c b/test/Driver/mips-cs-ld.c
index ac3adfd910b7..cdbd5c8c69c4 100644
--- a/test/Driver/mips-cs-ld.c
+++ b/test/Driver/mips-cs-ld.c
@@ -2,287 +2,287 @@
//
// = Big-endian, hard float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-32 %s
// CHECK-BE-HF-32: "{{.*}}ld{{(.exe)?}}"
// CHECK-BE-HF-32: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc"
-// CHECK-BE-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib/crt1.o"
-// CHECK-BE-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib/crti.o"
-// CHECK-BE-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/crtbegin.o"
+// CHECK-BE-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3{{/|\\\\}}crtbegin.o"
// CHECK-BE-HF-32: "-L[[TC]]"
// CHECK-BE-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib"
// CHECK-BE-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/lib"
// CHECK-BE-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/usr/lib"
-// CHECK-BE-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/crtend.o"
-// CHECK-BE-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib/crtn.o"
+// CHECK-BE-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, hard float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -mips16 \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu -mips16 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-16 %s
// CHECK-BE-HF-16: "{{.*}}ld{{(.exe)?}}"
// CHECK-BE-HF-16: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/mips16"
-// CHECK-BE-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/usr/lib/../lib/crt1.o"
-// CHECK-BE-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/usr/lib/../lib/crti.o"
-// CHECK-BE-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/crtbegin.o"
+// CHECK-BE-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16{{/|\\\\}}crtbegin.o"
// CHECK-BE-HF-16: "-L[[TC]]/mips16"
// CHECK-BE-HF-16: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/mips16"
-// CHECK-BE-HF-16: "-L[[TC]]"
-// CHECK-BE-HF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/lib"
-// CHECK-BE-HF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/usr/lib"
-// CHECK-BE-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/crtend.o"
-// CHECK-BE-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/usr/lib/../lib/crtn.o"
+// CHECK-BE-HF-16-NOT: "-L[[TC]]"
+// CHECK-BE-HF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/lib/../lib"
+// CHECK-BE-HF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/usr/lib/../lib"
+// CHECK-BE-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, hard float, mmicromips
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -mmicromips \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu -mmicromips \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-MICRO %s
// CHECK-BE-HF-MICRO: "{{.*}}ld{{(.exe)?}}"
// CHECK-BE-HF-MICRO: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/micromips"
-// CHECK-BE-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/usr/lib/../lib/crt1.o"
-// CHECK-BE-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/usr/lib/../lib/crti.o"
-// CHECK-BE-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/crtbegin.o"
+// CHECK-BE-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips{{/|\\\\}}crtbegin.o"
// CHECK-BE-HF-MICRO: "-L[[TC]]/micromips"
// CHECK-BE-HF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/micromips"
-// CHECK-BE-HF-MICRO: "-L[[TC]]"
-// CHECK-BE-HF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/lib"
-// CHECK-BE-HF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/usr/lib"
-// CHECK-BE-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/crtend.o"
-// CHECK-BE-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/usr/lib/../lib/crtn.o"
+// CHECK-BE-HF-MICRO-NOT: "-L[[TC]]"
+// CHECK-BE-HF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/lib/../lib"
+// CHECK-BE-HF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/usr/lib/../lib"
+// CHECK-BE-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, soft float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -msoft-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-32 %s
// CHECK-BE-SF-32: "{{.*}}ld{{(.exe)?}}"
// CHECK-BE-SF-32: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/soft-float"
-// CHECK-BE-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib/crt1.o"
-// CHECK-BE-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib/crti.o"
-// CHECK-BE-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/crtbegin.o"
+// CHECK-BE-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float{{/|\\\\}}crtbegin.o"
// CHECK-BE-SF-32: "-L[[TC]]/soft-float"
// CHECK-BE-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/soft-float"
-// CHECK-BE-SF-32: "-L[[TC]]"
-// CHECK-BE-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/lib"
-// CHECK-BE-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/usr/lib"
-// CHECK-BE-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/crtend.o"
-// CHECK-BE-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib/crtn.o"
+// CHECK-BE-SF-32-NOT: "-L[[TC]]"
+// CHECK-BE-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/lib/../lib"
+// CHECK-BE-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib"
+// CHECK-BE-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, soft float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -msoft-float -mips16 \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu -msoft-float -mips16 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-16 %s
// CHECK-BE-SF-16: "{{.*}}ld{{(.exe)?}}"
// CHECK-BE-SF-16: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/mips16/soft-float"
-// CHECK-BE-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/usr/lib/../lib/crt1.o"
-// CHECK-BE-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/usr/lib/../lib/crti.o"
-// CHECK-BE-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float/crtbegin.o"
+// CHECK-BE-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float{{/|\\\\}}crtbegin.o"
// CHECK-BE-SF-16: "-L[[TC]]/mips16/soft-float"
// CHECK-BE-SF-16: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/mips16/soft-float"
-// CHECK-BE-SF-16: "-L[[TC]]"
-// CHECK-BE-SF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/soft-float/lib"
-// CHECK-BE-SF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/soft-float/usr/lib"
-// CHECK-BE-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float/crtend.o"
-// CHECK-BE-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/usr/lib/../lib/crtn.o"
+// CHECK-BE-SF-16-NOT: "-L[[TC]]"
+// CHECK-BE-SF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/soft-float/lib/../lib"
+// CHECK-BE-SF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/soft-float/usr/lib/../lib"
+// CHECK-BE-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, soft float, micromips
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -msoft-float -mmicromips \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips-linux-gnu -msoft-float -mmicromips \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-MICRO %s
// CHECK-BE-SF-MICRO: "{{.*}}ld{{(.exe)?}}"
// CHECK-BE-SF-MICRO: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/micromips/soft-float"
-// CHECK-BE-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/usr/lib/../lib/crt1.o"
-// CHECK-BE-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/usr/lib/../lib/crti.o"
-// CHECK-BE-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float/crtbegin.o"
+// CHECK-BE-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float{{/|\\\\}}crtbegin.o"
// CHECK-BE-SF-MICRO: "-L[[TC]]/micromips/soft-float"
// CHECK-BE-SF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/micromips/soft-float"
-// CHECK-BE-SF-MICRO: "-L[[TC]]"
-// CHECK-BE-SF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/soft-float/lib"
-// CHECK-BE-SF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/soft-float/usr/lib"
-// CHECK-BE-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float/crtend.o"
-// CHECK-BE-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/usr/lib/../lib/crtn.o"
+// CHECK-BE-SF-MICRO-NOT: "-L[[TC]]"
+// CHECK-BE-SF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/soft-float/lib/../lib"
+// CHECK-BE-SF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/soft-float/usr/lib/../lib"
+// CHECK-BE-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Big-endian, hard float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips64-linux-gnu \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips64-linux-gnu \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-64 %s
// CHECK-BE-HF-64: "{{.*}}ld{{(.exe)?}}"
// CHECK-BE-HF-64: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc"
-// CHECK-BE-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib64/crt1.o"
-// CHECK-BE-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib64/crti.o"
-// CHECK-BE-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/64/crtbegin.o"
+// CHECK-BE-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib64{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib64{{/|\\\\}}crti.o"
+// CHECK-BE-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/64{{/|\\\\}}crtbegin.o"
// CHECK-BE-HF-64: "-L[[TC]]/64"
// CHECK-BE-HF-64: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib64"
// CHECK-BE-HF-64: "-L[[TC]]/../../../../mips-linux-gnu/libc/lib/../lib64"
// CHECK-BE-HF-64: "-L[[TC]]/../../../../mips-linux-gnu/libc/usr/lib/../lib64"
-// CHECK-BE-HF-64: "-L[[TC]]"
-// CHECK-BE-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/64/crtend.o"
-// CHECK-BE-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib64/crtn.o"
+// CHECK-BE-HF-64-NOT: "-L[[TC]]"
+// CHECK-BE-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/usr/lib/../lib64{{/|\\\\}}crtn.o"
//
// = Big-endian, soft float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips64-linux-gnu -msoft-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips64-linux-gnu -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-BE-SF-64 %s
// CHECK-BE-SF-64: "{{.*}}ld{{(.exe)?}}"
// CHECK-BE-SF-64: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/soft-float"
-// CHECK-BE-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib64/crt1.o"
-// CHECK-BE-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib64/crti.o"
-// CHECK-BE-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/64/crtbegin.o"
+// CHECK-BE-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib64{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib64{{/|\\\\}}crti.o"
+// CHECK-BE-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/64{{/|\\\\}}crtbegin.o"
// CHECK-BE-SF-64: "-L[[TC]]/soft-float/64"
// CHECK-BE-SF-64: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib64/soft-float"
// CHECK-BE-SF-64: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/lib/../lib64"
// CHECK-BE-SF-64: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib64"
-// CHECK-BE-SF-64: "-L[[TC]]"
-// CHECK-BE-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/64/crtend.o"
-// CHECK-BE-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib64/crtn.o"
+// CHECK-BE-SF-64-NOT: "-L[[TC]]"
+// CHECK-BE-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/64{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/usr/lib/../lib64{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mhard-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-32 %s
// CHECK-EL-HF-32: "{{.*}}ld{{(.exe)?}}"
// CHECK-EL-HF-32: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/el"
-// CHECK-EL-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib/crt1.o"
-// CHECK-EL-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib/crti.o"
-// CHECK-EL-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/el/crtbegin.o"
+// CHECK-EL-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/el{{/|\\\\}}crtbegin.o"
// CHECK-EL-HF-32: "-L[[TC]]/el"
// CHECK-EL-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/el"
-// CHECK-EL-HF-32: "-L[[TC]]"
-// CHECK-EL-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/el/lib"
-// CHECK-EL-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/el/usr/lib"
-// CHECK-EL-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/el/crtend.o"
-// CHECK-EL-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib/crtn.o"
+// CHECK-EL-HF-32-NOT: "-L[[TC]]"
+// CHECK-EL-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/el/lib/../lib"
+// CHECK-EL-HF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/el/usr/lib/../lib"
+// CHECK-EL-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mips16 \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mips16 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-16 %s
// CHECK-EL-HF-16: "{{.*}}ld{{(.exe)?}}"
// CHECK-EL-HF-16: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/mips16/el"
-// CHECK-EL-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/el/usr/lib/../lib/crt1.o"
-// CHECK-EL-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/el/usr/lib/../lib/crti.o"
-// CHECK-EL-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/el/crtbegin.o"
+// CHECK-EL-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/el{{/|\\\\}}crtbegin.o"
// CHECK-EL-HF-16: "-L[[TC]]/mips16/el"
// CHECK-EL-HF-16: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/mips16/el"
-// CHECK-EL-HF-16: "-L[[TC]]"
-// CHECK-EL-HF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/el/lib"
-// CHECK-EL-HF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/el/usr/lib"
-// CHECK-EL-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/el/crtend.o"
-// CHECK-EL-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/el/usr/lib/../lib/crtn.o"
+// CHECK-EL-HF-16-NOT: "-L[[TC]]"
+// CHECK-EL-HF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/el/lib/../lib"
+// CHECK-EL-HF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/el/usr/lib/../lib"
+// CHECK-EL-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float, micromips
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mmicromips \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mmicromips \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-MICRO %s
// CHECK-EL-HF-MICRO: "{{.*}}ld{{(.exe)?}}"
// CHECK-EL-HF-MICRO: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/micromips/el"
-// CHECK-EL-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/el/usr/lib/../lib/crt1.o"
-// CHECK-EL-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/el/usr/lib/../lib/crti.o"
-// CHECK-EL-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/el/crtbegin.o"
+// CHECK-EL-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/el{{/|\\\\}}crtbegin.o"
// CHECK-EL-HF-MICRO: "-L[[TC]]/micromips/el"
// CHECK-EL-HF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/micromips/el"
-// CHECK-EL-HF-MICRO: "-L[[TC]]"
-// CHECK-EL-HF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/el/lib"
-// CHECK-EL-HF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/el/usr/lib"
-// CHECK-EL-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/el/crtend.o"
-// CHECK-EL-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/el/usr/lib/../lib/crtn.o"
+// CHECK-EL-HF-MICRO-NOT: "-L[[TC]]"
+// CHECK-EL-HF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/el/lib/../lib"
+// CHECK-EL-HF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/el/usr/lib/../lib"
+// CHECK-EL-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, soft float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mfloat-abi=soft \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mfloat-abi=soft \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-32 %s
// CHECK-EL-SF-32: "{{.*}}ld{{(.exe)?}}"
// CHECK-EL-SF-32: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/soft-float/el"
-// CHECK-EL-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib/crt1.o"
-// CHECK-EL-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib/crti.o"
-// CHECK-EL-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el/crtbegin.o"
+// CHECK-EL-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el{{/|\\\\}}crtbegin.o"
// CHECK-EL-SF-32: "-L[[TC]]/soft-float/el"
// CHECK-EL-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/soft-float/el"
-// CHECK-EL-SF-32: "-L[[TC]]"
-// CHECK-EL-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/el/lib"
-// CHECK-EL-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib"
-// CHECK-EL-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el/crtend.o"
-// CHECK-EL-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib/crtn.o"
+// CHECK-EL-SF-32-NOT: "-L[[TC]]"
+// CHECK-EL-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/el/lib/../lib"
+// CHECK-EL-SF-32: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib"
+// CHECK-EL-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-32: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, soft float, mips16
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mips16 -msoft-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mips16 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-16 %s
// CHECK-EL-SF-16: "{{.*}}ld{{(.exe)?}}"
// CHECK-EL-SF-16: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/mips16/soft-float/el"
-// CHECK-EL-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/../lib/crt1.o"
-// CHECK-EL-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/../lib/crti.o"
-// CHECK-EL-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float/el/crtbegin.o"
+// CHECK-EL-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float/el{{/|\\\\}}crtbegin.o"
// CHECK-EL-SF-16: "-L[[TC]]/mips16/soft-float/el"
// CHECK-EL-SF-16: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/mips16/soft-float/el"
-// CHECK-EL-SF-16: "-L[[TC]]"
-// CHECK-EL-SF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/soft-float/el/lib"
-// CHECK-EL-SF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/soft-float/el/usr/lib"
-// CHECK-EL-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float/el/crtend.o"
-// CHECK-EL-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/../lib/crtn.o"
+// CHECK-EL-SF-16-NOT: "-L[[TC]]"
+// CHECK-EL-SF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/soft-float/el/lib/../lib"
+// CHECK-EL-SF-16: "-L[[TC]]/../../../../mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/../lib"
+// CHECK-EL-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/mips16/soft-float/el{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-16: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/mips16/soft-float/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, soft float, micromips
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mipsel-linux-gnu -mmicromips -msoft-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mipsel-linux-gnu -mmicromips -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-MICRO %s
// CHECK-EL-SF-MICRO: "{{.*}}ld{{(.exe)?}}"
// CHECK-EL-SF-MICRO: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/micromips/soft-float/el"
-// CHECK-EL-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/../lib/crt1.o"
-// CHECK-EL-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/../lib/crti.o"
-// CHECK-EL-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float/el/crtbegin.o"
+// CHECK-EL-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float/el{{/|\\\\}}crtbegin.o"
// CHECK-EL-SF-MICRO: "-L[[TC]]/micromips/soft-float/el"
// CHECK-EL-SF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib/micromips/soft-float/el"
-// CHECK-EL-SF-MICRO: "-L[[TC]]"
-// CHECK-EL-SF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/soft-float/el/lib"
-// CHECK-EL-SF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/soft-float/el/usr/lib"
-// CHECK-EL-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float/el/crtend.o"
-// CHECK-EL-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/../lib/crtn.o"
+// CHECK-EL-SF-MICRO-NOT: "-L[[TC]]"
+// CHECK-EL-SF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/soft-float/el/lib/../lib"
+// CHECK-EL-SF-MICRO: "-L[[TC]]/../../../../mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/../lib"
+// CHECK-EL-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/micromips/soft-float/el{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-MICRO: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/micromips/soft-float/el/usr/lib/../lib{{/|\\\\}}crtn.o"
//
// = Little-endian, hard float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips64el-linux-gnu \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips64el-linux-gnu \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-HF-64 %s
// CHECK-EL-HF-64: "{{.*}}ld{{(.exe)?}}"
// CHECK-EL-HF-64: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/el"
-// CHECK-EL-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib64/crt1.o"
-// CHECK-EL-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib64/crti.o"
-// CHECK-EL-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/el/64/crtbegin.o"
+// CHECK-EL-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib64{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib64{{/|\\\\}}crti.o"
+// CHECK-EL-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/el/64{{/|\\\\}}crtbegin.o"
// CHECK-EL-HF-64: "-L[[TC]]/el/64"
// CHECK-EL-HF-64: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib64/el"
// CHECK-EL-HF-64: "-L[[TC]]/../../../../mips-linux-gnu/libc/el/lib/../lib64"
// CHECK-EL-HF-64: "-L[[TC]]/../../../../mips-linux-gnu/libc/el/usr/lib/../lib64"
-// CHECK-EL-HF-64: "-L[[TC]]"
-// CHECK-EL-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/el/64/crtend.o"
-// CHECK-EL-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib64/crtn.o"
+// CHECK-EL-HF-64-NOT: "-L[[TC]]"
+// CHECK-EL-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/el/64{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/el/usr/lib/../lib64{{/|\\\\}}crtn.o"
//
// = Little-endian, soft float, 64-bit
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target mips64el-linux-gnu -msoft-float \
-// RUN: -gcc-toolchain %S/Inputs/mips_cs_tree \
+// RUN: --target=mips64el-linux-gnu -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \
// RUN: | FileCheck --check-prefix=CHECK-EL-SF-64 %s
// CHECK-EL-SF-64: "{{.*}}ld{{(.exe)?}}"
// CHECK-EL-SF-64: "--sysroot=[[TC:[^"]+]]/../../../../mips-linux-gnu/libc/soft-float/el"
-// CHECK-EL-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib64/crt1.o"
-// CHECK-EL-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib64/crti.o"
-// CHECK-EL-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el/64/crtbegin.o"
+// CHECK-EL-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib64{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib64{{/|\\\\}}crti.o"
+// CHECK-EL-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el/64{{/|\\\\}}crtbegin.o"
// CHECK-EL-SF-64: "-L[[TC]]/soft-float/el/64"
// CHECK-EL-SF-64: "-L[[TC]]/../../../../mips-linux-gnu/lib/../lib64/soft-float/el"
// CHECK-EL-SF-64: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/el/lib/../lib64"
// CHECK-EL-SF-64: "-L[[TC]]/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib64"
-// CHECK-EL-SF-64: "-L[[TC]]"
-// CHECK-EL-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el/64/crtend.o"
-// CHECK-EL-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib64/crtn.o"
+// CHECK-EL-SF-64-NOT: "-L[[TC]]"
+// CHECK-EL-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/soft-float/el/64{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-64: "{{.*}}/lib/gcc/mips-linux-gnu/4.6.3/../../../../mips-linux-gnu/libc/soft-float/el/usr/lib/../lib64{{/|\\\\}}crtn.o"
diff --git a/test/Driver/mips-features.c b/test/Driver/mips-features.c
index 31bf1935ea03..d663e6651e53 100644
--- a/test/Driver/mips-features.c
+++ b/test/Driver/mips-features.c
@@ -48,6 +48,30 @@
// RUN: | FileCheck --check-prefix=CHECK-NOMDSPR2 %s
// CHECK-NOMDSPR2: "-target-feature" "-dspr2"
//
+// -mmsa
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mno-msa -mmsa 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MMSA %s
+// CHECK-MMSA: "-target-feature" "+msa"
+//
+// -mno-msa
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mmsa -mno-msa 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NOMMSA %s
+// CHECK-NOMMSA: "-target-feature" "-msa"
+//
+// -mfp64
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mfp32 -mfp64 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MFP64 %s
+// CHECK-MFP64: "-target-feature" "+fp64"
+//
+// -mfp32
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mfp64 -mfp32 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NOMFP64 %s
+// CHECK-NOMFP64: "-target-feature" "-fp64"
+//
// -mxgot
// RUN: %clang -target mips-linux-gnu -### -c %s \
// RUN: -mno-xgot -mxgot 2>&1 \
@@ -60,6 +84,30 @@
// RUN: | FileCheck --check-prefix=CHECK-NOXGOT %s
// CHECK-NOXGOT-NOT: "-mllvm" "-mxgot"
//
+// -mldc1-sdc1
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mno-ldc1-sdc1 -mldc1-sdc1 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-LDC1SDC1 %s
+// CHECK-LDC1SDC1-NOT: "-mllvm" "-mno-ldc1-sdc1"
+//
+// -mno-ldc1-sdc1
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mldc1-sdc1 -mno-ldc1-sdc1 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NOLDC1SDC1 %s
+// CHECK-NOLDC1SDC1: "-mllvm" "-mno-ldc1-sdc1"
+//
+// -mcheck-zero-division
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mno-check-zero-division -mcheck-zero-division 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ZERODIV %s
+// CHECK-ZERODIV-NOT: "-mllvm" "-mno-check-zero-division"
+//
+// -mno-check-zero-division
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mcheck-zero-division -mno-check-zero-division 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NOZERODIV %s
+// CHECK-NOZERODIV: "-mllvm" "-mno-check-zero-division"
+//
// -G
// RUN: %clang -target mips-linux-gnu -### -c %s \
// RUN: -G 16 2>&1 \
diff --git a/test/Driver/mips-float.c b/test/Driver/mips-float.c
index 9e62c0a95e04..ad2106a00e81 100644
--- a/test/Driver/mips-float.c
+++ b/test/Driver/mips-float.c
@@ -17,9 +17,9 @@
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target mips-linux-gnu -msoft-float \
// RUN: | FileCheck --check-prefix=CHECK-SOFT %s
+// CHECK-SOFT: "-target-feature" "+soft-float"
// CHECK-SOFT: "-msoft-float"
// CHECK-SOFT: "-mfloat-abi" "soft"
-// CHECK-SOFT: "-target-feature" "+soft-float"
//
// -mfloat-abi=hard
// RUN: %clang -c %s -### -o %t.o 2>&1 \
@@ -31,9 +31,9 @@
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target mips-linux-gnu -mfloat-abi=soft \
// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT %s
+// CHECK-ABI-SOFT: "-target-feature" "+soft-float"
// CHECK-ABI-SOFT: "-msoft-float"
// CHECK-ABI-SOFT: "-mfloat-abi" "soft"
-// CHECK-ABI-SOFT: "-target-feature" "+soft-float"
//
// -mdouble-float
// RUN: %clang -c %s -### -o %t.o 2>&1 \
@@ -46,15 +46,15 @@
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target mips-linux-gnu -mdouble-float -msingle-float \
// RUN: | FileCheck --check-prefix=CHECK-ABI-SINGLE %s
-// CHECK-ABI-SINGLE: "-mfloat-abi" "hard"
// CHECK-ABI-SINGLE: "-target-feature" "+single-float"
+// CHECK-ABI-SINGLE: "-mfloat-abi" "hard"
//
// -msoft-float -msingle-float
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target mips-linux-gnu -msoft-float -msingle-float \
// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT-SINGLE %s
-// CHECK-ABI-SOFT-SINGLE: "-mfloat-abi" "soft"
// CHECK-ABI-SOFT-SINGLE: "-target-feature" "+single-float"
+// CHECK-ABI-SOFT-SINGLE: "-mfloat-abi" "soft"
//
// Default -mips16
// RUN: %clang -c %s -### -o %t.o 2>&1 \
@@ -67,32 +67,32 @@
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target mips-linux-gnu -mhard-float -mips16 \
// RUN: | FileCheck --check-prefix=CHECK-HARD-MIPS16 %s
+// CHECK-HARD-MIPS16: "-target-feature" "+soft-float"
// CHECK-HARD-MIPS16: "-msoft-float"
// CHECK-HARD-MIPS16: "-mfloat-abi" "soft"
-// CHECK-HARD-MIPS16: "-target-feature" "+soft-float"
// CHECK-HARD-MIPS16: "-mllvm" "-mips16-hard-float"
//
// -msoft-float -mips16
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target mips-linux-gnu -msoft-float -mips16 \
// RUN: | FileCheck --check-prefix=CHECK-SOFT-MIPS16 %s
+// CHECK-SOFT-MIPS16: "-target-feature" "+soft-float"
// CHECK-SOFT-MIPS16: "-msoft-float"
// CHECK-SOFT-MIPS16: "-mfloat-abi" "soft"
-// CHECK-SOFT-MIPS16: "-target-feature" "+soft-float"
//
// -mfloat-abi=hard -mips16
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target mips-linux-gnu -mfloat-abi=hard -mips16 \
// RUN: | FileCheck --check-prefix=CHECK-ABI-HARD-MIPS16 %s
+// CHECK-ABI-HARD-MIPS16: "-target-feature" "+soft-float"
// CHECK-ABI-HARD-MIPS16: "-msoft-float"
// CHECK-ABI-HARD-MIPS16: "-mfloat-abi" "soft"
-// CHECK-ABI-HARD-MIPS16: "-target-feature" "+soft-float"
// CHECK-ABI-HARD-MIPS16: "-mllvm" "-mips16-hard-float"
//
// -mfloat-abi=soft -mips16
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target mips-linux-gnu -mfloat-abi=soft -mips16 \
// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT-MIPS16 %s
+// CHECK-ABI-SOFT-MIPS16: "-target-feature" "+soft-float"
// CHECK-ABI-SOFT-MIPS16: "-msoft-float"
// CHECK-ABI-SOFT-MIPS16: "-mfloat-abi" "soft"
-// CHECK-ABI-SOFT-MIPS16: "-target-feature" "+soft-float"
diff --git a/test/Driver/mips-fsf.cpp b/test/Driver/mips-fsf.cpp
new file mode 100644
index 000000000000..b9fb11fd7c72
--- /dev/null
+++ b/test/Driver/mips-fsf.cpp
@@ -0,0 +1,2341 @@
+// Check frontend and linker invocations on FSF MIPS toolchain.
+//
+// = Big-endian, mips32, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF-32 %s
+// CHECK-BE-HF-32: "-internal-isystem"
+// CHECK-BE-HF-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF-32: "-internal-isystem"
+// CHECK-BE-HF-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32"
+// CHECK-BE-HF-32: "-internal-isystem"
+// CHECK-BE-HF-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF-32: "-internal-externc-isystem"
+// CHECK-BE-HF-32: "[[TC]]/include"
+// CHECK-BE-HF-32: "-internal-externc-isystem"
+// CHECK-BE-HF-32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF-32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32"
+// CHECK-BE-HF-32: "[[TC]]/../../../../sysroot/mips32/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-32: "[[TC]]/../../../../sysroot/mips32/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-32: "[[TC]]/mips32{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF-32: "-L[[SR]]/mips32"
+// CHECK-BE-HF-32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32"
+// CHECK-BE-HF-32: "-L[[SR]]/../../../../sysroot/mips32/usr/lib/../lib"
+// CHECK-BE-HF-32: "[[TC]]/mips32{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-32: "[[TC]]/../../../../sysroot/mips32/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32, hard float, fp64
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF64-32 %s
+// CHECK-BE-HF64-32: "-internal-isystem"
+// CHECK-BE-HF64-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF64-32: "-internal-isystem"
+// CHECK-BE-HF64-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/fp64"
+// CHECK-BE-HF64-32: "-internal-isystem"
+// CHECK-BE-HF64-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF64-32: "-internal-externc-isystem"
+// CHECK-BE-HF64-32: "[[TC]]/include"
+// CHECK-BE-HF64-32: "-internal-externc-isystem"
+// CHECK-BE-HF64-32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF64-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF64-32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/fp64"
+// CHECK-BE-HF64-32: "[[TC]]/../../../../sysroot/mips32/fp64/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF64-32: "[[TC]]/../../../../sysroot/mips32/fp64/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF64-32: "[[TC]]/mips32/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF64-32: "-L[[SR]]/mips32/fp64"
+// CHECK-BE-HF64-32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/fp64"
+// CHECK-BE-HF64-32: "-L[[SR]]/../../../../sysroot/mips32/fp64/usr/lib/../lib"
+// CHECK-BE-HF64-32: "[[TC]]/mips32/fp64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF64-32: "[[TC]]/../../../../sysroot/mips32/fp64/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-SF-32 %s
+// CHECK-BE-SF-32: "-internal-isystem"
+// CHECK-BE-SF-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-SF-32: "-internal-isystem"
+// CHECK-BE-SF-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/sof"
+// CHECK-BE-SF-32: "-internal-isystem"
+// CHECK-BE-SF-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-SF-32: "-internal-externc-isystem"
+// CHECK-BE-SF-32: "[[TC]]/include"
+// CHECK-BE-SF-32: "-internal-externc-isystem"
+// CHECK-BE-SF-32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-SF-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-SF-32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/sof"
+// CHECK-BE-SF-32: "[[TC]]/../../../../sysroot/mips32/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-32: "[[TC]]/../../../../sysroot/mips32/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-32: "[[TC]]/mips32/sof{{/|\\\\}}crtbegin.o"
+// CHECK-BE-SF-32: "-L[[SR]]/mips32/sof"
+// CHECK-BE-SF-32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/sof"
+// CHECK-BE-SF-32: "-L[[SR]]/../../../../sysroot/mips32/sof/usr/lib/../lib"
+// CHECK-BE-SF-32: "[[TC]]/mips32/sof{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-32: "[[TC]]/../../../../sysroot/mips32/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips16 / mips32, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32 -mips16 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF-16 %s
+// CHECK-BE-HF-16: "-internal-isystem"
+// CHECK-BE-HF-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF-16: "-internal-isystem"
+// CHECK-BE-HF-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16"
+// CHECK-BE-HF-16: "-internal-isystem"
+// CHECK-BE-HF-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF-16: "-internal-externc-isystem"
+// CHECK-BE-HF-16: "[[TC]]/include"
+// CHECK-BE-HF-16: "-internal-externc-isystem"
+// CHECK-BE-HF-16: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF-16: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF-16: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/mips16"
+// CHECK-BE-HF-16: "[[TC]]/../../../../sysroot/mips32/mips16/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-16: "[[TC]]/../../../../sysroot/mips32/mips16/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-16: "[[TC]]/mips32/mips16{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF-16: "-L[[SR]]/mips32/mips16"
+// CHECK-BE-HF-16: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/mips16"
+// CHECK-BE-HF-16: "-L[[SR]]/../../../../sysroot/mips32/mips16/usr/lib/../lib"
+// CHECK-BE-HF-16: "[[TC]]/mips32/mips16{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-16: "[[TC]]/../../../../sysroot/mips32/mips16/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips16 / mips32, hard float, fp64
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32 -mips16 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF64-16 %s
+// CHECK-BE-HF64-16: "-internal-isystem"
+// CHECK-BE-HF64-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF64-16: "-internal-isystem"
+// CHECK-BE-HF64-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/fp64"
+// CHECK-BE-HF64-16: "-internal-isystem"
+// CHECK-BE-HF64-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF64-16: "-internal-externc-isystem"
+// CHECK-BE-HF64-16: "[[TC]]/include"
+// CHECK-BE-HF64-16: "-internal-externc-isystem"
+// CHECK-BE-HF64-16: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF64-16: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF64-16: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/mips16/fp64"
+// CHECK-BE-HF64-16: "[[TC]]/../../../../sysroot/mips32/mips16/fp64/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF64-16: "[[TC]]/../../../../sysroot/mips32/mips16/fp64/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF64-16: "[[TC]]/mips32/mips16/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF64-16: "-L[[SR]]/mips32/mips16/fp64"
+// CHECK-BE-HF64-16: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/mips16/fp64"
+// CHECK-BE-HF64-16: "-L[[SR]]/../../../../sysroot/mips32/mips16/fp64/usr/lib/../lib"
+// CHECK-BE-HF64-16: "[[TC]]/mips32/mips16/fp64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF64-16: "[[TC]]/../../../../sysroot/mips32/mips16/fp64/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips16 / mips32, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32 -mips16 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-SF-16 %s
+// CHECK-BE-SF-16: "-internal-isystem"
+// CHECK-BE-SF-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-SF-16: "-internal-isystem"
+// CHECK-BE-SF-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/sof"
+// CHECK-BE-SF-16: "-internal-isystem"
+// CHECK-BE-SF-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-SF-16: "-internal-externc-isystem"
+// CHECK-BE-SF-16: "[[TC]]/include"
+// CHECK-BE-SF-16: "-internal-externc-isystem"
+// CHECK-BE-SF-16: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-SF-16: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-SF-16: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/mips16/sof"
+// CHECK-BE-SF-16: "[[TC]]/../../../../sysroot/mips32/mips16/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-16: "[[TC]]/../../../../sysroot/mips32/mips16/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-16: "[[TC]]/mips32/mips16/sof{{/|\\\\}}crtbegin.o"
+// CHECK-BE-SF-16: "-L[[SR]]/mips32/mips16/sof"
+// CHECK-BE-SF-16: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/mips16/sof"
+// CHECK-BE-SF-16: "-L[[SR]]/../../../../sysroot/mips32/mips16/sof/usr/lib/../lib"
+// CHECK-BE-SF-16: "[[TC]]/mips32/mips16/sof{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-16: "[[TC]]/../../../../sysroot/mips32/mips16/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32 / mips16, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32 -mips16 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN-16 %s
+// CHECK-BE-NAN-16: "-internal-isystem"
+// CHECK-BE-NAN-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN-16: "-internal-isystem"
+// CHECK-BE-NAN-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/nan2008"
+// CHECK-BE-NAN-16: "-internal-isystem"
+// CHECK-BE-NAN-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN-16: "-internal-externc-isystem"
+// CHECK-BE-NAN-16: "[[TC]]/include"
+// CHECK-BE-NAN-16: "-internal-externc-isystem"
+// CHECK-BE-NAN-16: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN-16: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN-16: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/mips16/nan2008"
+// CHECK-BE-NAN-16: "[[TC]]/../../../../sysroot/mips32/mips16/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN-16: "[[TC]]/../../../../sysroot/mips32/mips16/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN-16: "[[TC]]/mips32/mips16/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN-16: "-L[[SR]]/mips32/mips16/nan2008"
+// CHECK-BE-NAN-16: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/mips16/nan2008"
+// CHECK-BE-NAN-16: "-L[[SR]]/../../../../sysroot/mips32/mips16/nan2008/usr/lib/../lib"
+// CHECK-BE-NAN-16: "[[TC]]/mips32/mips16/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN-16: "[[TC]]/../../../../sysroot/mips32/mips16/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32 / mips16, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32 -mips16 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-16 %s
+// CHECK-BE-NAN64-16: "-internal-isystem"
+// CHECK-BE-NAN64-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN64-16: "-internal-isystem"
+// CHECK-BE-NAN64-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/fp64/nan2008"
+// CHECK-BE-NAN64-16: "-internal-isystem"
+// CHECK-BE-NAN64-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN64-16: "-internal-externc-isystem"
+// CHECK-BE-NAN64-16: "[[TC]]/include"
+// CHECK-BE-NAN64-16: "-internal-externc-isystem"
+// CHECK-BE-NAN64-16: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN64-16: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN64-16: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/mips16/fp64/nan2008"
+// CHECK-BE-NAN64-16: "[[TC]]/../../../../sysroot/mips32/mips16/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN64-16: "[[TC]]/../../../../sysroot/mips32/mips16/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN64-16: "[[TC]]/mips32/mips16/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN64-16: "-L[[SR]]/mips32/mips16/fp64/nan2008"
+// CHECK-BE-NAN64-16: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/mips16/fp64/nan2008"
+// CHECK-BE-NAN64-16: "-L[[SR]]/../../../../sysroot/mips32/mips16/fp64/nan2008/usr/lib/../lib"
+// CHECK-BE-NAN64-16: "[[TC]]/mips32/mips16/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN64-16: "[[TC]]/../../../../sysroot/mips32/mips16/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN-32 %s
+// CHECK-BE-NAN-32: "-internal-isystem"
+// CHECK-BE-NAN-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN-32: "-internal-isystem"
+// CHECK-BE-NAN-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/nan2008"
+// CHECK-BE-NAN-32: "-internal-isystem"
+// CHECK-BE-NAN-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN-32: "-internal-externc-isystem"
+// CHECK-BE-NAN-32: "[[TC]]/include"
+// CHECK-BE-NAN-32: "-internal-externc-isystem"
+// CHECK-BE-NAN-32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN-32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/nan2008"
+// CHECK-BE-NAN-32: "[[TC]]/../../../../sysroot/mips32/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN-32: "[[TC]]/../../../../sysroot/mips32/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN-32: "[[TC]]/mips32/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN-32: "-L[[SR]]/mips32/nan2008"
+// CHECK-BE-NAN-32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/nan2008"
+// CHECK-BE-NAN-32: "-L[[SR]]/../../../../sysroot/mips32/nan2008/usr/lib/../lib"
+// CHECK-BE-NAN-32: "[[TC]]/mips32/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN-32: "[[TC]]/../../../../sysroot/mips32/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-32 %s
+// CHECK-BE-NAN64-32: "-internal-isystem"
+// CHECK-BE-NAN64-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN64-32: "-internal-isystem"
+// CHECK-BE-NAN64-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/fp64/nan2008"
+// CHECK-BE-NAN64-32: "-internal-isystem"
+// CHECK-BE-NAN64-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN64-32: "-internal-externc-isystem"
+// CHECK-BE-NAN64-32: "[[TC]]/include"
+// CHECK-BE-NAN64-32: "-internal-externc-isystem"
+// CHECK-BE-NAN64-32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN64-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN64-32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/fp64/nan2008"
+// CHECK-BE-NAN64-32: "[[TC]]/../../../../sysroot/mips32/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN64-32: "[[TC]]/../../../../sysroot/mips32/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN64-32: "[[TC]]/mips32/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN64-32: "-L[[SR]]/mips32/fp64/nan2008"
+// CHECK-BE-NAN64-32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/fp64/nan2008"
+// CHECK-BE-NAN64-32: "-L[[SR]]/../../../../sysroot/mips32/fp64/nan2008/usr/lib/../lib"
+// CHECK-BE-NAN64-32: "[[TC]]/mips32/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN64-32: "[[TC]]/../../../../sysroot/mips32/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32r2, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R2 %s
+// CHECK-BE-HF-32R2: "-internal-isystem"
+// CHECK-BE-HF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF-32R2: "-internal-isystem"
+// CHECK-BE-HF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu"
+// CHECK-BE-HF-32R2: "-internal-isystem"
+// CHECK-BE-HF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF-32R2: "-internal-externc-isystem"
+// CHECK-BE-HF-32R2: "[[TC]]/include"
+// CHECK-BE-HF-32R2: "-internal-externc-isystem"
+// CHECK-BE-HF-32R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF-32R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot"
+// CHECK-BE-HF-32R2: "[[TC]]/../../../../sysroot/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-32R2: "[[TC]]/../../../../sysroot/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-32R2: "[[TC]]{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF-32R2: "-L[[SR]]"
+// CHECK-BE-HF-32R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib"
+// CHECK-BE-HF-32R2: "-L[[SR]]/../../../../sysroot/usr/lib/../lib"
+// CHECK-BE-HF-32R2: "[[TC]]{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-32R2: "[[TC]]/../../../../sysroot/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32r2, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF64-32R2 %s
+// CHECK-BE-HF64-32R2: "-internal-isystem"
+// CHECK-BE-HF64-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF64-32R2: "-internal-isystem"
+// CHECK-BE-HF64-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/fp64"
+// CHECK-BE-HF64-32R2: "-internal-isystem"
+// CHECK-BE-HF64-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF64-32R2: "-internal-externc-isystem"
+// CHECK-BE-HF64-32R2: "[[TC]]/include"
+// CHECK-BE-HF64-32R2: "-internal-externc-isystem"
+// CHECK-BE-HF64-32R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF64-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF64-32R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/fp64"
+// CHECK-BE-HF64-32R2: "[[TC]]/../../../../sysroot/fp64/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF64-32R2: "[[TC]]/../../../../sysroot/fp64/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF64-32R2: "[[TC]]/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF64-32R2: "-L[[SR]]/fp64"
+// CHECK-BE-HF64-32R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/fp64"
+// CHECK-BE-HF64-32R2: "-L[[SR]]/../../../../sysroot/fp64/usr/lib/../lib"
+// CHECK-BE-HF64-32R2: "[[TC]]/fp64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF64-32R2: "[[TC]]/../../../../sysroot/fp64/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32r2, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-SF-32R2 %s
+// CHECK-BE-SF-32R2: "-internal-isystem"
+// CHECK-BE-SF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-SF-32R2: "-internal-isystem"
+// CHECK-BE-SF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/sof"
+// CHECK-BE-SF-32R2: "-internal-isystem"
+// CHECK-BE-SF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-SF-32R2: "-internal-externc-isystem"
+// CHECK-BE-SF-32R2: "[[TC]]/include"
+// CHECK-BE-SF-32R2: "-internal-externc-isystem"
+// CHECK-BE-SF-32R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-SF-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-SF-32R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/sof"
+// CHECK-BE-SF-32R2: "[[TC]]/../../../../sysroot/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-32R2: "[[TC]]/../../../../sysroot/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-32R2: "[[TC]]/sof{{/|\\\\}}crtbegin.o"
+// CHECK-BE-SF-32R2: "-L[[SR]]/sof"
+// CHECK-BE-SF-32R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/sof"
+// CHECK-BE-SF-32R2: "-L[[SR]]/../../../../sysroot/sof/usr/lib/../lib"
+// CHECK-BE-SF-32R2: "[[TC]]/sof{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-32R2: "[[TC]]/../../../../sysroot/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32r2 / mips16, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mips16 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF-16R2 %s
+// CHECK-BE-HF-16R2: "-internal-isystem"
+// CHECK-BE-HF-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF-16R2: "-internal-isystem"
+// CHECK-BE-HF-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16"
+// CHECK-BE-HF-16R2: "-internal-isystem"
+// CHECK-BE-HF-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF-16R2: "-internal-externc-isystem"
+// CHECK-BE-HF-16R2: "[[TC]]/include"
+// CHECK-BE-HF-16R2: "-internal-externc-isystem"
+// CHECK-BE-HF-16R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF-16R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF-16R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips16"
+// CHECK-BE-HF-16R2: "[[TC]]/../../../../sysroot/mips16/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-16R2: "[[TC]]/../../../../sysroot/mips16/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-16R2: "[[TC]]/mips16{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF-16R2: "-L[[SR]]/mips16"
+// CHECK-BE-HF-16R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips16"
+// CHECK-BE-HF-16R2: "-L[[SR]]/../../../../sysroot/mips16/usr/lib/../lib"
+// CHECK-BE-HF-16R2: "[[TC]]/mips16{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-16R2: "[[TC]]/../../../../sysroot/mips16/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32r2 / mips16, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mips16 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF64-16R2 %s
+// CHECK-BE-HF64-16R2: "-internal-isystem"
+// CHECK-BE-HF64-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF64-16R2: "-internal-isystem"
+// CHECK-BE-HF64-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/fp64"
+// CHECK-BE-HF64-16R2: "-internal-isystem"
+// CHECK-BE-HF64-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF64-16R2: "-internal-externc-isystem"
+// CHECK-BE-HF64-16R2: "[[TC]]/include"
+// CHECK-BE-HF64-16R2: "-internal-externc-isystem"
+// CHECK-BE-HF64-16R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF64-16R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF64-16R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips16/fp64"
+// CHECK-BE-HF64-16R2: "[[TC]]/../../../../sysroot/mips16/fp64/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF64-16R2: "[[TC]]/../../../../sysroot/mips16/fp64/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF64-16R2: "[[TC]]/mips16/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF64-16R2: "-L[[SR]]/mips16/fp64"
+// CHECK-BE-HF64-16R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips16/fp64"
+// CHECK-BE-HF64-16R2: "-L[[SR]]/../../../../sysroot/mips16/fp64/usr/lib/../lib"
+// CHECK-BE-HF64-16R2: "[[TC]]/mips16/fp64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF64-16R2: "[[TC]]/../../../../sysroot/mips16/fp64/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32r2 / mips16, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mips16 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-SF-16R2 %s
+// CHECK-BE-SF-16R2: "-internal-isystem"
+// CHECK-BE-SF-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-SF-16R2: "-internal-isystem"
+// CHECK-BE-SF-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/sof"
+// CHECK-BE-SF-16R2: "-internal-isystem"
+// CHECK-BE-SF-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-SF-16R2: "-internal-externc-isystem"
+// CHECK-BE-SF-16R2: "[[TC]]/include"
+// CHECK-BE-SF-16R2: "-internal-externc-isystem"
+// CHECK-BE-SF-16R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-SF-16R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-SF-16R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips16/sof"
+// CHECK-BE-SF-16R2: "[[TC]]/../../../../sysroot/mips16/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-16R2: "[[TC]]/../../../../sysroot/mips16/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-16R2: "[[TC]]/mips16/sof{{/|\\\\}}crtbegin.o"
+// CHECK-BE-SF-16R2: "-L[[SR]]/mips16/sof"
+// CHECK-BE-SF-16R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips16/sof"
+// CHECK-BE-SF-16R2: "-L[[SR]]/../../../../sysroot/mips16/sof/usr/lib/../lib"
+// CHECK-BE-SF-16R2: "[[TC]]/mips16/sof{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-16R2: "[[TC]]/../../../../sysroot/mips16/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32r2 / mips16, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mips16 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN-16R2 %s
+// CHECK-BE-NAN-16R2: "-internal-isystem"
+// CHECK-BE-NAN-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN-16R2: "-internal-isystem"
+// CHECK-BE-NAN-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/nan2008"
+// CHECK-BE-NAN-16R2: "-internal-isystem"
+// CHECK-BE-NAN-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN-16R2: "-internal-externc-isystem"
+// CHECK-BE-NAN-16R2: "[[TC]]/include"
+// CHECK-BE-NAN-16R2: "-internal-externc-isystem"
+// CHECK-BE-NAN-16R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN-16R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN-16R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips16/nan2008"
+// CHECK-BE-NAN-16R2: "[[TC]]/../../../../sysroot/mips16/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN-16R2: "[[TC]]/../../../../sysroot/mips16/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN-16R2: "[[TC]]/mips16/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN-16R2: "-L[[SR]]/mips16/nan2008"
+// CHECK-BE-NAN-16R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips16/nan2008"
+// CHECK-BE-NAN-16R2: "-L[[SR]]/../../../../sysroot/mips16/nan2008/usr/lib/../lib"
+// CHECK-BE-NAN-16R2: "[[TC]]/mips16/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN-16R2: "[[TC]]/../../../../sysroot/mips16/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32r2 / mips16, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mips16 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-16R2 %s
+// CHECK-BE-NAN64-16R2: "-internal-isystem"
+// CHECK-BE-NAN64-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN64-16R2: "-internal-isystem"
+// CHECK-BE-NAN64-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/fp64/nan2008"
+// CHECK-BE-NAN64-16R2: "-internal-isystem"
+// CHECK-BE-NAN64-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN64-16R2: "-internal-externc-isystem"
+// CHECK-BE-NAN64-16R2: "[[TC]]/include"
+// CHECK-BE-NAN64-16R2: "-internal-externc-isystem"
+// CHECK-BE-NAN64-16R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN64-16R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN64-16R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips16/fp64/nan2008"
+// CHECK-BE-NAN64-16R2: "[[TC]]/../../../../sysroot/mips16/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN64-16R2: "[[TC]]/../../../../sysroot/mips16/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN64-16R2: "[[TC]]/mips16/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN64-16R2: "-L[[SR]]/mips16/fp64/nan2008"
+// CHECK-BE-NAN64-16R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips16/fp64/nan2008"
+// CHECK-BE-NAN64-16R2: "-L[[SR]]/../../../../sysroot/mips16/fp64/nan2008/usr/lib/../lib"
+// CHECK-BE-NAN64-16R2: "[[TC]]/mips16/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN64-16R2: "[[TC]]/../../../../sysroot/mips16/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32r2, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN-32R2 %s
+// CHECK-BE-NAN-32R2: "-internal-isystem"
+// CHECK-BE-NAN-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN-32R2: "-internal-isystem"
+// CHECK-BE-NAN-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/nan2008"
+// CHECK-BE-NAN-32R2: "-internal-isystem"
+// CHECK-BE-NAN-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN-32R2: "-internal-externc-isystem"
+// CHECK-BE-NAN-32R2: "[[TC]]/include"
+// CHECK-BE-NAN-32R2: "-internal-externc-isystem"
+// CHECK-BE-NAN-32R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN-32R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/nan2008"
+// CHECK-BE-NAN-32R2: "[[TC]]/../../../../sysroot/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN-32R2: "[[TC]]/../../../../sysroot/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN-32R2: "[[TC]]/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN-32R2: "-L[[SR]]/nan2008"
+// CHECK-BE-NAN-32R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/nan2008"
+// CHECK-BE-NAN-32R2: "-L[[SR]]/../../../../sysroot/nan2008/usr/lib/../lib"
+// CHECK-BE-NAN-32R2: "[[TC]]/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN-32R2: "[[TC]]/../../../../sysroot/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips32r2, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mips32r2 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-32R2 %s
+// CHECK-BE-NAN64-32R2: "-internal-isystem"
+// CHECK-BE-NAN64-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN64-32R2: "-internal-isystem"
+// CHECK-BE-NAN64-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/fp64/nan2008"
+// CHECK-BE-NAN64-32R2: "-internal-isystem"
+// CHECK-BE-NAN64-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN64-32R2: "-internal-externc-isystem"
+// CHECK-BE-NAN64-32R2: "[[TC]]/include"
+// CHECK-BE-NAN64-32R2: "-internal-externc-isystem"
+// CHECK-BE-NAN64-32R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN64-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN64-32R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/fp64/nan2008"
+// CHECK-BE-NAN64-32R2: "[[TC]]/../../../../sysroot/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN64-32R2: "[[TC]]/../../../../sysroot/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN64-32R2: "[[TC]]/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN64-32R2: "-L[[SR]]/fp64/nan2008"
+// CHECK-BE-NAN64-32R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/fp64/nan2008"
+// CHECK-BE-NAN64-32R2: "-L[[SR]]/../../../../sysroot/fp64/nan2008/usr/lib/../lib"
+// CHECK-BE-NAN64-32R2: "[[TC]]/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN64-32R2: "[[TC]]/../../../../sysroot/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, micromips, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mmicromips -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF-MM %s
+// CHECK-BE-HF-MM: "-internal-isystem"
+// CHECK-BE-HF-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF-MM: "-internal-isystem"
+// CHECK-BE-HF-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips"
+// CHECK-BE-HF-MM: "-internal-isystem"
+// CHECK-BE-HF-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF-MM: "-internal-externc-isystem"
+// CHECK-BE-HF-MM: "[[TC]]/include"
+// CHECK-BE-HF-MM: "-internal-externc-isystem"
+// CHECK-BE-HF-MM: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF-MM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF-MM: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/micromips"
+// CHECK-BE-HF-MM: "[[TC]]/../../../../sysroot/micromips/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-MM: "[[TC]]/../../../../sysroot/micromips/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-MM: "[[TC]]/micromips{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF-MM: "-L[[SR]]/micromips"
+// CHECK-BE-HF-MM: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/micromips"
+// CHECK-BE-HF-MM: "-L[[SR]]/../../../../sysroot/micromips/usr/lib/../lib"
+// CHECK-BE-HF-MM: "[[TC]]/micromips{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-MM: "[[TC]]/../../../../sysroot/micromips/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, micromips, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mmicromips -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF64-MM %s
+// CHECK-BE-HF64-MM: "-internal-isystem"
+// CHECK-BE-HF64-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF64-MM: "-internal-isystem"
+// CHECK-BE-HF64-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/fp64"
+// CHECK-BE-HF64-MM: "-internal-isystem"
+// CHECK-BE-HF64-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF64-MM: "-internal-externc-isystem"
+// CHECK-BE-HF64-MM: "[[TC]]/include"
+// CHECK-BE-HF64-MM: "-internal-externc-isystem"
+// CHECK-BE-HF64-MM: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF64-MM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF64-MM: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/micromips/fp64"
+// CHECK-BE-HF64-MM: "[[TC]]/../../../../sysroot/micromips/fp64/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF64-MM: "[[TC]]/../../../../sysroot/micromips/fp64/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF64-MM: "[[TC]]/micromips/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF64-MM: "-L[[SR]]/micromips/fp64"
+// CHECK-BE-HF64-MM: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/micromips/fp64"
+// CHECK-BE-HF64-MM: "-L[[SR]]/../../../../sysroot/micromips/fp64/usr/lib/../lib"
+// CHECK-BE-HF64-MM: "[[TC]]/micromips/fp64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF64-MM: "[[TC]]/../../../../sysroot/micromips/fp64/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, micromips, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mmicromips -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-SF-MM %s
+// CHECK-BE-SF-MM: "-internal-isystem"
+// CHECK-BE-SF-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-SF-MM: "-internal-isystem"
+// CHECK-BE-SF-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/sof"
+// CHECK-BE-SF-MM: "-internal-isystem"
+// CHECK-BE-SF-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-SF-MM: "-internal-externc-isystem"
+// CHECK-BE-SF-MM: "[[TC]]/include"
+// CHECK-BE-SF-MM: "-internal-externc-isystem"
+// CHECK-BE-SF-MM: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-SF-MM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-SF-MM: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/micromips/sof"
+// CHECK-BE-SF-MM: "[[TC]]/../../../../sysroot/micromips/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-MM: "[[TC]]/../../../../sysroot/micromips/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-MM: "[[TC]]/micromips/sof{{/|\\\\}}crtbegin.o"
+// CHECK-BE-SF-MM: "-L[[SR]]/micromips/sof"
+// CHECK-BE-SF-MM: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/micromips/sof"
+// CHECK-BE-SF-MM: "-L[[SR]]/../../../../sysroot/micromips/sof/usr/lib/../lib"
+// CHECK-BE-SF-MM: "[[TC]]/micromips/sof{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-MM: "[[TC]]/../../../../sysroot/micromips/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, micromips, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mmicromips -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN-MM %s
+// CHECK-BE-NAN-MM: "-internal-isystem"
+// CHECK-BE-NAN-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN-MM: "-internal-isystem"
+// CHECK-BE-NAN-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/nan2008"
+// CHECK-BE-NAN-MM: "-internal-isystem"
+// CHECK-BE-NAN-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN-MM: "-internal-externc-isystem"
+// CHECK-BE-NAN-MM: "[[TC]]/include"
+// CHECK-BE-NAN-MM: "-internal-externc-isystem"
+// CHECK-BE-NAN-MM: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN-MM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN-MM: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/micromips/nan2008"
+// CHECK-BE-NAN-MM: "[[TC]]/../../../../sysroot/micromips/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN-MM: "[[TC]]/../../../../sysroot/micromips/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN-MM: "[[TC]]/micromips/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN-MM: "-L[[SR]]/micromips/nan2008"
+// CHECK-BE-NAN-MM: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/micromips/nan2008"
+// CHECK-BE-NAN-MM: "-L[[SR]]/../../../../sysroot/micromips/nan2008/usr/lib/../lib"
+// CHECK-BE-NAN-MM: "[[TC]]/micromips/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN-MM: "[[TC]]/../../../../sysroot/micromips/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, micromips, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips-linux-gnu -mmicromips -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-MM %s
+// CHECK-BE-NAN64-MM: "-internal-isystem"
+// CHECK-BE-NAN64-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN64-MM: "-internal-isystem"
+// CHECK-BE-NAN64-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/fp64/nan2008"
+// CHECK-BE-NAN64-MM: "-internal-isystem"
+// CHECK-BE-NAN64-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN64-MM: "-internal-externc-isystem"
+// CHECK-BE-NAN64-MM: "[[TC]]/include"
+// CHECK-BE-NAN64-MM: "-internal-externc-isystem"
+// CHECK-BE-NAN64-MM: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN64-MM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN64-MM: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/micromips/fp64/nan2008"
+// CHECK-BE-NAN64-MM: "[[TC]]/../../../../sysroot/micromips/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN64-MM: "[[TC]]/../../../../sysroot/micromips/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN64-MM: "[[TC]]/micromips/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN64-MM: "-L[[SR]]/micromips/fp64/nan2008"
+// CHECK-BE-NAN64-MM: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/micromips/fp64/nan2008"
+// CHECK-BE-NAN64-MM: "-L[[SR]]/../../../../sysroot/micromips/fp64/nan2008/usr/lib/../lib"
+// CHECK-BE-NAN64-MM: "[[TC]]/micromips/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN64-MM: "[[TC]]/../../../../sysroot/micromips/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64, ABI n32, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64 -mabi=n32 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF-64-N32 %s
+// CHECK-BE-HF-64-N32: "-internal-isystem"
+// CHECK-BE-HF-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF-64-N32: "-internal-isystem"
+// CHECK-BE-HF-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64"
+// CHECK-BE-HF-64-N32: "-internal-isystem"
+// CHECK-BE-HF-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF-64-N32: "-internal-externc-isystem"
+// CHECK-BE-HF-64-N32: "[[TC]]/include"
+// CHECK-BE-HF-64-N32: "-internal-externc-isystem"
+// CHECK-BE-HF-64-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF-64-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF-64-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64"
+// CHECK-BE-HF-64-N32: "[[TC]]/../../../../sysroot/mips64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-64-N32: "[[TC]]/../../../../sysroot/mips64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-64-N32: "[[TC]]/mips64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF-64-N32: "-L[[SR]]/mips64"
+// CHECK-BE-HF-64-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64"
+// CHECK-BE-HF-64-N32: "-L[[SR]]/../../../../sysroot/mips64/usr/lib"
+// CHECK-BE-HF-64-N32: "[[TC]]/mips64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-64-N32: "[[TC]]/../../../../sysroot/mips64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64, ABI n32, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64 -mabi=n32 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF64-64-N32 %s
+// CHECK-BE-HF64-64-N32: "-internal-isystem"
+// CHECK-BE-HF64-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF64-64-N32: "-internal-isystem"
+// CHECK-BE-HF64-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/fp64"
+// CHECK-BE-HF64-64-N32: "-internal-isystem"
+// CHECK-BE-HF64-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF64-64-N32: "-internal-externc-isystem"
+// CHECK-BE-HF64-64-N32: "[[TC]]/include"
+// CHECK-BE-HF64-64-N32: "-internal-externc-isystem"
+// CHECK-BE-HF64-64-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF64-64-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF64-64-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/fp64"
+// CHECK-BE-HF64-64-N32: "[[TC]]/../../../../sysroot/mips64/fp64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF64-64-N32: "[[TC]]/../../../../sysroot/mips64/fp64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF64-64-N32: "[[TC]]/mips64/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF64-64-N32: "-L[[SR]]/mips64/fp64"
+// CHECK-BE-HF64-64-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/fp64"
+// CHECK-BE-HF64-64-N32: "-L[[SR]]/../../../../sysroot/mips64/fp64/usr/lib"
+// CHECK-BE-HF64-64-N32: "[[TC]]/mips64/fp64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF64-64-N32: "[[TC]]/../../../../sysroot/mips64/fp64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64, ABI n32, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64 -mabi=n32 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-SF-64-N32 %s
+// CHECK-BE-SF-64-N32: "-internal-isystem"
+// CHECK-BE-SF-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-SF-64-N32: "-internal-isystem"
+// CHECK-BE-SF-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/sof"
+// CHECK-BE-SF-64-N32: "-internal-isystem"
+// CHECK-BE-SF-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-SF-64-N32: "-internal-externc-isystem"
+// CHECK-BE-SF-64-N32: "[[TC]]/include"
+// CHECK-BE-SF-64-N32: "-internal-externc-isystem"
+// CHECK-BE-SF-64-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-SF-64-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-SF-64-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/sof"
+// CHECK-BE-SF-64-N32: "[[TC]]/../../../../sysroot/mips64/sof/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-64-N32: "[[TC]]/../../../../sysroot/mips64/sof/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-64-N32: "[[TC]]/mips64/sof{{/|\\\\}}crtbegin.o"
+// CHECK-BE-SF-64-N32: "-L[[SR]]/mips64/sof"
+// CHECK-BE-SF-64-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/sof"
+// CHECK-BE-SF-64-N32: "-L[[SR]]/../../../../sysroot/mips64/sof/usr/lib"
+// CHECK-BE-SF-64-N32: "[[TC]]/mips64/sof{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-64-N32: "[[TC]]/../../../../sysroot/mips64/sof/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64, ABI n32, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64 -mabi=n32 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN-64-N32 %s
+// CHECK-BE-NAN-64-N32: "-internal-isystem"
+// CHECK-BE-NAN-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN-64-N32: "-internal-isystem"
+// CHECK-BE-NAN-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/nan2008"
+// CHECK-BE-NAN-64-N32: "-internal-isystem"
+// CHECK-BE-NAN-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN-64-N32: "-internal-externc-isystem"
+// CHECK-BE-NAN-64-N32: "[[TC]]/include"
+// CHECK-BE-NAN-64-N32: "-internal-externc-isystem"
+// CHECK-BE-NAN-64-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN-64-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN-64-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/nan2008"
+// CHECK-BE-NAN-64-N32: "[[TC]]/../../../../sysroot/mips64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN-64-N32: "[[TC]]/../../../../sysroot/mips64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN-64-N32: "[[TC]]/mips64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN-64-N32: "-L[[SR]]/mips64/nan2008"
+// CHECK-BE-NAN-64-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/nan2008"
+// CHECK-BE-NAN-64-N32: "-L[[SR]]/../../../../sysroot/mips64/nan2008/usr/lib"
+// CHECK-BE-NAN-64-N32: "[[TC]]/mips64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN-64-N32: "[[TC]]/../../../../sysroot/mips64/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64, ABI n32, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64 -mabi=n32 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-64-N32 %s
+// CHECK-BE-NAN64-64-N32: "-internal-isystem"
+// CHECK-BE-NAN64-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN64-64-N32: "-internal-isystem"
+// CHECK-BE-NAN64-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/fp64/nan2008"
+// CHECK-BE-NAN64-64-N32: "-internal-isystem"
+// CHECK-BE-NAN64-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN64-64-N32: "-internal-externc-isystem"
+// CHECK-BE-NAN64-64-N32: "[[TC]]/include"
+// CHECK-BE-NAN64-64-N32: "-internal-externc-isystem"
+// CHECK-BE-NAN64-64-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN64-64-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN64-64-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/fp64/nan2008"
+// CHECK-BE-NAN64-64-N32: "[[TC]]/../../../../sysroot/mips64/fp64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN64-64-N32: "[[TC]]/../../../../sysroot/mips64/fp64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN64-64-N32: "[[TC]]/mips64/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN64-64-N32: "-L[[SR]]/mips64/fp64/nan2008"
+// CHECK-BE-NAN64-64-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/fp64/nan2008"
+// CHECK-BE-NAN64-64-N32: "-L[[SR]]/../../../../sysroot/mips64/fp64/nan2008/usr/lib"
+// CHECK-BE-NAN64-64-N32: "[[TC]]/mips64/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN64-64-N32: "[[TC]]/../../../../sysroot/mips64/fp64/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64, ABI 64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64 -mabi=64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF-64-64 %s
+// CHECK-BE-HF-64-64: "-internal-isystem"
+// CHECK-BE-HF-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF-64-64: "-internal-isystem"
+// CHECK-BE-HF-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64"
+// CHECK-BE-HF-64-64: "-internal-isystem"
+// CHECK-BE-HF-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF-64-64: "-internal-externc-isystem"
+// CHECK-BE-HF-64-64: "[[TC]]/include"
+// CHECK-BE-HF-64-64: "-internal-externc-isystem"
+// CHECK-BE-HF-64-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF-64-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF-64-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/64"
+// CHECK-BE-HF-64-64: "[[TC]]/../../../../sysroot/mips64/64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-64-64: "[[TC]]/../../../../sysroot/mips64/64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-64-64: "[[TC]]/mips64/64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF-64-64: "-L[[SR]]/mips64/64"
+// CHECK-BE-HF-64-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/64"
+// CHECK-BE-HF-64-64: "-L[[SR]]/../../../../sysroot/mips64/64/usr/lib"
+// CHECK-BE-HF-64-64: "[[TC]]/mips64/64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-64-64: "[[TC]]/../../../../sysroot/mips64/64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64, ABI 64, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64 -mabi=64 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF64-64-64 %s
+// CHECK-BE-HF64-64-64: "-internal-isystem"
+// CHECK-BE-HF64-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF64-64-64: "-internal-isystem"
+// CHECK-BE-HF64-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/fp64"
+// CHECK-BE-HF64-64-64: "-internal-isystem"
+// CHECK-BE-HF64-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF64-64-64: "-internal-externc-isystem"
+// CHECK-BE-HF64-64-64: "[[TC]]/include"
+// CHECK-BE-HF64-64-64: "-internal-externc-isystem"
+// CHECK-BE-HF64-64-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF64-64-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF64-64-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/64/fp64"
+// CHECK-BE-HF64-64-64: "[[TC]]/../../../../sysroot/mips64/64/fp64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF64-64-64: "[[TC]]/../../../../sysroot/mips64/64/fp64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF64-64-64: "[[TC]]/mips64/64/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF64-64-64: "-L[[SR]]/mips64/64/fp64"
+// CHECK-BE-HF64-64-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/64/fp64"
+// CHECK-BE-HF64-64-64: "-L[[SR]]/../../../../sysroot/mips64/64/fp64/usr/lib"
+// CHECK-BE-HF64-64-64: "[[TC]]/mips64/64/fp64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF64-64-64: "[[TC]]/../../../../sysroot/mips64/64/fp64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64, ABI 64, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64 -mabi=64 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-SF-64-64 %s
+// CHECK-BE-SF-64-64: "-internal-isystem"
+// CHECK-BE-SF-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-SF-64-64: "-internal-isystem"
+// CHECK-BE-SF-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/sof"
+// CHECK-BE-SF-64-64: "-internal-isystem"
+// CHECK-BE-SF-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-SF-64-64: "-internal-externc-isystem"
+// CHECK-BE-SF-64-64: "[[TC]]/include"
+// CHECK-BE-SF-64-64: "-internal-externc-isystem"
+// CHECK-BE-SF-64-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-SF-64-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-SF-64-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/64/sof"
+// CHECK-BE-SF-64-64: "[[TC]]/../../../../sysroot/mips64/64/sof/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-64-64: "[[TC]]/../../../../sysroot/mips64/64/sof/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-64-64: "[[TC]]/mips64/64/sof{{/|\\\\}}crtbegin.o"
+// CHECK-BE-SF-64-64: "-L[[SR]]/mips64/64/sof"
+// CHECK-BE-SF-64-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/64/sof"
+// CHECK-BE-SF-64-64: "-L[[SR]]/../../../../sysroot/mips64/64/sof/usr/lib"
+// CHECK-BE-SF-64-64: "[[TC]]/mips64/64/sof{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-64-64: "[[TC]]/../../../../sysroot/mips64/64/sof/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64, ABI 64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64 -mabi=64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN-64-64 %s
+// CHECK-BE-NAN-64-64: "-internal-isystem"
+// CHECK-BE-NAN-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN-64-64: "-internal-isystem"
+// CHECK-BE-NAN-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/nan2008"
+// CHECK-BE-NAN-64-64: "-internal-isystem"
+// CHECK-BE-NAN-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN-64-64: "-internal-externc-isystem"
+// CHECK-BE-NAN-64-64: "[[TC]]/include"
+// CHECK-BE-NAN-64-64: "-internal-externc-isystem"
+// CHECK-BE-NAN-64-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN-64-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN-64-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/64/nan2008"
+// CHECK-BE-NAN-64-64: "[[TC]]/../../../../sysroot/mips64/64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN-64-64: "[[TC]]/../../../../sysroot/mips64/64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN-64-64: "[[TC]]/mips64/64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN-64-64: "-L[[SR]]/mips64/64/nan2008"
+// CHECK-BE-NAN-64-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/64/nan2008"
+// CHECK-BE-NAN-64-64: "-L[[SR]]/../../../../sysroot/mips64/64/nan2008/usr/lib"
+// CHECK-BE-NAN-64-64: "[[TC]]/mips64/64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN-64-64: "[[TC]]/../../../../sysroot/mips64/64/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64, ABI 64, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64 -mabi=64 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-64-64 %s
+// CHECK-BE-NAN64-64-64: "-internal-isystem"
+// CHECK-BE-NAN64-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN64-64-64: "-internal-isystem"
+// CHECK-BE-NAN64-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/fp64/nan2008"
+// CHECK-BE-NAN64-64-64: "-internal-isystem"
+// CHECK-BE-NAN64-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN64-64-64: "-internal-externc-isystem"
+// CHECK-BE-NAN64-64-64: "[[TC]]/include"
+// CHECK-BE-NAN64-64-64: "-internal-externc-isystem"
+// CHECK-BE-NAN64-64-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN64-64-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN64-64-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/64/fp64/nan2008"
+// CHECK-BE-NAN64-64-64: "[[TC]]/../../../../sysroot/mips64/64/fp64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN64-64-64: "[[TC]]/../../../../sysroot/mips64/64/fp64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN64-64-64: "[[TC]]/mips64/64/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN64-64-64: "-L[[SR]]/mips64/64/fp64/nan2008"
+// CHECK-BE-NAN64-64-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/64/fp64/nan2008"
+// CHECK-BE-NAN64-64-64: "-L[[SR]]/../../../../sysroot/mips64/64/fp64/nan2008/usr/lib"
+// CHECK-BE-NAN64-64-64: "[[TC]]/mips64/64/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN64-64-64: "[[TC]]/../../../../sysroot/mips64/64/fp64/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64r2, ABI n32, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64r2 -mabi=n32 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF-64R2-N32 %s
+// CHECK-BE-HF-64R2-N32: "-internal-isystem"
+// CHECK-BE-HF-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF-64R2-N32: "-internal-isystem"
+// CHECK-BE-HF-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2"
+// CHECK-BE-HF-64R2-N32: "-internal-isystem"
+// CHECK-BE-HF-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF-64R2-N32: "-internal-externc-isystem"
+// CHECK-BE-HF-64R2-N32: "[[TC]]/include"
+// CHECK-BE-HF-64R2-N32: "-internal-externc-isystem"
+// CHECK-BE-HF-64R2-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF-64R2-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF-64R2-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2"
+// CHECK-BE-HF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-64R2-N32: "[[TC]]/mips64r2{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF-64R2-N32: "-L[[SR]]/mips64r2"
+// CHECK-BE-HF-64R2-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2"
+// CHECK-BE-HF-64R2-N32: "-L[[SR]]/../../../../sysroot/mips64r2/usr/lib"
+// CHECK-BE-HF-64R2-N32: "[[TC]]/mips64r2{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64r2, ABI n32, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64r2 -mabi=n32 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF64-64R2-N32 %s
+// CHECK-BE-HF64-64R2-N32: "-internal-isystem"
+// CHECK-BE-HF64-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF64-64R2-N32: "-internal-isystem"
+// CHECK-BE-HF64-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/fp64"
+// CHECK-BE-HF64-64R2-N32: "-internal-isystem"
+// CHECK-BE-HF64-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF64-64R2-N32: "-internal-externc-isystem"
+// CHECK-BE-HF64-64R2-N32: "[[TC]]/include"
+// CHECK-BE-HF64-64R2-N32: "-internal-externc-isystem"
+// CHECK-BE-HF64-64R2-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF64-64R2-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF64-64R2-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/fp64"
+// CHECK-BE-HF64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/fp64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/fp64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF64-64R2-N32: "[[TC]]/mips64r2/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF64-64R2-N32: "-L[[SR]]/mips64r2/fp64"
+// CHECK-BE-HF64-64R2-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/fp64"
+// CHECK-BE-HF64-64R2-N32: "-L[[SR]]/../../../../sysroot/mips64r2/fp64/usr/lib"
+// CHECK-BE-HF64-64R2-N32: "[[TC]]/mips64r2/fp64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/fp64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64r2, ABI n32, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64r2 -mabi=n32 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-SF-64R2-N32 %s
+// CHECK-BE-SF-64R2-N32: "-internal-isystem"
+// CHECK-BE-SF-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-SF-64R2-N32: "-internal-isystem"
+// CHECK-BE-SF-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/sof"
+// CHECK-BE-SF-64R2-N32: "-internal-isystem"
+// CHECK-BE-SF-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-SF-64R2-N32: "-internal-externc-isystem"
+// CHECK-BE-SF-64R2-N32: "[[TC]]/include"
+// CHECK-BE-SF-64R2-N32: "-internal-externc-isystem"
+// CHECK-BE-SF-64R2-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-SF-64R2-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-SF-64R2-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/sof"
+// CHECK-BE-SF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/sof/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/sof/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-64R2-N32: "[[TC]]/mips64r2/sof{{/|\\\\}}crtbegin.o"
+// CHECK-BE-SF-64R2-N32: "-L[[SR]]/mips64r2/sof"
+// CHECK-BE-SF-64R2-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/sof"
+// CHECK-BE-SF-64R2-N32: "-L[[SR]]/../../../../sysroot/mips64r2/sof/usr/lib"
+// CHECK-BE-SF-64R2-N32: "[[TC]]/mips64r2/sof{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/sof/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64r2, ABI n32, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64r2 -mabi=n32 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN-64R2-N32 %s
+// CHECK-BE-NAN-64R2-N32: "-internal-isystem"
+// CHECK-BE-NAN-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN-64R2-N32: "-internal-isystem"
+// CHECK-BE-NAN-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/nan2008"
+// CHECK-BE-NAN-64R2-N32: "-internal-isystem"
+// CHECK-BE-NAN-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN-64R2-N32: "-internal-externc-isystem"
+// CHECK-BE-NAN-64R2-N32: "[[TC]]/include"
+// CHECK-BE-NAN-64R2-N32: "-internal-externc-isystem"
+// CHECK-BE-NAN-64R2-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN-64R2-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN-64R2-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/nan2008"
+// CHECK-BE-NAN-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN-64R2-N32: "[[TC]]/mips64r2/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN-64R2-N32: "-L[[SR]]/mips64r2/nan2008"
+// CHECK-BE-NAN-64R2-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/nan2008"
+// CHECK-BE-NAN-64R2-N32: "-L[[SR]]/../../../../sysroot/mips64r2/nan2008/usr/lib"
+// CHECK-BE-NAN-64R2-N32: "[[TC]]/mips64r2/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64r2, ABI n32, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64r2 -mabi=n32 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-64R2-N32 %s
+// CHECK-BE-NAN64-64R2-N32: "-internal-isystem"
+// CHECK-BE-NAN64-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN64-64R2-N32: "-internal-isystem"
+// CHECK-BE-NAN64-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/fp64/nan2008"
+// CHECK-BE-NAN64-64R2-N32: "-internal-isystem"
+// CHECK-BE-NAN64-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN64-64R2-N32: "-internal-externc-isystem"
+// CHECK-BE-NAN64-64R2-N32: "[[TC]]/include"
+// CHECK-BE-NAN64-64R2-N32: "-internal-externc-isystem"
+// CHECK-BE-NAN64-64R2-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN64-64R2-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN64-64R2-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/fp64/nan2008"
+// CHECK-BE-NAN64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/fp64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/fp64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN64-64R2-N32: "[[TC]]/mips64r2/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN64-64R2-N32: "-L[[SR]]/mips64r2/fp64/nan2008"
+// CHECK-BE-NAN64-64R2-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/fp64/nan2008"
+// CHECK-BE-NAN64-64R2-N32: "-L[[SR]]/../../../../sysroot/mips64r2/fp64/nan2008/usr/lib"
+// CHECK-BE-NAN64-64R2-N32: "[[TC]]/mips64r2/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/fp64/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64r2, ABI 64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64r2 -mabi=64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF-64R2-64 %s
+// CHECK-BE-HF-64R2-64: "-internal-isystem"
+// CHECK-BE-HF-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF-64R2-64: "-internal-isystem"
+// CHECK-BE-HF-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64"
+// CHECK-BE-HF-64R2-64: "-internal-isystem"
+// CHECK-BE-HF-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF-64R2-64: "-internal-externc-isystem"
+// CHECK-BE-HF-64R2-64: "[[TC]]/include"
+// CHECK-BE-HF-64R2-64: "-internal-externc-isystem"
+// CHECK-BE-HF-64R2-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF-64R2-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF-64R2-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/64"
+// CHECK-BE-HF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF-64R2-64: "[[TC]]/mips64r2/64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF-64R2-64: "-L[[SR]]/mips64r2/64"
+// CHECK-BE-HF-64R2-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/64"
+// CHECK-BE-HF-64R2-64: "-L[[SR]]/../../../../sysroot/mips64r2/64/usr/lib"
+// CHECK-BE-HF-64R2-64: "[[TC]]/mips64r2/64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64r2, ABI 64, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64r2 -mabi=64 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-HF64-64R2-64 %s
+// CHECK-BE-HF64-64R2-64: "-internal-isystem"
+// CHECK-BE-HF64-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-HF64-64R2-64: "-internal-isystem"
+// CHECK-BE-HF64-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/fp64"
+// CHECK-BE-HF64-64R2-64: "-internal-isystem"
+// CHECK-BE-HF64-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-HF64-64R2-64: "-internal-externc-isystem"
+// CHECK-BE-HF64-64R2-64: "[[TC]]/include"
+// CHECK-BE-HF64-64R2-64: "-internal-externc-isystem"
+// CHECK-BE-HF64-64R2-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-HF64-64R2-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-HF64-64R2-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/64/fp64"
+// CHECK-BE-HF64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/fp64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-HF64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/fp64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-HF64-64R2-64: "[[TC]]/mips64r2/64/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-BE-HF64-64R2-64: "-L[[SR]]/mips64r2/64/fp64"
+// CHECK-BE-HF64-64R2-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/64/fp64"
+// CHECK-BE-HF64-64R2-64: "-L[[SR]]/../../../../sysroot/mips64r2/64/fp64/usr/lib"
+// CHECK-BE-HF64-64R2-64: "[[TC]]/mips64r2/64/fp64{{/|\\\\}}crtend.o"
+// CHECK-BE-HF64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/fp64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64r2, ABI 64, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64r2 -mabi=64 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-SF-64R2-64 %s
+// CHECK-BE-SF-64R2-64: "-internal-isystem"
+// CHECK-BE-SF-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-SF-64R2-64: "-internal-isystem"
+// CHECK-BE-SF-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/sof"
+// CHECK-BE-SF-64R2-64: "-internal-isystem"
+// CHECK-BE-SF-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-SF-64R2-64: "-internal-externc-isystem"
+// CHECK-BE-SF-64R2-64: "[[TC]]/include"
+// CHECK-BE-SF-64R2-64: "-internal-externc-isystem"
+// CHECK-BE-SF-64R2-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-SF-64R2-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-SF-64R2-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/64/sof"
+// CHECK-BE-SF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/sof/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-SF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/sof/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-SF-64R2-64: "[[TC]]/mips64r2/64/sof{{/|\\\\}}crtbegin.o"
+// CHECK-BE-SF-64R2-64: "-L[[SR]]/mips64r2/64/sof"
+// CHECK-BE-SF-64R2-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/64/sof"
+// CHECK-BE-SF-64R2-64: "-L[[SR]]/../../../../sysroot/mips64r2/64/sof/usr/lib"
+// CHECK-BE-SF-64R2-64: "[[TC]]/mips64r2/64/sof{{/|\\\\}}crtend.o"
+// CHECK-BE-SF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/sof/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64r2, ABI 64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64r2 -mabi=64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN-64R2-64 %s
+// CHECK-BE-NAN-64R2-64: "-internal-isystem"
+// CHECK-BE-NAN-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN-64R2-64: "-internal-isystem"
+// CHECK-BE-NAN-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/nan2008"
+// CHECK-BE-NAN-64R2-64: "-internal-isystem"
+// CHECK-BE-NAN-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN-64R2-64: "-internal-externc-isystem"
+// CHECK-BE-NAN-64R2-64: "[[TC]]/include"
+// CHECK-BE-NAN-64R2-64: "-internal-externc-isystem"
+// CHECK-BE-NAN-64R2-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN-64R2-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN-64R2-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/64/nan2008"
+// CHECK-BE-NAN-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN-64R2-64: "[[TC]]/mips64r2/64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN-64R2-64: "-L[[SR]]/mips64r2/64/nan2008"
+// CHECK-BE-NAN-64R2-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/64/nan2008"
+// CHECK-BE-NAN-64R2-64: "-L[[SR]]/../../../../sysroot/mips64r2/64/nan2008/usr/lib"
+// CHECK-BE-NAN-64R2-64: "[[TC]]/mips64r2/64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Big-endian, mips64r2, ABI 64, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64-linux-gnu -mips64r2 -mabi=64 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-64R2-64 %s
+// CHECK-BE-NAN64-64R2-64: "-internal-isystem"
+// CHECK-BE-NAN64-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-BE-NAN64-64R2-64: "-internal-isystem"
+// CHECK-BE-NAN64-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/fp64/nan2008"
+// CHECK-BE-NAN64-64R2-64: "-internal-isystem"
+// CHECK-BE-NAN64-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-BE-NAN64-64R2-64: "-internal-externc-isystem"
+// CHECK-BE-NAN64-64R2-64: "[[TC]]/include"
+// CHECK-BE-NAN64-64R2-64: "-internal-externc-isystem"
+// CHECK-BE-NAN64-64R2-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-BE-NAN64-64R2-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-BE-NAN64-64R2-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/64/fp64/nan2008"
+// CHECK-BE-NAN64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/fp64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-BE-NAN64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/fp64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-BE-NAN64-64R2-64: "[[TC]]/mips64r2/64/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-BE-NAN64-64R2-64: "-L[[SR]]/mips64r2/64/fp64/nan2008"
+// CHECK-BE-NAN64-64R2-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/64/fp64/nan2008"
+// CHECK-BE-NAN64-64R2-64: "-L[[SR]]/../../../../sysroot/mips64r2/64/fp64/nan2008/usr/lib"
+// CHECK-BE-NAN64-64R2-64: "[[TC]]/mips64r2/64/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-BE-NAN64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/fp64/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF-32 %s
+// CHECK-EL-HF-32: "-internal-isystem"
+// CHECK-EL-HF-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF-32: "-internal-isystem"
+// CHECK-EL-HF-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el"
+// CHECK-EL-HF-32: "-internal-isystem"
+// CHECK-EL-HF-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF-32: "-internal-externc-isystem"
+// CHECK-EL-HF-32: "[[TC]]/include"
+// CHECK-EL-HF-32: "-internal-externc-isystem"
+// CHECK-EL-HF-32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF-32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/el"
+// CHECK-EL-HF-32: "[[TC]]/../../../../sysroot/mips32/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-32: "[[TC]]/../../../../sysroot/mips32/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-32: "[[TC]]/mips32/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF-32: "-L[[SR]]/mips32/el"
+// CHECK-EL-HF-32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/el"
+// CHECK-EL-HF-32: "-L[[SR]]/../../../../sysroot/mips32/el/usr/lib/../lib"
+// CHECK-EL-HF-32: "[[TC]]/mips32/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-32: "[[TC]]/../../../../sysroot/mips32/el/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF64-32 %s
+// CHECK-EL-HF64-32: "-internal-isystem"
+// CHECK-EL-HF64-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF64-32: "-internal-isystem"
+// CHECK-EL-HF64-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/fp64"
+// CHECK-EL-HF64-32: "-internal-isystem"
+// CHECK-EL-HF64-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF64-32: "-internal-externc-isystem"
+// CHECK-EL-HF64-32: "[[TC]]/include"
+// CHECK-EL-HF64-32: "-internal-externc-isystem"
+// CHECK-EL-HF64-32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF64-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF64-32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/el/fp64"
+// CHECK-EL-HF64-32: "[[TC]]/../../../../sysroot/mips32/el/fp64/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF64-32: "[[TC]]/../../../../sysroot/mips32/el/fp64/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF64-32: "[[TC]]/mips32/el/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF64-32: "-L[[SR]]/mips32/el/fp64"
+// CHECK-EL-HF64-32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/el/fp64"
+// CHECK-EL-HF64-32: "-L[[SR]]/../../../../sysroot/mips32/el/fp64/usr/lib/../lib"
+// CHECK-EL-HF64-32: "[[TC]]/mips32/el/fp64{{/|\\\\}}crtend.o"
+// CHECK-EL-HF64-32: "[[TC]]/../../../../sysroot/mips32/el/fp64/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-SF-32 %s
+// CHECK-EL-SF-32: "-internal-isystem"
+// CHECK-EL-SF-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-SF-32: "-internal-isystem"
+// CHECK-EL-SF-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/sof"
+// CHECK-EL-SF-32: "-internal-isystem"
+// CHECK-EL-SF-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-SF-32: "-internal-externc-isystem"
+// CHECK-EL-SF-32: "[[TC]]/include"
+// CHECK-EL-SF-32: "-internal-externc-isystem"
+// CHECK-EL-SF-32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-SF-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-SF-32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/el/sof"
+// CHECK-EL-SF-32: "[[TC]]/../../../../sysroot/mips32/el/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-32: "[[TC]]/../../../../sysroot/mips32/el/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-32: "[[TC]]/mips32/el/sof{{/|\\\\}}crtbegin.o"
+// CHECK-EL-SF-32: "-L[[SR]]/mips32/el/sof"
+// CHECK-EL-SF-32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/el/sof"
+// CHECK-EL-SF-32: "-L[[SR]]/../../../../sysroot/mips32/el/sof/usr/lib/../lib"
+// CHECK-EL-SF-32: "[[TC]]/mips32/el/sof{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-32: "[[TC]]/../../../../sysroot/mips32/el/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32 / mips16, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32 -mips16 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF-16 %s
+// CHECK-EL-HF-16: "-internal-isystem"
+// CHECK-EL-HF-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF-16: "-internal-isystem"
+// CHECK-EL-HF-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el"
+// CHECK-EL-HF-16: "-internal-isystem"
+// CHECK-EL-HF-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF-16: "-internal-externc-isystem"
+// CHECK-EL-HF-16: "[[TC]]/include"
+// CHECK-EL-HF-16: "-internal-externc-isystem"
+// CHECK-EL-HF-16: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF-16: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF-16: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/mips16/el"
+// CHECK-EL-HF-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-16: "[[TC]]/mips32/mips16/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF-16: "-L[[SR]]/mips32/mips16/el"
+// CHECK-EL-HF-16: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/mips16/el"
+// CHECK-EL-HF-16: "-L[[SR]]/../../../../sysroot/mips32/mips16/el/usr/lib/../lib"
+// CHECK-EL-HF-16: "[[TC]]/mips32/mips16/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32 / mips16, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32 -mips16 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF64-16 %s
+// CHECK-EL-HF64-16: "-internal-isystem"
+// CHECK-EL-HF64-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF64-16: "-internal-isystem"
+// CHECK-EL-HF64-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/fp64"
+// CHECK-EL-HF64-16: "-internal-isystem"
+// CHECK-EL-HF64-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF64-16: "-internal-externc-isystem"
+// CHECK-EL-HF64-16: "[[TC]]/include"
+// CHECK-EL-HF64-16: "-internal-externc-isystem"
+// CHECK-EL-HF64-16: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF64-16: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF64-16: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/mips16/el/fp64"
+// CHECK-EL-HF64-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/fp64/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF64-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/fp64/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF64-16: "[[TC]]/mips32/mips16/el/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF64-16: "-L[[SR]]/mips32/mips16/el/fp64"
+// CHECK-EL-HF64-16: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/mips16/el/fp64"
+// CHECK-EL-HF64-16: "-L[[SR]]/../../../../sysroot/mips32/mips16/el/fp64/usr/lib/../lib"
+// CHECK-EL-HF64-16: "[[TC]]/mips32/mips16/el/fp64{{/|\\\\}}crtend.o"
+// CHECK-EL-HF64-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/fp64/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32 / mips16, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32 -mips16 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-SF-16 %s
+// CHECK-EL-SF-16: "-internal-isystem"
+// CHECK-EL-SF-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-SF-16: "-internal-isystem"
+// CHECK-EL-SF-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/sof"
+// CHECK-EL-SF-16: "-internal-isystem"
+// CHECK-EL-SF-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-SF-16: "-internal-externc-isystem"
+// CHECK-EL-SF-16: "[[TC]]/include"
+// CHECK-EL-SF-16: "-internal-externc-isystem"
+// CHECK-EL-SF-16: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-SF-16: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-SF-16: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/mips16/el/sof"
+// CHECK-EL-SF-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-16: "[[TC]]/mips32/mips16/el/sof{{/|\\\\}}crtbegin.o"
+// CHECK-EL-SF-16: "-L[[SR]]/mips32/mips16/el/sof"
+// CHECK-EL-SF-16: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/mips16/el/sof"
+// CHECK-EL-SF-16: "-L[[SR]]/../../../../sysroot/mips32/mips16/el/sof/usr/lib/../lib"
+// CHECK-EL-SF-16: "[[TC]]/mips32/mips16/el/sof{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32 / mips16, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32 -mips16 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN-16 %s
+// CHECK-EL-NAN-16: "-internal-isystem"
+// CHECK-EL-NAN-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN-16: "-internal-isystem"
+// CHECK-EL-NAN-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/nan2008"
+// CHECK-EL-NAN-16: "-internal-isystem"
+// CHECK-EL-NAN-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN-16: "-internal-externc-isystem"
+// CHECK-EL-NAN-16: "[[TC]]/include"
+// CHECK-EL-NAN-16: "-internal-externc-isystem"
+// CHECK-EL-NAN-16: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN-16: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN-16: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/mips16/el/nan2008"
+// CHECK-EL-NAN-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN-16: "[[TC]]/mips32/mips16/el/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN-16: "-L[[SR]]/mips32/mips16/el/nan2008"
+// CHECK-EL-NAN-16: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/mips16/el/nan2008"
+// CHECK-EL-NAN-16: "-L[[SR]]/../../../../sysroot/mips32/mips16/el/nan2008/usr/lib/../lib"
+// CHECK-EL-NAN-16: "[[TC]]/mips32/mips16/el/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32 / mips16, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32 -mips16 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-16 %s
+// CHECK-EL-NAN64-16: "-internal-isystem"
+// CHECK-EL-NAN64-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN64-16: "-internal-isystem"
+// CHECK-EL-NAN64-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/mips16/el/fp64/nan2008"
+// CHECK-EL-NAN64-16: "-internal-isystem"
+// CHECK-EL-NAN64-16: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN64-16: "-internal-externc-isystem"
+// CHECK-EL-NAN64-16: "[[TC]]/include"
+// CHECK-EL-NAN64-16: "-internal-externc-isystem"
+// CHECK-EL-NAN64-16: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN64-16: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN64-16: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/mips16/el/fp64/nan2008"
+// CHECK-EL-NAN64-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN64-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN64-16: "[[TC]]/mips32/mips16/el/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN64-16: "-L[[SR]]/mips32/mips16/el/fp64/nan2008"
+// CHECK-EL-NAN64-16: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/mips16/el/fp64/nan2008"
+// CHECK-EL-NAN64-16: "-L[[SR]]/../../../../sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/../lib"
+// CHECK-EL-NAN64-16: "[[TC]]/mips32/mips16/el/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN64-16: "[[TC]]/../../../../sysroot/mips32/mips16/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN-32 %s
+// CHECK-EL-NAN-32: "-internal-isystem"
+// CHECK-EL-NAN-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN-32: "-internal-isystem"
+// CHECK-EL-NAN-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/nan2008"
+// CHECK-EL-NAN-32: "-internal-isystem"
+// CHECK-EL-NAN-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN-32: "-internal-externc-isystem"
+// CHECK-EL-NAN-32: "[[TC]]/include"
+// CHECK-EL-NAN-32: "-internal-externc-isystem"
+// CHECK-EL-NAN-32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN-32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/el/nan2008"
+// CHECK-EL-NAN-32: "[[TC]]/../../../../sysroot/mips32/el/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN-32: "[[TC]]/../../../../sysroot/mips32/el/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN-32: "[[TC]]/mips32/el/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN-32: "-L[[SR]]/mips32/el/nan2008"
+// CHECK-EL-NAN-32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/el/nan2008"
+// CHECK-EL-NAN-32: "-L[[SR]]/../../../../sysroot/mips32/el/nan2008/usr/lib/../lib"
+// CHECK-EL-NAN-32: "[[TC]]/mips32/el/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN-32: "[[TC]]/../../../../sysroot/mips32/el/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-32 %s
+// CHECK-EL-NAN64-32: "-internal-isystem"
+// CHECK-EL-NAN64-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN64-32: "-internal-isystem"
+// CHECK-EL-NAN64-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips32/el/fp64/nan2008"
+// CHECK-EL-NAN64-32: "-internal-isystem"
+// CHECK-EL-NAN64-32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN64-32: "-internal-externc-isystem"
+// CHECK-EL-NAN64-32: "[[TC]]/include"
+// CHECK-EL-NAN64-32: "-internal-externc-isystem"
+// CHECK-EL-NAN64-32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN64-32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN64-32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips32/el/fp64/nan2008"
+// CHECK-EL-NAN64-32: "[[TC]]/../../../../sysroot/mips32/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN64-32: "[[TC]]/../../../../sysroot/mips32/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN64-32: "[[TC]]/mips32/el/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN64-32: "-L[[SR]]/mips32/el/fp64/nan2008"
+// CHECK-EL-NAN64-32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips32/el/fp64/nan2008"
+// CHECK-EL-NAN64-32: "-L[[SR]]/../../../../sysroot/mips32/el/fp64/nan2008/usr/lib/../lib"
+// CHECK-EL-NAN64-32: "[[TC]]/mips32/el/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN64-32: "[[TC]]/../../../../sysroot/mips32/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32r2, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF-32R2 %s
+// CHECK-EL-HF-32R2: "-internal-isystem"
+// CHECK-EL-HF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF-32R2: "-internal-isystem"
+// CHECK-EL-HF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el"
+// CHECK-EL-HF-32R2: "-internal-isystem"
+// CHECK-EL-HF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF-32R2: "-internal-externc-isystem"
+// CHECK-EL-HF-32R2: "[[TC]]/include"
+// CHECK-EL-HF-32R2: "-internal-externc-isystem"
+// CHECK-EL-HF-32R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF-32R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/el"
+// CHECK-EL-HF-32R2: "[[TC]]/../../../../sysroot/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-32R2: "[[TC]]/../../../../sysroot/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-32R2: "[[TC]]/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF-32R2: "-L[[SR]]/el"
+// CHECK-EL-HF-32R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/el"
+// CHECK-EL-HF-32R2: "-L[[SR]]/../../../../sysroot/el/usr/lib/../lib"
+// CHECK-EL-HF-32R2: "[[TC]]/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-32R2: "[[TC]]/../../../../sysroot/el/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32r2, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF64-32R2 %s
+// CHECK-EL-HF64-32R2: "-internal-isystem"
+// CHECK-EL-HF64-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF64-32R2: "-internal-isystem"
+// CHECK-EL-HF64-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/fp64"
+// CHECK-EL-HF64-32R2: "-internal-isystem"
+// CHECK-EL-HF64-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF64-32R2: "-internal-externc-isystem"
+// CHECK-EL-HF64-32R2: "[[TC]]/include"
+// CHECK-EL-HF64-32R2: "-internal-externc-isystem"
+// CHECK-EL-HF64-32R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF64-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF64-32R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/el/fp64"
+// CHECK-EL-HF64-32R2: "[[TC]]/../../../../sysroot/el/fp64/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF64-32R2: "[[TC]]/../../../../sysroot/el/fp64/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF64-32R2: "[[TC]]/el/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF64-32R2: "-L[[SR]]/el/fp64"
+// CHECK-EL-HF64-32R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/el/fp64"
+// CHECK-EL-HF64-32R2: "-L[[SR]]/../../../../sysroot/el/fp64/usr/lib/../lib"
+// CHECK-EL-HF64-32R2: "[[TC]]/el/fp64{{/|\\\\}}crtend.o"
+// CHECK-EL-HF64-32R2: "[[TC]]/../../../../sysroot/el/fp64/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32r2, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-SF-32R2 %s
+// CHECK-EL-SF-32R2: "-internal-isystem"
+// CHECK-EL-SF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-SF-32R2: "-internal-isystem"
+// CHECK-EL-SF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/sof"
+// CHECK-EL-SF-32R2: "-internal-isystem"
+// CHECK-EL-SF-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-SF-32R2: "-internal-externc-isystem"
+// CHECK-EL-SF-32R2: "[[TC]]/include"
+// CHECK-EL-SF-32R2: "-internal-externc-isystem"
+// CHECK-EL-SF-32R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-SF-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-SF-32R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/el/sof"
+// CHECK-EL-SF-32R2: "[[TC]]/../../../../sysroot/el/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-32R2: "[[TC]]/../../../../sysroot/el/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-32R2: "[[TC]]/el/sof{{/|\\\\}}crtbegin.o"
+// CHECK-EL-SF-32R2: "-L[[SR]]/el/sof"
+// CHECK-EL-SF-32R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/el/sof"
+// CHECK-EL-SF-32R2: "-L[[SR]]/../../../../sysroot/el/sof/usr/lib/../lib"
+// CHECK-EL-SF-32R2: "[[TC]]/el/sof{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-32R2: "[[TC]]/../../../../sysroot/el/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32r2 / mips16, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mips16 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF-16R2 %s
+// CHECK-EL-HF-16R2: "-internal-isystem"
+// CHECK-EL-HF-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF-16R2: "-internal-isystem"
+// CHECK-EL-HF-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el"
+// CHECK-EL-HF-16R2: "-internal-isystem"
+// CHECK-EL-HF-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF-16R2: "-internal-externc-isystem"
+// CHECK-EL-HF-16R2: "[[TC]]/include"
+// CHECK-EL-HF-16R2: "-internal-externc-isystem"
+// CHECK-EL-HF-16R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF-16R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF-16R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips16/el"
+// CHECK-EL-HF-16R2: "[[TC]]/../../../../sysroot/mips16/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-16R2: "[[TC]]/../../../../sysroot/mips16/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-16R2: "[[TC]]/mips16/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF-16R2: "-L[[SR]]/mips16/el"
+// CHECK-EL-HF-16R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips16/el"
+// CHECK-EL-HF-16R2: "-L[[SR]]/../../../../sysroot/mips16/el/usr/lib/../lib"
+// CHECK-EL-HF-16R2: "[[TC]]/mips16/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-16R2: "[[TC]]/../../../../sysroot/mips16/el/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32r2 / mips16, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mips16 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF64-16R2 %s
+// CHECK-EL-HF64-16R2: "-internal-isystem"
+// CHECK-EL-HF64-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF64-16R2: "-internal-isystem"
+// CHECK-EL-HF64-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/fp64"
+// CHECK-EL-HF64-16R2: "-internal-isystem"
+// CHECK-EL-HF64-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF64-16R2: "-internal-externc-isystem"
+// CHECK-EL-HF64-16R2: "[[TC]]/include"
+// CHECK-EL-HF64-16R2: "-internal-externc-isystem"
+// CHECK-EL-HF64-16R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF64-16R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF64-16R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips16/el/fp64"
+// CHECK-EL-HF64-16R2: "[[TC]]/../../../../sysroot/mips16/el/fp64/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF64-16R2: "[[TC]]/../../../../sysroot/mips16/el/fp64/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF64-16R2: "[[TC]]/mips16/el/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF64-16R2: "-L[[SR]]/mips16/el/fp64"
+// CHECK-EL-HF64-16R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips16/el/fp64"
+// CHECK-EL-HF64-16R2: "-L[[SR]]/../../../../sysroot/mips16/el/fp64/usr/lib/../lib"
+// CHECK-EL-HF64-16R2: "[[TC]]/mips16/el/fp64{{/|\\\\}}crtend.o"
+// CHECK-EL-HF64-16R2: "[[TC]]/../../../../sysroot/mips16/el/fp64/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32r2 / mips16, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mips16 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-SF-16R2 %s
+// CHECK-EL-SF-16R2: "-internal-isystem"
+// CHECK-EL-SF-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-SF-16R2: "-internal-isystem"
+// CHECK-EL-SF-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/sof"
+// CHECK-EL-SF-16R2: "-internal-isystem"
+// CHECK-EL-SF-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-SF-16R2: "-internal-externc-isystem"
+// CHECK-EL-SF-16R2: "[[TC]]/include"
+// CHECK-EL-SF-16R2: "-internal-externc-isystem"
+// CHECK-EL-SF-16R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-SF-16R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-SF-16R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips16/el/sof"
+// CHECK-EL-SF-16R2: "[[TC]]/../../../../sysroot/mips16/el/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-16R2: "[[TC]]/../../../../sysroot/mips16/el/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-16R2: "[[TC]]/mips16/el/sof{{/|\\\\}}crtbegin.o"
+// CHECK-EL-SF-16R2: "-L[[SR]]/mips16/el/sof"
+// CHECK-EL-SF-16R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips16/el/sof"
+// CHECK-EL-SF-16R2: "-L[[SR]]/../../../../sysroot/mips16/el/sof/usr/lib/../lib"
+// CHECK-EL-SF-16R2: "[[TC]]/mips16/el/sof{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-16R2: "[[TC]]/../../../../sysroot/mips16/el/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32r2 / mips16, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mips16 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN-16R2 %s
+// CHECK-EL-NAN-16R2: "-internal-isystem"
+// CHECK-EL-NAN-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN-16R2: "-internal-isystem"
+// CHECK-EL-NAN-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/nan2008"
+// CHECK-EL-NAN-16R2: "-internal-isystem"
+// CHECK-EL-NAN-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN-16R2: "-internal-externc-isystem"
+// CHECK-EL-NAN-16R2: "[[TC]]/include"
+// CHECK-EL-NAN-16R2: "-internal-externc-isystem"
+// CHECK-EL-NAN-16R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN-16R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN-16R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips16/el/nan2008"
+// CHECK-EL-NAN-16R2: "[[TC]]/../../../../sysroot/mips16/el/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN-16R2: "[[TC]]/../../../../sysroot/mips16/el/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN-16R2: "[[TC]]/mips16/el/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN-16R2: "-L[[SR]]/mips16/el/nan2008"
+// CHECK-EL-NAN-16R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips16/el/nan2008"
+// CHECK-EL-NAN-16R2: "-L[[SR]]/../../../../sysroot/mips16/el/nan2008/usr/lib/../lib"
+// CHECK-EL-NAN-16R2: "[[TC]]/mips16/el/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN-16R2: "[[TC]]/../../../../sysroot/mips16/el/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32r2 / mips16, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mips16 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-16R2 %s
+// CHECK-EL-NAN64-16R2: "-internal-isystem"
+// CHECK-EL-NAN64-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN64-16R2: "-internal-isystem"
+// CHECK-EL-NAN64-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips16/el/fp64/nan2008"
+// CHECK-EL-NAN64-16R2: "-internal-isystem"
+// CHECK-EL-NAN64-16R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN64-16R2: "-internal-externc-isystem"
+// CHECK-EL-NAN64-16R2: "[[TC]]/include"
+// CHECK-EL-NAN64-16R2: "-internal-externc-isystem"
+// CHECK-EL-NAN64-16R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN64-16R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN64-16R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips16/el/fp64/nan2008"
+// CHECK-EL-NAN64-16R2: "[[TC]]/../../../../sysroot/mips16/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN64-16R2: "[[TC]]/../../../../sysroot/mips16/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN64-16R2: "[[TC]]/mips16/el/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN64-16R2: "-L[[SR]]/mips16/el/fp64/nan2008"
+// CHECK-EL-NAN64-16R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/mips16/el/fp64/nan2008"
+// CHECK-EL-NAN64-16R2: "-L[[SR]]/../../../../sysroot/mips16/el/fp64/nan2008/usr/lib/../lib"
+// CHECK-EL-NAN64-16R2: "[[TC]]/mips16/el/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN64-16R2: "[[TC]]/../../../../sysroot/mips16/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32r2, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN-32R2 %s
+// CHECK-EL-NAN-32R2: "-internal-isystem"
+// CHECK-EL-NAN-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN-32R2: "-internal-isystem"
+// CHECK-EL-NAN-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/nan2008"
+// CHECK-EL-NAN-32R2: "-internal-isystem"
+// CHECK-EL-NAN-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN-32R2: "-internal-externc-isystem"
+// CHECK-EL-NAN-32R2: "[[TC]]/include"
+// CHECK-EL-NAN-32R2: "-internal-externc-isystem"
+// CHECK-EL-NAN-32R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN-32R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/el/nan2008"
+// CHECK-EL-NAN-32R2: "[[TC]]/../../../../sysroot/el/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN-32R2: "[[TC]]/../../../../sysroot/el/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN-32R2: "[[TC]]/el/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN-32R2: "-L[[SR]]/el/nan2008"
+// CHECK-EL-NAN-32R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/el/nan2008"
+// CHECK-EL-NAN-32R2: "-L[[SR]]/../../../../sysroot/el/nan2008/usr/lib/../lib"
+// CHECK-EL-NAN-32R2: "[[TC]]/el/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN-32R2: "[[TC]]/../../../../sysroot/el/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips32r2, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mips32r2 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-32R2 %s
+// CHECK-EL-NAN64-32R2: "-internal-isystem"
+// CHECK-EL-NAN64-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN64-32R2: "-internal-isystem"
+// CHECK-EL-NAN64-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/el/fp64/nan2008"
+// CHECK-EL-NAN64-32R2: "-internal-isystem"
+// CHECK-EL-NAN64-32R2: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN64-32R2: "-internal-externc-isystem"
+// CHECK-EL-NAN64-32R2: "[[TC]]/include"
+// CHECK-EL-NAN64-32R2: "-internal-externc-isystem"
+// CHECK-EL-NAN64-32R2: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN64-32R2: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN64-32R2: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/el/fp64/nan2008"
+// CHECK-EL-NAN64-32R2: "[[TC]]/../../../../sysroot/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN64-32R2: "[[TC]]/../../../../sysroot/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN64-32R2: "[[TC]]/el/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN64-32R2: "-L[[SR]]/el/fp64/nan2008"
+// CHECK-EL-NAN64-32R2: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/el/fp64/nan2008"
+// CHECK-EL-NAN64-32R2: "-L[[SR]]/../../../../sysroot/el/fp64/nan2008/usr/lib/../lib"
+// CHECK-EL-NAN64-32R2: "[[TC]]/el/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN64-32R2: "[[TC]]/../../../../sysroot/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, micromips, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mmicromips -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF-MM %s
+// CHECK-EL-HF-MM: "-internal-isystem"
+// CHECK-EL-HF-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF-MM: "-internal-isystem"
+// CHECK-EL-HF-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el"
+// CHECK-EL-HF-MM: "-internal-isystem"
+// CHECK-EL-HF-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF-MM: "-internal-externc-isystem"
+// CHECK-EL-HF-MM: "[[TC]]/include"
+// CHECK-EL-HF-MM: "-internal-externc-isystem"
+// CHECK-EL-HF-MM: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF-MM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF-MM: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/micromips/el"
+// CHECK-EL-HF-MM: "[[TC]]/../../../../sysroot/micromips/el/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-MM: "[[TC]]/../../../../sysroot/micromips/el/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-MM: "[[TC]]/micromips/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF-MM: "-L[[SR]]/micromips/el"
+// CHECK-EL-HF-MM: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/micromips/el"
+// CHECK-EL-HF-MM: "-L[[SR]]/../../../../sysroot/micromips/el/usr/lib/../lib"
+// CHECK-EL-HF-MM: "[[TC]]/micromips/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-MM: "[[TC]]/../../../../sysroot/micromips/el/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, micromips, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mmicromips -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF64-MM %s
+// CHECK-EL-HF64-MM: "-internal-isystem"
+// CHECK-EL-HF64-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF64-MM: "-internal-isystem"
+// CHECK-EL-HF64-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/fp64"
+// CHECK-EL-HF64-MM: "-internal-isystem"
+// CHECK-EL-HF64-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF64-MM: "-internal-externc-isystem"
+// CHECK-EL-HF64-MM: "[[TC]]/include"
+// CHECK-EL-HF64-MM: "-internal-externc-isystem"
+// CHECK-EL-HF64-MM: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF64-MM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF64-MM: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/micromips/el/fp64"
+// CHECK-EL-HF64-MM: "[[TC]]/../../../../sysroot/micromips/el/fp64/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF64-MM: "[[TC]]/../../../../sysroot/micromips/el/fp64/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF64-MM: "[[TC]]/micromips/el/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF64-MM: "-L[[SR]]/micromips/el/fp64"
+// CHECK-EL-HF64-MM: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/micromips/el/fp64"
+// CHECK-EL-HF64-MM: "-L[[SR]]/../../../../sysroot/micromips/el/fp64/usr/lib/../lib"
+// CHECK-EL-HF64-MM: "[[TC]]/micromips/el/fp64{{/|\\\\}}crtend.o"
+// CHECK-EL-HF64-MM: "[[TC]]/../../../../sysroot/micromips/el/fp64/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, micromips, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mmicromips -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-SF-MM %s
+// CHECK-EL-SF-MM: "-internal-isystem"
+// CHECK-EL-SF-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-SF-MM: "-internal-isystem"
+// CHECK-EL-SF-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/sof"
+// CHECK-EL-SF-MM: "-internal-isystem"
+// CHECK-EL-SF-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-SF-MM: "-internal-externc-isystem"
+// CHECK-EL-SF-MM: "[[TC]]/include"
+// CHECK-EL-SF-MM: "-internal-externc-isystem"
+// CHECK-EL-SF-MM: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-SF-MM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-SF-MM: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/micromips/el/sof"
+// CHECK-EL-SF-MM: "[[TC]]/../../../../sysroot/micromips/el/sof/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-MM: "[[TC]]/../../../../sysroot/micromips/el/sof/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-MM: "[[TC]]/micromips/el/sof{{/|\\\\}}crtbegin.o"
+// CHECK-EL-SF-MM: "-L[[SR]]/micromips/el/sof"
+// CHECK-EL-SF-MM: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/micromips/el/sof"
+// CHECK-EL-SF-MM: "-L[[SR]]/../../../../sysroot/micromips/el/sof/usr/lib/../lib"
+// CHECK-EL-SF-MM: "[[TC]]/micromips/el/sof{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-MM: "[[TC]]/../../../../sysroot/micromips/el/sof/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, micromips, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mmicromips -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN-MM %s
+// CHECK-EL-NAN-MM: "-internal-isystem"
+// CHECK-EL-NAN-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN-MM: "-internal-isystem"
+// CHECK-EL-NAN-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/nan2008"
+// CHECK-EL-NAN-MM: "-internal-isystem"
+// CHECK-EL-NAN-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN-MM: "-internal-externc-isystem"
+// CHECK-EL-NAN-MM: "[[TC]]/include"
+// CHECK-EL-NAN-MM: "-internal-externc-isystem"
+// CHECK-EL-NAN-MM: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN-MM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN-MM: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/micromips/el/nan2008"
+// CHECK-EL-NAN-MM: "[[TC]]/../../../../sysroot/micromips/el/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN-MM: "[[TC]]/../../../../sysroot/micromips/el/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN-MM: "[[TC]]/micromips/el/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN-MM: "-L[[SR]]/micromips/el/nan2008"
+// CHECK-EL-NAN-MM: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/micromips/el/nan2008"
+// CHECK-EL-NAN-MM: "-L[[SR]]/../../../../sysroot/micromips/el/nan2008/usr/lib/../lib"
+// CHECK-EL-NAN-MM: "[[TC]]/micromips/el/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN-MM: "[[TC]]/../../../../sysroot/micromips/el/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, micromips, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mipsel-linux-gnu -mmicromips -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-MM %s
+// CHECK-EL-NAN64-MM: "-internal-isystem"
+// CHECK-EL-NAN64-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN64-MM: "-internal-isystem"
+// CHECK-EL-NAN64-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/micromips/el/fp64/nan2008"
+// CHECK-EL-NAN64-MM: "-internal-isystem"
+// CHECK-EL-NAN64-MM: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN64-MM: "-internal-externc-isystem"
+// CHECK-EL-NAN64-MM: "[[TC]]/include"
+// CHECK-EL-NAN64-MM: "-internal-externc-isystem"
+// CHECK-EL-NAN64-MM: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN64-MM: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN64-MM: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/micromips/el/fp64/nan2008"
+// CHECK-EL-NAN64-MM: "[[TC]]/../../../../sysroot/micromips/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN64-MM: "[[TC]]/../../../../sysroot/micromips/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN64-MM: "[[TC]]/micromips/el/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN64-MM: "-L[[SR]]/micromips/el/fp64/nan2008"
+// CHECK-EL-NAN64-MM: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/../lib/micromips/el/fp64/nan2008"
+// CHECK-EL-NAN64-MM: "-L[[SR]]/../../../../sysroot/micromips/el/fp64/nan2008/usr/lib/../lib"
+// CHECK-EL-NAN64-MM: "[[TC]]/micromips/el/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN64-MM: "[[TC]]/../../../../sysroot/micromips/el/fp64/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64, ABI n32, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64 -mabi=n32 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF-64-N32 %s
+// CHECK-EL-HF-64-N32: "-internal-isystem"
+// CHECK-EL-HF-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF-64-N32: "-internal-isystem"
+// CHECK-EL-HF-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el"
+// CHECK-EL-HF-64-N32: "-internal-isystem"
+// CHECK-EL-HF-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF-64-N32: "-internal-externc-isystem"
+// CHECK-EL-HF-64-N32: "[[TC]]/include"
+// CHECK-EL-HF-64-N32: "-internal-externc-isystem"
+// CHECK-EL-HF-64-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF-64-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF-64-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/el"
+// CHECK-EL-HF-64-N32: "[[TC]]/../../../../sysroot/mips64/el/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-64-N32: "[[TC]]/../../../../sysroot/mips64/el/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-64-N32: "[[TC]]/mips64/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF-64-N32: "-L[[SR]]/mips64/el"
+// CHECK-EL-HF-64-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/el"
+// CHECK-EL-HF-64-N32: "-L[[SR]]/../../../../sysroot/mips64/el/usr/lib"
+// CHECK-EL-HF-64-N32: "[[TC]]/mips64/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-64-N32: "[[TC]]/../../../../sysroot/mips64/el/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64, ABI n32, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64 -mabi=n32 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF64-64-N32 %s
+// CHECK-EL-HF64-64-N32: "-internal-isystem"
+// CHECK-EL-HF64-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF64-64-N32: "-internal-isystem"
+// CHECK-EL-HF64-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/fp64"
+// CHECK-EL-HF64-64-N32: "-internal-isystem"
+// CHECK-EL-HF64-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF64-64-N32: "-internal-externc-isystem"
+// CHECK-EL-HF64-64-N32: "[[TC]]/include"
+// CHECK-EL-HF64-64-N32: "-internal-externc-isystem"
+// CHECK-EL-HF64-64-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF64-64-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF64-64-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/el/fp64"
+// CHECK-EL-HF64-64-N32: "[[TC]]/../../../../sysroot/mips64/el/fp64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF64-64-N32: "[[TC]]/../../../../sysroot/mips64/el/fp64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF64-64-N32: "[[TC]]/mips64/el/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF64-64-N32: "-L[[SR]]/mips64/el/fp64"
+// CHECK-EL-HF64-64-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/el/fp64"
+// CHECK-EL-HF64-64-N32: "-L[[SR]]/../../../../sysroot/mips64/el/fp64/usr/lib"
+// CHECK-EL-HF64-64-N32: "[[TC]]/mips64/el/fp64{{/|\\\\}}crtend.o"
+// CHECK-EL-HF64-64-N32: "[[TC]]/../../../../sysroot/mips64/el/fp64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64, ABI n32, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64 -mabi=n32 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-SF-64-N32 %s
+// CHECK-EL-SF-64-N32: "-internal-isystem"
+// CHECK-EL-SF-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-SF-64-N32: "-internal-isystem"
+// CHECK-EL-SF-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/sof"
+// CHECK-EL-SF-64-N32: "-internal-isystem"
+// CHECK-EL-SF-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-SF-64-N32: "-internal-externc-isystem"
+// CHECK-EL-SF-64-N32: "[[TC]]/include"
+// CHECK-EL-SF-64-N32: "-internal-externc-isystem"
+// CHECK-EL-SF-64-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-SF-64-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-SF-64-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/el/sof"
+// CHECK-EL-SF-64-N32: "[[TC]]/../../../../sysroot/mips64/el/sof/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-64-N32: "[[TC]]/../../../../sysroot/mips64/el/sof/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-64-N32: "[[TC]]/mips64/el/sof{{/|\\\\}}crtbegin.o"
+// CHECK-EL-SF-64-N32: "-L[[SR]]/mips64/el/sof"
+// CHECK-EL-SF-64-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/el/sof"
+// CHECK-EL-SF-64-N32: "-L[[SR]]/../../../../sysroot/mips64/el/sof/usr/lib"
+// CHECK-EL-SF-64-N32: "[[TC]]/mips64/el/sof{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-64-N32: "[[TC]]/../../../../sysroot/mips64/el/sof/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64, ABI n32, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64 -mabi=n32 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN-64-N32 %s
+// CHECK-EL-NAN-64-N32: "-internal-isystem"
+// CHECK-EL-NAN-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN-64-N32: "-internal-isystem"
+// CHECK-EL-NAN-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/nan2008"
+// CHECK-EL-NAN-64-N32: "-internal-isystem"
+// CHECK-EL-NAN-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN-64-N32: "-internal-externc-isystem"
+// CHECK-EL-NAN-64-N32: "[[TC]]/include"
+// CHECK-EL-NAN-64-N32: "-internal-externc-isystem"
+// CHECK-EL-NAN-64-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN-64-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN-64-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/el/nan2008"
+// CHECK-EL-NAN-64-N32: "[[TC]]/../../../../sysroot/mips64/el/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN-64-N32: "[[TC]]/../../../../sysroot/mips64/el/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN-64-N32: "[[TC]]/mips64/el/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN-64-N32: "-L[[SR]]/mips64/el/nan2008"
+// CHECK-EL-NAN-64-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/el/nan2008"
+// CHECK-EL-NAN-64-N32: "-L[[SR]]/../../../../sysroot/mips64/el/nan2008/usr/lib"
+// CHECK-EL-NAN-64-N32: "[[TC]]/mips64/el/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN-64-N32: "[[TC]]/../../../../sysroot/mips64/el/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64, ABI n32, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64 -mabi=n32 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-64-N32 %s
+// CHECK-EL-NAN64-64-N32: "-internal-isystem"
+// CHECK-EL-NAN64-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN64-64-N32: "-internal-isystem"
+// CHECK-EL-NAN64-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64-N32: "-internal-isystem"
+// CHECK-EL-NAN64-64-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN64-64-N32: "-internal-externc-isystem"
+// CHECK-EL-NAN64-64-N32: "[[TC]]/include"
+// CHECK-EL-NAN64-64-N32: "-internal-externc-isystem"
+// CHECK-EL-NAN64-64-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN64-64-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN64-64-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64-N32: "[[TC]]/../../../../sysroot/mips64/el/fp64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN64-64-N32: "[[TC]]/../../../../sysroot/mips64/el/fp64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN64-64-N32: "[[TC]]/mips64/el/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN64-64-N32: "-L[[SR]]/mips64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64-N32: "-L[[SR]]/../../../../sysroot/mips64/el/fp64/nan2008/usr/lib"
+// CHECK-EL-NAN64-64-N32: "[[TC]]/mips64/el/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN64-64-N32: "[[TC]]/../../../../sysroot/mips64/el/fp64/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64, ABI 64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64 -mabi=64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF-64-64 %s
+// CHECK-EL-HF-64-64: "-internal-isystem"
+// CHECK-EL-HF-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF-64-64: "-internal-isystem"
+// CHECK-EL-HF-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el"
+// CHECK-EL-HF-64-64: "-internal-isystem"
+// CHECK-EL-HF-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF-64-64: "-internal-externc-isystem"
+// CHECK-EL-HF-64-64: "[[TC]]/include"
+// CHECK-EL-HF-64-64: "-internal-externc-isystem"
+// CHECK-EL-HF-64-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF-64-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF-64-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/64/el"
+// CHECK-EL-HF-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-64-64: "[[TC]]/mips64/64/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF-64-64: "-L[[SR]]/mips64/64/el"
+// CHECK-EL-HF-64-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/64/el"
+// CHECK-EL-HF-64-64: "-L[[SR]]/../../../../sysroot/mips64/64/el/usr/lib"
+// CHECK-EL-HF-64-64: "[[TC]]/mips64/64/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64, ABI 64, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64 -mabi=64 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF64-64-64 %s
+// CHECK-EL-HF64-64-64: "-internal-isystem"
+// CHECK-EL-HF64-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF64-64-64: "-internal-isystem"
+// CHECK-EL-HF64-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/fp64"
+// CHECK-EL-HF64-64-64: "-internal-isystem"
+// CHECK-EL-HF64-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF64-64-64: "-internal-externc-isystem"
+// CHECK-EL-HF64-64-64: "[[TC]]/include"
+// CHECK-EL-HF64-64-64: "-internal-externc-isystem"
+// CHECK-EL-HF64-64-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF64-64-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF64-64-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/64/el/fp64"
+// CHECK-EL-HF64-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/fp64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF64-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/fp64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF64-64-64: "[[TC]]/mips64/64/el/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF64-64-64: "-L[[SR]]/mips64/64/el/fp64"
+// CHECK-EL-HF64-64-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/64/el/fp64"
+// CHECK-EL-HF64-64-64: "-L[[SR]]/../../../../sysroot/mips64/64/el/fp64/usr/lib"
+// CHECK-EL-HF64-64-64: "[[TC]]/mips64/64/el/fp64{{/|\\\\}}crtend.o"
+// CHECK-EL-HF64-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/fp64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64, ABI 64, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64 -mabi=64 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-SF-64-64 %s
+// CHECK-EL-SF-64-64: "-internal-isystem"
+// CHECK-EL-SF-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-SF-64-64: "-internal-isystem"
+// CHECK-EL-SF-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/sof"
+// CHECK-EL-SF-64-64: "-internal-isystem"
+// CHECK-EL-SF-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-SF-64-64: "-internal-externc-isystem"
+// CHECK-EL-SF-64-64: "[[TC]]/include"
+// CHECK-EL-SF-64-64: "-internal-externc-isystem"
+// CHECK-EL-SF-64-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-SF-64-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-SF-64-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/64/el/sof"
+// CHECK-EL-SF-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/sof/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/sof/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-64-64: "[[TC]]/mips64/64/el/sof{{/|\\\\}}crtbegin.o"
+// CHECK-EL-SF-64-64: "-L[[SR]]/mips64/64/el/sof"
+// CHECK-EL-SF-64-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/64/el/sof"
+// CHECK-EL-SF-64-64: "-L[[SR]]/../../../../sysroot/mips64/64/el/sof/usr/lib"
+// CHECK-EL-SF-64-64: "[[TC]]/mips64/64/el/sof{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/sof/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64, ABI 64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64 -mabi=64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN-64-64 %s
+// CHECK-EL-NAN-64-64: "-internal-isystem"
+// CHECK-EL-NAN-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN-64-64: "-internal-isystem"
+// CHECK-EL-NAN-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/nan2008"
+// CHECK-EL-NAN-64-64: "-internal-isystem"
+// CHECK-EL-NAN-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN-64-64: "-internal-externc-isystem"
+// CHECK-EL-NAN-64-64: "[[TC]]/include"
+// CHECK-EL-NAN-64-64: "-internal-externc-isystem"
+// CHECK-EL-NAN-64-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN-64-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN-64-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/64/el/nan2008"
+// CHECK-EL-NAN-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN-64-64: "[[TC]]/mips64/64/el/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN-64-64: "-L[[SR]]/mips64/64/el/nan2008"
+// CHECK-EL-NAN-64-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/64/el/nan2008"
+// CHECK-EL-NAN-64-64: "-L[[SR]]/../../../../sysroot/mips64/64/el/nan2008/usr/lib"
+// CHECK-EL-NAN-64-64: "[[TC]]/mips64/64/el/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64, ABI 64, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64 -mabi=64 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-64-64 %s
+// CHECK-EL-NAN64-64-64: "-internal-isystem"
+// CHECK-EL-NAN64-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN64-64-64: "-internal-isystem"
+// CHECK-EL-NAN64-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64/64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64-64: "-internal-isystem"
+// CHECK-EL-NAN64-64-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN64-64-64: "-internal-externc-isystem"
+// CHECK-EL-NAN64-64-64: "[[TC]]/include"
+// CHECK-EL-NAN64-64-64: "-internal-externc-isystem"
+// CHECK-EL-NAN64-64-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN64-64-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN64-64-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64/64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/fp64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN64-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/fp64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN64-64-64: "[[TC]]/mips64/64/el/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN64-64-64: "-L[[SR]]/mips64/64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64/64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64-64: "-L[[SR]]/../../../../sysroot/mips64/64/el/fp64/nan2008/usr/lib"
+// CHECK-EL-NAN64-64-64: "[[TC]]/mips64/64/el/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN64-64-64: "[[TC]]/../../../../sysroot/mips64/64/el/fp64/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64r2, ABI n32, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64r2 -mabi=n32 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF-64R2-N32 %s
+// CHECK-EL-HF-64R2-N32: "-internal-isystem"
+// CHECK-EL-HF-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF-64R2-N32: "-internal-isystem"
+// CHECK-EL-HF-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el"
+// CHECK-EL-HF-64R2-N32: "-internal-isystem"
+// CHECK-EL-HF-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF-64R2-N32: "-internal-externc-isystem"
+// CHECK-EL-HF-64R2-N32: "[[TC]]/include"
+// CHECK-EL-HF-64R2-N32: "-internal-externc-isystem"
+// CHECK-EL-HF-64R2-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF-64R2-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF-64R2-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/el"
+// CHECK-EL-HF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-64R2-N32: "[[TC]]/mips64r2/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF-64R2-N32: "-L[[SR]]/mips64r2/el"
+// CHECK-EL-HF-64R2-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/el"
+// CHECK-EL-HF-64R2-N32: "-L[[SR]]/../../../../sysroot/mips64r2/el/usr/lib"
+// CHECK-EL-HF-64R2-N32: "[[TC]]/mips64r2/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64r2, ABI n32, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64r2 -mabi=n32 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF64-64R2-N32 %s
+// CHECK-EL-HF64-64R2-N32: "-internal-isystem"
+// CHECK-EL-HF64-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF64-64R2-N32: "-internal-isystem"
+// CHECK-EL-HF64-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/fp64"
+// CHECK-EL-HF64-64R2-N32: "-internal-isystem"
+// CHECK-EL-HF64-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF64-64R2-N32: "-internal-externc-isystem"
+// CHECK-EL-HF64-64R2-N32: "[[TC]]/include"
+// CHECK-EL-HF64-64R2-N32: "-internal-externc-isystem"
+// CHECK-EL-HF64-64R2-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF64-64R2-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF64-64R2-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/el/fp64"
+// CHECK-EL-HF64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/fp64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/fp64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF64-64R2-N32: "[[TC]]/mips64r2/el/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF64-64R2-N32: "-L[[SR]]/mips64r2/el/fp64"
+// CHECK-EL-HF64-64R2-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/el/fp64"
+// CHECK-EL-HF64-64R2-N32: "-L[[SR]]/../../../../sysroot/mips64r2/el/fp64/usr/lib"
+// CHECK-EL-HF64-64R2-N32: "[[TC]]/mips64r2/el/fp64{{/|\\\\}}crtend.o"
+// CHECK-EL-HF64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/fp64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64r2, ABI n32, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64r2 -mabi=n32 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-SF-64R2-N32 %s
+// CHECK-EL-SF-64R2-N32: "-internal-isystem"
+// CHECK-EL-SF-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-SF-64R2-N32: "-internal-isystem"
+// CHECK-EL-SF-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/sof"
+// CHECK-EL-SF-64R2-N32: "-internal-isystem"
+// CHECK-EL-SF-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-SF-64R2-N32: "-internal-externc-isystem"
+// CHECK-EL-SF-64R2-N32: "[[TC]]/include"
+// CHECK-EL-SF-64R2-N32: "-internal-externc-isystem"
+// CHECK-EL-SF-64R2-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-SF-64R2-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-SF-64R2-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/el/sof"
+// CHECK-EL-SF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/sof/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/sof/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-64R2-N32: "[[TC]]/mips64r2/el/sof{{/|\\\\}}crtbegin.o"
+// CHECK-EL-SF-64R2-N32: "-L[[SR]]/mips64r2/el/sof"
+// CHECK-EL-SF-64R2-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/el/sof"
+// CHECK-EL-SF-64R2-N32: "-L[[SR]]/../../../../sysroot/mips64r2/el/sof/usr/lib"
+// CHECK-EL-SF-64R2-N32: "[[TC]]/mips64r2/el/sof{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/sof/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64r2, ABI n32, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64r2 -mabi=n32 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN-64R2-N32 %s
+// CHECK-EL-NAN-64R2-N32: "-internal-isystem"
+// CHECK-EL-NAN-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN-64R2-N32: "-internal-isystem"
+// CHECK-EL-NAN-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/nan2008"
+// CHECK-EL-NAN-64R2-N32: "-internal-isystem"
+// CHECK-EL-NAN-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN-64R2-N32: "-internal-externc-isystem"
+// CHECK-EL-NAN-64R2-N32: "[[TC]]/include"
+// CHECK-EL-NAN-64R2-N32: "-internal-externc-isystem"
+// CHECK-EL-NAN-64R2-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN-64R2-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN-64R2-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/el/nan2008"
+// CHECK-EL-NAN-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN-64R2-N32: "[[TC]]/mips64r2/el/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN-64R2-N32: "-L[[SR]]/mips64r2/el/nan2008"
+// CHECK-EL-NAN-64R2-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/el/nan2008"
+// CHECK-EL-NAN-64R2-N32: "-L[[SR]]/../../../../sysroot/mips64r2/el/nan2008/usr/lib"
+// CHECK-EL-NAN-64R2-N32: "[[TC]]/mips64r2/el/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64r2, ABI n32, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64r2 -mabi=n32 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-64R2-N32 %s
+// CHECK-EL-NAN64-64R2-N32: "-internal-isystem"
+// CHECK-EL-NAN64-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN64-64R2-N32: "-internal-isystem"
+// CHECK-EL-NAN64-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/el/fp64/nan2008"
+// CHECK-EL-NAN64-64R2-N32: "-internal-isystem"
+// CHECK-EL-NAN64-64R2-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN64-64R2-N32: "-internal-externc-isystem"
+// CHECK-EL-NAN64-64R2-N32: "[[TC]]/include"
+// CHECK-EL-NAN64-64R2-N32: "-internal-externc-isystem"
+// CHECK-EL-NAN64-64R2-N32: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN64-64R2-N32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN64-64R2-N32: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/el/fp64/nan2008"
+// CHECK-EL-NAN64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/fp64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/fp64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN64-64R2-N32: "[[TC]]/mips64r2/el/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN64-64R2-N32: "-L[[SR]]/mips64r2/el/fp64/nan2008"
+// CHECK-EL-NAN64-64R2-N32: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/el/fp64/nan2008"
+// CHECK-EL-NAN64-64R2-N32: "-L[[SR]]/../../../../sysroot/mips64r2/el/fp64/nan2008/usr/lib"
+// CHECK-EL-NAN64-64R2-N32: "[[TC]]/mips64r2/el/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN64-64R2-N32: "[[TC]]/../../../../sysroot/mips64r2/el/fp64/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64r2, ABI 64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64r2 -mabi=64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF-64R2-64 %s
+// CHECK-EL-HF-64R2-64: "-internal-isystem"
+// CHECK-EL-HF-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF-64R2-64: "-internal-isystem"
+// CHECK-EL-HF-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el"
+// CHECK-EL-HF-64R2-64: "-internal-isystem"
+// CHECK-EL-HF-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF-64R2-64: "-internal-externc-isystem"
+// CHECK-EL-HF-64R2-64: "[[TC]]/include"
+// CHECK-EL-HF-64R2-64: "-internal-externc-isystem"
+// CHECK-EL-HF-64R2-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF-64R2-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF-64R2-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/64/el"
+// CHECK-EL-HF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF-64R2-64: "[[TC]]/mips64r2/64/el{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF-64R2-64: "-L[[SR]]/mips64r2/64/el"
+// CHECK-EL-HF-64R2-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/64/el"
+// CHECK-EL-HF-64R2-64: "-L[[SR]]/../../../../sysroot/mips64r2/64/el/usr/lib"
+// CHECK-EL-HF-64R2-64: "[[TC]]/mips64r2/64/el{{/|\\\\}}crtend.o"
+// CHECK-EL-HF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64r2, ABI 64, fp64, hard float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64r2 -mabi=64 -mfp64 -mhard-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-HF64-64R2-64 %s
+// CHECK-EL-HF64-64R2-64: "-internal-isystem"
+// CHECK-EL-HF64-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-HF64-64R2-64: "-internal-isystem"
+// CHECK-EL-HF64-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/fp64"
+// CHECK-EL-HF64-64R2-64: "-internal-isystem"
+// CHECK-EL-HF64-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-HF64-64R2-64: "-internal-externc-isystem"
+// CHECK-EL-HF64-64R2-64: "[[TC]]/include"
+// CHECK-EL-HF64-64R2-64: "-internal-externc-isystem"
+// CHECK-EL-HF64-64R2-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-HF64-64R2-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-HF64-64R2-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/64/el/fp64"
+// CHECK-EL-HF64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/fp64/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-HF64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/fp64/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-HF64-64R2-64: "[[TC]]/mips64r2/64/el/fp64{{/|\\\\}}crtbegin.o"
+// CHECK-EL-HF64-64R2-64: "-L[[SR]]/mips64r2/64/el/fp64"
+// CHECK-EL-HF64-64R2-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/64/el/fp64"
+// CHECK-EL-HF64-64R2-64: "-L[[SR]]/../../../../sysroot/mips64r2/64/el/fp64/usr/lib"
+// CHECK-EL-HF64-64R2-64: "[[TC]]/mips64r2/64/el/fp64{{/|\\\\}}crtend.o"
+// CHECK-EL-HF64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/fp64/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64r2, ABI 64, soft float
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64r2 -mabi=64 -msoft-float \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-SF-64R2-64 %s
+// CHECK-EL-SF-64R2-64: "-internal-isystem"
+// CHECK-EL-SF-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-SF-64R2-64: "-internal-isystem"
+// CHECK-EL-SF-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/sof"
+// CHECK-EL-SF-64R2-64: "-internal-isystem"
+// CHECK-EL-SF-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-SF-64R2-64: "-internal-externc-isystem"
+// CHECK-EL-SF-64R2-64: "[[TC]]/include"
+// CHECK-EL-SF-64R2-64: "-internal-externc-isystem"
+// CHECK-EL-SF-64R2-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-SF-64R2-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-SF-64R2-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/64/el/sof"
+// CHECK-EL-SF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/sof/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-SF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/sof/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-SF-64R2-64: "[[TC]]/mips64r2/64/el/sof{{/|\\\\}}crtbegin.o"
+// CHECK-EL-SF-64R2-64: "-L[[SR]]/mips64r2/64/el/sof"
+// CHECK-EL-SF-64R2-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/64/el/sof"
+// CHECK-EL-SF-64R2-64: "-L[[SR]]/../../../../sysroot/mips64r2/64/el/sof/usr/lib"
+// CHECK-EL-SF-64R2-64: "[[TC]]/mips64r2/64/el/sof{{/|\\\\}}crtend.o"
+// CHECK-EL-SF-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/sof/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64r2, ABI 64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64r2 -mabi=64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN-64R2-64 %s
+// CHECK-EL-NAN-64R2-64: "-internal-isystem"
+// CHECK-EL-NAN-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN-64R2-64: "-internal-isystem"
+// CHECK-EL-NAN-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/nan2008"
+// CHECK-EL-NAN-64R2-64: "-internal-isystem"
+// CHECK-EL-NAN-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN-64R2-64: "-internal-externc-isystem"
+// CHECK-EL-NAN-64R2-64: "[[TC]]/include"
+// CHECK-EL-NAN-64R2-64: "-internal-externc-isystem"
+// CHECK-EL-NAN-64R2-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN-64R2-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN-64R2-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/64/el/nan2008"
+// CHECK-EL-NAN-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN-64R2-64: "[[TC]]/mips64r2/64/el/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN-64R2-64: "-L[[SR]]/mips64r2/64/el/nan2008"
+// CHECK-EL-NAN-64R2-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/64/el/nan2008"
+// CHECK-EL-NAN-64R2-64: "-L[[SR]]/../../../../sysroot/mips64r2/64/el/nan2008/usr/lib"
+// CHECK-EL-NAN-64R2-64: "[[TC]]/mips64r2/64/el/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/nan2008/usr/lib{{/|\\\\}}crtn.o"
+//
+// = Little-endian, mips64r2, ABI 64, fp64, nan2008
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=mips64el-linux-gnu -mips64r2 -mabi=64 -mfp64 -mnan=2008 \
+// RUN: --gcc-toolchain=%S/Inputs/mips_fsf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-64R2-64 %s
+// CHECK-EL-NAN64-64R2-64: "-internal-isystem"
+// CHECK-EL-NAN64-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0"
+// CHECK-EL-NAN64-64R2-64: "-internal-isystem"
+// CHECK-EL-NAN64-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/mips-mti-linux-gnu/mips64r2/64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64R2-64: "-internal-isystem"
+// CHECK-EL-NAN64-64R2-64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0/backward"
+// CHECK-EL-NAN64-64R2-64: "-internal-externc-isystem"
+// CHECK-EL-NAN64-64R2-64: "[[TC]]/include"
+// CHECK-EL-NAN64-64R2-64: "-internal-externc-isystem"
+// CHECK-EL-NAN64-64R2-64: "[[TC]]/../../../../sysroot/usr/include"
+// CHECK-EL-NAN64-64R2-64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-EL-NAN64-64R2-64: "--sysroot=[[SR:[^"]+]]/../../../../sysroot/mips64r2/64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/fp64/nan2008/usr/lib{{/|\\\\}}crt1.o"
+// CHECK-EL-NAN64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/fp64/nan2008/usr/lib{{/|\\\\}}crti.o"
+// CHECK-EL-NAN64-64R2-64: "[[TC]]/mips64r2/64/el/fp64/nan2008{{/|\\\\}}crtbegin.o"
+// CHECK-EL-NAN64-64R2-64: "-L[[SR]]/mips64r2/64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64R2-64: "-L[[SR]]/../../../../mips-mti-linux-gnu/lib/mips64r2/64/el/fp64/nan2008"
+// CHECK-EL-NAN64-64R2-64: "-L[[SR]]/../../../../sysroot/mips64r2/64/el/fp64/nan2008/usr/lib"
+// CHECK-EL-NAN64-64R2-64: "[[TC]]/mips64r2/64/el/fp64/nan2008{{/|\\\\}}crtend.o"
+// CHECK-EL-NAN64-64R2-64: "[[TC]]/../../../../sysroot/mips64r2/64/el/fp64/nan2008/usr/lib{{/|\\\\}}crtn.o"
diff --git a/test/Driver/mipsel-nacl-defines.cpp b/test/Driver/mipsel-nacl-defines.cpp
new file mode 100644
index 000000000000..0f63d7659e51
--- /dev/null
+++ b/test/Driver/mipsel-nacl-defines.cpp
@@ -0,0 +1,45 @@
+// RUN: %clang -target mipsel-unknown-nacl -### %s -emit-llvm-only -c -o %t.o 2>&1 | FileCheck %s -check-prefix=ECHO
+// RUN: %clang -target mipsel-unknown-nacl %s -emit-llvm -S -c -o - | FileCheck %s
+// RUN: %clang -target mipsel-unknown-nacl %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS
+
+// ECHO: {{.*}} "-cc1" {{.*}}mipsel-nacl-defines.c
+
+// Check platform defines
+
+// CHECK: _MIPSELdefined
+#ifdef _MIPSEL
+void _MIPSELdefined() {}
+#endif
+
+// CHECK: _mipsdefined
+#ifdef _mips
+void _mipsdefined() {}
+#endif
+
+// CHECK: __native_client__defined
+#ifdef __native_client__
+void __native_client__defined() {}
+#endif
+
+// CHECK: unixdefined
+#ifdef unix
+void unixdefined() {}
+#endif
+
+// CHECK: __ELF__defined
+#ifdef __ELF__
+void __ELF__defined() {}
+#endif
+
+// CHECK: _GNU_SOURCEdefined
+#ifdef _GNU_SOURCE
+void _GNU_SOURCEdefined() {}
+#endif
+
+// THREADS: _REENTRANTdefined
+// CHECK: _REENTRANTundefined
+#ifdef _REENTRANT
+void _REENTRANTdefined() {}
+#else
+void _REENTRANTundefined() {}
+#endif
diff --git a/test/Driver/montavista-gcc-toolchain.c b/test/Driver/montavista-gcc-toolchain.c
index b9ab729ef21c..da76e9579439 100644
--- a/test/Driver/montavista-gcc-toolchain.c
+++ b/test/Driver/montavista-gcc-toolchain.c
@@ -1,9 +1,9 @@
// Test that the montavista gcc-toolchain is correctly detected
//
// RUN: %clang -print-libgcc-file-name 2>&1 \
-// RUN: -target i686-montavista-linux \
-// RUN: -gcc-toolchain %S/Inputs/montavista_i686_tree/usr \
+// RUN: --target=i686-montavista-linux \
+// RUN: --gcc-toolchain=%S/Inputs/montavista_i686_tree/usr \
// RUN: | FileCheck %s
// Test for header search toolchain detection.
-// CHECK: montavista_i686_tree/usr/lib/gcc/i686-montavista-linux/4.2.0/libgcc.a
+// CHECK: montavista_i686_tree/usr/lib/gcc/i686-montavista-linux/4.2.0{{/|\\}}libgcc.a
diff --git a/test/Driver/netbsd.c b/test/Driver/netbsd.c
new file mode 100644
index 000000000000..09c2bd3d6e1f
--- /dev/null
+++ b/test/Driver/netbsd.c
@@ -0,0 +1,57 @@
+// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=X86_64 %s
+// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd7.0.0 \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=X86_64-7 %s
+// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd6.0.0 \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=X86_64-6 %s
+
+// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-X86_64 %s
+// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd7.0.0 -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-X86_64-7 %s
+// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd6.0.0 -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-X86_64-6 %s
+
+// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
+// X86_64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd7.0.0"
+// X86_64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd6.0.0"
+// X86_64-6: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// X86_64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// X86_64-6: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
+// S-X86_64: ld{{.*}}" "-Bstatic"
+// S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// S-X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd7.0.0"
+// S-X86_64-7: ld{{.*}}" "-Bstatic"
+// S-X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// S-X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// S-X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// S-X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd6.0.0"
+// S-X86_64-6: ld{{.*}}" "-Bstatic"
+// S-X86_64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// S-X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
+// S-X86_64-6: "-lgcc_eh" "-lc" "-lgcc"
+// S-X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
diff --git a/test/Driver/netbsd.cpp b/test/Driver/netbsd.cpp
new file mode 100644
index 000000000000..1c338d3e6925
--- /dev/null
+++ b/test/Driver/netbsd.cpp
@@ -0,0 +1,57 @@
+// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=X86_64 %s
+// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd7.0.0 \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=X86_64-7 %s
+// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd6.0.0 \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=X86_64-6 %s
+
+// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-X86_64 %s
+// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd7.0.0 -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-X86_64-7 %s
+// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd6.0.0 -static \
+// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=S-X86_64-6 %s
+
+// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
+// X86_64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// X86_64: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd7.0.0"
+// X86_64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// X86_64-7: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd6.0.0"
+// X86_64-6: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
+// X86_64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
+// X86_64-6: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
+// S-X86_64: ld{{.*}}" "-Bstatic"
+// S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// S-X86_64: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// S-X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd7.0.0"
+// S-X86_64-7: ld{{.*}}" "-Bstatic"
+// S-X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// S-X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
+// S-X86_64-7: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
+
+// S-X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd6.0.0"
+// S-X86_64-6: ld{{.*}}" "-Bstatic"
+// S-X86_64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
+// S-X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
+// S-X86_64-6: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc"
+// S-X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
diff --git a/test/Driver/no-integrated-as-win.c b/test/Driver/no-integrated-as-win.c
index 0d6c2958e57a..8f590a090168 100644
--- a/test/Driver/no-integrated-as-win.c
+++ b/test/Driver/no-integrated-as-win.c
@@ -1,3 +1,11 @@
// RUN: %clang -target x86_64-pc-win32 -### -no-integrated-as %s -c 2>&1 | FileCheck %s
+// CHECK: there is no external assembler that can be used on this platform
-// CHECK: there is no external assembler we can use on windows
+// But there is for mingw. The source file should only be mentioned once for
+// the compile step.
+// RUN: %clang -target i686-pc-mingw32 -### -no-integrated-as %s -c 2>&1 | FileCheck -check-prefix=MINGW %s
+// MINGW: "-cc1"
+// MINGW: "-main-file-name" "no-integrated-as-win.c"
+// MINGW: "-x" "c" "{{.*}}no-integrated-as-win.c"
+// The assembler goes here, but its name depends on PATH.
+// MINGW-NOT: no-integrated-as-win.c
diff --git a/test/Driver/no-objc-default-synthesize-properties.m b/test/Driver/no-objc-default-synthesize-properties.m
index e3805140fa04..a034926a9e2f 100644
--- a/test/Driver/no-objc-default-synthesize-properties.m
+++ b/test/Driver/no-objc-default-synthesize-properties.m
@@ -1,4 +1,4 @@
-// RUN: %clang -fsyntax-only -fno-objc-default-synthesize-properties -fobjc-default-synthesize-properties %s 2>&1 | FileCheck %s
+// RUN: not %clang -fsyntax-only -fno-objc-default-synthesize-properties -fobjc-default-synthesize-properties %s 2>&1 | FileCheck %s
@interface I
@property int P;
@@ -6,5 +6,5 @@
@implementation I
@end
-// CHECK: warning: argument unused during compilation: '-fno-objc-default-synthesize-properties'
-// CHECK: warning: argument unused during compilation: '-fobjc-default-synthesize-properties'
+// CHECK: error: unknown argument: '-fno-objc-default-synthesize-properties'
+// CHECK: error: unknown argument: '-fobjc-default-synthesize-properties'
diff --git a/test/Driver/noexecstack.c b/test/Driver/noexecstack.c
index 1f4772882654..5970713c1654 100644
--- a/test/Driver/noexecstack.c
+++ b/test/Driver/noexecstack.c
@@ -1 +1,3 @@
-// RUN: %clang -### %s -c -o tmp.o -triple i686-pc-linux-gnu -integrated-as -Wa,--noexecstack 2>&1 | grep "mnoexecstack"
+// RUN: %clang -### %s -c -o tmp.o -target i686-pc-linux-gnu -integrated-as -Wa,--noexecstack 2>&1 | FileCheck %s
+
+// CHECK: "-cc1" {{.*}} "-mnoexecstack"
diff --git a/test/Driver/nostdincxx.cpp b/test/Driver/nostdincxx.cpp
index 7e00555d04bd..1e1d85f35830 100644
--- a/test/Driver/nostdincxx.cpp
+++ b/test/Driver/nostdincxx.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx -nostdinc++ %s 2>&1 | FileCheck %s
+// RUN: not %clangxx -nostdinc++ %s 2>&1 | FileCheck %s
// XFAIL: win32
// CHECK: file not found
#include <vector>
diff --git a/test/Driver/objc_default_synth.m b/test/Driver/objc_default_synth.m
deleted file mode 100644
index a8c7f7e546db..000000000000
--- a/test/Driver/objc_default_synth.m
+++ /dev/null
@@ -1,6 +0,0 @@
-// We should be synthesizing properties by default on all platforms now.
-// RUN: %clang -### -target armv7-unknown-freebsd %s 2>&1 | FileCheck %s
-// RUN: %clang -### -target armv7-apple-ios %s 2>&1 | FileCheck %s
-// RUN: %clang -### -target i686-apple-macosx %s 2>&1 | FileCheck %s
-// REQUIRES: clang-driver
-// CHECK: -fobjc-default-synthesize
diff --git a/test/Driver/openbsd.c b/test/Driver/openbsd.c
index 4fd5b6a41b57..ef02b07d29ef 100644
--- a/test/Driver/openbsd.c
+++ b/test/Driver/openbsd.c
@@ -17,6 +17,10 @@
// RUN: | FileCheck --check-prefix=CHECK-LD-T %s
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -Z %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-LD-Z %s
+// RUN: %clang -no-canonical-prefixes -target mips64-unknown-openbsd %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MIPS64-LD %s
+// RUN: %clang -no-canonical-prefixes -target mips64el-unknown-openbsd %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s
// CHECK-LD-R: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
// CHECK-LD-R: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-r" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"
// CHECK-LD-S: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
@@ -25,3 +29,27 @@
// CHECK-LD-T: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-t" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"
// CHECK-LD-Z: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
// CHECK-LD-Z: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-Z" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"
+// CHECK-MIPS64-LD: clang{{.*}}" "-cc1" "-triple" "mips64-unknown-openbsd"
+// CHECK-MIPS64-LD: ld{{.*}}" "-EB" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"
+// CHECK-MIPS64EL-LD: clang{{.*}}" "-cc1" "-triple" "mips64el-unknown-openbsd"
+// CHECK-MIPS64EL-LD: ld{{.*}}" "-EL" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"
+
+// Check passing options to the assembler for various OpenBSD targets
+// RUN: %clang -target amd64-pc-openbsd -m32 -### -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-AMD64-M32 %s
+// RUN: %clang -target powerpc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-POWERPC %s
+// RUN: %clang -target mips64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-MIPS64 %s
+// RUN: %clang -target mips64-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-MIPS64-PIC %s
+// RUN: %clang -target mips64el-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-MIPS64EL %s
+// RUN: %clang -target mips64el-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-MIPS64EL-PIC %s
+// CHECK-AMD64-M32: as{{.*}}" "--32"
+// CHECK-POWERPC: as{{.*}}" "-mppc" "-many"
+// CHECK-MIPS64: as{{.*}}" "-mabi" "64" "-EB"
+// CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC"
+// CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL"
+// CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC"
diff --git a/test/Driver/option-aliases.c b/test/Driver/option-aliases.c
index 38bf4b1a5777..9cd9252a4832 100644
--- a/test/Driver/option-aliases.c
+++ b/test/Driver/option-aliases.c
@@ -1,11 +1,14 @@
-// RUN: %clang -ccc-print-options \
-// RUN: --save-temps --undefine-macro=FOO --undefine-macro FOO \
-// RUN: --param=FOO --output=FOO 2> %t
-// RUN: FileCheck --check-prefix=CHECK-OPTIONS < %t %s
+// RUN: %clang -### -S \
+// RUN: --save-temps --undefine-macro=FOO --undefine-macro BAR \
+// RUN: --param=FOO --output=FOO %s 2>&1 | \
+// RUN: FileCheck %s
-// CHECK-OPTIONS: Option 0 - Name: "-ccc-print-options", Values: {}
-// CHECK-OPTIONS: Option 1 - Name: "-save-temps", Values: {}
-// CHECK-OPTIONS: Option 2 - Name: "-U", Values: {"FOO"}
-// CHECK-OPTIONS: Option 3 - Name: "-U", Values: {"FOO"}
-// CHECK-OPTIONS: Option 4 - Name: "--param", Values: {"FOO"}
-// CHECK-OPTIONS: Option 5 - Name: "-o", Values: {"FOO"}
+// CHECK: "-cc1"
+// CHECK: "-E"
+// CHECK: "-U" "FOO"
+// CHECK: "-U" "BAR"
+// CHECK: "-o" "option-aliases.i"
+
+// CHECK-NEXT: "-cc1"
+// CHECK: "-S"
+// CHECK: "-o" "FOO"
diff --git a/test/Driver/parsing.c b/test/Driver/parsing.c
deleted file mode 100644
index eceba37d84fb..000000000000
--- a/test/Driver/parsing.c
+++ /dev/null
@@ -1,22 +0,0 @@
-// 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: "-ccc-print-options", Values: {}' %t
-// RUN: grep 'Option 1 - Name: "<input>", Values: {"input"}' %t
-// RUN: grep 'Option 2 - Name: "<unknown>", Values: {"-Yunknown"}' %t
-// RUN: grep 'Option 3 - Name: "-m32", Values: {}' %t
-// RUN: grep 'Option 4 - Name: "-arch", Values: {"ppc"}' %t
-// RUN: grep 'Option 5 - Name: "-d", Values: {"joined"}' %t
-// RUN: grep 'Option 6 - Name: "-A", Values: {"separate"}' %t
-// RUN: grep 'Option 7 - Name: "-A", Values: {"joined"}' %t
-// RUN: grep 'Option 8 - Name: "-Wp,", Values: {"one", "two"}' %t
-// RUN: grep 'Option 9 - Name: "-Xarch_", Values: {"joined", "AndSeparate"}' %t
-// RUN: grep 'Option 10 - 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
-
-// Verify that search continues after find the first option.
-// RUN: %clang -ccc-print-options -Wally 2> %t
-// RUN: grep 'Option 0 - Name: "-ccc-print-options", Values: {}' %t
-// RUN: grep 'Option 1 - Name: "-W", Values: {"ally"}' %t
diff --git a/test/Driver/pic.c b/test/Driver/pic.c
index 3faed2d18faf..30e1005c9737 100644
--- a/test/Driver/pic.c
+++ b/test/Driver/pic.c
@@ -24,6 +24,8 @@
// CHECK-PIE-LD: "Scrt1.o" "crti.o" "crtbeginS.o"
// CHECK-PIE-LD: "crtendS.o" "crtn.o"
//
+// CHECK-NOPIE-LD: "-nopie"
+//
// CHECK-DYNAMIC-NO-PIC-32: "-mrelocation-model" "dynamic-no-pic"
// CHECK-DYNAMIC-NO-PIC-32-NOT: "-pic-level"
// CHECK-DYNAMIC-NO-PIC-32-NOT: "-pie-level"
@@ -197,3 +199,13 @@
// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
// RUN: %clang -c %s -target armv7-apple-ios -fapple-kext -miphoneos-version-min=6.0.0 -static -### 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
+//
+// On OpenBSD, PIE is enabled by default, but can be disabled.
+// RUN: %clang -c %s -target i386-pc-openbsd -### 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-PIE2
+// RUN: %clang -c %s -target i386-pc-openbsd -fno-pie -### 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
+//
+// On OpenBSD, -nopie needs to be passed through to the linker.
+// RUN: %clang %s -target i386-pc-openbsd -nopie -### 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-NOPIE-LD
diff --git a/test/Driver/ppc-features.cpp b/test/Driver/ppc-features.cpp
index be78e19861b3..6959c629e581 100644
--- a/test/Driver/ppc-features.cpp
+++ b/test/Driver/ppc-features.cpp
@@ -4,15 +4,15 @@
// RUN: %clang -target powerpc64-linux-gnu -faltivec -fsyntax-only %s
// RUN: %clang -target powerpc64-linux-gnu -maltivec -fsyntax-only %s
-// RUN: %clang -target i386-pc-win32 -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
-// RUN: %clang -target x86_64-unknown-freebsd -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
-// RUN: %clang -target armv6-apple-darwin -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
-// RUN: %clang -target armv7-apple-darwin -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
-// RUN: %clang -target mips-linux-gnu -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
-// RUN: %clang -target mips64-linux-gnu -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
-// RUN: %clang -target sparc-unknown-solaris -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang -target i386-pc-win32 -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang -target x86_64-unknown-freebsd -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang -target armv6-apple-darwin -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang -target armv7-apple-darwin -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang -target mips-linux-gnu -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang -target mips64-linux-gnu -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang -target sparc-unknown-solaris -faltivec -fsyntax-only %s 2>&1 | FileCheck %s
-// CHECK: invalid argument '-faltivec' only allowed with 'ppc/ppc64'
+// CHECK: invalid argument '-faltivec' only allowed with 'ppc/ppc64/ppc64le'
// Check that -fno-altivec and -mno-altivec correctly disable the altivec
// target feature on powerpc.
@@ -86,3 +86,9 @@
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-fprnd -mfprnd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-FPRND %s
// CHECK-FPRND: "-target-feature" "+fprnd"
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOVSX %s
+// CHECK-NOVSX: "-target-feature" "-vsx"
+
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -mvsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-VSX %s
+// CHECK-VSX: "-target-feature" "+vsx"
+
diff --git a/test/Driver/pth.c b/test/Driver/pth.c
index 4350f46e86f6..e56c34c93bb0 100644
--- a/test/Driver/pth.c
+++ b/test/Driver/pth.c
@@ -3,10 +3,10 @@
// RUN: %clang -no-canonical-prefixes -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{{.*}}" "-cc1" {{.*}} "-o" "{{.*}}.h.pth" "-x" "c-header" "{{.*}}pth.c"
+// CHECK1: "{{.*[/\\]}}clang{{.*}}" "-cc1" {{.*}} "-o" "{{.*}}.h.pth" "-x" "c-header" "{{.*}}pth.c"
// RUN: touch %t.h.pth
// RUN: %clang -no-canonical-prefixes -ccc-pch-is-pth -E -include %t.h %s -### 2> %t.log
// RUN: FileCheck -check-prefix CHECK2 -input-file %t.log %s
-// CHECK2: "{{.*}}/clang{{.*}}" "-cc1" {{.*}}"-include-pth" "{{.*}}.h.pth" {{.*}}"-x" "c" "{{.*}}pth.c"
+// CHECK2: "{{.*[/\\]}}clang{{.*}}" "-cc1" {{.*}}"-include-pth" "{{.*}}.h.pth" {{.*}}"-x" "c" "{{.*}}pth.c"
diff --git a/test/Driver/qa_override.c b/test/Driver/qa_override.c
index f89815739b12..e5d9c95944aa 100644
--- a/test/Driver/qa_override.c
+++ b/test/Driver/qa_override.c
@@ -1,16 +1,12 @@
-// RUN: env QA_OVERRIDE_GCC3_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-ccc-print-options " %clang x -O2 b -O3 2>&1 | FileCheck %s
-// RUN: env QA_OVERRIDE_GCC3_OPTIONS="x-Werror +-mfoo" %clang -Werror %s -c 2>&1 | FileCheck %s -check-prefix=RM-WERROR
+// RUN: env QA_OVERRIDE_GCC3_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-### " %clang -target x86_64-apple-darwin %s -O2 b -O3 2>&1 | FileCheck %s
+// RUN: env QA_OVERRIDE_GCC3_OPTIONS="x-Werror +-msse" %clang -target x86_64-apple-darwin -Werror %s -c -### 2>&1 | FileCheck %s -check-prefix=RM-WERROR
-// FIXME: It seems doesn't work with gcc-driver.
-// REQUIRES: clang-driver
+// CHECK: "-cc1"
+// CHECK-NOT: "-Oignore"
+// CHECK: "-Omagic"
+// CHECK-NOT: "-Oignore"
-// CHECK-NOT: ###
-// CHECK: Option 0 - Name: "-ccc-print-options", Values: {}
-// CHECK-NEXT: Option 1 - Name: "<input>", Values: {"x"}
-// CHECK-NEXT: Option 2 - Name: "-O", Values: {"ignore"}
-// CHECK-NEXT: Option 3 - Name: "-O", Values: {"magic"}
-
-// RM-WERROR: ### QA_OVERRIDE_GCC3_OPTIONS: x-Werror +-mfoo
+// RM-WERROR: ### QA_OVERRIDE_GCC3_OPTIONS: x-Werror +-msse
// RM-WERROR-NEXT: ### Deleting argument -Werror
-// RM-WERROR-NEXT: ### Adding argument -mfoo at end
-// RM-WERROR-NEXT: warning: argument unused during compilation: '-mfoo'
+// RM-WERROR-NEXT: ### Adding argument -msse at end
+// RM-WERROR-NOT: "-Werror"
diff --git a/test/Driver/r600-mcpu.cl b/test/Driver/r600-mcpu.cl
index 1c5e76225b5e..7238ff4fbd20 100644
--- a/test/Driver/r600-mcpu.cl
+++ b/test/Driver/r600-mcpu.cl
@@ -30,6 +30,10 @@
// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=pitcairn %s -o - 2>&1 | FileCheck --check-prefix=PITCAIRN-CHECK %s
// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=verde %s -o - 2>&1 | FileCheck --check-prefix=VERDE-CHECK %s
// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=oland %s -o - 2>&1 | FileCheck --check-prefix=OLAND-CHECK %s
+// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=bonaire %s -o - 2>&1 | FileCheck --check-prefix=BONAIRE-CHECK %s
+// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=kabini %s -o - 2>&1 | FileCheck --check-prefix=KABINI-CHECK %s
+// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=kaveri %s -o - 2>&1 | FileCheck --check-prefix=KAVERI-CHECK %s
+// RUN: %clang -### -target r600 -x cl -S -emit-llvm -mcpu=hawaii %s -o - 2>&1 | FileCheck --check-prefix=HAWAII-CHECK %s
// R600-CHECK: "-target-cpu" "r600"
// RS880-CHECK: "-target-cpu" "rs880"
@@ -50,3 +54,7 @@
// PITCAIRN-CHECK: "-target-cpu" "pitcairn"
// VERDE-CHECK: "-target-cpu" "verde"
// OLAND-CHECK: "-target-cpu" "oland"
+// BONAIRE-CHECK: "-target-cpu" "bonaire"
+// KABINI-CHECK: "-target-cpu" "kabini"
+// KAVERI-CHECK: "-target-cpu" "kaveri"
+// HAWAII-CHECK: "-target-cpu" "hawaii"
diff --git a/test/Driver/rewrite-legacy-objc.m b/test/Driver/rewrite-legacy-objc.m
index 2e3f4218ef2d..0c6404e323de 100644
--- a/test/Driver/rewrite-legacy-objc.m
+++ b/test/Driver/rewrite-legacy-objc.m
@@ -3,5 +3,11 @@
// TEST0: clang{{.*}}" "-cc1"
// TEST0: "-rewrite-objc"
// FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
-// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fobjc-default-synthesize-properties" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
+// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
// TEST0: rewrite-legacy-objc.m"
+// RUN: %clang -no-canonical-prefixes -target i386-apple-macosx10.9.0 -rewrite-legacy-objc %s -o - -### 2>&1 | \
+// RUN: FileCheck -check-prefix=TEST1 %s
+// RUN: %clang -no-canonical-prefixes -target i386-apple-macosx10.6.0 -rewrite-legacy-objc %s -o - -### 2>&1 | \
+// RUN: FileCheck -check-prefix=TEST2 %s
+// TEST1: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fdiagnostics-show-option"
+// TEST2: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fdiagnostics-show-option"
diff --git a/test/Driver/rewrite-objc.m b/test/Driver/rewrite-objc.m
index fa159a625824..95db58294d2a 100644
--- a/test/Driver/rewrite-objc.m
+++ b/test/Driver/rewrite-objc.m
@@ -3,4 +3,4 @@
// TEST0: clang{{.*}}" "-cc1"
// TEST0: "-rewrite-objc"
// FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
-// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx" "-fobjc-dispatch-method=mixed" "-fobjc-default-synthesize-properties" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
+// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
diff --git a/test/Driver/sanitizer-ld.c b/test/Driver/sanitizer-ld.c
index fd7e97fc20f8..691b44bba262 100644
--- a/test/Driver/sanitizer-ld.c
+++ b/test/Driver/sanitizer-ld.c
@@ -152,4 +152,37 @@
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX-SHARED %s
// CHECK-UBSAN-LINUX-SHARED: "{{.*}}ld{{(.exe)?}}"
-// CHECK-UBSAN-LINUX-SHARED-NOT: libclang_rt.ubsan-i386.a"
+// CHECK-UBSAN-LINUX-SHARED: libclang_rt.ubsan-i386.a"
+
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-unknown-linux -fsanitize=leak \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LSAN-LINUX %s
+//
+// CHECK-LSAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
+// CHECK-LSAN-LINUX-NOT: "-lc"
+// CHECK-LSAN-LINUX: libclang_rt.lsan-x86_64.a"
+// CHECK-LSAN-LINUX: "-lpthread"
+// CHECK-LSAN-LINUX: "-ldl"
+
+// RUN: %clang -fsanitize=leak,undefined %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LSAN-UBSAN-LINUX %s
+// CHECK-LSAN-UBSAN-LINUX: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LSAN-UBSAN-LINUX-NOT: libclang_rt.san
+// CHECK-LSAN-UBSAN-LINUX: "-whole-archive" "{{.*}}libclang_rt.lsan-x86_64.a" "-no-whole-archive"
+// CHECK-LSAN-UBSAN-LINUX-NOT: libclang_rt.san
+// CHECK-LSAN-UBSAN-LINUX: "-whole-archive" "{{.*}}libclang_rt.ubsan-x86_64.a" "-no-whole-archive"
+// CHECK-LSAN-UBSAN-LINUX-NOT: libclang_rt.ubsan_cxx
+// CHECK-LSAN-UBSAN-LINUX: "-lpthread"
+// CHECK-LSAN-UBSAN-LINUX-NOT: "-lstdc++"
+
+// RUN: %clang -fsanitize=leak,address %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LSAN-ASAN-LINUX %s
+// CHECK-LSAN-ASAN-LINUX: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan
+// CHECK-LSAN-ASAN-LINUX: libclang_rt.asan-x86_64
+// CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan
diff --git a/test/Driver/split-debug.c b/test/Driver/split-debug.c
index d8a9fe841e27..792abbd55259 100644
--- a/test/Driver/split-debug.c
+++ b/test/Driver/split-debug.c
@@ -23,3 +23,13 @@
// RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
//
// CHECK-OPTION: "-split-dwarf-file" "split-debug.dwo"
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -S -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-ASM < %t %s
+//
+// CHECK-ASM-NOT: objcopy
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -no-integrated-as -gsplit-dwarf -c -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-IAS < %t %s
+//
+// CHECK-IAS: objcopy
diff --git a/test/Driver/stack-protector.c b/test/Driver/stack-protector.c
index 5f3d679c1ade..2eb0f53530a7 100644
--- a/test/Driver/stack-protector.c
+++ b/test/Driver/stack-protector.c
@@ -9,3 +9,9 @@
// RUN: %clang -fstack-protector --param ssp-buffer-size=16 -### %s 2>&1 | FileCheck %s -check-prefix=SSP-BUF
// SSP-BUF: "-stack-protector" "1"
// SSP-BUF: "-stack-protector-buffer-size" "16"
+
+// RUN: %clang -target i386-pc-openbsd -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD
+// OPENBSD: "-stack-protector" "1"
+
+// RUN: %clang -target i386-pc-openbsd -fno-stack-protector -### %s 2>&1 | FileCheck %s -check-prefix=OPENBSD_OFF
+// OPENBSD_OFF-NOT: "-stack-protector"
diff --git a/test/Driver/std.cpp b/test/Driver/std.cpp
index 822658c837dc..e98fd2c6bf18 100644
--- a/test/Driver/std.cpp
+++ b/test/Driver/std.cpp
@@ -1,12 +1,12 @@
-// RUN: %clang -std=c++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
-// RUN: %clang -std=gnu++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX98 %s
-// RUN: %clang -std=c++03 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
-// RUN: %clang -std=c++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
-// RUN: %clang -std=gnu++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
-// RUN: %clang -std=c++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
-// RUN: %clang -std=gnu++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
-// RUN: %clang -std=c++1y %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX1Y %s
-// RUN: %clang -std=gnu++1y %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX1Y %s
+// RUN: not %clang -std=c++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
+// RUN: not %clang -std=gnu++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX98 %s
+// RUN: not %clang -std=c++03 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
+// RUN: not %clang -std=c++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
+// RUN: not %clang -std=gnu++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
+// RUN: not %clang -std=c++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
+// RUN: not %clang -std=gnu++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
+// RUN: not %clang -std=c++1y %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX1Y %s
+// RUN: not %clang -std=gnu++1y %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX1Y %s
void f(int n) {
typeof(n)();
diff --git a/test/Driver/systemz-march.c b/test/Driver/systemz-march.c
new file mode 100644
index 000000000000..ffc126f14fe1
--- /dev/null
+++ b/test/Driver/systemz-march.c
@@ -0,0 +1,13 @@
+// Check that -march works for all supported targets.
+
+// RUN: not %clang -target s390x -S -emit-llvm -march=z9 %s -o - 2>&1 | FileCheck --check-prefix=CHECK-Z9 %s
+// RUN: %clang -target s390x -### -S -emit-llvm -march=z10 %s 2>&1 | FileCheck --check-prefix=CHECK-Z10 %s
+// RUN: %clang -target s390x -### -S -emit-llvm -march=z196 %s 2>&1 | FileCheck --check-prefix=CHECK-Z196 %s
+// RUN: %clang -target s390x -### -S -emit-llvm -march=zEC12 %s 2>&1 | FileCheck --check-prefix=CHECK-ZEC12 %s
+
+// CHECK-Z9: error: unknown target CPU 'z9'
+// CHECK-Z10: "-target-cpu" "z10"
+// CHECK-Z196: "-target-cpu" "z196"
+// CHECK-ZEC12: "-target-cpu" "zEC12"
+
+int x;
diff --git a/test/Driver/target-as.s b/test/Driver/target-as.s
index adb3d10f14ea..4881a330b56a 100644
--- a/test/Driver/target-as.s
+++ b/test/Driver/target-as.s
@@ -1,5 +1,3 @@
-// REQUIRES: clang-driver
-
// Make sure the -march is passed down to cc1as.
// RUN: %clang -target i386-unknown-freebsd -### -c -integrated-as %s \
// RUN: -march=geode 2>&1 | FileCheck -check-prefix=TARGET %s
diff --git a/test/Driver/target.c b/test/Driver/target.c
index 59147e0fbffd..b400f990fb1b 100644
--- a/test/Driver/target.c
+++ b/test/Driver/target.c
@@ -1,4 +1,4 @@
-// RUN: %clang -no-canonical-prefixes -target unknown-unknown-unknown -c %s \
+// RUN: %clang -no-canonical-prefixes --target=unknown-unknown-unknown -c %s \
// RUN: -o %t.o -### 2>&1 | FileCheck %s
//
// Ensure we get a crazy triple here as we asked for one.
@@ -9,3 +9,7 @@
// CHECK-NOT: "-target"
// CHECK-NOT: "unknown-unknown-unknown"
// CHECK: "-x" "assembler"
+//
+// Also check that the legacy spelling works.
+// RUN: %clang -no-canonical-prefixes -target unknown-unknown-unknown -c %s \
+// RUN: -o %t.o -### 2>&1 | FileCheck %s
diff --git a/test/Driver/tsan.c b/test/Driver/tsan.c
index 18b027fbceec..82a0785c07ac 100644
--- a/test/Driver/tsan.c
+++ b/test/Driver/tsan.c
@@ -1,8 +1,8 @@
-// RUN: %clang -target i386-unknown-unknown -fsanitize=thread %s -S -emit-llvm -o - | FileCheck %s
-// RUN: %clang -O1 -target i386-unknown-unknown -fsanitize=thread %s -S -emit-llvm -o - | FileCheck %s
-// RUN: %clang -O2 -target i386-unknown-unknown -fsanitize=thread %s -S -emit-llvm -o - | FileCheck %s
-// RUN: %clang -O3 -target i386-unknown-unknown -fsanitize=thread %s -S -emit-llvm -o - | FileCheck %s
-// RUN: %clang -target i386-unknown-unknown -fsanitize=thread %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -target x86_64-unknown-linux -fsanitize=thread %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O1 -target x86_64-unknown-linux -fsanitize=thread %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O2 -target x86_64-unknown-linux -fsanitize=thread %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -O3 -target x86_64-unknown-linux -fsanitize=thread %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang -target x86_64-unknown-linux -fsanitize=thread %s -S -emit-llvm -o - | FileCheck %s
// Verify that -fsanitize=thread invokes tsan instrumentation.
int foo(int *a) { return *a; }
diff --git a/test/Driver/unknown-arg.c b/test/Driver/unknown-arg.c
index 0fab8a50b99e..f834a0e8db92 100644
--- a/test/Driver/unknown-arg.c
+++ b/test/Driver/unknown-arg.c
@@ -1,6 +1,15 @@
-// RUN: not %clang_cc1 %s -cake-is-lie -%0 -%d 2> %t.log
-// RUN: FileCheck %s -input-file=%t.log
+// RUN: not %clang %s -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option 2>&1 | \
+// RUN: FileCheck %s
-// CHECK: unknown argument
-// CHECK: unknown argument
-// CHECK: unknown argument
+// CHECK: unknown argument: '-cake-is-lie'
+// CHECK: unknown argument: '-%0'
+// CHECK: unknown argument: '-%d'
+// CHECK: unknown argument: '-HHHH'
+// CHECK: unknown argument: '-munknown-to-clang-option'
+// CHECK: unknown argument: '-print-stats'
+// CHECK: unknown argument: '-funknown-to-clang-option'
+
+
+// RUN: %clang -S %s -o %t.s -Wunknown-to-clang-option 2>&1 | FileCheck --check-prefix=IGNORED %s
+
+// IGNORED: warning: unknown warning option '-Wunknown-to-clang-option'
diff --git a/test/Driver/working-directory.c b/test/Driver/working-directory.c
index 38a87a6402af..195abaca6f0c 100644
--- a/test/Driver/working-directory.c
+++ b/test/Driver/working-directory.c
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-print-options -working-directory "C:\Test" input 2>&1 | FileCheck %s
-// CHECK: Option 0 - Name: "-ccc-print-options", Values: {}
-// CHECK: Option 1 - Name: "-working-directory", Values: {"C:\Test"}
-// CHECK: Option 2 - Name: "<input>", Values: {"input"}
+// RUN: %clang -### -working-directory /no/such/dir/ input 2>&1 | FileCheck %s
+// REQUIRES: shell-preserves-root
+
+//CHECK: no such file or directory: '/no/such/dir/input'
diff --git a/test/Driver/x86_64-nacl-defines.cpp b/test/Driver/x86_64-nacl-defines.cpp
index b7c894036cd4..87d02d7e10f7 100644
--- a/test/Driver/x86_64-nacl-defines.cpp
+++ b/test/Driver/x86_64-nacl-defines.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang -target x86_64-unknown-nacl -ccc-echo %s -emit-llvm-only -c -o %t.o 2>&1 | FileCheck %s -check-prefix=ECHO
+// RUN: %clang -target x86_64-unknown-nacl -### %s -emit-llvm-only -c -o %t.o 2>&1 | FileCheck %s -check-prefix=ECHO
// RUN: %clang -target x86_64-unknown-nacl %s -emit-llvm -S -c -o - | FileCheck %s
// RUN: %clang -target x86_64-unknown-nacl %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS
-// ECHO: {{.*}} -cc1 {{.*}}x86_64-nacl-defines.c
+// ECHO: {{.*}} "-cc1" {{.*}}x86_64-nacl-defines.c
// Check platform defines
diff --git a/test/Driver/x86_features.c b/test/Driver/x86_features.c
index 5c65e31ff45c..26f0bd8bcf01 100644
--- a/test/Driver/x86_features.c
+++ b/test/Driver/x86_features.c
@@ -1,3 +1,7 @@
-// RUN: %clang -target i386-unknown-unknown -### -S %s -msse -msse4 -mno-sse -mno-mmx -msse 2> %t
-// RUN: grep '"pentium4" "-target-feature" "+sse4" "-target-feature" "-mmx" "-target-feature" "+sse"' %t
+// RUN: %clang -target i386-unknown-unknown -### -S %s -msse -msse4 -mno-sse -mno-mmx -msse 2>&1 | FileCheck %s
+// CHECK: "pentium4" "-target-feature" "+sse4" "-target-feature" "-mmx" "-target-feature" "+sse"
// Note that we filter out all but the last -m(no)sse.
+
+// Test that we don't produce an error with -mieee-fp.
+// RUN: %clang -### %s -mieee-fp -S 2>&1 | FileCheck --check-prefix=IEEE %s
+// IEEE-NOT: error: unknown argument
diff --git a/test/Driver/xcore-opts.c b/test/Driver/xcore-opts.c
new file mode 100644
index 000000000000..10d8da172d4a
--- /dev/null
+++ b/test/Driver/xcore-opts.c
@@ -0,0 +1,13 @@
+// RUN: %clang -target xcore %s -g -Wl,L1Arg,L2Arg -Wa,A1Arg,A2Arg -### -o %t.o 2>&1 | FileCheck %s
+
+// CHECK: "-nostdsysteminc"
+// CHECK: "-momit-leaf-frame-pointer"
+// CHECK-NOT: "-mdisable-fp-elim"
+// CHECK: "-fno-signed-char"
+// CHECK: "-fno-use-cxa-atexit"
+// CHECK: "-fno-common"
+// CHECH: xcc" "-o"
+// CHECK: "-c" "-g" "A1Arg" "A2Arg"
+// CHECK: xcc" "-o"
+// CHECK: "L1Arg" "L2Arg"
+
diff --git a/test/FixIt/bridge-cast-in-arc.mm b/test/FixIt/bridge-cast-in-arc.mm
index 5cd482fabc04..d32629d7c700 100644
--- a/test/FixIt/bridge-cast-in-arc.mm
+++ b/test/FixIt/bridge-cast-in-arc.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c++ -fobjc-arc %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c++ -fobjc-arc %s 2>&1 | FileCheck %s
// rdar://12788838
id obj;
diff --git a/test/FixIt/fixit-autoreleasepool.m b/test/FixIt/fixit-autoreleasepool.m
index ba1ad130f22a..06c45448fd21 100644
--- a/test/FixIt/fixit-autoreleasepool.m
+++ b/test/FixIt/fixit-autoreleasepool.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c %s 2>&1 | FileCheck %s
// rdar://10723084
void f0() {
diff --git a/test/FixIt/fixit-cxx0x.cpp b/test/FixIt/fixit-cxx0x.cpp
index 1f6275f933bc..bfd8c3dcfea6 100644
--- a/test/FixIt/fixit-cxx0x.cpp
+++ b/test/FixIt/fixit-cxx0x.cpp
@@ -132,3 +132,8 @@ namespace NonStaticConstexpr {
}
};
}
+
+int RegisterVariable() {
+ register int n; // expected-warning {{'register' storage class specifier is deprecated}}
+ return n;
+}
diff --git a/test/FixIt/fixit-cxx11-attributes.cpp b/test/FixIt/fixit-cxx11-attributes.cpp
index f28bdfc7cd90..30697a900026 100644
--- a/test/FixIt/fixit-cxx11-attributes.cpp
+++ b/test/FixIt/fixit-cxx11-attributes.cpp
@@ -2,7 +2,7 @@
// RUN: cp %s %t
// RUN: not %clang_cc1 -x c++ -std=c++11 -fixit %t
// RUN: %clang_cc1 -Wall -pedantic -x c++ -std=c++11 %t
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
namespace ClassSpecifier {
class [[]] [[]]
diff --git a/test/FixIt/fixit-errors-1.c b/test/FixIt/fixit-errors-1.c
index b034b1973471..0dbbe198e061 100644
--- a/test/FixIt/fixit-errors-1.c
+++ b/test/FixIt/fixit-errors-1.c
@@ -1,6 +1,6 @@
// RUN: cp %s %t
// RUN: %clang_cc1 -pedantic -fixit %t
-// RUN: echo %clang_cc1 -pedantic -Werror -x c %t
+// RUN: %clang_cc1 -pedantic -Werror -x c %t
/* 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-include.c b/test/FixIt/fixit-include.c
index 383c51386ab7..fd5d7a9ac142 100644
--- a/test/FixIt/fixit-include.c
+++ b/test/FixIt/fixit-include.c
@@ -3,7 +3,7 @@
// RUN: cp %S/fixit-include.h %T
// RUN: not %clang_cc1 -fsyntax-only -fixit %t
// RUN: %clang_cc1 -Wall -pedantic %t
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
#include <fixit-include.h> // expected-error {{'fixit-include.h' file not found with <angled> include; use "quotes" instead}}
// CHECK: fix-it:{{.*}}:{8:10-8:27}
diff --git a/test/FixIt/fixit-interface-as-param.m b/test/FixIt/fixit-interface-as-param.m
index 3295c82c31a1..75da5720d7f0 100644
--- a/test/FixIt/fixit-interface-as-param.m
+++ b/test/FixIt/fixit-interface-as-param.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c %s 2>&1 | FileCheck %s
// rdar://11311333
@interface NSView @end
diff --git a/test/FixIt/fixit-objc-message-comma-separator.m b/test/FixIt/fixit-objc-message-comma-separator.m
index 0caa33eb0ad2..748553e73060 100644
--- a/test/FixIt/fixit-objc-message-comma-separator.m
+++ b/test/FixIt/fixit-objc-message-comma-separator.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c %s 2>&1 | FileCheck %s
// rdar://11376372
@class NSObject;
diff --git a/test/FixIt/fixit-objc.m b/test/FixIt/fixit-objc.m
index ea57fe671b94..7c4776ae71e7 100644
--- a/test/FixIt/fixit-objc.m
+++ b/test/FixIt/fixit-objc.m
@@ -27,13 +27,13 @@ void g(NSString *a); // expected-note{{passing argument to parameter 'a' here}}
void h(id a); // expected-note 2{{passing argument to parameter 'a' here}}
void f(Test *t) {
- NSString *a = "Foo"; // expected-warning {{incompatible pointer types initializing 'NSString *' with an expression of type 'char [4]'}}
+ NSString *a = "Foo"; // expected-warning {{string literal must be prefixed by '@'}}
id b = "Foo"; // expected-warning {{incompatible pointer types initializing 'id' with an expression of type 'char [4]'}}
- g("Foo"); // expected-warning{{incompatible pointer types passing 'char [4]' to parameter of type 'NSString *'}}
+ g("Foo"); // expected-warning {{string literal must be prefixed by '@'}}
h("Foo"); // expected-warning{{incompatible pointer types passing 'char [4]' to parameter of type 'id'}}
h(("Foo")); // expected-warning{{incompatible pointer types passing 'char [4]' to parameter of type 'id'}}
- [t test:"Foo"]; // expected-warning{{incompatible pointer types sending 'char [4]' to parameter of type 'NSString *'}}
- t.property = "Foo"; // expected-warning{{incompatible pointer types assigning to 'NSString *' from 'char [4]'}}
+ [t test:"Foo"]; // expected-warning {{string literal must be prefixed by '@'}}
+ t.property = "Foo"; // expected-warning {{string literal must be prefixed by '@'}}
// <rdar://problem/6896493>
[t test:@"Foo"]]; // expected-error{{extraneous ']' before ';'}}
diff --git a/test/FixIt/fixit-static-object-decl.m b/test/FixIt/fixit-static-object-decl.m
index e13900fa786f..5f4feada4905 100644
--- a/test/FixIt/fixit-static-object-decl.m
+++ b/test/FixIt/fixit-static-object-decl.m
@@ -5,8 +5,8 @@
// Objective-C++ recovery
// RUN: cp %s %t
-// RUN: not %clang_cc1 -fixit -x objective-c++ %t
-// RUN: %clang_cc1 -fsyntax-only -Werror -x objective-c++ %t
+// RUN: not %clang_cc1 -fixit -x objective-c++ %t -std=c++11
+// RUN: %clang_cc1 -fsyntax-only -Werror -x objective-c++ %t -std=c++11
// rdar://9603056
@interface S @end
@@ -24,6 +24,14 @@ NSArray func() {
return P;
}
+NSArray (func2)() { return 0; }
+
+#ifdef __cplusplus
+void test_result_type() {
+ auto l1 = [] () -> NSArray { return 0; };
+}
+#endif
+
int main() {
NSArray pluginNames = [NSArray arrayWithObjects];
}
diff --git a/test/FixIt/fixit-unicode-with-utf8-output.c b/test/FixIt/fixit-unicode-with-utf8-output.c
new file mode 100644
index 000000000000..aff854274324
--- /dev/null
+++ b/test/FixIt/fixit-unicode-with-utf8-output.c
@@ -0,0 +1,24 @@
+// This test is an additional set of checks for the fixit-unicode.c test for
+// systems capable of outputting Unicode characters to the standard output in
+// the UTF-8 encoding.
+// RUN: not %clang_cc1 -fsyntax-only %S/fixit-unicode.c 2>&1 | FileCheck -strict-whitespace %s
+
+// CHECK: warning: format specifies type 'int' but the argument has type 'long'
+// CHECK: {{^ printf\("∆: %d", 1L\);}}
+// CHECK: {{^ ~~ \^~}}
+
+// CHECK: error: use of undeclared identifier 'à¸sss'; did you mean 'à¸ssss'?
+// CHECK: {{^ \^}}
+// CHECK: {{^ à¸ssss}}
+
+// CHECK: error: use of undeclared identifier 'ssà¸s'; did you mean 'ssà¸ss'?
+// CHECK: {{^ \^}}
+// CHECK: {{^ ssà¸ss}}
+
+// CHECK: error: use of undeclared identifier 'ss一二三'; did you mean 's一二三'?
+// CHECK: {{^ \^~~~~~~~}}
+// CHECK: {{^ s一二三}}
+
+// CHECK: error: use of undeclared identifier 'sssssssss'; did you mean 'sssssssssà¸'?
+// CHECK: {{^ \^}}
+// CHECK: {{^ sssssssssà¸}}
diff --git a/test/FixIt/fixit-unicode.c b/test/FixIt/fixit-unicode.c
index 9c0242e92e3b..360ac6957495 100644
--- a/test/FixIt/fixit-unicode.c
+++ b/test/FixIt/fixit-unicode.c
@@ -1,5 +1,9 @@
-// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck -check-prefix=CHECK-MACHINE %s
+// This file contains code and checks, that should work on any platform.
+// There's a set of additional checks for systems with proper support of UTF-8
+// on the standard output in fixit-unicode-with-utf8-output.c.
+
+// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck -check-prefix=CHECK-MACHINE %s
struct Foo {
int bar;
@@ -16,8 +20,8 @@ void test1() {
// CHECK: {{^ \^}}
// CHECK: {{^ ;}}
-// CHECK-MACHINE: fix-it:"{{.*}}fixit-unicode.c":{[[@LINE-8]]:15-[[@LINE-8]]:18}:""
-// CHECK-MACHINE: fix-it:"{{.*}}fixit-unicode.c":{[[@LINE-9]]:15-[[@LINE-9]]:15}:";"
+// CHECK-MACHINE: fix-it:"{{.*}}":{[[@LINE-8]]:15-[[@LINE-8]]:18}:""
+// CHECK-MACHINE: fix-it:"{{.*}}":{[[@LINE-9]]:15-[[@LINE-9]]:15}:";"
}
@@ -32,5 +36,30 @@ void test2() {
// because different systems will render the delta differently (either as a
// character, or as <U+2206>.) The fixit should line up with the %d regardless.
-// CHECK-MACHINE: fix-it:"{{.*}}fixit-unicode.c":{[[@LINE-9]]:16-[[@LINE-9]]:18}:"%ld"
+// CHECK-MACHINE: fix-it:"{{.*}}":{[[@LINE-9]]:16-[[@LINE-9]]:18}:"%ld"
+}
+
+void test3() {
+ int à¸ssss = 42;
+ int a = à¸sss; // expected-error{{use of undeclared identifier 'à¸sss'; did you mean 'à¸ssss'?}}
+// CHECK: {{^ \^}}
+// CHECK: {{^ [^ ]+ssss}}
+// CHECK-MACHINE: fix-it:"{{.*}}":{[[@LINE-3]]:11-[[@LINE-3]]:17}:"\340\270\201ssss"
+
+ int ssà¸ss = 42;
+ int b = ssà¸s; // expected-error{{use of undeclared identifier 'ssà¸s'; did you mean 'ssà¸ss'?}}
+// CHECK: {{^ \^}}
+// CHECK: {{^ ss.+ss}}
+// CHECK-MACHINE: fix-it:"{{.*}}":{[[@LINE-3]]:11-[[@LINE-3]]:17}:"ss\340\270\201ss"
+
+ int s一二三 = 42;
+ int b一二三四五六七 = ss一二三; // expected-error{{use of undeclared identifier 'ss一二三'; did you mean 's一二三'?}}
+// CHECK-MACHINE: fix-it:"{{.*}}":{[[@LINE-1]]:32-[[@LINE-1]]:43}:"s\344\270\200\344\272\214\344\270\211"
+
+
+ int sssssssssภ= 42;
+ int c = sssssssss; // expected-error{{use of undeclared identifier 'sssssssss'; did you mean 'sssssssssà¸'?}}
+// CHECK: {{^ \^}}
+// CHECK: {{^ sssssssss.+}}
+// CHECK-MACHINE: fix-it:"{{.*}}":{[[@LINE-3]]:11-[[@LINE-3]]:20}:"sssssssss\340\270\201"
}
diff --git a/test/FixIt/fixit-uninit.c b/test/FixIt/fixit-uninit.c
new file mode 100644
index 000000000000..853041e05b07
--- /dev/null
+++ b/test/FixIt/fixit-uninit.c
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+
+_Bool test_bool_no_false() {
+ _Bool var; // expected-note {{initialize}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:12-[[@LINE-1]]:12}:" = 0"
+ return var; // expected-warning {{uninitialized}}
+}
+
+#define bool _Bool
+#define false (bool)0
+#define true (bool)1
+bool test_bool_with_false() {
+ bool var; // expected-note {{initialize}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:11}:" = false"
+ return var; // expected-warning {{uninitialized}}
+}
+
+bool test_bool_with_false_undefined() {
+ bool
+#undef false
+ var; // expected-note {{initialize}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:10-[[@LINE-1]]:10}:" = 0"
+ return var; // expected-warning {{uninitialized}}
+}
diff --git a/test/FixIt/fixit-vexing-parse.cpp b/test/FixIt/fixit-vexing-parse.cpp
index dd0f87304a53..79d8cad6bb9f 100644
--- a/test/FixIt/fixit-vexing-parse.cpp
+++ b/test/FixIt/fixit-vexing-parse.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -verify -x c++ %s
-// RUN: %clang_cc1 -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s
struct S {
int n;
diff --git a/test/FixIt/fixit.c b/test/FixIt/fixit.c
index 00adb19e50ce..6443fe53c2a1 100644
--- a/test/FixIt/fixit.c
+++ b/test/FixIt/fixit.c
@@ -115,3 +115,5 @@ struct noSemiAfterStruct {
enum noSemiAfterEnum {
e1
} // expected-error {{expected ';' after enum}}
+
+int PR17175 __attribute__((visibility(hidden))); // expected-error {{'visibility' attribute requires a string}}
diff --git a/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp
index fca596b715de..52bbb3849a8f 100644
--- a/test/FixIt/fixit.cpp
+++ b/test/FixIt/fixit.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ %s
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s
// RUN: cp %s %t
// RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ %t
// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ %t
@@ -307,3 +307,34 @@ namespace dtor_fixit {
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:6-[[@LINE-1]]:9}:"foo"
};
}
+
+namespace PR5066 {
+ template<typename T> struct X {};
+ X<int *p> x; // expected-error {{type-id cannot have a name}}
+}
+
+namespace PR5898 {
+ class A {
+ public:
+ const char *str();
+ };
+ const char* foo(A &x)
+ {
+ return x.str.(); // expected-error {{unexpected '.' in function call; perhaps remove the '.'?}}
+ }
+ bool bar(A x, const char *y) {
+ return foo->(x) == y; // expected-error {{unexpected '->' in function call; perhaps remove the '->'?}}
+ }
+}
+
+namespace PR15045 {
+ class Cl0 {
+ public:
+ int a;
+ };
+
+ int f() {
+ Cl0 c;
+ return c->a; // expected-error {{member reference type 'PR15045::Cl0' is not a pointer; maybe you meant to use '.'?}}
+ }
+}
diff --git a/test/FixIt/format.m b/test/FixIt/format.m
index 919212b30678..5e4636047e86 100644
--- a/test/FixIt/format.m
+++ b/test/FixIt/format.m
@@ -186,26 +186,26 @@ void test_percent_C() {
const unsigned short data = 'a';
NSLog(@"%C", data); // no-warning
- NSLog(@"%C", 0x2603); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
+ NSLog(@"%C", 0x260300); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d"
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unsigned short)"
typedef unsigned short unichar;
- NSLog(@"%C", 0x2603); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
+ NSLog(@"%C", 0x260300); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d"
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unichar)"
- NSLog(@"%C", data ? 0x2F : 0x2603); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
+ NSLog(@"%C", data ? 0x2F0000 : 0x260300); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d"
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unichar)("
- // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:36-[[@LINE-3]]:36}:")"
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:42-[[@LINE-3]]:42}:")"
NSLog(@"%C", 0.0); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'double'}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%f"
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unichar)"
- NSLog(@"%C", (char)0x2603); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'char'}}
+ NSLog(@"%C", (char)0x260300); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'char'}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%c"
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:22}:"(unichar)"
diff --git a/test/FixIt/format.mm b/test/FixIt/format.mm
index 64c6c47b9b63..9d89c062faa9 100644
--- a/test/FixIt/format.mm
+++ b/test/FixIt/format.mm
@@ -11,7 +11,7 @@ void test_percent_C() {
NSLog(@"%C", wchar_data); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'wchar_t'}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:16-[[@LINE-1]]:16}:"(unsigned short)"
- NSLog(@"%C", 0x2603); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
+ NSLog(@"%C", 0x260300); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d"
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unsigned short)"
@@ -20,7 +20,7 @@ void test_percent_C() {
NSLog(@"%C", wchar_data); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'wchar_t'}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:16-[[@LINE-1]]:16}:"(unichar)"
- NSLog(@"%C", 0x2603); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
+ NSLog(@"%C", 0x260300); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d"
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unichar)"
diff --git a/test/FixIt/lit.local.cfg b/test/FixIt/lit.local.cfg
new file mode 100644
index 000000000000..5bbc711c656d
--- /dev/null
+++ b/test/FixIt/lit.local.cfg
@@ -0,0 +1,2 @@
+if config.root.clang_rewriter == 0:
+ config.unsupported = True
diff --git a/test/FixIt/messages.cpp b/test/FixIt/messages.cpp
index b9391449ad16..eb4c09d629ed 100644
--- a/test/FixIt/messages.cpp
+++ b/test/FixIt/messages.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 2>&1 %s | FileCheck -strict-whitespace %s
+// RUN: not %clang_cc1 -fsyntax-only -std=c++11 2>&1 %s | FileCheck -strict-whitespace %s
struct A {
unsigned int a;
diff --git a/test/FixIt/no-fixit.cpp b/test/FixIt/no-fixit.cpp
index 9da29229f041..7e8e1fbbb07b 100644
--- a/test/FixIt/no-fixit.cpp
+++ b/test/FixIt/no-fixit.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fdiagnostics-parseable-fixits -x c++ -std=c++11 %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fdiagnostics-parseable-fixits -x c++ -std=c++11 %s 2>&1 | FileCheck %s
// test that the diagnostics produced by this code do not include fixit hints
diff --git a/test/FixIt/selector-fixit.m b/test/FixIt/selector-fixit.m
new file mode 100644
index 000000000000..e9d2f19df1a1
--- /dev/null
+++ b/test/FixIt/selector-fixit.m
@@ -0,0 +1,41 @@
+// RUN: cp %s %t
+// RUN: %clang_cc1 -x objective-c -Wundeclared-selector -fixit %t
+// RUN: %clang_cc1 -x objective-c -Wundeclared-selector -Werror %t
+// rdar://14039037
+
+@interface NSObject @end
+
+@interface LogoutController : NSObject
+- (void)close;
+- (void)closed;
+- (void) open : (id) file_id;
+@end
+
+@implementation LogoutController
+
+- (void)close { }
+- (void)closed { }
+
+- (SEL)Meth
+{
+ return @selector(cloze);
+}
+- (void) open : (id) file_id {}
+
+- (SEL)Meth1
+{
+ return @selector(ope:);
+}
+
+@end
+
+// rdar://7853549
+@interface rdar7853549 : NSObject
+- (int) bounds;
+@end
+
+@implementation rdar7853549
+- (int) bounds { return 0; }
+- (void)PrivateMeth { int bounds = [self bonds]; }
+- (void)OtherPrivateMeth : (id) p { int bounds = [p bonds]; }
+@end
diff --git a/test/FixIt/typo-crash.cpp b/test/FixIt/typo-crash.cpp
index c154e3baba4f..4ea63c542a89 100644
--- a/test/FixIt/typo-crash.cpp
+++ b/test/FixIt/typo-crash.cpp
@@ -19,11 +19,12 @@ namespace PR12297 {
namespace B {
typedef short T;
- T global(); // expected-note {{'A::B::global' declared here}}
+ T global(); // expected-note {{'::PR12297::global' declared here}}
}
}
using namespace A::B;
- T A::global(); // expected-error {{out-of-line definition of 'global' does not match any declaration in namespace 'PR12297::A'; did you mean 'A::B::global'?}}
+ // FIXME: Adding '::PR12297::' is not needed as removing 'A::' is sufficient
+ T A::global(); // expected-error {{out-of-line declaration of 'global' does not match any declaration in namespace 'PR12297::A'; did you mean '::PR12297::global'?}}
}
diff --git a/test/FixIt/typo-location-bugs.cpp b/test/FixIt/typo-location-bugs.cpp
new file mode 100644
index 000000000000..9c34a91d49c7
--- /dev/null
+++ b/test/FixIt/typo-location-bugs.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: cp %s %t
+// RUN: not %clang_cc1 -fsyntax-only -fixit -x c++ %t
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ %t
+
+namespace dcl_fct_default_p10 {
+struct A {
+ virtual void f(int a = 7); // expected-note{{'A::f' declared here}}
+};
+
+struct B : public A {
+ void f(int a);
+};
+
+void m() {
+ B* pb = new B;
+ A* pa = pb;
+ pa->f(); // OK, calls pa->B::f(7)
+ pb->f(); // expected-error{{too few arguments to function call, expected 1, have 0; did you mean 'A::f'?}}
+}
+}
diff --git a/test/FixIt/typo-using.cpp b/test/FixIt/typo-using.cpp
new file mode 100644
index 000000000000..e676b1074f9f
--- /dev/null
+++ b/test/FixIt/typo-using.cpp
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: cp %s %t
+// RUN: not %clang_cc1 -fsyntax-only -fixit -x c++ %t
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ %t
+// RUN: grep using_suggestion_tyname_ty_dropped_specifier %t
+
+// These tests have been separated from typo.cpp to keep the maximum typo
+// correction counter from ticking over; this causes spurious failures.
+
+namespace using_suggestion_ty {
+namespace N { class AAA {}; } // expected-note {{'AAA' declared here}}
+using N::AAB; // expected-error {{no member named 'AAB' in namespace 'using_suggestion_ty::N'; did you mean 'AAA'?}}
+}
+
+namespace using_suggestion_tyname_ty {
+namespace N { class AAA {}; } // expected-note {{'AAA' declared here}}
+using typename N::AAB; // expected-error {{no member named 'AAB' in namespace 'using_suggestion_tyname_ty::N'; did you mean 'AAA'?}}
+}
+
+namespace using_suggestion_val {
+namespace N { void FFF() {} } // expected-note {{'FFF' declared here}}
+using N::FFG; // expected-error {{no member named 'FFG' in namespace 'using_suggestion_val::N'; did you mean 'FFF'?}}
+}
+
+namespace using_suggestion_ty_dropped_specifier {
+class ABC {}; // expected-note {{'::using_suggestion_ty_dropped_specifier::ABC' declared here}}
+namespace N { }
+using N::ABC; // expected-error {{no member named 'ABC' in namespace 'using_suggestion_ty_dropped_specifier::N'; did you mean '::using_suggestion_ty_dropped_specifier::ABC'?}}
+}
+
+namespace using_suggestion_tyname_ty_dropped_specifier {
+class BCD {}; // expected-note {{'::using_suggestion_tyname_ty_dropped_specifier::BCD' declared here}}
+namespace N { }
+using typename N::BCD; // expected-error {{no member named 'BCD' in namespace 'using_suggestion_tyname_ty_dropped_specifier::N'; did you mean '::using_suggestion_tyname_ty_dropped_specifier::BCD'?}}
+}
+
+namespace using_suggestion_val_dropped_specifier {
+void EFG() {} // expected-note {{'::using_suggestion_val_dropped_specifier::EFG' declared here}}
+namespace N { }
+using N::EFG; // expected-error {{no member named 'EFG' in namespace 'using_suggestion_val_dropped_specifier::N'; did you mean '::using_suggestion_val_dropped_specifier::EFG'?}}
+}
+
+namespace using_suggestion_member_ty {
+class CCC { public: typedef int AAA; }; // expected-note {{'AAA' declared here}}
+class DDD : public CCC { public: using CCC::AAB; }; // expected-error {{no member named 'AAB' in 'using_suggestion_member_ty::CCC'; did you mean 'AAA'?}}
+}
+
+namespace using_suggestion_member_val {
+class CCC { public: void AAA() { } }; // expected-note {{'AAA' declared here}}
+class DDD : public CCC { public: using CCC::AAB; }; // expected-error {{no member named 'AAB' in 'using_suggestion_member_val::CCC'; did you mean 'AAA'?}}
+}
+
+namespace using_suggestion_member_tyname_ty {
+class CCC { public: typedef int AAA; }; // expected-note {{'AAA' declared here}}
+class DDD : public CCC { public: using typename CCC::AAB; }; // expected-error {{no member named 'AAB' in 'using_suggestion_member_tyname_ty::CCC'; did you mean 'AAA'?}}
+}
diff --git a/test/FixIt/typo.c b/test/FixIt/typo.c
index 8e380c94979a..4f4c67b538f2 100644
--- a/test/FixIt/typo.c
+++ b/test/FixIt/typo.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
// RUN: cp %s %t
// RUN: not %clang_cc1 -fsyntax-only -fixit -x c %t
// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c %t
diff --git a/test/FixIt/typo.cpp b/test/FixIt/typo.cpp
index b3568a5bbf73..2a743991be41 100644
--- a/test/FixIt/typo.cpp
+++ b/test/FixIt/typo.cpp
@@ -5,8 +5,7 @@
// RUN: grep test_string %t
namespace std {
- template<typename T> class basic_string { // expected-note 2{{'basic_string' declared here}} \
- // expected-note {{'otherstd::basic_string' declared here}}
+ template<typename T> class basic_string { // expected-note 3{{'basic_string' declared here}}
public:
int find(const char *substr); // expected-note{{'find' declared here}}
static const int npos = -1; // expected-note{{'npos' declared here}}
@@ -84,8 +83,12 @@ namespace nonstd {
yarn str4; // expected-error{{unknown type name 'yarn'; did you mean 'nonstd::yarn'?}}
wibble::yarn str5; // expected-error{{no type named 'yarn' in namespace 'otherstd'; did you mean 'nonstd::yarn'?}}
+namespace another {
+ template<typename T> class wide_string {}; // expected-note {{'another::wide_string' declared here}}
+}
int poit() {
- nonstd::basic_string<char> str; // expected-error{{no template named 'basic_string' in namespace 'nonstd'; did you mean 'otherstd::basic_string'?}}
+ nonstd::basic_string<char> str; // expected-error{{no template named 'basic_string' in namespace 'nonstd'; did you mean simply 'basic_string'?}}
+ nonstd::wide_string<char> str2; // expected-error{{no template named 'wide_string' in namespace 'nonstd'; did you mean 'another::wide_string'?}}
return wibble::narf; // expected-error{{no member named 'narf' in namespace 'otherstd'; did you mean 'nonstd::narf'?}}
}
@@ -124,3 +127,11 @@ void func2() {
// to replace base::i with derived::i as we would for other qualified name misspellings.
// d.base::i = 3;
}
+
+class A {
+ void bar(int);
+};
+void bar(int, int); // expected-note{{'::bar' declared here}}
+void A::bar(int x) {
+ bar(x, 5); // expected-error{{too many arguments to function call, expected 1, have 2; did you mean '::bar'?}}
+}
diff --git a/test/Format/cursor.cpp b/test/Format/cursor.cpp
new file mode 100644
index 000000000000..d9aab5acb635
--- /dev/null
+++ b/test/Format/cursor.cpp
@@ -0,0 +1,6 @@
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t2.cpp
+// RUN: clang-format -style=LLVM %t2.cpp -cursor=6 > %t.cpp
+// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s
+// CHECK: {{^\{ "Cursor": 4 \}$}}
+// CHECK: {{^int\ \i;$}}
+ int i;
diff --git a/test/Format/diagnostic.cpp b/test/Format/diagnostic.cpp
deleted file mode 100644
index 2e930ee5b790..000000000000
--- a/test/Format/diagnostic.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: clang-format 2>&1 >/dev/null %s |FileCheck %s
-
-}
-// CHECK: diagnostic.cpp:[[@LINE-1]]:1: error: unexpected '}'
diff --git a/test/Format/line-ranges.cpp b/test/Format/line-ranges.cpp
new file mode 100644
index 000000000000..370445aed1e1
--- /dev/null
+++ b/test/Format/line-ranges.cpp
@@ -0,0 +1,11 @@
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
+// RUN: clang-format -style=LLVM -lines=1:1 -lines=5:5 -i %t.cpp
+// RUN: FileCheck -strict-whitespace -input-file=%t.cpp %s
+// CHECK: {{^int\ \*i;$}}
+ int*i;
+
+// CHECK: {{^\ \ int\ \ \*\ \ i;$}}
+ int * i;
+
+// CHECK: {{^\ \ int\ \*i;$}}
+ int * i;
diff --git a/test/Format/multiple-inputs-error.cpp b/test/Format/multiple-inputs-error.cpp
index 71f87e0b15b2..1aa9c9f3e2fa 100644
--- a/test/Format/multiple-inputs-error.cpp
+++ b/test/Format/multiple-inputs-error.cpp
@@ -1,6 +1,8 @@
// RUN: cp %s %t-1.cpp
// RUN: cp %s %t-2.cpp
-// RUN: clang-format 2>&1 >/dev/null -offset=1 -length=0 %t-1.cpp %t-2.cpp |FileCheck %s
-// CHECK: error: "-offset" and "-length" can only be used for single file.
+// RUN: not clang-format 2>&1 >/dev/null -offset=1 -length=0 %t-1.cpp %t-2.cpp |FileCheck %s
+// RUN: not clang-format 2>&1 >/dev/null -lines=1:1 %t-1.cpp %t-2.cpp |FileCheck %s -check-prefix=CHECK-LINE
+// CHECK: error: -offset, -length and -lines can only be used for single file.
+// CHECK-LINE: error: -offset, -length and -lines can only be used for single file.
int i ;
diff --git a/test/Format/style-on-command-line.cpp b/test/Format/style-on-command-line.cpp
new file mode 100644
index 000000000000..22131a1ebe1b
--- /dev/null
+++ b/test/Format/style-on-command-line.cpp
@@ -0,0 +1,29 @@
+// RUN: grep -Ev "// *[A-Z0-9_]+:" %s > %t.cpp
+// RUN: clang-format -style="{BasedOnStyle: Google, IndentWidth: 8}" %t.cpp | FileCheck -strict-whitespace -check-prefix=CHECK1 %s
+// RUN: clang-format -style="{BasedOnStyle: LLVM, IndentWidth: 7}" %t.cpp | FileCheck -strict-whitespace -check-prefix=CHECK2 %s
+// RUN: clang-format -style="{BasedOnStyle: invalid, IndentWidth: 7}" %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK3 %s
+// RUN: clang-format -style="{lsjd}" %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK4 %s
+// RUN: [ ! -e %T/.clang-format ] || rm %T/.clang-format
+// RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %T/.clang-format
+// RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK5 %s
+// RUN: printf "\n" > %T/.clang-format
+// RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK6 %s
+// RUN: [ ! -e %T/.clang-format ] || rm %T/.clang-format
+// RUN: [ ! -e %T/_clang-format ] || rm %T/_clang-format
+// RUN: printf "BasedOnStyle: google\nIndentWidth: 6\n" > %T/_clang-format
+// RUN: clang-format -style=file %t.cpp 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK7 %s
+void f() {
+// CHECK1: {{^ int\* i;$}}
+// CHECK2: {{^ int \*i;$}}
+// CHECK3: Unknown value for BasedOnStyle: invalid
+// CHECK3: Error parsing -style: Invalid argument, using LLVM style
+// CHECK3: {{^ int \*i;$}}
+// CHECK4: Error parsing -style: Invalid argument, using LLVM style
+// CHECK4: {{^ int \*i;$}}
+// CHECK5: {{^ int\* i;$}}
+// CHECK6: {{^Error reading .*\.clang-format: Invalid argument}}
+// XCHECK6X: {{^ int \*i;$}}
+// CHECK7: {{^ int\* i;$}}
+int*i;
+int j;
+}
diff --git a/test/Frontend/Inputs/lit.local.cfg b/test/Frontend/Inputs/lit.local.cfg
deleted file mode 100644
index e6f55eef7af5..000000000000
--- a/test/Frontend/Inputs/lit.local.cfg
+++ /dev/null
@@ -1 +0,0 @@
-config.suffixes = []
diff --git a/test/Frontend/Inputs/rewrite-includes-bom.h b/test/Frontend/Inputs/rewrite-includes-bom.h
new file mode 100644
index 000000000000..7ba011fc2d77
--- /dev/null
+++ b/test/Frontend/Inputs/rewrite-includes-bom.h
@@ -0,0 +1 @@
+// This file starts with UTF-8 BOM marker.
diff --git a/test/Frontend/cc1-return-codes.c b/test/Frontend/cc1-return-codes.c
new file mode 100644
index 000000000000..da329b934265
--- /dev/null
+++ b/test/Frontend/cc1-return-codes.c
@@ -0,0 +1,4 @@
+// cc1 immediate arguments (arguments which displays information and exits)
+// shall exit indicating success (return code 0)
+// RUN: %clang -cc1 -help
+// RUN: %clang -cc1 -version
diff --git a/test/Frontend/darwin-eabi.c b/test/Frontend/darwin-eabi.c
new file mode 100644
index 000000000000..b4b82aa842ed
--- /dev/null
+++ b/test/Frontend/darwin-eabi.c
@@ -0,0 +1,7 @@
+// RUN: %clang -arch armv6m -dM -E %s | FileCheck %s
+// RUN: %clang -arch armv7m -dM -E %s | FileCheck %s
+// RUN: %clang -arch armv7em -dM -E %s | FileCheck %s
+// RUN: %clang -arch armv7 -target thumbv7-apple-darwin-eabi -dM -E %s | FileCheck %s
+
+// CHECK-NOT: __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
+// CHECK-NOT: __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
diff --git a/test/Frontend/darwin-version.c b/test/Frontend/darwin-version.c
index f9ce54b923d3..7234ab48e3b0 100644
--- a/test/Frontend/darwin-version.c
+++ b/test/Frontend/darwin-version.c
@@ -1,23 +1,23 @@
// RUN: %clang -target armv6-apple-darwin9 -dM -E -o %t %s
-// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
// RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=3.0 -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: not grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t
// RUN: %clang -target 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: not grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t
// RUN: %clang -target 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 -target i686-apple-darwin8 -dM -E -o %t %s
-// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1
// RUN: %clang -target i686-apple-darwin9 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
// RUN: %clang -target i686-apple-darwin10 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1
// RUN: %clang -target 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: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1
// RUN: %clang -target 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
diff --git a/test/Frontend/invalid-o-level.c b/test/Frontend/invalid-o-level.c
new file mode 100644
index 000000000000..b9e01fcf00c0
--- /dev/null
+++ b/test/Frontend/invalid-o-level.c
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 %s -O900 -o /dev/null 2> %t.log
+// RUN: FileCheck %s -input-file=%t.log
+
+// CHECK: warning: optimization level '-O900' is unsupported; using '-O3' instead
diff --git a/test/Frontend/ir-support-errors.ll b/test/Frontend/ir-support-errors.ll
index cb5913cd3af8..daf1675be51d 100644
--- a/test/Frontend/ir-support-errors.ll
+++ b/test/Frontend/ir-support-errors.ll
@@ -1,4 +1,4 @@
-; RUN: %clang_cc1 -S -o - %s 2>&1 | FileCheck %s
+; RUN: not %clang_cc1 -S -o - %s 2>&1 | FileCheck %s
target triple = "x86_64-apple-darwin10"
diff --git a/test/Frontend/mfpmath.c b/test/Frontend/mfpmath.c
new file mode 100644
index 000000000000..f650e485cb99
--- /dev/null
+++ b/test/Frontend/mfpmath.c
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -triple i686-pc-linux -target-feature -sse %s
+
+// RUN: %clang_cc1 -triple i686-pc-linux -target-feature -sse -mfpmath 387 %s
+
+// RUN: %clang_cc1 -triple i686-pc-linux -target-feature +sse %s
+
+// RUN: %clang_cc1 -triple i686-pc-linux -target-feature +sse -mfpmath sse %s
+
+// RUN: not %clang_cc1 -triple i686-pc-linux -target-feature +sse \
+// RUN: -mfpmath xyz %s 2>&1 | FileCheck --check-prefix=CHECK-XYZ %s
+// CHECK-XYZ: error: unknown FP unit 'xyz'
+
+// RUN: not %clang_cc1 -triple i686-pc-linux -target-feature +sse \
+// RUN: -mfpmath 387 %s 2>&1 | FileCheck --check-prefix=CHECK-NO-387 %s
+// CHECK-NO-387: error: the '387' unit is not supported with this instruction set
+
+// RUN: not %clang_cc1 -triple i686-pc-linux -target-feature -sse \
+// RUN: -mfpmath sse %s 2>&1 | FileCheck --check-prefix=CHECK-NO-SSE %s
+// CHECK-NO-SSE: error: the 'sse' unit is not supported with this instruction set
+
+
+// RUN: %clang_cc1 -triple arm-apple-darwin10 -mfpmath vfp %s
+
+// RUN: %clang_cc1 -triple arm-apple-darwin10 -mfpmath vfp2 %s
+
+// RUN: %clang_cc1 -triple arm-apple-darwin10 -mfpmath vfp3 %s
+
+// RUN: %clang_cc1 -triple arm-apple-darwin10 -mfpmath vfp4 %s
+
+// RUN: %clang_cc1 -triple arm-apple-darwin10 -target-cpu cortex-a9 \
+// RUN: -mfpmath neon %s
+
+// RUN: not %clang_cc1 -triple arm-apple-darwin10 -mfpmath foo %s 2>&1 \
+// RUN: FileCheck --check-prefix=CHECK-FOO %s
+// CHECK-FOO: unknown FP unit 'foo'
+
+// RUN: not %clang_cc1 -triple arm-apple-darwin10 -target-cpu arm1136j-s \
+// RUN: -mfpmath neon %s 2>&1 | FileCheck --check-prefix=CHECK-NO-NEON %s
+
+// RUN: not %clang_cc1 -triple arm-apple-darwin10 -target-cpu cortex-a9 \
+// RUN: -target-feature -neon -mfpmath neon %s 2>&1 | FileCheck --check-prefix=CHECK-NO-NEON %s
+
+// CHECK-NO-NEON: error: the 'neon' unit is not supported with this instruction set
diff --git a/test/Driver/mips-long-double.c b/test/Frontend/mips-long-double.c
index 09de38c6b707..09de38c6b707 100644
--- a/test/Driver/mips-long-double.c
+++ b/test/Frontend/mips-long-double.c
diff --git a/test/Frontend/print-header-includes.c b/test/Frontend/print-header-includes.c
index 7773d2069d98..aa3e3971fd1b 100644
--- a/test/Frontend/print-header-includes.c
+++ b/test/Frontend/print-header-includes.c
@@ -5,4 +5,11 @@
// CHECK: . {{.*test.h}}
// CHECK: .. {{.*test2.h}}
+// RUN: %clang_cc1 -include Inputs/test3.h -E --show-includes -o %t.out %s 2> %t.err
+// RUN: FileCheck --check-prefix=MS < %t.err %s
+// MS-NOT: test3.h
+// MS: Note: including file: {{.*test.h}}
+// MS: Note: including file: {{.*test2.h}}
+// MS-NOT: Note
+
#include "Inputs/test.h"
diff --git a/test/Frontend/rewrite-includes-bom.c b/test/Frontend/rewrite-includes-bom.c
new file mode 100644
index 000000000000..a1aa4c98f86e
--- /dev/null
+++ b/test/Frontend/rewrite-includes-bom.c
@@ -0,0 +1,4 @@
+// RUN: %clang -E -frewrite-includes -I %S/Inputs %s -o - | %clang -fsyntax-only -Xclang -verify -x c -
+// expected-no-diagnostics
+
+#include "rewrite-includes-bom.h"
diff --git a/test/Frontend/rewrite-includes-header-cmd-line.c b/test/Frontend/rewrite-includes-header-cmd-line.c
new file mode 100644
index 000000000000..dffaf28fe237
--- /dev/null
+++ b/test/Frontend/rewrite-includes-header-cmd-line.c
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -E -frewrite-includes -include rewrite-includes2.h -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s
+
+// STARTMAIN
+
+// CHECK-NOT: {{^}}#define
+// CHECK: included_line2
+// CHECK: {{^}}// STARTMAIN{{$}}
diff --git a/test/Frontend/rewrite-includes-invalid-hasinclude.c b/test/Frontend/rewrite-includes-invalid-hasinclude.c
index e32d6ad8a3ed..334519a4b02d 100644
--- a/test/Frontend/rewrite-includes-invalid-hasinclude.c
+++ b/test/Frontend/rewrite-includes-invalid-hasinclude.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -E -frewrite-includes -DFIRST -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s
+// RUN: not %clang_cc1 -E -frewrite-includes -DFIRST -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s
#if __has_include bar.h
#endif
diff --git a/test/Frontend/rewrite-includes-warnings.c b/test/Frontend/rewrite-includes-warnings.c
new file mode 100644
index 000000000000..1fb98db30147
--- /dev/null
+++ b/test/Frontend/rewrite-includes-warnings.c
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -verify -Wall -Wextra -E -frewrite-includes %s
+// expected-no-diagnostics
+
+#pragma GCC visibility push (default)
diff --git a/test/Frontend/rewrite-includes.c b/test/Frontend/rewrite-includes.c
index bf330a60a3d6..2158dd0e8ead 100644
--- a/test/Frontend/rewrite-includes.c
+++ b/test/Frontend/rewrite-includes.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -verify -E -frewrite-includes -DFIRST -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s
-// RUN: %clang_cc1 -verify -E -frewrite-includes -P -DFIRST -I %S/Inputs %s -o - | FileCheck -check-prefix=CHECKNL -strict-whitespace %s
+// RUN: not %clang_cc1 -verify -E -frewrite-includes -DFIRST -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s
+// RUN: not %clang_cc1 -verify -E -frewrite-includes -P -DFIRST -I %S/Inputs %s -o - | FileCheck -check-prefix=CHECKNL -strict-whitespace %s
// STARTCOMPARE
#define A(a,b) a ## b
A(1,2)
@@ -10,6 +10,7 @@ A(1,2)
#else
#include "rewrite-includes4.h"
#endif
+ // indented
#/**/include /**/ "rewrite-includes5.h" /**/ \
#include "rewrite-includes6.h" // comment
@@ -26,79 +27,86 @@ A(1,2)
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes1.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs[/\\]}}rewrite-includes1.h" 1{{$}}
+// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes1.h" 1{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#pragma clang system_header{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 2 "{{.*[/\\]Inputs[/\\]}}rewrite-includes1.h" 3{{$}}
+// CHECK-NEXT: {{^}}# 2 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes1.h" 3{{$}}
// CHECK-NEXT: {{^}}included_line1{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes2.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs[/\\]}}rewrite-includes2.h" 1 3{{$}}
+// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes2.h" 1 3{{$}}
// CHECK-NEXT: {{^}}included_line2{{$}}
-// CHECK-NEXT: {{^}}# 4 "{{.*[/\\]Inputs[/\\]}}rewrite-includes1.h" 2 3{{$}}
+// CHECK-NEXT: {{^}}# 4 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes1.h" 2 3{{$}}
// CHECK-NEXT: {{^}}# 7 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}#ifdef FIRST{{$}}
// CHECK-NEXT: {{^}}#define HEADER "rewrite-includes3.h"{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include HEADER{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs[/\\]}}rewrite-includes3.h" 1{{$}}
+// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes3.h" 1{{$}}
// CHECK-NEXT: {{^}}included_line3{{$}}
// CHECK-NEXT: {{^}}# 10 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}#else{{$}}
+// CHECK-NEXT: {{^}}# 11 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes4.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 12 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}#endif{{$}}
+// CHECK-NEXT: {{^}}# 13 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}} // indented{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#/**/include /**/ "rewrite-includes5.h" /**/ {{\\}}{{$}}
// CHECK-NEXT: {{^}} {{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs[/\\]}}rewrite-includes5.h" 1{{$}}
+// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes5.h" 1{{$}}
// CHECK-NEXT: {{^}}included_line5{{$}}
-// CHECK-NEXT: {{^}}# 15 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}# 16 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes6.h" // comment{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs[/\\]}}rewrite-includes6.h" 1{{$}}
+// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes6.h" 1{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#pragma once{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 2 "{{.*[/\\]Inputs[/\\]}}rewrite-includes6.h"{{$}}
+// CHECK-NEXT: {{^}}# 2 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes6.h"{{$}}
// CHECK-NEXT: {{^}}included_line6{{$}}
-// CHECK-NEXT: {{^}}# 16 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}# 17 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}} {{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes6.h" /* comment{{$}}
// CHECK-NEXT: {{^}} continues */{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 19 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 20 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes7.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs[/\\]}}rewrite-includes7.h" 1{{$}}
+// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes7.h" 1{{$}}
// CHECK-NEXT: {{^}}#ifndef REWRITE_INCLUDES_7{{$}}
// CHECK-NEXT: {{^}}#define REWRITE_INCLUDES_7{{$}}
// CHECK-NEXT: {{^}}included_line7{{$}}
// CHECK-NEXT: {{^}}#endif{{$}}
-// CHECK-NEXT: {{^}}# 20 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}# 5 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes7.h"{{$}}
+// CHECK-NEXT: {{^}}# 21 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes7.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 21 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 22 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes8.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs[/\\]}}rewrite-includes8.h" 1{{$}}
+// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h" 1{{$}}
// CHECK-NEXT: {{^}}#if (1)/*__has_include_next(<rewrite-includes8.h>)*/{{$}}
// CHECK-NEXT: {{^}}#elif (0)/*__has_include(<rewrite-includes8.hfail>)*/{{$}}
+// CHECK-NEXT: {{^}}# 3 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h"{{$}}
// CHECK-NEXT: {{^}}#endif{{$}}
+// CHECK-NEXT: {{^}}# 4 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h"{{$}}
// CHECK-NEXT: {{^}}#if !(1)/*__has_include("rewrite-includes8.h")*/{{$}}
// CHECK-NEXT: {{^}}#endif{{$}}
-// CHECK-NEXT: {{^}}# 22 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}# 6 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h"{{$}}
+// CHECK-NEXT: {{^}}# 23 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}// ENDCOMPARE{{$}}
// CHECKNL: {{^}}// STARTCOMPARE{{$}}
@@ -126,6 +134,7 @@ A(1,2)
// CHECKNL-NEXT: {{^}}#include "rewrite-includes4.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#endif{{$}}
+// CHECKNL-NEXT: {{^}} // indented{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#/**/include /**/ "rewrite-includes5.h" /**/ {{\\}}{{$}}
// CHECKNL-NEXT: {{^}} {{$}}
diff --git a/test/Frontend/verify-fatal.c b/test/Frontend/verify-fatal.c
index 0e74032a3afe..1a26196efa1b 100644
--- a/test/Frontend/verify-fatal.c
+++ b/test/Frontend/verify-fatal.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Wfatal-errors -verify %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -Wfatal-errors -verify %s 2>&1 | FileCheck %s
#error first fatal
// expected-error@-1 {{first fatal}}
diff --git a/test/Frontend/verify.c b/test/Frontend/verify.c
index 3d71e04980c5..4bd0c90b4aea 100644
--- a/test/Frontend/verify.c
+++ b/test/Frontend/verify.c
@@ -1,8 +1,8 @@
// RUN: %clang_cc1 -DTEST1 -verify %s
-// RUN: %clang_cc1 -DTEST2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
-// RUN: %clang_cc1 -DTEST3 -verify %s 2>&1 | FileCheck -check-prefix=CHECK3 %s
-// RUN: %clang_cc1 -DTEST4 -verify %s 2>&1 | FileCheck -check-prefix=CHECK4 %s
-// RUN: %clang_cc1 -DTEST5 -verify %s 2>&1 | FileCheck -check-prefix=CHECK5 %s
+// RUN: not %clang_cc1 -DTEST2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
+// RUN: not %clang_cc1 -DTEST3 -verify %s 2>&1 | FileCheck -check-prefix=CHECK3 %s
+// RUN: not %clang_cc1 -DTEST4 -verify %s 2>&1 | FileCheck -check-prefix=CHECK4 %s
+// RUN: not %clang_cc1 -DTEST5 -verify %s 2>&1 | FileCheck -check-prefix=CHECK5 %s
// expected-warning@ malformed
// expected-error@7 1 {{missing or invalid line number}}
@@ -109,14 +109,14 @@ unexpected b; // expected-error@33 1-1 {{unknown type}}
#endif
#if 0
-// RUN: %clang_cc1 -verify %t.invalid 2>&1 | FileCheck -check-prefix=CHECK6 %s
+// RUN: not %clang_cc1 -verify %t.invalid 2>&1 | FileCheck -check-prefix=CHECK6 %s
// CHECK6: error: no expected directives found: consider use of 'expected-no-diagnostics'
// CHECK6-NEXT: error: 'error' diagnostics seen but not expected:
// CHECK6-NEXT: (frontend): error reading '{{.*}}verify.c.tmp.invalid'
// CHECK6-NEXT: 2 errors generated.
-// RUN: echo -e '//expected-error@2{{1}}\n#error 2' | %clang_cc1 -verify 2>&1 | FileCheck -check-prefix=CHECK7 %s
+// RUN: printf '//expected-error@2{{1}}\n#error 2\n' | not %clang_cc1 -verify 2>&1 | FileCheck -check-prefix=CHECK7 %s
// CHECK7: error: 'error' diagnostics expected but not seen:
// CHECK7-NEXT: Line 2 (directive at <stdin>:1): 1
@@ -126,10 +126,10 @@ unexpected b; // expected-error@33 1-1 {{unknown type}}
#endif
#ifdef TEST8
-// RUN: %clang_cc1 -DTEST8 -verify %s 2>&1 | FileCheck -check-prefix=CHECK8 %s
+// RUN: not %clang_cc1 -DTEST8 -verify %s 2>&1 | FileCheck -check-prefix=CHECK8 %s
-// expected-warning@nonexistant-file:1 {{ }}
-// expected-error@-1 {{file 'nonexistant-file' could not be located}}
+// expected-warning@nonexistent-file:1 {{ }}
+// expected-error@-1 {{file 'nonexistent-file' could not be located}}
// expected-warning@verify-directive.h: {{ }}
// expected-error@-1 {{missing or invalid line number}}
diff --git a/test/Frontend/verify2.c b/test/Frontend/verify2.c
index 04f80ad48e1a..73eda4d815de 100644
--- a/test/Frontend/verify2.c
+++ b/test/Frontend/verify2.c
@@ -1,5 +1,5 @@
#if 0
-// RUN: %clang_cc1 -verify %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -verify %s 2>&1 | FileCheck %s
// Please note that all comments are inside "#if 0" blocks so that
// VerifyDiagnosticConsumer sees no comments while processing this
diff --git a/test/Frontend/verify3.c b/test/Frontend/verify3.c
index 0705b4b7ee57..3898bfeedda0 100644
--- a/test/Frontend/verify3.c
+++ b/test/Frontend/verify3.c
@@ -2,7 +2,7 @@
// diagnostics are generated in relation to the mis-use and non-use of the
// 'expected-no-diagnostics' directive.
-// RUN: %clang_cc1 -DTEST1 -verify %s 2>&1 | FileCheck -check-prefix=CHECK1 %s
+// RUN: not %clang_cc1 -DTEST1 -verify %s 2>&1 | FileCheck -check-prefix=CHECK1 %s
#ifdef TEST1
// expected-no-diagnostics
// expected-note {{}}
@@ -12,7 +12,7 @@
// CHECK1-NEXT: 1 error generated.
#endif
-// RUN: %clang_cc1 -DTEST2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
+// RUN: not %clang_cc1 -DTEST2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
#ifdef TEST2
#warning X
// expected-warning@-1 {{X}}
@@ -23,8 +23,8 @@
// CHECK2-NEXT: 1 error generated.
#endif
-// RUN: %clang_cc1 -DTEST3 -verify %s 2>&1 | FileCheck -check-prefix=CHECK3 %s
-// RUN: %clang_cc1 -verify 2>&1 | FileCheck -check-prefix=CHECK3 %s
+// RUN: not %clang_cc1 -DTEST3 -verify %s 2>&1 | FileCheck -check-prefix=CHECK3 %s
+// RUN: not %clang_cc1 -verify %s 2>&1 | FileCheck -check-prefix=CHECK3 %s
#ifdef TEST3
// no directives
diff --git a/test/Driver/x86_64-nacl-types.cpp b/test/Frontend/x86_64-nacl-types.cpp
index a994cb75ef66..a994cb75ef66 100644
--- a/test/Driver/x86_64-nacl-types.cpp
+++ b/test/Frontend/x86_64-nacl-types.cpp
diff --git a/test/Headers/Inputs/include/complex.h b/test/Headers/Inputs/include/complex.h
new file mode 100644
index 000000000000..1ed5f53092a5
--- /dev/null
+++ b/test/Headers/Inputs/include/complex.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#define complex _Complex
diff --git a/test/Headers/Inputs/include/math.h b/test/Headers/Inputs/include/math.h
new file mode 100644
index 000000000000..6f70f09beec2
--- /dev/null
+++ b/test/Headers/Inputs/include/math.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/test/Headers/Inputs/include/stdint.h b/test/Headers/Inputs/include/stdint.h
index 7a1fddef82da..5bf26a7b67b0 100644
--- a/test/Headers/Inputs/include/stdint.h
+++ b/test/Headers/Inputs/include/stdint.h
@@ -10,6 +10,7 @@ typedef unsigned __INT64_TYPE__ uint64_t;
#endif
#ifdef __INTPTR_TYPE__
+typedef __INTPTR_TYPE__ intptr_t;
typedef unsigned __INTPTR_TYPE__ uintptr_t;
#else
#error Every target should have __INTPTR_TYPE__
diff --git a/test/Headers/altivec-header.c b/test/Headers/altivec-header.c
index 085e799f9599..b01cc9716d76 100644
--- a/test/Headers/altivec-header.c
+++ b/test/Headers/altivec-header.c
@@ -1,7 +1,7 @@
// REQUIRES: ppc64-registered-target
-// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -maltivec -ffreestanding -S -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -maltivec -ffreestanding -fno-lax-vector-conversions -S -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -maltivec -ffreestanding -x c++ -S -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -S -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -fno-lax-vector-conversions -S -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -x c++ -S -o - %s | FileCheck %s
#include <altivec.h>
diff --git a/test/Headers/c11.c b/test/Headers/c11.c
index 21f2e4f2224d..11bec1954462 100644
--- a/test/Headers/c11.c
+++ b/test/Headers/c11.c
@@ -1,6 +1,6 @@
-// RUN: %clang -fsyntax-only -Xclang -verify -std=c11 %s
-// RUN: %clang -fsyntax-only -Xclang -verify -std=c11 -fmodules %s
-// RUN: %clang -fsyntax-only -Xclang -verify -std=c11 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -fmodules %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s
noreturn int f(); // expected-error 1+{{}}
diff --git a/test/Headers/c89.c b/test/Headers/c89.c
index acf01b40e06e..6188df5487bd 100644
--- a/test/Headers/c89.c
+++ b/test/Headers/c89.c
@@ -1,4 +1,4 @@
-// RUN: %clang -target i386-apple-darwin10 -fsyntax-only -Xclang -verify -std=c89 %s
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -target-cpu yonah -fsyntax-only -verify -std=c89 %s
// expected-no-diagnostics
// FIXME: Disable inclusion of mm_malloc.h, our current implementation is broken
diff --git a/test/Headers/cxx11.cpp b/test/Headers/cxx11.cpp
index 54fe350ea5b2..1a4b6400e095 100644
--- a/test/Headers/cxx11.cpp
+++ b/test/Headers/cxx11.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang -fsyntax-only -std=c++11 %s
-// RUN: %clang -fsyntax-only -std=c++11 -fmodules %s
+// RUN: %clang_cc1 -ffreestanding -fsyntax-only -std=c++11 %s
+// RUN: %clang_cc1 -ffreestanding -fsyntax-only -std=c++11 -fmodules %s
#include <stdalign.h>
diff --git a/test/Headers/limits.cpp b/test/Headers/limits.cpp
new file mode 100644
index 000000000000..a78f7fc6de6e
--- /dev/null
+++ b/test/Headers/limits.cpp
@@ -0,0 +1,42 @@
+// RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fno-signed-char -ffreestanding -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++11 -ffreestanding -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+#include <limits.h>
+
+_Static_assert(SCHAR_MAX == -(SCHAR_MIN+1), "");
+_Static_assert(SHRT_MAX == -(SHRT_MIN+1), "");
+_Static_assert(INT_MAX == -(INT_MIN+1), "");
+_Static_assert(LONG_MAX == -(LONG_MIN+1L), "");
+
+_Static_assert(SCHAR_MAX == UCHAR_MAX/2, "");
+_Static_assert(SHRT_MAX == USHRT_MAX/2, "");
+_Static_assert(INT_MAX == UINT_MAX/2, "");
+_Static_assert(LONG_MAX == ULONG_MAX/2, "");
+
+_Static_assert(SCHAR_MIN == -SCHAR_MAX-1, "");
+_Static_assert(SHRT_MIN == -SHRT_MAX-1, "");
+_Static_assert(INT_MIN == -INT_MAX-1, "");
+_Static_assert(LONG_MIN == -LONG_MAX-1L, "");
+
+_Static_assert(UCHAR_MAX == (unsigned char)~0ULL, "");
+_Static_assert(USHRT_MAX == (unsigned short)~0ULL, "");
+_Static_assert(UINT_MAX == (unsigned int)~0ULL, "");
+_Static_assert(ULONG_MAX == (unsigned long)~0ULL, "");
+
+_Static_assert(MB_LEN_MAX >= 1, "");
+
+_Static_assert(CHAR_BIT >= 8, "");
+
+const bool char_is_signed = (char)-1 < (char)0;
+_Static_assert(CHAR_MIN == (char_is_signed ? -CHAR_MAX-1 : 0), "");
+_Static_assert(CHAR_MAX == (char_is_signed ? -(CHAR_MIN+1) : (char)~0ULL), "");
+
+#if __STDC_VERSION__ >= 199901 || __cplusplus >= 201103L
+_Static_assert(LLONG_MAX == -(LLONG_MIN+1LL), "");
+_Static_assert(LLONG_MIN == -LLONG_MAX-1LL, "");
+_Static_assert(ULLONG_MAX == (unsigned long long)~0ULL, "");
+#else
+int LLONG_MIN, LLONG_MAX, ULLONG_MAX; // Not defined.
+#endif
diff --git a/test/Headers/ms-intrin.cpp b/test/Headers/ms-intrin.cpp
new file mode 100644
index 000000000000..1bf134e7eac6
--- /dev/null
+++ b/test/Headers/ms-intrin.cpp
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -triple i386-pc-win32 -target-cpu pentium4 \
+// RUN: -fms-extensions -fms-compatibility -fmsc-version=1700 \
+// RUN: -ffreestanding -verify %s
+
+// Intrin.h needs size_t, but -ffreestanding prevents us from getting it from
+// stddef.h. Work around it with this typedef.
+typedef __SIZE_TYPE__ size_t;
+
+#include <Intrin.h>
+
+// Use some C++ to make sure we closed the extern "C" brackets.
+template <typename T>
+void foo(T V) {}
+
+void bar() {
+ _ReadWriteBarrier(); // expected-warning {{is deprecated: use other intrinsics or C++11 atomics instead}}
+ _ReadBarrier(); // expected-warning {{is deprecated: use other intrinsics or C++11 atomics instead}}
+ _WriteBarrier(); // expected-warning {{is deprecated: use other intrinsics or C++11 atomics instead}}
+ // FIXME: It'd be handy if we didn't have to hardcode the line number in
+ // intrin.h.
+ // expected-note@Intrin.h:754 {{declared here}}
+ // expected-note@Intrin.h:759 {{declared here}}
+ // expected-note@Intrin.h:764 {{declared here}}
+}
diff --git a/test/Headers/ms-null-ms-header-vs-stddef.cpp b/test/Headers/ms-null-ms-header-vs-stddef.cpp
index 7efa871da90e..237ed51f965e 100644
--- a/test/Headers/ms-null-ms-header-vs-stddef.cpp
+++ b/test/Headers/ms-null-ms-header-vs-stddef.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang -fsyntax-only -target i686-pc-win32 %s
-// RUN: %clang -fsyntax-only -target i386-mingw32 %s
+// RUN: %clang_cc1 -fsyntax-only -triple i686-pc-win32 -fms-compatibility -fmsc-version=1700 %s
+// RUN: %clang_cc1 -fsyntax-only -triple i386-mingw32 %s
// Something in MSVC's headers (pulled in e.g. by <crtdefs.h>) defines __null
// to something, mimick that.
diff --git a/test/Headers/ms-wchar.c b/test/Headers/ms-wchar.c
index f015fc77ee51..fee7e72bd42c 100644
--- a/test/Headers/ms-wchar.c
+++ b/test/Headers/ms-wchar.c
@@ -1,4 +1,4 @@
-// RUN: %clang -fsyntax-only -target i386-pc-win32 %s
+// RUN: %clang_cc1 -fsyntax-only -triple i386-pc-win32 -fms-compatibility %s
#if defined(_WCHAR_T_DEFINED)
#error "_WCHAR_T_DEFINED should not be defined in C99"
diff --git a/test/Headers/tgmath.c b/test/Headers/tgmath.c
new file mode 100644
index 000000000000..4235ae20719f
--- /dev/null
+++ b/test/Headers/tgmath.c
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -fsyntax-only -isystem %S/Inputs/include -verify %s
+// expected-no-diagnostics
+
+#include <tgmath.h>
+
+float f;
+double d;
+long double l;
+
+float complex fc;
+double complex dc;
+long double complex lc;
+
+// creal
+
+_Static_assert(sizeof(creal(f)) == sizeof(f), "");
+_Static_assert(sizeof(creal(d)) == sizeof(d), "");
+_Static_assert(sizeof(creal(l)) == sizeof(l), "");
+
+_Static_assert(sizeof(creal(fc)) == sizeof(f), "");
+_Static_assert(sizeof(creal(dc)) == sizeof(d), "");
+_Static_assert(sizeof(creal(lc)) == sizeof(l), "");
+
+// fabs
+
+_Static_assert(sizeof(fabs(f)) == sizeof(f), "");
+_Static_assert(sizeof(fabs(d)) == sizeof(d), "");
+_Static_assert(sizeof(fabs(l)) == sizeof(l), "");
+
+_Static_assert(sizeof(fabs(fc)) == sizeof(f), "");
+_Static_assert(sizeof(fabs(dc)) == sizeof(d), "");
+_Static_assert(sizeof(fabs(lc)) == sizeof(l), "");
+
+// logb
+
+_Static_assert(sizeof(logb(f)) == sizeof(f), "");
+_Static_assert(sizeof(logb(d)) == sizeof(d), "");
+_Static_assert(sizeof(logb(l)) == sizeof(l), "");
diff --git a/test/Headers/x86-intrinsics-headers.c b/test/Headers/x86-intrinsics-headers.c
index bdffddedfc7b..91c4ffaa0edb 100644
--- a/test/Headers/x86-intrinsics-headers.c
+++ b/test/Headers/x86-intrinsics-headers.c
@@ -1,6 +1,6 @@
-// RUN: %clang -fsyntax-only -ffreestanding %s
-// RUN: %clang -fsyntax-only -ffreestanding -fno-lax-vector-conversions %s
-// RUN: %clangxx -fsyntax-only -ffreestanding -x c++ %s
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding -fno-lax-vector-conversions %s
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding -x c++ %s
#if defined(i386) || defined(__x86_64__)
diff --git a/test/Headers/x86intrin.c b/test/Headers/x86intrin.c
new file mode 100644
index 000000000000..d095c00674e0
--- /dev/null
+++ b/test/Headers/x86intrin.c
@@ -0,0 +1,91 @@
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding %s -verify
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding -fno-lax-vector-conversions %s -verify
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding -x c++ %s -verify
+// expected-no-diagnostics
+
+#if defined(i386) || defined(__x86_64__)
+
+// Pretend to enable all features.
+#ifndef __3dNOW__
+#define __3dNOW__
+#endif
+#ifndef __BMI__
+#define __BMI__
+#endif
+#ifndef __BMI2__
+#define __BMI2__
+#endif
+#ifndef __LZCNT__
+#define __LZCNT__
+#endif
+#ifndef __POPCNT__
+#define __POPCNT__
+#endif
+#ifndef __RDSEED__
+#define __RDSEED__
+#endif
+#ifndef __PRFCHW__
+#define __PRFCHW__
+#endif
+#ifndef __SSE4A__
+#define __SSE4A__
+#endif
+#ifndef __FMA4__
+#define __FMA4__
+#endif
+#ifndef __XOP__
+#define __XOP__
+#endif
+#ifndef __F16C__
+#define __F16C__
+#endif
+#ifndef __MMX__
+#define __MMX__
+#endif
+#ifndef __SSE__
+#define __SSE__
+#endif
+#ifndef __SSE2__
+#define __SSE2__
+#endif
+#ifndef __SSE3__
+#define __SSE3__
+#endif
+#ifndef __SSSE3__
+#define __SSSE3__
+#endif
+#ifndef __SSE4_1__
+#define __SSE4_1__
+#endif
+#ifndef __SSE4_2__
+#define __SSE4_2__
+#endif
+#ifndef __AES__
+#define __AES__
+#endif
+#ifndef __AVX__
+#define __AVX__
+#endif
+#ifndef __AVX2__
+#define __AVX2__
+#endif
+#ifndef __BMI__
+#define __BMI__
+#endif
+#ifndef __BMI2__
+#define __BMI2__
+#endif
+#ifndef __LZCNT__
+#define __LZCNT__
+#endif
+#ifndef __FMA__
+#define __FMA__
+#endif
+#ifndef __RDRND__
+#define __RDRND__
+#endif
+
+// Now include the metaheader that includes all x86 intrinsic headers.
+#include <x86intrin.h>
+
+#endif
diff --git a/test/Index/Inputs/CommentXML/invalid-function-13.xml b/test/Index/Inputs/CommentXML/invalid-function-13.xml
new file mode 100644
index 000000000000..14cd31bfa4ba
--- /dev/null
+++ b/test/Index/Inputs/CommentXML/invalid-function-13.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Function>
+<Name>aaa</Name>
+<Abstract><Para>Aaa.</Para></Abstract>
+<Parameters>
+ <Parameter>
+ <Name>x1</Name>
+ <IsVarArg />
+ <Discussion><Para>Bbb</Para></Discussion>
+ </Parameter>
+</Parameters>
+</Function>
+
diff --git a/test/Index/Inputs/CommentXML/valid-function-07.xml b/test/Index/Inputs/CommentXML/valid-function-07.xml
index 89b8a0ca6fc8..b567e6b265bf 100644
--- a/test/Index/Inputs/CommentXML/valid-function-07.xml
+++ b/test/Index/Inputs/CommentXML/valid-function-07.xml
@@ -20,11 +20,24 @@
<Direction isExplicit="1">in,out</Direction>
<Discussion><Para>Ddd</Para></Discussion>
</Parameter>
+ <Parameter>
+ <Name>x4</Name>
+ <IsVarArg />
+ <Direction isExplicit="0">in</Direction>
+ <Discussion><Para>Eee</Para></Discussion>
+ </Parameter>
</Parameters>
-<ResultDiscussion><Para>Eee.</Para></ResultDiscussion>
+<Exceptions>
+ <Para>Fff.</Para>
+ <Para>Ggg</Para>
+</Exceptions>
+<ResultDiscussion>
+ <Para>Hhh.</Para>
+ <Para>Iii</Para>
+</ResultDiscussion>
<Discussion>
- <Para>Fff</Para>
- <Verbatim xml:space="preserve" kind="verbatim">Ggg</Verbatim>
+ <Para>Jjj</Para>
+ <Verbatim xml:space="preserve" kind="verbatim">Kkk</Verbatim>
</Discussion>
</Function>
diff --git a/test/Index/Inputs/empty.h b/test/Index/Inputs/empty.h
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/test/Index/Inputs/empty.h
diff --git a/test/Index/Inputs/lit.local.cfg b/test/Index/Inputs/lit.local.cfg
deleted file mode 100644
index e6f55eef7af5..000000000000
--- a/test/Index/Inputs/lit.local.cfg
+++ /dev/null
@@ -1 +0,0 @@
-config.suffixes = []
diff --git a/test/Index/Inputs/preamble-with-error.h b/test/Index/Inputs/preamble-with-error.h
new file mode 100644
index 000000000000..f840947369b0
--- /dev/null
+++ b/test/Index/Inputs/preamble-with-error.h
@@ -0,0 +1,3 @@
+typedef int Int;
+enum FFF
+extern Int *const www;
diff --git a/test/Index/TestClassDecl.m b/test/Index/TestClassDecl.m
index 038353b11dd6..899765eb0a2d 100644
--- a/test/Index/TestClassDecl.m
+++ b/test/Index/TestClassDecl.m
@@ -1,6 +1,6 @@
// RUN: c-index-test -write-pch %t.ast -fobjc-nonfragile-abi -fblocks -x objective-c %s
-// 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
+// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=CHECK-scan %s
+// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=CHECK-load %s
// This test checks how the @class resolves as a cursor when there is a real definition
// that follows. <rdar://problem/7383421>
diff --git a/test/Index/TestClassForwardDecl.m b/test/Index/TestClassForwardDecl.m
index 2f32d33c7082..9696a280661d 100644
--- a/test/Index/TestClassForwardDecl.m
+++ b/test/Index/TestClassForwardDecl.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -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
+// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=CHECK-scan %s
+// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=CHECK-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>)
diff --git a/test/Index/annotate-comments-objc.m b/test/Index/annotate-comments-objc.m
new file mode 100644
index 000000000000..e778d6c65e1c
--- /dev/null
+++ b/test/Index/annotate-comments-objc.m
@@ -0,0 +1,78 @@
+// Run lines are sensitive to line numbers and come below the code.
+
+#ifndef HEADER
+#define HEADER
+
+@class NSString;
+
+//===---
+// rdar://14258334
+// Check that we attach comments to properties correctly.
+//===---
+
+@interface MyClass {
+}
+
+/// property1_isdoxy1 IS_DOXYGEN_SINGLE
+@property (nonatomic, copy, readwrite) NSString *property1_isdoxy1;
+@property (nonatomic, copy, readwrite) NSString *property1_isdoxy2; ///< property1_isdoxy2 IS_DOXYGEN_SINGLE
+@property (nonatomic, copy, readwrite) NSString *property1_isdoxy3; /**< property1_isdoxy3 IS_DOXYGEN_SINGLE */
+@property (nonatomic, copy, readwrite) NSString *property1_isdoxy4; /*!< property1_isdoxy4 IS_DOXYGEN_SINGLE */
+
+/// method1_isdoxy1 IS_DOXYGEN_SINGLE
+- (void)method1_isdoxy1;
+- (void)method1_isdoxy2; /*!< method1_isdoxy2 IS_DOXYGEN_SINGLE */
+- (void)method1_isdoxy3; /*!< method1_isdoxy3 IS_DOXYGEN_SINGLE */
+- (void)method1_isdoxy4; /*!< method1_isdoxy4 IS_DOXYGEN_SINGLE */
+@end
+
+
+#endif
+
+// RUN: rm -rf %t
+// RUN: mkdir %t
+
+// Check that we serialize comment source locations properly.
+// RUN: %clang_cc1 -emit-pch -o %t/out.pch %s
+// RUN: %clang_cc1 -include-pch %t/out.pch -fsyntax-only %s
+
+// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s > %t/out.c-index-direct
+// RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch
+
+// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
+// RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-pch
+
+// Declarations without Doxygen comments should not pick up some Doxygen comments.
+// WRONG-NOT: notdoxy{{.*}}Comment=
+// WRONG-NOT: test{{.*}}Comment=
+
+// Non-Doxygen comments should not be attached to anything.
+// WRONG-NOT: NOT_DOXYGEN
+
+// Some Doxygen comments are not attached to anything.
+// WRONG-NOT: IS_DOXYGEN_NOT_ATTACHED
+
+// Ensure we don't pick up extra comments.
+// WRONG-NOT: IS_DOXYGEN_START{{.*}}IS_DOXYGEN_START{{.*}}BriefComment=
+// WRONG-NOT: IS_DOXYGEN_END{{.*}}IS_DOXYGEN_END{{.*}}BriefComment=
+//
+// Ensure that XML is not invalid
+// WRONG-NOT: CommentXMLInvalid
+
+// RUN: FileCheck %s < %t/out.c-index-direct
+// RUN: FileCheck %s < %t/out.c-index-pch
+
+// These CHECK lines are not located near the code on purpose. This test
+// checks that documentation comments are attached to declarations correctly.
+// Adding a non-documentation comment with CHECK line between every two
+// documentation comments will only test a single code path.
+//
+// CHECK: annotate-comments-objc.m:17:50: ObjCPropertyDecl=property1_isdoxy1:{{.*}} property1_isdoxy1 IS_DOXYGEN_SINGLE
+// CHECK: annotate-comments-objc.m:18:50: ObjCPropertyDecl=property1_isdoxy2:{{.*}} property1_isdoxy2 IS_DOXYGEN_SINGLE
+// CHECK: annotate-comments-objc.m:19:50: ObjCPropertyDecl=property1_isdoxy3:{{.*}} property1_isdoxy3 IS_DOXYGEN_SINGLE
+// CHECK: annotate-comments-objc.m:20:50: ObjCPropertyDecl=property1_isdoxy4:{{.*}} property1_isdoxy4 IS_DOXYGEN_SINGLE
+// CHECK: annotate-comments-objc.m:23:9: ObjCInstanceMethodDecl=method1_isdoxy1:{{.*}} method1_isdoxy1 IS_DOXYGEN_SINGLE
+// CHECK: annotate-comments-objc.m:24:9: ObjCInstanceMethodDecl=method1_isdoxy2:{{.*}} method1_isdoxy2 IS_DOXYGEN_SINGLE
+// CHECK: annotate-comments-objc.m:25:9: ObjCInstanceMethodDecl=method1_isdoxy3:{{.*}} method1_isdoxy3 IS_DOXYGEN_SINGLE
+// CHECK: annotate-comments-objc.m:26:9: ObjCInstanceMethodDecl=method1_isdoxy4:{{.*}} method1_isdoxy4 IS_DOXYGEN_SINGLE
+
diff --git a/test/Index/annotate-comments-unterminated.c b/test/Index/annotate-comments-unterminated.c
index 6bba911aac93..305cf2319172 100644
--- a/test/Index/annotate-comments-unterminated.c
+++ b/test/Index/annotate-comments-unterminated.c
@@ -1,5 +1,5 @@
// RUN: c-index-test -test-load-source all %s | FileCheck %s
-// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=ERR %s
+// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-ERR %s
// CHECK: annotate-comments-unterminated.c:9:5: VarDecl=x:{{.*}} RawComment=[/** Aaa. */]{{.*}} BriefComment=[Aaa.]
// CHECK: annotate-comments-unterminated.c:11:5: VarDecl=y:{{.*}} RawComment=[/**< Bbb. */]{{.*}} BriefComment=[Bbb.]
diff --git a/test/Index/annotate-comments.cpp b/test/Index/annotate-comments.cpp
index 2a0b635de85c..6612a44792e6 100644
--- a/test/Index/annotate-comments.cpp
+++ b/test/Index/annotate-comments.cpp
@@ -247,6 +247,13 @@ void isdoxy52(int);
*/
void isdoxy53(int);
+#define MYMAC(x,y)
+/**
+ * Aaa. IS_DOXYGEN_START IS_DOXYGEN_END
+ */
+MYMAC(0,0)
+void isdoxy54(int);
+
#endif
// RUN: rm -rf %t
@@ -327,4 +334,5 @@ void isdoxy53(int);
// CHECK: annotate-comments.cpp:222:6: FunctionDecl=isdoxy50:{{.*}} BriefComment=[Returns ddd IS_DOXYGEN_END]
// CHECK: annotate-comments.cpp:231:6: FunctionDecl=isdoxy51:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START]
// CHECK: annotate-comments.cpp:241:6: FunctionDecl=isdoxy52:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START Bbb.]
-
+// CHECK: annotate-comments.cpp:248:6: FunctionDecl=isdoxy53:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START IS_DOXYGEN_END]
+// CHECK: annotate-comments.cpp:255:6: FunctionDecl=isdoxy54:{{.*}} BriefComment=[Aaa. IS_DOXYGEN_START IS_DOXYGEN_END]
diff --git a/test/Index/annotate-tokens-cxx0x.cpp b/test/Index/annotate-tokens-cxx0x.cpp
index 49f7efb285a1..4e6d156dfa9f 100644
--- a/test/Index/annotate-tokens-cxx0x.cpp
+++ b/test/Index/annotate-tokens-cxx0x.cpp
@@ -23,6 +23,47 @@ class S : public B {
virtual void foo(Int) override;
};
+// Need std::initializer_list
+namespace std {
+ typedef decltype(sizeof(int)) size_t;
+
+ // libc++'s implementation
+ template <class _E>
+ class initializer_list
+ {
+ const _E* __begin_;
+ size_t __size_;
+
+ initializer_list(const _E* __b, size_t __s)
+ : __begin_(__b),
+ __size_(__s)
+ {}
+
+ public:
+ typedef _E value_type;
+ typedef const _E& reference;
+ typedef const _E& const_reference;
+ typedef size_t size_type;
+
+ typedef const _E* iterator;
+ typedef const _E* const_iterator;
+
+ initializer_list() : __begin_(nullptr), __size_(0) {}
+
+ size_t size() const {return __size_;}
+ const _E* begin() const {return __begin_;}
+ const _E* end() const {return __begin_ + __size_;}
+ };
+}
+
+struct Foo {
+ Foo(std::initializer_list<int> il);
+};
+
+void test2() {
+ Foo{10};
+}
+
// RUN: c-index-test -test-annotate-tokens=%s:1:1:5:1 -fno-delayed-template-parsing -std=c++11 %s | FileCheck %s
// CHECK: Identifier: "args" [3:20 - 3:24] SizeOfPackExpr=args:2:15
@@ -52,3 +93,6 @@ class S : public B {
// CHECK-WITH-OVERRIDE: Punctuation: ")" [23:23 - 23:24] ParmDecl=:23:23 (Definition)
// CHECK-WITH-OVERRIDE: Keyword: "override" [23:25 - 23:33] attribute(override)=
// CHECK-WITH-OVERRIDE: Punctuation: ";" [23:33 - 23:34] ClassDecl=S:22:7 (Definition)
+
+// RUN: c-index-test -test-annotate-tokens=%s:64:1:65:1 -std=c++11 %s | FileCheck -check-prefix=CHECK-INITLIST %s
+// CHECK-INITLIST: Identifier: "Foo" [64:3 - 64:6] TypeRef=struct Foo:59:8
diff --git a/test/Index/annotate-tokens.m b/test/Index/annotate-tokens.m
index 40c66a18b8f0..9a7e28a666bf 100644
--- a/test/Index/annotate-tokens.m
+++ b/test/Index/annotate-tokens.m
@@ -142,6 +142,17 @@ static Rdar8595462_A * Rdar8595462_staticVar;
}
@end
+@interface MyClass
+ @property int classProperty;
+@end
+@interface MyClass (abc)
+ @property int categoryProperty;
+@end
+@interface MyClass ()
+ @property int extensionProperty;
+@end
+
+
// RUN: c-index-test -test-annotate-tokens=%s:1:1:118:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' | FileCheck %s
// CHECK: Punctuation: "@" [1:1 - 1:2] ObjCInterfaceDecl=Foo:1:12
// CHECK: Keyword: "interface" [1:2 - 1:11] ObjCInterfaceDecl=Foo:1:12
@@ -574,3 +585,14 @@ static Rdar8595462_A * Rdar8595462_staticVar;
// CHECK-WITH-WEAK: Identifier: "foo" [141:15 - 141:18] ObjCIvarDecl=foo:141:15 (Definition)
// CHECK-WITH-WEAK: Punctuation: ";" [141:18 - 141:19] ObjCInterfaceDecl=rdar9535717:140:12
// CHECK-WITH-WEAK: Punctuation: "}" [142:1 - 142:2] ObjCInterfaceDecl=rdar9535717:140:12
+
+// RUN: c-index-test -test-annotate-tokens=%s:145:1:153:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' -target x86_64-apple-macosx10.7.0 | FileCheck -check-prefix=CHECK-PROP %s
+// CHECK-PROP: Keyword: "property" [146:4 - 146:12] ObjCPropertyDecl=classProperty:146:17
+// CHECK-PROP: Keyword: "int" [146:13 - 146:16] ObjCPropertyDecl=classProperty:146:17
+// CHECK-PROP: Identifier: "classProperty" [146:17 - 146:30] ObjCPropertyDecl=classProperty:146:17
+// CHECK-PROP: Keyword: "property" [149:4 - 149:12] ObjCPropertyDecl=categoryProperty:149:17
+// CHECK-PROP: Keyword: "int" [149:13 - 149:16] ObjCPropertyDecl=categoryProperty:149:17
+// CHECK-PROP: Identifier: "categoryProperty" [149:17 - 149:33] ObjCPropertyDecl=categoryProperty:149:17
+// CHECK-PROP: Keyword: "property" [152:4 - 152:12] ObjCPropertyDecl=extensionProperty:152:17
+// CHECK-PROP: Keyword: "int" [152:13 - 152:16] ObjCPropertyDecl=extensionProperty:152:17
+// CHECK-PROP: Identifier: "extensionProperty" [152:17 - 152:34] ObjCPropertyDecl=extensionProperty:152:17
diff --git a/test/Index/annotate-toplevel-in-objccontainer.m b/test/Index/annotate-toplevel-in-objccontainer.m
index 56b7871d9bc2..3d8948e01e8b 100644
--- a/test/Index/annotate-toplevel-in-objccontainer.m
+++ b/test/Index/annotate-toplevel-in-objccontainer.m
@@ -18,16 +18,16 @@ static int glob2;
// RUN: c-index-test -write-pch %t.h.pch -x objective-c-header %s.h
// RUN: c-index-test -test-annotate-tokens=%s:5:1:7:1 %s -include %t.h \
-// RUN: | FileCheck -check-prefix=INTER %s
+// RUN: | FileCheck -check-prefix=CHECK-INTER %s
// CHECK-INTER: Identifier: "meth1" [5:8 - 5:13] ObjCInstanceMethodDecl=meth1:5:8
// CHECK-INTER: Identifier: "meth2" [6:8 - 6:13] ObjCInstanceMethodDecl=meth2:6:8
// RUN: c-index-test -test-annotate-tokens=%s:14:1:16:1 %s -include %t.h \
-// RUN: | FileCheck -check-prefix=IMPL %s
+// RUN: | FileCheck -check-prefix=CHECK-IMPL %s
// CHECK-IMPL: Identifier: "meth1" [14:8 - 14:13] ObjCInstanceMethodDecl=meth1:14:8 (Definition)
// CHECK-IMPL: Identifier: "meth2" [15:8 - 15:13] ObjCInstanceMethodDecl=meth2:15:8 (Definition)
// RUN: c-index-test -test-annotate-tokens=%s.h:7:1:9:1 %s -include %t.h \
-// RUN: | FileCheck -check-prefix=PCH %s
+// RUN: | FileCheck -check-prefix=CHECK-PCH %s
// CHECK-PCH: Identifier: "meth1" [7:8 - 7:13] ObjCInstanceMethodDecl=meth1:7:8
// CHECK-PCH: Identifier: "meth2" [8:8 - 8:13] ObjCInstanceMethodDecl=meth2:8:8
diff --git a/test/Index/asm-attribute.c b/test/Index/asm-attribute.c
index f9524598b608..dddecfbe62d2 100644
--- a/test/Index/asm-attribute.c
+++ b/test/Index/asm-attribute.c
@@ -2,5 +2,4 @@ int foo(int x) __asm__("_foo_");
// RUN: c-index-test -test-load-source all %s | FileCheck %s
// CHECK: asm-attribute.c:1:5: FunctionDecl=foo:1:5 Extent=[1:1 - 1:32]
-// FIXME: Location below.
-// CHECK: <invalid loc>:0:0: asm label=_foo_ Extent=[1:24 - 1:31]
+// CHECK: asm-attribute.c:1:24: asm label=_foo_ Extent=[1:24 - 1:31]
diff --git a/test/Index/attributes.c b/test/Index/attributes.c
new file mode 100644
index 000000000000..3e60e6c0e495
--- /dev/null
+++ b/test/Index/attributes.c
@@ -0,0 +1,10 @@
+// RUN: c-index-test -test-load-source all %s | FileCheck %s
+
+struct __attribute__((packed)) Test2 {
+ char a;
+};
+
+// CHECK: attributes.c:3:32: StructDecl=Test2:3:32 (Definition) Extent=[3:1 - 5:2]
+// CHECK: attributes.c:3:23: attribute(packed)=packed Extent=[3:23 - 3:29]
+// CHECK: attributes.c:4:8: FieldDecl=a:4:8 (Definition) Extent=[4:3 - 4:9] [access=public]
+
diff --git a/test/Index/availability.c b/test/Index/availability.c
index e6b1273acafb..cfe0ff5bea81 100644
--- a/test/Index/availability.c
+++ b/test/Index/availability.c
@@ -2,9 +2,19 @@
void foo(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5,obsoleted=10.7), availability(ios,introduced=3.2,deprecated=4.1)));
+enum {
+ old_enum
+} __attribute__((deprecated));
+
+enum {
+ old_enum_plat
+} __attribute__((availability(macosx,introduced=10.4,deprecated=10.5,obsoleted=10.7)
+
// RUN: c-index-test -test-load-source all %s > %t
// RUN: FileCheck -check-prefix=CHECK-1 %s < %t
// RUN: FileCheck -check-prefix=CHECK-2 %s < %t
// CHECK-1: (ios, introduced=3.2, deprecated=4.1)
// CHECK-2: (macosx, introduced=10.4, deprecated=10.5, obsoleted=10.7)
+// CHECK-2: EnumConstantDecl=old_enum:6:3 (Definition) (deprecated)
+// CHECK-2: EnumConstantDecl=old_enum_plat:10:3 {{.*}} (macosx, introduced=10.4, deprecated=10.5, obsoleted=10.7)
diff --git a/test/Index/c-index-api-loadTU-test.m b/test/Index/c-index-api-loadTU-test.m
index 61d82a6cde5a..c75d5ac6814e 100644
--- a/test/Index/c-index-api-loadTU-test.m
+++ b/test/Index/c-index-api-loadTU-test.m
@@ -77,14 +77,14 @@ struct X0 {};
// CHECK: c-index-api-loadTU-test.m:4:12: ObjCInterfaceDecl=Foo:4:12 Extent=[4:1 - 12:5]
// CHECK: c-index-api-loadTU-test.m:6:32: ObjCIvarDecl=myoutlet:6:32 (Definition) Extent=[6:3 - 6:40]
-// CHECK: <invalid loc>:0:0: attribute(iboutlet)= Extent=[6:18 - 6:26]
+// CHECK: c-index-api-loadTU-test.m:6:18: attribute(iboutlet)= Extent=[6:18 - 6:26]
// CHECK: c-index-api-loadTU-test.m:6:29: TypeRef=id:0:0 Extent=[6:29 - 6:31]
// CHECK: c-index-api-loadTU-test.m:8:36: ObjCInstanceMethodDecl=myMessage::8:36 Extent=[8:1 - 8:54]
-// CHECK: <invalid loc>:0:0: attribute(ibaction)= Extent=[8:25 - 8:33]
+// CHECK: c-index-api-loadTU-test.m:8:25: attribute(ibaction)= Extent=[8:25 - 8:33]
// CHECK: c-index-api-loadTU-test.m:8:50: ParmDecl=msg:8:50 (Definition) Extent=[8:47 - 8:53]
// CHECK: c-index-api-loadTU-test.m:8:47: TypeRef=id:0:0 Extent=[8:47 - 8:49]
// CHECK: c-index-api-loadTU-test.m:9:3: ObjCInstanceMethodDecl=foo:9:3 (deprecated) (always deprecated: "") Extent=[9:1 - 9:35]
-// CHECK: <invalid loc>:0:0: UnexposedAttr= Extent=[9:22 - 9:32]
+// CHECK: c-index-api-loadTU-test.m:9:22: UnexposedAttr= Extent=[9:22 - 9:32]
// CHECK: c-index-api-loadTU-test.m:10:3: ObjCClassMethodDecl=fooC:10:3 Extent=[10:1 - 10:8]
// CHECK: c-index-api-loadTU-test.m:14:12: ObjCInterfaceDecl=Bar:14:12 Extent=[14:1 - 18:5]
// CHECK: c-index-api-loadTU-test.m:14:18: ObjCSuperClassRef=Foo:4:12 Extent=[14:18 - 14:21]
@@ -153,13 +153,13 @@ struct X0 {};
// CHECK: c-index-api-loadTU-test.m:54:33: DeclRefExpr=bee:47:8 Extent=[54:33 - 54:36]
// CHECK: c-index-api-loadTU-test.m:62:12: ObjCInterfaceDecl=TestAttributes:62:12 Extent=[62:1 - 67:5]
// CHECK: c-index-api-loadTU-test.m:63:15: ObjCIvarDecl=anOutlet:63:15 (Definition) Extent=[63:3 - 63:23]
-// CHECK: <invalid loc>:0:0: attribute(iboutlet)= Extent=[63:3 - 63:11]
+// CHECK: c-index-api-loadTU-test.m:63:3: attribute(iboutlet)= Extent=[63:3 - 63:11]
// CHECK: c-index-api-loadTU-test.m:63:12: TypeRef=id:0:0 Extent=[63:12 - 63:14]
// CHECK: c-index-api-loadTU-test.m:64:29: ObjCIvarDecl=anOutletCollection:64:29 (Definition) Extent=[64:3 - 64:47]
-// CHECK: <invalid loc>:0:0: attribute(iboutletcollection)= [IBOutletCollection=ObjCObjectPointer] Extent=[64:3 - 64:25]
+// CHECK: c-index-api-loadTU-test.m:64:3: attribute(iboutletcollection)= [IBOutletCollection=ObjCObjectPointer] Extent=[64:3 - 64:25]
// CHECK: c-index-api-loadTU-test.m:64:26: TypeRef=id:0:0 Extent=[64:26 - 64:28]
// CHECK: c-index-api-loadTU-test.m:66:14: ObjCInstanceMethodDecl=actionMethod::66:14 Extent=[66:1 - 66:35]
-// CHECK: <invalid loc>:0:0: attribute(ibaction)= Extent=[66:4 - 66:12]
+// CHECK: c-index-api-loadTU-test.m:66:4: attribute(ibaction)= Extent=[66:4 - 66:12]
// CHECK: c-index-api-loadTU-test.m:66:31: ParmDecl=arg:66:31 (Definition) Extent=[66:28 - 66:34]
// CHECK: c-index-api-loadTU-test.m:66:28: TypeRef=id:0:0 Extent=[66:28 - 66:30]
// CHECK: c-index-api-loadTU-test.m:69:16: StructDecl=X0:69:16 Extent=[69:9 - 69:18]
@@ -170,7 +170,7 @@ struct X0 {};
// CHECK: c-index-api-loadTU-test.m:73:12: ObjCCategoryDecl=:73:12 Extent=[73:1 - 76:5]
// CHECK: c-index-api-loadTU-test.m:73:12: ObjCClassRef=TestAttributes:62:12 Extent=[73:12 - 73:26]
// CHECK: c-index-api-loadTU-test.m:75:32: ObjCPropertyDecl=anotherOutlet:75:32 [retain,] Extent=[75:1 - 75:45]
-// CHECK: <invalid loc>:0:0: attribute(iboutlet)= Extent=[75:20 - 75:28]
+// CHECK: c-index-api-loadTU-test.m:75:20: attribute(iboutlet)= Extent=[75:20 - 75:28]
// CHECK: c-index-api-loadTU-test.m:75:29: TypeRef=id:0:0 Extent=[75:29 - 75:31]
// CHECK: c-index-api-loadTU-test.m:75:32: ObjCInstanceMethodDecl=anotherOutlet:75:32 Extent=[75:32 - 75:45]
// CHECK: c-index-api-loadTU-test.m:75:32: ObjCInstanceMethodDecl=setAnotherOutlet::75:32 Extent=[75:32 - 75:45]
diff --git a/test/Index/c-index-unsupported-warning-test.c b/test/Index/c-index-unsupported-warning-test.c
new file mode 100644
index 000000000000..82ed06359d7e
--- /dev/null
+++ b/test/Index/c-index-unsupported-warning-test.c
@@ -0,0 +1,3 @@
+// RUN: c-index-test -code-completion-at=%s:1:1 -Wunknown-foo-bar-warning -Werror %s
+
+void f();
diff --git a/test/Index/cindex-from-source.m b/test/Index/cindex-from-source.m
index f226e4533530..504d90fd2bc9 100644
--- a/test/Index/cindex-from-source.m
+++ b/test/Index/cindex-from-source.m
@@ -1,4 +1,4 @@
-
+// REQUIRES: native
// RUN: %clang -x objective-c-header %S/Inputs/cindex-from-source.h -o %t.pfx.h.gch
// RUN: c-index-test -test-load-source local %s -include %t.pfx.h > %t
// RUN: FileCheck %s < %t
diff --git a/test/Index/comment-custom-block-command.cpp b/test/Index/comment-custom-block-command.cpp
index 80a58caa2b50..f87cef96e590 100644
--- a/test/Index/comment-custom-block-command.cpp
+++ b/test/Index/comment-custom-block-command.cpp
@@ -17,7 +17,7 @@
// RUN: FileCheck %s < %t/out.c-index-direct
// RUN: FileCheck %s < %t/out.c-index-pch
-// XFAIL: valgrind
+// XFAIL: vg_leak
#ifndef HEADER
#define HEADER
diff --git a/test/Index/comment-misc-tags.m b/test/Index/comment-misc-tags.m
index 9eae5489fc06..bb16ea97b6d6 100644
--- a/test/Index/comment-misc-tags.m
+++ b/test/Index/comment-misc-tags.m
@@ -45,7 +45,7 @@
// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)))
// CHECK: (CXComment_BlockCommand CommandName=[seealso]
// CHECK-NEXT: (CXComment_Paragraph
-// CHECK-NEXT: (CXComment_Text Text=[ //k_ref/doc/uid/XX30000905-CH204 Programming] HasTrailingNewline)
+// CHECK-NEXT: (CXComment_Text Text=[ //k_ref/doc/uid/XX30000905-CH204 Programming])
// rdar://12379053
/*!
@@ -108,3 +108,4 @@ struct Test {int filler;};
// CHECK: (CXComment_BlockCommand CommandName=[par]
// CHECK-NEXT: (CXComment_Paragraph
// CHECK-NEXT: (CXComment_Text Text=[ And this is the second paragraph.])))
+
diff --git a/test/Index/comment-to-html-xml-conversion.cpp b/test/Index/comment-to-html-xml-conversion.cpp
index c770ca8d30f0..8c0ed21b2f04 100644
--- a/test/Index/comment-to-html-xml-conversion.cpp
+++ b/test/Index/comment-to-html-xml-conversion.cpp
@@ -116,7 +116,8 @@ void comment_to_html_conversion_6();
/// \return Bbb.
void comment_to_html_conversion_7();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_7:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_7</Name><USR>c:@F@comment_to_html_conversion_7#</USR><Declaration>void comment_to_html_conversion_7()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_7:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><div class="result-discussion"><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p></div>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_7</Name><USR>c:@F@comment_to_html_conversion_7#</USR><Declaration>void comment_to_html_conversion_7()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>]
+
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -132,7 +133,7 @@ void comment_to_html_conversion_7();
/// \returns Bbb.
void comment_to_html_conversion_8();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_8:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_8</Name><USR>c:@F@comment_to_html_conversion_8#</USR><Declaration>void comment_to_html_conversion_8()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_8:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><div class="result-discussion"><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p></div>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_8</Name><USR>c:@F@comment_to_html_conversion_8#</USR><Declaration>void comment_to_html_conversion_8()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -148,7 +149,7 @@ void comment_to_html_conversion_8();
/// \result Bbb.
void comment_to_html_conversion_9();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_9:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_9</Name><USR>c:@F@comment_to_html_conversion_9#</USR><Declaration>void comment_to_html_conversion_9()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_9:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><div class="result-discussion"><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p></div>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_9</Name><USR>c:@F@comment_to_html_conversion_9#</USR><Declaration>void comment_to_html_conversion_9()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Bbb.</Para></ResultDiscussion></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -163,7 +164,7 @@ void comment_to_html_conversion_9();
/// \returns Bbb.
void comment_to_html_conversion_10();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_10:{{.*}} FullCommentAsHTML=[<p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p><p class="para-returns"><span class="word-returns">Returns</span> Aaa. </p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_10</Name><USR>c:@F@comment_to_html_conversion_10#</USR><Declaration>void comment_to_html_conversion_10()</Declaration><ResultDiscussion><Para> Aaa. </Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_10:{{.*}} FullCommentAsHTML=[<div class="result-discussion"><p class="para-returns"><span class="word-returns">Returns</span> Aaa. </p><p class="para-returns"><span class="word-returns">Returns</span> Bbb.</p></div>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_10</Name><USR>c:@F@comment_to_html_conversion_10#</USR><Declaration>void comment_to_html_conversion_10()</Declaration><ResultDiscussion><Para> Aaa. </Para><Para> Bbb.</Para></ResultDiscussion></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
@@ -183,7 +184,7 @@ void comment_to_html_conversion_10();
/// \returns Ccc.
void comment_to_html_conversion_11();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_11:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p> Bbb.</p><p class="para-returns"><span class="word-returns">Returns</span> Ccc.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_11</Name><USR>c:@F@comment_to_html_conversion_11#</USR><Declaration>void comment_to_html_conversion_11()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Ccc.</Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_11:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p> Bbb.</p><div class="result-discussion"><p class="para-returns"><span class="word-returns">Returns</span> Ccc.</p></div>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_11</Name><USR>c:@F@comment_to_html_conversion_11#</USR><Declaration>void comment_to_html_conversion_11()</Declaration><Abstract><Para> Aaa.</Para></Abstract><ResultDiscussion><Para> Ccc.</Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -270,12 +271,29 @@ void comment_to_html_conversion_16(int x1, int x2);
// CHECK-NEXT: (CXComment_Paragraph
// CHECK-NEXT: (CXComment_Text Text=[ Aaa.]))))]
+/// \param x1 Aaa.
+/// \param ... Bbb.
+void comment_to_html_conversion_17(int x1, ...);
+
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_17:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Aaa. </dd><dt class="param-name-index-vararg">...</dt><dd class="param-descr-index-vararg"> Bbb.</dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@F@comment_to_html_conversion_17#I.#</USR><Declaration>void comment_to_html_conversion_17(int x1, ...)</Declaration><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Aaa. </Para></Discussion></Parameter><Parameter><Name>...</Name><IsVarArg /><Direction isExplicit="0">in</Direction><Discussion><Para> Bbb.</Para></Discussion></Parameter></Parameters></Function>]
+// CHECK-NEXT: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[x1] ParamIndex=0
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline)
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)))
+// CHECK-NEXT: (CXComment_ParamCommand in implicitly ParamName=[...] ParamIndex=4294967295
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))] Extent=[276:1 - 276:48]
+
/// \tparam
/// \param aaa Blah blah
template<typename T>
-void comment_to_html_conversion_17(T aaa);
+void comment_to_html_conversion_18(T aaa);
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_17:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">aaa</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_17</Name><USR>c:@FT@&gt;1#Tcomment_to_html_conversion_17#t0.0#</USR><Declaration>template &lt;typename T&gt; void comment_to_html_conversion_17(T aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_18:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">aaa</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_18</Name><USR>c:@FT@&gt;1#Tcomment_to_html_conversion_18#t0.0#</USR><Declaration>template &lt;typename T&gt; void comment_to_html_conversion_18(T aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
@@ -290,9 +308,9 @@ void comment_to_html_conversion_17(T aaa);
/// \tparam T
/// \param aaa Blah blah
template<typename T>
-void comment_to_html_conversion_18(T aaa);
+void comment_to_html_conversion_19(T aaa);
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_18:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">aaa</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_18</Name><USR>c:@FT@&gt;1#Tcomment_to_html_conversion_18#t0.0#</USR><Declaration>template &lt;typename T&gt; void comment_to_html_conversion_18(T aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_19:{{.*}} FullCommentAsHTML=[<dl><dt class="param-name-index-0">aaa</dt><dd class="param-descr-index-0"> Blah blah</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@&gt;1#Tcomment_to_html_conversion_19#t0.0#</USR><Declaration>template &lt;typename T&gt; void comment_to_html_conversion_19(T aaa)</Declaration><Parameters><Parameter><Name>aaa</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Blah blah</Para></Discussion></Parameter></Parameters></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
@@ -307,9 +325,9 @@ void comment_to_html_conversion_18(T aaa);
/// \tparam T2 Bbb
/// \tparam T1 Aaa
template<typename T1, typename T2>
-void comment_to_html_conversion_19(T1 aaa, T2 bbb);
+void comment_to_html_conversion_20(T1 aaa, T2 bbb);
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_19:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">T1</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">T2</dt><dd class="tparam-descr-index-1"> Bbb </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_19</Name><USR>c:@FT@&gt;2#T#Tcomment_to_html_conversion_19#t0.0#t0.1#</USR><Declaration>template &lt;typename T1, typename T2&gt;\nvoid comment_to_html_conversion_19(T1 aaa, T2 bbb)</Declaration><TemplateParameters><Parameter><Name>T1</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>T2</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_20:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">T1</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">T2</dt><dd class="tparam-descr-index-1"> Bbb </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@&gt;2#T#Tcomment_to_html_conversion_20#t0.0#t0.1#</USR><Declaration>template &lt;typename T1, typename T2&gt;\nvoid comment_to_html_conversion_20(T1 aaa, T2 bbb)</Declaration><TemplateParameters><Parameter><Name>T1</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>T2</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter></TemplateParameters></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
@@ -327,9 +345,9 @@ void comment_to_html_conversion_19(T1 aaa, T2 bbb);
/// \tparam V Ccc
/// \tparam T1 Aaa
template<typename T1, typename T2, int V>
-void comment_to_html_conversion_20(T1 aaa, T2 bbb);
+void comment_to_html_conversion_21(T1 aaa, T2 bbb);
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_20:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">T1</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">T2</dt><dd class="tparam-descr-index-1"> Bbb </dd><dt class="tparam-name-index-2">V</dt><dd class="tparam-descr-index-2"> Ccc </dd><dt class="tparam-name-index-invalid">U</dt><dd class="tparam-descr-index-invalid"> Zzz </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_20</Name><USR>c:@FT@&gt;3#T#T#NIcomment_to_html_conversion_20#t0.0#t0.1#</USR><Declaration>template &lt;typename T1, typename T2, int V&gt;\nvoid comment_to_html_conversion_20(T1 aaa, T2 bbb)</Declaration><TemplateParameters><Parameter><Name>T1</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>T2</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>V</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>U</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_21:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">T1</dt><dd class="tparam-descr-index-0"> Aaa</dd><dt class="tparam-name-index-1">T2</dt><dd class="tparam-descr-index-1"> Bbb </dd><dt class="tparam-name-index-2">V</dt><dd class="tparam-descr-index-2"> Ccc </dd><dt class="tparam-name-index-invalid">U</dt><dd class="tparam-descr-index-invalid"> Zzz </dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@&gt;3#T#T#NIcomment_to_html_conversion_21#t0.0#t0.1#</USR><Declaration>template &lt;typename T1, typename T2, int V&gt;\nvoid comment_to_html_conversion_21(T1 aaa, T2 bbb)</Declaration><TemplateParameters><Parameter><Name>T1</Name><Index>0</Index><Discussion><Para> Aaa</Para></Discussion></Parameter><Parameter><Name>T2</Name><Index>1</Index><Discussion><Para> Bbb </Para></Discussion></Parameter><Parameter><Name>V</Name><Index>2</Index><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>U</Name><Discussion><Para> Zzz </Para></Discussion></Parameter></TemplateParameters></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
@@ -355,9 +373,9 @@ void comment_to_html_conversion_20(T1 aaa, T2 bbb);
/// \tparam T Aaa
/// \tparam TT Bbb
template<template<template<typename T> class TT, class C> class TTT>
-void comment_to_html_conversion_21();
+void comment_to_html_conversion_22();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_21:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">TTT</dt><dd class="tparam-descr-index-0"> Ddd </dd><dt class="tparam-name-index-other">C</dt><dd class="tparam-descr-index-other"> Ccc </dd><dt class="tparam-name-index-other">T</dt><dd class="tparam-descr-index-other"> Aaa </dd><dt class="tparam-name-index-other">TT</dt><dd class="tparam-descr-index-other"> Bbb</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_21</Name><USR>c:@FT@&gt;1#t&gt;2#t&gt;1#T#Tcomment_to_html_conversion_21#</USR><Declaration>template &lt;template &lt;template &lt;typename T&gt; class TT, class C&gt; class TTT&gt;\nvoid comment_to_html_conversion_21()</Declaration><TemplateParameters><Parameter><Name>TTT</Name><Index>0</Index><Discussion><Para> Ddd </Para></Discussion></Parameter><Parameter><Name>C</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>T</Name><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>TT</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionTemplate=comment_to_html_conversion_22:{{.*}} FullCommentAsHTML=[<dl><dt class="tparam-name-index-0">TTT</dt><dd class="tparam-descr-index-0"> Ddd </dd><dt class="tparam-name-index-other">C</dt><dd class="tparam-descr-index-other"> Ccc </dd><dt class="tparam-name-index-other">T</dt><dd class="tparam-descr-index-other"> Aaa </dd><dt class="tparam-name-index-other">TT</dt><dd class="tparam-descr-index-other"> Bbb</dd></dl>] FullCommentAsXML=[<Function templateKind="template" file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@FT@&gt;1#t&gt;2#t&gt;1#T#Tcomment_to_html_conversion_22#</USR><Declaration>template &lt;template &lt;template &lt;typename T&gt; class TT, class C&gt; class TTT&gt;\nvoid comment_to_html_conversion_22()</Declaration><TemplateParameters><Parameter><Name>TTT</Name><Index>0</Index><Discussion><Para> Ddd </Para></Discussion></Parameter><Parameter><Name>C</Name><Discussion><Para> Ccc </Para></Discussion></Parameter><Parameter><Name>T</Name><Discussion><Para> Aaa </Para></Discussion></Parameter><Parameter><Name>TT</Name><Discussion><Para> Bbb</Para></Discussion></Parameter></TemplateParameters></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
@@ -385,9 +403,9 @@ void comment_to_html_conversion_21();
/// \param x2 Ddd.
/// \param x1 Ccc.
/// \returns Eee.
-void comment_to_html_conversion_22(int x1, int x2);
+void comment_to_html_conversion_23(int x1, int x2);
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_22:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p> Bbb.</p><dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Ccc. </dd><dt class="param-name-index-1">x2</dt><dd class="param-descr-index-1"> Ddd. </dd></dl><p class="para-returns"><span class="word-returns">Returns</span> Eee.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_22</Name><USR>c:@F@comment_to_html_conversion_22#I#I#</USR><Declaration>void comment_to_html_conversion_22(int x1, int x2)</Declaration><Abstract><Para> Aaa.</Para></Abstract><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Ccc. </Para></Discussion></Parameter><Parameter><Name>x2</Name><Index>1</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Ddd. </Para></Discussion></Parameter></Parameters><ResultDiscussion><Para> Eee.</Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_23:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Aaa.</p><p> Bbb.</p><dl><dt class="param-name-index-0">x1</dt><dd class="param-descr-index-0"> Ccc. </dd><dt class="param-name-index-1">x2</dt><dd class="param-descr-index-1"> Ddd. </dd></dl><div class="result-discussion"><p class="para-returns"><span class="word-returns">Returns</span> Eee.</p></div>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_23</Name><USR>c:@F@comment_to_html_conversion_23#I#I#</USR><Declaration>void comment_to_html_conversion_23(int x1, int x2)</Declaration><Abstract><Para> Aaa.</Para></Abstract><Parameters><Parameter><Name>x1</Name><Index>0</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Ccc. </Para></Discussion></Parameter><Parameter><Name>x2</Name><Index>1</Index><Direction isExplicit="0">in</Direction><Discussion><Para> Ddd. </Para></Discussion></Parameter></Parameters><ResultDiscussion><Para> Eee.</Para></ResultDiscussion><Discussion><Para> Bbb.</Para></Discussion></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
@@ -412,9 +430,9 @@ void comment_to_html_conversion_22(int x1, int x2);
// CHECK-NEXT: (CXComment_Text Text=[ Eee.]))))]
/// <br><a href="http://example.com/">Aaa</a>
-void comment_to_html_conversion_23();
+void comment_to_html_conversion_24();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_23:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <br><a href="http://example.com/">Aaa</a></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_23</Name><USR>c:@F@comment_to_html_conversion_23#</USR><Declaration>void comment_to_html_conversion_23()</Declaration><Abstract><Para> <rawHTML><![CDATA[<br>]]></rawHTML><rawHTML><![CDATA[<a href="http://example.com/">]]></rawHTML>Aaa<rawHTML>&lt;/a&gt;</rawHTML></Para></Abstract></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_24:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <br><a href="http://example.com/">Aaa</a></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_24</Name><USR>c:@F@comment_to_html_conversion_24#</USR><Declaration>void comment_to_html_conversion_24()</Declaration><Abstract><Para> <rawHTML><![CDATA[<br>]]></rawHTML><rawHTML><![CDATA[<a href="http://example.com/">]]></rawHTML>Aaa<rawHTML>&lt;/a&gt;</rawHTML></Para></Abstract></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -428,9 +446,9 @@ void comment_to_html_conversion_23();
/// <a href="http://example.com/">Aaa</a>
/// <a href='http://example.com/'>Aaa</a>
/// \endverbatim
-void comment_to_html_conversion_24();
+void comment_to_html_conversion_25();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_24:{{.*}} FullCommentAsHTML=[<pre> &lt;a href=&quot;http:&#47;&#47;example.com&#47;&quot;&gt;Aaa&lt;&#47;a&gt;\n &lt;a href=&#39;http:&#47;&#47;example.com&#47;&#39;&gt;Aaa&lt;&#47;a&gt;</pre>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_24</Name><USR>c:@F@comment_to_html_conversion_24#</USR><Declaration>void comment_to_html_conversion_24()</Declaration><Discussion><Verbatim xml:space="preserve" kind="verbatim"> &lt;a href=&quot;http://example.com/&quot;&gt;Aaa&lt;/a&gt;\n &lt;a href=&apos;http://example.com/&apos;&gt;Aaa&lt;/a&gt;</Verbatim></Discussion></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_25:{{.*}} FullCommentAsHTML=[<pre> &lt;a href=&quot;http:&#47;&#47;example.com&#47;&quot;&gt;Aaa&lt;&#47;a&gt;\n &lt;a href=&#39;http:&#47;&#47;example.com&#47;&#39;&gt;Aaa&lt;&#47;a&gt;</pre>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_25</Name><USR>c:@F@comment_to_html_conversion_25#</USR><Declaration>void comment_to_html_conversion_25()</Declaration><Discussion><Verbatim xml:space="preserve" kind="verbatim"> &lt;a href=&quot;http://example.com/&quot;&gt;Aaa&lt;/a&gt;\n &lt;a href=&apos;http://example.com/&apos;&gt;Aaa&lt;/a&gt;</Verbatim></Discussion></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
@@ -439,35 +457,63 @@ void comment_to_html_conversion_24();
// CHECK-NEXT: (CXComment_VerbatimBlockLine Text=[ <a href="http://example.com/">Aaa</a>])
// CHECK-NEXT: (CXComment_VerbatimBlockLine Text=[ <a href='http://example.com/'>Aaa</a>])))]
-/// \function foo
-/// \class foo
-/// \method foo
-/// \interface foo
+/// \def foo_def
+/// \fn foo_fn
+/// \namespace foo_namespace
+/// \overload foo_overload
+/// \property foo_property
+/// \typedef foo_typedef
+/// \var foo_var
+/// \function foo_function
+/// \class foo_class
+/// \method foo_method
+/// \interface foo_interface
/// Blah blah.
-void comment_to_html_conversion_25();
+void comment_to_html_conversion_26();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_25:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Blah blah.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_25</Name><USR>c:@F@comment_to_html_conversion_25#</USR><Declaration>void comment_to_html_conversion_25()</Declaration><Abstract><Para> Blah blah.</Para></Abstract></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_26:{{.*}} FullCommentAsHTML=[<p class="para-brief"> Blah blah.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_26</Name><USR>c:@F@comment_to_html_conversion_26#</USR><Declaration>void comment_to_html_conversion_26()</Declaration><Abstract><Para> Blah blah.</Para></Abstract></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
-// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo])
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_def])
+// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_fn])
+// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_namespace])
+// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_overload])
+// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_property])
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
-// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo])
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_typedef])
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
-// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo])
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_var])
// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
-// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo])
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_function])
+// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_class])
+// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_method])
+// CHECK-NEXT: (CXComment_Paragraph IsWhitespace
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_VerbatimLine Text=[ foo_interface])
// CHECK-NEXT: (CXComment_Paragraph
// CHECK-NEXT: (CXComment_Text Text=[ Blah blah.])))]
/// \unknown
-void comment_to_html_conversion_26();
+void comment_to_html_conversion_27();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_26:{{.*}} FullCommentAsHTML=[<p class="para-brief"> </p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_26</Name><USR>c:@F@comment_to_html_conversion_26#</USR><Declaration>void comment_to_html_conversion_26()</Declaration><Abstract><Para> </Para></Abstract></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_27:{{.*}} FullCommentAsHTML=[<p class="para-brief"> </p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_27</Name><USR>c:@F@comment_to_html_conversion_27#</USR><Declaration>void comment_to_html_conversion_27()</Declaration><Abstract><Para> </Para></Abstract></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -475,9 +521,9 @@ void comment_to_html_conversion_26();
// CHECK-NEXT: (CXComment_InlineCommand CommandName=[unknown] RenderNormal)))]
/// \b Aaa
-void comment_to_html_conversion_27();
+void comment_to_html_conversion_28();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_27:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <b>Aaa</b></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_27</Name><USR>c:@F@comment_to_html_conversion_27#</USR><Declaration>void comment_to_html_conversion_27()</Declaration><Abstract><Para> <bold>Aaa</bold></Para></Abstract></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_28:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <b>Aaa</b></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_28</Name><USR>c:@F@comment_to_html_conversion_28#</USR><Declaration>void comment_to_html_conversion_28()</Declaration><Abstract><Para> <bold>Aaa</bold></Para></Abstract></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -485,9 +531,9 @@ void comment_to_html_conversion_27();
// CHECK-NEXT: (CXComment_InlineCommand CommandName=[b] RenderBold Arg[0]=Aaa)))]
/// \c Aaa \p Bbb
-void comment_to_html_conversion_28();
+void comment_to_html_conversion_29();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_28:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <tt>Aaa</tt> <tt>Bbb</tt></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_28</Name><USR>c:@F@comment_to_html_conversion_28#</USR><Declaration>void comment_to_html_conversion_28()</Declaration><Abstract><Para> <monospaced>Aaa</monospaced> <monospaced>Bbb</monospaced></Para></Abstract></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_29:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <tt>Aaa</tt> <tt>Bbb</tt></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_29</Name><USR>c:@F@comment_to_html_conversion_29#</USR><Declaration>void comment_to_html_conversion_29()</Declaration><Abstract><Para> <monospaced>Aaa</monospaced> <monospaced>Bbb</monospaced></Para></Abstract></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -497,9 +543,9 @@ void comment_to_html_conversion_28();
// CHECK-NEXT: (CXComment_InlineCommand CommandName=[p] RenderMonospaced Arg[0]=Bbb)))]
/// \a Aaa \e Bbb \em Ccc
-void comment_to_html_conversion_29();
+void comment_to_html_conversion_30();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_29:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>Aaa</em> <em>Bbb</em> <em>Ccc</em></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_29</Name><USR>c:@F@comment_to_html_conversion_29#</USR><Declaration>void comment_to_html_conversion_29()</Declaration><Abstract><Para> <emphasized>Aaa</emphasized> <emphasized>Bbb</emphasized> <emphasized>Ccc</emphasized></Para></Abstract></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_30:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>Aaa</em> <em>Bbb</em> <em>Ccc</em></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_30</Name><USR>c:@F@comment_to_html_conversion_30#</USR><Declaration>void comment_to_html_conversion_30()</Declaration><Abstract><Para> <emphasized>Aaa</emphasized> <emphasized>Bbb</emphasized> <emphasized>Ccc</emphasized></Para></Abstract></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -511,9 +557,9 @@ void comment_to_html_conversion_29();
// CHECK-NEXT: (CXComment_InlineCommand CommandName=[em] RenderEmphasized Arg[0]=Ccc)))]
/// \a 1<2 \e 3<4 \em 5<6 \param 7<8 aaa \tparam 9<10 bbb
-void comment_to_html_conversion_30();
+void comment_to_html_conversion_31();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_30:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>1&lt;2</em> <em>3&lt;4</em> <em>5&lt;6</em> </p><dl><dt class="tparam-name-index-invalid">9&lt;10</dt><dd class="tparam-descr-index-invalid"> bbb</dd></dl><dl><dt class="param-name-index-invalid">7&lt;8</dt><dd class="param-descr-index-invalid"> aaa </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_30</Name><USR>c:@F@comment_to_html_conversion_30#</USR><Declaration>void comment_to_html_conversion_30()</Declaration><Abstract><Para> <emphasized>1&lt;2</emphasized> <emphasized>3&lt;4</emphasized> <emphasized>5&lt;6</emphasized> </Para></Abstract><TemplateParameters><Parameter><Name>9&lt;10</Name><Discussion><Para> bbb</Para></Discussion></Parameter></TemplateParameters><Parameters><Parameter><Name>7&lt;8</Name><Direction isExplicit="0">in</Direction><Discussion><Para> aaa </Para></Discussion></Parameter></Parameters></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_31:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>1&lt;2</em> <em>3&lt;4</em> <em>5&lt;6</em> </p><dl><dt class="tparam-name-index-invalid">9&lt;10</dt><dd class="tparam-descr-index-invalid"> bbb</dd></dl><dl><dt class="param-name-index-invalid">7&lt;8</dt><dd class="param-descr-index-invalid"> aaa </dd></dl>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_31</Name><USR>c:@F@comment_to_html_conversion_31#</USR><Declaration>void comment_to_html_conversion_31()</Declaration><Abstract><Para> <emphasized>1&lt;2</emphasized> <emphasized>3&lt;4</emphasized> <emphasized>5&lt;6</emphasized> </Para></Abstract><TemplateParameters><Parameter><Name>9&lt;10</Name><Discussion><Para> bbb</Para></Discussion></Parameter></TemplateParameters><Parameters><Parameter><Name>7&lt;8</Name><Direction isExplicit="0">in</Direction><Discussion><Para> aaa </Para></Discussion></Parameter></Parameters></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -532,9 +578,9 @@ void comment_to_html_conversion_30();
// CHECK-NEXT: (CXComment_Text Text=[ bbb]))))]
/// \\ \@ \& \$ \# \< \> \% \" \. \::
-void comment_to_html_conversion_31();
+void comment_to_html_conversion_32();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_31:{{.*}} FullCommentAsHTML=[<p class="para-brief"> \ @ &amp; $ # &lt; &gt; % &quot; . ::</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_31</Name><USR>c:@F@comment_to_html_conversion_31#</USR><Declaration>void comment_to_html_conversion_31()</Declaration><Abstract><Para> \ @ &amp; $ # &lt; &gt; % &quot; . ::</Para></Abstract></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_32:{{.*}} FullCommentAsHTML=[<p class="para-brief"> \ @ &amp; $ # &lt; &gt; % &quot; . ::</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_32</Name><USR>c:@F@comment_to_html_conversion_32#</USR><Declaration>void comment_to_html_conversion_32()</Declaration><Abstract><Para> \ @ &amp; $ # &lt; &gt; % &quot; . ::</Para></Abstract></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -562,9 +608,9 @@ void comment_to_html_conversion_31();
// CHECK-NEXT: (CXComment_Text Text=[::])))]
/// &amp; &lt; &gt; &quot; &apos; &#109;&#101;&#111;&#119; &#x6d;&#x65;&#x6F;&#X77;
-void comment_to_html_conversion_32();
+void comment_to_html_conversion_33();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_32:{{.*}} FullCommentAsHTML=[<p class="para-brief"> &amp; &lt; &gt; &quot; &#39; meow meow</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_32</Name><USR>c:@F@comment_to_html_conversion_32#</USR><Declaration>void comment_to_html_conversion_32()</Declaration><Abstract><Para> &amp; &lt; &gt; &quot; &apos; meow meow</Para></Abstract></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_33:{{.*}} FullCommentAsHTML=[<p class="para-brief"> &amp; &lt; &gt; &quot; &#39; meow meow</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_33</Name><USR>c:@F@comment_to_html_conversion_33#</USR><Declaration>void comment_to_html_conversion_33()</Declaration><Abstract><Para> &amp; &lt; &gt; &quot; &apos; meow meow</Para></Abstract></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -590,9 +636,9 @@ void comment_to_html_conversion_32();
// CHECK-NEXT: (CXComment_Text Text=[w])))]
/// <em>0&lt;i</em>
-void comment_to_html_conversion_33();
+void comment_to_html_conversion_34();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_33:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>0&lt;i</em></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_33</Name><USR>c:@F@comment_to_html_conversion_33#</USR><Declaration>void comment_to_html_conversion_33()</Declaration><Abstract><Para> <rawHTML><![CDATA[<em>]]></rawHTML>0&lt;i<rawHTML>&lt;/em&gt;</rawHTML></Para></Abstract></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_34:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <em>0&lt;i</em></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_34</Name><USR>c:@F@comment_to_html_conversion_34#</USR><Declaration>void comment_to_html_conversion_34()</Declaration><Abstract><Para> <rawHTML><![CDATA[<em>]]></rawHTML>0&lt;i<rawHTML>&lt;/em&gt;</rawHTML></Para></Abstract></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -610,9 +656,9 @@ void comment_to_html_conversion_33();
/// &nbsp; a non breakable space.
/// &Delta; Greek letter Delta Δ.
/// &Gamma; Greek letter Gamma Γ.
-void comment_to_html_conversion_34();
+void comment_to_html_conversion_35();
-// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_34:{{.*}} FullCommentAsHTML=[<p class="para-brief"> © the copyright symbol ™ the trade mark symbol ® the registered trade mark symbol   a non breakable space. Δ Greek letter Delta Δ. Γ Greek letter Gamma Γ.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_34</Name><USR>c:@F@comment_to_html_conversion_34#</USR><Declaration>void comment_to_html_conversion_34()</Declaration><Abstract><Para> © the copyright symbol ™ the trade mark symbol ® the registered trade mark symbol   a non breakable space. Δ Greek letter Delta Δ. Γ Greek letter Gamma Γ.</Para></Abstract></Function>]
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_35:{{.*}} FullCommentAsHTML=[<p class="para-brief"> © the copyright symbol ™ the trade mark symbol ® the registered trade mark symbol   a non breakable space. Δ Greek letter Delta Δ. Γ Greek letter Gamma Γ.</p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_35</Name><USR>c:@F@comment_to_html_conversion_35#</USR><Declaration>void comment_to_html_conversion_35()</Declaration><Abstract><Para> © the copyright symbol ™ the trade mark symbol ® the registered trade mark symbol   a non breakable space. Δ Greek letter Delta Δ. Γ Greek letter Gamma Γ.</Para></Abstract></Function>]
// CHECK-NEXT: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
// CHECK-NEXT: (CXComment_Paragraph
@@ -767,6 +813,57 @@ enum class comment_to_xml_conversion_17 {
// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:3: EnumConstantDecl=comment_to_xml_conversion_18:{{.*}} FullCommentAsXML=[<Variable file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="3"><Name>comment_to_xml_conversion_18</Name><USR>c:@E@comment_to_xml_conversion_17@comment_to_xml_conversion_18</USR><Declaration>comment_to_xml_conversion_18</Declaration><Abstract><Para> Aaa.</Para></Abstract></Variable>]
};
+//===---
+// Check that we attach comments from the base class to derived classes if they don't have a comment.
+// rdar://13647476
+//===---
+
+/// BaseToSuper1_Base
+class BaseToSuper1_Base {};
+
+class BaseToSuper1_Derived : public BaseToSuper1_Base {};
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:7: ClassDecl=BaseToSuper1_Derived:{{.*}} FullCommentAsXML=[<Class file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="7"><Name>BaseToSuper1_Base</Name><USR>c:@C@BaseToSuper1_Base</USR><Declaration>class BaseToSuper1_Derived : public BaseToSuper1_Base {}</Declaration><Abstract><Para> BaseToSuper1_Base</Para></Abstract></Class>]
+
+
+/// BaseToSuper2_Base
+class BaseToSuper2_Base {};
+
+/// BaseToSuper2_Derived
+class BaseToSuper2_Derived : public BaseToSuper2_Base {};
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:7: ClassDecl=BaseToSuper2_Derived:{{.*}} FullCommentAsXML=[<Class file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="7"><Name>BaseToSuper2_Derived</Name><USR>c:@C@BaseToSuper2_Derived</USR><Declaration>class BaseToSuper2_Derived : public BaseToSuper2_Base {}</Declaration><Abstract><Para> BaseToSuper2_Derived</Para></Abstract></Class>]
+
+class BaseToSuper2_MoreDerived : public BaseToSuper2_Derived {};
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:7: ClassDecl=BaseToSuper2_MoreDerived:{{.*}} FullCommentAsXML=[<Class file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="7"><Name>BaseToSuper2_Derived</Name><USR>c:@C@BaseToSuper2_Derived</USR><Declaration>class BaseToSuper2_MoreDerived : public BaseToSuper2_Derived {}</Declaration><Abstract><Para> BaseToSuper2_Derived</Para></Abstract></Class>]
+
+
+/// BaseToSuper3_Base
+class BaseToSuper3_Base {};
+
+class BaseToSuper3_DerivedA : public virtual BaseToSuper3_Base {};
+
+class BaseToSuper3_DerivedB : public virtual BaseToSuper3_Base {};
+
+class BaseToSuper3_MoreDerived : public BaseToSuper3_DerivedA, public BaseToSuper3_DerivedB {};
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:7: ClassDecl=BaseToSuper3_MoreDerived:{{.*}} FullCommentAsXML=[<Class file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="7"><Name>BaseToSuper3_Base</Name><USR>c:@C@BaseToSuper3_Base</USR><Declaration>class BaseToSuper3_MoreDerived : public BaseToSuper3_DerivedA,\n public BaseToSuper3_DerivedB {}</Declaration><Abstract><Para> BaseToSuper3_Base</Para></Abstract></Class>]
+
+
+// Check that we propagate comments only through public inheritance.
+
+/// BaseToSuper4_Base
+class BaseToSuper4_Base {};
+
+/// BaseToSuper4_DerivedA
+class BaseToSuper4_DerivedA : virtual BaseToSuper4_Base {};
+
+class BaseToSuper4_DerivedB : public virtual BaseToSuper4_Base {};
+
+class BaseToSuper4_MoreDerived : BaseToSuper4_DerivedA, public BaseToSuper4_DerivedB {};
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:7: ClassDecl=BaseToSuper4_MoreDerived:{{.*}} FullCommentAsXML=[<Class file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="7"><Name>BaseToSuper4_Base</Name><USR>c:@C@BaseToSuper4_Base</USR><Declaration>class BaseToSuper4_MoreDerived : BaseToSuper4_DerivedA,\n public BaseToSuper4_DerivedB {}</Declaration><Abstract><Para> BaseToSuper4_Base</Para></Abstract></Class>]
+
+//===---
+// Check the representation of \todo in XML.
+//===---
+
/// Aaa.
/// \todo Bbb.
void comment_to_xml_conversion_todo_1();
@@ -793,5 +890,102 @@ void comment_to_xml_conversion_todo_3();
void comment_to_xml_conversion_todo_4();
// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: FunctionDecl=comment_to_xml_conversion_todo_4:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_todo_4</Name><USR>c:@F@comment_to_xml_conversion_todo_4#</USR><Declaration>void comment_to_xml_conversion_todo_4()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Discussion><Para kind="todo"> Bbb. </Para><Para kind="todo"> Ccc.</Para></Discussion></Function>]
+
+//===---
+// Test the representation of exception specifications in AST and XML.
+//===---
+
+/// Aaa.
+/// \throws Bbb.
+void comment_to_xml_conversion_exceptions_1();
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: FunctionDecl=comment_to_xml_conversion_exceptions_1:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_exceptions_1</Name><USR>c:@F@comment_to_xml_conversion_exceptions_1#</USR><Declaration>void comment_to_xml_conversion_exceptions_1()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Exceptions><Para> Bbb.</Para></Exceptions></Function>]
+// CHECK-NEXT: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline)
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_BlockCommand CommandName=[throws]
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))]
+
+/// Aaa.
+/// \throw Bbb.
+void comment_to_xml_conversion_exceptions_2();
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: FunctionDecl=comment_to_xml_conversion_exceptions_2:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_exceptions_2</Name><USR>c:@F@comment_to_xml_conversion_exceptions_2#</USR><Declaration>void comment_to_xml_conversion_exceptions_2()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Exceptions><Para> Bbb.</Para></Exceptions></Function>]
+// CHECK-NEXT: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline)
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_BlockCommand CommandName=[throw]
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))]
+
+/// Aaa.
+/// \exception Bbb.
+void comment_to_xml_conversion_exceptions_3();
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: FunctionDecl=comment_to_xml_conversion_exceptions_3:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_exceptions_3</Name><USR>c:@F@comment_to_xml_conversion_exceptions_3#</USR><Declaration>void comment_to_xml_conversion_exceptions_3()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Exceptions><Para> Bbb.</Para></Exceptions></Function>]
+// CHECK-NEXT: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline)
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_BlockCommand CommandName=[exception]
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Bbb.]))))]
+
+/// Aaa.
+/// \throws Bbb.
+/// \throws Ccc.
+/// \throws Ddd.
+void comment_to_xml_conversion_exceptions_4();
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: FunctionDecl=comment_to_xml_conversion_exceptions_4:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_exceptions_4</Name><USR>c:@F@comment_to_xml_conversion_exceptions_4#</USR><Declaration>void comment_to_xml_conversion_exceptions_4()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Exceptions><Para> Bbb. </Para><Para> Ccc. </Para><Para> Ddd.</Para></Exceptions></Function>]
+// CHECK-NEXT: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline)
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_BlockCommand CommandName=[throws]
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Bbb.] HasTrailingNewline)
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)))
+// CHECK-NEXT: (CXComment_BlockCommand CommandName=[throws]
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Ccc.] HasTrailingNewline)
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)))
+// CHECK-NEXT: (CXComment_BlockCommand CommandName=[throws]
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Ddd.]))))]
+
+/// Aaa.
+/// \throws Bbb.
+/// \throw Ccc.
+void comment_to_xml_conversion_exceptions_5();
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:6: FunctionDecl=comment_to_xml_conversion_exceptions_5:{{.*}} FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-1]]" column="6"><Name>comment_to_xml_conversion_exceptions_5</Name><USR>c:@F@comment_to_xml_conversion_exceptions_5#</USR><Declaration>void comment_to_xml_conversion_exceptions_5()</Declaration><Abstract><Para> Aaa. </Para></Abstract><Exceptions><Para> Bbb. </Para><Para> Ccc.</Para></Exceptions></Function>]
+// CHECK-NEXT: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Aaa.] HasTrailingNewline)
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace))
+// CHECK-NEXT: (CXComment_BlockCommand CommandName=[throws]
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Bbb.] HasTrailingNewline)
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)))
+// CHECK-NEXT: (CXComment_BlockCommand CommandName=[throw]
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ Ccc.]))))]
+
+
+// rdar://14348912
+#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
+
+/**! Documentation comment */
+typedef NS_ENUM(int, Color) { Red, Green, Blue };
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-1]]:22: TypedefDecl=Color:[[@LINE-1]]:22
+// CHECK-NEXT: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[! Documentation comment ])))]
+
#endif
diff --git a/test/Index/comment-unqualified-objc-pointer.m b/test/Index/comment-unqualified-objc-pointer.m
index 546d4fa9f077..e9e1ceee236b 100644
--- a/test/Index/comment-unqualified-objc-pointer.m
+++ b/test/Index/comment-unqualified-objc-pointer.m
@@ -1,6 +1,6 @@
// RUN: rm -rf %t
// RUN: mkdir %t
-// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 -fobjc-default-synthesize-properties -fobjc-arc %s > %t/out
+// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 -fobjc-arc %s > %t/out
// RUN: FileCheck %s < %t/out
// rdar://13757500
diff --git a/test/Index/comment-xml-schema.c b/test/Index/comment-xml-schema.c
index b8560f7e279b..2bbdfcfe9999 100644
--- a/test/Index/comment-xml-schema.c
+++ b/test/Index/comment-xml-schema.c
@@ -33,21 +33,22 @@
//
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-para-kind-01.xml
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-01.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-02.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-03.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-04.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-05.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-06.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-07.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-08.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-09.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-10.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-11.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-12.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-//
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-para-kind-01.xml 2>&1 | FileCheck %s -check-prefix=INVALID
-// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-para-kind-02.xml 2>&1 | FileCheck %s -check-prefix=INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-01.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-02.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-03.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-04.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-05.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-06.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-07.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-08.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-09.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-10.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-11.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-12.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-function-13.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+//
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-para-kind-01.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
+// RUN: not xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/invalid-para-kind-02.xml 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID
// CHECK-INVALID: fails to validate
diff --git a/test/Index/complete-documentation-properties.m b/test/Index/complete-documentation-properties.m
index 774a02021e74..21ddf805a9c0 100644
--- a/test/Index/complete-documentation-properties.m
+++ b/test/Index/complete-documentation-properties.m
@@ -53,22 +53,22 @@
return 0;
}
@end
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:47:16 %s | FileCheck -check-prefix=CC1 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:47:16 %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is ReadonlyProperty)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:48:13 %s | FileCheck -check-prefix=CC2 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:48:13 %s | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:49:13 %s | FileCheck -check-prefix=CC3 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:49:13 %s | FileCheck -check-prefix=CHECK-CC3 %s
// CHECK-CC3: {TypedText PropertyInPrimaryClass}{{.*}}(brief comment: This is PropertyInPrimaryClass)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:50:13 %s | FileCheck -check-prefix=CC4 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:50:13 %s | FileCheck -check-prefix=CHECK-CC4 %s
// CHECK-CC4: {TypedText Record}{{.*}}(brief comment: This is Record)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:51:9 %s | FileCheck -check-prefix=CC5 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:51:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
// CHECK-CC5: {TypedText setThisRecord:}{Placeholder (id)}{{.*}}(brief comment: This is Record)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:52:12 %s | FileCheck -check-prefix=CC6 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:52:12 %s | FileCheck -check-prefix=CHECK-CC6 %s
// CHECK-CC6: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension)
@interface AnotherAppDelegate
@@ -87,6 +87,6 @@
self.ReadonlyGetter;
}
@end
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:87:6 %s | FileCheck -check-prefix=CC7 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:87:6 %s | FileCheck -check-prefix=CHECK-CC7 %s
// CHECK-CC7: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is getter = ReadonlyGetter)
diff --git a/test/Index/complete-documentation-templates.cpp b/test/Index/complete-documentation-templates.cpp
index 4cb826e1d5aa..ca24bc374d6a 100644
--- a/test/Index/complete-documentation-templates.cpp
+++ b/test/Index/complete-documentation-templates.cpp
@@ -105,20 +105,20 @@ void test_CC5_CC6_CC7() {
T100<int, long>::T105 t105;
}
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:17:1 %s | FileCheck -check-prefix=CC1 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:17:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: FunctionTemplate:{ResultType void}{TypedText T1}{{.*}}(brief comment: This is T1.)
// CHECK-CC1: FunctionTemplate:{ResultType void}{TypedText T2}{{.*}}(brief comment: This is T2.)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:56:12 %s | FileCheck -check-prefix=CC2 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:56:12 %s | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: CXXMethod:{ResultType void}{TypedText T4}{{.*}}(brief comment: This is T4.)
// CHECK-CC2: VarDecl:{ResultType int}{TypedText T5}{{.*}}(brief comment: This is T5.)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:58:6 %s | FileCheck -check-prefix=CC3 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:58:6 %s | FileCheck -check-prefix=CHECK-CC3 %s
// CHECK-CC3: FunctionTemplate:{ResultType void}{TypedText T11}{{.*}}(brief comment: This is T11.)
// CHECK-CC3: CXXMethod:{ResultType void}{TypedText T6}{{.*}}(brief comment: This is T6.)
// CHECK-CC3: FieldDecl:{ResultType int}{TypedText T7}{{.*}}(brief comment: This is T7.)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:59:12 %s | FileCheck -check-prefix=CC4 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:59:12 %s | FileCheck -check-prefix=CHECK-CC4 %s
// CHECK-CC4: EnumConstantDecl:{ResultType T3<int>::T9}{TypedText T10}{{.*}}(brief comment: This is T10.)
// FIXME: after we implement propagating comments through typedefs, this
// typedef for implicit instantiation should pick up the documentation
@@ -128,16 +128,16 @@ void test_CC5_CC6_CC7() {
// CHECK-CC4: ClassDecl:{TypedText T8}{{.*}}(brief comment: This is T8.)
// CHECK-CC4: EnumDecl:{TypedText T9}{{.*}}(brief comment: This is T9.)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:102:20 %s | FileCheck -check-prefix=CC5 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:102:20 %s | FileCheck -check-prefix=CHECK-CC5 %s
// CHECK-CC5: CXXMethod:{ResultType void}{TypedText T101}{{.*}}(brief comment: This is T101.)
// CHECK-CC5: VarDecl:{ResultType int}{TypedText T102}{{.*}}(brief comment: This is T102.)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:104:8 %s | FileCheck -check-prefix=CC6 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:104:8 %s | FileCheck -check-prefix=CHECK-CC6 %s
// CHECK-CC6: CXXMethod:{ResultType void}{TypedText T103}{{.*}}(brief comment: This is T103.)
// CHECK-CC6: FieldDecl:{ResultType int}{TypedText T104}{{.*}}(brief comment: This is T104.)
// CHECK-CC6: FunctionTemplate:{ResultType void}{TypedText T108}{{.*}}(brief comment: This is T108.)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:105:20 %s | FileCheck -check-prefix=CC7 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:105:20 %s | FileCheck -check-prefix=CHECK-CC7 %s
// CHECK-CC7: ClassDecl:{TypedText T105}{{.*}}(brief comment: This is T105.)
// CHECK-CC7: EnumDecl:{TypedText T106}{{.*}}(brief comment: This is T106.)
// CHECK-CC7: EnumConstantDecl:{ResultType T100<int, long>::T106}{TypedText T107}{{.*}}(brief comment: This is T107.)
diff --git a/test/Index/complete-documentation.cpp b/test/Index/complete-documentation.cpp
index 49b61f03ce6c..553660a124f8 100644
--- a/test/Index/complete-documentation.cpp
+++ b/test/Index/complete-documentation.cpp
@@ -37,15 +37,15 @@ void test1() {
t6.T8();
}
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:32:1 %s | FileCheck -check-prefix=CC1 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:32:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText T1}{{.*}}(brief comment: Aaa.)
// CHECK-CC1: ClassDecl:{TypedText T2}{{.*}}(brief comment: Bbb.)
// CHECK-CC1: Namespace:{TypedText T5}{{.*}}(brief comment: Eee.)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:34:6 %s | FileCheck -check-prefix=CC2 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:34:6 %s | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: CXXMethod:{ResultType void}{TypedText T3}{{.*}}(brief comment: Ccc.)
// CHECK-CC2: FieldDecl:{ResultType int}{TypedText T4}{{.*}}(brief comment: Ddd.)
-// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:37:6 %s | FileCheck -check-prefix=CC3 %s
+// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:37:6 %s | FileCheck -check-prefix=CHECK-CC3 %s
// CHECK-CC3: CXXMethod:{ResultType void}{TypedText T7}{LeftParen (}{RightParen )} (34)(brief comment: Fff.)
// CHECK-CC3: CXXMethod:{ResultType void}{TypedText T8}{LeftParen (}{RightParen )} (34)(brief comment: Ggg.)
diff --git a/test/Index/complete-modules.m b/test/Index/complete-modules.m
index d63c4b89566c..175cf3db2c7f 100644
--- a/test/Index/complete-modules.m
+++ b/test/Index/complete-modules.m
@@ -5,12 +5,12 @@
// RUN: rm -rf %t
// RUN: c-index-test -code-completion-at=%s:4:9 -fmodules-cache-path=%t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-TOP-LEVEL %s
-// CHECK-TOP-LEVEL: NotImplemented:{TypedText Framework} (50)
-// CHECK-TOP-LEVEL: NotImplemented:{TypedText LibA} (50)
-// CHECK-TOP-LEVEL: NotImplemented:{TypedText nested} (50)
+// CHECK-TOP-LEVEL: ModuleImport:{TypedText Framework} (50)
+// CHECK-TOP-LEVEL: ModuleImport:{TypedText LibA} (50)
+// CHECK-TOP-LEVEL: ModuleImport:{TypedText nested} (50)
// RUN: c-index-test -code-completion-at=%s:4:14 -fmodules-cache-path=%t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-LIBA %s
-// CHECK-LIBA: NotImplemented:{TypedText Extensions} (50)
+// CHECK-LIBA: ModuleImport:{TypedText Extensions} (50)
// RUN: c-index-test -code-completion-at=%s:4:1 -fmodules-cache-path=%t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-TOP %s
// CHECK-TOP: NotImplemented:{TypedText @import}{HorizontalSpace }{Placeholder module} (40)
diff --git a/test/Index/complete-pch.m b/test/Index/complete-pch.m
index 517d49c6351e..4c29f2796b5c 100644
--- a/test/Index/complete-pch.m
+++ b/test/Index/complete-pch.m
@@ -11,6 +11,8 @@ void msg_id(id x) {
[x instanceMethod1:5];
}
+// REQUIRES: native
+
// Build the precompiled header
// RUN: %clang -x objective-c-header -o %t.h.pch %S/Inputs/complete-pch.h
diff --git a/test/Index/complete-preamble.cpp b/test/Index/complete-preamble.cpp
index 61fb90a9db96..c57c88ab330a 100644
--- a/test/Index/complete-preamble.cpp
+++ b/test/Index/complete-preamble.cpp
@@ -3,6 +3,6 @@ void f() {
std::
}
-// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:3:8 %s -o - | FileCheck -check-prefix=CC1 %s
+// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:3:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: {ResultType void}{TypedText wibble}{LeftParen (}{RightParen )} (50)
diff --git a/test/Index/complete-qualified.cpp b/test/Index/complete-qualified.cpp
index 38a678af2422..a17ea25370c7 100644
--- a/test/Index/complete-qualified.cpp
+++ b/test/Index/complete-qualified.cpp
@@ -13,7 +13,7 @@ void foo()
{
Foo::
-// RUN: c-index-test -code-completion-at=%s:14:8 %s -o - | FileCheck -check-prefix=CC1 %s
+// RUN: c-index-test -code-completion-at=%s:14:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: FieldDecl:{ResultType C<Foo, class Bar>}{TypedText c} (35)
// CHECK-CC1: ClassDecl:{TypedText Foo} (35)
// CHECK-CC1: CXXMethod:{ResultType Foo &}{TypedText operator=}{LeftParen (}{Placeholder const Foo &}{RightParen )}
diff --git a/test/Index/crash-recovery-modules.m b/test/Index/crash-recovery-modules.m
index 23740ec98b3f..431c23f7dcad 100644
--- a/test/Index/crash-recovery-modules.m
+++ b/test/Index/crash-recovery-modules.m
@@ -15,6 +15,21 @@
@import Crash;
+#ifdef LIBCLANG_CRASH
+#pragma clang __debug crash
+#endif
+
void test() {
const char* error = getCrashString();
}
+
+
+// RUN: rm -rf %t
+// Check that libclang crash-recovery works; both with a module building crash...
+// RUN: not env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodules-cache-path=%t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DCRASH -DLIBCLANG_CRASH %s 2> %t.err
+// RUN: FileCheck < %t.err -check-prefix=CHECK-LIBCLANG-CRASH %s
+// ...and with module building successful.
+// RUN: not env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodules-cache-path=%t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DLIBCLANG_CRASH %s 2> %t.err
+// RUN: FileCheck < %t.err -check-prefix=CHECK-LIBCLANG-CRASH %s
+// CHECK-LIBCLANG-CRASH: libclang: crash detected during parsing
+// CHECK-LIBCLANG-CRASH: Unable to load translation unit!
diff --git a/test/Index/create-tu-fail.c b/test/Index/create-tu-fail.c
index f259cca50ff4..de3250173a3f 100644
--- a/test/Index/create-tu-fail.c
+++ b/test/Index/create-tu-fail.c
@@ -2,7 +2,7 @@
// RUN: touch %t.c
// RUN: c-index-test -write-pch %t.pch %t.c
// RUN: cp %s %t.c
-// RUN: c-index-test -test-load-tu %t.pch local 2>&1 | FileCheck %s
+// RUN: not c-index-test -test-load-tu %t.pch local 2>&1 | FileCheck %s
// rdar://11558355
// Unfortunately this would crash reliably only via valgrind.
diff --git a/test/Index/error-on-deserialized.c b/test/Index/error-on-deserialized.c
index 8ba828328e7a..bf0d59a05880 100644
--- a/test/Index/error-on-deserialized.c
+++ b/test/Index/error-on-deserialized.c
@@ -6,7 +6,7 @@
// RUN: c-index-test -write-pch %t.h.pch %S/targeted-top.h
// RUN: env CINDEXTEST_FAILONERROR=1 not c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \
// RUN: -Xclang -error-on-deserialized-decl=NestedVar1
-// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \
+// RUN: env CINDEXTEST_FAILONERROR=1 not c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \
// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 2>&1 \
// RUN: | FileCheck %s
diff --git a/test/Index/file-includes.c b/test/Index/file-includes.c
index 2dfced0c0c4f..ac3d568dc53d 100644
--- a/test/Index/file-includes.c
+++ b/test/Index/file-includes.c
@@ -22,3 +22,6 @@ int LocalVar;
// TOP: inclusion directive=targeted-nested1.h ({{.*[/\\]}}test{{[/\\]}}Index{{[/\\]}}targeted-nested1.h) =[5:1 - 5:2]
// TOP: inclusion directive=targeted-fields.h ({{.*[/\\]}}test{{[/\\]}}Index{{[/\\]}}targeted-fields.h) =[16:1 - 16:2]
+
+// rdar://13803893
+// RUN: c-index-test -file-includes-in=%S/Inputs/empty.h %S/Inputs/empty.h
diff --git a/test/Index/get-cursor.m b/test/Index/get-cursor.m
index 7eaa3a0a3c1e..f659fb1ff61c 100644
--- a/test/Index/get-cursor.m
+++ b/test/Index/get-cursor.m
@@ -99,6 +99,20 @@ void foo3(Test3 *test3) {
@synthesize prop1 = _prop1;
@end
+@protocol TestProt
+-(void)protMeth1;
+@property (retain) id propProp1;
+
+@optional
+-(void)protMeth2;
+@property (retain) id propProp2;
+
+@required
+-(void)protMeth3;
+@property (retain) id propProp3;
+@end
+
+
// RUN: c-index-test -cursor-at=%s:4:28 -cursor-at=%s:5:28 %s | FileCheck -check-prefix=CHECK-PROP %s
// CHECK-PROP: ObjCPropertyDecl=foo1:4:26
// CHECK-PROP: ObjCPropertyDecl=foo2:5:27
@@ -146,3 +160,13 @@ void foo3(Test3 *test3) {
// RUN: c-index-test -cursor-at=%s:86:7 -cursor-at=%s:89:7 %s | FileCheck -check-prefix=CHECK-SELECTORLOC %s
// CHECK-SELECTORLOC: 86:6 ObjCInstanceMethodDecl=meth1:86:6 (Definition) Extent=[86:1 - 88:2] Spelling=meth1 ([86:6 - 86:11]) Selector index=0
// CHECK-SELECTORLOC: 89:6 ObjCInstanceMethodDecl=meth2:89:6 (Definition) Extent=[89:1 - 91:2] Spelling=meth2 ([89:6 - 89:11]) Selector index=0
+
+// RUN: c-index-test -cursor-at=%s:103:10 -cursor-at=%s:104:10 \
+// RUN: -cursor-at=%s:107:10 -cursor-at=%s:108:10 \
+// RUN: -cursor-at=%s:111:10 -cursor-at=%s:112:10 %s | FileCheck -check-prefix=CHECK-OBJCOPTIONAL %s
+// CHECK-OBJCOPTIONAL: 103:8 ObjCInstanceMethodDecl=protMeth1:103:8 Extent=[103:1 - 103:18]
+// CHECK-OBJCOPTIONAL: 104:23 ObjCPropertyDecl=propProp1:104:23 [retain,] Extent=[104:1 - 104:32]
+// CHECK-OBJCOPTIONAL: 107:8 ObjCInstanceMethodDecl=protMeth2:107:8 (@optional) Extent=[107:1 - 107:18]
+// CHECK-OBJCOPTIONAL: 108:23 ObjCPropertyDecl=propProp2:108:23 (@optional) [retain,] Extent=[108:1 - 108:32]
+// CHECK-OBJCOPTIONAL: 111:8 ObjCInstanceMethodDecl=protMeth3:111:8 Extent=[111:1 - 111:18]
+// CHECK-OBJCOPTIONAL: 112:23 ObjCPropertyDecl=propProp3:112:23 [retain,] Extent=[112:1 - 112:32]
diff --git a/test/Index/index-decls.m b/test/Index/index-decls.m
index c6b14bb8fda5..a405abc78c88 100644
--- a/test/Index/index-decls.m
+++ b/test/Index/index-decls.m
@@ -33,6 +33,21 @@ int test1() {
return extfn();
}
+@interface I4
+@property (assign, nonatomic) id prop;
+-(id)prop;
+-(void)setProp:(id)p;
+@end
+
+@implementation I4
+@synthesize prop = _prop;
+-(id)prop {
+ return 0;
+}
+-(void)setProp:(id)p {
+}
+@end
+
// RUN: c-index-test -index-file %s -target x86_64-apple-macosx10.7 > %t
// RUN: FileCheck %s -input-file=%t
// CHECK: [indexDeclaration]: kind: objc-class | name: I | {{.*}} | loc: 1:12
@@ -54,3 +69,7 @@ int test1() {
// CHECK: [indexEntityReference]: kind: variable | name: extvar | {{.*}} | loc: 31:3
// CHECK: [indexDeclaration]: kind: function | name: extfn | {{.*}} | loc: 32:14
// CHECK: [indexEntityReference]: kind: function | name: extfn | {{.*}} | loc: 33:10
+
+// CHECK: [indexDeclaration]: kind: objc-class | name: I4 | {{.*}} | loc: 36:12
+// CHECK-NOT: [indexDeclaration]: kind: objc-instance-method {{.*}} loc: 37:
+// CHECK-NOT: [indexDeclaration]: kind: objc-instance-method {{.*}} loc: 43:
diff --git a/test/Index/index-file.cpp b/test/Index/index-file.cpp
index 7634c0db863f..37b14a2715a9 100644
--- a/test/Index/index-file.cpp
+++ b/test/Index/index-file.cpp
@@ -4,7 +4,20 @@ extern "C" {
template < typename T > *Allocate() { }
}
+// rdar://14063074
+namespace rdar14063074 {
+template <typename T>
+struct TS {};
+struct TS<int> {};
+
+template <typename T>
+void tfoo() {}
+void tfoo<int>() {}
+}
+
// RUN: c-index-test -index-file %s > %t
// RUN: FileCheck %s -input-file=%t
// CHECK: [indexDeclaration]: kind: type-alias | name: MyTypeAlias | {{.*}} | loc: 1:7
+// CHECK: [indexDeclaration]: kind: struct-template-spec | name: TS | {{.*}} | loc: 11:8
+// CHECK: [indexDeclaration]: kind: function-template-spec | name: tfoo | {{.*}} | loc: 15:6
diff --git a/test/Index/index-module.m b/test/Index/index-module.m
index 77dee98b4ac8..d6953136d863 100644
--- a/test/Index/index-module.m
+++ b/test/Index/index-module.m
@@ -21,11 +21,13 @@ int glob;
// CHECK-DMOD-NEXT: [ppIncludedFile]: [[DMOD_MODULE_H:.*/Modules/Inputs/DependsOnModule\.framework[/\\]Headers[/\\]DependsOnModule\.h]] | {{.*}} | hash loc: <invalid>
// CHECK-DMOD-NEXT: [ppIncludedFile]: {{.*}}/Modules/Inputs/Module.framework{{[/\\]}}Headers{{[/\\]}}Module.h | name: "Module/Module.h" | hash loc: {{.*}}/Modules/Inputs/DependsOnModule.framework{{[/\\]}}Headers{{[/\\]}}DependsOnModule.h:1:1 | isImport: 0 | isAngled: 1 | isModule: 1
// CHECK-DMOD-NEXT: [ppIncludedFile]: [[DMOD_OTHER_H:.*/Modules/Inputs/DependsOnModule\.framework[/\\]Headers[/\\]other\.h]] | {{.*}} | hash loc: <invalid>
+// CHECK-DMOD-NEXT: [ppIncludedFile]: [[DMOD_NOT_CXX_H:.*/Modules/Inputs/DependsOnModule\.framework[/\\]Headers[/\\]not_cxx\.h]] | {{.*}} | hash loc: <invalid>
// CHECK-DMOD-NEXT: [ppIncludedFile]: [[DMOD_SUB_H:.*/Modules/Inputs/DependsOnModule\.framework[/\\]Frameworks[/\\]SubFramework\.framework[/\\]Headers[/\\]SubFramework\.h]] | {{.*}} | hash loc: <invalid>
// CHECK-DMOD-NEXT: [ppIncludedFile]: [[DMOD_SUB_OTHER_H:.*/Modules/Inputs/DependsOnModule.framework[/\\]Frameworks/SubFramework\.framework/Headers/Other\.h]] | name: "SubFramework/Other.h" | hash loc: [[DMOD_SUB_H]]:1:1 | isImport: 0 | isAngled: 0
// CHECK-DMOD-NEXT: [ppIncludedFile]: [[DMOD_PRIVATE_H:.*/Modules/Inputs/DependsOnModule.framework[/\\]PrivateHeaders[/\\]DependsOnModulePrivate.h]] | {{.*}} | hash loc: <invalid>
// CHECK-DMOD-NEXT: [importedASTFile]: {{.*}}.cache{{[/\\]}}Module.pcm | loc: [[DMOD_MODULE_H]]:1:2 | name: "Module" | isImplicit: 1
// CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: depends_on_module_other | {{.*}} | loc: [[DMOD_OTHER_H]]:1:5
+// CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: template | {{.*}} | loc: [[DMOD_NOT_CXX_H]]:1:12
// CHECK-DMOD-NEXT: [importedASTFile]: {{.*}}.cache/DependsOnModule.pcm | loc: {{.*}}SubFramework.h:1:2 | name: "DependsOnModule.SubFramework.Other" | isImplicit: 1
// CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: sub_framework | {{.*}} | loc: [[DMOD_SUB_H]]:2:8
// CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: sub_framework_other | {{.*}} | loc: [[DMOD_SUB_OTHER_H]]:1:9
diff --git a/test/Index/overrides.cpp b/test/Index/overrides.cpp
index a711d82bea80..e311699f8660 100644
--- a/test/Index/overrides.cpp
+++ b/test/Index/overrides.cpp
@@ -17,7 +17,14 @@ struct D : C {
void C::g() {}
+struct E {
+ virtual void h() = 0;
+ template <typename T> void i(T);
+};
+
// RUN: c-index-test -test-load-source local %s | FileCheck %s
// CHECK: overrides.cpp:11:16: CXXMethod=g:11:16 (virtual) [Overrides @7:16] Extent=[11:3 - 11:19]
// CHECK: overrides.cpp:15:16: CXXMethod=f:15:16 (virtual) [Overrides @2:16, @6:16] Extent=[15:3 - 15:22]
// CHECK: overrides.cpp:18:9: CXXMethod=g:18:9 (Definition) (virtual) [Overrides @7:16] Extent=[18:1 - 18:15]
+// CHECK: overrides.cpp:21:16: CXXMethod=h:21:16 (virtual) (pure) Extent=[21:3 - 21:23]
+// CHECK: overrides.cpp:22:30: FunctionTemplate=i:22:30 Extent=[22:3 - 22:34]
diff --git a/test/Index/overriding-method-comments.mm b/test/Index/overriding-method-comments.mm
index 46ead4f64256..9285693396e0 100644
--- a/test/Index/overriding-method-comments.mm
+++ b/test/Index/overriding-method-comments.mm
@@ -19,7 +19,7 @@
- (void)METH:(id)AAA;
@end
-// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void)METH:(id)AAA;</Declaration><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>]
+// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void)METH:(id)AAA;</Declaration><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ</Para></Discussion></Parameter></Parameters></Function>]
@interface Sub : Root
@end
@@ -28,13 +28,13 @@
- (void)METH:(id)BBB;
@end
-// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void)METH:(id)BBB;</Declaration><Parameters><Parameter><Name>BBB</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>]
+// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void)METH:(id)BBB;</Declaration><Parameters><Parameter><Name>BBB</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ</Para></Discussion></Parameter></Parameters></Function>]
@implementation Sub(CAT)
- (void)METH:(id)III {}
@end
-// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void)METH:(id)III;</Declaration><Parameters><Parameter><Name>III</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ </Para></Discussion></Parameter></Parameters></Function>]
+// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>METH:</Name><USR>c:objc(cs)Root(im)METH:</USR><Declaration>- (void)METH:(id)III;</Declaration><Parameters><Parameter><Name>III</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> ZZZ</Para></Discussion></Parameter></Parameters></Function>]
@interface Redec : Root
@end
@@ -48,13 +48,13 @@
- (void)EXT_METH:(id)AAA : (double)BBB : (int)CCC;
@end
-// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Declaration>- (void)EXT_METH:(id)AAA:(double)BBB:(int)CCC;</Declaration><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double </Para></Discussion></Parameter><Parameter><Name>CCC</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int </Para></Discussion></Parameter></Parameters></Function>]
+// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Declaration>- (void)EXT_METH:(id)AAA:(double)BBB:(int)CCC;</Declaration><Parameters><Parameter><Name>AAA</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value </Para></Discussion></Parameter><Parameter><Name>BBB</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double</Para></Discussion></Parameter><Parameter><Name>CCC</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int </Para></Discussion></Parameter></Parameters></Function>]
@implementation Redec
- (void)EXT_METH:(id)PPP : (double)QQQ : (int)RRR {}
@end
-// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Declaration>- (void)EXT_METH:(id)PPP:(double)QQQ:(int)RRR;</Declaration><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double </Para></Discussion></Parameter><Parameter><Name>RRR</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int </Para></Discussion></Parameter></Parameters></Function>]
+// CHECK: FullCommentAsXML=[<Function isInstanceMethod="1" file="{{[^"]+}}overriding-method-comments.mm" line="[[@LINE-3]]" column="1"><Name>EXT_METH:::</Name><USR>c:objc(cs)Redec(im)EXT_METH:::</USR><Declaration>- (void)EXT_METH:(id)PPP:(double)QQQ:(int)RRR;</Declaration><Parameters><Parameter><Name>PPP</Name><Index>0</Index><Direction isExplicit="1">in</Direction><Discussion><Para> input value </Para></Discussion></Parameter><Parameter><Name>QQQ</Name><Index>1</Index><Direction isExplicit="1">in</Direction><Discussion><Para> 2nd input value is double</Para></Discussion></Parameter><Parameter><Name>RRR</Name><Index>2</Index><Direction isExplicit="1">out</Direction><Discussion><Para> output value is int </Para></Discussion></Parameter></Parameters></Function>]
struct Base {
/// \brief Does something.
diff --git a/test/Index/pch-with-errors.c b/test/Index/pch-with-errors.c
index 2d396134e5f2..5c94a8a8e4d3 100644
--- a/test/Index/pch-with-errors.c
+++ b/test/Index/pch-with-errors.c
@@ -37,8 +37,8 @@ void foo(void) {
// CHECK-INDEX: [indexDeclaration]: kind: function | name: foo
// CHECK-INDEX: [indexEntityReference]: kind: function | name: erroneous
-// RUN: %clang -fsyntax-only %s -include %t.h 2>&1 | FileCheck -check-prefix=PCH-ERR %s
+// RUN: not %clang -fsyntax-only %s -include %t.h 2>&1 | FileCheck -check-prefix=PCH-ERR %s
// PCH-ERR: error: PCH file contains compiler errors
-// RUN: c-index-test -write-pch %t.pch foobar.c 2>&1 | FileCheck -check-prefix=NONEXISTENT %s
+// RUN: not c-index-test -write-pch %t.pch foobar.c 2>&1 | FileCheck -check-prefix=NONEXISTENT %s
// NONEXISTENT: Unable to load translation unit
diff --git a/test/Index/pch-with-errors.m b/test/Index/pch-with-errors.m
index cc42cd308141..397f8e8e17cb 100644
--- a/test/Index/pch-with-errors.m
+++ b/test/Index/pch-with-errors.m
@@ -9,6 +9,12 @@
-(void)meth;
@end
+struct FFF1
+extern I2 *somevar1;
+
+enum FFF2
+extern I2 *somevar2;
+
#else
void foo(I2 *i) {
diff --git a/test/Index/pch-with-module.m b/test/Index/pch-with-module.m
new file mode 100644
index 000000000000..e839c811dab6
--- /dev/null
+++ b/test/Index/pch-with-module.m
@@ -0,0 +1,23 @@
+// RUN: rm -rf %t.cache
+// RUN: c-index-test -write-pch %t.h.pch %s -target x86_64-apple-macosx10.7 -fobjc-arc -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs -Xclang -fdisable-module-hash
+// RUN: %clang -fsyntax-only %s -target x86_64-apple-macosx10.7 -include %t.h -fobjc-arc -fmodules-cache-path=%t.cache -fmodules -F %S/../Modules/Inputs \
+// RUN: -Xclang -fdisable-module-hash -Xclang -detailed-preprocessing-record -Xclang -verify
+
+// expected-no-diagnostics
+
+#ifndef PCH_HEADER
+#define PCH_HEADER
+
+#include <Module/Module.h>
+
+@interface Module(PCHCat)
+-(id)PCH_meth;
+@end
+
+#else
+
+void foo(Module *m) {
+ [m PCH_meth];
+}
+
+#endif
diff --git a/test/Index/preamble-reparse-with-BOM.m b/test/Index/preamble-reparse-with-BOM.m
index a2a89c8d8e15..6727a7ee1cac 100644
--- a/test/Index/preamble-reparse-with-BOM.m
+++ b/test/Index/preamble-reparse-with-BOM.m
@@ -2,5 +2,7 @@
@interface I2
@end
-// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_FAILONERROR=1 \
-// RUN: c-index-test -test-load-source-reparse 1 local %s
+// RUN: env CINDEXTEST_EDITING=1 \
+// RUN: c-index-test -test-load-source-reparse 1 local %s | FileCheck %s
+
+// CHECK: preamble-reparse-with-BOM.m:2:12: ObjCInterfaceDecl=I2:2:12 Extent=[2:1 - 3:5]
diff --git a/test/Index/preamble.c b/test/Index/preamble.c
index 8a158e9b30ce..92a9b84546ff 100644
--- a/test/Index/preamble.c
+++ b/test/Index/preamble.c
@@ -1,5 +1,7 @@
#include "prefix.h"
#include "preamble.h"
+#include "preamble-with-error.h"
+
int wibble(int);
void f(int x) {
@@ -14,10 +16,10 @@ void f(int x) {
// CHECK: preamble.h:4:9: UnexposedExpr=ptr1:3:10 Extent=[4:9 - 4:13]
// CHECK: preamble.h:4:9: DeclRefExpr=ptr1:3:10 Extent=[4:9 - 4:13]
// CHECK: preamble.h:5:10: IntegerLiteral= Extent=[5:10 - 5:11]
-// CHECK: preamble.c:3:5: FunctionDecl=wibble:3:5 Extent=[3:1 - 3:16]
-// CHECK: preamble.c:3:15: ParmDecl=:3:15 (Definition) Extent=[3:12 - 3:16]
+// CHECK: preamble.c:5:5: FunctionDecl=wibble:5:5 Extent=[5:1 - 5:16]
+// CHECK: preamble.c:5:15: ParmDecl=:5:15 (Definition) Extent=[5:12 - 5:16]
// CHECK-DIAG: preamble.h:4:7:{4:9-4:13}: warning: incompatible pointer types assigning to 'int *' from 'float *'
-// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:6:1 -I %S/Inputs -include %t %s 2> %t.stderr.txt | FileCheck -check-prefix CHECK-CC %s
+// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:8:1 -I %S/Inputs -include %t %s 2> %t.stderr.txt | FileCheck -check-prefix CHECK-CC %s
// CHECK-CC: FunctionDecl:{ResultType int}{TypedText bar}{LeftParen (}{Placeholder int i}{RightParen )} (50)
// CHECK-CC: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder int x}{RightParen )} (50)
// CHECK-CC: FunctionDecl:{ResultType int}{TypedText foo}{LeftParen (}{Placeholder int}{RightParen )} (50)
diff --git a/test/Index/print-type-cxx11.cpp b/test/Index/print-type-cxx11.cpp
new file mode 100644
index 000000000000..0ad547377462
--- /dev/null
+++ b/test/Index/print-type-cxx11.cpp
@@ -0,0 +1,8 @@
+struct RefQualifierTest {
+ void f() & {};
+ void f() && {};
+};
+
+// RUN: c-index-test -test-print-type -std=c++11 %s | FileCheck %s
+// CHECK: CXXMethod=f:2:8 (Definition) [type=void () &] [typekind=FunctionProto] lvalue-ref-qualifier [resulttype=void] [resulttypekind=Void] [isPOD=0]
+// CHECK: CXXMethod=f:3:8 (Definition) [type=void () &&] [typekind=FunctionProto] rvalue-ref-qualifier [resulttype=void] [resulttypekind=Void] [isPOD=0]
diff --git a/test/Index/print-type-size.cpp b/test/Index/print-type-size.cpp
index 698d96705bc9..58f2e14c33a4 100644
--- a/test/Index/print-type-size.cpp
+++ b/test/Index/print-type-size.cpp
@@ -74,13 +74,6 @@ struct Test2 {
int foobar;
};
};
- struct inner {
- struct {
-//CHECK64: FieldDecl=mybar:[[@LINE+1]]:15 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=0]
- int mybar;
- };
-//CHECK64: FieldDecl=mole:[[@LINE+1]]:7 (Definition) [type=struct inner] [typekind=Unexposed] [sizeof=4] [alignof=4] [offsetof=96]
- } mole;
};
};
@@ -91,12 +84,9 @@ namespace Incomplete {
// test that fields in incomplete named record do not crash
union named {
struct forward_decl f1;
-//CHECK64: FieldDecl=f2:[[@LINE+1]]:7 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-2]
int f2;
struct x {
-//CHECK64: FieldDecl=g1:[[@LINE+1]]:9 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=0]
int g1;
-//CHECK64: FieldDecl=f3:[[@LINE+1]]:5 (Definition) [type=struct x] [typekind=Unexposed] [sizeof=4] [alignof=4] [offsetof=-2]
} f3;
struct forward_decl f4;
struct x2{
@@ -107,18 +97,13 @@ union named {
// test that fields in incomplete anonymous record do not crash
union f {
-//CHECK64: FieldDecl=f1:[[@LINE+1]]:23 (Definition) [type=struct forward_decl] [typekind=Unexposed] [sizeof=-2] [alignof=-2] [offsetof=-2]
struct forward_decl f1;
-//CHECK64: FieldDecl=f2:[[@LINE+1]]:7 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-2]
int f2;
struct {
-//CHECK64: FieldDecl=e1:[[@LINE+1]]:9 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-2]
int e1;
struct {
-//CHECK64: FieldDecl=g1:[[@LINE+1]]:28 (Definition) [type=struct forward_decl2] [typekind=Unexposed] [sizeof=-2] [alignof=-2] [offsetof=-2]
struct forward_decl2 g1;
};
-//CHECK64: FieldDecl=e3:[[@LINE+1]]:9 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-2]
int e3;
};
};
@@ -128,10 +113,8 @@ union f {
struct s1 {
struct {
struct forward_decl2 s1_g1;
-//CHECK64: FieldDecl=s1_e1:[[@LINE+1]]:9 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-2]
int s1_e1;
} s1_x; // named record shows in s1->field_iterator
-//CHECK64: FieldDecl=s1_e3:[[@LINE+1]]:7 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-2]
int s1_e3;
};
@@ -140,17 +123,14 @@ struct s1b {
struct {
struct forward_decl2 s1b_g1;
}; // erroneous anonymous record does not show in s1b->field_iterator
-//CHECK64: FieldDecl=s1b_e2:[[@LINE+1]]:7 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=0]
int s1b_e2;
};
struct s2 {
struct {
struct forward_decl2 s2_g1;
-//CHECK64: FieldDecl=s2_e1:[[@LINE+1]]:9 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-5]
int s2_e1;
}; // erroneous anonymous record does not show in s1b->field_iterator
-//CHECK64: FieldDecl=s2_e3:[[@LINE+1]]:7 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=0]
int s2_e3;
};
@@ -167,7 +147,6 @@ struct s3 {
};
};
};
-//CHECK64: FieldDecl=s3_e3:[[@LINE+1]]:9 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=64]
int s3_e3;
};
};
@@ -181,13 +160,11 @@ struct s4a {
struct {
struct {
struct {
-//CHECK64: FieldDecl=s4_e1:[[@LINE+1]]:17 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-2]
int s4_e1;
};
};
};
};
-//CHECK64: FieldDecl=s4_e3:[[@LINE+1]]:9 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-2]
int s4_e3;
};
};
@@ -200,30 +177,32 @@ struct s4b {
struct {
struct {
struct {
-//CHECK64: FieldDecl=s4b_e1:[[@LINE+1]]:17 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-5]
int s4b_e1;
};
};
};
};
-//CHECK64: FieldDecl=s4b_e3:[[@LINE+1]]:9 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-5]
int s4b_e3;
};
};
+//named struct within anonymous struct
+struct s5 {
+ struct {
+ struct x {
+ int i;
+ };
+ };
+};
+
// CHECK64: StructDecl=As:[[@LINE+1]]:8 [type=Incomplete::As] [typekind=Record]
struct As;
// undefined class. Should not crash
// CHECK64: ClassDecl=A:[[@LINE+1]]:7 [type=Incomplete::A] [typekind=Record]
class A;
-// CHECK64: ClassDecl=B:[[@LINE+1]]:7 (Definition) [type=Incomplete::B] [typekind=Record] [sizeof=16] [alignof=8]
class B {
-// CHECK64: FieldDecl=a1:[[@LINE+2]]:6 (Definition) [type=Incomplete::A *] [typekind=Pointer] [sizeof=8] [alignof=8] [offsetof=0]
-// CHECK32: FieldDecl=a1:[[@LINE+1]]:6 (Definition) [type=Incomplete::A *] [typekind=Pointer] [sizeof=4] [alignof=4] [offsetof=0]
A* a1;
-// CHECK64: FieldDecl=a2:[[@LINE+2]]:6 (Definition) [type=Incomplete::A &] [typekind=LValueReference] [sizeof=-2] [alignof=-2] [offsetof=64]
-// CHECK32: FieldDecl=a2:[[@LINE+1]]:6 (Definition) [type=Incomplete::A &] [typekind=LValueReference] [sizeof=-2] [alignof=-2] [offsetof=32]
A& a2;
};
@@ -388,15 +367,12 @@ struct BaseStruct
namespace NotConstantSize {
void f(int i) {
-// CHECK32: VarDecl=v2:[[@LINE+1]]:8 (Definition) [type=int [i]] [typekind=Unexposed] [sizeof=-4] [alignof=4]
+// CHECK32: VarDecl=v2:[[@LINE+1]]:8 (Definition) [type=int [i]] [typekind=VariableArray] [sizeof=-4] [alignof=4]
int v2[i];
{
struct CS1 {
-// FIXME: should libclang return [offsetof=0] ?
-//CHECK32: FieldDecl=f1:[[@LINE+1]]:9 (Definition) [type=int [i]] [typekind=Unexposed] [sizeof=-4] [alignof=4] [offsetof=0]
- int f1[i];
-//CHECK32: FieldDecl=f2:[[@LINE+1]]:11 (Definition) [type=float] [typekind=Float] [sizeof=4] [alignof=4] [offsetof=0]
- float f2;
+ int f1[i];
+ float f2;
};
}
}
@@ -407,9 +383,7 @@ namespace CrashTest {
// test crash scenarios on dependent types.
template<typename T>
struct Foo {
-//CHECK32: FieldDecl=t:[[@LINE+1]]:5 (Definition) [type=T] [typekind=Unexposed] [sizeof=-3] [alignof=-3] [offsetof=-1]
T t;
-//CHECK32: FieldDecl=a:[[@LINE+1]]:7 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-1]
int a;
};
diff --git a/test/Index/print-type.c b/test/Index/print-type.c
index 4805f59f3fe0..6c7095a4e5f5 100644
--- a/test/Index/print-type.c
+++ b/test/Index/print-type.c
@@ -10,6 +10,8 @@ typedef int ArrayType[5];
int __attribute__((vector_size(16))) x;
typedef int __attribute__((vector_size(16))) int4_t;
+int f2(int incompletearray[]);
+
// RUN: c-index-test -test-print-type %s | FileCheck %s
// CHECK: FunctionDecl=f:3:6 (Definition) [type=int *(int *, char *, FooType, int *, void (*)(int))] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int, int *, void (*)(int))] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Typedef] [int [5]] [ConstantArray] [void (*)(int)] [Pointer]] [isPOD=0]
// CHECK: ParmDecl=p:3:13 (Definition) [type=int *] [typekind=Pointer] [isPOD=1]
@@ -35,10 +37,11 @@ typedef int __attribute__((vector_size(16))) int4_t;
// CHECK: DeclRefExpr=p:3:13 [type=int *] [typekind=Pointer] [isPOD=1]
// CHECK: DeclRefExpr=z:3:33 [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: ArraySubscriptExpr= [type=int] [typekind=Int] [isPOD=1]
-// CHECK: DeclRefExpr=arr:3:40 [type=int *] [typekind=Pointer] [isPOD=1]
+// CHECK: UnexposedExpr=arr:3:40 [type=int [5]] [typekind=ConstantArray] [isPOD=1]
// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
// CHECK: TypedefDecl=OtherType:8:16 (Definition) [type=OtherType] [typekind=Typedef] [canonicaltype=double] [canonicaltypekind=Double] [isPOD=1]
// CHECK: TypedefDecl=ArrayType:9:13 (Definition) [type=ArrayType] [typekind=Typedef] [canonicaltype=int [5]] [canonicaltypekind=ConstantArray] [isPOD=1]
// CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
// CHECK: VarDecl=x:10:38 [type=__attribute__((__vector_size__(4 * sizeof(int)))) int] [typekind=Vector] [isPOD=1]
// CHECK: TypedefDecl=int4_t:11:46 (Definition) [type=int4_t] [typekind=Typedef] [canonicaltype=__attribute__((__vector_size__(4 * sizeof(int)))) int] [canonicaltypekind=Vector] [isPOD=1]
+// CHECK: ParmDecl=incompletearray:13:12 (Definition) [type=int []] [typekind=IncompleteArray] [isPOD=1]
diff --git a/test/Index/print-type.cpp b/test/Index/print-type.cpp
index 49a05fbbdbdf..6324d439a6d5 100644
--- a/test/Index/print-type.cpp
+++ b/test/Index/print-type.cpp
@@ -29,6 +29,16 @@ T tbar(int);
template <typename T>
T tbar(int[5]);
+template <typename T, int size>
+T tbar(int[size]);
+
+void foo(int i, int incomplete_array[]) { int variable_array[i]; }
+
+struct Blob {
+ int i;
+};
+int Blob::*member_pointer;
+
// RUN: c-index-test -test-print-type %s | FileCheck %s
// CHECK: Namespace=outer:1:11 (Definition) [type=] [typekind=Invalid] [isPOD=0]
// CHECK: ClassTemplate=Foo:4:8 (Definition) [type=] [typekind=Invalid] [isPOD=0]
@@ -64,3 +74,8 @@ T tbar(int[5]);
// CHECK: TemplateTypeParameter=T:26:20 (Definition) [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0]
// CHECK: FunctionTemplate=tbar:30:3 [type=T (int *)] [typekind=FunctionProto] [canonicaltype=type-parameter-0-0 (int *)] [canonicaltypekind=FunctionProto] [resulttype=T] [resulttypekind=Unexposed] [isPOD=0]
// CHECK: ParmDecl=:30:11 (Definition) [type=int [5]] [typekind=ConstantArray] [isPOD=1]
+// CHECK: FunctionTemplate=tbar:33:3 [type=T (int *)] [typekind=FunctionProto] [canonicaltype=type-parameter-0-0 (int *)] [canonicaltypekind=FunctionProto] [resulttype=T] [resulttypekind=Unexposed] [isPOD=0]
+// CHECK: ParmDecl=:33:11 (Definition) [type=int [size]] [typekind=DependentSizedArray] [isPOD=0]
+// CHECK: ParmDecl=incomplete_array:35:21 (Definition) [type=int []] [typekind=IncompleteArray] [isPOD=1]
+// CHECK: VarDecl=variable_array:35:47 (Definition) [type=int [i]] [typekind=VariableArray] [isPOD=1]
+// CHECK: VarDecl=member_pointer:40:12 (Definition) [type=int Blob::*] [typekind=MemberPointer] [isPOD=1]
diff --git a/test/Index/recover-bad-code-rdar_7487294.c b/test/Index/recover-bad-code-rdar_7487294.c
index e060672b6923..c2803006ac43 100644
--- a/test/Index/recover-bad-code-rdar_7487294.c
+++ b/test/Index/recover-bad-code-rdar_7487294.c
@@ -1,4 +1,4 @@
-// RUN: %clang-cc1 -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang-cc1 -fsyntax-only %s 2>&1 | FileCheck %s
// IMPORTANT: This test case intentionally DOES NOT use --disable-free. It
// tests that we are properly reclaiming the ASTs and we do not have a double free.
diff --git a/test/Index/retain-comments-from-system-headers.c b/test/Index/retain-comments-from-system-headers.c
index a9b2e2f1ef3c..67a0fd05f5de 100644
--- a/test/Index/retain-comments-from-system-headers.c
+++ b/test/Index/retain-comments-from-system-headers.c
@@ -9,7 +9,7 @@
int user_function(int a);
// RUN: c-index-test -test-load-source all %s -I %S/Inputs | FileCheck %s
-// RUN: c-index-test -test-load-source all %s -fretain-comments-from-system-headers -I %S/Inputs | FileCheck %s -check-prefix=RETAIN
+// RUN: c-index-test -test-load-source all %s -fretain-comments-from-system-headers -I %S/Inputs | FileCheck %s -check-prefix=CHECK-RETAIN
// CHECK: retain-comments-from-system-headers.h:7:5: FunctionDecl=system_function:7:5 Extent=[7:1 - 7:27]
// CHECK: retain-comments-from-system-headers.c:9:5: FunctionDecl=user_function:9:5 RawComment=[/**\n * user_function\n * \param a Aaa.\n */] RawCommentRange=[5:1 - 8:4] BriefComment=[user_function]
diff --git a/test/Index/subclass-comment.mm b/test/Index/subclass-comment.mm
index 9682a9f71d6c..5fcb89fe632b 100644
--- a/test/Index/subclass-comment.mm
+++ b/test/Index/subclass-comment.mm
@@ -13,7 +13,7 @@
// CHECK-NEXT: (CXComment_Text Text=[ NSObject is root of all.])))]
//! An umbrella class for super classes.
-@interface SuperClass
+@interface SuperClass
@end
// CHECK: CommentAST=[
// CHECK-NEXT: (CXComment_FullComment
@@ -41,67 +41,3 @@
// CHECK-NEXT: (CXComment_Paragraph
// CHECK-NEXT: (CXComment_Text Text=[ An umbrella class for super classes.])))]
-//! Something valuable to the organization.
-class Asset {
-};
-// CHECK: CommentAST=[
-// CHECK-NEXT: (CXComment_FullComment
-// CHECK-NEXT: (CXComment_Paragraph
-// CHECK-NEXT: (CXComment_Text Text=[ Something valuable to the organization.])))]
-
-//! An individual human or human individual.
-class Person : public Asset {
-};
-// CHECK: CommentAST=[
-// CHECK-NEXT: (CXComment_FullComment
-// CHECK-NEXT: (CXComment_Paragraph
-// CHECK-NEXT: (CXComment_Text Text=[ An individual human or human individual.])))]
-
-class Student : public Person {
-};
-// CHECK: CommentAST=[
-// CHECK-NEXT: (CXComment_FullComment
-// CHECK-NEXT: (CXComment_Paragraph
-// CHECK-NEXT: (CXComment_Text Text=[ An individual human or human individual.])))]
-
-//! Every thing is a part
-class Parts {
-};
-// CHECK: CommentAST=[
-// CHECK-NEXT: (CXComment_FullComment
-// CHECK-NEXT: (CXComment_Paragraph
-// CHECK-NEXT: (CXComment_Text Text=[ Every thing is a part])))]
-
-class Window : public virtual Parts {
-};
-// CHECK: CommentAST=[
-// CHECK-NEXT: (CXComment_FullComment
-// CHECK-NEXT: (CXComment_Paragraph
-// CHECK-NEXT: (CXComment_Text Text=[ Every thing is a part])))]
-
-class Door : public virtual Parts {
-};
-// CHECK: CommentAST=[
-// CHECK-NEXT: (CXComment_FullComment
-// CHECK-NEXT: (CXComment_Paragraph
-// CHECK-NEXT: (CXComment_Text Text=[ Every thing is a part])))]
-
-class House : public Window, Door {
-};
-// CHECK: CommentAST=[
-// CHECK-NEXT: (CXComment_FullComment
-// CHECK-NEXT: (CXComment_Paragraph
-// CHECK-NEXT: (CXComment_Text Text=[ Every thing is a part])))]
-
-//! Any Material
-class Material : virtual Parts {
-};
-
-class Building : Window, public Material {
-};
-// CHECK: CommentAST=[
-// CHECK-NEXT: (CXComment_FullComment
-// CHECK-NEXT: (CXComment_Paragraph
-// CHECK-NEXT: (CXComment_Text Text=[ Any Material])))]
-
-
diff --git a/test/Index/usrs.m b/test/Index/usrs.m
index dccfb7587279..cc2e0fd4b4c2 100644
--- a/test/Index/usrs.m
+++ b/test/Index/usrs.m
@@ -118,7 +118,7 @@ int test_multi_declaration(void) {
// CHECK: usrs.m c:objc(cs)Foo Extent=[34:1 - 45:2]
// CHECK: usrs.m c:objc(cs)Foo(im)godzilla Extent=[35:1 - 39:2]
// CHECK: usrs.m c:usrs.m@402objc(cs)Foo(im)godzilla@a Extent=[36:3 - 36:19]
-// CHECK: usrs.m c:objc(cs)Foo(im)godzilla@z Extent=[37:3 - 37:15]
+// CHECK: usrs.m c:@z Extent=[37:3 - 37:15]
// CHECK: usrs.m c:objc(cs)Foo(cm)kingkong Extent=[40:1 - 43:2]
// CHECK: usrs.m c:usrs.m@470objc(cs)Foo(cm)kingkong@local_var Extent=[41:3 - 41:16]
// CHECK: usrs.m c:objc(cs)Foo(py)d1 Extent=[44:1 - 44:15]
diff --git a/test/Layout/ms-x86-aligned-tail-padding.cpp b/test/Layout/ms-x86-aligned-tail-padding.cpp
new file mode 100644
index 000000000000..b9020f386c03
--- /dev/null
+++ b/test/Layout/ms-x86-aligned-tail-padding.cpp
@@ -0,0 +1,502 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+extern "C" int printf(const char *fmt, ...);
+
+struct B0 {
+ int a;
+ B0() : a(0xf00000B0) {}
+};
+struct __declspec(align(16)) B1 {
+ int a;
+ B1() : a(0xf00000B1) {}
+};
+struct B2 {
+ __declspec(align(16)) int a;
+ B2() : a(0xf00000B2) {}
+};
+struct __declspec(align(16)) B3 {
+ long long a1;
+ int a;
+ B3() : a(0xf00000B3), a1(0xf00000B3f00000B3ll) {}
+};
+struct V {
+ char a;
+ V() : a(0X11) {}
+};
+struct __declspec(align(32)) A16 {};
+struct V1 : A16 { virtual void f() {} };
+struct V2 {
+ long long a;
+ int a1;
+ V2() : a(0xf0000011f0000011ll), a1(0xf0000011) {}
+};
+struct V3 {
+ int a;
+ V3() : a(0xf0000022) {}
+};
+struct __declspec(align(16)) A16X {
+};
+struct __declspec(align(16)) B0X {
+ int a, a1;
+ B0X() : a(0xf00000B0), a1(0xf00000B0) {}
+};
+struct B1X {
+ int a;
+ B1X() : a(0xf00000B1) {}
+};
+struct B2X {
+ int a;
+ B2X() : a(0xf00000B2) {}
+};
+struct __declspec(align(16)) B3X {
+ int a;
+ B3X() : a(0xf00000B3) {}
+ virtual void g() {}
+};
+struct B4X : A16X {
+ int a, a1;
+ B4X() : a(0xf00000B4), a1(0xf00000B4) {}
+};
+struct B5X : virtual A16X {
+ int a, a1;
+ B5X() : a(0xf00000B5), a1(0xf00000B5) {}
+};
+struct B6X {
+ int a;
+ B6X() : a(0xf00000B6) {}
+};
+
+struct A : B1, B0, B2, virtual V {
+ int a;
+ A() : a(0xf000000A) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct A
+// CHECK: 0 | struct B1 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | struct B0 (base)
+// CHECK: 4 | int a
+// CHECK: 16 | struct B2 (base)
+// CHECK: 16 | int a
+// CHECK: 32 | (A vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 64 | struct V (virtual base)
+// CHECK: 64 | char a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct A
+// CHECK-X64: 0 | struct B1 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 4 | struct B0 (base)
+// CHECK-X64: 4 | int a
+// CHECK-X64: 16 | struct B2 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | (A vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 48 | struct V (virtual base)
+// CHECK-X64: 48 | char a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct B : B2, B0, B1, virtual V {
+ int a;
+ B() : a(0xf000000B) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct B
+// CHECK: 0 | struct B2 (base)
+// CHECK: 0 | int a
+// CHECK: 16 | struct B0 (base)
+// CHECK: 16 | int a
+// CHECK: 32 | struct B1 (base)
+// CHECK: 32 | int a
+// CHECK: 36 | (B vbtable pointer)
+// CHECK: 52 | int a
+// CHECK: 64 | struct V (virtual base)
+// CHECK: 64 | char a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct B
+// CHECK-X64: 0 | struct B2 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 16 | struct B0 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | struct B1 (base)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 40 | (B vbtable pointer)
+// CHECK-X64: 48 | int a
+// CHECK-X64: 64 | struct V (virtual base)
+// CHECK-X64: 64 | char a
+// CHECK-X64: | [sizeof=80, align=16
+// CHECK-X64: | nvsize=64, nvalign=16]
+
+struct C : B1, B0, virtual V {
+ int a;
+ long long a1;
+ C() : a(0xf000000C), a1(0xf000000Cf000000Cll) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | struct B1 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | struct B0 (base)
+// CHECK: 4 | int a
+// CHECK: 8 | (C vbtable pointer)
+// CHECK: 24 | int a
+// CHECK: 32 | long long a1
+// CHECK: 48 | struct V (virtual base)
+// CHECK: 48 | char a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct C
+// CHECK-X64: 0 | struct B1 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 4 | struct B0 (base)
+// CHECK-X64: 4 | int a
+// CHECK-X64: 8 | (C vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | long long a1
+// CHECK-X64: 32 | struct V (virtual base)
+// CHECK-X64: 32 | char a
+// CHECK-X64: | [sizeof=48, align=16
+// CHECK-X64: | nvsize=32, nvalign=16]
+
+struct D : B2, B0, virtual V {
+ int a;
+ D() : a(0xf000000D) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | struct B2 (base)
+// CHECK: 0 | int a
+// CHECK: 16 | struct B0 (base)
+// CHECK: 16 | int a
+// CHECK: 20 | (D vbtable pointer)
+// CHECK: 36 | int a
+// CHECK: 48 | struct V (virtual base)
+// CHECK: 48 | char a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct D
+// CHECK-X64: 0 | struct B2 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 16 | struct B0 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | (D vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct V (virtual base)
+// CHECK-X64: 48 | char a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct E : B3, B0, virtual V {
+ int a;
+ E() : a(0xf000000E) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct E
+// CHECK: 0 | struct B3 (base)
+// CHECK: 0 | long long a1
+// CHECK: 8 | int a
+// CHECK: 16 | struct B0 (base)
+// CHECK: 16 | int a
+// CHECK: 20 | (E vbtable pointer)
+// CHECK: 36 | int a
+// CHECK: 48 | struct V (virtual base)
+// CHECK: 48 | char a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct E
+// CHECK-X64: 0 | struct B3 (base)
+// CHECK-X64: 0 | long long a1
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B0 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | (E vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct V (virtual base)
+// CHECK-X64: 48 | char a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct F : B0, virtual V1 {
+ __declspec(align(16)) int a;
+ F() : a(0xf000000F) {}
+ virtual void f() {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F
+// CHECK: 0 | struct B0 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | (F vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 92 | (vtordisp for vbase V1)
+// CHECK: 96 | struct V1 (virtual base)
+// CHECK: 96 | (V1 vftable pointer)
+// CHECK: 128 | struct A16 (base) (empty)
+// CHECK: | [sizeof=128, align=32
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F
+// CHECK-X64: 0 | struct B0 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 8 | (F vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 60 | (vtordisp for vbase V1)
+// CHECK-X64: 64 | struct V1 (virtual base)
+// CHECK-X64: 64 | (V1 vftable pointer)
+// CHECK-X64: 96 | struct A16 (base) (empty)
+// CHECK-X64: | [sizeof=96, align=32
+// CHECK-X64: | nvsize=32, nvalign=16]
+
+struct G : virtual V2, virtual V3 {
+ int a;
+ G() : a(0xf0000001) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct G
+// CHECK: 0 | (G vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct V2 (virtual base)
+// CHECK: 8 | long long a
+// CHECK: 16 | int a1
+// CHECK: 24 | struct V3 (virtual base)
+// CHECK: 24 | int a
+// CHECK: | [sizeof=28, align=8
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct G
+// CHECK-X64: 0 | (G vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct V2 (virtual base)
+// CHECK-X64: 16 | long long a
+// CHECK-X64: 24 | int a1
+// CHECK-X64: 32 | struct V3 (virtual base)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=40, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct H {
+ __declspec(align(16)) int a;
+ int b;
+ H() : a(0xf0000010), b(0xf0000010) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct H
+// CHECK: 0 | int a
+// CHECK: 4 | int b
+// CHECK: | [sizeof=16, align=16
+// CHECK: | nvsize=16, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct H
+// CHECK-X64: 0 | int a
+// CHECK-X64: 4 | int b
+// CHECK-X64: | [sizeof=16, align=16
+// CHECK-X64: | nvsize=16, nvalign=16]
+
+struct I {
+ B2 a;
+ int b;
+ I() : b(0xf0000010) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct I
+// CHECK: 0 | struct B2 a
+// CHECK: 0 | int a
+// CHECK: 16 | int b
+// CHECK: | [sizeof=32, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct I
+// CHECK-X64: 0 | struct B2 a
+// CHECK-X64: 0 | int a
+// CHECK-X64: 16 | int b
+// CHECK-X64: | [sizeof=32, align=16
+// CHECK-X64: | nvsize=32, nvalign=16]
+
+struct AX : B0X, virtual B2X, virtual B6X, virtual B3X {
+ int a;
+ AX() : a(0xf000000A) {}
+ virtual void f() {}
+ virtual void g() {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AX
+// CHECK: 0 | (AX vftable pointer)
+// CHECK: 16 | struct B0X (base)
+// CHECK: 16 | int a
+// CHECK: 20 | int a1
+// CHECK: 24 | (AX vbtable pointer)
+// CHECK: 40 | int a
+// CHECK: 48 | struct B2X (virtual base)
+// CHECK: 48 | int a
+// CHECK: 52 | struct B6X (virtual base)
+// CHECK: 52 | int a
+// CHECK: 76 | (vtordisp for vbase B3X)
+// CHECK: 80 | struct B3X (virtual base)
+// CHECK: 80 | (B3X vftable pointer)
+// CHECK: 84 | int a
+// CHECK: | [sizeof=96, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AX
+// CHECK-X64: 0 | (AX vftable pointer)
+// CHECK-X64: 16 | struct B0X (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 20 | int a1
+// CHECK-X64: 24 | (AX vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct B2X (virtual base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: 52 | struct B6X (virtual base)
+// CHECK-X64: 52 | int a
+// CHECK-X64: 76 | (vtordisp for vbase B3X)
+// CHECK-X64: 80 | struct B3X (virtual base)
+// CHECK-X64: 80 | (B3X vftable pointer)
+// CHECK-X64: 88 | int a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct BX : B4X, virtual B2X, virtual B6X, virtual B3X {
+ int a;
+ BX() : a(0xf000000B) {}
+ virtual void f() {}
+ virtual void g() {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct BX
+// CHECK: 0 | (BX vftable pointer)
+// CHECK: 16 | struct B4X (base)
+// CHECK: 16 | struct A16X (base) (empty)
+// CHECK: 16 | int a
+// CHECK: 20 | int a1
+// CHECK: 32 | (BX vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 64 | struct B2X (virtual base)
+// CHECK: 64 | int a
+// CHECK: 68 | struct B6X (virtual base)
+// CHECK: 68 | int a
+// CHECK: 92 | (vtordisp for vbase B3X)
+// CHECK: 96 | struct B3X (virtual base)
+// CHECK: 96 | (B3X vftable pointer)
+// CHECK: 100 | int a
+// CHECK: | [sizeof=112, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct BX
+// CHECK-X64: 0 | (BX vftable pointer)
+// CHECK-X64: 16 | struct B4X (base)
+// CHECK-X64: 16 | struct A16X (base) (empty)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 20 | int a1
+// CHECK-X64: 32 | (BX vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 48 | struct B2X (virtual base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: 52 | struct B6X (virtual base)
+// CHECK-X64: 52 | int a
+// CHECK-X64: 76 | (vtordisp for vbase B3X)
+// CHECK-X64: 80 | struct B3X (virtual base)
+// CHECK-X64: 80 | (B3X vftable pointer)
+// CHECK-X64: 88 | int a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct CX : B5X, virtual B2X, virtual B6X, virtual B3X {
+ int a;
+ CX() : a(0xf000000C) {}
+ virtual void f() {}
+ virtual void g() {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct CX
+// CHECK: 0 | (CX vftable pointer)
+// CHECK: 16 | struct B5X (base)
+// CHECK: 16 | (B5X vbtable pointer)
+// CHECK: 20 | int a
+// CHECK: 24 | int a1
+// CHECK: 28 | int a
+// CHECK: 32 | struct A16X (virtual base) (empty)
+// CHECK: 32 | struct B2X (virtual base)
+// CHECK: 32 | int a
+// CHECK: 36 | struct B6X (virtual base)
+// CHECK: 36 | int a
+// CHECK: 60 | (vtordisp for vbase B3X)
+// CHECK: 64 | struct B3X (virtual base)
+// CHECK: 64 | (B3X vftable pointer)
+// CHECK: 68 | int a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct CX
+// CHECK-X64: 0 | (CX vftable pointer)
+// CHECK-X64: 16 | struct B5X (base)
+// CHECK-X64: 16 | (B5X vbtable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 28 | int a1
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct A16X (virtual base) (empty)
+// CHECK-X64: 48 | struct B2X (virtual base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: 52 | struct B6X (virtual base)
+// CHECK-X64: 52 | int a
+// CHECK-X64: 76 | (vtordisp for vbase B3X)
+// CHECK-X64: 80 | struct B3X (virtual base)
+// CHECK-X64: 80 | (B3X vftable pointer)
+// CHECK-X64: 88 | int a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct __declspec(align(16)) DX {
+ int a;
+ DX() : a(0xf000000D) {}
+ virtual void f() {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct DX
+// CHECK: 0 | (DX vftable pointer)
+// CHECK: 4 | int a
+// CHECK: | [sizeof=16, align=16
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct DX
+// CHECK-X64: 0 | (DX vftable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: | [sizeof=16, align=16
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+int a[
+sizeof(A)+
+sizeof(B)+
+sizeof(C)+
+sizeof(D)+
+sizeof(E)+
+sizeof(F)+
+sizeof(G)+
+sizeof(H)+
+sizeof(I)+
+sizeof(AX)+
+sizeof(BX)+
+sizeof(CX)+
+sizeof(DX)];
diff --git a/test/Layout/ms-x86-basic-layout.cpp b/test/Layout/ms-x86-basic-layout.cpp
new file mode 100644
index 000000000000..86b3553b0ba0
--- /dev/null
+++ b/test/Layout/ms-x86-basic-layout.cpp
@@ -0,0 +1,775 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+extern "C" int printf(const char *fmt, ...);
+
+struct A4 {
+ int a;
+ A4() : a(0xf00000a4) {}
+};
+
+struct B4 {
+ int a;
+ B4() : a(0xf00000b4) {}
+};
+
+struct C4 {
+ int a;
+ C4() : a(0xf00000c4) {}
+ virtual void f() {printf("C4");}
+};
+
+struct A16 {
+ __declspec(align(16)) int a;
+ A16() : a(0xf0000a16) {}
+};
+
+struct C16 {
+ __declspec(align(16)) int a;
+ C16() : a(0xf0000c16) {}
+ virtual void f() {printf("C16");}
+};
+
+struct TestF0 : A4, virtual B4 {
+ int a;
+ TestF0() : a(0xf00000F0) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestF0
+// CHECK: 0 | struct A4 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | (TestF0 vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 12 | struct B4 (virtual base)
+// CHECK: 12 | int a
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestF0
+// CHECK-X64: 0 | struct A4 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 8 | (TestF0 vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct B4 (virtual base)
+// CHECK-X64: 24 | int a
+// CHECK-X64: | [sizeof=32, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct TestF1 : A4, virtual A16 {
+ int a;
+ TestF1() : a(0xf00000f1) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestF1
+// CHECK: 0 | struct A4 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | (TestF1 vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 16 | struct A16 (virtual base)
+// CHECK: 16 | int a
+// CHECK: | [sizeof=32, align=16
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestF1
+// CHECK-X64: 0 | struct A4 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 8 | (TestF1 vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | struct A16 (virtual base)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=48, align=16
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct TestF2 : A4, virtual C4 {
+ int a;
+ TestF2() : a(0xf00000f2) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestF2
+// CHECK: 0 | struct A4 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | (TestF2 vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 12 | struct C4 (virtual base)
+// CHECK: 12 | (C4 vftable pointer)
+// CHECK: 16 | int a
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestF2
+// CHECK-X64: 0 | struct A4 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 8 | (TestF2 vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct C4 (virtual base)
+// CHECK-X64: 24 | (C4 vftable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=40, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct TestF3 : A4, virtual C16 {
+ int a;
+ TestF3() : a(0xf00000f3) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestF3
+// CHECK: 0 | struct A4 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | (TestF3 vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 16 | struct C16 (virtual base)
+// CHECK: 16 | (C16 vftable pointer)
+// CHECK: 32 | int a
+// CHECK: | [sizeof=48, align=16
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestF3
+// CHECK-X64: 0 | struct A4 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 8 | (TestF3 vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | struct C16 (virtual base)
+// CHECK-X64: 32 | (C16 vftable pointer)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct TestF4 : TestF3, A4 {
+ int a;
+ TestF4() : a(0xf00000f4) {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestF4
+// CHECK: 0 | struct TestF3 (base)
+// CHECK: 0 | struct A4 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | (TestF3 vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 12 | struct A4 (base)
+// CHECK: 12 | int a
+// CHECK: 16 | int a
+// CHECK: 32 | struct C16 (virtual base)
+// CHECK: 32 | (C16 vftable pointer)
+// CHECK: 48 | int a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestF4
+// CHECK-X64: 0 | struct TestF3 (base)
+// CHECK-X64: 0 | struct A4 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 8 | (TestF3 vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct A4 (base)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 28 | int a
+// CHECK-X64: 32 | struct C16 (virtual base)
+// CHECK-X64: 32 | (C16 vftable pointer)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=32, nvalign=16]
+
+struct TestF5 : TestF3, A4 {
+ int a;
+ TestF5() : a(0xf00000f5) {}
+ virtual void g() {printf("F5");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestF5
+// CHECK: 0 | (TestF5 vftable pointer)
+// CHECK: 16 | struct TestF3 (base)
+// CHECK: 16 | struct A4 (base)
+// CHECK: 16 | int a
+// CHECK: 20 | (TestF3 vbtable pointer)
+// CHECK: 24 | int a
+// CHECK: 28 | struct A4 (base)
+// CHECK: 28 | int a
+// CHECK: 32 | int a
+// CHECK: 48 | struct C16 (virtual base)
+// CHECK: 48 | (C16 vftable pointer)
+// CHECK: 64 | int a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestF5
+// CHECK-X64: 0 | (TestF5 vftable pointer)
+// CHECK-X64: 16 | struct TestF3 (base)
+// CHECK-X64: 16 | struct A4 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | (TestF3 vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 40 | struct A4 (base)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 44 | int a
+// CHECK-X64: 48 | struct C16 (virtual base)
+// CHECK-X64: 48 | (C16 vftable pointer)
+// CHECK-X64: 64 | int a
+// CHECK-X64: | [sizeof=80, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct TestF6 : TestF3, A4 {
+ int a;
+ TestF6() : a(0xf00000f6) {}
+ virtual void f() {printf("F6");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestF6
+// CHECK: 0 | struct TestF3 (base)
+// CHECK: 0 | struct A4 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | (TestF3 vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 12 | struct A4 (base)
+// CHECK: 12 | int a
+// CHECK: 16 | int a
+// CHECK: 44 | (vtordisp for vbase C16)
+// CHECK: 48 | struct C16 (virtual base)
+// CHECK: 48 | (C16 vftable pointer)
+// CHECK: 64 | int a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestF6
+// CHECK-X64: 0 | struct TestF3 (base)
+// CHECK-X64: 0 | struct A4 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 8 | (TestF3 vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct A4 (base)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 28 | int a
+// CHECK-X64: 44 | (vtordisp for vbase C16)
+// CHECK-X64: 48 | struct C16 (virtual base)
+// CHECK-X64: 48 | (C16 vftable pointer)
+// CHECK-X64: 64 | int a
+// CHECK-X64: | [sizeof=80, align=16
+// CHECK-X64: | nvsize=32, nvalign=16]
+
+struct TestF7 : A4, virtual C16 {
+ int a;
+ TestF7() : a(0xf00000f7) {}
+ virtual void f() {printf("F7");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestF7
+// CHECK: 0 | struct A4 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | (TestF7 vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 28 | (vtordisp for vbase C16)
+// CHECK: 32 | struct C16 (virtual base)
+// CHECK: 32 | (C16 vftable pointer)
+// CHECK: 48 | int a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestF7
+// CHECK-X64: 0 | struct A4 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 8 | (TestF7 vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 44 | (vtordisp for vbase C16)
+// CHECK-X64: 48 | struct C16 (virtual base)
+// CHECK-X64: 48 | (C16 vftable pointer)
+// CHECK-X64: 64 | int a
+// CHECK-X64: | [sizeof=80, align=16
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct TestF8 : TestF7, A4 {
+ int a;
+ TestF8() : a(0xf00000f8) {}
+ virtual void f() {printf("F8");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestF8
+// CHECK: 0 | struct TestF7 (base)
+// CHECK: 0 | struct A4 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | (TestF7 vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 12 | struct A4 (base)
+// CHECK: 12 | int a
+// CHECK: 16 | int a
+// CHECK: 44 | (vtordisp for vbase C16)
+// CHECK: 48 | struct C16 (virtual base)
+// CHECK: 48 | (C16 vftable pointer)
+// CHECK: 64 | int a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestF8
+// CHECK-X64: 0 | struct TestF7 (base)
+// CHECK-X64: 0 | struct A4 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 8 | (TestF7 vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct A4 (base)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 28 | int a
+// CHECK-X64: 44 | (vtordisp for vbase C16)
+// CHECK-X64: 48 | struct C16 (virtual base)
+// CHECK-X64: 48 | (C16 vftable pointer)
+// CHECK-X64: 64 | int a
+// CHECK-X64: | [sizeof=80, align=16
+// CHECK-X64: | nvsize=32, nvalign=16]
+
+struct TestF9 : A4, virtual C16 {
+ int a;
+ TestF9() : a(0xf00000f9) {}
+ virtual void g() {printf("F9");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestF9
+// CHECK: 0 | (TestF9 vftable pointer)
+// CHECK: 4 | struct A4 (base)
+// CHECK: 4 | int a
+// CHECK: 8 | (TestF9 vbtable pointer)
+// CHECK: 12 | int a
+// CHECK: 16 | struct C16 (virtual base)
+// CHECK: 16 | (C16 vftable pointer)
+// CHECK: 32 | int a
+// CHECK: | [sizeof=48, align=16
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestF9
+// CHECK-X64: 0 | (TestF9 vftable pointer)
+// CHECK-X64: 8 | struct A4 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | (TestF9 vbtable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 32 | struct C16 (virtual base)
+// CHECK-X64: 32 | (C16 vftable pointer)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=32, nvalign=8]
+
+struct TestFA : TestF9, A4 {
+ int a;
+ TestFA() : a(0xf00000fa) {}
+ virtual void g() {printf("FA");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestFA
+// CHECK: 0 | struct TestF9 (primary base)
+// CHECK: 0 | (TestF9 vftable pointer)
+// CHECK: 4 | struct A4 (base)
+// CHECK: 4 | int a
+// CHECK: 8 | (TestF9 vbtable pointer)
+// CHECK: 12 | int a
+// CHECK: 16 | struct A4 (base)
+// CHECK: 16 | int a
+// CHECK: 20 | int a
+// CHECK: 32 | struct C16 (virtual base)
+// CHECK: 32 | (C16 vftable pointer)
+// CHECK: 48 | int a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestFA
+// CHECK-X64: 0 | struct TestF9 (primary base)
+// CHECK-X64: 0 | (TestF9 vftable pointer)
+// CHECK-X64: 8 | struct A4 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | (TestF9 vbtable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 32 | struct A4 (base)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 36 | int a
+// CHECK-X64: 48 | struct C16 (virtual base)
+// CHECK-X64: 48 | (C16 vftable pointer)
+// CHECK-X64: 64 | int a
+// CHECK-X64: | [sizeof=80, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct TestFB : A16, virtual C16 {
+ int a;
+ TestFB() : a(0xf00000fb) {}
+ virtual void g() {printf("Fb");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestFB
+// CHECK: 0 | (TestFB vftable pointer)
+// CHECK: 16 | struct A16 (base)
+// CHECK: 16 | int a
+// CHECK: 32 | (TestFB vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 64 | struct C16 (virtual base)
+// CHECK: 64 | (C16 vftable pointer)
+// CHECK: 80 | int a
+// CHECK: | [sizeof=96, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestFB
+// CHECK-X64: 0 | (TestFB vftable pointer)
+// CHECK-X64: 16 | struct A16 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | (TestFB vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 48 | struct C16 (virtual base)
+// CHECK-X64: 48 | (C16 vftable pointer)
+// CHECK-X64: 64 | int a
+// CHECK-X64: | [sizeof=80, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct TestFC : TestFB, A4 {
+ int a;
+ TestFC() : a(0xf00000fc) {}
+ virtual void g() {printf("FC");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct TestFC
+// CHECK: 0 | struct TestFB (primary base)
+// CHECK: 0 | (TestFB vftable pointer)
+// CHECK: 16 | struct A16 (base)
+// CHECK: 16 | int a
+// CHECK: 32 | (TestFB vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 64 | struct A4 (base)
+// CHECK: 64 | int a
+// CHECK: 68 | int a
+// CHECK: 80 | struct C16 (virtual base)
+// CHECK: 80 | (C16 vftable pointer)
+// CHECK: 96 | int a
+// CHECK: | [sizeof=112, align=16
+// CHECK: | nvsize=80, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct TestFC
+// CHECK-X64: 0 | struct TestFB (primary base)
+// CHECK-X64: 0 | (TestFB vftable pointer)
+// CHECK-X64: 16 | struct A16 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | (TestFB vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 48 | struct A4 (base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: 52 | int a
+// CHECK-X64: 64 | struct C16 (virtual base)
+// CHECK-X64: 64 | (C16 vftable pointer)
+// CHECK-X64: 80 | int a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=64, nvalign=16]
+
+
+struct A16f {
+ __declspec(align(16)) int a;
+ A16f() : a(0xf0000a16) {}
+ virtual void f() {printf("A16f");}
+};
+
+struct Y { char y; Y() : y(0xaa) {} };
+struct X : virtual A16f {};
+
+struct B : A4, Y, X {
+ int a;
+ B() : a(0xf000000b) {}
+};
+
+struct F0 : A4, B {
+ int a;
+ F0() : a(0xf00000f0) {}
+ virtual void g() {printf("F0");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F0
+// CHECK: 0 | (F0 vftable pointer)
+// CHECK: 16 | struct A4 (base)
+// CHECK: 16 | int a
+// CHECK: 32 | struct B (base)
+// CHECK: 32 | struct A4 (base)
+// CHECK: 32 | int a
+// CHECK: 36 | struct Y (base)
+// CHECK: 36 | char y
+// CHECK: 48 | struct X (base)
+// CHECK: 48 | (X vbtable pointer)
+// CHECK: 52 | int a
+// CHECK: 64 | int a
+// CHECK: 80 | struct A16f (virtual base)
+// CHECK: 80 | (A16f vftable pointer)
+// CHECK: 96 | int a
+// CHECK: | [sizeof=112, align=16
+// CHECK: | nvsize=80, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F0
+// CHECK-X64: 0 | (F0 vftable pointer)
+// CHECK-X64: 8 | struct A4 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B (base)
+// CHECK-X64: 16 | struct A4 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 20 | struct Y (base)
+// CHECK-X64: 20 | char y
+// CHECK-X64: 32 | struct X (base)
+// CHECK-X64: 32 | (X vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 48 | int a
+// CHECK-X64: 64 | struct A16f (virtual base)
+// CHECK-X64: 64 | (A16f vftable pointer)
+// CHECK-X64: 80 | int a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=64, nvalign=16]
+
+struct F1 : B, A4 {
+ int a;
+ F1() : a(0xf00000f1) {}
+ virtual void g() {printf("F1");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F1
+// CHECK: 0 | (F1 vftable pointer)
+// CHECK: 16 | struct B (base)
+// CHECK: 16 | struct A4 (base)
+// CHECK: 16 | int a
+// CHECK: 20 | struct Y (base)
+// CHECK: 20 | char y
+// CHECK: 32 | struct X (base)
+// CHECK: 32 | (X vbtable pointer)
+// CHECK: 36 | int a
+// CHECK: 48 | struct A4 (base)
+// CHECK: 48 | int a
+// CHECK: 52 | int a
+// CHECK: 64 | struct A16f (virtual base)
+// CHECK: 64 | (A16f vftable pointer)
+// CHECK: 80 | int a
+// CHECK: | [sizeof=96, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F1
+// CHECK-X64: 0 | (F1 vftable pointer)
+// CHECK-X64: 16 | struct B (base)
+// CHECK-X64: 16 | struct A4 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 20 | struct Y (base)
+// CHECK-X64: 20 | char y
+// CHECK-X64: 32 | struct X (base)
+// CHECK-X64: 32 | (X vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 48 | struct A4 (base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: 52 | int a
+// CHECK-X64: 64 | struct A16f (virtual base)
+// CHECK-X64: 64 | (A16f vftable pointer)
+// CHECK-X64: 80 | int a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=64, nvalign=16]
+
+struct F2 : A4, virtual A16f {
+ int a;
+ F2() : a(0xf00000f2) {}
+ virtual void g() {printf("F2");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F2
+// CHECK: 0 | (F2 vftable pointer)
+// CHECK: 4 | struct A4 (base)
+// CHECK: 4 | int a
+// CHECK: 8 | (F2 vbtable pointer)
+// CHECK: 12 | int a
+// CHECK: 16 | struct A16f (virtual base)
+// CHECK: 16 | (A16f vftable pointer)
+// CHECK: 32 | int a
+// CHECK: | [sizeof=48, align=16
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F2
+// CHECK-X64: 0 | (F2 vftable pointer)
+// CHECK-X64: 8 | struct A4 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | (F2 vbtable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 32 | struct A16f (virtual base)
+// CHECK-X64: 32 | (A16f vftable pointer)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=32, nvalign=8]
+
+struct F3 : A4, virtual A16f {
+ __declspec(align(16)) int a;
+ F3() : a(0xf00000f3) {}
+ virtual void g() {printf("F3");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F3
+// CHECK: 0 | (F3 vftable pointer)
+// CHECK: 16 | struct A4 (base)
+// CHECK: 16 | int a
+// CHECK: 20 | (F3 vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 64 | struct A16f (virtual base)
+// CHECK: 64 | (A16f vftable pointer)
+// CHECK: 80 | int a
+// CHECK: | [sizeof=96, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F3
+// CHECK-X64: 0 | (F3 vftable pointer)
+// CHECK-X64: 8 | struct A4 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | (F3 vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct A16f (virtual base)
+// CHECK-X64: 48 | (A16f vftable pointer)
+// CHECK-X64: 64 | int a
+// CHECK-X64: | [sizeof=80, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct F4 : A4, B {
+ __declspec(align(16)) int a;
+ F4() : a(0xf00000f4) {}
+ virtual void g() {printf("F4");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F4
+// CHECK: 0 | (F4 vftable pointer)
+// CHECK: 16 | struct A4 (base)
+// CHECK: 16 | int a
+// CHECK: 32 | struct B (base)
+// CHECK: 32 | struct A4 (base)
+// CHECK: 32 | int a
+// CHECK: 36 | struct Y (base)
+// CHECK: 36 | char y
+// CHECK: 48 | struct X (base)
+// CHECK: 48 | (X vbtable pointer)
+// CHECK: 52 | int a
+// CHECK: 64 | int a
+// CHECK: 80 | struct A16f (virtual base)
+// CHECK: 80 | (A16f vftable pointer)
+// CHECK: 96 | int a
+// CHECK: | [sizeof=112, align=16
+// CHECK: | nvsize=80, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F4
+// CHECK-X64: 0 | (F4 vftable pointer)
+// CHECK-X64: 8 | struct A4 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B (base)
+// CHECK-X64: 16 | struct A4 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 20 | struct Y (base)
+// CHECK-X64: 20 | char y
+// CHECK-X64: 32 | struct X (base)
+// CHECK-X64: 32 | (X vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 48 | int a
+// CHECK-X64: 64 | struct A16f (virtual base)
+// CHECK-X64: 64 | (A16f vftable pointer)
+// CHECK-X64: 80 | int a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=64, nvalign=16]
+
+struct F5 : A16f, virtual A4 {
+ int a;
+ F5() : a(0xf00000f5) {}
+ virtual void g() {printf("F5");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F5
+// CHECK: 0 | struct A16f (primary base)
+// CHECK: 0 | (A16f vftable pointer)
+// CHECK: 16 | int a
+// CHECK: 32 | (F5 vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 64 | struct A4 (virtual base)
+// CHECK: 64 | int a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F5
+// CHECK-X64: 0 | struct A16f (primary base)
+// CHECK-X64: 0 | (A16f vftable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | (F5 vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 48 | struct A4 (virtual base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct F6 : virtual A16f, A4, virtual B {
+ int a;
+ F6() : a(0xf00000f6) {}
+ virtual void g() {printf("F6");}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F6
+// CHECK: 0 | (F6 vftable pointer)
+// CHECK: 4 | struct A4 (base)
+// CHECK: 4 | int a
+// CHECK: 8 | (F6 vbtable pointer)
+// CHECK: 12 | int a
+// CHECK: 16 | struct A16f (virtual base)
+// CHECK: 16 | (A16f vftable pointer)
+// CHECK: 32 | int a
+// CHECK: 48 | struct B (virtual base)
+// CHECK: 48 | struct A4 (base)
+// CHECK: 48 | int a
+// CHECK: 52 | struct Y (base)
+// CHECK: 52 | char y
+// CHECK: 64 | struct X (base)
+// CHECK: 64 | (X vbtable pointer)
+// CHECK: 68 | int a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F6
+// CHECK-X64: 0 | (F6 vftable pointer)
+// CHECK-X64: 8 | struct A4 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | (F6 vbtable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 32 | struct A16f (virtual base)
+// CHECK-X64: 32 | (A16f vftable pointer)
+// CHECK-X64: 48 | int a
+// CHECK-X64: 64 | struct B (virtual base)
+// CHECK-X64: 64 | struct A4 (base)
+// CHECK-X64: 64 | int a
+// CHECK-X64: 68 | struct Y (base)
+// CHECK-X64: 68 | char y
+// CHECK-X64: 80 | struct X (base)
+// CHECK-X64: 80 | (X vbtable pointer)
+// CHECK-X64: 88 | int a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=32, nvalign=8]
+
+int a[
+sizeof(TestF0)+
+sizeof(TestF1)+
+sizeof(TestF2)+
+sizeof(TestF3)+
+sizeof(TestF4)+
+sizeof(TestF5)+
+sizeof(TestF6)+
+sizeof(TestF7)+
+sizeof(TestF8)+
+sizeof(TestF9)+
+sizeof(TestFA)+
+sizeof(TestFB)+
+sizeof(TestFC)+
+sizeof(F0)+
+sizeof(F1)+
+sizeof(F2)+
+sizeof(F3)+
+sizeof(F4)+
+sizeof(F5)+
+sizeof(F6)];
diff --git a/test/Layout/ms-x86-bitfields-vbases.cpp b/test/Layout/ms-x86-bitfields-vbases.cpp
new file mode 100644
index 000000000000..e11ef67a6347
--- /dev/null
+++ b/test/Layout/ms-x86-bitfields-vbases.cpp
@@ -0,0 +1,84 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+struct B0 { };
+
+struct A : virtual B0 { char a : 1; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct A
+// CHECK: 0 | (A vbtable pointer)
+// CHECK: 4 | char a
+// CHECK: 9 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=9, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct A
+// CHECK-X64: 0 | (A vbtable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 17 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct B : virtual B0 { short a : 1; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct B
+// CHECK: 0 | (B vbtable pointer)
+// CHECK: 4 | short a
+// CHECK: 10 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=10, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct B
+// CHECK-X64: 0 | (B vbtable pointer)
+// CHECK-X64: 8 | short a
+// CHECK-X64: 18 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct C : virtual B0 { char a : 1; char : 0; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | (C vbtable pointer)
+// CHECK: 4 | char a
+// CHECK: 5 | char
+// CHECK: 8 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=8, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct C
+// CHECK-X64: 0 | (C vbtable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 9 | char
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct D : virtual B0 { char a : 1; char b; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | (D vbtable pointer)
+// CHECK: 4 | char a
+// CHECK: 5 | char b
+// CHECK: 8 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=8, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct D
+// CHECK-X64: 0 | (D vbtable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 9 | char b
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+int a[
+sizeof(A)+
+sizeof(B)+
+sizeof(C)+
+sizeof(D)];
diff --git a/test/Layout/ms-x86-empty-base-after-base-with-vbptr.cpp b/test/Layout/ms-x86-empty-base-after-base-with-vbptr.cpp
new file mode 100644
index 000000000000..293a61b96e64
--- /dev/null
+++ b/test/Layout/ms-x86-empty-base-after-base-with-vbptr.cpp
@@ -0,0 +1,216 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+
+struct U { char a; };
+struct V { };
+struct W { };
+struct X : virtual V { char a; };
+struct Y : virtual V { char a; };
+struct Z : Y { };
+
+struct A : X, W { char a; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct A
+// CHECK: 0 | struct X (base)
+// CHECK: 0 | (X vbtable pointer)
+// CHECK: 4 | char a
+// CHECK: 9 | struct W (base) (empty)
+// CHECK: 9 | char a
+// CHECK: 12 | struct V (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct A
+// CHECK-X64: 0 | struct X (base)
+// CHECK-X64: 0 | (X vbtable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 17 | struct W (base) (empty)
+// CHECK-X64: 17 | char a
+// CHECK-X64: 24 | struct V (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct B : X, U, W { char a; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct B
+// CHECK: 0 | struct X (base)
+// CHECK: 0 | (X vbtable pointer)
+// CHECK: 4 | char a
+// CHECK: 8 | struct U (base)
+// CHECK: 8 | char a
+// CHECK: 9 | struct W (base) (empty)
+// CHECK: 9 | char a
+// CHECK: 12 | struct V (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct B
+// CHECK-X64: 0 | struct X (base)
+// CHECK-X64: 0 | (X vbtable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 16 | struct U (base)
+// CHECK-X64: 16 | char a
+// CHECK-X64: 17 | struct W (base) (empty)
+// CHECK-X64: 17 | char a
+// CHECK-X64: 24 | struct V (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct C : X, V, W { char a; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | struct X (base)
+// CHECK: 0 | (X vbtable pointer)
+// CHECK: 4 | char a
+// CHECK: 9 | struct V (base) (empty)
+// CHECK: 10 | struct W (base) (empty)
+// CHECK: 10 | char a
+// CHECK: 12 | struct V (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct C
+// CHECK-X64: 0 | struct X (base)
+// CHECK-X64: 0 | (X vbtable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 17 | struct V (base) (empty)
+// CHECK-X64: 18 | struct W (base) (empty)
+// CHECK-X64: 18 | char a
+// CHECK-X64: 24 | struct V (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct D : X, U, V, W { char a; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | struct X (base)
+// CHECK: 0 | (X vbtable pointer)
+// CHECK: 4 | char a
+// CHECK: 8 | struct U (base)
+// CHECK: 8 | char a
+// CHECK: 9 | struct V (base) (empty)
+// CHECK: 10 | struct W (base) (empty)
+// CHECK: 10 | char a
+// CHECK: 12 | struct V (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct D
+// CHECK-X64: 0 | struct X (base)
+// CHECK-X64: 0 | (X vbtable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 16 | struct U (base)
+// CHECK-X64: 16 | char a
+// CHECK-X64: 17 | struct V (base) (empty)
+// CHECK-X64: 18 | struct W (base) (empty)
+// CHECK-X64: 18 | char a
+// CHECK-X64: 24 | struct V (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct E : X, U, Y, V, W { char a; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct E
+// CHECK: 0 | struct X (base)
+// CHECK: 0 | (X vbtable pointer)
+// CHECK: 4 | char a
+// CHECK: 8 | struct U (base)
+// CHECK: 8 | char a
+// CHECK: 12 | struct Y (base)
+// CHECK: 12 | (Y vbtable pointer)
+// CHECK: 16 | char a
+// CHECK: 21 | struct V (base) (empty)
+// CHECK: 22 | struct W (base) (empty)
+// CHECK: 22 | char a
+// CHECK: 24 | struct V (virtual base) (empty)
+// CHECK: | [sizeof=24, align=4
+// CHECK: | nvsize=24, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct E
+// CHECK-X64: 0 | struct X (base)
+// CHECK-X64: 0 | (X vbtable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 16 | struct U (base)
+// CHECK-X64: 16 | char a
+// CHECK-X64: 24 | struct Y (base)
+// CHECK-X64: 24 | (Y vbtable pointer)
+// CHECK-X64: 32 | char a
+// CHECK-X64: 41 | struct V (base) (empty)
+// CHECK-X64: 42 | struct W (base) (empty)
+// CHECK-X64: 42 | char a
+// CHECK-X64: 48 | struct V (virtual base) (empty)
+// CHECK-X64: | [sizeof=48, align=8
+// CHECK-X64: | nvsize=48, nvalign=8]
+
+struct F : Z, W { char a; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F
+// CHECK: 0 | struct Z (base)
+// CHECK: 0 | struct Y (base)
+// CHECK: 0 | (Y vbtable pointer)
+// CHECK: 4 | char a
+// CHECK: 9 | struct W (base) (empty)
+// CHECK: 9 | char a
+// CHECK: 12 | struct V (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F
+// CHECK-X64: 0 | struct Z (base)
+// CHECK-X64: 0 | struct Y (base)
+// CHECK-X64: 0 | (Y vbtable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 17 | struct W (base) (empty)
+// CHECK-X64: 17 | char a
+// CHECK-X64: 24 | struct V (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct G : X, W, Y, V { char a; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct G
+// CHECK: 0 | struct X (base)
+// CHECK: 0 | (X vbtable pointer)
+// CHECK: 4 | char a
+// CHECK: 9 | struct W (base) (empty)
+// CHECK: 12 | struct Y (base)
+// CHECK: 12 | (Y vbtable pointer)
+// CHECK: 16 | char a
+// CHECK: 21 | struct V (base) (empty)
+// CHECK: 21 | char a
+// CHECK: 24 | struct V (virtual base) (empty)
+// CHECK: | [sizeof=24, align=4
+// CHECK: | nvsize=24, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct G
+// CHECK-X64: 0 | struct X (base)
+// CHECK-X64: 0 | (X vbtable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 17 | struct W (base) (empty)
+// CHECK-X64: 24 | struct Y (base)
+// CHECK-X64: 24 | (Y vbtable pointer)
+// CHECK-X64: 32 | char a
+// CHECK-X64: 41 | struct V (base) (empty)
+// CHECK-X64: 41 | char a
+// CHECK-X64: 48 | struct V (virtual base) (empty)
+// CHECK-X64: | [sizeof=48, align=8
+// CHECK-X64: | nvsize=48, nvalign=8]
+
+int a[
+sizeof(A)+
+sizeof(B)+
+sizeof(C)+
+sizeof(D)+
+sizeof(E)+
+sizeof(F)+
+sizeof(G)];
diff --git a/test/Layout/ms-x86-empty-nonvirtual-bases.cpp b/test/Layout/ms-x86-empty-nonvirtual-bases.cpp
new file mode 100644
index 000000000000..01d10c9994f6
--- /dev/null
+++ b/test/Layout/ms-x86-empty-nonvirtual-bases.cpp
@@ -0,0 +1,174 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s
+
+extern "C" int printf(const char *fmt, ...);
+
+struct __declspec(align(8)) B0 { B0() {printf("B0 : %p\n", this);} };
+struct __declspec(align(8)) B1 { B1() {printf("B1 : %p\n", this);} };
+struct __declspec(align(8)) B2 { B2() {printf("B2 : %p\n", this);} };
+struct __declspec(align(8)) B3 { B3() {printf("B3 : %p\n", this);} };
+struct __declspec(align(8)) B4 { B4() {printf("B4 : %p\n", this);} };
+
+struct C0 { int a; C0() : a(0xf00000C0) {printf("C0 : %p\n", this);} };
+struct C1 { int a; C1() : a(0xf00000C1) {printf("C1 : %p\n", this);} };
+struct C2 { int a; C2() : a(0xf00000C2) {printf("C2 : %p\n", this);} };
+struct C3 { int a; C3() : a(0xf00000C3) {printf("C3 : %p\n", this);} };
+struct C4 { int a; C4() : a(0xf00000C4) {printf("C4 : %p\n", this);} };
+
+struct A : B0 {
+ int a;
+ A() : a(0xf000000A) {printf("X : %p\n", this);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct A
+// CHECK: 0 | struct B0 (base) (empty)
+// CHECK: 0 | int a
+// CHECK: | [sizeof=8, align=8
+// CHECK: | nvsize=8, nvalign=8]
+
+struct B : B0 {
+ B0 b0;
+ int a;
+ B() : a(0xf000000B) {printf("X : %p\n", this);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct B
+// CHECK: 0 | struct B0 (base) (empty)
+// CHECK: 0 | struct B0 b0 (empty)
+// CHECK: | [sizeof=8, align=8
+// CHECK: | nvsize=0, nvalign=1]
+// CHECK: 8 | int a
+// CHECK: | [sizeof=16, align=8
+// CHECK: | nvsize=16, nvalign=8]
+
+struct C : B0, B1, B2, B3, B4 {
+ int a;
+ C() : a(0xf000000C) {printf("X : %p\n", this);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | struct B0 (base) (empty)
+// CHECK: 8 | struct B1 (base) (empty)
+// CHECK: 16 | struct B2 (base) (empty)
+// CHECK: 24 | struct B3 (base) (empty)
+// CHECK: 32 | struct B4 (base) (empty)
+// CHECK: 32 | int a
+// CHECK: | [sizeof=40, align=8
+// CHECK: | nvsize=40, nvalign=8]
+
+struct D {
+ B0 b0;
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ B1 b1;
+ int a;
+ D() : a(0xf000000D) {printf("X : %p\n", this);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | struct B0 b0 (empty)
+// CHECK: | [sizeof=8, align=8
+// CHECK: | nvsize=0, nvalign=1]
+// CHECK: 8 | struct C0 c0
+// CHECK: 8 | int a
+// CHECK: | [sizeof=4, align=4
+// CHECK: | nvsize=4, nvalign=4]
+// CHECK: 12 | struct C1 c1
+// CHECK: 12 | int a
+// CHECK: | [sizeof=4, align=4
+// CHECK: | nvsize=4, nvalign=4]
+// CHECK: 16 | struct C2 c2
+// CHECK: 16 | int a
+// CHECK: | [sizeof=4, align=4
+// CHECK: | nvsize=4, nvalign=4]
+// CHECK: 24 | struct B1 b1 (empty)
+// CHECK: | [sizeof=8, align=8
+// CHECK: | nvsize=0, nvalign=1]
+// CHECK: 32 | int a
+// CHECK: | [sizeof=40, align=8
+// CHECK: | nvsize=40, nvalign=8]
+
+struct E : B0, C0, C1, C2, B1 {
+ int a;
+ E() : a(0xf000000E) {printf("X : %p\n", this);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct E
+// CHECK: 0 | struct B0 (base) (empty)
+// CHECK: 0 | struct C0 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | struct C1 (base)
+// CHECK: 4 | int a
+// CHECK: 8 | struct C2 (base)
+// CHECK: 8 | int a
+// CHECK: 16 | struct B1 (base) (empty)
+// CHECK: 16 | int a
+// CHECK: | [sizeof=24, align=8
+// CHECK: | nvsize=24, nvalign=8]
+
+struct F : C0, B0, B1, C1 {
+ int a;
+ F() : a(0xf000000F) {printf("X : %p\n", this);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F
+// CHECK: 0 | struct C0 (base)
+// CHECK: 0 | int a
+// CHECK: 8 | struct B0 (base) (empty)
+// CHECK: 16 | struct B1 (base) (empty)
+// CHECK: 16 | struct C1 (base)
+// CHECK: 16 | int a
+// CHECK: 20 | int a
+// CHECK: | [sizeof=24, align=8
+// CHECK: | nvsize=24, nvalign=8]
+
+struct G : B0, B1, B2, B3, B4 {
+ __declspec(align(32)) int a;
+ G() : a(0xf0000011) {printf("X : %p\n", this);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct G
+// CHECK: 0 | struct B0 (base) (empty)
+// CHECK: 8 | struct B1 (base) (empty)
+// CHECK: 16 | struct B2 (base) (empty)
+// CHECK: 24 | struct B3 (base) (empty)
+// CHECK: 32 | struct B4 (base) (empty)
+// CHECK: 32 | int a
+// CHECK: | [sizeof=64, align=32
+// CHECK: | nvsize=64, nvalign=32]
+
+struct __declspec(align(32)) H : B0, B1, B2, B3, B4 {
+ int a;
+ H() : a(0xf0000011) {printf("X : %p\n", this);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct H
+// CHECK: 0 | struct B0 (base) (empty)
+// CHECK: 8 | struct B1 (base) (empty)
+// CHECK: 16 | struct B2 (base) (empty)
+// CHECK: 24 | struct B3 (base) (empty)
+// CHECK: 32 | struct B4 (base) (empty)
+// CHECK: 32 | int a
+// CHECK: | [sizeof=64, align=32
+// CHECK: | nvsize=40, nvalign=8]
+
+int a[
+sizeof(A)+
+sizeof(B)+
+sizeof(C)+
+sizeof(D)+
+sizeof(E)+
+sizeof(F)+
+sizeof(G)+
+sizeof(H)];
diff --git a/test/Layout/ms-x86-empty-virtual-base.cpp b/test/Layout/ms-x86-empty-virtual-base.cpp
new file mode 100644
index 000000000000..ef6f08175e7a
--- /dev/null
+++ b/test/Layout/ms-x86-empty-virtual-base.cpp
@@ -0,0 +1,704 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+extern "C" int printf(const char *fmt, ...);
+
+struct __declspec(align(8)) B0 { B0() {printf("B0 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+struct __declspec(align(8)) B1 { B1() {printf("B1 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+struct __declspec(align(8)) B2 { B2() {printf("B2 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+struct __declspec(align(8)) B3 { B3() {printf("B3 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+struct __declspec(align(8)) B4 { B4() {printf("B4 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+
+struct C0 { int a; C0() : a(0xf00000C0) {printf("C0 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+struct C1 { int a; C1() : a(0xf00000C1) {printf("C1 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+struct C2 { int a; C2() : a(0xf00000C2) {printf("C2 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+struct C3 { int a; C3() : a(0xf00000C3) {printf("C3 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+struct C4 { int a; C4() : a(0xf00000C4) {printf("C4 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+
+struct __declspec(align(16)) D0 { D0() {printf("D0 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} virtual void f() {} };
+struct D1 { D1() {printf("D1 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+struct D2 { int a[8]; D2() {printf("D2 : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);} };
+
+struct A : virtual B0 {
+ int a;
+ A() : a(0xf000000A) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct A
+// CHECK: 0 | (A vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=8, align=8
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct A
+// CHECK-X64: 0 | (A vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct B : virtual B0 {
+ B0 b0;
+ int a;
+ B() : a(0xf000000B) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct B
+// CHECK: 0 | (B vbtable pointer)
+// CHECK: 8 | struct B0 b0 (empty)
+// CHECK: | [sizeof=8, align=8
+// CHECK: | nvsize=0, nvalign=1]
+// CHECK: 16 | int a
+// CHECK: 24 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=24, align=8
+// CHECK: | nvsize=24, nvalign=8]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct B
+// CHECK-X64: 0 | (B vbtable pointer)
+// CHECK-X64: 8 | struct B0 b0 (empty)
+// CHECK-X64: | [sizeof=8, align=8
+// CHECK-X64: | nvsize=0, nvalign=1]
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct C : virtual B0, virtual B1, virtual B2, virtual B3, virtual B4 {
+ int a;
+ C() : a(0xf000000C) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | (C vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct B0 (virtual base) (empty)
+// CHECK: 16 | struct B1 (virtual base) (empty)
+// CHECK: 24 | struct B2 (virtual base) (empty)
+// CHECK: 32 | struct B3 (virtual base) (empty)
+// CHECK: 40 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=40, align=8
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct C
+// CHECK-X64: 0 | (C vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: 24 | struct B1 (virtual base) (empty)
+// CHECK-X64: 32 | struct B2 (virtual base) (empty)
+// CHECK-X64: 40 | struct B3 (virtual base) (empty)
+// CHECK-X64: 48 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=48, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct D {
+ B0 b0;
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ B1 b1;
+ int a;
+ D() : a(0xf000000D) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | struct B0 b0 (empty)
+// CHECK: 8 | struct C0 c0
+// CHECK: 8 | int a
+// CHECK: 12 | struct C1 c1
+// CHECK: 12 | int a
+// CHECK: 16 | struct C2 c2
+// CHECK: 16 | int a
+// CHECK: 24 | struct B1 b1 (empty)
+// CHECK: 32 | int a
+// CHECK: | [sizeof=40, align=8
+// CHECK: | nvsize=40, nvalign=8]
+// CHECK-64: *** Dumping AST Record Layout
+// CHECK-64: 0 | struct D
+// CHECK-64: 0 | struct B0 b0 (empty)
+// CHECK-64: 8 | struct C0 c0
+// CHECK-64: 8 | int a
+// CHECK-64: 12 | struct C1 c1
+// CHECK-64: 12 | int a
+// CHECK-64: 16 | struct C2 c2
+// CHECK-64: 16 | int a
+// CHECK-64: 24 | struct B1 b1 (empty)
+// CHECK-64: 32 | int a
+// CHECK-64: | [sizeof=40, align=8
+// CHECK-64: | nvsize=40, nvalign=8]
+
+struct E : virtual B0, virtual C0, virtual C1, virtual C2, virtual B1 {
+ int a;
+ E() : a(0xf000000E) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct E
+// CHECK: 0 | (E vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct B0 (virtual base) (empty)
+// CHECK: 8 | struct C0 (virtual base)
+// CHECK: 8 | int a
+// CHECK: 12 | struct C1 (virtual base)
+// CHECK: 12 | int a
+// CHECK: 16 | struct C2 (virtual base)
+// CHECK: 16 | int a
+// CHECK: 24 | struct B1 (virtual base) (empty)
+// CHECK: | [sizeof=24, align=8
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct E
+// CHECK-X64: 0 | (E vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: 16 | struct C0 (virtual base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 20 | struct C1 (virtual base)
+// CHECK-X64: 20 | int a
+// CHECK-X64: 24 | struct C2 (virtual base)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 32 | struct B1 (virtual base) (empty)
+// CHECK-X64: | [sizeof=32, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct F : virtual C0, virtual B0, virtual B1, virtual C1 {
+ int a;
+ F() : a(0xf000000F) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F
+// CHECK: 0 | (F vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct C0 (virtual base)
+// CHECK: 8 | int a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: 24 | struct B1 (virtual base) (empty)
+// CHECK: 24 | struct C1 (virtual base)
+// CHECK: 24 | int a
+// CHECK: | [sizeof=32, align=8
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F
+// CHECK-X64: 0 | (F vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct C0 (virtual base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: 32 | struct B1 (virtual base) (empty)
+// CHECK-X64: 32 | struct C1 (virtual base)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=40, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct G : virtual C0, virtual B0, virtual B1, D0, virtual C1 {
+ int a;
+ G() : a(0xf0000010) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+ virtual void f() {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct G
+// CHECK: 0 | struct D0 (primary base)
+// CHECK: 0 | (D0 vftable pointer)
+// CHECK: 4 | (G vbtable pointer)
+// CHECK: 20 | int a
+// CHECK: 32 | struct C0 (virtual base)
+// CHECK: 32 | int a
+// CHECK: 40 | struct B0 (virtual base) (empty)
+// CHECK: 56 | struct B1 (virtual base) (empty)
+// CHECK: 56 | struct C1 (virtual base)
+// CHECK: 56 | int a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct G
+// CHECK-X64: 0 | struct D0 (primary base)
+// CHECK-X64: 0 | (D0 vftable pointer)
+// CHECK-X64: 8 | (G vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | struct C0 (virtual base)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 40 | struct B0 (virtual base) (empty)
+// CHECK-X64: 56 | struct B1 (virtual base) (empty)
+// CHECK-X64: 56 | struct C1 (virtual base)
+// CHECK-X64: 56 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=32, nvalign=16]
+
+struct H : virtual C0, virtual B0, virtual B1, virtual D0, virtual C1 {
+ int a;
+ H() : a(0xf0000011) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+ virtual void f() {}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct H
+// CHECK: 0 | (H vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct C0 (virtual base)
+// CHECK: 8 | int a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: 24 | struct B1 (virtual base) (empty)
+// CHECK: 44 | (vtordisp for vbase D0)
+// CHECK: 48 | struct D0 (virtual base)
+// CHECK: 48 | (D0 vftable pointer)
+// CHECK: 52 | struct C1 (virtual base)
+// CHECK: 52 | int a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct H
+// CHECK-X64: 0 | (H vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct C0 (virtual base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: 40 | struct B1 (virtual base) (empty)
+// CHECK-X64: 60 | (vtordisp for vbase D0)
+// CHECK-X64: 64 | struct D0 (virtual base)
+// CHECK-X64: 64 | (D0 vftable pointer)
+// CHECK-X64: 72 | struct C1 (virtual base)
+// CHECK-X64: 72 | int a
+// CHECK-X64: | [sizeof=80, align=16
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct I : virtual B0, virtual B1, virtual B2, virtual B3, virtual B4 {
+ __declspec(align(32)) int a;
+ I() : a(0xf0000012) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct I
+// CHECK: 0 | (I vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 64 | struct B0 (virtual base) (empty)
+// CHECK: 72 | struct B1 (virtual base) (empty)
+// CHECK: 104 | struct B2 (virtual base) (empty)
+// CHECK: 136 | struct B3 (virtual base) (empty)
+// CHECK: 168 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=192, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct I
+// CHECK-X64: 0 | (I vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 64 | struct B0 (virtual base) (empty)
+// CHECK-X64: 72 | struct B1 (virtual base) (empty)
+// CHECK-X64: 104 | struct B2 (virtual base) (empty)
+// CHECK-X64: 136 | struct B3 (virtual base) (empty)
+// CHECK-X64: 168 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=192, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct __declspec(align(32)) J : virtual B0, virtual B1, virtual B2, virtual B3, virtual B4 {
+ int a;
+ J() : a(0xf0000012) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct J
+// CHECK: 0 | (J vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct B0 (virtual base) (empty)
+// CHECK: 40 | struct B1 (virtual base) (empty)
+// CHECK: 72 | struct B2 (virtual base) (empty)
+// CHECK: 104 | struct B3 (virtual base) (empty)
+// CHECK: 136 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=160, align=32
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct J
+// CHECK-X64: 0 | (J vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: 40 | struct B1 (virtual base) (empty)
+// CHECK-X64: 72 | struct B2 (virtual base) (empty)
+// CHECK-X64: 104 | struct B3 (virtual base) (empty)
+// CHECK-X64: 136 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=160, align=32
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct K : virtual D1, virtual B1, virtual B2, virtual B3, virtual B4 {
+ __declspec(align(32)) int a;
+ K() : a(0xf0000013) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct K
+// CHECK: 0 | (K vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 64 | struct D1 (virtual base) (empty)
+// CHECK: 72 | struct B1 (virtual base) (empty)
+// CHECK: 104 | struct B2 (virtual base) (empty)
+// CHECK: 136 | struct B3 (virtual base) (empty)
+// CHECK: 168 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=192, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct K
+// CHECK-X64: 0 | (K vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 64 | struct D1 (virtual base) (empty)
+// CHECK-X64: 72 | struct B1 (virtual base) (empty)
+// CHECK-X64: 104 | struct B2 (virtual base) (empty)
+// CHECK-X64: 136 | struct B3 (virtual base) (empty)
+// CHECK-X64: 168 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=192, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct L : virtual B1, virtual D1, virtual B2, virtual B3, virtual B4 {
+ __declspec(align(32)) int a;
+ L() : a(0xf0000014) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct L
+// CHECK: 0 | (L vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 64 | struct B1 (virtual base) (empty)
+// CHECK: 68 | struct D1 (virtual base) (empty)
+// CHECK: 104 | struct B2 (virtual base) (empty)
+// CHECK: 136 | struct B3 (virtual base) (empty)
+// CHECK: 168 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=192, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct L
+// CHECK-X64: 0 | (L vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 64 | struct B1 (virtual base) (empty)
+// CHECK-X64: 68 | struct D1 (virtual base) (empty)
+// CHECK-X64: 104 | struct B2 (virtual base) (empty)
+// CHECK-X64: 136 | struct B3 (virtual base) (empty)
+// CHECK-X64: 168 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=192, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct M : virtual B1, virtual B2, virtual D1, virtual B3, virtual B4 {
+ __declspec(align(32)) int a;
+ M() : a(0xf0000015) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct M
+// CHECK: 0 | (M vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 64 | struct B1 (virtual base) (empty)
+// CHECK: 72 | struct B2 (virtual base) (empty)
+// CHECK: 100 | struct D1 (virtual base) (empty)
+// CHECK: 136 | struct B3 (virtual base) (empty)
+// CHECK: 168 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=192, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct M
+// CHECK-X64: 0 | (M vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 64 | struct B1 (virtual base) (empty)
+// CHECK-X64: 72 | struct B2 (virtual base) (empty)
+// CHECK-X64: 100 | struct D1 (virtual base) (empty)
+// CHECK-X64: 136 | struct B3 (virtual base) (empty)
+// CHECK-X64: 168 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=192, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct N : virtual C0, virtual B1, virtual D1, virtual B2, virtual B3, virtual B4 {
+ __declspec(align(32)) int a;
+ N() : a(0xf0000016) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct N
+// CHECK: 0 | (N vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 64 | struct C0 (virtual base)
+// CHECK: 64 | int a
+// CHECK: 72 | struct B1 (virtual base) (empty)
+// CHECK: 100 | struct D1 (virtual base) (empty)
+// CHECK: 136 | struct B2 (virtual base) (empty)
+// CHECK: 168 | struct B3 (virtual base) (empty)
+// CHECK: 200 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=224, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct N
+// CHECK-X64: 0 | (N vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 64 | struct C0 (virtual base)
+// CHECK-X64: 64 | int a
+// CHECK-X64: 72 | struct B1 (virtual base) (empty)
+// CHECK-X64: 100 | struct D1 (virtual base) (empty)
+// CHECK-X64: 136 | struct B2 (virtual base) (empty)
+// CHECK-X64: 168 | struct B3 (virtual base) (empty)
+// CHECK-X64: 200 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=224, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct O : virtual C0, virtual B1, virtual B2, virtual D1, virtual B3, virtual B4 {
+ __declspec(align(32)) int a;
+ O() : a(0xf0000017) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct O
+// CHECK: 0 | (O vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 64 | struct C0 (virtual base)
+// CHECK: 64 | int a
+// CHECK: 72 | struct B1 (virtual base) (empty)
+// CHECK: 104 | struct B2 (virtual base) (empty)
+// CHECK: 132 | struct D1 (virtual base) (empty)
+// CHECK: 168 | struct B3 (virtual base) (empty)
+// CHECK: 200 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=224, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct O
+// CHECK-X64: 0 | (O vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 64 | struct C0 (virtual base)
+// CHECK-X64: 64 | int a
+// CHECK-X64: 72 | struct B1 (virtual base) (empty)
+// CHECK-X64: 104 | struct B2 (virtual base) (empty)
+// CHECK-X64: 132 | struct D1 (virtual base) (empty)
+// CHECK-X64: 168 | struct B3 (virtual base) (empty)
+// CHECK-X64: 200 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=224, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct P : virtual B1, virtual C0, virtual D1, virtual B2, virtual B3, virtual B4 {
+ __declspec(align(32)) int a;
+ P() : a(0xf0000018) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct P
+// CHECK: 0 | (P vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 64 | struct B1 (virtual base) (empty)
+// CHECK: 64 | struct C0 (virtual base)
+// CHECK: 64 | int a
+// CHECK: 68 | struct D1 (virtual base) (empty)
+// CHECK: 104 | struct B2 (virtual base) (empty)
+// CHECK: 136 | struct B3 (virtual base) (empty)
+// CHECK: 168 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=192, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct P
+// CHECK-X64: 0 | (P vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 64 | struct B1 (virtual base) (empty)
+// CHECK-X64: 64 | struct C0 (virtual base)
+// CHECK-X64: 64 | int a
+// CHECK-X64: 68 | struct D1 (virtual base) (empty)
+// CHECK-X64: 104 | struct B2 (virtual base) (empty)
+// CHECK-X64: 136 | struct B3 (virtual base) (empty)
+// CHECK-X64: 168 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=192, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct Q : virtual B1, virtual C0, virtual B2, virtual D1, virtual B3, virtual B4 {
+ __declspec(align(32)) int a;
+ Q() : a(0xf0000019) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct Q
+// CHECK: 0 | (Q vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 64 | struct B1 (virtual base) (empty)
+// CHECK: 64 | struct C0 (virtual base)
+// CHECK: 64 | int a
+// CHECK: 72 | struct B2 (virtual base) (empty)
+// CHECK: 100 | struct D1 (virtual base) (empty)
+// CHECK: 136 | struct B3 (virtual base) (empty)
+// CHECK: 168 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=192, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct Q
+// CHECK-X64: 0 | (Q vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 64 | struct B1 (virtual base) (empty)
+// CHECK-X64: 64 | struct C0 (virtual base)
+// CHECK-X64: 64 | int a
+// CHECK-X64: 72 | struct B2 (virtual base) (empty)
+// CHECK-X64: 100 | struct D1 (virtual base) (empty)
+// CHECK-X64: 136 | struct B3 (virtual base) (empty)
+// CHECK-X64: 168 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=192, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct R : virtual B0, virtual B1, virtual B2, virtual C0, virtual B3, virtual B4 {
+ __declspec(align(32)) int a;
+ R() : a(0xf0000020) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct R
+// CHECK: 0 | (R vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 64 | struct B0 (virtual base) (empty)
+// CHECK: 72 | struct B1 (virtual base) (empty)
+// CHECK: 104 | struct B2 (virtual base) (empty)
+// CHECK: 104 | struct C0 (virtual base)
+// CHECK: 104 | int a
+// CHECK: 112 | struct B3 (virtual base) (empty)
+// CHECK: 136 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=160, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct R
+// CHECK-X64: 0 | (R vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 64 | struct B0 (virtual base) (empty)
+// CHECK-X64: 72 | struct B1 (virtual base) (empty)
+// CHECK-X64: 104 | struct B2 (virtual base) (empty)
+// CHECK-X64: 104 | struct C0 (virtual base)
+// CHECK-X64: 104 | int a
+// CHECK-X64: 112 | struct B3 (virtual base) (empty)
+// CHECK-X64: 136 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=160, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct S : virtual B0, virtual B1, virtual C0, virtual B2, virtual B3, virtual B4 {
+ __declspec(align(32)) int a;
+ S() : a(0xf0000021) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct S
+// CHECK: 0 | (S vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 64 | struct B0 (virtual base) (empty)
+// CHECK: 72 | struct B1 (virtual base) (empty)
+// CHECK: 72 | struct C0 (virtual base)
+// CHECK: 72 | int a
+// CHECK: 80 | struct B2 (virtual base) (empty)
+// CHECK: 104 | struct B3 (virtual base) (empty)
+// CHECK: 136 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=160, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct S
+// CHECK-X64: 0 | (S vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 64 | struct B0 (virtual base) (empty)
+// CHECK-X64: 72 | struct B1 (virtual base) (empty)
+// CHECK-X64: 72 | struct C0 (virtual base)
+// CHECK-X64: 72 | int a
+// CHECK-X64: 80 | struct B2 (virtual base) (empty)
+// CHECK-X64: 104 | struct B3 (virtual base) (empty)
+// CHECK-X64: 136 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=160, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct T : virtual B0, virtual B1, virtual C0, virtual D2, virtual B2, virtual B3, virtual B4 {
+ __declspec(align(16)) int a;
+ T() : a(0xf0000022) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct T
+// CHECK: 0 | (T vbtable pointer)
+// CHECK: 16 | int a
+// CHECK: 32 | struct B0 (virtual base) (empty)
+// CHECK: 40 | struct B1 (virtual base) (empty)
+// CHECK: 40 | struct C0 (virtual base)
+// CHECK: 40 | int a
+// CHECK: 44 | struct D2 (virtual base)
+// CHECK: 44 | int [8] a
+// CHECK: 80 | struct B2 (virtual base) (empty)
+// CHECK: 88 | struct B3 (virtual base) (empty)
+// CHECK: 104 | struct B4 (virtual base) (empty)
+// CHECK: | [sizeof=112, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct T
+// CHECK-X64: 0 | (T vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | struct B0 (virtual base) (empty)
+// CHECK-X64: 40 | struct B1 (virtual base) (empty)
+// CHECK-X64: 40 | struct C0 (virtual base)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 44 | struct D2 (virtual base)
+// CHECK-X64: 44 | int [8] a
+// CHECK-X64: 80 | struct B2 (virtual base) (empty)
+// CHECK-X64: 88 | struct B3 (virtual base) (empty)
+// CHECK-X64: 104 | struct B4 (virtual base) (empty)
+// CHECK-X64: | [sizeof=112, align=16
+// CHECK-X64: | nvsize=32, nvalign=16]
+
+struct __declspec(align(32)) U : virtual B0, virtual B1 {
+ int a;
+ U() : a(0xf0000023) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct U
+// CHECK: 0 | (U vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct B0 (virtual base) (empty)
+// CHECK: 40 | struct B1 (virtual base) (empty)
+// CHECK: | [sizeof=64, align=32
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct U
+// CHECK-X64: 0 | (U vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: 40 | struct B1 (virtual base) (empty)
+// CHECK-X64: | [sizeof=64, align=32
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct __declspec(align(32)) V : virtual D1 {
+ int a;
+ V() : a(0xf0000024) {printf("X : %3d\n", ((int)(__SIZE_TYPE__)this)&0xfff);}
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct V
+// CHECK: 0 | (V vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct D1 (virtual base) (empty)
+// CHECK: | [sizeof=32, align=32
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct V
+// CHECK-X64: 0 | (V vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct D1 (virtual base) (empty)
+// CHECK-X64: | [sizeof=32, align=32
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+int a[
+sizeof(A)+
+sizeof(B)+
+sizeof(C)+
+sizeof(D)+
+sizeof(E)+
+sizeof(F)+
+sizeof(G)+
+sizeof(H)+
+sizeof(I)+
+sizeof(J)+
+sizeof(K)+
+sizeof(L)+
+sizeof(M)+
+sizeof(N)+
+sizeof(O)+
+sizeof(P)+
+sizeof(Q)+
+sizeof(R)+
+sizeof(S)+
+sizeof(T)+
+sizeof(U)+
+sizeof(V)]; \ No newline at end of file
diff --git a/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp b/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp
new file mode 100644
index 000000000000..7dd3fad5bf45
--- /dev/null
+++ b/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp
@@ -0,0 +1,735 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+extern "C" int printf(const char *fmt, ...);
+
+struct B0 { B0() { printf("B0 = %p\n", this); } };
+struct B1 { B1() { printf("B1 = %p\n", this); } };
+struct B2 { B2() { printf("B2 = %p\n", this); } };
+struct B3 { B3() { printf("B3 = %p\n", this); } };
+struct B4 { B4() { printf("B4 = %p\n", this); } };
+struct B5 { B5() { printf("B5 = %p\n", this); } };
+struct __declspec(align(2)) B6 { B6() { printf("B6 = %p\n", this); } };
+struct __declspec(align(16)) B7 { B7() { printf("B7 = %p\n", this); } };
+struct B8 { char c[5]; B8() { printf("B8 = %p\n", this); } };
+struct B9 { char c[6]; B9() { printf("B9 = %p\n", this); } };
+struct B10 { char c[7]; B10() { printf("B10 = %p\n", this); } };
+struct B11 { char c[8]; B11() { printf("B11 = %p\n", this); } };
+struct B0X { B0X() { printf("B0 = %p\n", this); } };
+struct B1X { B1X() { printf("B1 = %p\n", this); } };
+struct __declspec(align(16)) B2X { B2X() { printf("B2 = %p\n", this); } };
+struct __declspec(align(2)) B3X { B3X() { printf("B3 = %p\n", this); } };
+struct B4X { B4X() { printf("B4 = %p\n", this); } };
+struct B5X { B5X() { printf("B5 = %p\n", this); } };
+struct B6X { B6X() { printf("B6 = %p\n", this); } };
+struct B8X { short a; B8X() : a(0xf00000B8) { printf("B8 = %p\n", this); } };
+
+struct AA : B8, B1, virtual B0 {
+ int a;
+ AA() : a(0xf00000AA) { printf("AA = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AA
+// CHECK: 0 | struct B8 (base)
+// CHECK: 0 | char [5] c
+// CHECK: 13 | struct B1 (base) (empty)
+// CHECK: 8 | (AA vbtable pointer)
+// CHECK: 16 | int a
+// CHECK: 20 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=20, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AA
+// CHECK-X64: 0 | struct B8 (base)
+// CHECK-X64: 0 | char [5] c
+// CHECK-X64: 17 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AA vbtable pointer)
+// CHECK-X64: 20 | int a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AB : B8, B1, virtual B0 {
+ short a;
+ AB() : a(0xf00000AB) { printf("AB = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AB
+// CHECK: 0 | struct B8 (base)
+// CHECK: 0 | char [5] c
+// CHECK: 13 | struct B1 (base) (empty)
+// CHECK: 8 | (AB vbtable pointer)
+// CHECK: 14 | short a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AB
+// CHECK-X64: 0 | struct B8 (base)
+// CHECK-X64: 0 | char [5] c
+// CHECK-X64: 17 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AB vbtable pointer)
+// CHECK-X64: 18 | short a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AC : B8, B1, virtual B0 {
+ char a;
+ AC() : a(0xf00000AC) { printf("AC = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AC
+// CHECK: 0 | struct B8 (base)
+// CHECK: 0 | char [5] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AC vbtable pointer)
+// CHECK: 12 | char a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AC
+// CHECK-X64: 0 | struct B8 (base)
+// CHECK-X64: 0 | char [5] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AC vbtable pointer)
+// CHECK-X64: 16 | char a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AD : B8, B1, virtual B0 {
+ AD() { printf("AD = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AD
+// CHECK: 0 | struct B8 (base)
+// CHECK: 0 | char [5] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AD vbtable pointer)
+// CHECK: 12 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AD
+// CHECK-X64: 0 | struct B8 (base)
+// CHECK-X64: 0 | char [5] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AD vbtable pointer)
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct AA1 : B9, B1, virtual B0 {
+ int a;
+ AA1() : a(0xf0000AA1) { printf("AA1 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AA1
+// CHECK: 0 | struct B9 (base)
+// CHECK: 0 | char [6] c
+// CHECK: 14 | struct B1 (base) (empty)
+// CHECK: 8 | (AA1 vbtable pointer)
+// CHECK: 16 | int a
+// CHECK: 20 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=20, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AA1
+// CHECK-X64: 0 | struct B9 (base)
+// CHECK-X64: 0 | char [6] c
+// CHECK-X64: 18 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AA1 vbtable pointer)
+// CHECK-X64: 20 | int a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AB1 : B9, B1, virtual B0 {
+ short a;
+ AB1() : a(0xf0000AB1) { printf("AB1 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AB1
+// CHECK: 0 | struct B9 (base)
+// CHECK: 0 | char [6] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AB1 vbtable pointer)
+// CHECK: 12 | short a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AB1
+// CHECK-X64: 0 | struct B9 (base)
+// CHECK-X64: 0 | char [6] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AB1 vbtable pointer)
+// CHECK-X64: 16 | short a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AC1 : B9, B1, virtual B0 {
+ char a;
+ AC1() : a(0xf0000AC1) { printf("AC1 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AC1
+// CHECK: 0 | struct B9 (base)
+// CHECK: 0 | char [6] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AC1 vbtable pointer)
+// CHECK: 12 | char a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AC1
+// CHECK-X64: 0 | struct B9 (base)
+// CHECK-X64: 0 | char [6] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AC1 vbtable pointer)
+// CHECK-X64: 16 | char a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AD1 : B9, B1, virtual B0 {
+ AD1() { printf("AD1 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AD1
+// CHECK: 0 | struct B9 (base)
+// CHECK: 0 | char [6] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AD1 vbtable pointer)
+// CHECK: 12 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AD1
+// CHECK-X64: 0 | struct B9 (base)
+// CHECK-X64: 0 | char [6] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AD1 vbtable pointer)
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct AA2 : B10, B1, virtual B0 {
+ int a;
+ AA2() : a(0xf0000AA2) { printf("AA2 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AA2
+// CHECK: 0 | struct B10 (base)
+// CHECK: 0 | char [7] c
+// CHECK: 15 | struct B1 (base) (empty)
+// CHECK: 8 | (AA2 vbtable pointer)
+// CHECK: 16 | int a
+// CHECK: 20 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=20, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AA2
+// CHECK-X64: 0 | struct B10 (base)
+// CHECK-X64: 0 | char [7] c
+// CHECK-X64: 19 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AA2 vbtable pointer)
+// CHECK-X64: 20 | int a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AB2 : B10, B1, virtual B0 {
+ short a;
+ AB2() : a(0xf0000AB2) { printf("AB2 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AB2
+// CHECK: 0 | struct B10 (base)
+// CHECK: 0 | char [7] c
+// CHECK: 13 | struct B1 (base) (empty)
+// CHECK: 8 | (AB2 vbtable pointer)
+// CHECK: 14 | short a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AB2
+// CHECK-X64: 0 | struct B10 (base)
+// CHECK-X64: 0 | char [7] c
+// CHECK-X64: 17 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AB2 vbtable pointer)
+// CHECK-X64: 18 | short a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AC2 : B10, B1, virtual B0 {
+ char a;
+ AC2() : a(0xf0000AC2) { printf("AC2 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AC2
+// CHECK: 0 | struct B10 (base)
+// CHECK: 0 | char [7] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AC2 vbtable pointer)
+// CHECK: 12 | char a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AC2
+// CHECK-X64: 0 | struct B10 (base)
+// CHECK-X64: 0 | char [7] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AC2 vbtable pointer)
+// CHECK-X64: 16 | char a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AD2 : B10, B1, virtual B0 {
+ AD2() { printf("AD2 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AD2
+// CHECK: 0 | struct B10 (base)
+// CHECK: 0 | char [7] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AD2 vbtable pointer)
+// CHECK: 12 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AD2
+// CHECK-X64: 0 | struct B10 (base)
+// CHECK-X64: 0 | char [7] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AD2 vbtable pointer)
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct AA3 : B11, B1, virtual B0 {
+ int a;
+ AA3() : a(0xf0000AA3) { printf("AA3 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AA3
+// CHECK: 0 | struct B11 (base)
+// CHECK: 0 | char [8] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AA3 vbtable pointer)
+// CHECK: 12 | int a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AA3
+// CHECK-X64: 0 | struct B11 (base)
+// CHECK-X64: 0 | char [8] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AA3 vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AB3 : B11, B1, virtual B0 {
+ short a;
+ AB3() : a(0xf0000AB3) { printf("AB3 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AB3
+// CHECK: 0 | struct B11 (base)
+// CHECK: 0 | char [8] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AB3 vbtable pointer)
+// CHECK: 12 | short a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AB3
+// CHECK-X64: 0 | struct B11 (base)
+// CHECK-X64: 0 | char [8] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AB3 vbtable pointer)
+// CHECK-X64: 16 | short a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AC3 : B11, B1, virtual B0 {
+ char a;
+ AC3() : a(0xf0000AC3) { printf("AC3 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AC3
+// CHECK: 0 | struct B11 (base)
+// CHECK: 0 | char [8] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AC3 vbtable pointer)
+// CHECK: 12 | char a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AC3
+// CHECK-X64: 0 | struct B11 (base)
+// CHECK-X64: 0 | char [8] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AC3 vbtable pointer)
+// CHECK-X64: 16 | char a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AD3 : B11, B1, virtual B0 {
+ AD3() { printf("AD3 = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AD3
+// CHECK: 0 | struct B11 (base)
+// CHECK: 0 | char [8] c
+// CHECK: 12 | struct B1 (base) (empty)
+// CHECK: 8 | (AD3 vbtable pointer)
+// CHECK: 12 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AD3
+// CHECK-X64: 0 | struct B11 (base)
+// CHECK-X64: 0 | char [8] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (AD3 vbtable pointer)
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct B : B1, B2, virtual B0 {
+ B() { printf("B = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct B
+// CHECK: 0 | struct B1 (base) (empty)
+// CHECK: 8 | struct B2 (base) (empty)
+// CHECK: 4 | (B vbtable pointer)
+// CHECK: 8 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=8, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct B
+// CHECK-X64: 0 | struct B1 (base) (empty)
+// CHECK-X64: 16 | struct B2 (base) (empty)
+// CHECK-X64: 8 | (B vbtable pointer)
+// CHECK-X64: 16 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct C : B1, B2, B3, virtual B0 {
+ char a;
+ C() : a(0xf000000C) { printf("C = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | struct B1 (base) (empty)
+// CHECK: 1 | struct B2 (base) (empty)
+// CHECK: 8 | struct B3 (base) (empty)
+// CHECK: 4 | (C vbtable pointer)
+// CHECK: 8 | char a
+// CHECK: 12 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct C
+// CHECK-X64: 0 | struct B1 (base) (empty)
+// CHECK-X64: 1 | struct B2 (base) (empty)
+// CHECK-X64: 16 | struct B3 (base) (empty)
+// CHECK-X64: 8 | (C vbtable pointer)
+// CHECK-X64: 16 | char a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct D : B1, B2, B3, B4, B5, virtual B0 {
+ int a;
+ D() : a(0xf000000D) { printf("D = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | struct B1 (base) (empty)
+// CHECK: 1 | struct B2 (base) (empty)
+// CHECK: 2 | struct B3 (base) (empty)
+// CHECK: 3 | struct B4 (base) (empty)
+// CHECK: 8 | struct B5 (base) (empty)
+// CHECK: 4 | (D vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 12 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct D
+// CHECK-X64: 0 | struct B1 (base) (empty)
+// CHECK-X64: 1 | struct B2 (base) (empty)
+// CHECK-X64: 2 | struct B3 (base) (empty)
+// CHECK-X64: 3 | struct B4 (base) (empty)
+// CHECK-X64: 16 | struct B5 (base) (empty)
+// CHECK-X64: 8 | (D vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct E : B1, B6, B3, B4, B5, virtual B0 {
+ int a;
+ E() : a(0xf000000E) { printf("E = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct E
+// CHECK: 0 | struct B1 (base) (empty)
+// CHECK: 2 | struct B6 (base) (empty)
+// CHECK: 3 | struct B3 (base) (empty)
+// CHECK: 4 | struct B4 (base) (empty)
+// CHECK: 13 | struct B5 (base) (empty)
+// CHECK: 8 | (E vbtable pointer)
+// CHECK: 16 | int a
+// CHECK: 20 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=20, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct E
+// CHECK-X64: 0 | struct B1 (base) (empty)
+// CHECK-X64: 2 | struct B6 (base) (empty)
+// CHECK-X64: 3 | struct B3 (base) (empty)
+// CHECK-X64: 4 | struct B4 (base) (empty)
+// CHECK-X64: 17 | struct B5 (base) (empty)
+// CHECK-X64: 8 | (E vbtable pointer)
+// CHECK-X64: 20 | int a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct F : B1, B6, B4, B8, B5, virtual B0 {
+ int a;
+ F() : a(0xf000000F) { printf("&a = %p\n", &a); printf("F = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F
+// CHECK: 0 | struct B1 (base) (empty)
+// CHECK: 2 | struct B6 (base) (empty)
+// CHECK: 3 | struct B4 (base) (empty)
+// CHECK: 3 | struct B8 (base)
+// CHECK: 3 | char [5] c
+// CHECK: 12 | struct B5 (base) (empty)
+// CHECK: 8 | (F vbtable pointer)
+// CHECK: 12 | int a
+// CHECK: 16 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F
+// CHECK-X64: 0 | struct B1 (base) (empty)
+// CHECK-X64: 2 | struct B6 (base) (empty)
+// CHECK-X64: 3 | struct B4 (base) (empty)
+// CHECK-X64: 3 | struct B8 (base)
+// CHECK-X64: 3 | char [5] c
+// CHECK-X64: 16 | struct B5 (base) (empty)
+// CHECK-X64: 8 | (F vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct G : B8, B1, virtual B0 {
+ int a;
+ __declspec(align(16)) int a1;
+ G() : a(0xf0000010), a1(0xf0000010) { printf("G = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct G
+// CHECK: 0 | struct B8 (base)
+// CHECK: 0 | char [5] c
+// CHECK: 21 | struct B1 (base) (empty)
+// CHECK: 8 | (G vbtable pointer)
+// CHECK: 24 | int a
+// CHECK: 32 | int a1
+// CHECK: 48 | struct B0 (virtual base) (empty)
+// CHECK: | [sizeof=48, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct G
+// CHECK-X64: 0 | struct B8 (base)
+// CHECK-X64: 0 | char [5] c
+// CHECK-X64: 16 | struct B1 (base) (empty)
+// CHECK-X64: 8 | (G vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | int a1
+// CHECK-X64: 48 | struct B0 (virtual base) (empty)
+// CHECK-X64: | [sizeof=48, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct AX : B1X, B2X, B3X, B4X, virtual B0X {
+ int a;
+ AX() : a(0xf000000A) { printf(" A = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AX
+// CHECK: 0 | struct B1X (base) (empty)
+// CHECK: 16 | struct B2X (base) (empty)
+// CHECK: 18 | struct B3X (base) (empty)
+// CHECK: 35 | struct B4X (base) (empty)
+// CHECK: 20 | (AX vbtable pointer)
+// CHECK: 36 | int a
+// CHECK: 48 | struct B0X (virtual base) (empty)
+// CHECK: | [sizeof=48, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AX
+// CHECK-X64: 0 | struct B1X (base) (empty)
+// CHECK-X64: 16 | struct B2X (base) (empty)
+// CHECK-X64: 18 | struct B3X (base) (empty)
+// CHECK-X64: 33 | struct B4X (base) (empty)
+// CHECK-X64: 24 | (AX vbtable pointer)
+// CHECK-X64: 36 | int a
+// CHECK-X64: 48 | struct B0X (virtual base) (empty)
+// CHECK-X64: | [sizeof=48, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct BX : B2X, B1X, B3X, B4X, virtual B0X {
+ int a;
+ BX() : a(0xf000000B) { printf(" B = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct BX
+// CHECK: 0 | struct B2X (base) (empty)
+// CHECK: 1 | struct B1X (base) (empty)
+// CHECK: 2 | struct B3X (base) (empty)
+// CHECK: 19 | struct B4X (base) (empty)
+// CHECK: 4 | (BX vbtable pointer)
+// CHECK: 20 | int a
+// CHECK: 32 | struct B0X (virtual base) (empty)
+// CHECK: | [sizeof=32, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct BX
+// CHECK-X64: 0 | struct B2X (base) (empty)
+// CHECK-X64: 1 | struct B1X (base) (empty)
+// CHECK-X64: 2 | struct B3X (base) (empty)
+// CHECK-X64: 17 | struct B4X (base) (empty)
+// CHECK-X64: 8 | (BX vbtable pointer)
+// CHECK-X64: 20 | int a
+// CHECK-X64: 32 | struct B0X (virtual base) (empty)
+// CHECK-X64: | [sizeof=32, align=16
+// CHECK-X64: | nvsize=32, nvalign=16]
+
+struct CX : B1X, B3X, B2X, virtual B0X {
+ int a;
+ CX() : a(0xf000000C) { printf(" C = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct CX
+// CHECK: 0 | struct B1X (base) (empty)
+// CHECK: 2 | struct B3X (base) (empty)
+// CHECK: 32 | struct B2X (base) (empty)
+// CHECK: 4 | (CX vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 48 | struct B0X (virtual base) (empty)
+// CHECK: | [sizeof=48, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct CX
+// CHECK-X64: 0 | struct B1X (base) (empty)
+// CHECK-X64: 2 | struct B3X (base) (empty)
+// CHECK-X64: 32 | struct B2X (base) (empty)
+// CHECK-X64: 8 | (CX vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct B0X (virtual base) (empty)
+// CHECK-X64: | [sizeof=48, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct DX : B8X, B1X, virtual B0X {
+ int a;
+ DX() : a(0xf000000D) { printf(" D = %p\n", this); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct DX
+// CHECK: 0 | struct B8X (base)
+// CHECK: 0 | short a
+// CHECK: 10 | struct B1X (base) (empty)
+// CHECK: 4 | (DX vbtable pointer)
+// CHECK: 12 | int a
+// CHECK: 16 | struct B0X (virtual base) (empty)
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct DX
+// CHECK-X64: 0 | struct B8X (base)
+// CHECK-X64: 0 | short a
+// CHECK-X64: 18 | struct B1X (base) (empty)
+// CHECK-X64: 8 | (DX vbtable pointer)
+// CHECK-X64: 20 | int a
+// CHECK-X64: 24 | struct B0X (virtual base) (empty)
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+int a[
+sizeof(AA)+
+sizeof(AB)+
+sizeof(AC)+
+sizeof(AD)+
+sizeof(AA1)+
+sizeof(AB1)+
+sizeof(AC1)+
+sizeof(AD1)+
+sizeof(AA2)+
+sizeof(AB2)+
+sizeof(AC2)+
+sizeof(AD2)+
+sizeof(AA3)+
+sizeof(AB3)+
+sizeof(AC3)+
+sizeof(AD3)+
+sizeof(B)+
+sizeof(C)+
+sizeof(D)+
+sizeof(E)+
+sizeof(F)+
+sizeof(G)+
+sizeof(AX)+
+sizeof(BX)+
+sizeof(CX)+
+sizeof(DX)];
diff --git a/test/Layout/ms-x86-misalignedarray.cpp b/test/Layout/ms-x86-misalignedarray.cpp
new file mode 100644
index 000000000000..f6887daf15b6
--- /dev/null
+++ b/test/Layout/ms-x86-misalignedarray.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+struct T0 { char c; };
+struct T2 : virtual T0 { };
+struct T3 { T2 a[1]; char c; };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct T3
+// CHECK: 0 | struct T2 [1] a
+// CHECK: 5 | char c
+// CHECK: | [sizeof=8, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct T3
+// CHECK-X64: 0 | struct T2 [1] a
+// CHECK-X64: 16 | char c
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+int a[sizeof(T3)];
diff --git a/test/Layout/ms-x86-primary-bases.cpp b/test/Layout/ms-x86-primary-bases.cpp
new file mode 100644
index 000000000000..bc9b801d99c8
--- /dev/null
+++ b/test/Layout/ms-x86-primary-bases.cpp
@@ -0,0 +1,317 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+extern "C" int printf(const char *fmt, ...);
+
+struct B0 { int a; B0() : a(0xf00000B0) { printf("B0 = %p\n", this); } virtual void f() { printf("B0"); } };
+struct B1 { int a; B1() : a(0xf00000B1) { printf("B1 = %p\n", this); } virtual void g() { printf("B1"); } };
+struct B2 { int a; B2() : a(0xf00000B2) { printf("B1 = %p\n", this); } };
+struct B0X { int a; B0X() : a(0xf00000B0) {} };
+struct B1X { int a; B1X() : a(0xf00000B1) {} virtual void f() { printf("B0"); } };
+struct B2X : virtual B1X { int a; B2X() : a(0xf00000B2) {} };
+
+struct A : virtual B0 {
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct A
+// CHECK: 0 | (A vbtable pointer)
+// CHECK: 4 | struct B0 (virtual base)
+// CHECK: 4 | (B0 vftable pointer)
+// CHECK: 8 | int a
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=4, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct A
+// CHECK-X64: 0 | (A vbtable pointer)
+// CHECK-X64: 8 | struct B0 (virtual base)
+// CHECK-X64: 8 | (B0 vftable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=8, nvalign=8]
+
+struct B : virtual B0 {
+ virtual void f() { printf("B"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct B
+// CHECK: 0 | (B vbtable pointer)
+// CHECK: 4 | struct B0 (virtual base)
+// CHECK: 4 | (B0 vftable pointer)
+// CHECK: 8 | int a
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=4, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct B
+// CHECK-X64: 0 | (B vbtable pointer)
+// CHECK-X64: 8 | struct B0 (virtual base)
+// CHECK-X64: 8 | (B0 vftable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=8, nvalign=8]
+
+struct C : virtual B0 {
+ virtual void g() { printf("A"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | (C vftable pointer)
+// CHECK: 4 | (C vbtable pointer)
+// CHECK: 8 | struct B0 (virtual base)
+// CHECK: 8 | (B0 vftable pointer)
+// CHECK: 12 | int a
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct C
+// CHECK-X64: 0 | (C vftable pointer)
+// CHECK-X64: 8 | (C vbtable pointer)
+// CHECK-X64: 16 | struct B0 (virtual base)
+// CHECK-X64: 16 | (B0 vftable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: | [sizeof=32, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct D : virtual B2, virtual B0 {
+ virtual void f() { printf("D"); }
+ virtual void g() { printf("D"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | (D vftable pointer)
+// CHECK: 4 | (D vbtable pointer)
+// CHECK: 8 | struct B2 (virtual base)
+// CHECK: 8 | int a
+// CHECK: 12 | struct B0 (virtual base)
+// CHECK: 12 | (B0 vftable pointer)
+// CHECK: 16 | int a
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct D
+// CHECK-X64: 0 | (D vftable pointer)
+// CHECK-X64: 8 | (D vbtable pointer)
+// CHECK-X64: 16 | struct B2 (virtual base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct B0 (virtual base)
+// CHECK-X64: 24 | (B0 vftable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=40, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct E : B0, virtual B1 {
+ virtual void f() { printf("E"); }
+ virtual void g() { printf("E"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct E
+// CHECK: 0 | struct B0 (primary base)
+// CHECK: 0 | (B0 vftable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | (E vbtable pointer)
+// CHECK: 12 | struct B1 (virtual base)
+// CHECK: 12 | (B1 vftable pointer)
+// CHECK: 16 | int a
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct E
+// CHECK-X64: 0 | struct B0 (primary base)
+// CHECK-X64: 0 | (B0 vftable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | (E vbtable pointer)
+// CHECK-X64: 24 | struct B1 (virtual base)
+// CHECK-X64: 24 | (B1 vftable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=40, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct F : virtual B0, virtual B1 {
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F
+// CHECK: 0 | (F vbtable pointer)
+// CHECK: 4 | struct B0 (virtual base)
+// CHECK: 4 | (B0 vftable pointer)
+// CHECK: 8 | int a
+// CHECK: 12 | struct B1 (virtual base)
+// CHECK: 12 | (B1 vftable pointer)
+// CHECK: 16 | int a
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=4, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F
+// CHECK-X64: 0 | (F vbtable pointer)
+// CHECK-X64: 8 | struct B0 (virtual base)
+// CHECK-X64: 8 | (B0 vftable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct B1 (virtual base)
+// CHECK-X64: 24 | (B1 vftable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=40, align=8
+// CHECK-X64: | nvsize=8, nvalign=8]
+
+struct AX : B0X, B1X { int a; AX() : a(0xf000000A) {} virtual void f() { printf("A"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct AX
+// CHECK: 8 | struct B0X (base)
+// CHECK: 8 | int a
+// CHECK: 0 | struct B1X (primary base)
+// CHECK: 0 | (B1X vftable pointer)
+// CHECK: 4 | int a
+// CHECK: 12 | int a
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct AX
+// CHECK-X64: 16 | struct B0X (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 0 | struct B1X (primary base)
+// CHECK-X64: 0 | (B1X vftable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 20 | int a
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct BX : B0X, B1X { int a; BX() : a(0xf000000B) {} virtual void g() { printf("B"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct BX
+// CHECK: 8 | struct B0X (base)
+// CHECK: 8 | int a
+// CHECK: 0 | struct B1X (primary base)
+// CHECK: 0 | (B1X vftable pointer)
+// CHECK: 4 | int a
+// CHECK: 12 | int a
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=16, nvalign=4]
+// CHECK-x64: *** Dumping AST Record Layout
+// CHECK-x64: 0 | struct BX
+// CHECK-x64: 16 | struct B0X (base)
+// CHECK-x64: 16 | int a
+// CHECK-x64: 0 | struct B1X (primary base)
+// CHECK-x64: 0 | (B1X vftable pointer)
+// CHECK-x64: 8 | int a
+// CHECK-x64: 24 | int a
+// CHECK-x64: | [sizeof=24, align=8
+// CHECK-x64: | nvsize=24, nvalign=8]
+
+struct CX : B0X, B2X { int a; CX() : a(0xf000000C) {} virtual void g() { printf("C"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct CX
+// CHECK: 0 | (CX vftable pointer)
+// CHECK: 4 | struct B0X (base)
+// CHECK: 4 | int a
+// CHECK: 8 | struct B2X (base)
+// CHECK: 8 | (B2X vbtable pointer)
+// CHECK: 12 | int a
+// CHECK: 16 | int a
+// CHECK: 20 | struct B1X (virtual base)
+// CHECK: 20 | (B1X vftable pointer)
+// CHECK: 24 | int a
+// CHECK: | [sizeof=28, align=4
+// CHECK: | nvsize=20, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct CX
+// CHECK-X64: 0 | (CX vftable pointer)
+// CHECK-X64: 8 | struct B0X (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B2X (base)
+// CHECK-X64: 16 | (B2X vbtable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 32 | int a
+// CHECK-X64: 40 | struct B1X (virtual base)
+// CHECK-X64: 40 | (B1X vftable pointer)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=56, align=8
+// CHECK-X64: | nvsize=40, nvalign=8]
+
+struct DX : virtual B1X { int a; DX() : a(0xf000000D) {} virtual void f() { printf("D"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct DX
+// CHECK: 0 | (DX vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | (vtordisp for vbase B1X)
+// CHECK: 12 | struct B1X (virtual base)
+// CHECK: 12 | (B1X vftable pointer)
+// CHECK: 16 | int a
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct DX
+// CHECK-X64: 0 | (DX vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 20 | (vtordisp for vbase B1X)
+// CHECK-X64: 24 | struct B1X (virtual base)
+// CHECK-X64: 24 | (B1X vftable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=40, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct EX : virtual B1X { int a; EX() : a(0xf000000E) {} virtual void g() { printf("E"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct EX
+// CHECK: 0 | (EX vftable pointer)
+// CHECK: 4 | (EX vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 12 | struct B1X (virtual base)
+// CHECK: 12 | (B1X vftable pointer)
+// CHECK: 16 | int a
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct EX
+// CHECK-X64: 0 | (EX vftable pointer)
+// CHECK-X64: 8 | (EX vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct B1X (virtual base)
+// CHECK-X64: 24 | (B1X vftable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=40, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct FX : virtual B1X { int a; FX() : a(0xf000000F) {} };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct FX
+// CHECK: 0 | (FX vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct B1X (virtual base)
+// CHECK: 8 | (B1X vftable pointer)
+// CHECK: 12 | int a
+// CHECK: | [sizeof=16, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct FX
+// CHECK-X64: 0 | (FX vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B1X (virtual base)
+// CHECK-X64: 16 | (B1X vftable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: | [sizeof=32, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+int a[
+sizeof(A)+
+sizeof(B)+
+sizeof(C)+
+sizeof(D)+
+sizeof(E)+
+sizeof(F)+
+sizeof(AX)+
+sizeof(BX)+
+sizeof(CX)+
+sizeof(DX)+
+sizeof(EX)+
+sizeof(FX)];
diff --git a/test/Layout/ms-x86-size-alignment-fail.cpp b/test/Layout/ms-x86-size-alignment-fail.cpp
new file mode 100644
index 000000000000..f998ee12c8d1
--- /dev/null
+++ b/test/Layout/ms-x86-size-alignment-fail.cpp
@@ -0,0 +1,123 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+extern "C" int printf(const char *fmt, ...);
+
+struct B0 { char a; B0() : a(0xB0) {} };
+struct __declspec(align(1)) B1 {};
+
+struct A : virtual B0 {};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct A
+// CHECK: 0 | (A vbtable pointer)
+// CHECK: 4 | struct B0 (virtual base)
+// CHECK: 4 | char a
+// CHECK: | [sizeof=5, align=4
+// CHECK: | nvsize=4, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct A
+// CHECK-X64: 0 | (A vbtable pointer)
+// CHECK-X64: 8 | struct B0 (virtual base)
+// CHECK-X64: 8 | char a
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=8, nvalign=8]
+
+struct __declspec(align(1)) B : virtual B0 {};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct B
+// CHECK: 0 | (B vbtable pointer)
+// CHECK: 4 | struct B0 (virtual base)
+// CHECK: 4 | char a
+// CHECK: | [sizeof=8, align=4
+// CHECK: | nvsize=4, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct B
+// CHECK-X64: 0 | (B vbtable pointer)
+// CHECK-X64: 8 | struct B0 (virtual base)
+// CHECK-X64: 8 | char a
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=8, nvalign=8]
+
+struct C : virtual B0 { int a; C() : a(0xC) {} };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | (C vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct B0 (virtual base)
+// CHECK: 8 | char a
+// CHECK: | [sizeof=9, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct C
+// CHECK-X64: 0 | (C vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B0 (virtual base)
+// CHECK-X64: 16 | char a
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct D : virtual B0 { __declspec(align(1)) int a; D() : a(0xD) {} };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | (D vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct B0 (virtual base)
+// CHECK: 8 | char a
+// CHECK: | [sizeof=12, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct D
+// CHECK-X64: 0 | (D vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B0 (virtual base)
+// CHECK-X64: 16 | char a
+// CHECK-X64: | [sizeof=24, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct E : virtual B0, virtual B1 {};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct E
+// CHECK: 0 | (E vbtable pointer)
+// CHECK: 4 | struct B0 (virtual base)
+// CHECK: 4 | char a
+// CHECK: 5 | struct B1 (virtual base) (empty)
+// CHECK: | [sizeof=8, align=4
+// CHECK: | nvsize=4, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct E
+// CHECK-X64: 0 | (E vbtable pointer)
+// CHECK-X64: 8 | struct B0 (virtual base)
+// CHECK-X64: 8 | char a
+// CHECK-X64: 9 | struct B1 (virtual base) (empty)
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=8, nvalign=8]
+
+struct F { char a; virtual ~F(); };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F
+// CHECK: 0 | (F vftable pointer)
+// CHECK: 4 | char a
+// CHECK: | [sizeof=8, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F
+// CHECK-X64: 0 | (F vftable pointer)
+// CHECK-X64: 8 | char a
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+int a[
+sizeof(A)+
+sizeof(B)+
+sizeof(C)+
+sizeof(D)+
+sizeof(E)+
+sizeof(F)];
diff --git a/test/Layout/ms-x86-vfvb-alignment.cpp b/test/Layout/ms-x86-vfvb-alignment.cpp
new file mode 100644
index 000000000000..8eea20959b0e
--- /dev/null
+++ b/test/Layout/ms-x86-vfvb-alignment.cpp
@@ -0,0 +1,376 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+extern "C" int printf(const char *fmt, ...);
+
+struct B0 { int a; B0() : a(0xf00000B0) {} };
+struct B1 { char a; B1() : a(0xB1) {} };
+struct B2 : virtual B1 { int a; B2() : a(0xf00000B2) {} };
+struct B3 { __declspec(align(16)) int a; B3() : a(0xf00000B3) {} };
+struct B4 : virtual B3 { int a; B4() : a(0xf00000B4) {} };
+struct B5 { __declspec(align(32)) int a; B5() : a(0xf00000B5) {} };
+struct B6 { int a; B6() : a(0xf00000B6) {} virtual void f() { printf("B6"); } };
+
+struct A : B0, virtual B1 { __declspec(align(16)) int a; A() : a(0xf000000A) {} virtual void f() { printf("A"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct A
+// CHECK: 0 | (A vftable pointer)
+// CHECK: 16 | struct B0 (base)
+// CHECK: 16 | int a
+// CHECK: 20 | (A vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 64 | struct B1 (virtual base)
+// CHECK: 64 | char a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct A
+// CHECK-X64: 0 | (A vftable pointer)
+// CHECK-X64: 8 | struct B0 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | (A vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct B1 (virtual base)
+// CHECK-X64: 48 | char a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct B : A, B2 { int a; B() : a(0xf000000B) {} virtual void f() { printf("B"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct B
+// CHECK: 0 | struct A (primary base)
+// CHECK: 0 | (A vftable pointer)
+// CHECK: 16 | struct B0 (base)
+// CHECK: 16 | int a
+// CHECK: 20 | (A vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 64 | struct B2 (base)
+// CHECK: 64 | (B2 vbtable pointer)
+// CHECK: 68 | int a
+// CHECK: 72 | int a
+// CHECK: 80 | struct B1 (virtual base)
+// CHECK: 80 | char a
+// CHECK: | [sizeof=96, align=16
+// CHECK: | nvsize=80, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct B
+// CHECK-X64: 0 | struct A (primary base)
+// CHECK-X64: 0 | (A vftable pointer)
+// CHECK-X64: 8 | struct B0 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | (A vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct B2 (base)
+// CHECK-X64: 48 | (B2 vbtable pointer)
+// CHECK-X64: 56 | int a
+// CHECK-X64: 64 | int a
+// CHECK-X64: 80 | struct B1 (virtual base)
+// CHECK-X64: 80 | char a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=80, nvalign=16]
+
+struct C : B4 { int a; C() : a(0xf000000C) {} virtual void f() { printf("C"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | (C vftable pointer)
+// CHECK: 16 | struct B4 (base)
+// CHECK: 16 | (B4 vbtable pointer)
+// CHECK: 20 | int a
+// CHECK: 24 | int a
+// CHECK: 32 | struct B3 (virtual base)
+// CHECK: 32 | int a
+// CHECK: | [sizeof=48, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct C
+// CHECK-X64: 0 | (C vftable pointer)
+// CHECK-X64: 16 | struct B4 (base)
+// CHECK-X64: 16 | (B4 vbtable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct B3 (virtual base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct D : C { int a; D() : a(0xf000000D) {} virtual void f() { printf("D"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | struct C (primary base)
+// CHECK: 0 | (C vftable pointer)
+// CHECK: 16 | struct B4 (base)
+// CHECK: 16 | (B4 vbtable pointer)
+// CHECK: 20 | int a
+// CHECK: 24 | int a
+// CHECK: 32 | int a
+// CHECK: 48 | struct B3 (virtual base)
+// CHECK: 48 | int a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct D
+// CHECK-X64: 0 | struct C (primary base)
+// CHECK-X64: 0 | (C vftable pointer)
+// CHECK-X64: 16 | struct B4 (base)
+// CHECK-X64: 16 | (B4 vbtable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | int a
+// CHECK-X64: 64 | struct B3 (virtual base)
+// CHECK-X64: 64 | int a
+// CHECK-X64: | [sizeof=80, align=16
+// CHECK-X64: | nvsize=64, nvalign=16]
+
+struct E : virtual C { int a; E() : a(0xf000000E) {} virtual void f() { printf("E"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct E
+// CHECK: 0 | (E vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 16 | struct B3 (virtual base)
+// CHECK: 16 | int a
+// CHECK: 44 | (vtordisp for vbase C)
+// CHECK: 48 | struct C (virtual base)
+// CHECK: 48 | (C vftable pointer)
+// CHECK: 64 | struct B4 (base)
+// CHECK: 64 | (B4 vbtable pointer)
+// CHECK: 68 | int a
+// CHECK: 72 | int a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct E
+// CHECK-X64: 0 | (E vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B3 (virtual base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 44 | (vtordisp for vbase C)
+// CHECK-X64: 48 | struct C (virtual base)
+// CHECK-X64: 48 | (C vftable pointer)
+// CHECK-X64: 64 | struct B4 (base)
+// CHECK-X64: 64 | (B4 vbtable pointer)
+// CHECK-X64: 72 | int a
+// CHECK-X64: 80 | int a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct F : B3, virtual B0 { int a; F() : a(0xf000000F) {} virtual void f() { printf("F"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct F
+// CHECK: 0 | (F vftable pointer)
+// CHECK: 16 | struct B3 (base)
+// CHECK: 16 | int a
+// CHECK: 32 | (F vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 64 | struct B0 (virtual base)
+// CHECK: 64 | int a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct F
+// CHECK-X64: 0 | (F vftable pointer)
+// CHECK-X64: 16 | struct B3 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | (F vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 48 | struct B0 (virtual base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct G : B2, B6, virtual B1 { int a; G() : a(0xf0000010) {} };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct G
+// CHECK: 8 | struct B2 (base)
+// CHECK: 8 | (B2 vbtable pointer)
+// CHECK: 12 | int a
+// CHECK: 0 | struct B6 (primary base)
+// CHECK: 0 | (B6 vftable pointer)
+// CHECK: 4 | int a
+// CHECK: 16 | int a
+// CHECK: 20 | struct B1 (virtual base)
+// CHECK: 20 | char a
+// CHECK: | [sizeof=21, align=4
+// CHECK: | nvsize=20, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct G
+// CHECK-X64: 16 | struct B2 (base)
+// CHECK-X64: 16 | (B2 vbtable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 0 | struct B6 (primary base)
+// CHECK-X64: 0 | (B6 vftable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 32 | int a
+// CHECK-X64: 40 | struct B1 (virtual base)
+// CHECK-X64: 40 | char a
+// CHECK-X64: | [sizeof=48, align=8
+// CHECK-X64: | nvsize=40, nvalign=8]
+
+struct H : B6, B2, virtual B1 { int a; H() : a(0xf0000011) {} };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct H
+// CHECK: 0 | struct B6 (primary base)
+// CHECK: 0 | (B6 vftable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | struct B2 (base)
+// CHECK: 8 | (B2 vbtable pointer)
+// CHECK: 12 | int a
+// CHECK: 16 | int a
+// CHECK: 20 | struct B1 (virtual base)
+// CHECK: 20 | char a
+// CHECK: | [sizeof=21, align=4
+// CHECK: | nvsize=20, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct H
+// CHECK-X64: 0 | struct B6 (primary base)
+// CHECK-X64: 0 | (B6 vftable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | struct B2 (base)
+// CHECK-X64: 16 | (B2 vbtable pointer)
+// CHECK-X64: 24 | int a
+// CHECK-X64: 32 | int a
+// CHECK-X64: 40 | struct B1 (virtual base)
+// CHECK-X64: 40 | char a
+// CHECK-X64: | [sizeof=48, align=8
+// CHECK-X64: | nvsize=40, nvalign=8]
+
+struct I : B0, virtual B1 { int a; int a1; __declspec(align(16)) int a2; I() : a(0xf0000011), a1(0xf0000011), a2(0xf0000011) {} };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct I
+// CHECK: 0 | struct B0 (base)
+// CHECK: 0 | int a
+// CHECK: 4 | (I vbtable pointer)
+// CHECK: 20 | int a
+// CHECK: 24 | int a1
+// CHECK: 32 | int a2
+// CHECK: 48 | struct B1 (virtual base)
+// CHECK: 48 | char a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct I
+// CHECK-X64: 0 | struct B0 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 8 | (I vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 20 | int a1
+// CHECK-X64: 32 | int a2
+// CHECK-X64: 48 | struct B1 (virtual base)
+// CHECK-X64: 48 | char a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct J : B0, B3, virtual B1 { int a; int a1; J() : a(0xf0000012), a1(0xf0000012) {} };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct J
+// CHECK: 0 | struct B0 (base)
+// CHECK: 0 | int a
+// CHECK: 16 | struct B3 (base)
+// CHECK: 16 | int a
+// CHECK: 32 | (J vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 52 | int a1
+// CHECK: 64 | struct B1 (virtual base)
+// CHECK: 64 | char a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct J
+// CHECK-X64: 0 | struct B0 (base)
+// CHECK-X64: 0 | int a
+// CHECK-X64: 16 | struct B3 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | (J vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 44 | int a1
+// CHECK-X64: 48 | struct B1 (virtual base)
+// CHECK-X64: 48 | char a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct K { int a; K() : a(0xf0000013) {} virtual void f() { printf("K"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct K
+// CHECK: 0 | (K vftable pointer)
+// CHECK: 4 | int a
+// CHECK: | [sizeof=8, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct K
+// CHECK-X64: 0 | (K vftable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+struct L : virtual K { int a; L() : a(0xf0000014) {} virtual void g() { printf("L"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct L
+// CHECK: 0 | (L vftable pointer)
+// CHECK: 4 | (L vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 12 | struct K (virtual base)
+// CHECK: 12 | (K vftable pointer)
+// CHECK: 16 | int a
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct L
+// CHECK-X64: 0 | (L vftable pointer)
+// CHECK-X64: 8 | (L vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 24 | struct K (virtual base)
+// CHECK-X64: 24 | (K vftable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=40, align=8
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct M : virtual K { int a; M() : a(0xf0000015) {} virtual void f() { printf("M"); } };
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct M
+// CHECK: 0 | (M vbtable pointer)
+// CHECK: 4 | int a
+// CHECK: 8 | (vtordisp for vbase K)
+// CHECK: 12 | struct K (virtual base)
+// CHECK: 12 | (K vftable pointer)
+// CHECK: 16 | int a
+// CHECK: | [sizeof=20, align=4
+// CHECK: | nvsize=8, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct M
+// CHECK-X64: 0 | (M vbtable pointer)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 20 | (vtordisp for vbase K)
+// CHECK-X64: 24 | struct K (virtual base)
+// CHECK-X64: 24 | (K vftable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: | [sizeof=40, align=8
+// CHECK-X64: | nvsize=16, nvalign=8]
+
+int a[
+sizeof(A)+
+sizeof(B)+
+sizeof(C)+
+sizeof(D)+
+sizeof(E)+
+sizeof(F)+
+sizeof(G)+
+sizeof(H)+
+sizeof(I)+
+sizeof(J)+
+sizeof(K)+
+sizeof(L)+
+sizeof(M)];
diff --git a/test/Layout/ms-x86-vfvb-sharing.cpp b/test/Layout/ms-x86-vfvb-sharing.cpp
new file mode 100644
index 000000000000..2b3d08e44c67
--- /dev/null
+++ b/test/Layout/ms-x86-vfvb-sharing.cpp
@@ -0,0 +1,140 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+extern "C" int printf(const char *fmt, ...);
+
+struct B0 { int a; B0() : a(0xf00000B0) { printf("B0 = %p\n", this); } };
+struct B1 { int a; B1() : a(0xf00000B1) { printf("B1 = %p\n", this); } };
+struct B2 { B2() { printf("B2 = %p\n", this); } virtual void g() { printf("B2"); } };
+struct B3 : virtual B1 { B3() { printf("B3 = %p\n", this); } };
+struct B4 : virtual B1 { B4() { printf("B4 = %p\n", this); } virtual void g() { printf("B4"); } };
+
+struct A : B0, virtual B1 {
+ __declspec(align(16)) int a;
+ A() : a(0xf000000A) { printf(" A = %p\n\n", this); }
+ virtual void f() { printf("A"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct A
+// CHECK: 0 | (A vftable pointer)
+// CHECK: 16 | struct B0 (base)
+// CHECK: 16 | int a
+// CHECK: 20 | (A vbtable pointer)
+// CHECK: 48 | int a
+// CHECK: 64 | struct B1 (virtual base)
+// CHECK: 64 | int a
+// CHECK: | [sizeof=80, align=16
+// CHECK: | nvsize=64, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct A
+// CHECK-X64: 0 | (A vftable pointer)
+// CHECK-X64: 8 | struct B0 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | (A vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct B1 (virtual base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct B : B2, B0, virtual B1 {
+ __declspec(align(16)) int a;
+ B() : a(0xf000000B) { printf(" B = %p\n\n", this); }
+ virtual void f() { printf("B"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct B
+// CHECK: 0 | struct B2 (primary base)
+// CHECK: 0 | (B2 vftable pointer)
+// CHECK: 4 | struct B0 (base)
+// CHECK: 4 | int a
+// CHECK: 8 | (B vbtable pointer)
+// CHECK: 32 | int a
+// CHECK: 48 | struct B1 (virtual base)
+// CHECK: 48 | int a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct B
+// CHECK-X64: 0 | struct B2 (primary base)
+// CHECK-X64: 0 | (B2 vftable pointer)
+// CHECK-X64: 8 | struct B0 (base)
+// CHECK-X64: 8 | int a
+// CHECK-X64: 16 | (B vbtable pointer)
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct B1 (virtual base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct C : B3, B0, virtual B1 {
+ __declspec(align(16)) int a;
+ C() : a(0xf000000C) { printf(" C = %p\n\n", this); }
+ virtual void f() { printf("C"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | (C vftable pointer)
+// CHECK: 16 | struct B3 (base)
+// CHECK: 16 | (B3 vbtable pointer)
+// CHECK: 20 | struct B0 (base)
+// CHECK: 20 | int a
+// CHECK: 32 | int a
+// CHECK: 48 | struct B1 (virtual base)
+// CHECK: 48 | int a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=48, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct C
+// CHECK-X64: 0 | (C vftable pointer)
+// CHECK-X64: 8 | struct B3 (base)
+// CHECK-X64: 8 | (B3 vbtable pointer)
+// CHECK-X64: 16 | struct B0 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct B1 (virtual base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+struct D : B4, B0, virtual B1 {
+ __declspec(align(16)) int a;
+ D() : a(0xf000000D) { printf(" D = %p\n\n", this); }
+ virtual void f() { printf("D"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | struct B4 (primary base)
+// CHECK: 0 | (B4 vftable pointer)
+// CHECK: 4 | (B4 vbtable pointer)
+// CHECK: 8 | struct B0 (base)
+// CHECK: 8 | int a
+// CHECK: 16 | int a
+// CHECK: 32 | struct B1 (virtual base)
+// CHECK: 32 | int a
+// CHECK: | [sizeof=48, align=16
+// CHECK: | nvsize=32, nvalign=16]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct D
+// CHECK-X64: 0 | struct B4 (primary base)
+// CHECK-X64: 0 | (B4 vftable pointer)
+// CHECK-X64: 8 | (B4 vbtable pointer)
+// CHECK-X64: 16 | struct B0 (base)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 32 | int a
+// CHECK-X64: 48 | struct B1 (virtual base)
+// CHECK-X64: 48 | int a
+// CHECK-X64: | [sizeof=64, align=16
+// CHECK-X64: | nvsize=48, nvalign=16]
+
+int a[
+sizeof(A)+
+sizeof(B)+
+sizeof(C)+
+sizeof(D)];
diff --git a/test/Layout/ms-x86-vtordisp.cpp b/test/Layout/ms-x86-vtordisp.cpp
new file mode 100644
index 000000000000..b16f09ed704c
--- /dev/null
+++ b/test/Layout/ms-x86-vtordisp.cpp
@@ -0,0 +1,170 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: | FileCheck %s -check-prefix CHECK-X64
+
+extern "C" int printf(const char *fmt, ...);
+
+struct B0 {
+ int a;
+ B0() : a(0xf00000B0) {}
+ virtual void f() { printf("B0"); }
+};
+
+struct __declspec(align(16)) B1 {
+ int a;
+ B1() : a(0xf00000B1) {}
+ virtual void f() { printf("B1"); }
+};
+
+struct __declspec(align(16)) Align16 {};
+struct __declspec(align(32)) Align32 {};
+struct VAlign16 : virtual Align16 {};
+struct VAlign32 : virtual Align32 {};
+
+struct A : virtual B0, virtual B1 {
+ int a;
+ A() : a(0xf000000A) {}
+ virtual void f() { printf("A"); }
+ virtual void g() { printf("A"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct A
+// CHECK: 0 | (A vftable pointer)
+// CHECK: 4 | (A vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 16 | (vtordisp for vbase B0)
+// CHECK: 20 | struct B0 (virtual base)
+// CHECK: 20 | (B0 vftable pointer)
+// CHECK: 24 | int a
+// CHECK: 44 | (vtordisp for vbase B1)
+// CHECK: 48 | struct B1 (virtual base)
+// CHECK: 48 | (B1 vftable pointer)
+// CHECK: 52 | int a
+// CHECK: | [sizeof=64, align=16
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct A
+// CHECK-X64: 0 | (A vftable pointer)
+// CHECK-X64: 8 | (A vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 36 | (vtordisp for vbase B0)
+// CHECK-X64: 40 | struct B0 (virtual base)
+// CHECK-X64: 40 | (B0 vftable pointer)
+// CHECK-X64: 48 | int a
+// CHECK-X64: 76 | (vtordisp for vbase B1)
+// CHECK-X64: 80 | struct B1 (virtual base)
+// CHECK-X64: 80 | (B1 vftable pointer)
+// CHECK-X64: 88 | int a
+// CHECK-X64: | [sizeof=96, align=16
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct C : virtual B0, virtual B1, VAlign32 {
+ int a;
+ C() : a(0xf000000C) {}
+ virtual void f() { printf("C"); }
+ virtual void g() { printf("C"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct C
+// CHECK: 0 | (C vftable pointer)
+// CHECK: 32 | struct VAlign32 (base)
+// CHECK: 32 | (VAlign32 vbtable pointer)
+// CHECK: 36 | int a
+// CHECK: 64 | (vtordisp for vbase B0)
+// CHECK: 68 | struct B0 (virtual base)
+// CHECK: 68 | (B0 vftable pointer)
+// CHECK: 72 | int a
+// CHECK: 108 | (vtordisp for vbase B1)
+// CHECK: 112 | struct B1 (virtual base)
+// CHECK: 112 | (B1 vftable pointer)
+// CHECK: 116 | int a
+// CHECK: 128 | struct Align32 (virtual base) (empty)
+// CHECK: | [sizeof=128, align=32
+// CHECK: | nvsize=64, nvalign=32]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct C
+// CHECK-X64: 0 | (C vftable pointer)
+// CHECK-X64: 32 | struct VAlign32 (base)
+// CHECK-X64: 32 | (VAlign32 vbtable pointer)
+// CHECK-X64: 40 | int a
+// CHECK-X64: 68 | (vtordisp for vbase B0)
+// CHECK-X64: 72 | struct B0 (virtual base)
+// CHECK-X64: 72 | (B0 vftable pointer)
+// CHECK-X64: 80 | int a
+// CHECK-X64: 108 | (vtordisp for vbase B1)
+// CHECK-X64: 112 | struct B1 (virtual base)
+// CHECK-X64: 112 | (B1 vftable pointer)
+// CHECK-X64: 120 | int a
+// CHECK-X64: 128 | struct Align32 (virtual base) (empty)
+// CHECK-X64: | [sizeof=128, align=32
+// CHECK-X64: | nvsize=64, nvalign=32]
+
+struct __declspec(align(32)) D : virtual B0, virtual B1 {
+ int a;
+ D() : a(0xf000000D) {}
+ virtual void f() { printf("D"); }
+ virtual void g() { printf("D"); }
+};
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct D
+// CHECK: 0 | (D vftable pointer)
+// CHECK: 4 | (D vbtable pointer)
+// CHECK: 8 | int a
+// CHECK: 32 | (vtordisp for vbase B0)
+// CHECK: 36 | struct B0 (virtual base)
+// CHECK: 36 | (B0 vftable pointer)
+// CHECK: 40 | int a
+// CHECK: 76 | (vtordisp for vbase B1)
+// CHECK: 80 | struct B1 (virtual base)
+// CHECK: 80 | (B1 vftable pointer)
+// CHECK: 84 | int a
+// CHECK: | [sizeof=96, align=32
+// CHECK: | nvsize=12, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct D
+// CHECK-X64: 0 | (D vftable pointer)
+// CHECK-X64: 8 | (D vbtable pointer)
+// CHECK-X64: 16 | int a
+// CHECK-X64: 36 | (vtordisp for vbase B0)
+// CHECK-X64: 40 | struct B0 (virtual base)
+// CHECK-X64: 40 | (B0 vftable pointer)
+// CHECK-X64: 48 | int a
+// CHECK-X64: 76 | (vtordisp for vbase B1)
+// CHECK-X64: 80 | struct B1 (virtual base)
+// CHECK-X64: 80 | (B1 vftable pointer)
+// CHECK-X64: 88 | int a
+// CHECK-X64: | [sizeof=96, align=32
+// CHECK-X64: | nvsize=24, nvalign=8]
+
+struct AT {
+ virtual ~AT(){}
+};
+struct CT : virtual AT {
+ virtual ~CT();
+};
+CT::~CT(){}
+
+// CHECK: *** Dumping AST Record Layout
+// CHECK: 0 | struct CT
+// CHECK: 0 | (CT vbtable pointer)
+// CHECK: 4 | struct AT (virtual base)
+// CHECK: 4 | (AT vftable pointer)
+// CHECK: | [sizeof=8, align=4
+// CHECK: | nvsize=4, nvalign=4]
+// CHECK-X64: *** Dumping AST Record Layout
+// CHECK-X64: 0 | struct CT
+// CHECK-X64: 0 | (CT vbtable pointer)
+// CHECK-X64: 8 | struct AT (virtual base)
+// CHECK-X64: 8 | (AT vftable pointer)
+// CHECK-X64: | [sizeof=16, align=8
+// CHECK-X64: | nvsize=8, nvalign=8]
+
+int a[
+sizeof(A)+
+sizeof(C)+
+sizeof(D)+
+sizeof(CT)];
diff --git a/test/Lexer/Inputs/bad-header-guard-defined.h b/test/Lexer/Inputs/bad-header-guard-defined.h
new file mode 100644
index 000000000000..b28f1a8873e9
--- /dev/null
+++ b/test/Lexer/Inputs/bad-header-guard-defined.h
@@ -0,0 +1,4 @@
+#if !defined(foo)
+#define goo
+int n;
+#endif
diff --git a/test/Lexer/Inputs/bad-header-guard.h b/test/Lexer/Inputs/bad-header-guard.h
new file mode 100644
index 000000000000..601da0932721
--- /dev/null
+++ b/test/Lexer/Inputs/bad-header-guard.h
@@ -0,0 +1,4 @@
+#ifndef bad_header_guard
+#define bad_guard
+
+#endif
diff --git a/test/Lexer/Inputs/different-define.h b/test/Lexer/Inputs/different-define.h
new file mode 100644
index 000000000000..f23454b7c8c4
--- /dev/null
+++ b/test/Lexer/Inputs/different-define.h
@@ -0,0 +1,4 @@
+#ifndef different_define
+#define FOO 5
+
+#endif
diff --git a/test/Lexer/Inputs/good-header-guard.h b/test/Lexer/Inputs/good-header-guard.h
new file mode 100644
index 000000000000..664a479d3914
--- /dev/null
+++ b/test/Lexer/Inputs/good-header-guard.h
@@ -0,0 +1,4 @@
+#ifndef good_header_guard
+#define good_header_guard
+
+#endif
diff --git a/test/Lexer/Inputs/multiple.h b/test/Lexer/Inputs/multiple.h
new file mode 100644
index 000000000000..5dfb327a0b2a
--- /dev/null
+++ b/test/Lexer/Inputs/multiple.h
@@ -0,0 +1,4 @@
+#ifndef multiple
+#define multi
+
+#endif
diff --git a/test/Lexer/Inputs/no-define.h b/test/Lexer/Inputs/no-define.h
new file mode 100644
index 000000000000..591a66b30c61
--- /dev/null
+++ b/test/Lexer/Inputs/no-define.h
@@ -0,0 +1,3 @@
+#ifndef no_define
+
+#endif
diff --git a/test/Lexer/Inputs/out-of-order-define.h b/test/Lexer/Inputs/out-of-order-define.h
new file mode 100644
index 000000000000..d38e93f29bb5
--- /dev/null
+++ b/test/Lexer/Inputs/out-of-order-define.h
@@ -0,0 +1,7 @@
+#ifndef out_of_order
+
+#define something_else
+
+#define out_of_order
+
+#endif
diff --git a/test/Lexer/Inputs/tokens-between-ifndef-and-define.h b/test/Lexer/Inputs/tokens-between-ifndef-and-define.h
new file mode 100644
index 000000000000..ce8d77050631
--- /dev/null
+++ b/test/Lexer/Inputs/tokens-between-ifndef-and-define.h
@@ -0,0 +1,7 @@
+#ifndef tokens_between
+
+const int pi = 3;
+
+#define pi_is_bad
+
+#endif
diff --git a/test/Lexer/Inputs/unlikely-to-be-header-guard.h b/test/Lexer/Inputs/unlikely-to-be-header-guard.h
new file mode 100644
index 000000000000..098fc3cb7a1a
--- /dev/null
+++ b/test/Lexer/Inputs/unlikely-to-be-header-guard.h
@@ -0,0 +1,5 @@
+#ifndef data_rep_h
+#define use_alternate_data_rep
+/* #include "data_rep.h" */
+#endif
+
diff --git a/test/Lexer/builtin_redef.c b/test/Lexer/builtin_redef.c
index c9351dc4a696..b0bb2a096be5 100644
--- a/test/Lexer/builtin_redef.c
+++ b/test/Lexer/builtin_redef.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -D__TIME__=1234 -U__DATE__ -E 2>&1 | FileCheck %s --check-prefix=CHECK-OUT
// RUN: %clang_cc1 %s -D__TIME__=1234 -U__DATE__ -E 2>&1 | FileCheck %s --check-prefix=CHECK-WARN
-// RUN: %clang_cc1 %s -D__TIME__=1234 -U__DATE__ -E 2>&1 -pedantic-errors | FileCheck %s --check-prefix=CHECK-ERR
+// RUN: not %clang_cc1 %s -D__TIME__=1234 -U__DATE__ -E 2>&1 -pedantic-errors | FileCheck %s --check-prefix=CHECK-ERR
// CHECK-WARN: <command line>:{{.*}} warning: redefining builtin macro
// CHECK-WARN: <command line>:{{.*}} warning: undefining builtin macro
diff --git a/test/Lexer/char-literal.cpp b/test/Lexer/char-literal.cpp
index b2fab34e4407..1cd14a9b0116 100644
--- a/test/Lexer/char-literal.cpp
+++ b/test/Lexer/char-literal.cpp
@@ -36,8 +36,4 @@ char16_t p[2] = u"\U0000FFFF";
char16_t q[2] = u"\U00010000";
#ifdef __cplusplus
// expected-error@-2 {{too long}}
-#else
-// FIXME: The above should be accepted in C11 mode.
-// expected-error@-6 {{must be an initializer list}}
-// expected-error@-6 {{must be an initializer list}}
#endif
diff --git a/test/Lexer/constants.c b/test/Lexer/constants.c
index 290388543c0e..f0cd4d7cf29c 100644
--- a/test/Lexer/constants.c
+++ b/test/Lexer/constants.c
@@ -13,7 +13,12 @@ float Y = 08.123456;
// PR2252
#if -0x8000000000000000 // should not warn.
#endif
-
+#if -01000000000000000000000 // should not warn.
+#endif
+#if 9223372036854775808 // expected-warning {{integer constant is larger than the largest signed integer type}}
+#endif
+#if 0x10000000000000000 // expected-error {{integer constant is larger than the largest unsigned integer type}}
+#endif
int c[] = {
'df', // expected-warning {{multi-character character constant}}
diff --git a/test/Lexer/cxx-features.cpp b/test/Lexer/cxx-features.cpp
new file mode 100644
index 000000000000..1202ecb18349
--- /dev/null
+++ b/test/Lexer/cxx-features.cpp
@@ -0,0 +1,89 @@
+// RUN: %clang_cc1 -std=c++98 -verify %s
+// RUN: %clang_cc1 -std=c++11 -verify %s
+// RUN: %clang_cc1 -std=c++1y -verify %s
+
+// expected-no-diagnostics
+
+#if __cplusplus < 201103L
+#define check(macro, cxx98, cxx11, cxx1y) cxx98 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx98
+#elif __cplusplus < 201304L
+#define check(macro, cxx98, cxx11, cxx1y) cxx11 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx11
+#else
+#define check(macro, cxx98, cxx11, cxx1y) cxx1y == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx1y
+#endif
+
+#if check(binary_literals, 0, 0, 201304)
+#error "wrong value for __cpp_binary_literals"
+#endif
+
+#if check(init_captures, 0, 0, 201304)
+#error "wrong value for __cpp_init_captures"
+#endif
+
+#if check(generic_lambdas, 0, 0, 201304)
+#error "wrong value for __cpp_generic_lambdas"
+#endif
+
+#if check(constexpr, 0, 200704, 201304)
+#error "wrong value for __cpp_constexpr"
+#endif
+
+#if check(decltype_auto, 0, 0, 201304)
+#error "wrong value for __cpp_decltype_auto"
+#endif
+
+#if check(return_type_deduction, 0, 0, 201304)
+#error "wrong value for __cpp_return_type_deduction"
+#endif
+
+#if check(runtime_arrays, 0, 0, 0)
+#error "wrong value for __cpp_runtime_arrays"
+#endif
+
+#if check(aggregate_nsdmi, 0, 0, 201304)
+#error "wrong value for __cpp_aggregate_nsdmi"
+#endif
+
+#if check(variable_templates, 0, 0, 201304)
+#error "wrong value for __cpp_variable_templates"
+#endif
+
+#if check(unicode_characters, 0, 200704, 200704)
+#error "wrong value for __cpp_unicode_characters"
+#endif
+
+#if check(raw_strings, 0, 200710, 200710)
+#error "wrong value for __cpp_raw_strings"
+#endif
+
+#if check(unicode_literals, 0, 200710, 200710)
+#error "wrong value for __cpp_unicode_literals"
+#endif
+
+#if check(user_defined_literals, 0, 200809, 200809)
+#error "wrong value for __cpp_user_defined_literals"
+#endif
+
+#if check(lambdas, 0, 200907, 200907)
+#error "wrong value for __cpp_lambdas"
+#endif
+
+#if check(static_assert, 0, 200410, 200410)
+#error "wrong value for __cpp_static_assert"
+#endif
+
+#if check(decltype, 0, 200707, 200707)
+#error "wrong value for __cpp_decltype"
+#endif
+
+#if check(attributes, 0, 200809, 200809)
+#error "wrong value for __cpp_attributes"
+#endif
+
+#if check(rvalue_references, 0, 200610, 200610)
+#error "wrong value for __cpp_rvalue_references"
+#endif
+
+#if check(variadic_templates, 0, 200704, 200704)
+#error "wrong value for __cpp_variadic_templates"
+#endif
diff --git a/test/Lexer/cxx0x_raw_string_unterminated.cpp b/test/Lexer/cxx0x_raw_string_unterminated.cpp
index dfbaaeee1e72..be134f8cb513 100644
--- a/test/Lexer/cxx0x_raw_string_unterminated.cpp
+++ b/test/Lexer/cxx0x_raw_string_unterminated.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -E %s 2>&1 | grep 'error: raw string missing terminating delimiter )foo"'
+// RUN: not %clang_cc1 -std=c++11 -E %s 2>&1 | grep 'error: raw string missing terminating delimiter )foo"'
const char *str = R"foo(abc
def)bar";
diff --git a/test/Lexer/cxx1y_binary_literal.cpp b/test/Lexer/cxx1y_binary_literal.cpp
index 96dce3dd4439..662e99d28c0b 100644
--- a/test/Lexer/cxx1y_binary_literal.cpp
+++ b/test/Lexer/cxx1y_binary_literal.cpp
@@ -17,3 +17,4 @@ int k1 = 0b1234; // expected-error {{invalid digit '2' in binary constant}}
// we'll need to rework our binary literal parsing rules.
int k2 = 0b10010f; // expected-error {{invalid digit 'f' in binary constant}}
int k3 = 0b10010g; // expected-error {{invalid suffix 'g' on integer constant}}
+int k4 = 0b; // expected-error {{invalid digit 'b' in octal constant}}
diff --git a/test/Lexer/cxx1y_digit_separators.cpp b/test/Lexer/cxx1y_digit_separators.cpp
new file mode 100644
index 000000000000..39ea3e7b8d74
--- /dev/null
+++ b/test/Lexer/cxx1y_digit_separators.cpp
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -std=c++1y -verify %s
+
+int operator""ms(unsigned long long); // expected-warning {{reserved}}
+float operator""ms(long double); // expected-warning {{reserved}}
+
+int operator""_foo(unsigned long long);
+
+namespace integral {
+ static_assert(1'2'3 == 12'3, "");
+ static_assert(1'000'000 == 0xf'4240, "");
+ static_assert(0'004'000'000 == 0x10'0000, "");
+ static_assert(0b0101'0100 == 0x54, "");
+
+ int a = 123'; //'; // expected-error {{expected ';'}}
+ int b = 0'xff; // expected-error {{digit separator cannot appear at end of digit sequence}} expected-error {{suffix 'xff' on integer}}
+ int c = 0x'ff; // expected-error {{suffix 'x'ff' on integer}}
+ int d = 0'1234; // ok, octal
+ int e = 0'b1010; // expected-error {{digit 'b' in octal constant}}
+ int f = 0b'1010; // expected-error {{invalid digit 'b' in octal}}
+ int g = 123'ms; // expected-error {{digit separator cannot appear at end of digit sequence}}
+
+ int z = 0'123'_foo; //'; // expected-error {{cannot appear at end of digit seq}}
+}
+
+namespace floating {
+ static_assert(0'123.456'7 == 123.4567, "");
+ static_assert(1e1'0 == 10'000'000'000, "");
+
+ float a = 1'e1; // expected-error {{digit separator cannot appear at end of digit sequence}}
+ float b = 1'0e1;
+ float c = 1.'0e1; // expected-error {{digit separator cannot appear at start of digit sequence}}
+ float d = 1.0'e1; // expected-error {{digit separator cannot appear at end of digit sequence}}
+ float e = 1e'1; // expected-error {{digit separator cannot appear at start of digit sequence}}
+ float f = 1e1'ms; // expected-error {{digit separator cannot appear at end of digit sequence}}
+}
+
+#line 123'456
+static_assert(__LINE__ == 123456, "");
+
+// x has value 0 in C++11 and 34 in C++1y.
+#define M(x, ...) __VA_ARGS__
+constexpr int x = { M(1'2,3'4) };
+static_assert(x == 34, "");
diff --git a/test/Lexer/dollar-idents.c b/test/Lexer/dollar-idents.c
index e57ee865886b..a1263b4e572c 100644
--- a/test/Lexer/dollar-idents.c
+++ b/test/Lexer/dollar-idents.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -dump-tokens %s 2>&1 | FileCheck %s
-// RUN: %clang_cc1 -dump-tokens -x assembler-with-cpp %s 2>&1 | FileCheck %s --check-prefix=ASM
+// RUN: %clang_cc1 -dump-tokens -x assembler-with-cpp %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASM
// PR3808
// CHECK: identifier '$A'
diff --git a/test/Lexer/gnu-flags.c b/test/Lexer/gnu-flags.c
new file mode 100644
index 000000000000..6e47547b009d
--- /dev/null
+++ b/test/Lexer/gnu-flags.c
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wgnu
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DALL \
+// RUN: -Wgnu-zero-variadic-macro-arguments \
+// RUN: -Wgnu-imaginary-constant -Wgnu-binary-literal -Wgnu-zero-line-directive
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wgnu \
+// RUN: -Wno-gnu-zero-variadic-macro-arguments \
+// RUN: -Wno-gnu-imaginary-constant -Wno-gnu-binary-literal -Wno-gnu-zero-line-directive
+// Additional disabled tests:
+// %clang_cc1 -fsyntax-only -verify %s -DZEROARGS -Wgnu-zero-variadic-macro-arguments
+// %clang_cc1 -fsyntax-only -verify %s -DIMAGINARYCONST -Wgnu-imaginary-constant
+// %clang_cc1 -fsyntax-only -verify %s -DBINARYLITERAL -Wgnu-binary-literal
+// %clang_cc1 -fsyntax-only -verify %s -DLINE0 -Wgnu-zero-line-directive
+
+#if NONE
+// expected-no-diagnostics
+#endif
+
+
+#if ALL || ZEROARGS
+// expected-warning@+9 {{must specify at least one argument for '...' parameter of variadic macro}}
+// expected-note@+4 {{macro 'efoo' defined here}}
+// expected-warning@+3 {{token pasting of ',' and __VA_ARGS__ is a GNU extension}}
+#endif
+
+#define efoo(format, args...) foo(format , ##args)
+
+void foo( const char* c )
+{
+ efoo("6");
+}
+
+
+#if ALL || IMAGINARYCONST
+// expected-warning@+3 {{imaginary constants are a GNU extension}}
+#endif
+
+float _Complex c = 1.if;
+
+
+#if ALL || BINARYLITERAL
+// expected-warning@+3 {{binary integer literals are a GNU extension}}
+#endif
+
+int b = 0b0101;
+
+
+// This case is handled differently because lit has a bug whereby #line 0 is reported to be on line 4294967295
+// http://llvm.org/bugs/show_bug.cgi?id=16952
+#if ALL || LINE0
+#line 0 // expected-warning {{#line directive with zero argument is a GNU extension}}
+#else
+#line 0
+#endif
+
+// WARNING: Do not add more tests after the #line 0 line! Add them before the LINE0 test
diff --git a/test/Lexer/has_extension_cxx.cpp b/test/Lexer/has_extension_cxx.cpp
index 68b542fb2975..d3483df94c5a 100644
--- a/test/Lexer/has_extension_cxx.cpp
+++ b/test/Lexer/has_extension_cxx.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++98 -E %s -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -E %s -o - | FileCheck %s --check-prefix=CHECK11
// CHECK: c_static_assert
#if __has_extension(c_static_assert)
@@ -40,16 +41,23 @@ int has_reference_qualified_functions();
int has_rvalue_references();
#endif
+// CHECK: has_local_type_template_args
#if __has_extension(cxx_local_type_template_args)
int has_local_type_template_args();
-#else
-int no_local_type_template_args();
#endif
-// CHECK: has_local_type_template_args
-
+// CHECK: has_binary_literals
#if __has_extension(cxx_binary_literals)
int has_binary_literals();
#endif
-// CHECK: has_binary_literals
+// CHECK: has_variable_templates
+#if __has_extension(cxx_variable_templates)
+int has_variable_templates();
+#endif
+
+// CHECK-NOT: has_init_captures
+// CHECK11: has_init_captures
+#if __has_extension(cxx_init_captures)
+int has_init_captures();
+#endif
diff --git a/test/Lexer/has_feature_cxx0x.cpp b/test/Lexer/has_feature_cxx0x.cpp
index 62a965caacb1..b2fe842bd678 100644
--- a/test/Lexer/has_feature_cxx0x.cpp
+++ b/test/Lexer/has_feature_cxx0x.cpp
@@ -346,3 +346,53 @@ int no_aggregate_nsdmi();
// CHECK-1Y: has_aggregate_nsdmi
// CHECK-11: no_aggregate_nsdmi
// CHECK-NO-11: no_aggregate_nsdmi
+
+#if __has_feature(cxx_return_type_deduction)
+int has_return_type_deduction();
+#else
+int no_return_type_deduction();
+#endif
+
+// CHECK-1Y: has_return_type_deduction
+// CHECK-11: no_return_type_deduction
+// CHECK-NO-11: no_return_type_deduction
+
+#if __has_feature(cxx_contextual_conversions)
+int has_contextual_conversions();
+#else
+int no_contextual_conversions();
+#endif
+
+// CHECK-1Y: has_contextual_conversions
+// CHECK-11: no_contextual_conversions
+// CHECK-NO-11: no_contextual_conversions
+
+#if __has_feature(cxx_relaxed_constexpr)
+int has_relaxed_constexpr();
+#else
+int no_relaxed_constexpr();
+#endif
+
+// CHECK-1Y: has_relaxed_constexpr
+// CHECK-11: no_relaxed_constexpr
+// CHECK-NO-11: no_relaxed_constexpr
+
+#if __has_feature(cxx_variable_templates)
+int has_variable_templates();
+#else
+int no_variable_templates();
+#endif
+
+// CHECK-1Y: has_variable_templates
+// CHECK-11: no_variable_templates
+// CHECK-NO-11: no_variable_templates
+
+#if __has_feature(cxx_init_captures)
+int has_init_captures();
+#else
+int no_init_captures();
+#endif
+
+// CHECK-1Y: has_init_captures
+// CHECK-11: no_init_captures
+// CHECK-NO-11: no_init_captures
diff --git a/test/Lexer/header.cpp b/test/Lexer/header.cpp
new file mode 100644
index 000000000000..f02b1e69db43
--- /dev/null
+++ b/test/Lexer/header.cpp
@@ -0,0 +1,44 @@
+// RUN: %clang_cc1 -fsyntax-only -Wno-header-guard %s
+// RUN: %clang_cc1 -fsyntax-only -Wheader-guard %s 2>&1 | FileCheck %s
+
+#include "Inputs/good-header-guard.h"
+#include "Inputs/no-define.h"
+#include "Inputs/different-define.h"
+#include "Inputs/out-of-order-define.h"
+#include "Inputs/tokens-between-ifndef-and-define.h"
+#include "Inputs/unlikely-to-be-header-guard.h"
+
+#include "Inputs/bad-header-guard.h"
+// CHECK: In file included from {{.*}}header.cpp:{{[0-9]*}}:
+// CHECK: {{.*}}bad-header-guard.h:1:9: warning: 'bad_header_guard' is used as a header guard here, followed by #define of a different macro
+// CHECK: {{^}}#ifndef bad_header_guard
+// CHECK: {{^}} ^~~~~~~~~~~~~~~~
+// CHECK: {{.*}}bad-header-guard.h:2:9: note: 'bad_guard' is defined here; did you mean 'bad_header_guard'?
+// CHECK: {{^}}#define bad_guard
+// CHECK: {{^}} ^~~~~~~~~
+// CHECK: {{^}} bad_header_guard
+
+#include "Inputs/bad-header-guard-defined.h"
+// CHECK: In file included from {{.*}}header.cpp:{{[0-9]*}}:
+// CHECK: {{.*}}bad-header-guard-defined.h:1:2: warning: 'foo' is used as a header guard here, followed by #define of a different macro
+// CHECK: {{^}}#if !defined(foo)
+// CHECK: {{^}} ^~
+// CHECK: {{.*}}bad-header-guard-defined.h:2:9: note: 'goo' is defined here; did you mean 'foo'?
+// CHECK: {{^}}#define goo
+// CHECK: {{^}} ^~~
+// CHECK: {{^}} foo
+
+#include "Inputs/multiple.h"
+#include "Inputs/multiple.h"
+#include "Inputs/multiple.h"
+#include "Inputs/multiple.h"
+// CHECK: In file included from {{.*}}header.cpp:{{[0-9]*}}:
+// CHECK: {{.*}}multiple.h:1:9: warning: 'multiple' is used as a header guard here, followed by #define of a different macro
+// CHECK: {{^}}#ifndef multiple
+// CHECK: {{^}} ^~~~~~~~
+// CHECK: {{.*}}multiple.h:2:9: note: 'multi' is defined here; did you mean 'multiple'?
+// CHECK: {{^}}#define multi
+// CHECK: {{^}} ^~~~~
+// CHECK: {{^}} multiple
+
+// CHECK: 3 warnings generated.
diff --git a/test/Lexer/newline-eof-c++11.cpp b/test/Lexer/newline-eof-c++11.cpp
deleted file mode 100644
index eeabe8bb9fc3..000000000000
--- a/test/Lexer/newline-eof-c++11.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wnewline-eof -verify %s
-// expected-no-diagnostics
-
-// The following line isn't terminated, don't fix it.
-void foo() {} \ No newline at end of file
diff --git a/test/Lexer/newline-eof-c++98-compat.cpp b/test/Lexer/newline-eof-c++98-compat.cpp
index 3e5c8e226235..9af0b889537b 100644
--- a/test/Lexer/newline-eof-c++98-compat.cpp
+++ b/test/Lexer/newline-eof-c++98-compat.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -Wc++98-compat-pedantic -std=c++11 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wc++98-compat-pedantic -Wnewline-eof -std=c++11 -verify %s
// The following line isn't terminated, don't fix it.
void foo() {} // expected-warning{{C++98 requires newline at end of file}} \ No newline at end of file
diff --git a/test/Lexer/newline-eof.c b/test/Lexer/newline-eof.c
index a4a18835cf5f..340d9de8d36a 100644
--- a/test/Lexer/newline-eof.c
+++ b/test/Lexer/newline-eof.c
@@ -1,9 +1,15 @@
// RUN: %clang_cc1 -fsyntax-only -Wnewline-eof -verify %s
+// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
+// RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++03 -pedantic -verify %s
// RUN: %clang_cc1 -fsyntax-only -Wnewline-eof %s 2>&1 | FileCheck %s
// rdar://9133072
+// In C++11 mode, this is allowed, so don't warn in pedantic mode.
+// RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++11 -Wnewline-eof -verify %s
+// RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++11 -Werror -pedantic %s
+
// Make sure the diagnostic shows up properly at the end of the last line.
-// CHECK: newline-eof.c:9:63
+// CHECK: newline-eof.c:[[@LINE+3]]:63
// The following line isn't terminated, don't fix it.
void foo() {} // expected-warning{{no newline at end of file}} \ No newline at end of file
diff --git a/test/Lexer/pragma-operators.cpp b/test/Lexer/pragma-operators.cpp
index 6a5a498a151f..7270f1eed203 100644
--- a/test/Lexer/pragma-operators.cpp
+++ b/test/Lexer/pragma-operators.cpp
@@ -35,3 +35,25 @@ B(foo)
// CHECK: #pragma message("\042Hello\042, world!")
// CHECK: 0;
int n = pragma_L pragma_u8 pragma_u pragma_U pragma_R pragma_UR pragma_hello 0;
+
+#pragma warning(disable : 1 2L 3U ; error : 4 5 6 ; suppress : 7 8 9)
+// CHECK: #pragma warning(disable: 1 2 3)
+// CHECK: #line [[@LINE-2]]
+// CHECK: #pragma warning(error: 4 5 6)
+// CHECK: #line [[@LINE-4]]
+// CHECK: #pragma warning(suppress: 7 8 9)
+
+#pragma warning(push)
+#pragma warning(push, 1L)
+#pragma warning(push, 4U)
+#pragma warning(push, 0x1)
+#pragma warning(push, 03)
+#pragma warning(push, 0b10)
+#pragma warning(push, 1i8)
+// CHECK: #pragma warning(push)
+// CHECK: #pragma warning(push, 1)
+// CHECK: #pragma warning(push, 4)
+// CHECK: #pragma warning(push, 1)
+// CHECK: #pragma warning(push, 3)
+// CHECK: #pragma warning(push, 2)
+// CHECK: #pragma warning(push, 1)
diff --git a/test/Lexer/string-literal-errors.cpp b/test/Lexer/string-literal-errors.cpp
index be574c2a557b..d8e29934f367 100644
--- a/test/Lexer/string-literal-errors.cpp
+++ b/test/Lexer/string-literal-errors.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
+// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
void foo() {
(void)"\q \u123z \x \U \U123 \U12345 \u123 \xyzzy \777 \U"
diff --git a/test/Lexer/wchar-signedness.c b/test/Lexer/wchar-signedness.c
index fea0ecac64f5..b5d4ac8f000c 100644
--- a/test/Lexer/wchar-signedness.c
+++ b/test/Lexer/wchar-signedness.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple x86_64-none-linux-gnu | FileCheck %s --check-prefix=X86
-// RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple armv7-none-eabi | FileCheck %s --check-prefix=ARM
+// RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple x86_64-none-linux-gnu | FileCheck %s --check-prefix=CHECK-X86
+// RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple armv7-none-eabi | FileCheck %s --check-prefix=CHECK-ARM
// CHECK-X86-NOT: #define __WCHAR_UNSIGNED__
// CHECK-X86: #define __WINT_UNSIGNED__ 1
diff --git a/test/Makefile b/test/Makefile
index 4fdafe1481b1..dbfa52177b71 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -45,6 +45,9 @@ lit.site.cfg: FORCE
@$(ECHOPATH) s=@CLANG_SOURCE_DIR@=$(PROJ_SRC_DIR)/..=g >> lit.tmp
@$(ECHOPATH) s=@CLANG_BINARY_DIR@=$(PROJ_OBJ_DIR)/..=g >> lit.tmp
@$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
+ @$(ECHOPATH) s=@ENABLE_CLANG_ARCMT@=$(ENABLE_CLANG_ARCMT)=g >> lit.tmp
+ @$(ECHOPATH) s=@ENABLE_CLANG_REWRITER@=$(ENABLE_CLANG_REWRITER)=g >> lit.tmp
+ @$(ECHOPATH) s=@ENABLE_CLANG_STATIC_ANALYZER@=$(ENABLE_CLANG_STATIC_ANALYZER)=g >> lit.tmp
@sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
@-rm -f lit.tmp
diff --git a/test/Misc/ast-dump-attr.cpp b/test/Misc/ast-dump-attr.cpp
index 3efcd098b370..729be1f24773 100644
--- a/test/Misc/ast-dump-attr.cpp
+++ b/test/Misc/ast-dump-attr.cpp
@@ -95,3 +95,19 @@ void *TestVariadicUnsigned1(int) __attribute__((alloc_size(1)));
void *TestVariadicUnsigned2(int, int) __attribute__((alloc_size(1,2)));
// CHECK: FunctionDecl{{.*}}TestVariadicUnsigned2
// CHECK: AllocSizeAttr{{.*}} 0 1
+
+void TestLabel() {
+L: __attribute__((unused)) int i;
+// CHECK: LabelStmt{{.*}}'L'
+// CHECK: VarDecl{{.*}}i 'int'
+// CHECK-NEXT: UnusedAttr{{.*}}
+
+M: __attribute(()) int j;
+// CHECK: LabelStmt {{.*}} 'M'
+// CHECK-NEXT: DeclStmt
+// CHECK-NEXT: VarDecl {{.*}} j 'int'
+
+N: __attribute(()) ;
+// CHECK: LabelStmt {{.*}} 'N'
+// CHECK-NEXT: NullStmt
+}
diff --git a/test/Misc/ast-dump-color.cpp b/test/Misc/ast-dump-color.cpp
index 0367cc50178f..a41c0bba8cb4 100644
--- a/test/Misc/ast-dump-color.cpp
+++ b/test/Misc/ast-dump-color.cpp
@@ -58,7 +58,7 @@ int TestExpr __attribute__((guarded_by(mu1)));
//CHECK: {{^}}[[Blue]]| `-[[RESET]][[YELLOW]]FullComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:8:4[[RESET]], [[Yellow]]col:11[[RESET]]>{{$}}
//CHECK: {{^}}[[Blue]]| `-[[RESET]][[YELLOW]]ParagraphComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:4[[RESET]], [[Yellow]]col:11[[RESET]]>{{$}}
//CHECK: {{^}}[[Blue]]| `-[[RESET]][[YELLOW]]TextComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:4[[RESET]], [[Yellow]]col:11[[RESET]]> Text=" Comment"{{$}}
-//CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]CXXRecordDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:18:1[[RESET]], [[Yellow]]line:25:1[[RESET]]> class[[CYAN]] Mutex[[RESET]]{{$}}
+//CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]CXXRecordDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:18:1[[RESET]], [[Yellow]]line:25:1[[RESET]]> class[[CYAN]] Mutex[[RESET]] definition{{$}}
//CHECK: {{^}}[[Blue]]| |-[[RESET]][[BLUE]]LockableAttr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:18:22[[RESET]]>{{$}}
//CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXRecordDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:1[[RESET]], [[Yellow]]col:33[[RESET]]> class[[CYAN]] Mutex[[RESET]]{{$}}
//CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]FieldDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:20:3[[RESET]], [[Yellow]]col:7[[RESET]]>[[CYAN]] var1[[RESET]] [[Green]]'int'[[RESET]]{{$}}
@@ -71,11 +71,11 @@ int TestExpr __attribute__((guarded_by(mu1)));
//CHECK: {{^}}[[Blue]]| | | `-[[RESET]][[YELLOW]]TextComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:6[[RESET]], [[Yellow]]col:22[[RESET]]> Text=" Another variable"{{$}}
//CHECK: {{^}}[[Blue]]| | `-[[RESET]][[YELLOW]]ParagraphComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:23:6[[RESET]], [[Yellow]]col:44[[RESET]]>{{$}}
//CHECK: {{^}}[[Blue]]| | `-[[RESET]][[YELLOW]]TextComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:6[[RESET]], [[Yellow]]col:44[[RESET]]> Text=" Like the other variable, but different"{{$}}
-//CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:18:33[[RESET]]>[[CYAN]] Mutex[[RESET]] [[Green]]'void (void)'[[RESET]] inline{{$}}
+//CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:18:33[[RESET]]>[[CYAN]] Mutex[[RESET]] [[Green]]'void (void)'[[RESET]] inline{{.*$}}
//CHECK: {{^}}[[Blue]]| | `-[[RESET]][[MAGENTA]]CompoundStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]>{{$}}
-//CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]>[[CYAN]] Mutex[[RESET]] [[Green]]'void (const class Mutex &)'[[RESET]] inline{{$}}
+//CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]>[[CYAN]] Mutex[[RESET]] [[Green]]'void (const class Mutex &)'[[RESET]] inline{{ .*$}}
//CHECK: {{^}}[[Blue]]| | `-[[RESET]][[GREEN]]ParmVarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]> [[Green]]'const class Mutex &'[[RESET]]{{$}}
-//CHECK: {{^}}[[Blue]]| `-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]>[[CYAN]] Mutex[[RESET]] [[Green]]'void (class Mutex &&)'[[RESET]] inline{{$}}
+//CHECK: {{^}}[[Blue]]| `-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]>[[CYAN]] Mutex[[RESET]] [[Green]]'void (class Mutex &&)'[[RESET]] inline{{ .*$}}
//CHECK: {{^}}[[Blue]]| `-[[RESET]][[GREEN]]ParmVarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]> [[Green]]'class Mutex &&'[[RESET]]{{$}}
//CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]VarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:1[[RESET]], [[Yellow]]line:25:3[[RESET]]>[[CYAN]] mu1[[RESET]] [[Green]]'class Mutex':'class Mutex'[[RESET]]{{$}}
//CHECK: {{^}}[[Blue]]| `-[[RESET]][[MAGENTA]]CXXConstructExpr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:3[[RESET]]> [[Green]]'class Mutex':'class Mutex'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]] [[Green]]'void (void)'[[RESET]]{{$}}
diff --git a/test/Misc/ast-dump-decl.cpp b/test/Misc/ast-dump-decl.cpp
index 31715cd15e4c..d98bdb56d5bd 100644
--- a/test/Misc/ast-dump-decl.cpp
+++ b/test/Misc/ast-dump-decl.cpp
@@ -458,3 +458,19 @@ namespace TestFriendDecl2 {
// CHECK: |-CXXRecordDecl {{.*}} struct S
// CHECK: `-FriendDecl
// CHECK: `-FunctionDecl {{.*}} parent [[TestFriendDecl2]] prev [[TestFriendDecl2_f]] <{{.*}}> f 'void (void)'
+
+namespace Comment {
+ extern int Test;
+ /// Something here.
+ extern int Test;
+ extern int Test;
+}
+
+// CHECK: VarDecl {{.*}} Test 'int' extern
+// CHECK-NOT: FullComment
+// CHECK: VarDecl {{.*}} Test 'int' extern
+// CHECK: `-FullComment
+// CHECK: `-ParagraphComment
+// CHECK: `-TextComment
+// CHECK: VarDecl {{.*}} Test 'int' extern
+// CHECK-NOT: FullComment
diff --git a/test/Misc/ast-dump-stmt.cpp b/test/Misc/ast-dump-stmt.cpp
index cf3e8bf28981..72205c130e08 100644
--- a/test/Misc/ast-dump-stmt.cpp
+++ b/test/Misc/ast-dump-stmt.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s
+// RUN: %clang_cc1 -fcxx-exceptions -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s
namespace n {
void function() {}
@@ -12,3 +12,29 @@ void TestFunction() {
Variable = 4;
// CHECK: DeclRefExpr{{.*}} (UsingShadow{{.*}}Variable
}
+
+// CHECK: FunctionDecl {{.*}} TestCatch1
+void TestCatch1() {
+// CHECK: CXXTryStmt
+// CHECK-NEXT: CompoundStmt
+ try {
+ }
+// CHECK-NEXT: CXXCatchStmt
+// CHECK-NEXT: VarDecl {{.*}} x
+// CHECK-NEXT: CompoundStmt
+ catch (int x) {
+ }
+}
+
+// CHECK: FunctionDecl {{.*}} TestCatch2
+void TestCatch2() {
+// CHECK: CXXTryStmt
+// CHECK-NEXT: CompoundStmt
+ try {
+ }
+// CHECK-NEXT: CXXCatchStmt
+// CHECK-NEXT: NULL
+// CHECK-NEXT: CompoundStmt
+ catch (...) {
+ }
+}
diff --git a/test/Misc/ast-dump-templates.cpp b/test/Misc/ast-dump-templates.cpp
index 7e28da95a1f2..b7aeca8d55df 100644
--- a/test/Misc/ast-dump-templates.cpp
+++ b/test/Misc/ast-dump-templates.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -ast-print %s > %t
// RUN: FileCheck < %t %s -check-prefix=CHECK1
// RUN: FileCheck < %t %s -check-prefix=CHECK2
+// RUN: %clang_cc1 -ast-dump %s | FileCheck --check-prefix=DUMP %s
template <int X, typename Y, int Z = 5>
struct foo {
@@ -37,3 +38,14 @@ void baz() {
// Template definition - bar
// CHECK1: template <int A, typename B> B bar()
// CHECK2: template <int A, typename B> B bar()
+
+namespace test2 {
+void func(int);
+void func(float);
+template<typename T>
+void tmpl() {
+ func(T());
+}
+
+// DUMP: UnresolvedLookupExpr {{.*}} <col:3> '<overloaded function type>' lvalue (ADL) = 'func'
+}
diff --git a/test/Misc/caret-diags-scratch-buffer.c b/test/Misc/caret-diags-scratch-buffer.c
index 883c68e81dce..e53e0b4277f3 100644
--- a/test/Misc/caret-diags-scratch-buffer.c
+++ b/test/Misc/caret-diags-scratch-buffer.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | not grep keyXXXX
+// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | not grep keyXXXX
// This should not show keyXXXX in the caret diag output. This once
// happened because the two tokens ended up in the scratch buffer and
// the caret diag from the scratch buffer included the previous token.
diff --git a/test/Misc/dev-fd-fs.c b/test/Misc/dev-fd-fs.c
index 2bc4f291a216..d1f13286aa8e 100644
--- a/test/Misc/dev-fd-fs.c
+++ b/test/Misc/dev-fd-fs.c
@@ -1,9 +1,6 @@
// Check that we can operate on files from /dev/fd.
// REQUIRES: dev-fd-fs
-// It has not been working since r169831 on freebsd.
-// XFAIL: freebsd
-
// Check reading from named pipes. We cat the input here instead of redirecting
// it to ensure that /dev/fd/0 is a named pipe, not just a redirected file.
//
diff --git a/test/Misc/diag-format.c b/test/Misc/diag-format.c
index 959177b2bd42..3dc351d4290c 100644
--- a/test/Misc/diag-format.c
+++ b/test/Misc/diag-format.c
@@ -12,7 +12,7 @@
//
// RUN: %clang -fsyntax-only -fno-show-column %s 2>&1 | FileCheck %s -check-prefix=NO_COLUMN
//
-
+// RUN: not %clang -fsyntax-only -Werror -fdiagnostics-format=msvc-fallback %s 2>&1 | FileCheck %s -check-prefix=MSVC-FALLBACK
@@ -31,4 +31,5 @@
// VI: {{.*}} +28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
// MSVC_ORIG: {{.*}}(28) : warning: extra tokens at end of #endif directive [-Wextra-tokens]
// NO_COLUMN: {{.*}}:28: warning: extra tokens at end of #endif directive [-Wextra-tokens]
+// MSVC-FALLBACK: {{.*}}(28,7) : error(clang): extra tokens at end of #endif directive
int x;
diff --git a/test/Misc/diag-line-wrapping.cpp b/test/Misc/diag-line-wrapping.cpp
index ea119afc642d..2bcb03f9781c 100644
--- a/test/Misc/diag-line-wrapping.cpp
+++ b/test/Misc/diag-line-wrapping.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -fmessage-length 60 %s 2>&1 | FileCheck %s
-// RUN: %clang_cc1 -fsyntax-only -fmessage-length 0 %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fmessage-length 60 %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fmessage-length 0 %s 2>&1 | FileCheck %s
struct B { void f(); };
struct D1 : B {};
diff --git a/test/Misc/diag-macro-backtrace.c b/test/Misc/diag-macro-backtrace.c
index 0d28d7b9114c..8d7d5726ad82 100644
--- a/test/Misc/diag-macro-backtrace.c
+++ b/test/Misc/diag-macro-backtrace.c
@@ -1,4 +1,4 @@
-// RUN: %clang -fsyntax-only -fmacro-backtrace-limit=0 %s 2>&1 | FileCheck %s
+// RUN: not %clang -fsyntax-only -fmacro-backtrace-limit=0 %s 2>&1 | FileCheck %s
#define FOO 1+"hi"
#define BAR FOO
diff --git a/test/Misc/diag-mapping.c b/test/Misc/diag-mapping.c
index 75b49ef17c98..edc137ec68fe 100644
--- a/test/Misc/diag-mapping.c
+++ b/test/Misc/diag-mapping.c
@@ -4,10 +4,10 @@
// RUN: %clang_cc1 %s -Wno-extra-tokens 2>&1 | not grep diagnostic
// -Werror can map all warnings to error.
-// RUN: %clang_cc1 %s -Werror 2>&1 | grep "error:"
+// RUN: not %clang_cc1 %s -Werror 2>&1 | grep "error:"
// -Werror can map this one warning to error.
-// RUN: %clang_cc1 %s -Werror=extra-tokens 2>&1 | grep "error:"
+// RUN: not %clang_cc1 %s -Werror=extra-tokens 2>&1 | grep "error:"
// Mapping unrelated diags to errors doesn't affect this one.
// RUN: %clang_cc1 %s -Werror=trigraphs 2>&1 | grep "warning:"
@@ -16,7 +16,7 @@
// RUN: %clang_cc1 %s -pedantic 2>&1 | grep "warning:"
// This should emit an error with -pedantic-errors.
-// RUN: %clang_cc1 %s -pedantic-errors 2>&1 | grep "error:"
+// RUN: not %clang_cc1 %s -pedantic-errors 2>&1 | grep "error:"
// This should emit a warning, because -Wfoo overrides -pedantic*.
// RUN: %clang_cc1 %s -pedantic-errors -Wextra-tokens 2>&1 | grep "warning:"
diff --git a/test/Misc/diag-mapping2.c b/test/Misc/diag-mapping2.c
index bc5a0872e7c8..c4ade074cb05 100644
--- a/test/Misc/diag-mapping2.c
+++ b/test/Misc/diag-mapping2.c
@@ -6,10 +6,10 @@
// RUN: %clang_cc1 %s -Wno-#warnings 2>&1 | not grep diagnostic
// -Werror can map all warnings to error.
-// RUN: %clang_cc1 %s -Werror 2>&1 | grep "error:"
+// RUN: not %clang_cc1 %s -Werror 2>&1 | grep "error:"
// -Werror can map this one warning to error.
-// RUN: %clang_cc1 %s -Werror=#warnings 2>&1 | grep "error:"
+// RUN: not %clang_cc1 %s -Werror=#warnings 2>&1 | grep "error:"
// -Wno-error= overrides -Werror. rdar://3158301
// RUN: %clang_cc1 %s -Werror -Wno-error=#warnings 2>&1 | grep "warning:"
diff --git a/test/Misc/diag-presumed.c b/test/Misc/diag-presumed.c
index 07b7cdfe351f..70f2f24e321c 100644
--- a/test/Misc/diag-presumed.c
+++ b/test/Misc/diag-presumed.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -pedantic-errors %s 2>&1 | FileCheck %s --check-prefix=PRESUMED
-// RUN: %clang_cc1 -fsyntax-only -pedantic-errors -fno-diagnostics-use-presumed-location %s 2>&1 | FileCheck %s --check-prefix=SPELLING
+// RUN: not %clang_cc1 -fsyntax-only -pedantic-errors %s 2>&1 | FileCheck %s --check-prefix=PRESUMED
+// RUN: not %clang_cc1 -fsyntax-only -pedantic-errors -fno-diagnostics-use-presumed-location %s 2>&1 | FileCheck %s --check-prefix=SPELLING
#line 100
#define X(y) y
diff --git a/test/Misc/diag-template-diffing-color.cpp b/test/Misc/diag-template-diffing-color.cpp
index c771857f3907..e73fc2c3973a 100644
--- a/test/Misc/diag-template-diffing-color.cpp
+++ b/test/Misc/diag-template-diffing-color.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -fcolor-diagnostics %s 2>&1 | FileCheck %s
-// RUN: %clang_cc1 -fsyntax-only -fcolor-diagnostics -fdiagnostics-show-template-tree %s 2>&1 | FileCheck %s -check-prefix=TREE
+// RUN: not %clang_cc1 -fsyntax-only -fcolor-diagnostics %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fcolor-diagnostics -fdiagnostics-show-template-tree %s 2>&1 | FileCheck %s -check-prefix=TREE
// REQUIRES: ansi-escape-sequences
template<typename> struct foo {};
void func(foo<int>);
diff --git a/test/Misc/diag-template-diffing-cxx98.cpp b/test/Misc/diag-template-diffing-cxx98.cpp
index a21e4cf060d9..9fa46127920c 100644
--- a/test/Misc/diag-template-diffing-cxx98.cpp
+++ b/test/Misc/diag-template-diffing-cxx98.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only %s -std=c++98 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only %s -std=c++98 2>&1 | FileCheck %s
namespace PR14342 {
template<typename T, char a> struct X {};
diff --git a/test/Misc/diag-template-diffing.cpp b/test/Misc/diag-template-diffing.cpp
index add96efd37b6..46807070c7cc 100644
--- a/test/Misc/diag-template-diffing.cpp
+++ b/test/Misc/diag-template-diffing.cpp
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -fsyntax-only %s -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-ELIDE-NOTREE
-// RUN: %clang_cc1 -fsyntax-only %s -fno-elide-type -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-NOELIDE-NOTREE
-// RUN: %clang_cc1 -fsyntax-only %s -fdiagnostics-show-template-tree -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-ELIDE-TREE
-// RUN: %clang_cc1 -fsyntax-only %s -fno-elide-type -fdiagnostics-show-template-tree -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-NOELIDE-TREE
+// RUN: not %clang_cc1 -fsyntax-only %s -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-ELIDE-NOTREE
+// RUN: not %clang_cc1 -fsyntax-only %s -fno-elide-type -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-NOELIDE-NOTREE
+// RUN: not %clang_cc1 -fsyntax-only %s -fdiagnostics-show-template-tree -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-ELIDE-TREE
+// RUN: not %clang_cc1 -fsyntax-only %s -fno-elide-type -fdiagnostics-show-template-tree -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-NOELIDE-TREE
// PR9548 - "no known conversion from 'vector<string>' to 'vector<string>'"
// vector<string> refers to two different types here. Make sure the message
@@ -935,10 +935,10 @@ namespace DependentDefault {
B<int, char> b3;
b1 = b2;
// CHECK-ELIDE-NOTREE: no viable overloaded '='
- // CHECK-ELIDE-NOTREE: no known conversion from 'B<char, (default) Trait<T>::Ty>' to 'B<int, int>'
+ // CHECK-ELIDE-NOTREE: no known conversion from 'B<char, [...]>' to 'B<int, [...]>'
b3 = b1;
// CHECK-ELIDE-NOTREE: no viable overloaded '='
- // CHECK-ELIDE-NOTREE: no known conversion from 'B<[...], (default) Trait<T>::Ty>' to 'B<[...], char>'
+ // CHECK-ELIDE-NOTREE: no known conversion from 'B<[...], (default) int>' to 'B<[...], char>'
b2 = b3;
// CHECK-ELIDE-NOTREE: no viable overloaded '='
// CHECK-ELIDE-NOTREE: no known conversion from 'B<int, char>' to 'B<char, int>'
@@ -1002,8 +1002,73 @@ namespace VariadicDefault {
}
}
+namespace PointerArguments {
+ template <int *p> class T {};
+ template <int* ...> class U {};
+ int a, b, c;
+ int z[5];
+ void test() {
+ T<&a> ta;
+ T<z> tz;
+ T<&b> tb(ta);
+ // CHECK-ELIDE-NOTREE: no matching constructor for initialization of 'T<&b>'
+ // CHECK-ELIDE-NOTREE: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'T<&a>' to 'const T<&b>' for 1st argument
+ T<&c> tc(tz);
+ // CHECK-ELIDE-NOTREE: no matching constructor for initialization of 'T<&c>'
+ // CHECK-ELIDE-NOTREE: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'T<z>' to 'const T<&c>' for 1st argument
+
+ U<&a, &a> uaa;
+ U<&b> ub(uaa);
+ // CHECK-ELIDE-NOTREE: no matching constructor for initialization of 'U<&b>'
+ // CHECK-ELIDE-NOTREE: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'U<&a, &a>' to 'const U<&b, (no argument)>' for 1st argument
+
+ U<&b, &b, &b> ubbb(uaa);
+ // CHECK-ELIDE-NOTREE: no matching constructor for initialization of 'U<&b, &b, &b>'
+ // CHECK-ELIDE-NOTREE: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'U<&a, &a, (no argument)>' to 'const U<&b, &b, &b>' for 1st argument
+
+ }
+}
+
+namespace DependentInt {
+ template<int Num> struct INT;
+
+ template <class CLASS, class Int_wrapper = INT<CLASS::val> >
+ struct C;
+
+ struct N {
+ static const int val = 1;
+ };
+
+ template <class M_T>
+ struct M {};
+
+ void test() {
+ using T1 = M<C<int, INT<0>>>;
+ using T2 = M<C<N>>;
+ T2 p;
+ T1 x = p;
+ // CHECK-ELIDE-NOTREE: no viable conversion from 'M<C<struct DependentInt::N, INT<1>>>' to 'M<C<int, INT<0>>>'
+ }
+}
+
+namespace PR17510 {
+class Atom;
+
+template <typename T> class allocator;
+template <typename T, typename A> class vector;
+
+typedef vector<const Atom *, allocator<const Atom *> > AtomVector;
+
+template <typename T, typename A = allocator<const Atom *> > class vector {};
+
+void foo() {
+ vector<Atom *> v;
+ AtomVector v2(v);
+ // CHECK-ELIDE-NOTREE: no known conversion from 'vector<class PR17510::Atom *, [...]>' to 'const vector<const class PR17510::Atom *, [...]>'
+}
+}
+
// CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-ELIDE-TREE: {{[0-9]*}} errors generated.
// CHECK-NOELIDE-TREE: {{[0-9]*}} errors generated.
-
diff --git a/test/Misc/diag-trailing-null-bytes.cpp b/test/Misc/diag-trailing-null-bytes.cpp
index 91b159ca257d..2786f50e65e1 100644
--- a/test/Misc/diag-trailing-null-bytes.cpp
+++ b/test/Misc/diag-trailing-null-bytes.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
+// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
// CHECK: {{ERR_DNS_SERVER_REQUIRES_TCP$}}
// http://llvm.org/PR12674
diff --git a/test/Misc/diag-verify.cpp b/test/Misc/diag-verify.cpp
index 895bc3fe0303..397558c0574d 100644
--- a/test/Misc/diag-verify.cpp
+++ b/test/Misc/diag-verify.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -verify %s 2>&1 | FileCheck %s
// Test the -verify flag. Each of the "x = y;" lines will produce a
// "use of undeclared identifier 'y'" error message.
diff --git a/test/Misc/error-limit-multiple-notes.cpp b/test/Misc/error-limit-multiple-notes.cpp
index 019b4dde2633..71a39091f60c 100644
--- a/test/Misc/error-limit-multiple-notes.cpp
+++ b/test/Misc/error-limit-multiple-notes.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -ferror-limit 1 -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ferror-limit 1 -fsyntax-only %s 2>&1 | FileCheck %s
// error and three notes emitted
void foo(int);
diff --git a/test/Misc/error-limit.c b/test/Misc/error-limit.c
index 26f4ac1d8a5e..e4ce7aab42e8 100644
--- a/test/Misc/error-limit.c
+++ b/test/Misc/error-limit.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -ferror-limit 1 -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -ferror-limit 1 -fsyntax-only %s 2>&1 | FileCheck %s
// error and note emitted
struct s1{};
diff --git a/test/Misc/include-stack-for-note-flag.cpp b/test/Misc/include-stack-for-note-flag.cpp
index b41284fd607e..f9bceee968d7 100644
--- a/test/Misc/include-stack-for-note-flag.cpp
+++ b/test/Misc/include-stack-for-note-flag.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACK
-// RUN: %clang_cc1 -fsyntax-only -fno-diagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACKLESS
-// RUN: %clang_cc1 -fsyntax-only -fno-diagnostics-show-note-include-stack -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACK
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-note-include-stack -fno-diagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACKLESS
-// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s -check-prefix=STACKLESS
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACK
+// RUN: not %clang_cc1 -fsyntax-only -fno-diagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACKLESS
+// RUN: not %clang_cc1 -fsyntax-only -fno-diagnostics-show-note-include-stack -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACK
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-note-include-stack -fno-diagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACKLESS
+// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s -check-prefix=STACKLESS
#include "Inputs/include.h"
int test() {
diff --git a/test/Misc/languageOptsOpenCL.cl b/test/Misc/languageOptsOpenCL.cl
new file mode 100644
index 000000000000..c81db995808f
--- /dev/null
+++ b/test/Misc/languageOptsOpenCL.cl
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -x cl %s -verify
+// expected-no-diagnostics
+
+// Test the forced language options for OpenCL are set correctly.
+
+__constant int v0[(sizeof(int) == 4) -1];
+__constant int v1[(__alignof(int) == 4) -1];
+__constant int v2[(sizeof(long) == 8) -1];
+__constant int v3[(__alignof(long) == 8) -1];
+__constant int v4[(sizeof(long long) == 16) -1];
+__constant int v5[(__alignof(long long) == 16) -1];
+__constant int v6[(sizeof(float) == 4) -1];
+__constant int v7[(__alignof(float) == 4) -1];
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+__constant int v8[(sizeof(double)==8) -1];
+__constant int v9[(__alignof(double)==8) -1];
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+__constant int v10[(sizeof(half) == 2) -1];
+__constant int v11[(__alignof(half) == 2) -1];
diff --git a/test/Misc/permissions.cpp b/test/Misc/permissions.cpp
new file mode 100644
index 000000000000..143e49d58eac
--- /dev/null
+++ b/test/Misc/permissions.cpp
@@ -0,0 +1,15 @@
+// REQUIRES: shell
+
+// MSYS doesn't emulate umask.
+// FIXME: Could we introduce another feature for it?
+// REQUIRES: shell-preserves-root
+
+// RUN: umask 000
+// RUN: %clang_cc1 -emit-llvm-bc %s -o %t
+// RUN: ls -l %t | FileCheck --check-prefix=CHECK000 %s
+// CHECK000: rw-rw-rw-
+
+// RUN: umask 002
+// RUN: %clang_cc1 -emit-llvm-bc %s -o %t
+// RUN: ls -l %t | FileCheck --check-prefix=CHECK002 %s
+// CHECK002: rw-rw-r--
diff --git a/test/Misc/show-diag-options.c b/test/Misc/show-diag-options.c
index ef0a5a660da4..8f05fbc76b56 100644
--- a/test/Misc/show-diag-options.c
+++ b/test/Misc/show-diag-options.c
@@ -2,7 +2,7 @@
// RUN: | FileCheck %s -check-prefix=BASE
// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-option %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=OPTION
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-option -Werror %s 2>&1 \
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-option -Werror %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=OPTION_ERROR
// RUN: %clang_cc1 -fsyntax-only -std=c89 -pedantic -fdiagnostics-show-option %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=OPTION_PEDANTIC
@@ -10,7 +10,7 @@
// RUN: | FileCheck %s -check-prefix=CATEGORY_ID
// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-category name %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=CATEGORY_NAME
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-option -fdiagnostics-show-category name -Werror %s 2>&1 \
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-option -fdiagnostics-show-category name -Werror %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=OPTION_ERROR_CATEGORY
void test(int x, int y) {
diff --git a/test/Misc/tabstop.c b/test/Misc/tabstop.c
index 7f59b6ab32b1..cb6af0cec8a1 100644
--- a/test/Misc/tabstop.c
+++ b/test/Misc/tabstop.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -ftabstop 3 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=3 -strict-whitespace %s
-// RUN: %clang_cc1 -ftabstop 4 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=4 -strict-whitespace %s
-// RUN: %clang_cc1 -ftabstop 5 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=5 -strict-whitespace %s
+// RUN: %clang_cc1 -ftabstop 3 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-3 -strict-whitespace %s
+// RUN: %clang_cc1 -ftabstop 4 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-4 -strict-whitespace %s
+// RUN: %clang_cc1 -ftabstop 5 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-5 -strict-whitespace %s
// tab
void* a = 1;
diff --git a/test/Misc/unprintable.c b/test/Misc/unprintable.c
index cd97131c8d1a..eaa4f34d8028 100644
--- a/test/Misc/unprintable.c
+++ b/test/Misc/unprintable.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fmessage-length 40 2>&1 | FileCheck -strict-whitespace %s
+// RUN: not %clang_cc1 %s -fmessage-length 40 2>&1 | FileCheck -strict-whitespace %s
int main() {
int i;
diff --git a/test/Misc/warning-flags-tree.c b/test/Misc/warning-flags-tree.c
index a64e942f20bd..d71c9f618b42 100644
--- a/test/Misc/warning-flags-tree.c
+++ b/test/Misc/warning-flags-tree.c
@@ -36,11 +36,8 @@
// CHECK-GNU: ext_gnu_array_range
// CHECK-GNU: ext_gnu_missing_equal_designator
// CHECK-GNU: ext_gnu_old_style_field_designator
-// CHECK-GNU: -Wvla
+// CHECK-GNU: -Wvla-extension
// CHECK-GNU: ext_vla
-// CHECK-GNU: ext_array_init_copy
-// CHECK-GNU: ext_empty_struct_union
-// CHECK-GNU: ext_expr_not_ice
// There are more GNU extensions but we don't need to check them all.
// RUN: diagtool tree --flags-only -Wgnu | FileCheck -check-prefix CHECK-FLAGS-ONLY %s
diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c
index a6dc8f1352fd..e61225ad20a5 100644
--- a/test/Misc/warning-flags.c
+++ b/test/Misc/warning-flags.c
@@ -5,22 +5,21 @@ This test serves two purposes:
(1) It documents all existing warnings that currently have no associated -W flag,
and ensures that the list never grows.
-
+
If take an existing warning and add a flag, this test will fail. To
fix this test, simply remove that warning from the list below.
-
+
(2) It prevents us adding new warnings to Clang that have no -W flag. All
new warnings should have -W flags.
-
+
If you add a new warning without a flag, this test will fail. To fix
this test, simply add a warning group to that warning.
-
+
The list of warnings below should NEVER grow. It should gradually shrink to 0.
-CHECK: Warnings without flags (143):
+CHECK: Warnings without flags (134):
CHECK-NEXT: ext_delete_void_ptr_operand
-CHECK-NEXT: ext_enum_friend
CHECK-NEXT: ext_expected_semi_decl_list
CHECK-NEXT: ext_explicit_specialization_storage_class
CHECK-NEXT: ext_implicit_lib_function_decl
@@ -81,13 +80,11 @@ CHECK-NEXT: warn_fe_cc_log_diagnostics_failure
CHECK-NEXT: warn_fe_cc_print_header_failure
CHECK-NEXT: warn_fe_macro_contains_embedded_newline
CHECK-NEXT: warn_file_asm_volatile
-CHECK-NEXT: warn_hex_escape_too_large
CHECK-NEXT: warn_ignoring_ftabstop_value
CHECK-NEXT: warn_implements_nscopying
CHECK-NEXT: warn_incompatible_qualified_id
CHECK-NEXT: warn_initializer_string_for_char_array_too_long
CHECK-NEXT: warn_inline_namespace_reopened_noninline
-CHECK-NEXT: warn_integer_too_large
CHECK-NEXT: warn_integer_too_large_for_signed
CHECK-NEXT: warn_invalid_asm_cast_lvalue
CHECK-NEXT: warn_many_braces_around_scalar_init
@@ -104,7 +101,6 @@ CHECK-NEXT: warn_nonnull_pointers_only
CHECK-NEXT: warn_not_compound_assign
CHECK-NEXT: warn_objc_property_copy_missing_on_block
CHECK-NEXT: warn_objc_protocol_qualifier_missing_id
-CHECK-NEXT: warn_octal_escape_too_large
CHECK-NEXT: warn_on_superclass_use
CHECK-NEXT: warn_param_default_argument_redefinition
CHECK-NEXT: warn_partial_specs_not_deducible
@@ -136,7 +132,6 @@ CHECK-NEXT: warn_pragma_unused_expected_punc
CHECK-NEXT: warn_pragma_unused_expected_var
CHECK-NEXT: warn_pragma_unused_expected_var_arg
CHECK-NEXT: warn_pragma_unused_undeclared_var
-CHECK-NEXT: warn_previous_alias_decl
CHECK-NEXT: warn_property_attr_mismatch
CHECK-NEXT: warn_property_attribute
CHECK-NEXT: warn_property_getter_owning_mismatch
@@ -146,9 +141,6 @@ CHECK-NEXT: warn_redeclaration_without_attribute_prev_attribute_ignored
CHECK-NEXT: warn_register_objc_catch_parm
CHECK-NEXT: warn_related_result_type_compatibility_class
CHECK-NEXT: warn_related_result_type_compatibility_protocol
-CHECK-NEXT: warn_second_parameter_of_va_start_not_last_named_argument
-CHECK-NEXT: warn_second_parameter_to_va_arg_never_compatible
-CHECK-NEXT: warn_static_inline_explicit_inst_ignored
CHECK-NEXT: warn_static_non_static
CHECK-NEXT: warn_template_export_unsupported
CHECK-NEXT: warn_template_spec_extra_headers
@@ -158,11 +150,10 @@ CHECK-NEXT: warn_unavailable_fwdclass_message
CHECK-NEXT: warn_undef_interface
CHECK-NEXT: warn_undef_interface_suggest
CHECK-NEXT: warn_undef_protocolref
-CHECK-NEXT: warn_unknown_method_family
CHECK-NEXT: warn_use_out_of_scope_declaration
CHECK-NEXT: warn_weak_identifier_undeclared
CHECK-NEXT: warn_weak_import
The list of warnings in -Wpedantic should NEVER grow.
-CHECK: Number in -Wpedantic (not covered by other -W flags): 29
+CHECK: Number in -Wpedantic (not covered by other -W flags): 28
diff --git a/test/Modules/Inputs/DependsOnModule.framework/Headers/not_cxx.h b/test/Modules/Inputs/DependsOnModule.framework/Headers/not_cxx.h
new file mode 100644
index 000000000000..c29a9219c64c
--- /dev/null
+++ b/test/Modules/Inputs/DependsOnModule.framework/Headers/not_cxx.h
@@ -0,0 +1 @@
+extern int template;
diff --git a/test/Modules/Inputs/DependsOnModule.framework/Headers/not_objc.h b/test/Modules/Inputs/DependsOnModule.framework/Headers/not_objc.h
new file mode 100644
index 000000000000..f63975a25d16
--- /dev/null
+++ b/test/Modules/Inputs/DependsOnModule.framework/Headers/not_objc.h
@@ -0,0 +1 @@
+int NSObject;
diff --git a/test/Modules/Inputs/DependsOnModule.framework/module.map b/test/Modules/Inputs/DependsOnModule.framework/module.map
index 2a3dd8038bd1..5a1cacaad2a3 100644
--- a/test/Modules/Inputs/DependsOnModule.framework/module.map
+++ b/test/Modules/Inputs/DependsOnModule.framework/module.map
@@ -8,6 +8,14 @@ framework module DependsOnModule {
requires cplusplus
header "cxx_other.h"
}
+ explicit module NotCXX {
+ requires !cplusplus
+ header "not_cxx.h"
+ }
+ explicit module NotObjC {
+ requires !objc
+ header "not_objc.h"
+ }
explicit framework module SubFramework {
umbrella header "SubFramework.h"
diff --git a/test/Modules/Inputs/MethodPoolBSub.h b/test/Modules/Inputs/MethodPoolBSub.h
index 0a7899df81b7..fbfc0aa14392 100644
--- a/test/Modules/Inputs/MethodPoolBSub.h
+++ b/test/Modules/Inputs/MethodPoolBSub.h
@@ -1,4 +1,5 @@
@interface B (Sub)
- (char *)method3;
- (char*)method4;
+- (id)method6;
@end
diff --git a/test/Modules/Inputs/MethodPoolBSub2.h b/test/Modules/Inputs/MethodPoolBSub2.h
new file mode 100644
index 000000000000..8bc369f73e85
--- /dev/null
+++ b/test/Modules/Inputs/MethodPoolBSub2.h
@@ -0,0 +1,3 @@
+@interface TotallyUnrelated
+- (id)method6;
+@end
diff --git a/test/Modules/Inputs/System/usr/include/stdio.h b/test/Modules/Inputs/System/usr/include/stdio.h
index 9a7b1063032c..f41e09c35a41 100644
--- a/test/Modules/Inputs/System/usr/include/stdio.h
+++ b/test/Modules/Inputs/System/usr/include/stdio.h
@@ -1,3 +1,3 @@
typedef struct { int id; } FILE;
int fprintf(FILE*restrict, const char* restrict format, ...);
-
+extern FILE *__stderrp;
diff --git a/test/Modules/Inputs/cxx-decls-imported.h b/test/Modules/Inputs/cxx-decls-imported.h
new file mode 100644
index 000000000000..b94368614dfb
--- /dev/null
+++ b/test/Modules/Inputs/cxx-decls-imported.h
@@ -0,0 +1,5 @@
+class HasFriends {
+ friend void friend_1(HasFriends);
+ friend void friend_2(HasFriends);
+ void private_thing();
+};
diff --git a/test/Modules/Inputs/cxx-decls-unimported.h b/test/Modules/Inputs/cxx-decls-unimported.h
new file mode 100644
index 000000000000..0431e324616e
--- /dev/null
+++ b/test/Modules/Inputs/cxx-decls-unimported.h
@@ -0,0 +1 @@
+void operator delete(void*);
diff --git a/test/Modules/Inputs/cxx-templates-a.h b/test/Modules/Inputs/cxx-templates-a.h
new file mode 100644
index 000000000000..0b1614d3d9e6
--- /dev/null
+++ b/test/Modules/Inputs/cxx-templates-a.h
@@ -0,0 +1,50 @@
+@import cxx_templates_common;
+
+template<typename T> T f() { return T(); }
+template<typename T> T f(T);
+namespace N {
+ template<typename T> T f() { return T(); }
+ template<typename T> T f(T);
+}
+
+template<int N> int template_param_kinds_1();
+template<template<typename T, int, int> class> int template_param_kinds_2();
+template<template<typename T, typename U, T> class> int template_param_kinds_3();
+
+template<typename T> struct SomeTemplate<T*>;
+template<typename T> struct SomeTemplate<T*> {};
+typedef SomeTemplate<int*> SomeTemplateIntPtr;
+
+template<typename T> void PerformDelayedLookup(T &t) {
+ t.f();
+ typename T::Inner inner;
+ FoundByADL(t);
+}
+
+template<typename T> void PerformDelayedLookupInDefaultArgument(T &t, int a = (FoundByADL(T()), 0)) {}
+
+template<typename T> struct RedeclaredAsFriend {};
+
+void use_some_template_a() {
+ SomeTemplate<char[2]> a;
+ SomeTemplate<char[1]> b, c;
+ b = c;
+}
+
+template<int> struct MergeTemplates;
+MergeTemplates<0> *merge_templates_a;
+
+auto enum_a_from_a = CommonTemplate<int>::a;
+const auto enum_c_from_a = CommonTemplate<int>::c;
+
+template<int> struct UseInt;
+template<typename T> void UseRedeclaredEnum(UseInt<T() + CommonTemplate<char>::a>);
+constexpr void (*UseRedeclaredEnumA)(UseInt<1>) = UseRedeclaredEnum<int>;
+
+template<typename> struct MergeSpecializations;
+template<typename T> struct MergeSpecializations<T*> {
+ typedef int partially_specialized_in_a;
+};
+template<> struct MergeSpecializations<char> {
+ typedef int explicitly_specialized_in_a;
+};
diff --git a/test/Modules/Inputs/cxx-templates-b-impl.h b/test/Modules/Inputs/cxx-templates-b-impl.h
new file mode 100644
index 000000000000..fdf4a4fbc4d4
--- /dev/null
+++ b/test/Modules/Inputs/cxx-templates-b-impl.h
@@ -0,0 +1,5 @@
+struct DefinedInBImpl {
+ void f();
+ struct Inner {};
+ friend void FoundByADL(DefinedInBImpl);
+};
diff --git a/test/Modules/Inputs/cxx-templates-b.h b/test/Modules/Inputs/cxx-templates-b.h
new file mode 100644
index 000000000000..6cd83faf1a1b
--- /dev/null
+++ b/test/Modules/Inputs/cxx-templates-b.h
@@ -0,0 +1,69 @@
+@import cxx_templates_common;
+
+template<typename T> T f();
+template<typename T> T f(T t) { return t; }
+namespace N {
+ template<typename T> T f();
+ template<typename T> T f(T t) { return t; }
+}
+
+template<typename> int template_param_kinds_1();
+template<template<typename, int, int...> class> int template_param_kinds_2();
+template<template<typename T, typename U, U> class> int template_param_kinds_3();
+
+template<typename T> struct SomeTemplate<T&> {};
+template<typename T> struct SomeTemplate<T&>;
+typedef SomeTemplate<int&> SomeTemplateIntRef;
+
+extern DefinedInCommon &defined_in_common;
+
+template<int> struct MergeTemplates;
+MergeTemplates<0> *merge_templates_b;
+
+@import cxx_templates_b_impl;
+
+template<typename T, typename> struct Identity { typedef T type; };
+template<typename T> void UseDefinedInBImpl() {
+ typename Identity<DefinedInBImpl, T>::type dependent;
+ FoundByADL(dependent);
+ typename Identity<DefinedInBImpl, T>::type::Inner inner;
+ dependent.f();
+}
+
+extern DefinedInBImpl &defined_in_b_impl;
+
+template<typename T>
+struct RedeclareTemplateAsFriend {
+ template<typename U>
+ friend struct RedeclaredAsFriend;
+};
+
+void use_some_template_b() {
+ SomeTemplate<char[1]> a;
+ SomeTemplate<char[2]> b, c;
+ b = c;
+}
+
+auto enum_b_from_b = CommonTemplate<int>::b;
+const auto enum_c_from_b = CommonTemplate<int>::c;
+
+template<int> struct UseInt;
+template<typename T> void UseRedeclaredEnum(UseInt<T() + CommonTemplate<char>::a>);
+constexpr void (*UseRedeclaredEnumB)(UseInt<1>) = UseRedeclaredEnum<int>;
+
+template<typename> struct MergeSpecializations;
+template<typename T> struct MergeSpecializations<T&> {
+ typedef int partially_specialized_in_b;
+};
+template<> struct MergeSpecializations<double> {
+ typedef int explicitly_specialized_in_b;
+};
+
+@import cxx_templates_a;
+template<typename T> void UseDefinedInBImplIndirectly(T &v) {
+ PerformDelayedLookup(v);
+}
+
+void TriggerInstantiation() {
+ UseDefinedInBImpl<void>();
+}
diff --git a/test/Modules/Inputs/cxx-templates-c.h b/test/Modules/Inputs/cxx-templates-c.h
new file mode 100644
index 000000000000..4c0fc8a4a825
--- /dev/null
+++ b/test/Modules/Inputs/cxx-templates-c.h
@@ -0,0 +1,7 @@
+template<typename> struct MergeSpecializations;
+template<typename T> struct MergeSpecializations<T[]> {
+ typedef int partially_specialized_in_c;
+};
+template<> struct MergeSpecializations<bool> {
+ typedef int explicitly_specialized_in_c;
+};
diff --git a/test/Modules/Inputs/cxx-templates-common.h b/test/Modules/Inputs/cxx-templates-common.h
new file mode 100644
index 000000000000..40a11e20b4f0
--- /dev/null
+++ b/test/Modules/Inputs/cxx-templates-common.h
@@ -0,0 +1,11 @@
+template<typename T> struct SomeTemplate {};
+
+struct DefinedInCommon {
+ void f();
+ struct Inner {};
+ friend void FoundByADL(DefinedInCommon);
+};
+
+template<typename T> struct CommonTemplate {
+ enum E { a = 1, b = 2, c = 3 };
+};
diff --git a/test/Modules/Inputs/declare-use/a.h b/test/Modules/Inputs/declare-use/a.h
new file mode 100644
index 000000000000..a36dc1b59d6f
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/a.h
@@ -0,0 +1,4 @@
+#ifndef A_H
+#define A_H
+const int a = 2;
+#endif
diff --git a/test/Modules/Inputs/declare-use/b.h b/test/Modules/Inputs/declare-use/b.h
new file mode 100644
index 000000000000..55daf7286801
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/b.h
@@ -0,0 +1,4 @@
+#ifndef B_H
+#define B_H
+const int b = 3;
+#endif
diff --git a/test/Modules/Inputs/declare-use/c.h b/test/Modules/Inputs/declare-use/c.h
new file mode 100644
index 000000000000..a24cd5ae44c0
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/c.h
@@ -0,0 +1,6 @@
+#ifndef C_H
+#define C_H
+#include "a.h"
+#include "b.h"
+const int c = a+b;
+#endif
diff --git a/test/Modules/Inputs/declare-use/d.h b/test/Modules/Inputs/declare-use/d.h
new file mode 100644
index 000000000000..a597b01c5d04
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/d.h
@@ -0,0 +1,6 @@
+#ifndef D_H
+#define D_H
+#include "a.h"
+#include "b.h"
+const int d = a+b;
+#endif
diff --git a/test/Modules/Inputs/declare-use/e.h b/test/Modules/Inputs/declare-use/e.h
new file mode 100644
index 000000000000..ed8d843f9a85
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/e.h
@@ -0,0 +1,6 @@
+#ifndef E_H
+#define E_H
+#include "a.h"
+#include "b.h"
+const int e = a*b;
+#endif
diff --git a/test/Modules/Inputs/declare-use/f.h b/test/Modules/Inputs/declare-use/f.h
new file mode 100644
index 000000000000..1d8e2fd2881e
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/f.h
@@ -0,0 +1,6 @@
+#ifndef F_H
+#define F_H
+#include "a.h"
+#include "b.h"
+const int f = a+b;
+#endif
diff --git a/test/Modules/Inputs/declare-use/g.h b/test/Modules/Inputs/declare-use/g.h
new file mode 100644
index 000000000000..2a590177f8c3
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/g.h
@@ -0,0 +1,6 @@
+#ifndef G_H
+#define G_H
+#include "c.h"
+#include "g1.h"
+const int g1 = aux_g*c*7;
+#endif
diff --git a/test/Modules/Inputs/declare-use/g1.h b/test/Modules/Inputs/declare-use/g1.h
new file mode 100644
index 000000000000..78a072451f81
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/g1.h
@@ -0,0 +1 @@
+int aux_g = 11;
diff --git a/test/Modules/Inputs/declare-use/h.h b/test/Modules/Inputs/declare-use/h.h
new file mode 100644
index 000000000000..df99a6dd10ae
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/h.h
@@ -0,0 +1,7 @@
+#ifndef H_H
+#define H_H
+#include "c.h"
+#include "d.h" // expected-error {{use of a module not declared used}}
+#include "h1.h"
+const int h1 = aux_h*c*7*d;
+#endif
diff --git a/test/Modules/Inputs/declare-use/h1.h b/test/Modules/Inputs/declare-use/h1.h
new file mode 100644
index 000000000000..a9275d555c34
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/h1.h
@@ -0,0 +1 @@
+int aux_h = 13;
diff --git a/test/Modules/Inputs/declare-use/module.map b/test/Modules/Inputs/declare-use/module.map
new file mode 100644
index 000000000000..774fc37760c9
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/module.map
@@ -0,0 +1,43 @@
+module XA {
+ header "a.h"
+}
+
+module XB {
+ header "b.h"
+}
+
+module XC {
+ header "c.h"
+ use XA
+}
+
+module XD {
+ header "d.h"
+ use XA
+}
+
+module XE {
+ header "e.h"
+ use XA
+ use XB
+}
+
+module XF {
+ header "f.h"
+ use XA
+ use XB
+}
+
+module XG {
+ header "g.h"
+ header "g1.h"
+ use XC
+ use XE
+}
+
+module XH {
+ header "h.h"
+ header "h1.h"
+ use XC
+ use XE
+}
diff --git a/test/Modules/Inputs/def.h b/test/Modules/Inputs/def.h
index eb7eb7e59dc1..6fa83d3eec75 100644
--- a/test/Modules/Inputs/def.h
+++ b/test/Modules/Inputs/def.h
@@ -17,4 +17,11 @@ class Def2 {
public:
void func();
};
+
+namespace Def3NS {
+ class Def3 {
+ public:
+ void func();
+ };
+}
#endif
diff --git a/test/Modules/Inputs/dummy.h b/test/Modules/Inputs/dummy.h
new file mode 100644
index 000000000000..6e1ac74e44fb
--- /dev/null
+++ b/test/Modules/Inputs/dummy.h
@@ -0,0 +1,3 @@
+// This module only exists to make local decl IDs and global decl IDs different.
+
+struct Dummy {} extern *dummy1, *dummy2, *dummy3;
diff --git a/test/Modules/Inputs/incomplete_mod.h b/test/Modules/Inputs/incomplete_mod.h
new file mode 100644
index 000000000000..f08be7244136
--- /dev/null
+++ b/test/Modules/Inputs/incomplete_mod.h
@@ -0,0 +1 @@
+#include "incomplete_mod_missing.h"
diff --git a/test/Modules/Inputs/incomplete_mod_missing.h b/test/Modules/Inputs/incomplete_mod_missing.h
new file mode 100644
index 000000000000..ffc85d5e7305
--- /dev/null
+++ b/test/Modules/Inputs/incomplete_mod_missing.h
@@ -0,0 +1,2 @@
+extern int *missing;
+
diff --git a/test/Modules/Inputs/initializer_list b/test/Modules/Inputs/initializer_list
new file mode 100644
index 000000000000..6058f803a3dd
--- /dev/null
+++ b/test/Modules/Inputs/initializer_list
@@ -0,0 +1,9 @@
+namespace std {
+ using size_t = decltype(sizeof(0));
+
+ template<typename T> struct initializer_list {
+ initializer_list(T*, size_t);
+ };
+
+ template<typename T> int min(initializer_list<T>);
+}
diff --git a/test/Modules/Inputs/modular_maps/a.h b/test/Modules/Inputs/modular_maps/a.h
new file mode 100644
index 000000000000..a36dc1b59d6f
--- /dev/null
+++ b/test/Modules/Inputs/modular_maps/a.h
@@ -0,0 +1,4 @@
+#ifndef A_H
+#define A_H
+const int a = 2;
+#endif
diff --git a/test/Modules/Inputs/modular_maps/b.h b/test/Modules/Inputs/modular_maps/b.h
new file mode 100644
index 000000000000..55daf7286801
--- /dev/null
+++ b/test/Modules/Inputs/modular_maps/b.h
@@ -0,0 +1,4 @@
+#ifndef B_H
+#define B_H
+const int b = 3;
+#endif
diff --git a/test/Modules/Inputs/modular_maps/common.h b/test/Modules/Inputs/modular_maps/common.h
new file mode 100644
index 000000000000..f690bcbd399b
--- /dev/null
+++ b/test/Modules/Inputs/modular_maps/common.h
@@ -0,0 +1,4 @@
+#ifndef COMMON_H
+#define COMMON_H
+const int c = 2;
+#endif
diff --git a/test/Modules/Inputs/modular_maps/modulea.map b/test/Modules/Inputs/modular_maps/modulea.map
new file mode 100644
index 000000000000..58c5f6464e40
--- /dev/null
+++ b/test/Modules/Inputs/modular_maps/modulea.map
@@ -0,0 +1,7 @@
+module A {
+ header "common.h"
+ header "a.h"
+}
+
+extern module B "moduleb.map"
+
diff --git a/test/Modules/Inputs/modular_maps/moduleb.map b/test/Modules/Inputs/modular_maps/moduleb.map
new file mode 100644
index 000000000000..7b35e8f91e44
--- /dev/null
+++ b/test/Modules/Inputs/modular_maps/moduleb.map
@@ -0,0 +1,4 @@
+module B {
+ header "common.h"
+ private header "b.h"
+}
diff --git a/test/Modules/Inputs/module.map b/test/Modules/Inputs/module.map
index d20521f9c764..cf8a298ccee7 100644
--- a/test/Modules/Inputs/module.map
+++ b/test/Modules/Inputs/module.map
@@ -131,6 +131,10 @@ module MethodPoolA {
module MethodPoolB {
header "MethodPoolB.h"
+ explicit module Sub2 {
+ header "MethodPoolBSub2.h"
+ }
+
explicit module Sub {
header "MethodPoolBSub.h"
}
@@ -184,6 +188,35 @@ module cxx_linkage_cache {
header "cxx-linkage-cache.h"
}
+module cxx_templates_common {
+ header "cxx-templates-common.h"
+}
+
+module cxx_templates_a {
+ header "cxx-templates-a.h"
+}
+
+module cxx_templates_b_impl {
+ header "cxx-templates-b-impl.h"
+}
+
+module cxx_templates_b {
+ header "cxx-templates-b.h"
+}
+
+module cxx_templates_c {
+ header "cxx-templates-c.h"
+}
+
+module cxx_decls {
+ module unimported {
+ header "cxx-decls-unimported.h"
+ }
+ module imported {
+ header "cxx-decls-imported.h"
+ }
+}
+
module config {
header "config.h"
config_macros [exhaustive] WANT_FOO, WANT_BAR
@@ -193,6 +226,10 @@ module diag_pragma {
header "diag_pragma.h"
}
+module dummy {
+ header "dummy.h"
+}
+
module builtin {
header "builtin.h"
explicit module sub {
@@ -209,3 +246,38 @@ module linkage_merge {
}
}
+
+module incomplete_mod {
+ header "incomplete_mod.h"
+}
+
+module warning {
+ header "warning.h"
+}
+
+module initializer_list {
+ header "initializer_list"
+}
+
+module using_decl {
+ module a { header "using-decl-a.h" export * }
+ module b { header "using-decl-b.h" export * }
+}
+
+module recursive_visibility_a1 {
+ module inner { header "recursive_visibility_a1_inner.h" }
+}
+module recursive_visibility_a2 {
+ module inner {
+ module more_inner {
+ header "recursive_visibility_a2_more_inner.h"
+ }
+ }
+}
+module recursive_visibility_b {
+ header "recursive_visibility_b.h"
+ export *
+}
+module recursive_visibility_c {
+ header "recursive_visibility_c.h"
+}
diff --git a/test/Modules/Inputs/namespaces-top.h b/test/Modules/Inputs/namespaces-top.h
index 0c607f528516..7aa8490eb7e1 100644
--- a/test/Modules/Inputs/namespaces-top.h
+++ b/test/Modules/Inputs/namespaces-top.h
@@ -12,3 +12,8 @@ namespace N3 {
namespace N12 { }
+namespace N13 {
+ void f();
+ int f(int);
+ void (*p)() = &f;
+}
diff --git a/test/Modules/Inputs/odr/a.h b/test/Modules/Inputs/odr/a.h
new file mode 100644
index 000000000000..26144b86e8d1
--- /dev/null
+++ b/test/Modules/Inputs/odr/a.h
@@ -0,0 +1,13 @@
+extern struct Y {
+ int n;
+ float f;
+} y1;
+enum E { e1 };
+
+struct X {
+ int n;
+} x1;
+
+int f() {
+ return y1.n + e1 + y1.f + x1.n;
+}
diff --git a/test/Modules/Inputs/odr/b.h b/test/Modules/Inputs/odr/b.h
new file mode 100644
index 000000000000..b4063979474f
--- /dev/null
+++ b/test/Modules/Inputs/odr/b.h
@@ -0,0 +1,9 @@
+struct Y {
+ int m;
+ double f;
+} y2;
+enum E { e2 };
+
+int g() {
+ return y2.m + e2 + y2.f;
+}
diff --git a/test/Modules/Inputs/odr/module.map b/test/Modules/Inputs/odr/module.map
new file mode 100644
index 000000000000..81f396342fac
--- /dev/null
+++ b/test/Modules/Inputs/odr/module.map
@@ -0,0 +1,6 @@
+module a {
+ header "a.h"
+}
+module b {
+ header "b.h"
+}
diff --git a/test/Modules/Inputs/pch-used.h b/test/Modules/Inputs/pch-used.h
new file mode 100644
index 000000000000..60e0097ea909
--- /dev/null
+++ b/test/Modules/Inputs/pch-used.h
@@ -0,0 +1,2 @@
+@import cstd.stdio;
+static inline void SPXTrace() { fprintf(__stderrp, ""); }
diff --git a/test/Modules/Inputs/private/common.h b/test/Modules/Inputs/private/common.h
new file mode 100644
index 000000000000..17d5444b650f
--- /dev/null
+++ b/test/Modules/Inputs/private/common.h
@@ -0,0 +1,6 @@
+#ifndef COMMON_H
+#define COMMON_H
+
+typedef int common;
+
+#endif
diff --git a/test/Modules/Inputs/private/module.map b/test/Modules/Inputs/private/module.map
new file mode 100644
index 000000000000..9da44354be14
--- /dev/null
+++ b/test/Modules/Inputs/private/module.map
@@ -0,0 +1,9 @@
+module libPrivate1 {
+ header "public1.h"
+ private header "private1.h"
+}
+
+module libPrivate2 {
+ header "public2.h"
+ private header "private2.h"
+}
diff --git a/test/Modules/Inputs/private/private1.h b/test/Modules/Inputs/private/private1.h
new file mode 100644
index 000000000000..3f41cc0181d5
--- /dev/null
+++ b/test/Modules/Inputs/private/private1.h
@@ -0,0 +1,9 @@
+#ifndef PRIVATE1_H
+#define PRIVATE1_H
+
+#include "common.h"
+
+struct mitts_off1 { common field; };
+struct mitts_off1 hidden_variable1;
+
+#endif
diff --git a/test/Modules/Inputs/private/private2.h b/test/Modules/Inputs/private/private2.h
new file mode 100644
index 000000000000..3b6cddc4d902
--- /dev/null
+++ b/test/Modules/Inputs/private/private2.h
@@ -0,0 +1,9 @@
+#ifndef PRIVATE2_H
+#define PRIVATE2_H
+
+#include "common.h"
+
+struct mitts_off2 { common field; };
+struct mitts_off2 hidden_variable2;
+
+#endif
diff --git a/test/Modules/Inputs/private/public1.h b/test/Modules/Inputs/private/public1.h
new file mode 100644
index 000000000000..3af596a98d08
--- /dev/null
+++ b/test/Modules/Inputs/private/public1.h
@@ -0,0 +1,9 @@
+#ifndef PUBLIC1_H
+#define PUBLIC1_H
+
+#include "private1.h"
+
+struct use_this1 { struct mitts_off1 field; };
+struct use_this1 public_variable1;
+
+#endif
diff --git a/test/Modules/Inputs/private/public2.h b/test/Modules/Inputs/private/public2.h
new file mode 100644
index 000000000000..03d0a858e10e
--- /dev/null
+++ b/test/Modules/Inputs/private/public2.h
@@ -0,0 +1,9 @@
+#ifndef PUBLIC2_H
+#define PUBLIC2_H
+
+#include "private2.h"
+
+struct use_this2 { struct mitts_off2 field; };
+struct use_this2 public_variable2;
+
+#endif
diff --git a/test/Modules/Inputs/private0/common.h b/test/Modules/Inputs/private0/common.h
new file mode 100644
index 000000000000..17d5444b650f
--- /dev/null
+++ b/test/Modules/Inputs/private0/common.h
@@ -0,0 +1,6 @@
+#ifndef COMMON_H
+#define COMMON_H
+
+typedef int common;
+
+#endif
diff --git a/test/Modules/Inputs/private1/module.map b/test/Modules/Inputs/private1/module.map
new file mode 100644
index 000000000000..0904fe68a62c
--- /dev/null
+++ b/test/Modules/Inputs/private1/module.map
@@ -0,0 +1,4 @@
+module libPrivate {
+ header "public1.h"
+ private header "private1.h"
+}
diff --git a/test/Modules/Inputs/private1/private1.h b/test/Modules/Inputs/private1/private1.h
new file mode 100644
index 000000000000..3f41cc0181d5
--- /dev/null
+++ b/test/Modules/Inputs/private1/private1.h
@@ -0,0 +1,9 @@
+#ifndef PRIVATE1_H
+#define PRIVATE1_H
+
+#include "common.h"
+
+struct mitts_off1 { common field; };
+struct mitts_off1 hidden_variable1;
+
+#endif
diff --git a/test/Modules/Inputs/private1/public1.h b/test/Modules/Inputs/private1/public1.h
new file mode 100644
index 000000000000..3af596a98d08
--- /dev/null
+++ b/test/Modules/Inputs/private1/public1.h
@@ -0,0 +1,9 @@
+#ifndef PUBLIC1_H
+#define PUBLIC1_H
+
+#include "private1.h"
+
+struct use_this1 { struct mitts_off1 field; };
+struct use_this1 public_variable1;
+
+#endif
diff --git a/test/Modules/Inputs/private2/module.map b/test/Modules/Inputs/private2/module.map
new file mode 100644
index 000000000000..3d2a5786f9b1
--- /dev/null
+++ b/test/Modules/Inputs/private2/module.map
@@ -0,0 +1,4 @@
+module libPrivateN2 {
+ header "public2.h"
+ private header "private2.h"
+}
diff --git a/test/Modules/Inputs/private2/private2.h b/test/Modules/Inputs/private2/private2.h
new file mode 100644
index 000000000000..3b6cddc4d902
--- /dev/null
+++ b/test/Modules/Inputs/private2/private2.h
@@ -0,0 +1,9 @@
+#ifndef PRIVATE2_H
+#define PRIVATE2_H
+
+#include "common.h"
+
+struct mitts_off2 { common field; };
+struct mitts_off2 hidden_variable2;
+
+#endif
diff --git a/test/Modules/Inputs/private2/public2.h b/test/Modules/Inputs/private2/public2.h
new file mode 100644
index 000000000000..03d0a858e10e
--- /dev/null
+++ b/test/Modules/Inputs/private2/public2.h
@@ -0,0 +1,9 @@
+#ifndef PUBLIC2_H
+#define PUBLIC2_H
+
+#include "private2.h"
+
+struct use_this2 { struct mitts_off2 field; };
+struct use_this2 public_variable2;
+
+#endif
diff --git a/test/Modules/Inputs/recursive_visibility_a1_inner.h b/test/Modules/Inputs/recursive_visibility_a1_inner.h
new file mode 100644
index 000000000000..0f9fdf709ba5
--- /dev/null
+++ b/test/Modules/Inputs/recursive_visibility_a1_inner.h
@@ -0,0 +1,4 @@
+namespace A1_Inner {
+ struct X {};
+ void f(X);
+}
diff --git a/test/Modules/Inputs/recursive_visibility_a2_more_inner.h b/test/Modules/Inputs/recursive_visibility_a2_more_inner.h
new file mode 100644
index 000000000000..a9ff9d90af1b
--- /dev/null
+++ b/test/Modules/Inputs/recursive_visibility_a2_more_inner.h
@@ -0,0 +1,4 @@
+namespace A2_More_Inner {
+ struct X {};
+ void f(X);
+}
diff --git a/test/Modules/Inputs/recursive_visibility_b.h b/test/Modules/Inputs/recursive_visibility_b.h
new file mode 100644
index 000000000000..2c5d4effe330
--- /dev/null
+++ b/test/Modules/Inputs/recursive_visibility_b.h
@@ -0,0 +1,2 @@
+@import recursive_visibility_a1.inner;
+@import recursive_visibility_a2;
diff --git a/test/Modules/Inputs/recursive_visibility_c.h b/test/Modules/Inputs/recursive_visibility_c.h
new file mode 100644
index 000000000000..a978a3c0a562
--- /dev/null
+++ b/test/Modules/Inputs/recursive_visibility_c.h
@@ -0,0 +1,5 @@
+@import recursive_visibility_b;
+template<template<typename T> class Y> void g() {
+ f(typename Y<A1_Inner::X>::type{});
+ f(typename Y<A2_More_Inner::X>::type{});
+}
diff --git a/test/Modules/Inputs/separate_map_tree/maps/modulea.map b/test/Modules/Inputs/separate_map_tree/maps/modulea.map
new file mode 100644
index 000000000000..736503ecaebe
--- /dev/null
+++ b/test/Modules/Inputs/separate_map_tree/maps/modulea.map
@@ -0,0 +1,12 @@
+module D {
+ header "../src/common.h"
+}
+
+module A {
+ header "../src/common.h"
+ use C
+}
+
+extern module B "moduleb.map"
+extern module C "modulec.map"
+
diff --git a/test/Modules/Inputs/separate_map_tree/maps/moduleb.map b/test/Modules/Inputs/separate_map_tree/maps/moduleb.map
new file mode 100644
index 000000000000..d3877965c71e
--- /dev/null
+++ b/test/Modules/Inputs/separate_map_tree/maps/moduleb.map
@@ -0,0 +1,4 @@
+module B {
+ header "../src/public-in-b.h"
+ private header "../src/public-in-c.h"
+}
diff --git a/test/Modules/Inputs/separate_map_tree/maps/modulec.map b/test/Modules/Inputs/separate_map_tree/maps/modulec.map
new file mode 100644
index 000000000000..91063b65f378
--- /dev/null
+++ b/test/Modules/Inputs/separate_map_tree/maps/modulec.map
@@ -0,0 +1,5 @@
+module C {
+ header "../src/public-in-c.h"
+ private header "../src/public-in-b.h"
+ private header "../src/private-in-c.h"
+}
diff --git a/test/Modules/Inputs/separate_map_tree/src/common.h b/test/Modules/Inputs/separate_map_tree/src/common.h
new file mode 100644
index 000000000000..1d2ecb5a194d
--- /dev/null
+++ b/test/Modules/Inputs/separate_map_tree/src/common.h
@@ -0,0 +1,4 @@
+#ifndef COMMON_H
+#define COMMON_H
+const int common = 2;
+#endif
diff --git a/test/Modules/Inputs/separate_map_tree/src/private-in-c.h b/test/Modules/Inputs/separate_map_tree/src/private-in-c.h
new file mode 100644
index 000000000000..bc9e2c1bb342
--- /dev/null
+++ b/test/Modules/Inputs/separate_map_tree/src/private-in-c.h
@@ -0,0 +1,4 @@
+#ifndef PRIVATE_IN_C_H
+#define PRIVATE_IN_C_H
+const int c_ = 2;
+#endif
diff --git a/test/Modules/Inputs/separate_map_tree/src/public-in-b.h b/test/Modules/Inputs/separate_map_tree/src/public-in-b.h
new file mode 100644
index 000000000000..9ea6c1b4410d
--- /dev/null
+++ b/test/Modules/Inputs/separate_map_tree/src/public-in-b.h
@@ -0,0 +1,4 @@
+#ifndef PUBLIC_IN_B_H
+#define PUBLIC_IN_B_H
+const int b = 3;
+#endif
diff --git a/test/Modules/Inputs/separate_map_tree/src/public-in-c.h b/test/Modules/Inputs/separate_map_tree/src/public-in-c.h
new file mode 100644
index 000000000000..fa3d2fd2cb73
--- /dev/null
+++ b/test/Modules/Inputs/separate_map_tree/src/public-in-c.h
@@ -0,0 +1,4 @@
+#ifndef PUBLIC_IN_C_H
+#define PUBLIC_IN_C_H
+const int c = 2;
+#endif
diff --git a/test/Modules/Inputs/submodules/import-self-a.h b/test/Modules/Inputs/submodules/import-self-a.h
new file mode 100644
index 000000000000..adb070abf362
--- /dev/null
+++ b/test/Modules/Inputs/submodules/import-self-a.h
@@ -0,0 +1 @@
+typedef int MyTypeA;
diff --git a/test/Modules/Inputs/submodules/import-self-b.h b/test/Modules/Inputs/submodules/import-self-b.h
new file mode 100644
index 000000000000..f88b56d5f082
--- /dev/null
+++ b/test/Modules/Inputs/submodules/import-self-b.h
@@ -0,0 +1,10 @@
+@import import_self.c;
+#include "import-self-d.h"
+
+// FIXME: This should not work; names from 'a' should not be visible here.
+MyTypeA import_self_test_a;
+
+// FIXME: This should work but does not; names from 'b' are not actually visible here.
+//MyTypeC import_self_test_c;
+
+MyTypeD import_self_test_d;
diff --git a/test/Modules/Inputs/submodules/import-self-c.h b/test/Modules/Inputs/submodules/import-self-c.h
new file mode 100644
index 000000000000..f4b86c5656e1
--- /dev/null
+++ b/test/Modules/Inputs/submodules/import-self-c.h
@@ -0,0 +1 @@
+typedef int MyTypeC;
diff --git a/test/Modules/Inputs/submodules/import-self-d.h b/test/Modules/Inputs/submodules/import-self-d.h
new file mode 100644
index 000000000000..e32a6f51957c
--- /dev/null
+++ b/test/Modules/Inputs/submodules/import-self-d.h
@@ -0,0 +1 @@
+typedef int MyTypeD;
diff --git a/test/Modules/Inputs/submodules/module.map b/test/Modules/Inputs/submodules/module.map
index 16cedac231e7..c91e94f47d23 100644
--- a/test/Modules/Inputs/submodules/module.map
+++ b/test/Modules/Inputs/submodules/module.map
@@ -3,3 +3,10 @@ module std {
module type_traits { header "type_traits.h" }
explicit module hash_map { header "hash_map.h" }
}
+
+module import_self {
+ module a { header "import-self-a.h" }
+ module b { header "import-self-b.h" export * }
+ module c { header "import-self-c.h" }
+ module d { header "import-self-d.h" }
+}
diff --git a/test/Modules/Inputs/templates-left.h b/test/Modules/Inputs/templates-left.h
index 7451420c7482..e76598d6bd5c 100644
--- a/test/Modules/Inputs/templates-left.h
+++ b/test/Modules/Inputs/templates-left.h
@@ -19,6 +19,10 @@ namespace N {
};
}
+constexpr unsigned List<int>::*size_left = &List<int>::size;
+List<int> list_left = { 0, 8 };
+typedef List<int> ListInt_left;
+
template <typename T>
void pendingInstantiationEmit(T) {}
void triggerPendingInstantiation() {
@@ -27,3 +31,5 @@ void triggerPendingInstantiation() {
}
void redeclDefinitionEmit(){}
+
+typedef Outer<int>::Inner OuterIntInner_left;
diff --git a/test/Modules/Inputs/templates-right.h b/test/Modules/Inputs/templates-right.h
index d3524d34769b..16d0a714d90e 100644
--- a/test/Modules/Inputs/templates-right.h
+++ b/test/Modules/Inputs/templates-right.h
@@ -18,6 +18,10 @@ namespace N {
};
}
+constexpr unsigned List<int>::*size_right = &List<int>::size;
+List<int> list_right = { 0, 12 };
+typedef List<int> ListInt_right;
+
template <typename T>
void pendingInstantiationEmit(T) {}
void triggerPendingInstantiationToo() {
@@ -25,3 +29,5 @@ void triggerPendingInstantiationToo() {
}
void redeclDefinitionEmit(){}
+
+typedef Outer<int>::Inner OuterIntInner_right;
diff --git a/test/Modules/Inputs/templates-top.h b/test/Modules/Inputs/templates-top.h
index 5985ee8820d6..87dcd8b7f465 100644
--- a/test/Modules/Inputs/templates-top.h
+++ b/test/Modules/Inputs/templates-top.h
@@ -3,6 +3,10 @@ template<typename T> class Vector;
template<typename T> class List {
public:
void push_back(T);
+
+ struct node {};
+ node *head;
+ unsigned size;
};
namespace A {
@@ -15,3 +19,7 @@ template <typename T> class A::WhereAmI {
public:
static void func() {}
};
+
+template<typename T> struct Outer {
+ struct Inner {};
+};
diff --git a/test/Modules/Inputs/using-decl-a.h b/test/Modules/Inputs/using-decl-a.h
new file mode 100644
index 000000000000..85a4788e7647
--- /dev/null
+++ b/test/Modules/Inputs/using-decl-a.h
@@ -0,0 +1,10 @@
+typedef int using_decl_type;
+int using_decl_var;
+
+namespace UsingDecl {
+ using ::using_decl_type;
+ using ::using_decl_var;
+
+ namespace A { typedef int inner; }
+ using A::inner;
+}
diff --git a/test/Modules/Inputs/using-decl-b.h b/test/Modules/Inputs/using-decl-b.h
new file mode 100644
index 000000000000..b82526f39ff4
--- /dev/null
+++ b/test/Modules/Inputs/using-decl-b.h
@@ -0,0 +1,11 @@
+namespace UsingDecl {
+ namespace B { typedef int inner; }
+ using B::inner;
+}
+
+#include "using-decl-a.h"
+
+namespace UsingDecl {
+ using ::using_decl_type;
+ using ::using_decl_var;
+}
diff --git a/test/Modules/Inputs/warning.h b/test/Modules/Inputs/warning.h
new file mode 100644
index 000000000000..a90c62886749
--- /dev/null
+++ b/test/Modules/Inputs/warning.h
@@ -0,0 +1 @@
+enum { bigger_than_int = 0x80000000 };
diff --git a/test/Modules/auto-module-import.m b/test/Modules/auto-module-import.m
index 735182818203..d7fb9d1f9fd6 100644
--- a/test/Modules/auto-module-import.m
+++ b/test/Modules/auto-module-import.m
@@ -1,10 +1,12 @@
// RUN: rm -rf %t
+// RUN: %clang_cc1 -Wauto-import -fmodules-cache-path=%t -fmodules -F %S/Inputs %s -verify -DERRORS
// RUN: %clang_cc1 -Wauto-import -fmodules-cache-path=%t -fmodules -F %S/Inputs %s -verify
+//
+// Test both with and without the declarations that refer to unimported
+// entities. For error recovery, those cases implicitly trigger an import.
#include <DependsOnModule/DependsOnModule.h> // expected-warning{{treating #include as an import of module 'DependsOnModule'}}
-// expected-note@Inputs/NoUmbrella.framework/PrivateHeaders/A_Private.h:1{{'no_umbrella_A_private' declared here}}
-
#ifdef MODULE_H_MACRO
# error MODULE_H_MACRO should have been hidden
#endif
@@ -13,15 +15,21 @@
# error DEPENDS_ON_MODULE should have been hidden
#endif
-Module *mod; // expected-error{{unknown type name 'Module'}}
-
+#ifdef ERRORS
+Module *mod; // expected-error{{declaration of 'Module' must be imported from module 'Module' before it is required}}
+// expected-note@Inputs/Module.framework/Headers/Module.h:15 {{previous}}
+#else
#import <AlsoDependsOnModule/AlsoDependsOnModule.h> // expected-warning{{treating #import as an import of module 'AlsoDependsOnModule'}}
+#endif
Module *mod2;
int getDependsOther() { return depends_on_module_other; }
void testSubframeworkOther() {
- double *sfo1 = sub_framework_other; // expected-error{{use of undeclared identifier 'sub_framework_other'}}
+#ifdef ERRORS
+ double *sfo1 = sub_framework_other; // expected-error{{declaration of 'sub_framework_other' must be imported from module 'DependsOnModule.SubFramework.Other'}}
+ // expected-note@Inputs/DependsOnModule.framework/Frameworks/SubFramework.framework/Headers/Other.h:15 {{previous}}
+#endif
}
// Test umbrella-less submodule includes
@@ -32,8 +40,10 @@ int getNoUmbrellaA() { return no_umbrella_A; }
#include <NoUmbrella/SubDir/C.h> // expected-warning{{treating #include as an import of module 'NoUmbrella.SubDir.C'}}
int getNoUmbrellaC() { return no_umbrella_C; }
+#ifndef ERRORS
// Test header cross-subframework include pattern.
#include <DependsOnModule/../Frameworks/SubFramework.framework/Headers/Other.h> // expected-warning{{treating #include as an import of module 'DependsOnModule.SubFramework.Other'}}
+#endif
void testSubframeworkOtherAgain() {
double *sfo1 = sub_framework_other;
@@ -61,7 +71,8 @@ int getModulePrivate() { return module_private; }
#include <NoUmbrella/A_Private.h> // expected-warning{{treating #include as an import of module 'NoUmbrella.Private.A_Private'}}
int getNoUmbrellaAPrivate() { return no_umbrella_A_private; }
-int getNoUmbrellaBPrivateFail() { return no_umbrella_B_private; } // expected-error{{use of undeclared identifier 'no_umbrella_B_private'; did you mean 'no_umbrella_A_private'?}}
+int getNoUmbrellaBPrivateFail() { return no_umbrella_B_private; } // expected-error{{declaration of 'no_umbrella_B_private' must be imported from module 'NoUmbrella.Private.B_Private'}}
+// expected-note@Inputs/NoUmbrella.framework/PrivateHeaders/B_Private.h:1 {{previous}}
// Test inclusion of headers that are under an umbrella directory but
// not actually part of the module.
@@ -71,3 +82,7 @@ int getNoUmbrellaBPrivateFail() { return no_umbrella_B_private; } // expected-er
int getNotInModule() {
return not_in_module;
}
+
+void includeNotAtTopLevel() {
+ #include <NoUmbrella/A.h> // expected-warning {{treating #include as an import}} expected-error {{expected expression}}
+}
diff --git a/test/Modules/autolink.m b/test/Modules/autolink.m
index 4bf9d592a8f2..077aac5374a0 100644
--- a/test/Modules/autolink.m
+++ b/test/Modules/autolink.m
@@ -35,7 +35,7 @@ int use_no_umbrella() {
// CHECK: !4 = metadata !{i32 6, metadata !"Linker Options", metadata ![[AUTOLINK_OPTIONS:[0-9]+]]}
// CHECK: ![[AUTOLINK_OPTIONS]] = metadata !{metadata ![[AUTOLINK_FRAMEWORK:[0-9]+]], metadata ![[AUTOLINK:[0-9]+]], metadata ![[DEPENDSONMODULE:[0-9]+]], metadata ![[MODULE:[0-9]+]], metadata ![[NOUMBRELLA:[0-9]+]]}
// CHECK: ![[AUTOLINK_FRAMEWORK]] = metadata !{metadata !"-framework", metadata !"autolink_framework"}
-// CHECK: ![[AUTOLINK]] = metadata !{metadata !"-lautolink"}
+// CHECK: ![[AUTOLINK]] = metadata !{metadata !"{{(-l|/DEFAULTLIB:)}}autolink{{(\.lib)?}}"}
// CHECK: ![[DEPENDSONMODULE]] = metadata !{metadata !"-framework", metadata !"DependsOnModule"}
// CHECK: ![[MODULE]] = metadata !{metadata !"-framework", metadata !"Module"}
// CHECK: ![[NOUMBRELLA]] = metadata !{metadata !"-framework", metadata !"NoUmbrella"}
diff --git a/test/Modules/build-fail-notes.m b/test/Modules/build-fail-notes.m
index 8375788e817b..e27341154d79 100644
--- a/test/Modules/build-fail-notes.m
+++ b/test/Modules/build-fail-notes.m
@@ -1,5 +1,5 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -F %S/Inputs -DgetModuleVersion="epic fail" %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fmodules-cache-path=%t -fmodules -F %S/Inputs -DgetModuleVersion="epic fail" %s 2>&1 | FileCheck %s
@import DependsOnModule;
@@ -11,14 +11,14 @@
// CHECK: fatal error: could not build module 'DependsOnModule'
// CHECK-NOT: error:
-// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -F %S/Inputs %s -fdiagnostics-show-note-include-stack 2>&1 | FileCheck -check-prefix=CHECK-REDEF %s
+// RUN: not %clang_cc1 -fmodules-cache-path=%t -fmodules -F %S/Inputs %s -fdiagnostics-show-note-include-stack 2>&1 | FileCheck -check-prefix=CHECK-REDEF %s
extern int Module;
// CHECK-REDEF: In module 'DependsOnModule' imported from
// CHECK-REDEF: In module 'Module' imported from
// CHECK-REDEF: Module.h:15:12: note: previous definition is here
-// RUN: not %clang_cc1 -fmodules-cache-path=%t -fmodules -F %S/Inputs -DgetModuleVersion="epic fail" -serialize-diagnostic-file %t/tmp.diag %s 2>&1
+// RUN: not %clang_cc1 -Wincomplete-umbrella -fmodules-cache-path=%t -fmodules -F %S/Inputs -DgetModuleVersion="epic fail" -serialize-diagnostic-file %t/tmp.diag %s 2>&1
// RUN: c-index-test -read-diagnostics %t/tmp.diag 2>&1 | FileCheck -check-prefix=CHECK-SDIAG %s
// CHECK-SDIAG: Module.h:9:13: error: expected ';' after top level declarator
diff --git a/test/Modules/compiler_builtins_arm.m b/test/Modules/compiler_builtins_arm.m
new file mode 100644
index 000000000000..d15437cafcdb
--- /dev/null
+++ b/test/Modules/compiler_builtins_arm.m
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fsyntax-only -triple thumbv7-none-linux-gnueabihf -target-abi aapcs -target-cpu cortex-a8 -mfloat-abi hard -std=c99 -fmodules -fmodules-cache-path=%t -D__need_wint_t %s -verify
+// expected-no-diagnostics
+// REQUIRES: arm-registered-target
+
+@import _Builtin_intrinsics.arm.neon;
diff --git a/test/Modules/cxx-decls.cpp b/test/Modules/cxx-decls.cpp
new file mode 100644
index 000000000000..ba3281aaec7a
--- /dev/null
+++ b/test/Modules/cxx-decls.cpp
@@ -0,0 +1,21 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11
+
+// expected-no-diagnostics
+
+@import dummy;
+@import cxx_decls.imported;
+
+void test_delete(int *p) {
+ // We can call the normal global deallocation function even though it has only
+ // ever been explicitly declared in an unimported submodule.
+ delete p;
+}
+
+void friend_1(HasFriends s) {
+ s.private_thing();
+}
+void test_friends(HasFriends s) {
+ friend_1(s);
+ friend_2(s);
+}
diff --git a/test/Modules/cxx-templates.cpp b/test/Modules/cxx-templates.cpp
new file mode 100644
index 000000000000..65f41f677be5
--- /dev/null
+++ b/test/Modules/cxx-templates.cpp
@@ -0,0 +1,125 @@
+// RUN: rm -rf %t
+// RUN: not %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -std=c++11 -ast-dump -ast-dump-lookups | FileCheck %s --check-prefix=CHECK-GLOBAL
+// RUN: not %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -std=c++11 -ast-dump -ast-dump-lookups -ast-dump-filter N | FileCheck %s --check-prefix=CHECK-NAMESPACE-N
+// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11
+
+@import cxx_templates_a;
+@import cxx_templates_b;
+@import cxx_templates_c;
+@import cxx_templates_common;
+
+template<typename, char> struct Tmpl_T_C {};
+template<typename, int, int> struct Tmpl_T_I_I {};
+
+template<typename A, typename B, A> struct Tmpl_T_T_A {};
+template<typename A, typename B, B> struct Tmpl_T_T_B {};
+
+template<int> struct UseInt {};
+
+void g() {
+ f(0);
+ f<double>(1.0);
+ f<int>();
+ f(); // expected-error {{no matching function}}
+ // expected-note@Inputs/cxx-templates-b.h:3 {{couldn't infer template argument}}
+ // expected-note@Inputs/cxx-templates-b.h:4 {{requires single argument}}
+
+ N::f(0);
+ N::f<double>(1.0);
+ N::f<int>();
+ N::f(); // expected-error {{no matching function}}
+ // expected-note@Inputs/cxx-templates-b.h:6 {{couldn't infer template argument}}
+ // expected-note@Inputs/cxx-templates-b.h:7 {{requires single argument 't'}}
+
+ template_param_kinds_1<0>(); // ok, from cxx-templates-a.h
+ template_param_kinds_1<int>(); // ok, from cxx-templates-b.h
+
+ template_param_kinds_2<Tmpl_T_C>(); // expected-error {{no matching function}}
+ // expected-note@Inputs/cxx-templates-a.h:11 {{invalid explicitly-specified argument}}
+ // expected-note@Inputs/cxx-templates-b.h:11 {{invalid explicitly-specified argument}}
+
+ template_param_kinds_2<Tmpl_T_I_I>(); // expected-error {{ambiguous}}
+ // expected-note@Inputs/cxx-templates-a.h:11 {{candidate}}
+ // expected-note@Inputs/cxx-templates-b.h:11 {{candidate}}
+
+ // FIXME: This should be valid, but we incorrectly match the template template
+ // argument against both template template parameters.
+ template_param_kinds_3<Tmpl_T_T_A>(); // expected-error {{ambiguous}}
+ // expected-note@Inputs/cxx-templates-a.h:12 {{candidate}}
+ // expected-note@Inputs/cxx-templates-b.h:12 {{candidate}}
+ template_param_kinds_3<Tmpl_T_T_B>(); // expected-error {{ambiguous}}
+ // expected-note@Inputs/cxx-templates-a.h:12 {{candidate}}
+ // expected-note@Inputs/cxx-templates-b.h:12 {{candidate}}
+
+ // Trigger the instantiation of a template in 'a' that uses a type defined in
+ // 'common'. That type is not visible here.
+ PerformDelayedLookup(defined_in_common);
+
+ // Likewise, but via a default argument.
+ PerformDelayedLookupInDefaultArgument(defined_in_common);
+
+ // Trigger the instantiation of a template in 'b' that uses a type defined in
+ // 'b_impl'. That type is not visible here.
+ UseDefinedInBImpl<int>();
+
+ // Trigger the instantiation of a template in 'a' that uses a type defined in
+ // 'b_impl', via a template defined in 'b'. Since the type is visible from
+ // within 'b', the instantiation succeeds.
+ UseDefinedInBImplIndirectly(defined_in_b_impl);
+
+ // Trigger the instantiation of a template in 'a' that uses a type defined in
+ // 'b_impl'. That type is not visible here, nor in 'a'. This fails; there is
+ // no reason why DefinedInBImpl should be visible here.
+ // expected-error@Inputs/cxx-templates-a.h:19 {{definition of 'DefinedInBImpl' must be imported}}
+ // expected-note@Inputs/cxx-templates-b-impl.h:1 {{definition is here}}
+ PerformDelayedLookup(defined_in_b_impl); // expected-note {{in instantiation of}}
+
+ merge_templates_a = merge_templates_b; // ok, same type
+
+ using T = decltype(enum_a_from_a);
+ using T = decltype(enum_b_from_b);
+ T e = true ? enum_a_from_a : enum_b_from_b;
+
+ UseRedeclaredEnum<int>(UseInt<1>());
+ // FIXME: Reintroduce this once we merge function template specializations.
+ //static_assert(UseRedeclaredEnumA == UseRedeclaredEnumB, "");
+ //static_assert(UseRedeclaredEnumA == UseRedeclaredEnum<int>, "");
+ //static_assert(UseRedeclaredEnumB == UseRedeclaredEnum<int>, "");
+ static_assert(enum_c_from_a == enum_c_from_b, "");
+ CommonTemplate<int> cti;
+ CommonTemplate<int>::E eee = CommonTemplate<int>::c;
+}
+
+RedeclaredAsFriend<int> raf1;
+RedeclareTemplateAsFriend<double> rtaf;
+RedeclaredAsFriend<double> raf2;
+
+MergeSpecializations<int*>::partially_specialized_in_a spec_in_a_1;
+MergeSpecializations<int&>::partially_specialized_in_b spec_in_b_1;
+MergeSpecializations<int[]>::partially_specialized_in_c spec_in_c_1;
+MergeSpecializations<char>::explicitly_specialized_in_a spec_in_a_2;
+MergeSpecializations<double>::explicitly_specialized_in_b spec_in_b_2;
+MergeSpecializations<bool>::explicitly_specialized_in_c spec_in_c_2;
+
+@import cxx_templates_common;
+
+typedef SomeTemplate<int*> SomeTemplateIntPtr;
+typedef SomeTemplate<int&> SomeTemplateIntRef;
+SomeTemplate<char*> some_template_char_ptr;
+SomeTemplate<char&> some_template_char_ref;
+
+void testImplicitSpecialMembers(SomeTemplate<char[1]> &a,
+ const SomeTemplate<char[1]> &b,
+ SomeTemplate<char[2]> &c,
+ const SomeTemplate<char[2]> &d) {
+ a = b;
+ c = d;
+}
+
+// CHECK-GLOBAL: DeclarationName 'f'
+// CHECK-GLOBAL-NEXT: |-FunctionTemplate {{.*}} 'f'
+// CHECK-GLOBAL-NEXT: `-FunctionTemplate {{.*}} 'f'
+
+// CHECK-NAMESPACE-N: DeclarationName 'f'
+// CHECK-NAMESPACE-N-NEXT: |-FunctionTemplate {{.*}} 'f'
+// CHECK-NAMESPACE-N-NEXT: `-FunctionTemplate {{.*}} 'f'
diff --git a/test/Modules/cycles.c b/test/Modules/cycles.c
index 5f83092c95fd..47728d814c29 100644
--- a/test/Modules/cycles.c
+++ b/test/Modules/cycles.c
@@ -1,5 +1,5 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -F %S/Inputs %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -F %S/Inputs %s 2>&1 | FileCheck %s
// FIXME: When we have a syntax for modules in C, use that.
@import MutuallyRecursive1;
diff --git a/test/Modules/declare-use1.cpp b/test/Modules/declare-use1.cpp
new file mode 100644
index 000000000000..4508017c12d2
--- /dev/null
+++ b/test/Modules/declare-use1.cpp
@@ -0,0 +1,7 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fmodules-decluse -fmodule-name=XG -I %S/Inputs/declare-use %s -verify
+
+#include "g.h"
+#include "e.h"
+#include "f.h" // expected-error {{use of a module not declared used}}
+const int g2 = g1+e+f;
diff --git a/test/Modules/declare-use2.cpp b/test/Modules/declare-use2.cpp
new file mode 100644
index 000000000000..a2ec55e5e5ca
--- /dev/null
+++ b/test/Modules/declare-use2.cpp
@@ -0,0 +1,7 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fmodules-decluse -fmodule-name=XH -I %S/Inputs/declare-use %s -verify
+
+#include "h.h"
+#include "e.h"
+#include "f.h" // expected-error {{use of a module not declared used}}
+const int h2 = h1+e+f;
diff --git a/test/Modules/decldef.m b/test/Modules/decldef.m
index 7ed82b57e9c6..efd2d7c42c83 100644
--- a/test/Modules/decldef.m
+++ b/test/Modules/decldef.m
@@ -1,13 +1,16 @@
// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fobjc-arc -I %S/Inputs -fmodules-cache-path=%t %s -verify -DUSE_EARLY
// RUN: %clang_cc1 -fmodules -fobjc-arc -I %S/Inputs -fmodules-cache-path=%t %s -verify
-// expected-note@Inputs/def.h:5 {{previous definition is here}}
+// expected-note@Inputs/def.h:5 {{previous}}
@class Def;
Def *def;
@import decldef;
-A *a1; // expected-error{{unknown type name 'A'}}
+#ifdef USE_EARLY
+A *a1; // expected-error{{declaration of 'A' must be imported from module 'decldef.Def' before it is required}}
+#endif
B *b1; // expected-error{{must use 'struct' tag to refer to type 'B'}}
@import decldef.Decl;
@@ -15,7 +18,10 @@ A *a2;
struct B *b;
void testA(A *a) {
- a->ivar = 17; // expected-error{{definition of 'A' must be imported from module 'decldef.Def' before it is required}}
+ a->ivar = 17;
+#ifndef USE_EARLY
+ // expected-error@-2{{definition of 'A' must be imported from module 'decldef.Def' before it is required}}
+#endif
}
void testB() {
diff --git a/test/Modules/decldef.mm b/test/Modules/decldef.mm
index 593f53b2c6cf..35694935dfbb 100644
--- a/test/Modules/decldef.mm
+++ b/test/Modules/decldef.mm
@@ -1,27 +1,35 @@
// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fobjc-arc -I %S/Inputs -fmodules-cache-path=%t %s -verify -DUSE_EARLY
// RUN: %clang_cc1 -fmodules -fobjc-arc -I %S/Inputs -fmodules-cache-path=%t %s -verify
-// expected-note@Inputs/def.h:5 {{previous definition is here}}
+// expected-note@Inputs/def.h:5 {{previous}}
@class Def;
Def *def;
-class Def2;
+class Def2; // expected-note {{forward decl}}
Def2 *def2;
+namespace Def3NS { class Def3; } // expected-note {{forward decl}}
+Def3NS::Def3 *def3;
@interface Unrelated
- defMethod;
@end
@import decldef;
-A *a1; // expected-error{{unknown type name 'A'}}
-B *b1; // expected-error{{unknown type name 'B'}}
+#ifdef USE_EARLY
+A *a1; // expected-error{{declaration of 'A' must be imported from module 'decldef.Def'}}
+B *b1;
+#endif
@import decldef.Decl;
A *a2;
B *b;
void testA(A *a) {
- a->ivar = 17; // expected-error{{definition of 'A' must be imported from module 'decldef.Def' before it is required}}
+ a->ivar = 17;
+#ifndef USE_EARLY
+ // expected-error@-2{{definition of 'A' must be imported from module 'decldef.Def' before it is required}}
+#endif
}
void testB() {
@@ -33,5 +41,9 @@ void testDef() {
}
void testDef2() {
- def2->func();
+ // FIXME: These should both work, since we've (implicitly) imported
+ // decldef.Def here, but they don't, because nothing has triggered the lazy
+ // loading of the definitions of these classes.
+ def2->func(); // expected-error {{incomplete}}
+ def3->func(); // expected-error {{incomplete}}
}
diff --git a/test/Modules/driver.c b/test/Modules/driver.c
index 08fdaab44106..79d1bbe13c07 100644
--- a/test/Modules/driver.c
+++ b/test/Modules/driver.c
@@ -1,5 +1,5 @@
-// RUN: %clang -fmodules %s -### 2>&1 | FileCheck -check-prefix NO_MODULE_CACHE %s
-// RUN: %clang -fmodules -fmodules-cache-path=blarg %s -### 2>&1 | FileCheck -check-prefix WITH_MODULE_CACHE %s
+// RUN: %clang -fmodules %s -### 2>&1 | FileCheck -check-prefix CHECK-NO_MODULE_CACHE %s
+// RUN: %clang -fmodules -fmodules-cache-path=blarg %s -### 2>&1 | FileCheck -check-prefix CHECK-WITH_MODULE_CACHE %s
// CHECK-NO_MODULE_CACHE: {{clang.*"-fmodules-cache-path=.*ModuleCache"}}
diff --git a/test/Modules/epic-fail.m b/test/Modules/epic-fail.m
index 8969149f957a..7ce9571255f9 100644
--- a/test/Modules/epic-fail.m
+++ b/test/Modules/epic-fail.m
@@ -1,5 +1,5 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -F %S/Inputs -DgetModuleVersion="epic fail" %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fmodules-cache-path=%t -fmodules -F %S/Inputs -DgetModuleVersion="epic fail" %s 2>&1 | FileCheck %s
@import Module;
@import DependsOnModule;
diff --git a/test/Modules/fatal-module-loader-error.m b/test/Modules/fatal-module-loader-error.m
new file mode 100644
index 000000000000..6af3b4c7c370
--- /dev/null
+++ b/test/Modules/fatal-module-loader-error.m
@@ -0,0 +1,26 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: touch %t/Module.pcm
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t %s -fdisable-module-hash -F %S/Inputs -verify
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t %s -fdisable-module-hash -F %S/Inputs -DIMPLICIT -verify
+
+// This tests that after a fatal module loader error, we do not continue parsing.
+
+#ifdef IMPLICIT
+
+// expected-error@+1{{does not appear to be}}
+#import <Module/Module.h>
+#pragma clang __debug crash;
+
+#else
+
+// expected-error@+1{{does not appear to be}}
+@import Module;
+#pragma clang __debug crash;
+
+#endif
+
+// Also check that libclang does not create a PCH with such an error.
+// RUN: not c-index-test -write-pch %t.pch -fmodules -fmodules-cache-path=%t \
+// RUN: %s -Xclang -fdisable-module-hash -F %S/Inputs 2>&1 | FileCheck %s
+// CHECK: Unable to write PCH file
diff --git a/test/Modules/import-decl.cpp b/test/Modules/import-decl.cpp
index 900e090c0c5f..56428b3eba65 100644
--- a/test/Modules/import-decl.cpp
+++ b/test/Modules/import-decl.cpp
@@ -8,3 +8,12 @@
int main() {
return 0;
}
+
+// <rdar://problem/15084587>
+@interface A
+-method;
+@end
+
+void testImport(A *import) {
+ [import method];
+}
diff --git a/test/Modules/incomplete-module.m b/test/Modules/incomplete-module.m
new file mode 100644
index 000000000000..8edaea983cb9
--- /dev/null
+++ b/test/Modules/incomplete-module.m
@@ -0,0 +1,5 @@
+@import incomplete_mod;
+
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules-cache-path=%t -Wincomplete-module -fmodules -I %S/Inputs %s 2>&1 | FileCheck %s
+// CHECK: {{warning: header '.*incomplete_mod_missing.h' is included in module 'incomplete_mod' but not listed in module map}}
diff --git a/test/Modules/initializer_list.cpp b/test/Modules/initializer_list.cpp
new file mode 100644
index 000000000000..0cbcbbb70e46
--- /dev/null
+++ b/test/Modules/initializer_list.cpp
@@ -0,0 +1,7 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11
+
+// expected-no-diagnostics
+@import initializer_list;
+
+int n = std::min({1, 2, 3});
diff --git a/test/Modules/load_failure.c b/test/Modules/load_failure.c
index 6f9426aa062b..6c6d812bafa3 100644
--- a/test/Modules/load_failure.c
+++ b/test/Modules/load_failure.c
@@ -8,7 +8,7 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodules-cache-path=%t -fdisable-module-hash -emit-module -fmodule-name=load_failure %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s
+// RUN: not %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s
// CHECK-NONEXISTENT: load_failure.c:2:9: fatal error: module 'load_nonexistent' not found
// RUN: not %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -fdisable-module-hash %s -DFAILURE 2> %t.out
diff --git a/test/Modules/macros.c b/test/Modules/macros.c
index 433e03324bce..541c95be58de 100644
--- a/test/Modules/macros.c
+++ b/test/Modules/macros.c
@@ -4,7 +4,7 @@
// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=macros_right %S/Inputs/module.map
// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodules-cache-path=%t -fmodule-name=macros %S/Inputs/module.map
// RUN: %clang_cc1 -fmodules -x objective-c -verify -fmodules-cache-path=%t %s
-// RUN: %clang_cc1 -E -fmodules -x objective-c -fmodules-cache-path=%t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
+// RUN: not %clang_cc1 -E -fmodules -x objective-c -fmodules-cache-path=%t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
// FIXME: When we have a syntax for modules in C, use that.
// These notes come from headers in modules, and are bogus.
diff --git a/test/Modules/method_pool.m b/test/Modules/method_pool.m
index 6fd74b0885fd..f7d5ae700c97 100644
--- a/test/Modules/method_pool.m
+++ b/test/Modules/method_pool.m
@@ -47,6 +47,10 @@ void testMethod3Again(id object) {
char *str = [object method3]; // okay: only found in MethodPoolB.Sub
}
+void testMethod6(id object) {
+ [object method6];
+}
+
@import MethodPoolA.Sub;
void testMethod3AgainAgain(id object) {
diff --git a/test/Modules/modular_maps.cpp b/test/Modules/modular_maps.cpp
new file mode 100644
index 000000000000..9c9aba85a918
--- /dev/null
+++ b/test/Modules/modular_maps.cpp
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fmodule-map-file=%S/Inputs/modular_maps/modulea.map -I %S/Inputs/modular_maps %s -verify
+
+#include "common.h"
+#include "a.h"
+#include "b.h" // expected-error {{private header}}
+const int v = a + c;
+const int val = a + b + c; // expected-error {{undeclared identifier}}
diff --git a/test/Modules/namespaces.cpp b/test/Modules/namespaces.cpp
index 426e0025f9f8..8c225e051bde 100644
--- a/test/Modules/namespaces.cpp
+++ b/test/Modules/namespaces.cpp
@@ -75,3 +75,10 @@ void testAnonymousNotMerged() {
// expected-note@Inputs/namespaces-right.h:60 {{passing argument to parameter here}}
// expected-note@Inputs/namespaces-right.h:67 {{passing argument to parameter here}}
+
+// Test that bringing in one name from an overload set does not hide the rest.
+void testPartialImportOfOverloadSet() {
+ void (*p)() = N13::p;
+ p();
+ N13::f(0);
+}
diff --git a/test/Modules/normal-module-map.cpp b/test/Modules/normal-module-map.cpp
index 8155318fb310..70fed60b1295 100644
--- a/test/Modules/normal-module-map.cpp
+++ b/test/Modules/normal-module-map.cpp
@@ -24,8 +24,8 @@ int testNestedUmbrellaA() {
int testNestedUmbrellaBFail() {
return nested_umbrella_b;
- // expected-error@-1{{use of undeclared identifier 'nested_umbrella_b'; did you mean 'nested_umbrella_a'?}}
- // expected-note@Inputs/normal-module-map/nested_umbrella/a.h:1{{'nested_umbrella_a' declared here}}
+ // expected-error@-1{{declaration of 'nested_umbrella_b' must be imported from module 'nested_umbrella.b' before it is required}}
+ // expected-note@Inputs/normal-module-map/nested_umbrella/b.h:1{{previous}}
}
@import nested_umbrella.b;
diff --git a/test/Modules/objc-categories.m b/test/Modules/objc-categories.m
index 81fb28bafb2a..f08b13a78ab2 100644
--- a/test/Modules/objc-categories.m
+++ b/test/Modules/objc-categories.m
@@ -10,6 +10,7 @@
// expected-note@Inputs/category_left.h:14 {{previous definition}}
// expected-warning@Inputs/category_right.h:11 {{duplicate definition of category}}
+// expected-note@Inputs/category_top.h:1 {{receiver is instance of class declared here}}
@interface Foo(Source)
-(void)source;
diff --git a/test/Modules/odr.cpp b/test/Modules/odr.cpp
new file mode 100644
index 000000000000..5ab10d2ce419
--- /dev/null
+++ b/test/Modules/odr.cpp
@@ -0,0 +1,20 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs/odr %s -verify -std=c++11
+
+// expected-error@a.h:8 {{'X::n' from module 'a' is not present in definition of 'X' provided earlier}}
+struct X { // expected-note {{definition has no member 'n'}}
+};
+
+@import a;
+@import b;
+
+// Trigger the declarations from a and b to be imported.
+int x = f() + g();
+
+// expected-note@a.h:5 {{definition has no member 'e2'}}
+// expected-note@a.h:3 {{declaration of 'f' does not match}}
+// expected-note@a.h:1 {{definition has no member 'm'}}
+
+// expected-error@b.h:5 {{'E::e2' from module 'b' is not present in definition of 'E' in module 'a'}}
+// expected-error@b.h:3 {{'Y::f' from module 'b' is not present in definition of 'Y' in module 'a'}}
+// expected-error@b.h:2 {{'Y::m' from module 'b' is not present in definition of 'Y' in module 'a'}}
diff --git a/test/Modules/pch-used.m b/test/Modules/pch-used.m
new file mode 100644
index 000000000000..56961ba404cc
--- /dev/null
+++ b/test/Modules/pch-used.m
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: %clang_cc1 -x objective-c-header -emit-pch %S/Inputs/pch-used.h -o %t/pch-used.h.pch -fmodules -fmodules-cache-path=%t/cache -O0 -isystem %S/Inputs/System/usr/include
+// RUN: %clang_cc1 %s -include-pch %t/pch-used.h.pch -fmodules -fmodules-cache-path=%t/cache -O0 -isystem %S/Inputs/System/usr/include -emit-llvm -o - | FileCheck %s
+
+void f() { SPXTrace(); }
+
+// CHECK: define internal void @SPXTrace
diff --git a/test/Modules/private.cpp b/test/Modules/private.cpp
new file mode 100644
index 000000000000..93b4b9457f44
--- /dev/null
+++ b/test/Modules/private.cpp
@@ -0,0 +1,13 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c -fmodules-cache-path=%t -fmodules -I %S/Inputs/private %s -verify
+
+#include "common.h"
+@import libPrivate1;
+#include "private1.h" // expected-error {{use of private header from outside its module}}
+#include "public2.h"
+#include "private2.h" // expected-error {{use of private header from outside its module}}
+
+struct use_this1 client_variable1;
+struct use_this2 client_variable2;
+struct mitts_off1 client_variable3;
+struct mitts_off2 client_variable4;
diff --git a/test/Modules/private1.cpp b/test/Modules/private1.cpp
new file mode 100644
index 000000000000..811a2333d1db
--- /dev/null
+++ b/test/Modules/private1.cpp
@@ -0,0 +1,13 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c -fmodules-cache-path=%t -fmodules -I %S/Inputs/private0 -I %S/Inputs/private1 -I %S/Inputs/private2 %s -verify
+
+#include "common.h"
+@import libPrivateN2;
+#include "private1.h" // expected-error {{use of private header from outside its module}}
+#include "public2.h"
+#include "private2.h" // expected-error {{use of private header from outside its module}}
+
+struct use_this1 client_variable1;
+struct use_this2 client_variable2;
+struct mitts_off1 client_variable3;
+struct mitts_off2 client_variable4;
diff --git a/test/Modules/recursive_visibility.mm b/test/Modules/recursive_visibility.mm
new file mode 100644
index 000000000000..f37410aa44e1
--- /dev/null
+++ b/test/Modules/recursive_visibility.mm
@@ -0,0 +1,9 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11
+
+// expected-no-diagnostics
+
+@import recursive_visibility_c;
+
+template<typename T> struct Z { typedef T type; };
+template void g<Z>();
diff --git a/test/Modules/requires.m b/test/Modules/requires.m
index 83b524d3935b..b8b2c55698c4 100644
--- a/test/Modules/requires.m
+++ b/test/Modules/requires.m
@@ -2,4 +2,5 @@
// RUN: %clang_cc1 -Wauto-import -fmodules-cache-path=%t -fmodules -F %S/Inputs %s -verify
@import DependsOnModule.CXX; // expected-error{{module 'DependsOnModule.CXX' requires feature 'cplusplus'}}
-
+@import DependsOnModule.NotCXX;
+@import DependsOnModule.NotObjC; // expected-error{{module 'DependsOnModule.NotObjC' is incompatible with feature 'objc'}}
diff --git a/test/Modules/requires.mm b/test/Modules/requires.mm
new file mode 100644
index 000000000000..736f2fab646a
--- /dev/null
+++ b/test/Modules/requires.mm
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -Wauto-import -fmodules-cache-path=%t -fmodules -F %S/Inputs %s -verify
+
+@import DependsOnModule.CXX;
+@import DependsOnModule.NotCXX; // expected-error{{module 'DependsOnModule.NotCXX' is incompatible with feature 'cplusplus'}}
+@import DependsOnModule.NotObjC; // expected-error{{module 'DependsOnModule.NotObjC' is incompatible with feature 'objc'}}
diff --git a/test/Modules/self-import-header/af.framework/Headers/a1.h b/test/Modules/self-import-header/af.framework/Headers/a1.h
new file mode 100644
index 000000000000..31ae279bde2d
--- /dev/null
+++ b/test/Modules/self-import-header/af.framework/Headers/a1.h
@@ -0,0 +1,4 @@
+@import DepBuiltin;
+
+@interface Foo
+@end
diff --git a/test/Modules/self-import-header/af.framework/Headers/a2.h b/test/Modules/self-import-header/af.framework/Headers/a2.h
new file mode 100644
index 000000000000..cc7e6e20b667
--- /dev/null
+++ b/test/Modules/self-import-header/af.framework/Headers/a2.h
@@ -0,0 +1 @@
+#import "a1.h"
diff --git a/test/Modules/self-import-header/af.framework/module.map b/test/Modules/self-import-header/af.framework/module.map
new file mode 100644
index 000000000000..87176831df2d
--- /dev/null
+++ b/test/Modules/self-import-header/af.framework/module.map
@@ -0,0 +1,4 @@
+framework module af {
+ header "a1.h"
+ header "a2.h"
+}
diff --git a/test/Modules/self-import-header/depend_builtin/h1.h b/test/Modules/self-import-header/depend_builtin/h1.h
new file mode 100644
index 000000000000..13298efce877
--- /dev/null
+++ b/test/Modules/self-import-header/depend_builtin/h1.h
@@ -0,0 +1 @@
+#include <float.h>
diff --git a/test/Modules/self-import-header/depend_builtin/module.map b/test/Modules/self-import-header/depend_builtin/module.map
new file mode 100644
index 000000000000..a736ad85c136
--- /dev/null
+++ b/test/Modules/self-import-header/depend_builtin/module.map
@@ -0,0 +1,5 @@
+module DepBuiltin {
+header "h1.h"
+ export *
+}
+
diff --git a/test/Modules/self-import-header/test.m b/test/Modules/self-import-header/test.m
new file mode 100644
index 000000000000..377c01d66eb3
--- /dev/null
+++ b/test/Modules/self-import-header/test.m
@@ -0,0 +1,8 @@
+// rdar://13840148
+
+// RUN: rm -rf %t
+// RUN: %clang -fsyntax-only -isysroot %S/../Inputs/System/usr/include -fmodules -fmodules-cache-path=%t \
+// RUN: -target x86_64-darwin \
+// RUN: -F %S -I %S %s -D__need_wint_t -Werror=implicit-function-declaration
+
+@import af;
diff --git a/test/Modules/separate_map_tree.cpp b/test/Modules/separate_map_tree.cpp
new file mode 100644
index 000000000000..5a1fff4efc70
--- /dev/null
+++ b/test/Modules/separate_map_tree.cpp
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fmodules-decluse -fmodule-name=A -fmodule-map-file=%S/Inputs/separate_map_tree/maps/modulea.map -I %S/Inputs/separate_map_tree/src %s -verify
+
+#include "common.h"
+#include "public-in-b.h" // expected-error {{private header}}
+#include "public-in-c.h"
+#include "private-in-c.h" // expected-error {{private header}}
+const int val = common + b + c + c_; // expected-error {{undeclared identifier}}
diff --git a/test/Modules/subframeworks.m b/test/Modules/subframeworks.m
index ad70cc2b22f8..5d70bc0840d5 100644
--- a/test/Modules/subframeworks.m
+++ b/test/Modules/subframeworks.m
@@ -5,7 +5,8 @@
@import DependsOnModule;
void testSubFramework() {
- float *sf1 = sub_framework; // expected-error{{use of undeclared identifier 'sub_framework'}}
+ float *sf1 = sub_framework; // expected-error{{declaration of 'sub_framework' must be imported from module 'DependsOnModule.SubFramework' before it is required}}
+ // expected-note@Inputs/DependsOnModule.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h:2 {{previous}}
}
@import DependsOnModule.SubFramework;
diff --git a/test/Modules/submodules.cpp b/test/Modules/submodules.cpp
index 1b4f5d886e3b..9c62389eadc0 100644
--- a/test/Modules/submodules.cpp
+++ b/test/Modules/submodules.cpp
@@ -7,8 +7,9 @@
vector<int> vi;
// Note: remove_reference is not visible yet.
-remove_reference<int&>::type *int_ptr = 0; // expected-error{{unknown type name 'remove_reference'}} \
-// expected-error{{expected unqualified-id}}
+remove_reference<int&>::type *int_ptr = 0; // expected-error{{declaration of 'remove_reference' must be imported from module 'std.type_traits' before it is required}}
+// expected-note@Inputs/submodules/type_traits.h:2{{previous}}
+// expected-note@Inputs/submodules/hash_map.h:1{{previous}}
@import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
@@ -20,10 +21,16 @@ remove_reference<int&>::type *int_ptr2 = 0;
@import std; // import everything in 'std'
// hash_map still isn't available.
-hash_map<int, float> ints_to_floats; // expected-error{{unknown type name 'hash_map'}} \
-// expected-error{{expected unqualified-id}}
+hash_map<int, float> ints_to_floats; // expected-error{{declaration of 'hash_map' must be imported from module 'std.hash_map' before it is required}}
@import std.hash_map;
hash_map<int, float> ints_to_floats2;
+@import import_self.b;
+extern MyTypeA import_self_test_a; // expected-error {{must be imported from module 'import_self.a'}}
+// expected-note@import-self-a.h:1 {{here}}
+extern MyTypeC import_self_test_c;
+// FIXME: This should be valid; import_self.b re-exports import_self.d.
+extern MyTypeD import_self_test_d; // expected-error {{must be imported from module 'import_self.d'}}
+// expected-note@import-self-d.h:1 {{here}}
diff --git a/test/Modules/system_headers.m b/test/Modules/system_headers.m
new file mode 100644
index 000000000000..39b13ca5fc4a
--- /dev/null
+++ b/test/Modules/system_headers.m
@@ -0,0 +1,8 @@
+// Test that system-headerness works for building modules.
+
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/cache -isystem %S/Inputs -pedantic -Werror %s -verify
+// expected-no-diagnostics
+
+@import warning;
+int i = bigger_than_int;
diff --git a/test/Modules/templates.mm b/test/Modules/templates.mm
index 1fef967e400f..080f9e7c665e 100644
--- a/test/Modules/templates.mm
+++ b/test/Modules/templates.mm
@@ -1,11 +1,15 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs -verify %s -Wno-objc-root-class
-// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs -emit-llvm %s -o - -Wno-objc-root-class | grep Emit | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs -verify %s -Wno-objc-root-class
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs -emit-llvm %s -o - -Wno-objc-root-class | FileCheck %s
// expected-no-diagnostics
@import templates_left;
@import templates_right;
+// CHECK: @list_left = global { %{{.*}}*, i32, [4 x i8] } { %{{.*}}* null, i32 8,
+// CHECK: @list_right = global { %{{.*}}*, i32, [4 x i8] } { %{{.*}}* null, i32 12,
+// CHECK: @_ZZ15testMixedStructvE1l = {{.*}} constant { %{{.*}}*, i32, [4 x i8] } { %{{.*}}* null, i32 1,
+// CHECK: @_ZZ15testMixedStructvE1r = {{.*}} constant { %{{.*}}*, i32, [4 x i8] } { %{{.*}}* null, i32 2,
void testTemplateClasses() {
Vector<int> vec_int;
@@ -32,5 +36,34 @@ void testRedeclDefinition() {
redeclDefinitionEmit();
}
+// These three are all the same type.
+typedef OuterIntInner_left OuterIntInner;
+typedef OuterIntInner_right OuterIntInner;
+typedef Outer<int>::Inner OuterIntInner;
+
// CHECK: call {{.*pendingInstantiation}}
// CHECK: call {{.*redeclDefinitionEmit}}
+
+static_assert(size_left == size_right, "same field both ways");
+void useListInt(List<int> &);
+
+// CHECK-LABEL: define i32 @_Z15testMixedStructv(
+unsigned testMixedStruct() {
+ // CHECK: %[[l:.*]] = alloca %[[ListInt:[^ ]*]], align 8
+ // CHECK: %[[r:.*]] = alloca %[[ListInt]], align 8
+
+ // CHECK: call {{.*}}memcpy{{.*}}(i8* %{{.*}}, i8* bitcast ({{.*}}* @_ZZ15testMixedStructvE1l to i8*), i64 16,
+ ListInt_left l{0, 1};
+
+ // CHECK: call {{.*}}memcpy{{.*}}(i8* %{{.*}}, i8* bitcast ({{.*}}* @_ZZ15testMixedStructvE1r to i8*), i64 16,
+ ListInt_right r{0, 2};
+
+ // CHECK: call void @_Z10useListIntR4ListIiE(%[[ListInt]]* %[[l]])
+ useListInt(l);
+ // CHECK: call void @_Z10useListIntR4ListIiE(%[[ListInt]]* %[[r]])
+ useListInt(r);
+
+ // CHECK: load i32* bitcast (i8* getelementptr inbounds (i8* bitcast ({{.*}}* @list_left to i8*), i64 8) to i32*)
+ // CHECK: load i32* bitcast (i8* getelementptr inbounds (i8* bitcast ({{.*}}* @list_right to i8*), i64 8) to i32*)
+ return list_left.*size_right + list_right.*size_left;
+}
diff --git a/test/Modules/using-decl.cpp b/test/Modules/using-decl.cpp
new file mode 100644
index 000000000000..4432738f060a
--- /dev/null
+++ b/test/Modules/using-decl.cpp
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify
+
+@import using_decl.a;
+
+// expected-no-diagnostics
+UsingDecl::using_decl_type x = UsingDecl::using_decl_var;
+UsingDecl::inner y = x;
diff --git a/test/OpenMP/openmp_common.c b/test/OpenMP/openmp_common.c
index ca5d89a6629b..3765f4c5dc14 100644
--- a/test/OpenMP/openmp_common.c
+++ b/test/OpenMP/openmp_common.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
#pragma omp // expected-error {{expected an OpenMP directive}}
#pragma omp unknown_directive // expected-error {{expected an OpenMP directive}}
diff --git a/test/OpenMP/parallel_ast_print.cpp b/test/OpenMP/parallel_ast_print.cpp
new file mode 100644
index 000000000000..f2fd2f7b69f9
--- /dev/null
+++ b/test/OpenMP/parallel_ast_print.cpp
@@ -0,0 +1,60 @@
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+void foo() {}
+
+
+template <typename T>
+T tmain(T argc, T *argv) {
+ T b = argc, c, d, e, f, g;
+ static T a;
+#pragma omp parallel
+ a=2;
+#pragma omp parallel default(none), private(argc,b) firstprivate(argv) shared (d)
+ foo();
+ return 0;
+}
+// CHECK: template <typename T = int> int tmain(int argc, int *argv) {
+// CHECK-NEXT: int b = argc, c, d, e, f, g;
+// CHECK-NEXT: static int a;
+// CHECK-NEXT: #pragma omp parallel
+// CHECK-NEXT: a = 2;
+// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d)
+// CHECK-NEXT: foo()
+// CHECK: template <typename T = float> float tmain(float argc, float *argv) {
+// CHECK-NEXT: float b = argc, c, d, e, f, g;
+// CHECK-NEXT: static float a;
+// CHECK-NEXT: #pragma omp parallel
+// CHECK-NEXT: a = 2;
+// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d)
+// CHECK-NEXT: foo()
+// CHECK: template <typename T> T tmain(T argc, T *argv) {
+// CHECK-NEXT: T b = argc, c, d, e, f, g;
+// CHECK-NEXT: static T a;
+// CHECK-NEXT: #pragma omp parallel
+// CHECK-NEXT: a = 2;
+// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d)
+// CHECK-NEXT: foo()
+
+int main (int argc, char **argv) {
+ float x;
+ int b = argc, c, d, e, f, g;
+ static int a;
+// CHECK: static int a;
+#pragma omp parallel
+// CHECK-NEXT: #pragma omp parallel
+ a=2;
+// CHECK-NEXT: a = 2;
+#pragma omp parallel default(none), private(argc,b) firstprivate(argv)
+// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv)
+ foo();
+// CHECK-NEXT: foo();
+ return tmain(b, &b) + tmain(x, &x);
+}
+
+#endif
diff --git a/test/OpenMP/parallel_default_messages.cpp b/test/OpenMP/parallel_default_messages.cpp
new file mode 100644
index 000000000000..cbc6a73fe35d
--- /dev/null
+++ b/test/OpenMP/parallel_default_messages.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+
+void foo();
+
+int main(int argc, char **argv) {
+ #pragma omp parallel default // expected-error {{expected '(' after 'default'}}
+ #pragma omp parallel default ( // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel default () // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
+ #pragma omp parallel default (none // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel default (shared), default(shared) // expected-error {{directive '#pragma omp parallel' cannot contain more than one 'default' clause}}
+ #pragma omp parallel default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
+ foo();
+
+ #pragma omp parallel default(none)
+ ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
+
+ #pragma omp parallel default(none)
+ #pragma omp parallel default(shared)
+ ++argc;
+ return 0;
+}
diff --git a/test/OpenMP/parallel_firstprivate_messages.cpp b/test/OpenMP/parallel_firstprivate_messages.cpp
new file mode 100644
index 000000000000..780059e282bf
--- /dev/null
+++ b/test/OpenMP/parallel_firstprivate_messages.cpp
@@ -0,0 +1,82 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+public:
+ S2():a(0) { }
+ S2(S2 &s2):a(s2.a) { }
+ static float S2s;
+ static const float S2sc;
+};
+const float S2::S2sc = 0;
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+public:
+ S3():a(0) { }
+ S3(S3 &s3):a(s3.a) { }
+};
+const S3 c;
+const S3 ca[5];
+extern const int f;
+class S4 { // expected-note {{'S4' declared here}}
+ int a;
+ S4();
+ S4(const S4 &s4);
+public:
+ S4(int v):a(v) { }
+};
+class S5 { // expected-note {{'S5' declared here}}
+ int a;
+ S5():a(0) {}
+ S5(const S5 &s5):a(s5.a) { }
+public:
+ S5(int v):a(v) { }
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
+
+int main(int argc, char **argv) {
+ const int d = 5;
+ const int da[5] = { 0 };
+ S4 e(4); // expected-note {{'e' defined here}}
+ S5 g(5); // expected-note {{'g' defined here}}
+ int i;
+ int &j = i; // expected-note {{'j' defined here}}
+ #pragma omp parallel firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ #pragma omp parallel firstprivate ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel firstprivate () // expected-error {{expected expression}}
+ #pragma omp parallel firstprivate (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel firstprivate (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ #pragma omp parallel firstprivate (argc)
+ #pragma omp parallel firstprivate (S1) // expected-error {{'S1' does not refer to a value}}
+ #pragma omp parallel firstprivate (a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+ #pragma omp parallel firstprivate (argv[1]) // expected-error {{expected variable name}}
+ #pragma omp parallel firstprivate(ba)
+ #pragma omp parallel firstprivate(ca)
+ #pragma omp parallel firstprivate(da)
+ #pragma omp parallel firstprivate(S2::S2s)
+ #pragma omp parallel firstprivate(S2::S2sc)
+ #pragma omp parallel firstprivate(e, g) // expected-error 2 {{firstprivate variable must have an accessible, unambiguous copy constructor}}
+ #pragma omp parallel firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ #pragma omp parallel private(i), firstprivate(i) // expected-error {{private variable cannot be firstprivate}} expected-note{{defined as private}}
+ foo();
+ #pragma omp parallel shared(i)
+ #pragma omp parallel firstprivate(i)
+ #pragma omp parallel firstprivate(j) // expected-error {{arguments of OpenMP clause 'firstprivate' cannot be of reference type}}
+ foo();
+
+ return 0;
+}
diff --git a/test/OpenMP/parallel_messages.cpp b/test/OpenMP/parallel_messages.cpp
new file mode 100644
index 000000000000..d991ccfc3806
--- /dev/null
+++ b/test/OpenMP/parallel_messages.cpp
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
+
+void foo() {
+}
+
+#pragma omp parallel // expected-error {{unexpected OpenMP directive '#pragma omp parallel'}}
+
+int main(int argc, char **argv) {
+ #pragma omp parallel
+ #pragma omp parallel unknown() // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
+ foo();
+ L1:
+ foo();
+ #pragma omp parallel
+ ;
+ #pragma omp parallel
+ {
+ goto L1; // expected-error {{use of undeclared label 'L1'}}
+ argc++;
+ }
+
+ for (int i = 0; i < 10; ++i) {
+ switch(argc) {
+ case (0):
+ #pragma omp parallel
+ {
+ foo();
+ break; // expected-error {{'break' statement not in loop or switch statement}}
+ continue; // expected-error {{'continue' statement not in loop statement}}
+ }
+ default:
+ break;
+ }
+ }
+ #pragma omp parallel default(none)
+ ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
+
+ goto L2; // expected-error {{use of undeclared label 'L2'}}
+ #pragma omp parallel
+ L2:
+ foo();
+ #pragma omp parallel
+ {
+ return 1; // expected-error {{cannot return from OpenMP region}}
+ }
+
+ [[]] // expected-error {{an attribute list cannot appear here}}
+ #pragma omp parallel
+ for (int n = 0; n < 100; ++n) {}
+
+ return 0;
+}
+
diff --git a/test/OpenMP/parallel_private_messages.cpp b/test/OpenMP/parallel_private_messages.cpp
new file mode 100644
index 000000000000..2037d56daf0c
--- /dev/null
+++ b/test/OpenMP/parallel_private_messages.cpp
@@ -0,0 +1,81 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+public:
+ S2():a(0) { }
+ static float S2s; // expected-note {{predetermined as shared}}
+};
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+public:
+ S3():a(0) { }
+};
+const S3 c; // expected-note {{predetermined as shared}}
+const S3 ca[5]; // expected-note {{predetermined as shared}}
+extern const int f; // expected-note {{predetermined as shared}}
+class S4 { // expected-note {{'S4' declared here}}
+ int a;
+ S4();
+public:
+ S4(int v):a(v) { }
+};
+class S5 { // expected-note {{'S5' declared here}}
+ int a;
+ S5():a(0) {}
+public:
+ S5(int v):a(v) { }
+};
+
+int threadvar;
+#pragma omp threadprivate(threadvar) // expected-note {{defined as threadprivate or thread local}}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note {{predetermined as shared}}
+ const int da[5] = { 0 }; // expected-note {{predetermined as shared}}
+ S4 e(4); // expected-note {{'e' defined here}}
+ S5 g(5); // expected-note {{'g' defined here}}
+ int i;
+ int &j = i; // expected-note {{'j' defined here}}
+ #pragma omp parallel private // expected-error {{expected '(' after 'private'}}
+ #pragma omp parallel private ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel private () // expected-error {{expected expression}}
+ #pragma omp parallel private (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel private (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ #pragma omp parallel private (argc argv) // expected-error {{expected ',' or ')' in 'private' clause}}
+ #pragma omp parallel private (S1) // expected-error {{'S1' does not refer to a value}}
+ #pragma omp parallel private (a, b, c, d, f) // expected-error {{a private variable with incomplete type 'S1'}} expected-error 3 {{shared variable cannot be private}}
+ #pragma omp parallel private (argv[1]) // expected-error {{expected variable name}}
+ #pragma omp parallel private(ba)
+ #pragma omp parallel private(ca) // expected-error {{shared variable cannot be private}}
+ #pragma omp parallel private(da) // expected-error {{shared variable cannot be private}}
+ #pragma omp parallel private(S2::S2s) // expected-error {{shared variable cannot be private}}
+ #pragma omp parallel private(e, g) // expected-error 2 {{private variable must have an accessible, unambiguous default constructor}}
+ #pragma omp parallel private(threadvar) // expected-error {{threadprivate or thread local variable cannot be private}}
+ #pragma omp parallel shared(i), private(i) // expected-error {{shared variable cannot be private}} expected-note {{defined as shared}}
+ foo();
+ #pragma omp parallel firstprivate(i) private(i) // expected-error {{firstprivate variable cannot be private}} expected-note {{defined as firstprivate}}
+ foo();
+ #pragma omp parallel private(i)
+ #pragma omp parallel private(j) // expected-error {{arguments of OpenMP clause 'private' cannot be of reference type 'int &'}}
+ foo();
+ #pragma omp parallel firstprivate(i)
+ for (int k = 0; k < 10; ++k) {
+ #pragma omp parallel private(i)
+ foo();
+ }
+
+ return 0;
+}
diff --git a/test/OpenMP/parallel_shared_messages.cpp b/test/OpenMP/parallel_shared_messages.cpp
new file mode 100644
index 000000000000..211d392fe04e
--- /dev/null
+++ b/test/OpenMP/parallel_shared_messages.cpp
@@ -0,0 +1,83 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+extern S1 a;
+class S2 {
+ mutable int a;
+public:
+ S2():a(0) { }
+ S2(S2 &s2):a(s2.a) { }
+};
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+public:
+ S3():a(0) { }
+ S3(S3 &s3):a(s3.a) { }
+};
+const S3 c;
+const S3 ca[5];
+extern const int f;
+class S4 {
+ int a;
+ S4();
+ S4(const S4 &s4);
+public:
+ S4(int v):a(v) { }
+};
+class S5 {
+ int a;
+ S5():a(0) {}
+ S5(const S5 &s5):a(s5.a) { }
+public:
+ S5(int v):a(v) { }
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
+
+int main(int argc, char **argv) {
+ const int d = 5;
+ const int da[5] = { 0 };
+ S4 e(4);
+ S5 g(5);
+ int i;
+ int &j = i;
+ #pragma omp parallel shared // expected-error {{expected '(' after 'shared'}}
+ #pragma omp parallel shared ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel shared () // expected-error {{expected expression}}
+ #pragma omp parallel shared (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel shared (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ #pragma omp parallel shared (argc)
+ #pragma omp parallel shared (S1) // expected-error {{'S1' does not refer to a value}}
+ #pragma omp parallel shared (a, b, c, d, f)
+ #pragma omp parallel shared (argv[1]) // expected-error {{expected variable name}}
+ #pragma omp parallel shared(ba)
+ #pragma omp parallel shared(ca)
+ #pragma omp parallel shared(da)
+ #pragma omp parallel shared(e, g)
+ #pragma omp parallel shared(h) // expected-error {{threadprivate or thread local variable cannot be shared}}
+ #pragma omp parallel private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}}
+ foo();
+ #pragma omp parallel firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}}
+ foo();
+ #pragma omp parallel private(i)
+ #pragma omp parallel shared(i)
+ #pragma omp parallel shared(j)
+ foo();
+ #pragma omp parallel firstprivate(i)
+ #pragma omp parallel shared(i)
+ #pragma omp parallel shared(j)
+ foo();
+
+ return 0;
+}
diff --git a/test/OpenMP/predefined_macro.c b/test/OpenMP/predefined_macro.c
index cf6c0cc61188..3a8118620962 100644
--- a/test/OpenMP/predefined_macro.c
+++ b/test/OpenMP/predefined_macro.c
@@ -31,4 +31,3 @@
#error "_OPENMP macro is defined without -fopenmp option"
#endif // _OPENMP
#endif // FOPENMP
-
diff --git a/test/OpenMP/threadprivate_ast_print.cpp b/test/OpenMP/threadprivate_ast_print.cpp
index deb829e92673..72bf6f4077eb 100644
--- a/test/OpenMP/threadprivate_ast_print.cpp
+++ b/test/OpenMP/threadprivate_ast_print.cpp
@@ -1,5 +1,12 @@
// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print
// expected-no-diagnostics
+// FIXME: This test has been crashing since r186647.
+// REQUIRES: disabled
+
+#ifndef HEADER
+#define HEADER
struct St{
int a;
@@ -10,7 +17,7 @@ struct St1{
static int b;
// CHECK: static int b;
#pragma omp threadprivate(b)
-// CHECK-NEXT: #pragma omp threadprivate(b)
+// CHECK-NEXT: #pragma omp threadprivate(St1::b)
} d;
int a, b;
@@ -33,6 +40,15 @@ template <class T> T foo() {
//CHECK-NEXT: static T v;
//CHECK-NEXT: #pragma omp threadprivate(v)
+namespace ns{
+ int a;
+}
+// CHECK: namespace ns {
+// CHECK-NEXT: int a;
+// CHECK-NEXT: }
+#pragma omp threadprivate(ns::a)
+// CHECK-NEXT: #pragma omp threadprivate(ns::a)
+
int main () {
static int a;
// CHECK: static int a;
@@ -41,3 +57,5 @@ int main () {
a=2;
return (foo<int>());
}
+
+#endif
diff --git a/test/OpenMP/threadprivate_messages.cpp b/test/OpenMP/threadprivate_messages.cpp
index 0c448b2ef27e..4858549a7038 100644
--- a/test/OpenMP/threadprivate_messages.cpp
+++ b/test/OpenMP/threadprivate_messages.cpp
@@ -1,8 +1,8 @@
// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 %s
#pragma omp threadprivate // expected-error {{expected '(' after 'threadprivate'}}
-#pragma omp threadprivate( // expected-error {{expected unqualified-id}}
-#pragma omp threadprivate() // expected-error {{expected unqualified-id}}
+#pragma omp threadprivate( // expected-error {{expected identifier}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp threadprivate() // expected-error {{expected identifier}}
#pragma omp threadprivate(1) // expected-error {{expected unqualified-id}}
struct CompleteSt{
int a;
@@ -11,29 +11,29 @@ struct CompleteSt{
struct CompleteSt1{
#pragma omp threadprivate(1) // expected-error {{expected unqualified-id}}
int a;
-} d; // expected-note {{forward declaration of 'd'}}
+} d; // expected-note {{'d' defined here}}
-int a; // expected-note {{forward declaration of 'a'}}
+int a; // expected-note {{'a' defined here}}
#pragma omp threadprivate(a)
#pragma omp threadprivate(u) // expected-error {{use of undeclared identifier 'u'}}
#pragma omp threadprivate(d, a) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'a'}}
int foo() { // expected-note {{declared here}}
static int l;
-#pragma omp threadprivate(l)) // expected-warning {{extra tokens at end of '#pragma omp threadprivate' are ignored}}
+#pragma omp threadprivate(l)) // expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
return (a);
}
#pragma omp threadprivate a // expected-error {{expected '(' after 'threadprivate'}}
#pragma omp threadprivate(d // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{'#pragma omp threadprivate' must precede all references to variable 'd'}}
-#pragma omp threadprivate(d))
+#pragma omp threadprivate(d)) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'd'}} expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
int x, y;
-#pragma omp threadprivate(x)) // expected-warning {{extra tokens at end of '#pragma omp threadprivate' are ignored}}
-#pragma omp threadprivate(y)), // expected-warning {{extra tokens at end of '#pragma omp threadprivate' are ignored}}
+#pragma omp threadprivate(x)) // expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
+#pragma omp threadprivate(y)), // expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
#pragma omp threadprivate(a,d) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'a'}} expected-error {{'#pragma omp threadprivate' must precede all references to variable 'd'}}
-#pragma omp threadprivate(d.a) // expected-error {{expected unqualified-id}}
+#pragma omp threadprivate(d.a) // expected-error {{expected identifier}}
#pragma omp threadprivate((float)a) // expected-error {{expected unqualified-id}}
-int foa;
+int foa; // expected-note {{'foa' declared here}}
#pragma omp threadprivate(faa) // expected-error {{use of undeclared identifier 'faa'; did you mean 'foa'?}}
#pragma omp threadprivate(foo) // expected-error {{'foo' is not a global variable, static local variable or static data member}}
#pragma omp threadprivate (int a=2) // expected-error {{expected unqualified-id}}
@@ -41,22 +41,22 @@ int foa;
struct IncompleteSt; // expected-note {{forward declaration of 'IncompleteSt'}}
extern IncompleteSt e;
-#pragma omp threadprivate (e) // expected-error {{a threadprivate variable must not have incomplete type 'IncompleteSt'}}
+#pragma omp threadprivate (e) // expected-error {{threadprivate variable with incomplete type 'IncompleteSt'}}
-int &f = a; // expected-note {{forward declaration of 'f'}}
+int &f = a; // expected-note {{'f' defined here}}
#pragma omp threadprivate (f) // expected-error {{arguments of '#pragma omp threadprivate' cannot be of reference type 'int &'}}
class Class {
private:
int a; // expected-note {{declared here}}
- static int b;
+ static int b; // expected-note {{'b' declared here}}
Class() : a(0){}
public:
Class (int aaa) : a(aaa) {}
#pragma omp threadprivate (b, a) // expected-error {{'a' is not a global variable, static local variable or static data member}}
} g(10);
#pragma omp threadprivate (b) // expected-error {{use of undeclared identifier 'b'}}
-#pragma omp threadprivate (Class::b) // expected-error {{expected unqualified-id}}
+#pragma omp threadprivate (Class::b) // expected-error {{'#pragma omp threadprivate' must appear in the scope of the 'Class::b' variable declaration}}
#pragma omp threadprivate (g)
namespace ns {
@@ -64,8 +64,8 @@ namespace ns {
#pragma omp threadprivate (m)
}
#pragma omp threadprivate (m) // expected-error {{use of undeclared identifier 'm'}}
-#pragma omp threadprivate (ns::m) // expected-error {{expected unqualified-id}}
-#pragma omp threadprivate (ns:m) // expected-error {{expected unqualified-id}}
+#pragma omp threadprivate (ns::m) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'ns::m'}}
+#pragma omp threadprivate (ns:m) // expected-error {{unexpected ':' in nested name specifier; did you mean '::'?}} expected-error {{'#pragma omp threadprivate' must precede all references to variable 'ns::m'}}
const int h = 12;
const volatile int i = 10;
@@ -84,26 +84,30 @@ class TempClass {
};
#pragma omp threadprivate (s) // expected-error {{use of undeclared identifier 's'}}
-static __thread int t; // expected-note {{forward declaration of 't'}}
+static __thread int t; // expected-note {{'t' defined here}}
#pragma omp threadprivate (t) // expected-error {{variable 't' cannot be threadprivate because it is thread-local}}
int o; // expected-note {{candidate found by name lookup is 'o'}}
+#pragma omp threadprivate (o)
namespace {
int o; // expected-note {{candidate found by name lookup is '<anonymous namespace>::o'}}
+#pragma omp threadprivate (o)
+#pragma omp threadprivate (o) // expected-error {{'#pragma omp threadprivate' must precede all references to variable '<anonymous namespace>::o'}}
}
#pragma omp threadprivate (o) // expected-error {{reference to 'o' is ambiguous}}
+#pragma omp threadprivate (::o) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'o'}}
-int main(int argc, char **argv) { // expected-note {{forward declaration of 'argc'}}
+int main(int argc, char **argv) { // expected-note {{'argc' defined here}}
- int x, y = argc; // expected-note {{forward declaration of 'y'}}
+ int x, y = argc; // expected-note {{'y' defined here}}
static double d1;
static double d2;
- static double d3; // expected-note {{forward declaration of 'd3'}}
+ static double d3; // expected-note {{'d3' defined here}}
d.a = a;
d2++;
;
-#pragma omp threadprivate(argc+y) // expected-error {{expected unqualified-id}}
+#pragma omp threadprivate(argc+y) // expected-error {{expected identifier}}
#pragma omp threadprivate(argc,y) // expected-error 2 {{arguments of '#pragma omp threadprivate' must have static storage duration}}
#pragma omp threadprivate(d2) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'd2'}}
#pragma omp threadprivate(d1)
diff --git a/test/PCH/Inputs/chain-selectors2.h b/test/PCH/Inputs/chain-selectors2.h
index 973fc107e90e..d54244de617b 100644
--- a/test/PCH/Inputs/chain-selectors2.h
+++ b/test/PCH/Inputs/chain-selectors2.h
@@ -1,6 +1,6 @@
@interface Y
-(void)f;
- -(double)f2;
+ -(void)f2;
-(void)e;
@end
diff --git a/test/PCH/arc.m b/test/PCH/arc.m
index 64b390c30715..466b31705596 100644
--- a/test/PCH/arc.m
+++ b/test/PCH/arc.m
@@ -6,9 +6,9 @@
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include-pch %t -fsyntax-only -emit-llvm-only %s
// Test error when pch's -fobjc-arc state is different.
-// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -include-pch %t -fsyntax-only -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=ERR1 %s
+// RUN: not %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -include-pch %t -fsyntax-only -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=CHECK-ERR1 %s
// RUN: %clang_cc1 -emit-pch -fblocks -triple x86_64-apple-darwin11 -x objective-c-header -o %t %S/Inputs/arc.h
-// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include-pch %t -fsyntax-only -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=ERR2 %s
+// RUN: not %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include-pch %t -fsyntax-only -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=CHECK-ERR2 %s
array0 a0;
array1 a1;
diff --git a/test/PCH/badpch.c b/test/PCH/badpch.c
index f34e3d6a158b..c302329aaae8 100644
--- a/test/PCH/badpch.c
+++ b/test/PCH/badpch.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -include-pch %S/Inputs/badpch-empty.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-EMPTY %s
-// RUN: %clang_cc1 -fsyntax-only -include-pch %S/Inputs/badpch-dir.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-DIR %s
+// RUN: not %clang_cc1 -fsyntax-only -include-pch %S/Inputs/badpch-empty.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-EMPTY %s
+// RUN: not %clang_cc1 -fsyntax-only -include-pch %S/Inputs/badpch-dir.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-DIR %s
// The purpose of this test is to verify that various invalid PCH files are
// reported as such.
diff --git a/test/PCH/chain-categories2.m b/test/PCH/chain-categories2.m
index f230bf934858..50eea2a5606f 100644
--- a/test/PCH/chain-categories2.m
+++ b/test/PCH/chain-categories2.m
@@ -45,6 +45,7 @@
#else
//===----------------------------------------------------------------------===//
+// expected-note@30 {{receiver is instance of class declared here}}
void f(I* i) {
[i meth]; // expected-warning {{not found}}
}
diff --git a/test/PCH/chain-cxx.cpp b/test/PCH/chain-cxx.cpp
index 4b64f51143df..6e9c1743fbd7 100644
--- a/test/PCH/chain-cxx.cpp
+++ b/test/PCH/chain-cxx.cpp
@@ -6,6 +6,9 @@
// With PCH
// RUN: %clang_cc1 -fsyntax-only -verify %s -chain-include %s -chain-include %s
+// With modules
+// RUN: %clang_cc1 -fsyntax-only -verify -fmodules %s -chain-include %s -chain-include %s
+
// expected-no-diagnostics
#ifndef HEADER1
diff --git a/test/PCH/chain-friend-instantiation.cpp b/test/PCH/chain-friend-instantiation.cpp
index 294d97911236..2f042a8341ec 100644
--- a/test/PCH/chain-friend-instantiation.cpp
+++ b/test/PCH/chain-friend-instantiation.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 %s -ast-print -o - -chain-include %s -chain-include %s
+// RUN: %clang_cc1 %s -ast-print -o - -fmodules -chain-include %s -chain-include %s
#if !defined(PASS1)
#define PASS1
diff --git a/test/PCH/chain-selectors.m b/test/PCH/chain-selectors.m
index 7eae094e1513..f2bfc4b9d3df 100644
--- a/test/PCH/chain-selectors.m
+++ b/test/PCH/chain-selectors.m
@@ -18,9 +18,9 @@ void bar() {
// FIXME: Can't verify notes in headers
//[a f2];
- (void)@selector(x); // expected-warning {{unimplemented selector}}
- (void)@selector(y); // expected-warning {{unimplemented selector}}
- (void)@selector(e); // expected-warning {{unimplemented selector}}
+ (void)@selector(x); // expected-warning {{creating selector for nonexistent method 'x'}}
+ (void)@selector(y); // expected-warning {{creating selector for nonexistent method 'y'}}
+ (void)@selector(e); // expected-warning {{creating selector for nonexistent method 'e'}}
}
@implementation X (Blah)
diff --git a/test/PCH/check-deserializations.cpp b/test/PCH/check-deserializations.cpp
index 9f73c95c541e..e4dafb7f54af 100644
--- a/test/PCH/check-deserializations.cpp
+++ b/test/PCH/check-deserializations.cpp
@@ -1,20 +1,34 @@
-// RUN: %clang_cc1 -emit-pch -o %t %s
-// RUN: %clang_cc1 -error-on-deserialized-decl S1_method -include-pch %t -emit-llvm-only %s
+// RUN: %clang_cc1 -emit-pch -o %t.1 %s
+// RUN: %clang_cc1 -error-on-deserialized-decl S1_keyfunc -error-on-deserialized-decl S3 -include-pch %t.1 -emit-pch -o %t.2 %s
+// RUN: %clang_cc1 -error-on-deserialized-decl S1_method -error-on-deserialized-decl S3 -include-pch %t.2 -emit-llvm-only %s
-#ifndef HEADER
-#define HEADER
+#ifndef HEADER1
+#define HEADER1
// Header.
struct S1 {
- void S1_method(); // This should not be deserialized.
+ void S1_method();
virtual void S1_keyfunc();
};
+struct S3 {};
+
+struct S2 {
+ operator S3();
+};
+
+#elif !defined(HEADER2)
+#define HEADER2
+
+// Chained PCH.
+S1 *s1;
+S2 *s2;
#else
-// Using the header.
-void test(S1*) {
+// Using the headers.
+
+void test(S1*, S2*) {
}
#endif
diff --git a/test/PCH/cxx-friends.cpp b/test/PCH/cxx-friends.cpp
index f7d45cea8df4..9c75f92f34d6 100644
--- a/test/PCH/cxx-friends.cpp
+++ b/test/PCH/cxx-friends.cpp
@@ -3,7 +3,11 @@
// Test with pch.
// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h
-// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize
+
+// Test with modules.
+// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h -fmodules
+// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize -fmodules
// expected-no-diagnostics
@@ -21,3 +25,5 @@ public:
}
};
int k = PR12585::future_base::setter<int>().f();
+
+Lazy::S *p;
diff --git a/test/PCH/cxx-friends.h b/test/PCH/cxx-friends.h
index 05dcc9606636..2d20a4d26978 100644
--- a/test/PCH/cxx-friends.h
+++ b/test/PCH/cxx-friends.h
@@ -16,3 +16,28 @@ namespace PR12585 {
int k;
};
}
+
+namespace Lazy {
+ struct S {
+ friend void doNotDeserialize();
+ };
+}
+
+// Reduced testcase from libc++'s <valarray>. Used to crash with modules
+// enabled.
+namespace std {
+
+template <class T> struct valarray;
+
+template <class T> struct valarray {
+ valarray();
+ template <class U> friend struct valarray;
+ template <class U> friend U *begin(valarray<U> &v);
+};
+
+struct gslice {
+ valarray<int> size;
+ gslice() {}
+};
+
+}
diff --git a/test/PCH/cxx-member-init.cpp b/test/PCH/cxx-member-init.cpp
index 20594d532e33..78fd74425b84 100644
--- a/test/PCH/cxx-member-init.cpp
+++ b/test/PCH/cxx-member-init.cpp
@@ -13,6 +13,15 @@ struct S {
S *that = this;
};
template<typename T> struct X { T t {0}; };
+
+struct v_t { };
+
+struct m_t
+{
+ struct { v_t v; };
+ m_t() { }
+};
+
#endif
#ifdef SOURCE
@@ -20,6 +29,11 @@ S s;
struct E { explicit E(int); };
X<E> x;
+
+m_t *test() {
+ return new m_t;
+}
+
#elif HEADER
#undef HEADER
#define SOURCE
diff --git a/test/PCH/cxx-namespaces.cpp b/test/PCH/cxx-namespaces.cpp
index e0ff27c020c4..e0feaab6910a 100644
--- a/test/PCH/cxx-namespaces.cpp
+++ b/test/PCH/cxx-namespaces.cpp
@@ -3,10 +3,23 @@
// Test with pch.
// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-namespaces.h
-// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// RUN: %clang_cc1 -include-pch %t -fsyntax-only -ast-dump -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s
+
+// Test with modules.
+// RUN: %clang_cc1 -fmodules -x c++-header -emit-pch -o %t %S/cxx-namespaces.h
+// RUN: %clang_cc1 -fmodules -include-pch %t -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fmodules -include-pch %t -fsyntax-only -ast-dump -ast-dump-lookups -ast-dump-filter N %s | FileCheck %s
// expected-no-diagnostics
void m() {
N::x = 0;
+ N::f();
}
+
+// namespace 'N' should contain only two declarations of 'f'.
+
+// CHECK: DeclarationName 'f'
+// CHECK-NEXT: |-Function {{.*}} 'f' 'void (
+// CHECK-NEXT: `-Function {{.*}} 'f' 'void (
diff --git a/test/PCH/cxx-namespaces.h b/test/PCH/cxx-namespaces.h
index f3389533d001..26d75a079d92 100644
--- a/test/PCH/cxx-namespaces.h
+++ b/test/PCH/cxx-namespaces.h
@@ -4,4 +4,7 @@ namespace N {
namespace {
int x;
}
+
+ void f();
+ void f(int);
}
diff --git a/test/PCH/cxx-templates.cpp b/test/PCH/cxx-templates.cpp
index 58c4c177fd21..e5ddd86e3802 100644
--- a/test/PCH/cxx-templates.cpp
+++ b/test/PCH/cxx-templates.cpp
@@ -1,13 +1,21 @@
// Test this without pch.
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include %S/cxx-templates.h -verify %s -ast-dump -o -
-// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include %S/cxx-templates.h %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include %S/cxx-templates.h %s -emit-llvm -o - -DNO_ERRORS | FileCheck %s
// Test with pch.
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -x c++-header -emit-pch -o %t %S/cxx-templates.h
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include-pch %t -verify %s -ast-dump -o -
-// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include-pch %t %s -emit-llvm -o - -error-on-deserialized-decl doNotDeserialize | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include-pch %t %s -emit-llvm -o - -error-on-deserialized-decl doNotDeserialize -DNO_ERRORS | FileCheck %s
-// expected-no-diagnostics
+// Test with modules.
+// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -fmodules -x c++-header -emit-pch -o %t %S/cxx-templates.h
+// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -fmodules -include-pch %t -verify %s -ast-dump -o -
+// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -fmodules -include-pch %t %s -emit-llvm -o - -error-on-deserialized-decl doNotDeserialize -DNO_ERRORS | FileCheck %s
+
+// Test with pch and delayed template parsing.
+// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fdelayed-template-parsing -fexceptions -x c++-header -emit-pch -o %t %S/cxx-templates.h
+// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fdelayed-template-parsing -fexceptions -include-pch %t -verify %s -ast-dump -o -
+// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fdelayed-template-parsing -fexceptions -include-pch %t %s -emit-llvm -o - -DNO_ERRORS | FileCheck %s
// CHECK: define weak_odr void @_ZN2S4IiE1mEv
// CHECK: define linkonce_odr void @_ZN2S3IiE1mEv
@@ -85,3 +93,18 @@ namespace rdar13135282 {
__mt_alloc<> mt = __mt_alloc<>();
}
}
+
+void CallDependentSpecializedFunc(DependentSpecializedFuncClass<int> &x) {
+ DependentSpecializedFunc(x);
+}
+
+namespace cyclic_module_load {
+ extern std::valarray<int> x;
+ std::valarray<int> y(x);
+}
+
+#ifndef NO_ERRORS
+// expected-error@cxx-templates.h:305 {{incomplete}}
+template int local_extern::f<int[]>(); // expected-note {{in instantiation of}}
+#endif
+template int local_extern::g<int[]>();
diff --git a/test/PCH/cxx-templates.h b/test/PCH/cxx-templates.h
index e672b0b38733..992f478e33e6 100644
--- a/test/PCH/cxx-templates.h
+++ b/test/PCH/cxx-templates.h
@@ -269,3 +269,45 @@ template<typename T> struct ContainsDoNotDeserialize2 {
};
template<typename T> int ContainsDoNotDeserialize<T>::doNotDeserialize = 0;
template<typename T> void ContainsDoNotDeserialize2<T>::doNotDeserialize() {}
+
+
+template<typename T> void DependentSpecializedFunc(T x) { x.foo(); }
+template<typename T> class DependentSpecializedFuncClass {
+ void foo() {}
+ friend void DependentSpecializedFunc<>(DependentSpecializedFuncClass);
+};
+
+namespace cyclic_module_load {
+ // Reduced from a libc++ modules crasher.
+ namespace std {
+ template<class> class mask_array;
+ template<class> class valarray {
+ public:
+ valarray(const valarray &v);
+ };
+
+ class gslice {
+ valarray<int> x;
+ valarray<int> stride() const { return x; }
+ };
+
+ template<class> class mask_array {
+ template<class> friend class valarray;
+ };
+ }
+}
+
+namespace local_extern {
+ template<typename T> int f() {
+ extern int arr[3];
+ {
+ extern T arr;
+ return sizeof(arr);
+ }
+ }
+ template<typename T> int g() {
+ extern int arr[3];
+ extern T arr;
+ return sizeof(arr);
+ }
+}
diff --git a/test/PCH/cxx-traits.cpp b/test/PCH/cxx-traits.cpp
index 938f36f2c279..ffdfccc6f47f 100644
--- a/test/PCH/cxx-traits.cpp
+++ b/test/PCH/cxx-traits.cpp
@@ -2,9 +2,11 @@
// RUN: %clang_cc1 -include %S/cxx-traits.h -std=c++11 -fsyntax-only -verify %s
// RUN: %clang_cc1 -x c++-header -std=c++11 -emit-pch -o %t %S/cxx-traits.h
-// RUN: %clang_cc1 -std=c++11 -include-pch %t -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++11 -include-pch %t -DPCH -fsyntax-only -verify %s
+#ifdef PCH
// expected-no-diagnostics
+#endif
bool _Is_pod_comparator = __is_pod<int>::__value;
bool _Is_empty_check = __is_empty<int>::__value;
diff --git a/test/PCH/cxx-traits.h b/test/PCH/cxx-traits.h
index 8b62002789d6..836804ef2c88 100644
--- a/test/PCH/cxx-traits.h
+++ b/test/PCH/cxx-traits.h
@@ -1,12 +1,12 @@
// Header for PCH test cxx-traits.cpp
template<typename _Tp>
-struct __is_pod {
+struct __is_pod { // expected-warning {{keyword '__is_pod' will be treated as an identifier for the remainder of the translation unit}}
enum { __value };
};
template<typename _Tp>
-struct __is_empty {
+struct __is_empty { // expected-warning {{keyword '__is_empty' will be treated as an identifier for the remainder of the translation unit}}
enum { __value };
};
diff --git a/test/PCH/cxx-typeid.cpp b/test/PCH/cxx-typeid.cpp
index 534863af21b1..6e622206521c 100644
--- a/test/PCH/cxx-typeid.cpp
+++ b/test/PCH/cxx-typeid.cpp
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: %clang_cc1 -include %S/cxx-typeid.h -fsyntax-only -verify %s
+// RUN: %clang_cc1 -include %S/cxx-typeid.h -fsyntax-only -stdlib=libstdc++ -verify %s
-// RUN: %clang_cc1 -x c++-header -emit-pch -o %t.pch %S/cxx-typeid.h
-// RUN: %clang_cc1 -include-pch %t.pch -fsyntax-only -verify %s
+// RUN: %clang_cc1 -x c++-header -emit-pch -stdlib=libstdc++ -o %t.pch %S/cxx-typeid.h
+// RUN: %clang_cc1 -include-pch %t.pch -fsyntax-only -stdlib=libstdc++ -verify %s
// expected-no-diagnostics
diff --git a/test/PCH/cxx11-lambdas.mm b/test/PCH/cxx11-lambdas.mm
index c00ec6380752..c4550517bb1e 100644
--- a/test/PCH/cxx11-lambdas.mm
+++ b/test/PCH/cxx11-lambdas.mm
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -pedantic-errors -fblocks -std=c++11 -emit-pch %s -o %t-cxx11
-// RUN: %clang_cc1 -ast-print -pedantic-errors -fblocks -std=c++11 -include-pch %t-cxx11 %s | FileCheck -check-prefix=CHECK-PRINT %s
+// RUN: %clang_cc1 -pedantic-errors -fblocks -std=c++1y -emit-pch %s -o %t-cxx11
+// RUN: %clang_cc1 -ast-print -pedantic-errors -fblocks -std=c++1y -include-pch %t-cxx11 %s | FileCheck -check-prefix=CHECK-PRINT %s
#ifndef HEADER_INCLUDED
@@ -33,6 +33,11 @@ inline int to_block_pointer(int n) {
return block(17);
}
+template<typename T>
+int init_capture(T t) {
+ return [&, x(t)] { return sizeof(x); };
+}
+
#else
// CHECK-PRINT: T add_slowly
@@ -45,4 +50,8 @@ int add(int x, int y) {
// CHECK-PRINT: inline int add_int_slowly_twice
// CHECK-PRINT: lambda = [&] (int z)
+
+// CHECK-PRINT: init_capture
+// CHECK-PRINT: [&, x( t )]
+
#endif
diff --git a/test/PCH/cxx1y-deduced-return-type.cpp b/test/PCH/cxx1y-deduced-return-type.cpp
new file mode 100644
index 000000000000..a61dda21e7f9
--- /dev/null
+++ b/test/PCH/cxx1y-deduced-return-type.cpp
@@ -0,0 +1,34 @@
+// No PCH:
+// RUN: %clang_cc1 -pedantic -std=c++1y -include %s -include %s -verify %s
+//
+// With chained PCH:
+// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch %s -o %t.a
+// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.a -emit-pch %s -o %t.b
+// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.b -verify %s
+
+// expected-no-diagnostics
+
+#if !defined(HEADER1)
+#define HEADER1
+
+auto &f(int &);
+
+template<typename T> decltype(auto) g(T &t) {
+ return f(t);
+}
+
+#elif !defined(HEADER2)
+#define HEADER2
+
+// Ensure that this provides an update record for the type of HEADER1's 'f',
+// so that HEADER1's 'g' can successfully call it.
+auto &f(int &n) {
+ return n;
+}
+
+#else
+
+int n;
+int &k = g(n);
+
+#endif
diff --git a/test/PCH/cxx1y-init-captures.cpp b/test/PCH/cxx1y-init-captures.cpp
new file mode 100644
index 000000000000..3c8fc149d84b
--- /dev/null
+++ b/test/PCH/cxx1y-init-captures.cpp
@@ -0,0 +1,28 @@
+// No PCH:
+// RUN: %clang_cc1 -pedantic -std=c++1y -include %s -verify %s
+//
+// With PCH:
+// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch %s -o %t
+// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t -verify %s
+
+#ifndef HEADER
+#define HEADER
+
+auto counter = [a(0)] () mutable { return a++; };
+int x = counter();
+
+template<typename T> void f(T t) {
+ [t(t)] { int n = t; } ();
+}
+
+#else
+
+int y = counter();
+
+void g() {
+ f(0); // ok
+ // expected-error@15 {{lvalue of type 'const char *const'}}
+ f("foo"); // expected-note {{here}}
+}
+
+#endif
diff --git a/test/PCH/cxx1y-lambdas.mm b/test/PCH/cxx1y-lambdas.mm
new file mode 100644
index 000000000000..ee4a2ba3ecc9
--- /dev/null
+++ b/test/PCH/cxx1y-lambdas.mm
@@ -0,0 +1,58 @@
+// RUN: %clang_cc1 -pedantic-errors -fblocks -std=c++1y -emit-pch %s -o %t-cxx1y
+// RUN: %clang_cc1 -ast-print -pedantic-errors -fblocks -std=c++1y -include-pch %t-cxx1y %s | FileCheck -check-prefix=CHECK-PRINT %s
+
+#ifndef HEADER_INCLUDED
+
+#define HEADER_INCLUDED
+template<typename T>
+T add_slowly(const T& x, const T &y) {
+ return [](auto z, int y = 0) { return z + y; }(5);
+};
+
+inline int add_int_slowly_twice(int x, int y) {
+ int i = add_slowly(x, y);
+ auto lambda = [](auto z) { return z + z; };
+ return i + lambda(y);
+}
+
+inline int sum_array(int n) {
+ auto lambda = [](auto N) -> int {
+ int sum = 0;
+ int array[5] = { 1, 2, 3, 4, 5};
+
+ for (unsigned I = 0; I < N; ++I)
+ sum += array[N];
+ return sum;
+ };
+
+ return lambda(n);
+}
+
+inline int to_block_pointer(int n) {
+ auto lambda = [=](int m) { return n + m; };
+ int (^block)(int) = lambda;
+ return block(17);
+}
+
+template<typename T>
+int init_capture(T t) {
+ return [&, x(t)] { return sizeof(x); };
+}
+
+#else
+
+// CHECK-PRINT: T add_slowly
+// CHECK-PRINT: return []
+template float add_slowly(const float&, const float&);
+
+int add(int x, int y) {
+ return add_int_slowly_twice(x, y) + sum_array(4) + to_block_pointer(5);
+}
+
+// CHECK-PRINT: inline int add_int_slowly_twice
+// CHECK-PRINT: lambda = [] ($auto-0-0 z
+
+// CHECK-PRINT: init_capture
+// CHECK-PRINT: [&, x( t )]
+
+#endif
diff --git a/test/PCH/cxx1y-variable-templates.cpp b/test/PCH/cxx1y-variable-templates.cpp
new file mode 100644
index 000000000000..77eeea22a23d
--- /dev/null
+++ b/test/PCH/cxx1y-variable-templates.cpp
@@ -0,0 +1,171 @@
+// No PCH:
+// RUN: %clang_cc1 -pedantic -std=c++1y -include %s -include %s -verify %s -DNONPCH
+// RUN: %clang_cc1 -pedantic -std=c++1y -include %s -include %s -verify %s -DNONPCH -DERROR
+//
+// With PCH:
+// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch %s -o %t.a -DHEADER1
+// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.a -emit-pch %s -o %t.b -DHEADER2
+// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.b -verify %s -DHEADERUSE
+
+#ifndef ERROR
+// expected-no-diagnostics
+#endif
+
+#ifdef NONPCH
+#if !defined(HEADER1)
+#define HEADER1
+#undef HEADER2
+#undef HEADERUSE
+#elif !defined(HEADER2)
+#define HEADER2
+#undef HEADERUSE
+#else
+#define HEADERUSE
+#undef HEADER1
+#undef HEADER2
+#endif
+#endif
+
+
+// *** HEADER1: First header file
+#if defined(HEADER1) && !defined(HEADER2) && !defined(HEADERUSE)
+
+template<typename T> T var0a = T();
+template<typename T> extern T var0b;
+
+namespace join {
+ template<typename T> T va = T(100);
+ template<typename T> extern T vb;
+
+ namespace diff_types {
+#ifdef ERROR
+ template<typename T> extern float err0;
+ template<typename T> extern T err1;
+#endif
+ template<typename T> extern T def;
+ }
+
+}
+
+namespace spec {
+ template<typename T> constexpr T va = T(10);
+ template<> constexpr float va<float> = 1.5;
+ template constexpr int va<int>;
+
+ template<typename T> T vb = T();
+ template<> constexpr float vb<float> = 1.5;
+
+ template<typename T> T vc = T();
+
+ template<typename T> constexpr T vd = T(10);
+ template<typename T> T* vd<T*> = new T();
+}
+
+namespace spec_join1 {
+ template<typename T> T va = T(10);
+ template<> extern float va<float>;
+ extern template int va<int>;
+
+ template<typename T> T vb = T(10);
+ template<> extern float vb<float>;
+
+ template<typename T> T vc = T(10);
+
+ template<typename T> T vd = T(10);
+ template<typename T> extern T* vd<T*>;
+}
+
+#endif
+
+
+// *** HEADER2: Second header file -- including HEADER1
+#if defined(HEADER2) && !defined(HEADERUSE)
+
+namespace join {
+ template<typename T> extern T va;
+ template<> constexpr float va<float> = 2.5;
+
+ template<typename T> T vb = T(100);
+
+ namespace diff_types {
+#ifdef ERROR
+ template<typename T> extern T err0; // expected-error {{redefinition of 'err0' with a different type: 'T' vs 'float'}} // expected-note@42 {{previous definition is here}}
+ template<typename T> extern float err1; // expected-error {{redefinition of 'err1' with a different type: 'float' vs 'T'}} // expected-note@43 {{previous definition is here}}
+#endif
+ template<typename T> extern T def;
+ }
+}
+
+namespace spec_join1 {
+ template<typename T> extern T va;
+ template<> float va<float> = 1.5;
+ extern template int va<int>;
+
+ template<> float vb<float> = 1.5;
+ template int vb<int>;
+
+ template<> float vc<float> = 1.5;
+ template int vc<int>;
+
+ template<typename T> extern T vd;
+ template<typename T> T* vd<T*> = new T();
+}
+
+#endif
+
+// *** HEADERUSE: File using both header files -- including HEADER2
+#ifdef HEADERUSE
+
+template int var0a<int>;
+float fvara = var0a<float>;
+
+template<typename T> extern T var0a;
+
+template<typename T> T var0b = T();
+template int var0b<int>;
+float fvarb = var0b<float>;
+
+namespace join {
+ template const int va<const int>;
+ template<> const int va<int> = 50;
+ static_assert(va<float> == 2.5, "");
+ static_assert(va<int> == 50, "");
+
+ template<> constexpr float vb<float> = 2.5;
+ template const int vb<const int>;
+ static_assert(vb<float> == 2.5, "");
+ static_assert(vb<const int> == 100, "");
+
+ namespace diff_types {
+ template<typename T> T def = T();
+ }
+
+}
+
+namespace spec {
+ static_assert(va<float> == 1.5, "");
+ static_assert(va<int> == 10, "");
+
+ template<typename T> T* vb<T*> = new T();
+ int* intpb = vb<int*>;
+ static_assert(vb<float> == 1.5, "");
+
+ template<typename T> T* vc<T*> = new T();
+ template<> constexpr float vc<float> = 1.5;
+ int* intpc = vc<int*>;
+ static_assert(vc<float> == 1.5, "");
+
+ char* intpd = vd<char*>;
+}
+
+namespace spec_join1 {
+ template int va<int>;
+ int a = va<int>;
+
+ template<typename T> extern T vb;
+ int b = vb<int>;
+
+ int* intpb = vd<int*>;
+}
+
+#endif
diff --git a/test/PCH/debug-info-limited-struct.c b/test/PCH/debug-info-limited-struct.c
new file mode 100644
index 000000000000..9d0ed26f34cf
--- /dev/null
+++ b/test/PCH/debug-info-limited-struct.c
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -emit-pch -o %t %S/debug-info-limited-struct.h
+// RUN: %clang_cc1 -include-pch %t -emit-llvm %s -g -o - | FileCheck %s
+
+// CHECK-DAG: [ DW_TAG_structure_type ] [foo] {{.*}} [def]
diff --git a/test/PCH/debug-info-limited-struct.h b/test/PCH/debug-info-limited-struct.h
new file mode 100644
index 000000000000..593e722ce9c0
--- /dev/null
+++ b/test/PCH/debug-info-limited-struct.h
@@ -0,0 +1,8 @@
+struct foo {
+ int i;
+};
+
+void func() {
+ struct foo *f;
+ f->i = 3;
+}
diff --git a/test/PCH/exprs.h b/test/PCH/exprs.h
index d08b1f64edec..d6735a727a53 100644
--- a/test/PCH/exprs.h
+++ b/test/PCH/exprs.h
@@ -102,6 +102,10 @@ typedef typeof(__builtin_choose_expr(17 > 19, d0, 1)) choose_expr;
// ShuffleVectorExpr
typedef typeof(__builtin_shufflevector(vec2, vec2b, 2, 1)) shuffle_expr;
+// ConvertVectorExpr
+typedef __attribute__(( ext_vector_type(2) )) float float2;
+typedef typeof(__builtin_convertvector(vec2, float2)) convert_expr;
+
// GenericSelectionExpr
typedef typeof(_Generic(i, char*: 0, int: 0., default: hello))
generic_selection_expr;
diff --git a/test/PCH/external-defs.c b/test/PCH/external-defs.c
index 5097859297a5..5c2582a9c361 100644
--- a/test/PCH/external-defs.c
+++ b/test/PCH/external-defs.c
@@ -3,7 +3,7 @@
// RUN: %clang_cc1 -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: not grep "@z" %t
// RUN: grep "@x2 = global i32 19" %t | count 1
int x2 = 19;
diff --git a/test/PCH/floating-literal.c b/test/PCH/floating-literal.c
index 7bf10d4e7981..738e45a41517 100644
--- a/test/PCH/floating-literal.c
+++ b/test/PCH/floating-literal.c
@@ -7,12 +7,12 @@
// targets with 128-bit IEEE long doubles.
long double foo = 1.0E4000L;
-// CHECK: long double foo = 1.0E+4000L;
+// CHECK: long double foo = 1.00000000000000000000000000000000004E+4000L;
// Just as well check the others are still sane while we're here...
double bar = 1.0E300;
-// CHECK: double bar = 1.0E+300;
+// CHECK: double bar = 1.0000000000000001E+300;
float wibble = 1.0E40;
// CHECK: float wibble = 1.0E+40;
diff --git a/test/PCH/irgen-rdar13114142.mm b/test/PCH/irgen-rdar13114142.mm
index bd523c29cf32..7a9cfba942d8 100644
--- a/test/PCH/irgen-rdar13114142.mm
+++ b/test/PCH/irgen-rdar13114142.mm
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 %s -emit-pch -o %t.pch
-// RUN: %clang_cc1 %s -emit-llvm %s -include-pch %t.pch -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -include-pch %t.pch -o - | FileCheck %s
#ifndef HEADER
#define HEADER
diff --git a/test/PCH/line-directive.c b/test/PCH/line-directive.c
index 4710c40d7234..7d59c62763c3 100644
--- a/test/PCH/line-directive.c
+++ b/test/PCH/line-directive.c
@@ -1,9 +1,9 @@
// Test this without pch.
-// RUN: %clang_cc1 -include %S/line-directive.h -fsyntax-only %s 2>&1|grep "25:5"
+// RUN: not %clang_cc1 -include %S/line-directive.h -fsyntax-only %s 2>&1|grep "25:5"
// Test with pch.
// RUN: %clang_cc1 -emit-pch -o %t %S/line-directive.h
-// RUN: %clang_cc1 -include-pch %t -fsyntax-only %s 2>&1|grep "25:5"
+// RUN: not %clang_cc1 -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/modified-header-error.c b/test/PCH/modified-header-error.c
index 4ad3fafff4d9..8ab38e1e9e98 100644
--- a/test/PCH/modified-header-error.c
+++ b/test/PCH/modified-header-error.c
@@ -4,7 +4,7 @@
// RUN: cp %s %t.dir/t.c
// RUN: %clang_cc1 -x c-header %t.dir/header1.h -emit-pch -o %t.pch
// RUN: echo >> %t.dir/header2.h
-// RUN: %clang_cc1 %t.dir/t.c -include-pch %t.pch -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 %t.dir/t.c -include-pch %t.pch -fsyntax-only 2>&1 | FileCheck %s
#include "header2.h"
diff --git a/test/PCH/objc_container.m b/test/PCH/objc_container.m
index aafe6a96ab13..0f25d3252c68 100644
--- a/test/PCH/objc_container.m
+++ b/test/PCH/objc_container.m
@@ -4,8 +4,8 @@
// Test with pch.
// RUN: %clang_cc1 -x objective-c -emit-pch -o %t %S/objc_container.h
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
-// RUN: %clang_cc1 -include-pch %t -ast-print %s | FileCheck -check-prefix=PRINT %s
-// RUN: %clang_cc1 -include-pch %t -emit-llvm -o - %s | FileCheck -check-prefix=IR %s
+// RUN: %clang_cc1 -include-pch %t -ast-print %s | FileCheck -check-prefix=CHECK-PRINT %s
+// RUN: %clang_cc1 -include-pch %t -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-IR %s
// expected-no-diagnostics
diff --git a/test/PCH/objc_import.h b/test/PCH/objc_import.h
index 8af87ab25c7d..4646e16a2cdb 100644
--- a/test/PCH/objc_import.h
+++ b/test/PCH/objc_import.h
@@ -5,3 +5,14 @@
- (void)instMethod;
@end
+@class NewID1;
+@compatibility_alias OldID1 NewID1;
+@class OldID1;
+@class OldID1;
+
+@class NewID2;
+@compatibility_alias OldID2 NewID2;
+@class OldID2;
+@interface OldID2
+-(void)meth;
+@end
diff --git a/test/PCH/objc_import.m b/test/PCH/objc_import.m
index c7dd805b3e47..724c8221848b 100644
--- a/test/PCH/objc_import.m
+++ b/test/PCH/objc_import.m
@@ -15,3 +15,18 @@ void func() {
xx = [TestPCH alloc];
[xx instMethod];
}
+
+// rdar://14112291
+@class NewID1;
+void foo1(NewID1 *p);
+void bar1(OldID1 *p) {
+ foo1(p);
+}
+@class NewID2;
+void foo2(NewID2 *p) {
+ [p meth];
+}
+void bar2(OldID2 *p) {
+ foo2(p);
+ [p meth];
+}
diff --git a/test/PCH/objc_literals.m b/test/PCH/objc_literals.m
index b73c3bebb8c4..f96d4afe2aa0 100644
--- a/test/PCH/objc_literals.m
+++ b/test/PCH/objc_literals.m
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -emit-pch -o %t %s
// RUN: %clang_cc1 -include-pch %t -verify %s
-// RUN: %clang_cc1 -include-pch %t -ast-print %s | FileCheck -check-prefix=PRINT %s
-// RUN: %clang_cc1 -include-pch %t -emit-llvm -o - %s | FileCheck -check-prefix=IR %s
+// RUN: %clang_cc1 -include-pch %t -ast-print %s | FileCheck -check-prefix=CHECK-PRINT %s
+// RUN: %clang_cc1 -include-pch %t -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-IR %s
// expected-no-diagnostics
@@ -44,18 +44,18 @@ static inline void test_numeric_literals() {
// CHECK-PRINT: id intlit = @17
// CHECK-IR: {{call.*17}}
id intlit = @17;
- // CHECK-PRINT: id floatlit = @17.45
+ // CHECK-PRINT: id floatlit = @17.449999999999999
// CHECK-IR: {{call.*1.745}}
id floatlit = @17.45;
}
static inline void test_array_literals() {
- // CHECK-PRINT: id arraylit = @[ @17, @17.45
+ // CHECK-PRINT: id arraylit = @[ @17, @17.449999999999999
id arraylit = @[@17, @17.45];
}
static inline void test_dictionary_literals() {
- // CHECK-PRINT: id dictlit = @{ @17 : {{@17.45[^,]*}}, @"hello" : @"world" };
+ // CHECK-PRINT: id dictlit = @{ @17 : {{@17.449999999999999[^,]*}}, @"hello" : @"world" };
id dictlit = @{@17 : @17.45, @"hello" : @"world" };
}
diff --git a/test/PCH/objc_literals.mm b/test/PCH/objc_literals.mm
index ef95294d7aa7..59f33815a2b8 100644
--- a/test/PCH/objc_literals.mm
+++ b/test/PCH/objc_literals.mm
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -emit-pch -x objective-c++ -std=c++0x -o %t %s
// RUN: %clang_cc1 -include-pch %t -x objective-c++ -std=c++0x -verify %s
-// RUN: %clang_cc1 -include-pch %t -x objective-c++ -std=c++0x -ast-print %s | FileCheck -check-prefix=PRINT %s
-// RUN: %clang_cc1 -include-pch %t -x objective-c++ -std=c++0x -emit-llvm -o - %s | FileCheck -check-prefix=IR %s
+// RUN: %clang_cc1 -include-pch %t -x objective-c++ -std=c++0x -ast-print %s | FileCheck -check-prefix=CHECK-PRINT %s
+// RUN: %clang_cc1 -include-pch %t -x objective-c++ -std=c++0x -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-IR %s
// expected-no-diagnostics
diff --git a/test/PCH/objcxx-ivar-class.mm b/test/PCH/objcxx-ivar-class.mm
index 821495747d46..a83d7e74d758 100644
--- a/test/PCH/objcxx-ivar-class.mm
+++ b/test/PCH/objcxx-ivar-class.mm
@@ -1,9 +1,9 @@
// Test this without pch.
-// RUN: %clang_cc1 -include %S/objcxx-ivar-class.h -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: not %clang_cc1 -include %S/objcxx-ivar-class.h -verify %s -emit-llvm -o - | FileCheck %s
// Test with pch.
// RUN: %clang_cc1 -x objective-c++-header -emit-pch -o %t %S/objcxx-ivar-class.h
-// RUN: %clang_cc1 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: not %clang_cc1 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// CHECK: [C position]
// CHECK: call {{.*}} @_ZN1SC1ERKS_
diff --git a/test/PCH/pch-dir.c b/test/PCH/pch-dir.c
index ae841ce0a7a4..2ac10ea56c92 100644
--- a/test/PCH/pch-dir.c
+++ b/test/PCH/pch-dir.c
@@ -3,14 +3,14 @@
// RUN: %clang -x c-header %S/pch-dir.h -DFOO=bar -o %t.h.gch/cbar.gch
// RUN: %clang -x c++-header -std=c++98 %S/pch-dir.h -o %t.h.gch/cpp.gch
// RUN: %clang -include %t.h -DFOO=foo -fsyntax-only %s -Xclang -print-stats 2> %t.clog
-// RUN: FileCheck -check-prefix=C %s < %t.clog
+// RUN: FileCheck -check-prefix=CHECK-C %s < %t.clog
// RUN: %clang -include %t.h -DFOO=bar -DBAR=bar -fsyntax-only %s -Xclang -ast-print > %t.cbarlog
-// RUN: FileCheck -check-prefix=CBAR %s < %t.cbarlog
+// RUN: FileCheck -check-prefix=CHECK-CBAR %s < %t.cbarlog
// RUN: %clang -x c++ -include %t.h -std=c++98 -fsyntax-only %s -Xclang -print-stats 2> %t.cpplog
-// RUN: FileCheck -check-prefix=CPP %s < %t.cpplog
+// RUN: FileCheck -check-prefix=CHECK-CPP %s < %t.cpplog
// RUN: not %clang -x c++ -std=c++11 -include %t.h -fsyntax-only %s 2> %t.cpp11log
-// RUN: FileCheck -check-prefix=CPP11 %s < %t.cpp11log
+// RUN: FileCheck -check-prefix=CHECK-CPP11 %s < %t.cpp11log
// CHECK-CBAR: int bar
int FOO;
diff --git a/test/PCH/pragma-diag-section.cpp b/test/PCH/pragma-diag-section.cpp
index 627156f15398..eea6bd73f546 100644
--- a/test/PCH/pragma-diag-section.cpp
+++ b/test/PCH/pragma-diag-section.cpp
@@ -1,20 +1,20 @@
// Test this without pch.
-// RUN: %clang_cc1 %s -include %s -verify -fsyntax-only
+// RUN: %clang_cc1 %s -include %s -verify -fsyntax-only -Wuninitialized
// Test with pch.
// RUN: %clang_cc1 %s -emit-pch -o %t
-// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only
+// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only -Wuninitialized
#ifndef HEADER
#define HEADER
#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wtautological-compare"
+#pragma clang diagnostic ignored "-Wuninitialized"
template <typename T>
struct TS1 {
void m() {
- T a = 0;
- T b = a==a;
+ T a;
+ T b = a;
}
};
#pragma clang diagnostic pop
@@ -25,8 +25,10 @@ struct TS1 {
template <typename T>
struct TS2 {
void m() {
- T a = 0;
- T b = a==a; // expected-warning {{self-comparison always evaluates to true}} expected-note@39 {{in instantiation of member function}}
+ T a;
+ T b = a; // expected-warning {{variable 'a' is uninitialized}} \
+ expected-note@41 {{in instantiation of member function}} \
+ expected-note@28 {{initialize the variable 'a' to silence}}
}
};
diff --git a/test/PCH/pragma-weak.c b/test/PCH/pragma-weak.c
index 18b45c889d12..1a8724c35cd7 100644
--- a/test/PCH/pragma-weak.c
+++ b/test/PCH/pragma-weak.c
@@ -1,9 +1,9 @@
// Test this without pch.
-// RUN: %clang_cc1 -include %S/pragma-weak.h %s -verify -emit-llvm -o - | FileCheck %s
+// RUN: not %clang_cc1 -include %S/pragma-weak.h %s -verify -emit-llvm -o - | FileCheck %s
// Test with pch.
// RUN: %clang_cc1 -x c-header -emit-pch -o %t %S/pragma-weak.h
-// RUN: %clang_cc1 -include-pch %t %s -verify -emit-llvm -o - | FileCheck %s
+// RUN: not %clang_cc1 -include-pch %t %s -verify -emit-llvm -o - | FileCheck %s
// CHECK: @weakvar = weak global i32 0
int weakvar;
diff --git a/test/PCH/preamble.c b/test/PCH/preamble.c
index 6a61fa10ffa1..7344f54453eb 100644
--- a/test/PCH/preamble.c
+++ b/test/PCH/preamble.c
@@ -1,7 +1,7 @@
// Check that using the preamble option actually skips the preamble.
// RUN: %clang_cc1 -emit-pch -o %t %S/Inputs/preamble.h -DFOO=f
-// RUN: %clang_cc1 -include-pch %t -preamble-bytes=317,1 -DFOO=f -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: not %clang_cc1 -include-pch %t -preamble-bytes=317,1 -DFOO=f -verify %s -emit-llvm -o - | FileCheck %s
float f(int); // Not an error, because we skip this via the preamble!
diff --git a/test/PCH/pth.c b/test/PCH/pth.c
index 1262f8aebd70..6f2e4fc7b53c 100644
--- a/test/PCH/pth.c
+++ b/test/PCH/pth.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-pth -o %t %S/pth.h
-// RUN: %clang_cc1 -triple i386-unknown-unknown -include-pth %t -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple i386-unknown-unknown -include-pth %t -fsyntax-only %s 2>&1 | FileCheck %s
#error This is the only diagnostic
// CHECK: This is the only diagnostic
-// CHECK: 1 error generated. \ No newline at end of file
+// CHECK: 1 error generated.
diff --git a/test/PCH/rdar10830559.cpp b/test/PCH/rdar10830559.cpp
index b9b643741d78..aa19da43a34e 100644
--- a/test/PCH/rdar10830559.cpp
+++ b/test/PCH/rdar10830559.cpp
@@ -8,7 +8,7 @@
// rdar://10830559
-#pragma ms_struct on
+//#pragma ms_struct on
template< typename T >
class Templated
diff --git a/test/PCH/remap-file-from-pch.cpp b/test/PCH/remap-file-from-pch.cpp
index 8b965cf11c34..017285385a0b 100644
--- a/test/PCH/remap-file-from-pch.cpp
+++ b/test/PCH/remap-file-from-pch.cpp
@@ -1,7 +1,7 @@
// %clang_cc1 -remap-file "%s;%S/Inputs/remapped-file" -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXIST %s
// RUN: %clang_cc1 -x c++-header %s.h -emit-pch -o %t.pch
-// RUN: %clang_cc1 %s -include-pch %t.pch -remap-file "%s.h;%s.remap.h" -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 %s -include-pch %t.pch -remap-file "%s.h;%s.remap.h" -fsyntax-only 2>&1 | FileCheck %s
const char *str = STR;
int ge = zool;
diff --git a/test/Parser/DelayedTemplateParsing.cpp b/test/Parser/DelayedTemplateParsing.cpp
index 77b47239f4c8..73128c49f247 100644
--- a/test/Parser/DelayedTemplateParsing.cpp
+++ b/test/Parser/DelayedTemplateParsing.cpp
@@ -11,7 +11,8 @@ class A {
template <class T>
class B {
void foo4() { } // expected-note {{previous definition is here}} expected-note {{previous definition is here}}
- void foo4() { } // expected-error {{class member cannot be redeclared}} expected-error {{redefinition of 'foo4'}} expected-note {{previous definition is here}}
+ void foo4() { } // expected-error {{class member cannot be redeclared}} expected-error {{redefinition of 'foo4'}}
+ void foo5() { } // expected-note {{previous definition is here}}
friend void foo3() {
undeclared();
@@ -20,7 +21,7 @@ class B {
template <class T>
-void B<T>::foo4() {// expected-error {{redefinition of 'foo4'}}
+void B<T>::foo5() { // expected-error {{redefinition of 'foo5'}}
}
template <class T>
@@ -101,3 +102,22 @@ namespace rdar11700604 {
};
}
+namespace PR17334 {
+
+template <typename = void> struct ArrayRef {
+ constexpr ArrayRef() {}
+};
+template <typename = void> void CreateConstInBoundsGEP2_32() {
+ ArrayRef<> IdxList;
+}
+void LLVMBuildStructGEP() { CreateConstInBoundsGEP2_32(); }
+
+}
+
+namespace PR17661 {
+template <typename T>
+constexpr T Fun(T A) { return T(0); }
+
+constexpr int Var = Fun(20);
+}
+
diff --git a/test/Parser/MicrosoftExtensions.c b/test/Parser/MicrosoftExtensions.c
index 35c63d4b552a..5e1139338b81 100644
--- a/test/Parser/MicrosoftExtensions.c
+++ b/test/Parser/MicrosoftExtensions.c
@@ -30,6 +30,20 @@ void __forceinline InterlockedBitTestAndSet (long *Base, long Bit)
};
#endif
}
+
+// Both inline and __forceinline is OK.
+inline void __forceinline pr8264() {
+}
+__forceinline void inline pr8264_1() {
+}
+void inline __forceinline pr8264_2() {
+}
+void __forceinline inline pr8264_3() {
+}
+// But duplicate __forceinline causes warning.
+void __forceinline __forceinline pr8264_4() { // expected-warning{{duplicate '__forceinline' declaration specifier}}
+}
+
_inline int foo99() { return 99; }
void test_ms_alignof_alias() {
@@ -105,3 +119,14 @@ __declspec() void quux( void ) {
struct S7 s;
int i = s.t; /* expected-warning {{'t' is deprecated}} */
}
+
+int * __sptr psp;
+int * __uptr pup;
+/* Either ordering is acceptable */
+int * __ptr32 __sptr psp32;
+int * __ptr32 __uptr pup32;
+int * __sptr __ptr64 psp64;
+int * __uptr __ptr64 pup64;
+
+/* Legal to have nested pointer attributes */
+int * __sptr * __ptr32 ppsp32;
diff --git a/test/Parser/MicrosoftExtensions.cpp b/test/Parser/MicrosoftExtensions.cpp
index d8a597a8cc5b..efb5c3ce1fdc 100644
--- a/test/Parser/MicrosoftExtensions.cpp
+++ b/test/Parser/MicrosoftExtensions.cpp
@@ -4,21 +4,21 @@
[repeatable][source_annotation_attribute( Parameter|ReturnValue )]
struct SA_Post{ SA_Post(); int attr; };
-[returnvalue:SA_Post( attr=1)]
+[returnvalue:SA_Post( attr=1)]
int foo1([SA_Post(attr=1)] void *param);
namespace {
- [returnvalue:SA_Post(attr=1)]
+ [returnvalue:SA_Post(attr=1)]
int foo2([SA_Post(attr=1)] void *param);
}
class T {
- [returnvalue:SA_Post(attr=1)]
+ [returnvalue:SA_Post(attr=1)]
int foo3([SA_Post(attr=1)] void *param);
};
extern "C" {
- [returnvalue:SA_Post(attr=1)]
+ [returnvalue:SA_Post(attr=1)]
int foo5([SA_Post(attr=1)] void *param);
}
@@ -32,7 +32,7 @@ public:
void uuidof_test1()
-{
+{
__uuidof(0); // expected-error {{you need to include <guiddef.h> before using the '__uuidof' operator}}
}
@@ -44,8 +44,8 @@ typedef struct _GUID
unsigned char Data4[8];
} GUID;
-struct __declspec(uuid(L"00000000-0000-0000-1234-000000000047")) uuid_attr_bad1 { };// expected-error {{'uuid' attribute requires parameter 1 to be a string}}
-struct __declspec(uuid(3)) uuid_attr_bad2 { };// expected-error {{'uuid' attribute requires parameter 1 to be a string}}
+struct __declspec(uuid(L"00000000-0000-0000-1234-000000000047")) uuid_attr_bad1 { };// expected-error {{'uuid' attribute requires a string}}
+struct __declspec(uuid(3)) uuid_attr_bad2 { };// expected-error {{'uuid' attribute requires a string}}
struct __declspec(uuid("0000000-0000-0000-1234-0000500000047")) uuid_attr_bad3 { };// expected-error {{uuid attribute contains a malformed GUID}}
struct __declspec(uuid("0000000-0000-0000-Z234-000000000047")) uuid_attr_bad4 { };// expected-error {{uuid attribute contains a malformed GUID}}
struct __declspec(uuid("000000000000-0000-1234-000000000047")) uuid_attr_bad5 { };// expected-error {{uuid attribute contains a malformed GUID}}
@@ -59,7 +59,7 @@ struct struct_without_uuid { };
struct __declspec(uuid("000000A0-0000-0000-C000-000000000049"))
struct_with_uuid2;
-struct
+struct
struct_with_uuid2 {} ;
int uuid_sema_test()
@@ -72,6 +72,10 @@ int uuid_sema_test()
__uuidof(struct_without_uuid); // expected-error {{cannot call operator __uuidof on a type with no GUID}}
__uuidof(struct_with_uuid*);
__uuidof(struct_without_uuid*); // expected-error {{cannot call operator __uuidof on a type with no GUID}}
+ __uuidof(struct_with_uuid[1]);
+ __uuidof(struct_with_uuid*[1]); // expected-error {{cannot call operator __uuidof on a type with no GUID}}
+ __uuidof(const struct_with_uuid[1][1]);
+ __uuidof(const struct_with_uuid*[1][1]); // expected-error {{cannot call operator __uuidof on a type with no GUID}}
__uuidof(var_with_uuid);
__uuidof(var_without_uuid);// expected-error {{cannot call operator __uuidof on a type with no GUID}}
@@ -89,16 +93,16 @@ template <class T>
void template_uuid()
{
T expr;
-
+
__uuidof(T);
__uuidof(expr);
}
-template <class T, const GUID* g = &__uuidof(T)>
+template <class T, const GUID* g = &__uuidof(T)> // expected-note {{template parameter is declared here}}
class COM_CLASS_TEMPLATE { };
-typedef COM_CLASS_TEMPLATE<struct_with_uuid, &__uuidof(struct_with_uuid)> COM_TYPE_1;
+typedef COM_CLASS_TEMPLATE<struct_with_uuid, &*&__uuidof(struct_with_uuid)> COM_TYPE_1; // expected-warning {{non-type template argument containing a dereference operation is a Microsoft extension}}
typedef COM_CLASS_TEMPLATE<struct_with_uuid> COM_TYPE_2;
template <class T, const GUID& g>
@@ -112,8 +116,30 @@ typedef COM_CLASS_TEMPLATE_REF<struct_with_uuid, __uuidof(struct_with_uuid)> COM
}
struct __declspec(uuid("000000A0-0000-0000-C000-000000000049")) late_defined_uuid;
+COM_CLASS_TEMPLATE_REF<int, __uuidof(struct_with_uuid)> good_template_arg;
+
+COM_CLASS_TEMPLATE<int, __uuidof(struct_with_uuid)> bad_template_arg; // expected-error {{non-type template argument of type 'const _GUID' is not a constant expression}}
+
+namespace PR16911 {
+struct __declspec(uuid("{12345678-1234-1234-1234-1234567890aB}")) uuid;
+struct __declspec(uuid("{12345678-1234-1234-1234-1234567890aB}")) uuid2;
+
+template <typename T, typename T2>
+struct thing {
+};
+
+struct empty {};
+struct inher : public thing<empty, uuid2> {};
-class CtorCall {
+struct __declspec(uuid("{12345678-1234-1234-1234-1234567890aB}")) uuid;
+const struct _GUID *w = &__uuidof(inher); // expected-error{{cannot call operator __uuidof on a type with no GUID}}
+const struct _GUID *x = &__uuidof(thing<uuid, inher>);
+const struct _GUID *y = &__uuidof(thing<uuid2, uuid>); // expected-error{{cannot call operator __uuidof on a type with multiple GUIDs}}
+thing<uuid2, uuid> thing_obj = thing<uuid2, uuid>();
+const struct _GUID *z = &__uuidof(thing_obj); // expected-error{{cannot call operator __uuidof on a type with multiple GUIDs}}
+}
+
+class CtorCall {
public:
CtorCall& operator=(const CtorCall& that);
@@ -136,7 +162,7 @@ public:
class Iterator {
};
};
-
+
template<class T>
class C2 {
typename C1<T>:: /*template*/ Iterator<0> Mypos; // expected-warning {{use 'template' keyword to treat 'Iterator' as a dependent template name}}
@@ -149,7 +175,9 @@ void missing_template_keyword(){
-class AAAA { };
+class AAAA {
+ typedef int D;
+};
template <typename T>
class SimpleTemplate {};
@@ -160,7 +188,7 @@ void redundant_typename() {
typename AAAA a;// expected-warning {{expected a qualified name after 'typename'}}
t = 3;
-
+
typedef typename T* pointerT;// expected-warning {{expected a qualified name after 'typename'}}
typedef typename SimpleTemplate<int> templateT;// expected-warning {{expected a qualified name after 'typename'}}
@@ -171,6 +199,12 @@ void redundant_typename() {
int k = typename var;// expected-error {{expected a qualified name after 'typename'}}
}
+template <typename T>
+struct TypenameWrongPlace {
+ typename typedef T::D D;// expected-warning {{expected a qualified name after 'typename'}}
+};
+
+extern TypenameWrongPlace<AAAA> PR16925;
__interface MicrosoftInterface;
__interface MicrosoftInterface {
@@ -239,25 +273,25 @@ __if_not_exists(IF_EXISTS::Type_not) {
int __if_exists_init_list() {
int array1[] = {
- 0,
+ 0,
__if_exists(IF_EXISTS::Type) {2, }
3
};
int array2[] = {
- 0,
+ 0,
__if_exists(IF_EXISTS::Type_not) { this wont compile }
3
};
int array3[] = {
- 0,
+ 0,
__if_not_exists(IF_EXISTS::Type_not) {2, }
3
};
int array4[] = {
- 0,
+ 0,
__if_not_exists(IF_EXISTS::Type) { this wont compile }
3
};
@@ -297,10 +331,19 @@ class inline_definition_pure_spec {
virtual int f2() = 0;
};
+struct pure_virtual_dtor {
+ virtual ~pure_virtual_dtor() = 0;
+};
+pure_virtual_dtor::~pure_virtual_dtor() { }
+
+struct pure_virtual_dtor_inline {
+ virtual ~pure_virtual_dtor_inline() = 0 { }// expected-warning {{function definition with pure-specifier is a Microsoft extension}}
+};
+
int main () {
// Necessary to force instantiation in -fdelayed-template-parsing mode.
- test_late_defined_uuid<int>();
+ test_late_defined_uuid<int>();
redundant_typename<int>();
missing_template_keyword<int>();
}
diff --git a/test/Parser/PR11000.cpp b/test/Parser/PR11000.cpp
index 7dae99621bbb..8d235cdf0316 100644
--- a/test/Parser/PR11000.cpp
+++ b/test/Parser/PR11000.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -std=c++11 %s 2>&1 | FileCheck %s
// PR11000: Don't crash.
class tuple<>
diff --git a/test/Parser/altivec-csk-bool.c b/test/Parser/altivec-csk-bool.c
new file mode 100644
index 000000000000..ba6fa3b2f77b
--- /dev/null
+++ b/test/Parser/altivec-csk-bool.c
@@ -0,0 +1,14 @@
+// RUN: %clang -target powerpc64-unknown-linux-gnu -maltivec -fsyntax-only %s
+
+// PR16456: Verify that bool, true, false are treated as context-sensitive
+// keywords (and therefore available for use as identifiers) when in
+// Altivec mode.
+
+typedef enum {
+ false_value = 0,
+ true_value = 1
+} bool;
+
+#define true true_value
+#define false false_value
+
diff --git a/test/Parser/attr-availability.c b/test/Parser/attr-availability.c
index 0ed839177531..06bebbad5c59 100644
--- a/test/Parser/attr-availability.c
+++ b/test/Parser/attr-availability.c
@@ -18,6 +18,8 @@ void f5() __attribute__((availability(macosx,introduced=10.5), availability(ios,
void f6() __attribute__((availability(macosx,unavailable,introduced=10.5))); // expected-warning{{'unavailable' availability overrides all other availability information}}
+void f7() __attribute__((availability(macosx,message=L"wide"))); // expected-error {{expected string literal for optional message in 'availability' attribute}}
+
// rdar://10095131
enum E{
gorf __attribute__((availability(macosx,introduced=8.5, message = 10.0))), // expected-error {{expected string literal for optional message in 'availability' attribute}}
diff --git a/test/Parser/attributes.c b/test/Parser/attributes.c
index 347cb9c1bfbf..376ed2e7d2c9 100644
--- a/test/Parser/attributes.c
+++ b/test/Parser/attributes.c
@@ -58,7 +58,7 @@ void d2(void) __attribute__((noreturn)), d3(void) __attribute__((noreturn));
void __attribute__((returns_twice)) returns_twice_test();
int aligned(int);
-int __attribute__((vec_type_hint(char, aligned(16) )) missing_rparen_1; // expected-error {{expected ')'}}
+int __attribute__((vec_type_hint(char, aligned(16) )) missing_rparen_1; // expected-error 2{{expected ')'}} expected-note {{to match}} expected-warning {{does not declare anything}}
int __attribute__((mode(x aligned(16) )) missing_rparen_2; // expected-error {{expected ')'}}
int __attribute__((format(printf, 0 aligned(16) )) missing_rparen_3; // expected-error {{expected ')'}}
diff --git a/test/Parser/crash-report.c b/test/Parser/crash-report.c
index 42481aa7d003..6f3706299d1b 100644
--- a/test/Parser/crash-report.c
+++ b/test/Parser/crash-report.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s 2>&1 | FileCheck %s
+// RUN: not --crash %clang_cc1 %s 2>&1 | FileCheck %s
// REQUIRES: crash-recovery
#prag\
diff --git a/test/Parser/cxx-altivec.cpp b/test/Parser/cxx-altivec.cpp
index 9b2b1af22f6e..be00e494fd53 100644
--- a/test/Parser/cxx-altivec.cpp
+++ b/test/Parser/cxx-altivec.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -faltivec -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -faltivec -fsyntax-only -verify -std=c++11 %s
__vector char vv_c;
__vector signed char vv_sc;
@@ -168,3 +168,7 @@ public:
__vector float xyzw;
__vector float abcd;
} __attribute__((vecreturn)); // expected-error {{the vecreturn attribute can only be used on a class or structure with one member, which must be a vector}}
+
+template<typename... Args> void PR16874() {
+ (void) (Args::foo()...); // expected-error {{expression contains unexpanded parameter pack 'Args'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+}
diff --git a/test/Parser/cxx-ambig-init-templ.cpp b/test/Parser/cxx-ambig-init-templ.cpp
new file mode 100644
index 000000000000..ac79f77e152d
--- /dev/null
+++ b/test/Parser/cxx-ambig-init-templ.cpp
@@ -0,0 +1,171 @@
+// RUN: %clang_cc1 -Wno-uninitialized -std=c++11 -verify %s
+
+template<int> struct c { c(int) = delete; typedef void val; operator int() const; };
+
+int val;
+int foobar;
+struct S {
+ int k1 = a < b < c, d > ::val, e1;
+ int k2 = a < b, c < d > ::val, e2;
+ int k3 = b < a < c, d > ::val, e3;
+ int k4 = b < c, x, y = d > ::val, e4;
+ int k5 = T1 < b, &S::operator=(int); // expected-error {{extra qualification}}
+ int k6 = T2 < b, &S::operator= >::val;
+ int k7 = T1 < b, &S::operator>(int); // expected-error {{extra qualification}}
+ int k8 = T2 < b, &S::operator> >::val;
+ int k9 = T3 < a < b, c >> (d), e5 = 1 > (e4);
+ int k10 = 0 < T3 < a < b, c >> (d
+ ) // expected-error {{expected ';' at end of declaration}}
+ , a > (e4);
+ int k11 = 0 < 1, c<3>::*ptr;
+ int k12 = e < 0, int a<b<c>::* >(), e11;
+
+ void f1(
+ int k1 = a < b < c, d > ::val,
+ int k2 = b < a < c, d > ::val,
+ int k3 = b < c, int x = 0 > ::val,
+ int k4 = a < b, T3 < int > >(), // expected-error {{must be an expression}}
+ int k5 = a < b, c < d > ::val,
+ int k6 = a < b, c < d > (n) // expected-error {{undeclared identifier 'n'}}
+ );
+
+ void f2a(
+ // T3<int> here is a parameter type, so must be declared before it is used.
+ int k1 = c < b, T3 < int > x = 0 // expected-error {{unexpected end of default argument expression}}
+ );
+
+ template<typename, int=0> struct T3 { T3(int); operator int(); };
+
+ void f2b(
+ int k1 = c < b, T3 < int > x = 0 // ok
+ );
+
+ // This is a one-parameter function. Ensure we don't typo-correct it to
+ // int = a < b, c < foobar > ()
+ // ... which would be a function with two parameters.
+ int f3(int = a < b, c < goobar > ());
+ static constexpr int (S::*f3_test)(int) = &S::f3;
+
+ void f4(
+ int k1 = a<1,2>::val,
+ int missing_default // expected-error {{missing default argument on parameter}}
+ );
+
+ void f5(
+ int k1 = b < c,
+ int missing_default // expected-error {{missing default argument on parameter}}
+ );
+
+ void f6(
+ int k = b < c,
+ unsigned int (missing_default) // expected-error {{missing default argument on parameter}}
+ );
+
+ template<int, int=0> struct a { static const int val = 0; operator int(); }; // expected-note {{here}}
+ static const int b = 0, c = 1, d = 2, goobar = 3;
+ template<int, typename> struct e { operator int(); };
+
+ int mp1 = 0 < 1,
+ a<b<c,b<c>::*mp2,
+ mp3 = 0 > a<b<c>::val,
+ a<b<c,b<c>::*mp4 = 0,
+ a<b<c,b<c>::*mp5 {0},
+ a<b<c,b<c>::*mp6;
+
+ int np1 = e<0, int a<b<c,b<c>::*>();
+
+ static const int T1 = 4;
+ template<int, int &(S::*)(int)> struct T2 { static const int val = 0; };
+};
+
+namespace NoAnnotationTokens {
+ template<bool> struct Bool { Bool(int); };
+ static const bool in_class = false;
+
+ struct Test {
+ // Check we don't keep around a Bool<false> annotation token here.
+ int f(Bool<true> = X<Y, Bool<in_class> >(0));
+
+ // But it's OK if we do here.
+ int g(Bool<true> = Z<Y, Bool<in_class> = Bool<false>(0));
+
+ static const bool in_class = true;
+ template<int, typename U> using X = U;
+ static const int Y = 0, Z = 0;
+ };
+}
+
+namespace ImplicitInstantiation {
+ template<typename T> struct HasError { typename T::error error; }; // expected-error {{has no members}}
+
+ struct S {
+ // This triggers the instantiation of the outer HasError<int> during
+ // disambiguation, even though it uses the inner HasError<int>.
+ void f(int a = X<Y, HasError<int>::Z >()); // expected-note {{in instantiation of}}
+
+ template<typename, typename> struct X { operator int(); };
+ typedef int Y;
+ template<typename> struct HasError { typedef int Z; };
+ };
+
+ HasError<int> hei;
+}
+
+namespace CWG325 {
+ template <int A, typename B> struct T { static int i; operator int(); };
+ class C {
+ int Foo (int i = T<1, int>::i);
+ };
+
+ class D {
+ int Foo (int i = T<1, int>::i);
+ template <int A, typename B> struct T {static int i;};
+ };
+
+ const int a = 0;
+ typedef int b;
+ T<a,b> c;
+ struct E {
+ int n = T<a,b>(c);
+ };
+}
+
+namespace Operators {
+ struct Y {};
+ constexpr int operator,(const Y&, const Y&) { return 8; }
+ constexpr int operator>(const Y&, const Y&) { return 8; }
+ constexpr int operator<(const Y&, const Y&) { return 8; }
+ constexpr int operator>>(const Y&, const Y&) { return 8; }
+
+ struct X {
+ typedef int (*Fn)(const Y&, const Y&);
+
+ Fn a = operator,, b = operator<, c = operator>;
+ void f(Fn a = operator,, Fn b = operator<, Fn c = operator>);
+
+ int k1 = T1<0, operator<, operator>, operator<>::val, l1;
+ int k2 = T1<0, operator>, operator,, operator,>::val, l2;
+ int k3 = T2<0, operator,(Y{}, Y{}), operator<(Y{}, Y{})>::val, l3;
+ int k4 = T2<0, operator>(Y{}, Y{}), operator,(Y{}, Y{})>::val, l4;
+ int k5 = T3<0, operator>>>::val, l5;
+ int k6 = T4<0, T3<0, operator>>>>::val, l6;
+
+ template<int, Fn, Fn, Fn> struct T1 { enum { val }; };
+ template<int, int, int> struct T2 { enum { val }; };
+ template<int, Fn> struct T3 { enum { val }; };
+ template<int, typename T> struct T4 : T {};
+ };
+}
+
+namespace ElaboratedTypeSpecifiers {
+ struct S {
+ int f(int x = T<a, struct S>());
+ int g(int x = T<a, class __declspec() C>());
+ int h(int x = T<a, union __attribute__(()) U>());
+ int i(int x = T<a, enum E>());
+ int j(int x = T<a, struct S::template T<0, enum E>>());
+ template <int, typename> struct T { operator int(); };
+ static const int a = 0;
+ enum E {};
+ };
+}
diff --git a/test/Parser/cxx-attributes.cpp b/test/Parser/cxx-attributes.cpp
index 5ea0ce227595..6fd7f4f68a46 100644
--- a/test/Parser/cxx-attributes.cpp
+++ b/test/Parser/cxx-attributes.cpp
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// expected-no-diagnostics
class c {
virtual void f1(const char* a, ...)
@@ -8,3 +7,16 @@ class c {
__attribute__ (( __format__(__printf__,2,3) )) {}
};
+template <typename T> class X {
+ template <typename S> void X<S>::f() __attribute__((locks_excluded())); // expected-error{{nested name specifier 'X<S>::' for declaration does not refer into a class, class template or class template partial specialization}} \
+ // expected-warning{{attribute locks_excluded ignored, because it is not attached to a declaration}}
+};
+
+namespace PR17666 {
+ const int A = 1;
+ typedef int __attribute__((__aligned__(A))) T1;
+ int check1[__alignof__(T1) == 1 ? 1 : -1];
+
+ typedef int __attribute__((aligned(int(1)))) T1;
+ typedef int __attribute__((aligned(int))) T2; // expected-error {{expected '(' for function-style cast}}
+}
diff --git a/test/Parser/cxx-class-template-specialization.cpp b/test/Parser/cxx-class-template-specialization.cpp
new file mode 100644
index 000000000000..f94a85964a78
--- /dev/null
+++ b/test/Parser/cxx-class-template-specialization.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct A {
+ template<typename T>
+ void f();
+};
+class A::f<int>;
+// expected-error@-1 {{identifier followed by '<' indicates a class template specialization but 'f' refers to a function template}}
diff --git a/test/Parser/cxx-decl.cpp b/test/Parser/cxx-decl.cpp
index 41d305b17642..8c4c6175f5c5 100644
--- a/test/Parser/cxx-decl.cpp
+++ b/test/Parser/cxx-decl.cpp
@@ -108,9 +108,9 @@ template<class T>
class Class1;
class Class2 {
-} // no ;
+} // expected-error {{expected ';' after class}}
-typedef Class1<Class2> Type1; // expected-error {{cannot combine with previous 'class' declaration specifier}}
+typedef Class1<Class2> Type1;
// rdar : // 8307865
struct CodeCompleteConsumer {
@@ -187,6 +187,51 @@ namespace PR15017 {
// Ensure we produce at least some diagnostic for attributes in C++98.
[[]] struct S; // expected-error 2{{}}
+namespace test7 {
+ struct Foo {
+ void a();
+ void b();
+ };
+
+ void Foo::
+ // Comment!
+ a() {}
+
+
+ void Foo:: // expected-error {{expected unqualified-id}}
+ // Comment!
+}
+
+void test8() {
+ struct {} o;
+ // This used to crash.
+ (&o)->(); // expected-error{{expected unqualified-id}}
+}
+
+namespace PR5066 {
+ template<typename T> struct X {};
+ X<int N> x; // expected-error {{type-id cannot have a name}}
+
+ using T = int (*T)(); // expected-error {{type-id cannot have a name}} expected-warning {{C++11}}
+}
+
+namespace PR17255 {
+void foo() {
+ typename A::template B<>; // expected-error {{use of undeclared identifier 'A'}} \
+ // expected-error {{expected a qualified name after 'typename'}} \
+ // expected-warning {{'template' keyword outside of a template}}
+}
+}
+
+namespace PR17567 {
+ struct Foobar { // expected-note 2{{declared here}}
+ FooBar(); // expected-error {{missing return type for function 'FooBar'; did you mean the constructor name 'Foobar'?}}
+ ~FooBar(); // expected-error {{expected the class name after '~' to name a destructor}}
+ };
+ FooBar::FooBar() {} // expected-error {{undeclared}} expected-error {{missing return type}}
+ FooBar::~FooBar() {} // expected-error {{undeclared}} expected-error {{expected the class name}}
+}
+
// PR8380
extern "" // expected-error {{unknown linkage language}}
test6a { ;// expected-error {{C++ requires a type specifier for all declarations}} \
diff --git a/test/Parser/cxx-default-args.cpp b/test/Parser/cxx-default-args.cpp
index 7fe8474142ba..36abf0d8cb38 100644
--- a/test/Parser/cxx-default-args.cpp
+++ b/test/Parser/cxx-default-args.cpp
@@ -14,3 +14,20 @@ typedef struct Inst {
struct X {
void f(int x = 1:); // expected-error {{unexpected end of default argument expression}}
};
+
+// PR13657
+struct T {
+ template <typename A, typename B> struct T1 { enum {V};};
+ template <int A, int B> struct T2 { enum {V}; };
+ template <int, int> static int func(int);
+
+
+ void f1(T1<int, int> = T1<int, int>());
+ void f2(T1<int, double> = T1<int, double>(), T2<0, 5> = T2<0, 5>());
+ void f3(int a = T2<0, (T1<int, int>::V > 10) ? 5 : 6>::V, bool b = 4<5 );
+ void f4(bool a = 1 < 0, bool b = 2 > 0 );
+ void f5(bool a = 1 > T2<0, 0>::V, bool b = T1<int,int>::V < 3, int c = 0);
+ void f6(bool a = T2<0,3>::V < 4, bool b = 4 > T2<0,3>::V);
+ void f7(bool a = T1<int, bool>::V < 3);
+ void f8(int = func<0,1<2>(0), int = 1<0, T1<int,int>(int) = 0);
+};
diff --git a/test/Parser/cxx-friend.cpp b/test/Parser/cxx-friend.cpp
index a13e7babc534..a3b89cc688bb 100644
--- a/test/Parser/cxx-friend.cpp
+++ b/test/Parser/cxx-friend.cpp
@@ -30,6 +30,10 @@ class B {
void f(A *a) { a->f(); }
};
+void bar() {} // expected-note {{previous definition is here}}
+class E {
+ friend void bar() {} // expected-error {{redefinition of 'bar'}}
+};
diff --git a/test/Parser/cxx-member-crash.cpp b/test/Parser/cxx-member-crash.cpp
index 2b31a608a583..65e70954e043 100644
--- a/test/Parser/cxx-member-crash.cpp
+++ b/test/Parser/cxx-member-crash.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only %s 2>&1|FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s
// <rdar://problem/9221993>
-// We only care to chek whether the compiler crashes; the actual
+// We only care to check whether the compiler crashes; the actual
// diagnostics are uninteresting.
// CHECK: 8 errors generated.
template<class _CharT> struct char_traits;
diff --git a/test/Parser/cxx-member-initializers.cpp b/test/Parser/cxx-member-initializers.cpp
index 5c3906836c49..ff8c880a1849 100644
--- a/test/Parser/cxx-member-initializers.cpp
+++ b/test/Parser/cxx-member-initializers.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
struct x {
x() : a(4) ; // expected-error {{expected '{'}}
@@ -11,5 +11,71 @@ struct y {
struct z {
int a;
- z() : a {} // expected-error {{expected '('}}
-};
+ z() : a {}
+}; // expected-error {{expected '{'}}
+
+namespace PR16480 {
+ template<int n> struct X {
+ X();
+ X(int);
+ };
+
+ struct A : X<0> {
+ A() : X<a<b>{0}.n>() {}
+
+ template<int> struct a {
+ int n;
+ };
+
+ static const int b = 1;
+ };
+
+ struct B : X<0> {
+ B() : X<a<b>{0} {}
+
+ static const int a = 0, b = 0;
+ };
+
+ template<int> struct a {
+ constexpr a(int) {}
+ constexpr operator int() const { return 0; }
+ };
+
+ struct C : X<0> {
+ C() : X<a<b>(0)>() {}
+
+ static const int b = 0;
+ };
+
+ struct D : X<0> {
+ D() : X<a<b>(0) {}
+
+ static const int a = 0, b = 0;
+ };
+
+ template<typename T> struct E : X<0> {
+ E(X<0>) : X<(0)>{} {}
+ E(X<1>) : X<int{}>{} {}
+ E(X<2>) : X<(0)>() {}
+ E(X<3>) : X<int{}>() {}
+ };
+
+ // FIXME: This should be valid in the union of C99 and C++11.
+ struct F : X<0> {
+ F() : X<A<T>().n + (T){}.n>{} {} // expected-error +{{}}
+
+ struct T { int n; };
+ template<typename> struct A { int n; };
+ }; // expected-error +{{}}
+
+ // FIXME: This is valid now, but may be made ill-formed by DR1607.
+ struct G : X<0> {
+ G() : X<0 && [](){return 0;}()>{} // expected-error +{{}}
+ }; // expected-error +{{}}
+
+ struct Errs : X<0> {
+ Errs(X<0>) : decltype X<0>() {} // expected-error {{expected '(' after 'decltype'}}
+ Errs(X<1>) : what is this () {} // expected-error {{expected '(' or '{'}}
+ Errs(X<2>) : decltype(X<0> // expected-note {{to match this '('}}
+ }; // expected-error {{expected ')'}}
+}
diff --git a/test/Parser/cxx-template-argument.cpp b/test/Parser/cxx-template-argument.cpp
index afe318df7a1a..8bf2a4f78add 100644
--- a/test/Parser/cxx-template-argument.cpp
+++ b/test/Parser/cxx-template-argument.cpp
@@ -5,7 +5,7 @@ template<typename T> struct A {};
// Check for template argument lists followed by junk
// FIXME: The diagnostics here aren't great...
A<int+> int x; // expected-error {{expected '>'}} expected-error {{expected unqualified-id}}
-A<int x; // expected-error {{expected '>'}}
+A<int x; // expected-error {{type-id cannot have a name}} expected-error {{expected '>'}}
// PR8912
template <bool> struct S {};
@@ -42,3 +42,66 @@ namespace PR13210 {
new C(); // expected-error {{requires template arguments}}
}
}
+
+// Don't emit spurious messages
+namespace pr16225add {
+
+ template<class T1, typename T2> struct Known { }; // expected-note 3 {{template is declared here}}
+ template<class T1, typename T2> struct X;
+ template<class T1, typename T2> struct ABC; // expected-note {{template is declared here}}
+ template<int N1, int N2> struct ABC2 {};
+
+ template<class T1, typename T2> struct foo :
+ UnknownBase<T1,T2> // expected-error {{unknown template name 'UnknownBase'}}
+ { };
+
+ template<class T1, typename T2> struct foo2 :
+ UnknownBase<T1,T2>, // expected-error {{unknown template name 'UnknownBase'}}
+ Known<T1> // expected-error {{too few template arguments for class template 'Known'}}
+ { };
+
+ template<class T1, typename T2> struct foo3 :
+ UnknownBase<T1,T2,ABC<T2,T1> > // expected-error {{unknown template name 'UnknownBase'}}
+ { };
+
+ template<class T1, typename T2> struct foo4 :
+ UnknownBase<T1,ABC<T2> >, // expected-error {{unknown template name 'UnknownBase'}} \
+ // expected-error {{too few template arguments for class template 'ABC'}}
+ Known<T1> // expected-error {{too few template arguments for class template 'Known'}}
+ { };
+
+ template<class T1, typename T2> struct foo5 :
+ UnknownBase<T1,T2,ABC<T2,T1>> // expected-error {{unknown template name 'UnknownBase'}} \
+ // expected-error {{use '> >'}}
+ { };
+
+ template<class T1, typename T2> struct foo6 :
+ UnknownBase<T1,ABC<T2,T1>>, // expected-error {{unknown template name 'UnknownBase'}} \
+ // expected-error {{use '> >'}}
+ Known<T1> // expected-error {{too few template arguments for class template 'Known'}}
+ { };
+
+ template<class T1, typename T2, int N> struct foo7 :
+ UnknownBase<T1,T2,(N>1)> // expected-error {{unknown template name 'UnknownBase'}}
+ { };
+
+ template<class T1, typename T2> struct foo8 :
+ UnknownBase<X<int,int>,X<int,int>> // expected-error {{unknown template name 'UnknownBase'}} \
+ // expected-error {{use '> >'}}
+ { };
+
+ template<class T1, typename T2> struct foo9 :
+ UnknownBase<Known<int,int>,X<int,int>> // expected-error {{unknown template name 'UnknownBase'}} \
+ // expected-error {{use '> >'}}
+ { };
+
+ template<class T1, typename T2> struct foo10 :
+ UnknownBase<Known<int,int>,X<int,X<int,int>>> // expected-error {{unknown template name 'UnknownBase'}} \
+ // expected-error {{use '> >'}}
+ { };
+
+ template<int N1, int N2> struct foo11 :
+ UnknownBase<2<N1,N2<4> // expected-error {{unknown template name 'UnknownBase'}}
+ { };
+
+}
diff --git a/test/Parser/cxx-template-decl.cpp b/test/Parser/cxx-template-decl.cpp
index 7e931a31fa2d..81269ce25416 100644
--- a/test/Parser/cxx-template-decl.cpp
+++ b/test/Parser/cxx-template-decl.cpp
@@ -85,6 +85,19 @@ struct shadow5 {
int T(int, float); // expected-error{{shadows}}
};
+template<typename T, // expected-note{{template parameter is declared here}}
+ T T> // expected-error{{declaration of 'T' shadows template parameter}}
+void shadow6();
+
+template<typename T, // expected-note{{template parameter is declared here}}
+ template<typename> class T> // expected-error{{declaration of 'T' shadows template parameter}}
+void shadow7();
+
+// PR8302
+template<template<typename> class T> struct shadow8 { // expected-note{{template parameter is declared here}}
+ template<template<typename> class T> struct inner; // expected-error{{declaration of 'T' shadows template parameter}}
+};
+
// Non-type template parameters in scope
template<int Size>
void f(int& i) {
@@ -103,6 +116,7 @@ void f2() {
// PR3844
template <> struct S<int> { }; // expected-error{{explicit specialization of non-template struct 'S'}}
+template <> union U<int> { }; // expected-error{{explicit specialization of non-template union 'U'}}
namespace PR6184 {
namespace N {
diff --git a/test/Parser/cxx-using-directive.cpp b/test/Parser/cxx-using-directive.cpp
index 9a1a6de89267..5efd991c8e7a 100644
--- a/test/Parser/cxx-using-directive.cpp
+++ b/test/Parser/cxx-using-directive.cpp
@@ -4,11 +4,11 @@ class A {};
namespace B {
namespace A {} // expected-note{{namespace '::B::A' defined here}} \
- // expected-note{{namespace 'B::A' defined here}}
+ // expected-note 2{{namespace 'B::A' defined here}}
using namespace A ;
}
-namespace C {}
+namespace C {} // expected-note{{namespace 'C' defined here}}
namespace D {
@@ -22,12 +22,13 @@ namespace D {
using namespace C ;
using namespace B::A ; // expected-error{{no namespace named 'A' in namespace 'D::B'; did you mean '::B::A'?}}
using namespace ::B::A ;
- using namespace ::D::C ; // expected-error{{expected namespace name}}
+ using namespace ::D::F ; // expected-error{{expected namespace name}}
+ using namespace ::D::C ; // expected-error{{no namespace named 'C' in namespace 'D'; did you mean simply 'C'?}}
}
using namespace ! ; // expected-error{{expected namespace name}}
using namespace A ; // expected-error{{no namespace named 'A'; did you mean 'B::A'?}}
-using namespace ::A // expected-error{{expected namespace name}} \
+using namespace ::A // expected-error{{no namespace named 'A' in the global namespace; did you mean 'B::A'?}} \
// expected-error{{expected ';' after namespace name}}
B ;
diff --git a/test/Parser/cxx0x-attributes.cpp b/test/Parser/cxx0x-attributes.cpp
index 5e4e388a2645..b02add98457e 100644
--- a/test/Parser/cxx0x-attributes.cpp
+++ b/test/Parser/cxx0x-attributes.cpp
@@ -122,6 +122,24 @@ extern "C++" [[]] { } // expected-error {{an attribute list cannot appear here}}
[[unknown]] using namespace ns; // expected-warning {{unknown attribute 'unknown' ignored}}
[[noreturn]] using namespace ns; // expected-error {{'noreturn' attribute only applies to functions and methods}}
+using [[]] alignas(4) [[]] ns::i; // expected-error {{an attribute list cannot appear here}}
+using [[]] alignas(4) [[]] foobar = int; // expected-error {{an attribute list cannot appear here}} expected-error {{'alignas' attribute only applies to}}
+
+void bad_attributes_in_do_while() {
+ do {} while (
+ [[ns::i); // expected-error {{expected ']'}} \
+ // expected-note {{to match this '['}} \
+ // expected-error {{expected expression}}
+ do {} while (
+ [[a]b ns::i); // expected-error {{expected ']'}} \
+ // expected-note {{to match this '['}} \
+ // expected-error {{expected expression}}
+ do {} while (
+ [[ab]ab] ns::i); // expected-error {{an attribute list cannot appear here}}
+ do {} while ( // expected-note {{to match this '('}}
+ alignas(4 ns::i; // expected-note {{to match this '('}}
+} // expected-error 2{{expected ')'}} expected-error {{expected expression}}
+
[[]] using T = int; // expected-error {{an attribute list cannot appear here}}
using T [[]] = int; // ok
template<typename T> using U [[]] = T;
@@ -281,3 +299,23 @@ int v5()[[gnu::unused]]; // expected-warning {{attribute 'unused' ignored}}
[[attribute_declaration]]; // expected-warning {{unknown attribute 'attribute_declaration' ignored}}
[[noreturn]]; // expected-error {{'noreturn' attribute only applies to functions and methods}}
[[carries_dependency]]; // expected-error {{'carries_dependency' attribute only applies to functions, methods, and parameters}}
+
+class A {
+ A([[gnu::unused]] int a);
+};
+A::A([[gnu::unused]] int a) {}
+
+namespace GccConst {
+ // GCC's tokenizer treats const and __const as the same token.
+ [[gnu::const]] int *f1();
+ [[gnu::__const]] int *f2();
+ void f(const int *);
+ void g() { f(f1()); f(f2()); }
+}
+
+namespace GccASan {
+ __attribute__((no_address_safety_analysis)) void f1();
+ __attribute__((no_sanitize_address)) void f2();
+ [[gnu::no_address_safety_analysis]] void f3();
+ [[gnu::no_sanitize_address]] void f4();
+}
diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp
index e6cba726ab63..257c56c9ce98 100644
--- a/test/Parser/cxx0x-decl.cpp
+++ b/test/Parser/cxx0x-decl.cpp
@@ -73,3 +73,34 @@ enum E
[[]] e;
}
+
+namespace PR5066 {
+ using T = int (*f)(); // expected-error {{type-id cannot have a name}}
+ template<typename T> using U = int (*f)(); // expected-error {{type-id cannot have a name}}
+ auto f() -> int (*f)(); // expected-error {{type-id cannot have a name}}
+ auto g = []() -> int (*f)() {}; // expected-error {{type-id cannot have a name}}
+}
+
+namespace FinalOverride {
+ struct Base {
+ virtual void *f();
+ virtual void *g();
+ virtual void *h();
+ virtual void *i();
+ };
+ struct Derived : Base {
+ virtual auto f() -> void *final;
+ virtual auto g() -> void *override;
+ virtual auto h() -> void *final override;
+ virtual auto i() -> void *override final;
+ };
+}
+
+namespace UsingDeclAttrs {
+ using T __attribute__((aligned(1))) = int;
+ using T [[gnu::aligned(1)]] = int;
+ static_assert(alignof(T) == 1, "");
+
+ using [[gnu::aligned(1)]] T = int; // expected-error {{an attribute list cannot appear here}}
+ using T = int [[gnu::aligned(1)]]; // expected-error {{'aligned' attribute cannot be applied to types}}
+}
diff --git a/test/Parser/cxx0x-in-cxx98.cpp b/test/Parser/cxx0x-in-cxx98.cpp
index b4bda89d2781..724993811631 100644
--- a/test/Parser/cxx0x-in-cxx98.cpp
+++ b/test/Parser/cxx0x-in-cxx98.cpp
@@ -21,3 +21,10 @@ void NewBracedInitList() {
// A warning on this would be sufficient once we can handle it correctly.
new int {}; // expected-error {{}}
}
+
+struct Auto {
+ static int n;
+};
+auto Auto::n = 0; // expected-warning {{'auto' type specifier is a C++11 extension}}
+auto Auto::m = 0; // expected-error {{no member named 'm' in 'Auto'}}
+ // expected-warning@-1 {{'auto' type specifier is a C++11 extension}}
diff --git a/test/Parser/cxx0x-lambda-expressions.cpp b/test/Parser/cxx0x-lambda-expressions.cpp
index 642c69a532ee..289d03c223b3 100644
--- a/test/Parser/cxx0x-lambda-expressions.cpp
+++ b/test/Parser/cxx0x-lambda-expressions.cpp
@@ -48,4 +48,20 @@ class C {
delete [] { return new int; } (); // expected-error{{expected expression}}
delete [&] { return new int; } (); // ok, lambda
}
+
+ // We support init-captures in C++11 as an extension.
+ int z;
+ void init_capture() {
+ [n(0)] () mutable -> int { return ++n; }; // expected-warning{{extension}}
+ [n{0}] { return; }; // expected-error {{<initializer_list>}} expected-warning{{extension}}
+ [n = 0] { return ++n; }; // expected-error {{captured by copy in a non-mutable}} expected-warning{{extension}}
+ [n = {0}] { return; }; // expected-error {{<initializer_list>}} expected-warning{{extension}}
+ [a([&b = z]{})](){}; // expected-warning 2{{extension}}
+
+ int x = 4;
+ auto y = [&r = x, x = x + 1]() -> int { // expected-warning 2{{extension}}
+ r += 2;
+ return x + 2;
+ } ();
+ }
};
diff --git a/test/Parser/cxx0x-member-initializers.cpp b/test/Parser/cxx0x-member-initializers.cpp
index a324f974bcaf..43e99b133646 100644
--- a/test/Parser/cxx0x-member-initializers.cpp
+++ b/test/Parser/cxx0x-member-initializers.cpp
@@ -27,3 +27,13 @@ struct V1 {
int a, b;
V1() : a(), b{} {}
};
+
+template <typename, typename> struct T1 { enum {V};};
+template <int, int> struct T2 { enum {V};};
+struct A {
+ T1<int, int> a1 = T1<int, int>(), *a2 = new T1<int,int>;
+ T2<0,0> b1 = T2<0,0>(), b2 = T2<0,0>(), b3;
+ bool c1 = 1 < 2, c2 = 2 < 1, c3 = false;
+ bool d1 = T1<int, T1<int, int>>::V < 3, d2;
+ T1<int, int()> e = T1<int, int()>();
+};
diff --git a/test/Parser/cxx11-stmt-attributes.cpp b/test/Parser/cxx11-stmt-attributes.cpp
index 2f727a25bd7e..9374b58b1f24 100644
--- a/test/Parser/cxx11-stmt-attributes.cpp
+++ b/test/Parser/cxx11-stmt-attributes.cpp
@@ -76,4 +76,9 @@ void foo(int i) {
}
[[carries_dependency]] return; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
+
+ {
+ [[ ]] // expected-error {{an attribute list cannot appear here}}
+#pragma STDC FP_CONTRACT ON // expected-error {{can only appear at file scope or at the start of a compound statement}}
+ }
}
diff --git a/test/Parser/declarators.c b/test/Parser/declarators.c
index f63b59f7caa6..210a8e2befc7 100644
--- a/test/Parser/declarators.c
+++ b/test/Parser/declarators.c
@@ -108,7 +108,8 @@ void test18() {
}
enum E1 { e1 }: // expected-error {{expected ';'}}
-struct EnumBitfield {
+struct EnumBitfield { // expected-warning {{struct without named members is a GNU extension}}
enum E2 { e2 } : 4; // ok
struct S { int n; }: // expected-error {{expected ';'}}
+
};
diff --git a/test/Parser/expressions.c b/test/Parser/expressions.c
index 0d1b6c945c5c..95d6fb354f3f 100644
--- a/test/Parser/expressions.c
+++ b/test/Parser/expressions.c
@@ -57,3 +57,13 @@ void test7() {
({} // expected-note {{to match}}
; // expected-error {{expected ')'}}
}
+
+// PR16992
+struct pr16992 { int x; };
+
+void func_16992 () {
+ int x1 = sizeof int; // expected-error {{expected parentheses around type name in sizeof expression}}
+ int x2 = sizeof struct pr16992; // expected-error {{expected parentheses around type name in sizeof expression}}
+ int x3 = __alignof int; // expected-error {{expected parentheses around type name in __alignof expression}}
+ int x4 = _Alignof int; // expected-error {{expected parentheses around type name in _Alignof expression}}
+}
diff --git a/test/Parser/objc-diag-width.mm b/test/Parser/objc-diag-width.mm
index 3929ba2b090e..eba7a847de39 100644
--- a/test/Parser/objc-diag-width.mm
+++ b/test/Parser/objc-diag-width.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 %s 2>&1 | FileCheck %s
// Just shouldn't crash. -verify suppresses the crash, so don't use it.
// PR13417
diff --git a/test/Parser/objc-error-qualified-implementation.m b/test/Parser/objc-error-qualified-implementation.m
index 444fb5dab44c..8bbd50236027 100644
--- a/test/Parser/objc-error-qualified-implementation.m
+++ b/test/Parser/objc-error-qualified-implementation.m
@@ -19,3 +19,11 @@
@implementation K <P // expected-error {{@implementation declaration can not be protocol qualified}}
@end // expected-error {{expected '>'}}
+
+// rdar://13920026
+@implementation I (Cat) <P> // expected-error {{@implementation declaration can not be protocol qualified}}
+- (void) Meth {}
+@end
+
+@implementation I (Cat1) <P // expected-error {{@implementation declaration can not be protocol qualified}}
+@end // expected-error {{expected '>'}}
diff --git a/test/Parser/objcxx0x-lambda-expressions.mm b/test/Parser/objcxx0x-lambda-expressions.mm
index fb90b16a971f..bef576a9d204 100644
--- a/test/Parser/objcxx0x-lambda-expressions.mm
+++ b/test/Parser/objcxx0x-lambda-expressions.mm
@@ -1,9 +1,10 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -Wno-c++1y-extensions -std=c++11 %s
class C {
+ id get(int);
void f() {
- int foo, bar;
+ int foo, bar, baz;
// fail to parse as a lambda introducer, so we get objc message parsing errors instead
[foo,+] {}; // expected-error {{expected expression}}
@@ -17,6 +18,25 @@ class C {
[foo,bar] () { return 3; };
[=,&foo] () {};
[this] () {};
+
+ [foo(bar)] () {};
+ [foo = bar] () {};
+ [foo{bar}] () {}; // expected-error {{<initializer_list>}}
+ [foo = {bar}] () {}; // expected-error {{<initializer_list>}}
+
+ [foo(bar) baz] () {}; // expected-error {{called object type 'int' is not a function}}
+ [foo(bar), baz] () {}; // ok
+
+ [foo = bar baz]; // expected-warning {{receiver type 'int'}} expected-warning {{instance method '-baz'}}
+
+ [get(bar) baz]; // expected-warning {{instance method '-baz'}}
+ [get(bar), baz]; // expected-error {{expected body of lambda}}
+
+ [foo = bar ++ baz]; // expected-warning {{receiver type 'int'}} expected-warning {{instance method '-baz'}}
+ [foo = bar + baz]; // expected-error {{expected body of lambda}}
+ [foo = { bar, baz }]; // expected-error {{<initializer_list>}} expected-error {{expected body of lambda}}
+ [foo = { bar } baz ]; // expected-warning {{receiver type 'int'}} expected-warning {{instance method '-baz'}}
+ [foo = { bar }, baz ]; // expected-error {{<initializer_list>}} expected-error {{expected body of lambda}}
}
};
diff --git a/test/Parser/parser_overflow.c b/test/Parser/parser_overflow.c
index 7a3d6516af4e..9514e808550a 100644
--- a/test/Parser/parser_overflow.c
+++ b/test/Parser/parser_overflow.c
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 %s -fsyntax-only -DHUGE 2>&1 | FileCheck %s
-// RUN: %clang_cc1 %s -fsyntax-only 2>&1 | FileCheck %s
-// RUN: %clang_cc1 %s -fsyntax-only -fbracket-depth 299 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 %s -fsyntax-only -DHUGE 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 %s -fsyntax-only -fbracket-depth 299 2>&1 | FileCheck %s
// RUN: %clang_cc1 %s -fsyntax-only -fbracket-depth 300
-// RUN: %clang %s -fsyntax-only -fbracket-depth=299 2>&1 | FileCheck %s
+// RUN: not %clang %s -fsyntax-only -fbracket-depth=299 2>&1 | FileCheck %s
// RUN: %clang %s -fsyntax-only -fbracket-depth=300
void foo(void) {
diff --git a/test/Parser/pragma-fp-contract.c b/test/Parser/pragma-fp-contract.c
index 568c0a0a88ba..c80c140ea71f 100644
--- a/test/Parser/pragma-fp-contract.c
+++ b/test/Parser/pragma-fp-contract.c
@@ -2,7 +2,7 @@
void f1(void) {
int x = 0;
-/* expected-error@+1 {{'#pragma fp_contract' should only appear at file scope or at the start of a compound expression}} */
+/* expected-error@+1 {{'#pragma fp_contract' can only appear at file scope or at the start of a compound statement}} */
#pragma STDC FP_CONTRACT ON
}
diff --git a/test/Parser/pragma-weak.c b/test/Parser/pragma-weak.c
index 7e5740b48308..fd47dd8696b8 100644
--- a/test/Parser/pragma-weak.c
+++ b/test/Parser/pragma-weak.c
@@ -15,3 +15,30 @@ extern int z;
extern int a;
/* expected-warning {{extra tokens at end of '#pragma weak'}}*/ #pragma weak a b
/* expected-warning {{extra tokens at end of '#pragma weak'}}*/ #pragma weak a = x c
+
+
+void pragma_is_not_a_statement(int x)
+{
+ int t;
+
+ {
+ if (x)
+#pragma weak t
+ else // expected-error {{expected expression}}
+#pragma weak t
+ }
+
+ switch (x) {
+ case 1:
+#pragma weak t
+ } // expected-error {{expected statement}}
+ switch(x) {
+ default:
+#pragma weak t
+ } // expected-error {{expected statement}}
+
+label:
+#pragma weak t
+} // expected-error {{expected statement}}
+
+
diff --git a/test/Parser/recovery.cpp b/test/Parser/recovery.cpp
index 41845fb29158..b5b09484ad9e 100644
--- a/test/Parser/recovery.cpp
+++ b/test/Parser/recovery.cpp
@@ -12,7 +12,7 @@ inline namespace Std { // expected-error {{cannot be reopened as inline}}
int x;
Std::Important y;
-extenr "C" { // expected-error {{did you mean the keyword 'extern'}}
+extenr "C" { // expected-error {{did you mean 'extern'}}
void f();
}
void g() {
@@ -35,11 +35,27 @@ constexpr int foo();
5int m = { l }, n = m; // expected-error {{unqualified-id}}
+namespace MissingBrace {
+ struct S { // expected-error {{missing '}' at end of definition of 'MissingBrace::S'}}
+ int f();
+ // };
+
+ namespace N { int g(); } // expected-note {{still within definition of 'MissingBrace::S' here}}
+
+ int k1 = S().h(); // expected-error {{no member named 'h' in 'MissingBrace::S'}}
+ int k2 = S().f() + N::g();
+
+ template<typename T> struct PR17949 { // expected-error {{missing '}' at end of definition of 'MissingBrace::PR17949'}}
+
+ namespace X { // expected-note {{still within definition of 'MissingBrace::PR17949' here}}
+ }
+}
+
namespace N {
int
} // expected-error {{unqualified-id}}
-strcut Uuuu { // expected-error {{did you mean the keyword 'struct'}} \
+strcut Uuuu { // expected-error {{did you mean 'struct'}} \
// expected-note {{'Uuuu' declared here}}
} *u[3];
uuuu v; // expected-error {{did you mean 'Uuuu'}}
@@ -50,3 +66,56 @@ struct Redefined { // expected-note {{previous}}
struct Redefined { // expected-error {{redefinition}}
Redefined() {}
};
+
+struct MissingSemi5;
+namespace N {
+ typedef int afterMissingSemi4;
+ extern MissingSemi5 afterMissingSemi5;
+}
+
+struct MissingSemi1 {} // expected-error {{expected ';' after struct}}
+static int afterMissingSemi1();
+
+class MissingSemi2 {} // expected-error {{expected ';' after class}}
+MissingSemi1 *afterMissingSemi2;
+
+enum MissingSemi3 {} // expected-error {{expected ';' after enum}}
+::MissingSemi1 afterMissingSemi3;
+
+extern N::afterMissingSemi4 afterMissingSemi4b;
+union MissingSemi4 { MissingSemi4(int); } // expected-error {{expected ';' after union}}
+N::afterMissingSemi4 (afterMissingSemi4b);
+
+int afterMissingSemi5b;
+struct MissingSemi5 { MissingSemi5(int); } // ok, no missing ';' here
+N::afterMissingSemi5 (afterMissingSemi5b);
+
+template<typename T> struct MissingSemiT {
+} // expected-error {{expected ';' after struct}}
+MissingSemiT<int> msi;
+
+struct MissingSemiInStruct {
+ struct Inner1 {} // expected-error {{expected ';' after struct}}
+ static MissingSemi5 ms1;
+
+ struct Inner2 {} // ok, no missing ';' here
+ static MissingSemi1;
+
+ struct Inner3 {} // expected-error {{expected ';' after struct}}
+ static MissingSemi5 *p;
+};
+
+void MissingSemiInFunction() {
+ struct Inner1 {} // expected-error {{expected ';' after struct}}
+ if (true) {}
+
+ // FIXME: It would be nice to at least warn on this.
+ struct Inner2 { Inner2(int); } // ok, no missing ';' here
+ k = l;
+
+ struct Inner3 {} // expected-error {{expected ';' after struct}}
+ Inner1 i1;
+
+ struct Inner4 {} // ok, no missing ';' here
+ Inner5;
+}
diff --git a/test/Parser/switch-recovery.cpp b/test/Parser/switch-recovery.cpp
index 84ac0c899e55..63b580202af8 100644
--- a/test/Parser/switch-recovery.cpp
+++ b/test/Parser/switch-recovery.cpp
@@ -95,7 +95,7 @@ int test8( foo x ) {
}
// Stress test to make sure Clang doesn't crash.
-void test9(int x) {
+void test9(int x) { // expected-note {{'x' declared here}}
switch(x) {
case 1: return;
2: case; // expected-error {{expected 'case' keyword before expression}} \
@@ -104,8 +104,8 @@ void test9(int x) {
7: :x; // expected-error {{expected 'case' keyword before expression}} \
expected-error {{expected expression}}
8:: x; // expected-error {{expected ';' after expression}} \
- expected-error {{no member named 'x' in the global namespace}} \
- expected-warning {{expression result unused}}
+ expected-error {{no member named 'x' in the global namespace; did you mean simply 'x'?}} \
+ expected-warning 2 {{expression result unused}}
9:: :y; // expected-error {{expected ';' after expression}} \
expected-error {{expected unqualified-id}} \
expected-warning {{expression result unused}}
diff --git a/test/Preprocessor/_Pragma.c b/test/Preprocessor/_Pragma.c
index 0a83b149ff75..15725a422299 100644
--- a/test/Preprocessor/_Pragma.c
+++ b/test/Preprocessor/_Pragma.c
@@ -5,6 +5,9 @@ _Pragma ("GCC system_header") // expected-warning {{system_header ignored in ma
// rdar://6880630
_Pragma("#define macro") // expected-warning {{unknown pragma ignored}}
+_Pragma("") // expected-warning {{unknown pragma ignored}}
+_Pragma("message(\"foo \\\\\\\\ bar\")") // expected-warning {{foo \\ bar}}
+
#ifdef macro
#error #define invalid
#endif
diff --git a/test/Preprocessor/aarch64-target-features.c b/test/Preprocessor/aarch64-target-features.c
index 8bb8427c0d2d..9978f91e2605 100644
--- a/test/Preprocessor/aarch64-target-features.c
+++ b/test/Preprocessor/aarch64-target-features.c
@@ -1,28 +1,33 @@
// RUN: %clang -target aarch64-none-linux-gnu -x c -E -dM %s -o - | FileCheck %s
-// CHECK: __AARCH64EL__
-// CHECK-NOT: __AARCH_ADVSIMD_FP
-// CHECK-NOT: __AARCH_FEATURE_ADVSIMD
-// CHECK: __ARM_ACLE 101
+
+// CHECK: __AARCH64EL__ 1
+// CHECK: __ARM_64BIT_STATE 1
+// CHECK: __ARM_ACLE 200
+// CHECK: __ARM_ALIGN_MAX_STACK_PWR 4
// CHECK: __ARM_ARCH 8
+// CHECK: __ARM_ARCH_ISA_A64 1
// CHECK: __ARM_ARCH_PROFILE 'A'
// CHECK-NOT: __ARM_FEATURE_BIG_ENDIAN
// CHECK: __ARM_FEATURE_CLZ 1
+// CHECK-NOT: __ARM_FEATURE_CRYPTO 1
+// CHECK: __ARM_FEATURE_DIV 1
// CHECK: __ARM_FEATURE_FMA 1
-// CHECK: __ARM_FEATURE_LDREX 0xf
// CHECK: __ARM_FEATURE_UNALIGNED 1
// CHECK: __ARM_FP 0xe
-// CHECK-NOT: __ARM_FP_FAST
// CHECK: __ARM_FP16_FORMAT_IEEE 1
+// CHECK-NOT: __ARM_FP_FAST 1
// CHECK: __ARM_FP_FENV_ROUNDING 1
-// CHECK-NOT: __ARM_NEON_FP
-// CHECK-NOT: __ARM_NEON
-// CHECK: __ARM_SIZEOF_MINIMAL_ENUM 4
-// CHECK: __ARM_SIZEOF_WCHAR_T 4
-// CHECK: __aarch64__
+// CHECK-NOT: __ARM_NEON 1
+// CHECK-NOT: __ARM_NEON_FP 7
+// CHECK: __ARM_PCS_AAPCS64 1
+// CHECK-NOT: __ARM_SIZEOF_MINIMAL_ENUM 1
+// CHECK-NOT: __ARM_SIZEOF_WCHAR_T 2
+// RUN: %clang -target aarch64-none-linux-gnu -mfpu=crypto-neon-fp-armv8 -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CRYPTO %s
+// CHECK-CRYPTO: __ARM_FEATURE_CRYPTO 1
// RUN: %clang -target aarch64-none-linux-gnu -ffast-math -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-FASTMATH %s
-// CHECK-FASTMATH: __ARM_FP_FAST
+// CHECK-FASTMATH: __ARM_FP_FAST 1
// RUN: %clang -target aarch64-none-linux-gnu -fshort-wchar -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTWCHAR %s
// CHECK-SHORTWCHAR: __ARM_SIZEOF_WCHAR_T 2
@@ -30,3 +35,6 @@
// RUN: %clang -target aarch64-none-linux-gnu -fshort-enums -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTENUMS %s
// CHECK-SHORTENUMS: __ARM_SIZEOF_MINIMAL_ENUM 1
+// RUN: %clang -target aarch64-none-linux-gnu -mfpu=neon -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-NEON %s
+// CHECK-NEON: __ARM_NEON 1
+// CHECK-NEON: __ARM_NEON_FP 7
diff --git a/test/Preprocessor/arm-target-features.c b/test/Preprocessor/arm-target-features.c
new file mode 100644
index 000000000000..ae93a3da7c08
--- /dev/null
+++ b/test/Preprocessor/arm-target-features.c
@@ -0,0 +1,157 @@
+// RUN: %clang -target armv8a-none-linux-gnu -x c -E -dM %s -o - | FileCheck %s
+// CHECK: __ARMEL__ 1
+// CHECK: __ARM_ARCH 8
+// CHECK: __ARM_ARCH_8A__ 1
+// CHECK: __ARM_FEATURE_CRC32 1
+
+// RUN: %clang -target armv7a-none-linux-gnu -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-V7 %s
+// CHECK-V7: __ARMEL__ 1
+// CHECK-V7: __ARM_ARCH 7
+// CHECK-V7: __ARM_ARCH_7A__ 1
+// CHECK-NOT-V7: __ARM_FEATURE_CRC32
+
+// RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF %s
+// CHECK-V8-BAREHF: __ARMEL__ 1
+// CHECK-V8-BAREHF: __ARM_ARCH 8
+// CHECK-V8-BAREHF: __ARM_ARCH_8A__ 1
+// CHECK-V8-BAREHF: __ARM_FEATURE_CRC32 1
+// CHECK-V8-BAREHF: __ARM_NEON__ 1
+// CHECK-V8-BAREHF: __VFP_FP__ 1
+
+// RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=fp-armv8 -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF-FP %s
+// CHECK-V8-BAREHF-FP-NOT: __ARM_NEON__ 1
+// CHECK-V8-BAREHF-FP: __VFP_FP__ 1
+
+// RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=neon-fp-armv8 -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF-NEON-FP %s
+// RUN: %clang -target armv8a -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF-NEON-FP %s
+// CHECK-V8-BAREHF-NEON-FP: __ARM_NEON__ 1
+// CHECK-V8-BAREHF-NEON-FP: __VFP_FP__ 1
+
+// RUN: %clang -target armv8a -mnocrc -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-NOCRC %s
+// CHECK-V8-NOCRC-NOT: __ARM_FEATURE_CRC32 1
+
+// Check that -mhwdiv works properly for armv8/thumbv8 (enabled by default).
+
+// RUN: %clang -target armv8 -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8 %s
+// ARMV8:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv8 -mthumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8 %s
+// THUMBV8:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv8-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8-EABI %s
+// ARMV8-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv8-eabi -mthumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8-EABI %s
+// THUMBV8-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv8 -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=NONEHWDIV-ARMV8 %s
+// NONEHWDIV-ARMV8-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target armv8 -mthumb -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=NONEHWDIV-THUMBV8 %s
+// NONEHWDIV-THUMBV8-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target armv8 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBHWDIV-ARMV8 %s
+// THUMBHWDIV-ARMV8-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target armv8 -mthumb -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=ARMHWDIV-THUMBV8 %s
+// ARMHWDIV-THUMBV8-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target armv8a -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8A %s
+// ARMV8A:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv8a -mthumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8A %s
+// THUMBV8A:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=ARMV8A-EABI %s
+// ARMV8A-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8A-EABI %s
+// THUMBV8A-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
+
+
+// Test that -mhwdiv has the right effect for a target CPU which has hwdiv enabled by default.
+// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-ARM %s
+// DEFAULTHWDIV-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-THUMB %s
+// DEFAULTHWDIV-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv7 -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=ARMHWDIV-ARM %s
+// ARMHWDIV-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBHWDIV-THUMB %s
+// THUMBHWDIV-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-THUMBHWDIV-ARM %s
+// DEFAULTHWDIV-THUMBHWDIV-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-ARMHWDIV-THUMB %s
+// DEFAULTHWDIV-ARMHWDIV-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target arm -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-NONEHWDIV-ARM %s
+// DEFAULTHWDIV-NONEHWDIV-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-NONEHWDIV-THUMB %s
+// DEFAULTHWDIV-NONEHWDIV-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// FIXME: add check for further predefines
+// Test whether predefines are as expected when targeting cortex-a5.
+// RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5-ARM %s
+// A5-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5-THUMB %s
+// A5-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// Test whether predefines are as expected when targeting cortex-a8.
+// RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck --check-prefix=A8-ARM %s
+// A8-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck --check-prefix=A8-THUMB %s
+// A8-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// Test whether predefines are as expected when targeting cortex-a9.
+// RUN: %clang -target armv7 -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck --check-prefix=A9-ARM %s
+// A9-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck --check-prefix=A9-THUMB %s
+// A9-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// Test whether predefines are as expected when targeting cortex-a15.
+// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=A15-ARM %s
+// A15-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=A15-THUMB %s
+// A15-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// Test whether predefines are as expected when targeting swift.
+// RUN: %clang -target armv7s -mcpu=swift -x c -E -dM %s -o - | FileCheck --check-prefix=SWIFT-ARM %s
+// SWIFT-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv7s -mthumb -mcpu=swift -x c -E -dM %s -o - | FileCheck --check-prefix=SWIFT-THUMB %s
+// SWIFT-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// Test whether predefines are as expected when targeting cortex-a53.
+// RUN: %clang -target armv8 -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck --check-prefix=A53-ARM %s
+// A53-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck --check-prefix=A53-THUMB %s
+// A53-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// Test whether predefines are as expected when targeting cortex-r5.
+// RUN: %clang -target armv7 -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck --check-prefix=R5-ARM %s
+// R5-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-r5 -x c -E -dM %s -o - | FileCheck --check-prefix=R5-THUMB %s
+// R5-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// Test whether predefines are as expected when targeting cortex-m0.
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m0 -x c -E -dM %s -o - | FileCheck --check-prefix=M0-THUMB %s
+// M0-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// Test whether predefines are as expected when targeting cortex-m3.
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m3 -x c -E -dM %s -o - | FileCheck --check-prefix=M3-THUMB %s
+// M3-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// Test whether predefines are as expected when targeting cortex-m4.
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck --check-prefix=M4-THUMB %s
+// M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
diff --git a/test/Preprocessor/assembler-with-cpp.c b/test/Preprocessor/assembler-with-cpp.c
index a9c42940a310..f03cb06ea115 100644
--- a/test/Preprocessor/assembler-with-cpp.c
+++ b/test/Preprocessor/assembler-with-cpp.c
@@ -72,8 +72,15 @@
11: T11(b)
// CHECK-Identifiers-True: 11: #0
+// Universal character names can specify basic ascii and control characters
+12: \u0020\u0030\u0080\u0000
+// CHECK-Identifiers-False: 12: \u0020\u0030\u0080\u0000
// This should not crash
// rdar://8823139
# ##
// CHECK-Identifiers-False: # ##
+
+#define X(a) # # # 1
+X(1)
+// CHECK-Identifiers-False: # # # 1
diff --git a/test/Preprocessor/feature_tests.c b/test/Preprocessor/feature_tests.c
index 19d80468ab3f..5a2c300e6ee1 100644
--- a/test/Preprocessor/feature_tests.c
+++ b/test/Preprocessor/feature_tests.c
@@ -11,6 +11,7 @@
#if !__has_builtin(__builtin_huge_val) || \
!__has_builtin(__builtin_shufflevector) || \
+ !__has_builtin(__builtin_convertvector) || \
!__has_builtin(__builtin_trap) || \
!__has_builtin(__c11_atomic_init) || \
!__has_feature(attribute_analyzer_noreturn) || \
diff --git a/test/Preprocessor/has_attribute.c b/test/Preprocessor/has_attribute.c
index 711cf671cfea..555c2b3f9e22 100644
--- a/test/Preprocessor/has_attribute.c
+++ b/test/Preprocessor/has_attribute.c
@@ -34,3 +34,7 @@ int has_something_we_dont_have();
static int constFunction() __attribute__((const));
#endif
+// CHECK: has_no_volatile_attribute
+#if !__has_attribute(volatile)
+int has_no_volatile_attribute();
+#endif
diff --git a/test/Preprocessor/hash_line.c b/test/Preprocessor/hash_line.c
index 64edae0d9577..c4de9f04044e 100644
--- a/test/Preprocessor/hash_line.c
+++ b/test/Preprocessor/hash_line.c
@@ -1,11 +1,12 @@
// The 1 and # should not go on the same line.
// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
-// CHECK-NOT: 1{{.*}}#
// CHECK: {{^1$}}
-// CHECK-NOT: 1{{.*}}#
-// CHECK: {{^ #$}}
-// CHECK-NOT: 1{{.*}}#
-1
+// CHECK-NEXT: {{^ #$}}
+// CHECK-NEXT: {{^2$}}
+// CHECK-NEXT: {{^ #$}}
#define EMPTY
+#define IDENTITY(X) X
+1
EMPTY #
-
+2
+IDENTITY() #
diff --git a/test/Preprocessor/ifdef-recover.c b/test/Preprocessor/ifdef-recover.c
index 51d06d1f1b6e..3d652dc604d9 100644
--- a/test/Preprocessor/ifdef-recover.c
+++ b/test/Preprocessor/ifdef-recover.c
@@ -1,4 +1,4 @@
-/* RUN: %clang_cc1 -E %s 2>&1 >/dev/null | grep error: | count 3
+/* RUN: not %clang_cc1 -E %s 2>&1 >/dev/null | grep error: | count 3
*/
#ifdef
diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c
index 9671f7e23293..8486e94b3a73 100644
--- a/test/Preprocessor/init.c
+++ b/test/Preprocessor/init.c
@@ -49,6 +49,14 @@
// C99:#define __STRICT_ANSI__ 1
//
//
+// RUN: %clang_cc1 -std=c11 -E -dM < /dev/null | FileCheck -check-prefix C11 %s
+//
+// C11:#define __STDC_UTF_16__ 1
+// C11:#define __STDC_UTF_32__ 1
+// C11:#define __STDC_VERSION__ 201112L
+// C11:#define __STRICT_ANSI__ 1
+//
+//
// RUN: %clang_cc1 -E -dM < /dev/null | FileCheck -check-prefix COMMON %s
//
// COMMON:#define __CONSTANT_CFSTRINGS__ 1
@@ -144,7 +152,7 @@
// NONFRAGILE:#define __OBJC2__ 1
//
//
-// RUN: %clang_cc1 -O0 -E -dM < /dev/null | FileCheck -check-prefix O0 %s
+// RUN: %clang_cc1 -E -dM < /dev/null | FileCheck -check-prefix O0 %s
//
// O0:#define __NO_INLINE__ 1
// O0-NOT:#define __OPTIMIZE_SIZE__
@@ -504,6 +512,33 @@
// ARMEABIHARDFP:#define __arm 1
// ARMEABIHARDFP:#define __arm__ 1
+// RUN: %clang -target arm -arch armv7s -x c -E -dM %s -o - | FileCheck --check-prefix=ARM-DARWIN-NO-EABI %s
+// RUN: %clang -target arm -arch armv6m -x c -E -dM %s -o - | FileCheck --check-prefix=ARM-DARWIN-NO-EABI %s
+// RUN: %clang -target arm -arch armv7m -x c -E -dM %s -o - | FileCheck --check-prefix=ARM-DARWIN-NO-EABI %s
+// RUN: %clang -target arm -arch armv7em -x c -E -dM %s -o - | FileCheck --check-prefix=ARM-DARWIN-NO-EABI %s
+// RUN: %clang -target thumbv7-apple-darwin-eabi -arch armv7 -x c -E -dM %s -o - | FileCheck --check-prefix=ARM-DARWIN-NO-EABI %s
+// ARM-DARWIN-NO-EABI-NOT: #define __ARM_EABI__ 1
+
+// Check that -mhwdiv works properly for targets which don't have the hwdiv feature enabled by default.
+
+// RUN: %clang -target arm -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=ARMHWDIV-ARM %s
+// ARMHWDIV-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target arm -mthumb -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBHWDIV-THUMB %s
+// THUMBHWDIV-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// RUN: %clang -target arm -x c -E -dM %s -o - | FileCheck --check-prefix=ARM-FALSE %s
+// ARM-FALSE-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target arm -mthumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMB-FALSE %s
+// THUMB-FALSE-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target arm -mhwdiv=thumb -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBHWDIV-ARM-FALSE %s
+// THUMBHWDIV-ARM-FALSE-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// RUN: %clang -target arm -mthumb -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=ARMHWDIV-THUMB-FALSE %s
+// ARMHWDIV-THUMB-FALSE-NOT:#define __ARM_ARCH_EXT_IDIV__
+
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-none-none < /dev/null | FileCheck -check-prefix I386 %s
//
@@ -701,6 +736,112 @@
// I386-LINUX:#define __i386__ 1
// I386-LINUX:#define i386 1
//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-netbsd < /dev/null | FileCheck -check-prefix I386-NETBSD %s
+//
+// I386-NETBSD-NOT:#define _LP64
+// I386-NETBSD:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+// I386-NETBSD:#define __CHAR16_TYPE__ unsigned short
+// I386-NETBSD:#define __CHAR32_TYPE__ unsigned int
+// I386-NETBSD:#define __CHAR_BIT__ 8
+// I386-NETBSD:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// I386-NETBSD:#define __DBL_DIG__ 15
+// I386-NETBSD:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// I386-NETBSD:#define __DBL_HAS_DENORM__ 1
+// I386-NETBSD:#define __DBL_HAS_INFINITY__ 1
+// I386-NETBSD:#define __DBL_HAS_QUIET_NAN__ 1
+// I386-NETBSD:#define __DBL_MANT_DIG__ 53
+// I386-NETBSD:#define __DBL_MAX_10_EXP__ 308
+// I386-NETBSD:#define __DBL_MAX_EXP__ 1024
+// I386-NETBSD:#define __DBL_MAX__ 1.7976931348623157e+308
+// I386-NETBSD:#define __DBL_MIN_10_EXP__ (-307)
+// I386-NETBSD:#define __DBL_MIN_EXP__ (-1021)
+// I386-NETBSD:#define __DBL_MIN__ 2.2250738585072014e-308
+// I386-NETBSD:#define __DECIMAL_DIG__ 21
+// I386-NETBSD:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// I386-NETBSD:#define __FLT_DIG__ 6
+// I386-NETBSD:#define __FLT_EPSILON__ 1.19209290e-7F
+// I386-NETBSD:#define __FLT_EVAL_METHOD__ 2
+// I386-NETBSD:#define __FLT_HAS_DENORM__ 1
+// I386-NETBSD:#define __FLT_HAS_INFINITY__ 1
+// I386-NETBSD:#define __FLT_HAS_QUIET_NAN__ 1
+// I386-NETBSD:#define __FLT_MANT_DIG__ 24
+// I386-NETBSD:#define __FLT_MAX_10_EXP__ 38
+// I386-NETBSD:#define __FLT_MAX_EXP__ 128
+// I386-NETBSD:#define __FLT_MAX__ 3.40282347e+38F
+// I386-NETBSD:#define __FLT_MIN_10_EXP__ (-37)
+// I386-NETBSD:#define __FLT_MIN_EXP__ (-125)
+// I386-NETBSD:#define __FLT_MIN__ 1.17549435e-38F
+// I386-NETBSD:#define __FLT_RADIX__ 2
+// I386-NETBSD:#define __INT16_TYPE__ short
+// I386-NETBSD:#define __INT32_TYPE__ int
+// I386-NETBSD:#define __INT64_C_SUFFIX__ LL
+// I386-NETBSD:#define __INT64_TYPE__ long long int
+// I386-NETBSD:#define __INT8_TYPE__ char
+// I386-NETBSD:#define __INTMAX_MAX__ 9223372036854775807LL
+// I386-NETBSD:#define __INTMAX_TYPE__ long long int
+// I386-NETBSD:#define __INTMAX_WIDTH__ 64
+// I386-NETBSD:#define __INTPTR_TYPE__ int
+// I386-NETBSD:#define __INTPTR_WIDTH__ 32
+// I386-NETBSD:#define __INT_MAX__ 2147483647
+// I386-NETBSD:#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
+// I386-NETBSD:#define __LDBL_DIG__ 18
+// I386-NETBSD:#define __LDBL_EPSILON__ 1.08420217248550443401e-19L
+// I386-NETBSD:#define __LDBL_HAS_DENORM__ 1
+// I386-NETBSD:#define __LDBL_HAS_INFINITY__ 1
+// I386-NETBSD:#define __LDBL_HAS_QUIET_NAN__ 1
+// I386-NETBSD:#define __LDBL_MANT_DIG__ 64
+// I386-NETBSD:#define __LDBL_MAX_10_EXP__ 4932
+// I386-NETBSD:#define __LDBL_MAX_EXP__ 16384
+// I386-NETBSD:#define __LDBL_MAX__ 1.18973149535723176502e+4932L
+// I386-NETBSD:#define __LDBL_MIN_10_EXP__ (-4931)
+// I386-NETBSD:#define __LDBL_MIN_EXP__ (-16381)
+// I386-NETBSD:#define __LDBL_MIN__ 3.36210314311209350626e-4932L
+// I386-NETBSD:#define __LITTLE_ENDIAN__ 1
+// I386-NETBSD:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// I386-NETBSD:#define __LONG_MAX__ 2147483647L
+// I386-NETBSD-NOT:#define __LP64__
+// I386-NETBSD:#define __NO_MATH_INLINES 1
+// I386-NETBSD:#define __POINTER_WIDTH__ 32
+// I386-NETBSD:#define __PTRDIFF_TYPE__ int
+// I386-NETBSD:#define __PTRDIFF_WIDTH__ 32
+// I386-NETBSD:#define __REGISTER_PREFIX__
+// I386-NETBSD:#define __SCHAR_MAX__ 127
+// I386-NETBSD:#define __SHRT_MAX__ 32767
+// I386-NETBSD:#define __SIG_ATOMIC_WIDTH__ 32
+// I386-NETBSD:#define __SIZEOF_DOUBLE__ 8
+// I386-NETBSD:#define __SIZEOF_FLOAT__ 4
+// I386-NETBSD:#define __SIZEOF_INT__ 4
+// I386-NETBSD:#define __SIZEOF_LONG_DOUBLE__ 12
+// I386-NETBSD:#define __SIZEOF_LONG_LONG__ 8
+// I386-NETBSD:#define __SIZEOF_LONG__ 4
+// I386-NETBSD:#define __SIZEOF_POINTER__ 4
+// I386-NETBSD:#define __SIZEOF_PTRDIFF_T__ 4
+// I386-NETBSD:#define __SIZEOF_SHORT__ 2
+// I386-NETBSD:#define __SIZEOF_SIZE_T__ 4
+// I386-NETBSD:#define __SIZEOF_WCHAR_T__ 4
+// I386-NETBSD:#define __SIZEOF_WINT_T__ 4
+// I386-NETBSD:#define __SIZE_MAX__ 4294967295U
+// I386-NETBSD:#define __SIZE_TYPE__ unsigned int
+// I386-NETBSD:#define __SIZE_WIDTH__ 32
+// I386-NETBSD:#define __UINTMAX_TYPE__ long long unsigned int
+// I386-NETBSD:#define __USER_LABEL_PREFIX__
+// I386-NETBSD:#define __WCHAR_MAX__ 2147483647
+// I386-NETBSD:#define __WCHAR_TYPE__ int
+// I386-NETBSD:#define __WCHAR_WIDTH__ 32
+// I386-NETBSD:#define __WINT_TYPE__ int
+// I386-NETBSD:#define __WINT_WIDTH__ 32
+// I386-NETBSD:#define __i386 1
+// I386-NETBSD:#define __i386__ 1
+// I386-NETBSD:#define i386 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-netbsd -target-feature +sse2 < /dev/null | FileCheck -check-prefix I386-NETBSD-SSE %s
+// I386-NETBSD-SSE:#define __FLT_EVAL_METHOD__ 0
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-netbsd6 < /dev/null | FileCheck -check-prefix I386-NETBSD6 %s
+// I386-NETBSD6:#define __FLT_EVAL_METHOD__ 1
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-netbsd6 -target-feature +sse2 < /dev/null | FileCheck -check-prefix I386-NETBSD6-SSE %s
+// I386-NETBSD6-SSE:#define __FLT_EVAL_METHOD__ 1
+
+//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips-none-none < /dev/null | FileCheck -check-prefix MIPS32BE %s
//
// MIPS32BE:#define MIPSEB 1
@@ -709,6 +850,7 @@
// MIPS32BE:#define _MIPSEB 1
// MIPS32BE:#define _MIPS_ARCH "mips32"
// MIPS32BE:#define _MIPS_ARCH_MIPS32 1
+// MIPS32BE:#define _MIPS_FPSET 16
// MIPS32BE:#define _MIPS_SIM _ABIO32
// MIPS32BE:#define _MIPS_SZINT 32
// MIPS32BE:#define _MIPS_SZLONG 32
@@ -813,6 +955,7 @@
// MIPS32BE:#define __llvm__ 1
// MIPS32BE:#define __mips 1
// MIPS32BE:#define __mips__ 1
+// MIPS32BE:#define __mips_fpr 32
// MIPS32BE:#define __mips_hard_float 1
// MIPS32BE:#define __mips_o32 1
// MIPS32BE:#define _mips 1
@@ -826,6 +969,7 @@
// MIPS32EL:#define _MIPSEL 1
// MIPS32EL:#define _MIPS_ARCH "mips32"
// MIPS32EL:#define _MIPS_ARCH_MIPS32 1
+// MIPS32EL:#define _MIPS_FPSET 16
// MIPS32EL:#define _MIPS_SIM _ABIO32
// MIPS32EL:#define _MIPS_SZINT 32
// MIPS32EL:#define _MIPS_SZLONG 32
@@ -927,6 +1071,7 @@
// MIPS32EL:#define __llvm__ 1
// MIPS32EL:#define __mips 1
// MIPS32EL:#define __mips__ 1
+// MIPS32EL:#define __mips_fpr 32
// MIPS32EL:#define __mips_hard_float 1
// MIPS32EL:#define __mips_o32 1
// MIPS32EL:#define _mips 1
@@ -940,6 +1085,7 @@
// MIPS64BE:#define _MIPSEB 1
// MIPS64BE:#define _MIPS_ARCH "mips64"
// MIPS64BE:#define _MIPS_ARCH_MIPS64 1
+// MIPS64BE:#define _MIPS_FPSET 32
// MIPS64BE:#define _MIPS_SIM _ABI64
// MIPS64BE:#define _MIPS_SZINT 32
// MIPS64BE:#define _MIPS_SZLONG 64
@@ -1043,6 +1189,7 @@
// MIPS64BE:#define __mips64 1
// MIPS64BE:#define __mips64__ 1
// MIPS64BE:#define __mips__ 1
+// MIPS64BE:#define __mips_fpr 64
// MIPS64BE:#define __mips_hard_float 1
// MIPS64BE:#define __mips_n64 1
// MIPS64BE:#define _mips 1
@@ -1056,6 +1203,7 @@
// MIPS64EL:#define _MIPSEL 1
// MIPS64EL:#define _MIPS_ARCH "mips64"
// MIPS64EL:#define _MIPS_ARCH_MIPS64 1
+// MIPS64EL:#define _MIPS_FPSET 32
// MIPS64EL:#define _MIPS_SIM _ABI64
// MIPS64EL:#define _MIPS_SZINT 32
// MIPS64EL:#define _MIPS_SZLONG 64
@@ -1159,6 +1307,7 @@
// MIPS64EL:#define __mips64 1
// MIPS64EL:#define __mips64__ 1
// MIPS64EL:#define __mips__ 1
+// MIPS64EL:#define __mips_fpr 64
// MIPS64EL:#define __mips_hard_float 1
// MIPS64EL:#define __mips_n64 1
// MIPS64EL:#define _mips 1
@@ -1224,6 +1373,46 @@
// MIPS-DSPR2:#define __mips_dsp_rev 2
// MIPS-DSPR2:#define __mips_dspr2 1
//
+// RUN: %clang_cc1 -target-feature +msa \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS-MSA %s
+// MIPS-MSA:#define __mips_msa 1
+//
+// RUN: %clang_cc1 -target-feature +nan2008 \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS-NAN2008 %s
+// MIPS-NAN2008:#define __mips_nan2008 1
+//
+// RUN: %clang_cc1 -target-feature -fp64 \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS32-MFP32 %s
+// MIPS32-MFP32:#define _MIPS_FPSET 16
+// MIPS32-MFP32:#define __mips_fpr 32
+//
+// RUN: %clang_cc1 -target-feature +fp64 \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS32-MFP64 %s
+// MIPS32-MFP64:#define _MIPS_FPSET 32
+// MIPS32-MFP64:#define __mips_fpr 64
+//
+// RUN: %clang_cc1 -target-feature +single-float \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS32-MFP32SF %s
+// MIPS32-MFP32SF:#define _MIPS_FPSET 32
+// MIPS32-MFP32SF:#define __mips_fpr 32
+//
+// RUN: %clang_cc1 -target-feature +fp64 \
+// RUN: -E -dM -triple=mips64-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS64-MFP64 %s
+// MIPS64-MFP64:#define _MIPS_FPSET 32
+// MIPS64-MFP64:#define __mips_fpr 64
+//
+// RUN: %clang_cc1 -target-feature -fp64 -target-feature +single-float \
+// RUN: -E -dM -triple=mips64-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS64-NOMFP64 %s
+// MIPS64-NOMFP64:#define _MIPS_FPSET 32
+// MIPS64-NOMFP64:#define __mips_fpr 32
+//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=msp430-none-none < /dev/null | FileCheck -check-prefix MSP430 %s
//
// MSP430:#define MSP430 1
@@ -1265,10 +1454,10 @@
// 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
-// MSP430:#define __INTMAX_WIDTH__ 32
-// MSP430:#define __INTPTR_TYPE__ short
+// MSP430:#define __INTMAX_MAX__ 9223372036854775807LL
+// MSP430:#define __INTMAX_TYPE__ long long int
+// MSP430:#define __INTMAX_WIDTH__ 64
+// MSP430:#define __INTPTR_TYPE__ int
// MSP430:#define __INTPTR_WIDTH__ 16
// MSP430:#define __INT_MAX__ 32767
// MSP430:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
@@ -1309,7 +1498,7 @@
// MSP430:#define __SIZE_MAX__ 65535U
// MSP430:#define __SIZE_TYPE__ unsigned int
// MSP430:#define __SIZE_WIDTH__ 16
-// MSP430:#define __UINTMAX_TYPE__ long unsigned int
+// MSP430:#define __UINTMAX_TYPE__ long long unsigned int
// MSP430:#define __USER_LABEL_PREFIX__ _
// MSP430:#define __WCHAR_MAX__ 32767
// MSP430:#define __WCHAR_TYPE__ int
@@ -1585,6 +1774,7 @@
// PPC603E:#define __NATURAL_ALIGNMENT__ 1
// PPC603E:#define __POINTER_WIDTH__ 32
// PPC603E:#define __POWERPC__ 1
+// PPC603E:#define __PPC__ 1
// PPC603E:#define __PTRDIFF_TYPE__ long int
// PPC603E:#define __PTRDIFF_WIDTH__ 32
// PPC603E:#define __REGISTER_PREFIX__
@@ -1694,6 +1884,8 @@
// PPC64:#define __NATURAL_ALIGNMENT__ 1
// PPC64:#define __POINTER_WIDTH__ 64
// PPC64:#define __POWERPC__ 1
+// PPC64:#define __PPC64__ 1
+// PPC64:#define __PPC__ 1
// PPC64:#define __PTRDIFF_TYPE__ long int
// PPC64:#define __PTRDIFF_WIDTH__ 64
// PPC64:#define __REGISTER_PREFIX__
@@ -1725,6 +1917,119 @@
// PPC64:#define __ppc64__ 1
// PPC64:#define __ppc__ 1
//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64le-none-none -target-cpu pwr7 -fno-signed-char < /dev/null | FileCheck -check-prefix PPC64LE %s
+//
+// PPC64LE:#define _ARCH_PPC 1
+// PPC64LE:#define _ARCH_PPC64 1
+// PPC64LE:#define _ARCH_PPCGR 1
+// PPC64LE:#define _ARCH_PPCSQ 1
+// PPC64LE:#define _ARCH_PWR4 1
+// PPC64LE:#define _ARCH_PWR5 1
+// PPC64LE:#define _ARCH_PWR5X 1
+// PPC64LE:#define _ARCH_PWR6 1
+// PPC64LE:#define _ARCH_PWR6X 1
+// PPC64LE:#define _ARCH_PWR7 1
+// PPC64LE:#define _LITTLE_ENDIAN 1
+// PPC64LE:#define _LP64 1
+// PPC64LE:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+// PPC64LE:#define __CHAR16_TYPE__ unsigned short
+// PPC64LE:#define __CHAR32_TYPE__ unsigned int
+// PPC64LE:#define __CHAR_BIT__ 8
+// PPC64LE:#define __CHAR_UNSIGNED__ 1
+// PPC64LE:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// PPC64LE:#define __DBL_DIG__ 15
+// PPC64LE:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// PPC64LE:#define __DBL_HAS_DENORM__ 1
+// PPC64LE:#define __DBL_HAS_INFINITY__ 1
+// PPC64LE:#define __DBL_HAS_QUIET_NAN__ 1
+// PPC64LE:#define __DBL_MANT_DIG__ 53
+// PPC64LE:#define __DBL_MAX_10_EXP__ 308
+// PPC64LE:#define __DBL_MAX_EXP__ 1024
+// PPC64LE:#define __DBL_MAX__ 1.7976931348623157e+308
+// PPC64LE:#define __DBL_MIN_10_EXP__ (-307)
+// PPC64LE:#define __DBL_MIN_EXP__ (-1021)
+// PPC64LE:#define __DBL_MIN__ 2.2250738585072014e-308
+// PPC64LE:#define __DECIMAL_DIG__ 33
+// PPC64LE:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// PPC64LE:#define __FLT_DIG__ 6
+// PPC64LE:#define __FLT_EPSILON__ 1.19209290e-7F
+// PPC64LE:#define __FLT_EVAL_METHOD__ 0
+// PPC64LE:#define __FLT_HAS_DENORM__ 1
+// PPC64LE:#define __FLT_HAS_INFINITY__ 1
+// PPC64LE:#define __FLT_HAS_QUIET_NAN__ 1
+// PPC64LE:#define __FLT_MANT_DIG__ 24
+// PPC64LE:#define __FLT_MAX_10_EXP__ 38
+// PPC64LE:#define __FLT_MAX_EXP__ 128
+// PPC64LE:#define __FLT_MAX__ 3.40282347e+38F
+// PPC64LE:#define __FLT_MIN_10_EXP__ (-37)
+// PPC64LE:#define __FLT_MIN_EXP__ (-125)
+// PPC64LE:#define __FLT_MIN__ 1.17549435e-38F
+// PPC64LE:#define __FLT_RADIX__ 2
+// PPC64LE:#define __INT16_TYPE__ short
+// PPC64LE:#define __INT32_TYPE__ int
+// PPC64LE:#define __INT64_C_SUFFIX__ L
+// PPC64LE:#define __INT64_TYPE__ long int
+// PPC64LE:#define __INT8_TYPE__ char
+// PPC64LE:#define __INTMAX_MAX__ 9223372036854775807L
+// PPC64LE:#define __INTMAX_TYPE__ long int
+// PPC64LE:#define __INTMAX_WIDTH__ 64
+// PPC64LE:#define __INTPTR_TYPE__ long int
+// PPC64LE:#define __INTPTR_WIDTH__ 64
+// PPC64LE:#define __INT_MAX__ 2147483647
+// PPC64LE:#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
+// PPC64LE:#define __LDBL_DIG__ 31
+// PPC64LE:#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
+// PPC64LE:#define __LDBL_HAS_DENORM__ 1
+// PPC64LE:#define __LDBL_HAS_INFINITY__ 1
+// PPC64LE:#define __LDBL_HAS_QUIET_NAN__ 1
+// PPC64LE:#define __LDBL_MANT_DIG__ 106
+// PPC64LE:#define __LDBL_MAX_10_EXP__ 308
+// PPC64LE:#define __LDBL_MAX_EXP__ 1024
+// PPC64LE:#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
+// PPC64LE:#define __LDBL_MIN_10_EXP__ (-291)
+// PPC64LE:#define __LDBL_MIN_EXP__ (-968)
+// PPC64LE:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
+// PPC64LE:#define __LITTLE_ENDIAN__ 1
+// PPC64LE:#define __LONG_DOUBLE_128__ 1
+// PPC64LE:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// PPC64LE:#define __LONG_MAX__ 9223372036854775807L
+// PPC64LE:#define __LP64__ 1
+// PPC64LE:#define __NATURAL_ALIGNMENT__ 1
+// PPC64LE:#define __POINTER_WIDTH__ 64
+// PPC64LE:#define __POWERPC__ 1
+// PPC64LE:#define __PPC64__ 1
+// PPC64LE:#define __PPC__ 1
+// PPC64LE:#define __PTRDIFF_TYPE__ long int
+// PPC64LE:#define __PTRDIFF_WIDTH__ 64
+// PPC64LE:#define __REGISTER_PREFIX__
+// PPC64LE:#define __SCHAR_MAX__ 127
+// PPC64LE:#define __SHRT_MAX__ 32767
+// PPC64LE:#define __SIG_ATOMIC_WIDTH__ 32
+// PPC64LE:#define __SIZEOF_DOUBLE__ 8
+// PPC64LE:#define __SIZEOF_FLOAT__ 4
+// PPC64LE:#define __SIZEOF_INT__ 4
+// PPC64LE:#define __SIZEOF_LONG_DOUBLE__ 16
+// PPC64LE:#define __SIZEOF_LONG_LONG__ 8
+// PPC64LE:#define __SIZEOF_LONG__ 8
+// PPC64LE:#define __SIZEOF_POINTER__ 8
+// PPC64LE:#define __SIZEOF_PTRDIFF_T__ 8
+// PPC64LE:#define __SIZEOF_SHORT__ 2
+// PPC64LE:#define __SIZEOF_SIZE_T__ 8
+// PPC64LE:#define __SIZEOF_WCHAR_T__ 4
+// PPC64LE:#define __SIZEOF_WINT_T__ 4
+// PPC64LE:#define __SIZE_MAX__ 18446744073709551615UL
+// PPC64LE:#define __SIZE_TYPE__ long unsigned int
+// PPC64LE:#define __SIZE_WIDTH__ 64
+// PPC64LE:#define __UINTMAX_TYPE__ long unsigned int
+// PPC64LE:#define __USER_LABEL_PREFIX__ _
+// PPC64LE:#define __WCHAR_MAX__ 2147483647
+// PPC64LE:#define __WCHAR_TYPE__ int
+// PPC64LE:#define __WCHAR_WIDTH__ 32
+// PPC64LE:#define __WINT_TYPE__ int
+// PPC64LE:#define __WINT_WIDTH__ 32
+// PPC64LE:#define __ppc64__ 1
+// PPC64LE:#define __ppc__ 1
+//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu a2q -fno-signed-char < /dev/null | FileCheck -check-prefix PPCA2Q %s
//
// PPCA2Q:#define _ARCH_A2 1
@@ -1957,6 +2262,8 @@
// PPC64-LINUX:#define __NATURAL_ALIGNMENT__ 1
// PPC64-LINUX:#define __POINTER_WIDTH__ 64
// PPC64-LINUX:#define __POWERPC__ 1
+// PPC64-LINUX:#define __PPC64__ 1
+// PPC64-LINUX:#define __PPC__ 1
// PPC64-LINUX:#define __PTRDIFF_TYPE__ long int
// PPC64-LINUX:#define __PTRDIFF_WIDTH__ 64
// PPC64-LINUX:#define __REGISTER_PREFIX__
@@ -2062,6 +2369,7 @@
// PPC:#define __NATURAL_ALIGNMENT__ 1
// PPC:#define __POINTER_WIDTH__ 32
// PPC:#define __POWERPC__ 1
+// PPC:#define __PPC__ 1
// PPC:#define __PTRDIFF_TYPE__ long int
// PPC:#define __PTRDIFF_WIDTH__ 32
// PPC:#define __REGISTER_PREFIX__
@@ -2163,6 +2471,7 @@
// PPC-LINUX:#define __NATURAL_ALIGNMENT__ 1
// PPC-LINUX:#define __POINTER_WIDTH__ 32
// PPC-LINUX:#define __POWERPC__ 1
+// PPC-LINUX:#define __PPC__ 1
// PPC-LINUX:#define __PTRDIFF_TYPE__ int
// PPC-LINUX:#define __PTRDIFF_WIDTH__ 32
// PPC-LINUX:#define __REGISTER_PREFIX__
@@ -2195,6 +2504,113 @@
// PPC-LINUX:#define __powerpc__ 1
// PPC-LINUX:#define __ppc__ 1
//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-apple-darwin8 < /dev/null | FileCheck -check-prefix PPC-DARWIN %s
+//
+// PPC-DARWIN:#define _ARCH_PPC 1
+// PPC-DARWIN:#define _BIG_ENDIAN 1
+// PPC-DARWIN:#define __BIG_ENDIAN__ 1
+// PPC-DARWIN:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
+// PPC-DARWIN:#define __CHAR16_TYPE__ unsigned short
+// PPC-DARWIN:#define __CHAR32_TYPE__ unsigned int
+// PPC-DARWIN:#define __CHAR_BIT__ 8
+// PPC-DARWIN:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// PPC-DARWIN:#define __DBL_DIG__ 15
+// PPC-DARWIN:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// PPC-DARWIN:#define __DBL_HAS_DENORM__ 1
+// PPC-DARWIN:#define __DBL_HAS_INFINITY__ 1
+// PPC-DARWIN:#define __DBL_HAS_QUIET_NAN__ 1
+// PPC-DARWIN:#define __DBL_MANT_DIG__ 53
+// PPC-DARWIN:#define __DBL_MAX_10_EXP__ 308
+// PPC-DARWIN:#define __DBL_MAX_EXP__ 1024
+// PPC-DARWIN:#define __DBL_MAX__ 1.7976931348623157e+308
+// PPC-DARWIN:#define __DBL_MIN_10_EXP__ (-307)
+// PPC-DARWIN:#define __DBL_MIN_EXP__ (-1021)
+// PPC-DARWIN:#define __DBL_MIN__ 2.2250738585072014e-308
+// PPC-DARWIN:#define __DECIMAL_DIG__ 33
+// PPC-DARWIN:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// PPC-DARWIN:#define __FLT_DIG__ 6
+// PPC-DARWIN:#define __FLT_EPSILON__ 1.19209290e-7F
+// PPC-DARWIN:#define __FLT_EVAL_METHOD__ 0
+// PPC-DARWIN:#define __FLT_HAS_DENORM__ 1
+// PPC-DARWIN:#define __FLT_HAS_INFINITY__ 1
+// PPC-DARWIN:#define __FLT_HAS_QUIET_NAN__ 1
+// PPC-DARWIN:#define __FLT_MANT_DIG__ 24
+// PPC-DARWIN:#define __FLT_MAX_10_EXP__ 38
+// PPC-DARWIN:#define __FLT_MAX_EXP__ 128
+// PPC-DARWIN:#define __FLT_MAX__ 3.40282347e+38F
+// PPC-DARWIN:#define __FLT_MIN_10_EXP__ (-37)
+// PPC-DARWIN:#define __FLT_MIN_EXP__ (-125)
+// PPC-DARWIN:#define __FLT_MIN__ 1.17549435e-38F
+// PPC-DARWIN:#define __FLT_RADIX__ 2
+// PPC-DARWIN:#define __INT16_TYPE__ short
+// PPC-DARWIN:#define __INT32_TYPE__ int
+// PPC-DARWIN:#define __INT64_C_SUFFIX__ LL
+// PPC-DARWIN:#define __INT64_TYPE__ long long int
+// PPC-DARWIN:#define __INT8_TYPE__ char
+// PPC-DARWIN:#define __INTMAX_MAX__ 9223372036854775807LL
+// PPC-DARWIN:#define __INTMAX_TYPE__ long long int
+// PPC-DARWIN:#define __INTMAX_WIDTH__ 64
+// PPC-DARWIN:#define __INTPTR_TYPE__ long int
+// PPC-DARWIN:#define __INTPTR_WIDTH__ 32
+// PPC-DARWIN:#define __INT_MAX__ 2147483647
+// PPC-DARWIN:#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
+// PPC-DARWIN:#define __LDBL_DIG__ 31
+// PPC-DARWIN:#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
+// PPC-DARWIN:#define __LDBL_HAS_DENORM__ 1
+// PPC-DARWIN:#define __LDBL_HAS_INFINITY__ 1
+// PPC-DARWIN:#define __LDBL_HAS_QUIET_NAN__ 1
+// PPC-DARWIN:#define __LDBL_MANT_DIG__ 106
+// PPC-DARWIN:#define __LDBL_MAX_10_EXP__ 308
+// PPC-DARWIN:#define __LDBL_MAX_EXP__ 1024
+// PPC-DARWIN:#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
+// PPC-DARWIN:#define __LDBL_MIN_10_EXP__ (-291)
+// PPC-DARWIN:#define __LDBL_MIN_EXP__ (-968)
+// PPC-DARWIN:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
+// PPC-DARWIN:#define __LONG_DOUBLE_128__ 1
+// PPC-DARWIN:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// PPC-DARWIN:#define __LONG_MAX__ 2147483647L
+// PPC-DARWIN:#define __MACH__ 1
+// PPC-DARWIN:#define __NATURAL_ALIGNMENT__ 1
+// PPC-DARWIN:#define __ORDER_BIG_ENDIAN__ 4321
+// PPC-DARWIN:#define __ORDER_LITTLE_ENDIAN__ 1234
+// PPC-DARWIN:#define __ORDER_PDP_ENDIAN__ 3412
+// PPC-DARWIN:#define __POINTER_WIDTH__ 32
+// PPC-DARWIN:#define __POWERPC__ 1
+// PPC-DARWIN:#define __PPC__ 1
+// PPC-DARWIN:#define __PTRDIFF_TYPE__ int
+// PPC-DARWIN:#define __PTRDIFF_WIDTH__ 32
+// PPC-DARWIN:#define __REGISTER_PREFIX__
+// PPC-DARWIN:#define __SCHAR_MAX__ 127
+// PPC-DARWIN:#define __SHRT_MAX__ 32767
+// PPC-DARWIN:#define __SIG_ATOMIC_WIDTH__ 32
+// PPC-DARWIN:#define __SIZEOF_DOUBLE__ 8
+// PPC-DARWIN:#define __SIZEOF_FLOAT__ 4
+// PPC-DARWIN:#define __SIZEOF_INT__ 4
+// PPC-DARWIN:#define __SIZEOF_LONG_DOUBLE__ 16
+// PPC-DARWIN:#define __SIZEOF_LONG_LONG__ 8
+// PPC-DARWIN:#define __SIZEOF_LONG__ 4
+// PPC-DARWIN:#define __SIZEOF_POINTER__ 4
+// PPC-DARWIN:#define __SIZEOF_PTRDIFF_T__ 4
+// PPC-DARWIN:#define __SIZEOF_SHORT__ 2
+// PPC-DARWIN:#define __SIZEOF_SIZE_T__ 4
+// PPC-DARWIN:#define __SIZEOF_WCHAR_T__ 4
+// PPC-DARWIN:#define __SIZEOF_WINT_T__ 4
+// PPC-DARWIN:#define __SIZE_MAX__ 4294967295UL
+// PPC-DARWIN:#define __SIZE_TYPE__ long unsigned int
+// PPC-DARWIN:#define __SIZE_WIDTH__ 32
+// PPC-DARWIN:#define __STDC_HOSTED__ 0
+// PPC-DARWIN:#define __STDC_VERSION__ 199901L
+// PPC-DARWIN:#define __STDC__ 1
+// PPC-DARWIN:#define __UINTMAX_TYPE__ long long unsigned int
+// PPC-DARWIN:#define __USER_LABEL_PREFIX__ _
+// PPC-DARWIN:#define __WCHAR_MAX__ 2147483647
+// PPC-DARWIN:#define __WCHAR_TYPE__ int
+// PPC-DARWIN:#define __WCHAR_WIDTH__ 32
+// PPC-DARWIN:#define __WINT_TYPE__ int
+// PPC-DARWIN:#define __WINT_WIDTH__ 32
+// PPC-DARWIN:#define __powerpc__ 1
+// PPC-DARWIN:#define __ppc__ 1
+//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=s390x-none-none -fno-signed-char < /dev/null | FileCheck -check-prefix S390X %s
//
// S390X:#define __CHAR16_TYPE__ unsigned short
@@ -2688,9 +3104,141 @@
// X86_64-LINUX:#define __x86_64 1
// X86_64-LINUX:#define __x86_64__ 1
//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-unknown-freebsd9.1 < /dev/null | FileCheck -check-prefix X86_64-FREEBSD %s
+//
+// X86_64-FREEBSD:#define __FreeBSD__ 9
+// X86_64-FREEBSD:#define __FreeBSD_cc_version 900001
+// X86_64-FREEBSD:#define __STDC_MB_MIGHT_NEQ_WC__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-netbsd < /dev/null | FileCheck -check-prefix X86_64-NETBSD %s
+//
+// X86_64-NETBSD:#define _LP64 1
+// X86_64-NETBSD:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+// X86_64-NETBSD:#define __CHAR16_TYPE__ unsigned short
+// X86_64-NETBSD:#define __CHAR32_TYPE__ unsigned int
+// X86_64-NETBSD:#define __CHAR_BIT__ 8
+// X86_64-NETBSD:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// X86_64-NETBSD:#define __DBL_DIG__ 15
+// X86_64-NETBSD:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// X86_64-NETBSD:#define __DBL_HAS_DENORM__ 1
+// X86_64-NETBSD:#define __DBL_HAS_INFINITY__ 1
+// X86_64-NETBSD:#define __DBL_HAS_QUIET_NAN__ 1
+// X86_64-NETBSD:#define __DBL_MANT_DIG__ 53
+// X86_64-NETBSD:#define __DBL_MAX_10_EXP__ 308
+// X86_64-NETBSD:#define __DBL_MAX_EXP__ 1024
+// X86_64-NETBSD:#define __DBL_MAX__ 1.7976931348623157e+308
+// X86_64-NETBSD:#define __DBL_MIN_10_EXP__ (-307)
+// X86_64-NETBSD:#define __DBL_MIN_EXP__ (-1021)
+// X86_64-NETBSD:#define __DBL_MIN__ 2.2250738585072014e-308
+// X86_64-NETBSD:#define __DECIMAL_DIG__ 21
+// X86_64-NETBSD:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// X86_64-NETBSD:#define __FLT_DIG__ 6
+// X86_64-NETBSD:#define __FLT_EPSILON__ 1.19209290e-7F
+// X86_64-NETBSD:#define __FLT_EVAL_METHOD__ 0
+// X86_64-NETBSD:#define __FLT_HAS_DENORM__ 1
+// X86_64-NETBSD:#define __FLT_HAS_INFINITY__ 1
+// X86_64-NETBSD:#define __FLT_HAS_QUIET_NAN__ 1
+// X86_64-NETBSD:#define __FLT_MANT_DIG__ 24
+// X86_64-NETBSD:#define __FLT_MAX_10_EXP__ 38
+// X86_64-NETBSD:#define __FLT_MAX_EXP__ 128
+// X86_64-NETBSD:#define __FLT_MAX__ 3.40282347e+38F
+// X86_64-NETBSD:#define __FLT_MIN_10_EXP__ (-37)
+// X86_64-NETBSD:#define __FLT_MIN_EXP__ (-125)
+// X86_64-NETBSD:#define __FLT_MIN__ 1.17549435e-38F
+// X86_64-NETBSD:#define __FLT_RADIX__ 2
+// X86_64-NETBSD:#define __INT16_TYPE__ short
+// X86_64-NETBSD:#define __INT32_TYPE__ int
+// X86_64-NETBSD:#define __INT64_C_SUFFIX__ L
+// X86_64-NETBSD:#define __INT64_TYPE__ long int
+// X86_64-NETBSD:#define __INT8_TYPE__ char
+// X86_64-NETBSD:#define __INTMAX_MAX__ 9223372036854775807L
+// X86_64-NETBSD:#define __INTMAX_TYPE__ long int
+// X86_64-NETBSD:#define __INTMAX_WIDTH__ 64
+// X86_64-NETBSD:#define __INTPTR_TYPE__ long int
+// X86_64-NETBSD:#define __INTPTR_WIDTH__ 64
+// X86_64-NETBSD:#define __INT_MAX__ 2147483647
+// X86_64-NETBSD:#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
+// X86_64-NETBSD:#define __LDBL_DIG__ 18
+// X86_64-NETBSD:#define __LDBL_EPSILON__ 1.08420217248550443401e-19L
+// X86_64-NETBSD:#define __LDBL_HAS_DENORM__ 1
+// X86_64-NETBSD:#define __LDBL_HAS_INFINITY__ 1
+// X86_64-NETBSD:#define __LDBL_HAS_QUIET_NAN__ 1
+// X86_64-NETBSD:#define __LDBL_MANT_DIG__ 64
+// X86_64-NETBSD:#define __LDBL_MAX_10_EXP__ 4932
+// X86_64-NETBSD:#define __LDBL_MAX_EXP__ 16384
+// X86_64-NETBSD:#define __LDBL_MAX__ 1.18973149535723176502e+4932L
+// X86_64-NETBSD:#define __LDBL_MIN_10_EXP__ (-4931)
+// X86_64-NETBSD:#define __LDBL_MIN_EXP__ (-16381)
+// X86_64-NETBSD:#define __LDBL_MIN__ 3.36210314311209350626e-4932L
+// X86_64-NETBSD:#define __LITTLE_ENDIAN__ 1
+// X86_64-NETBSD:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// X86_64-NETBSD:#define __LONG_MAX__ 9223372036854775807L
+// X86_64-NETBSD:#define __LP64__ 1
+// X86_64-NETBSD:#define __MMX__ 1
+// X86_64-NETBSD:#define __NO_MATH_INLINES 1
+// X86_64-NETBSD:#define __POINTER_WIDTH__ 64
+// X86_64-NETBSD:#define __PTRDIFF_TYPE__ long int
+// X86_64-NETBSD:#define __PTRDIFF_WIDTH__ 64
+// X86_64-NETBSD:#define __REGISTER_PREFIX__
+// X86_64-NETBSD:#define __SCHAR_MAX__ 127
+// X86_64-NETBSD:#define __SHRT_MAX__ 32767
+// X86_64-NETBSD:#define __SIG_ATOMIC_WIDTH__ 32
+// X86_64-NETBSD:#define __SIZEOF_DOUBLE__ 8
+// X86_64-NETBSD:#define __SIZEOF_FLOAT__ 4
+// X86_64-NETBSD:#define __SIZEOF_INT__ 4
+// X86_64-NETBSD:#define __SIZEOF_LONG_DOUBLE__ 16
+// X86_64-NETBSD:#define __SIZEOF_LONG_LONG__ 8
+// X86_64-NETBSD:#define __SIZEOF_LONG__ 8
+// X86_64-NETBSD:#define __SIZEOF_POINTER__ 8
+// X86_64-NETBSD:#define __SIZEOF_PTRDIFF_T__ 8
+// X86_64-NETBSD:#define __SIZEOF_SHORT__ 2
+// X86_64-NETBSD:#define __SIZEOF_SIZE_T__ 8
+// X86_64-NETBSD:#define __SIZEOF_WCHAR_T__ 4
+// X86_64-NETBSD:#define __SIZEOF_WINT_T__ 4
+// X86_64-NETBSD:#define __SIZE_MAX__ 18446744073709551615UL
+// X86_64-NETBSD:#define __SIZE_TYPE__ long unsigned int
+// X86_64-NETBSD:#define __SIZE_WIDTH__ 64
+// X86_64-NETBSD:#define __SSE2_MATH__ 1
+// X86_64-NETBSD:#define __SSE2__ 1
+// X86_64-NETBSD:#define __SSE_MATH__ 1
+// X86_64-NETBSD:#define __SSE__ 1
+// X86_64-NETBSD:#define __UINTMAX_TYPE__ long unsigned int
+// X86_64-NETBSD:#define __USER_LABEL_PREFIX__
+// X86_64-NETBSD:#define __WCHAR_MAX__ 2147483647
+// X86_64-NETBSD:#define __WCHAR_TYPE__ int
+// X86_64-NETBSD:#define __WCHAR_WIDTH__ 32
+// X86_64-NETBSD:#define __WINT_TYPE__ int
+// X86_64-NETBSD:#define __WINT_WIDTH__ 32
+// X86_64-NETBSD:#define __amd64 1
+// X86_64-NETBSD:#define __amd64__ 1
+// X86_64-NETBSD:#define __x86_64 1
+// X86_64-NETBSD:#define __x86_64__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc64-none-none < /dev/null | FileCheck -check-prefix SPARCV9 %s
+// SPARCV9:#define __INT64_TYPE__ long int
+// SPARCV9:#define __INTMAX_TYPE__ long int
+// SPARCV9:#define __INTPTR_TYPE__ long int
+// SPARCV9:#define __LONG_MAX__ 9223372036854775807L
+// SPARCV9:#define __LP64__ 1
+// SPARCV9:#define __SIZEOF_LONG__ 8
+// SPARCV9:#define __SIZEOF_POINTER__ 8
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc64-none-openbsd < /dev/null | FileCheck -check-prefix SPARC64-OBSD %s
+// SPARC64-OBSD:#define __INT64_TYPE__ long long int
+// SPARC64-OBSD:#define __INTMAX_TYPE__ long long int
+// SPARC64-OBSD:#define __UINTMAX_TYPE__ long long unsigned int
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-pc-kfreebsd-gnu < /dev/null | FileCheck -check-prefix KFREEBSD-DEFINE %s
+// KFREEBSD-DEFINE:#define __FreeBSD_kernel__ 1
+// KFREEBSD-DEFINE:#define __GLIBC__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i686-pc-kfreebsd-gnu < /dev/null | FileCheck -check-prefix KFREEBSDI686-DEFINE %s
+// KFREEBSDI686-DEFINE:#define __FreeBSD_kernel__ 1
+// KFREEBSDI686-DEFINE:#define __GLIBC__ 1
+//
// RUN: %clang_cc1 -x c++ -triple i686-pc-linux-gnu -fobjc-runtime=gcc -E -dM < /dev/null | FileCheck -check-prefix GNUSOURCE %s
// GNUSOURCE:#define _GNU_SOURCE 1
-//
+//
// RUN: %clang_cc1 -x c++ -std=c++98 -fno-rtti -E -dM < /dev/null | FileCheck -check-prefix NORTTI %s
// NORTTI: __GXX_ABI_VERSION
// NORTTI-NOT:#define __GXX_RTTI
@@ -2698,3 +3246,9 @@
//
// RUN: %clang_cc1 -triple arm-linux-androideabi -E -dM < /dev/null | FileCheck -check-prefix ANDROID %s
// ANDROID: __ANDROID__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-freebsd < /dev/null | FileCheck -check-prefix PPC64-FREEBSD %s
+// PPC64-FREEBSD-NOT: #define __LONG_DOUBLE_128__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=xcore-none-none < /dev/null | FileCheck -check-prefix XCORE %s
+// XCORE:#define __XS1B__ 1
diff --git a/test/Preprocessor/iwithprefix.c b/test/Preprocessor/iwithprefix.c
index c11f36e94b5a..59935ac1b8b5 100644
--- a/test/Preprocessor/iwithprefix.c
+++ b/test/Preprocessor/iwithprefix.c
@@ -4,13 +4,12 @@
// RUN: mkdir -p %t.tmps/first %t.tmps/second
// RUN: %clang_cc1 -triple x86_64-unknown-unknown \
// RUN: -iprefix %t.tmps/ -iwithprefix second \
-// RUN: -isystem %t.tmps/first -v 2> %t.out
-// RUN: cat %t.out
-// RUN: FileCheck < %t.out %s
+// RUN: -isystem %t.tmps/first -v %s 2> %t.out
+// RUN: FileCheck %s < %t.out
// CHECK: #include <...> search starts here:
// CHECK: {{.*}}.tmps/first
-// CHECK: /lib/clang/{{[.0-9]+}}/include
+// CHECK: {{/|\\}}lib{{/|\\}}clang{{/|\\}}{{[.0-9]+}}{{/|\\}}include
// CHECK: {{.*}}.tmps/second
// CHECK-NOT: {{.*}}.tmps
diff --git a/test/Preprocessor/line-directive-output.c b/test/Preprocessor/line-directive-output.c
index bd3ea949ebd9..5c0aef8b3219 100644
--- a/test/Preprocessor/line-directive-output.c
+++ b/test/Preprocessor/line-directive-output.c
@@ -73,3 +73,6 @@ extern int z;
# 42 "A.c"
# 44 "A.c"
# 49 "A.c"
+
+// CHECK: # 50 "a\n.c"
+# 50 "a\012.c"
diff --git a/test/Preprocessor/line-directive.c b/test/Preprocessor/line-directive.c
index ea0a36fca358..0dd658f7f1a1 100644
--- a/test/Preprocessor/line-directive.c
+++ b/test/Preprocessor/line-directive.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
-// RUN: %clang_cc1 -E %s 2>&1 | grep 'blonk.c:92:2: error: ABC'
-// RUN: %clang_cc1 -E %s 2>&1 | grep 'blonk.c:93:2: error: DEF'
+// RUN: not %clang_cc1 -E %s 2>&1 | grep 'blonk.c:92:2: error: ABC'
+// RUN: not %clang_cc1 -E %s 2>&1 | grep 'blonk.c:93:2: error: DEF'
#line 'a' // expected-error {{#line directive requires a positive integer argument}}
#line 0 // expected-warning {{#line directive with zero argument is a GNU extension}}
diff --git a/test/Preprocessor/macro_backslash.c b/test/Preprocessor/macro_backslash.c
new file mode 100644
index 000000000000..76f5d41e734d
--- /dev/null
+++ b/test/Preprocessor/macro_backslash.c
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 -E %s -Dfoo='bar\' | FileCheck %s
+// CHECK: TTA bar\ TTB
+TTA foo TTB
diff --git a/test/Preprocessor/macro_expand_empty.c b/test/Preprocessor/macro_expand_empty.c
new file mode 100644
index 000000000000..3fb6394dc9ea
--- /dev/null
+++ b/test/Preprocessor/macro_expand_empty.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only %s
+// Check that this doesn't crash
+
+#define IDENTITY1(x) x
+#define IDENTITY2(x) IDENTITY1(x) IDENTITY1(x) IDENTITY1(x) IDENTITY1(x)
+#define IDENTITY3(x) IDENTITY2(x) IDENTITY2(x) IDENTITY2(x) IDENTITY2(x)
+#define IDENTITY4(x) IDENTITY3(x) IDENTITY3(x) IDENTITY3(x) IDENTITY3(x)
+#define IDENTITY5(x) IDENTITY4(x) IDENTITY4(x) IDENTITY4(x) IDENTITY4(x)
+#define IDENTITY6(x) IDENTITY5(x) IDENTITY5(x) IDENTITY5(x) IDENTITY5(x)
+#define IDENTITY7(x) IDENTITY6(x) IDENTITY6(x) IDENTITY6(x) IDENTITY6(x)
+#define IDENTITY8(x) IDENTITY7(x) IDENTITY7(x) IDENTITY7(x) IDENTITY7(x)
+#define IDENTITY9(x) IDENTITY8(x) IDENTITY8(x) IDENTITY8(x) IDENTITY8(x)
+#define IDENTITY0(x) IDENTITY9(x) IDENTITY9(x) IDENTITY9(x) IDENTITY9(x)
+IDENTITY0()
diff --git a/test/Preprocessor/macro_fn.c b/test/Preprocessor/macro_fn.c
index fcdb90ad57d6..f21ef5197d44 100644
--- a/test/Preprocessor/macro_fn.c
+++ b/test/Preprocessor/macro_fn.c
@@ -13,7 +13,8 @@ zero(1, 2, 3); /* expected-error {{too many arguments provided to function-li
one() /* ok */
one(a)
-one(a,) /* expected-error {{too many arguments provided to function-like macro invocation}} */
+one(a,) /* expected-error {{too many arguments provided to function-like macro invocation}} \
+ expected-warning {{empty macro arguments are a C99 feature}}*/
one(a, b) /* expected-error {{too many arguments provided to function-like macro invocation}} */
two() /* expected-error {{too few arguments provided to function-like macro invocation}} */
@@ -25,7 +26,7 @@ two(
, /* expected-warning {{empty macro arguments are a C99 feature}} */
, /* expected-warning {{empty macro arguments are a C99 feature}} \
expected-error {{too many arguments provided to function-like macro invocation}} */
- )
+ ) /* expected-warning {{empty macro arguments are a C99 feature}} */
two(,) /* expected-warning 2 {{empty macro arguments are a C99 feature}} */
diff --git a/test/Preprocessor/macro_paste_bad.c b/test/Preprocessor/macro_paste_bad.c
index 0a028a44686e..ec10006ae3d7 100644
--- a/test/Preprocessor/macro_paste_bad.c
+++ b/test/Preprocessor/macro_paste_bad.c
@@ -32,3 +32,5 @@ XX // expected-error {{attempt to use a poisoned identifier}}
#define VA __VA_ ## ARGS__
int VA; // expected-warning {{__VA_ARGS__ can only appear in the expansion of a C99 variadic macro}}
+#define LOG_ON_ERROR(x) x ## #y; // expected-error {{'#' is not followed by a macro parameter}}
+LOG_ON_ERROR(0);
diff --git a/test/Preprocessor/macro_paste_bcpl_comment.c b/test/Preprocessor/macro_paste_bcpl_comment.c
index fd07b1f7f2fc..e915ca611cc5 100644
--- a/test/Preprocessor/macro_paste_bcpl_comment.c
+++ b/test/Preprocessor/macro_paste_bcpl_comment.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -Eonly 2>&1 | grep error
+// RUN: not %clang_cc1 %s -Eonly 2>&1 | grep error
#define COMM1 / ## /
COMM1
diff --git a/test/Preprocessor/macro_paste_empty.c b/test/Preprocessor/macro_paste_empty.c
index 2e26f1419573..e9b50f0e8e87 100644
--- a/test/Preprocessor/macro_paste_empty.c
+++ b/test/Preprocessor/macro_paste_empty.c
@@ -1,13 +1,17 @@
-// RUN: %clang_cc1 -E %s | grep 'a:Y'
-// RUN: %clang_cc1 -E %s | grep 'b:Y'
-// RUN: %clang_cc1 -E %s | grep 'c:YY'
+// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
#define FOO(X) X ## Y
a:FOO()
+// CHECK: a:Y
#define FOO2(X) Y ## X
b:FOO2()
+// CHECK: b:Y
#define FOO3(X) X ## Y ## X ## Y ## X ## X
c:FOO3()
+// CHECK: c:YY
+#define FOO4(X, Y) X ## Y
+d:FOO4(,FOO4(,))
+// CHECK: d:FOO4
diff --git a/test/Preprocessor/macro_paste_msextensions.c b/test/Preprocessor/macro_paste_msextensions.c
index c5b42130b8ea..afdcdbd493f0 100644
--- a/test/Preprocessor/macro_paste_msextensions.c
+++ b/test/Preprocessor/macro_paste_msextensions.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -P -E -fms-extensions %s | FileCheck -strict-whitespace %s
+// RUN: not %clang_cc1 -P -E -fms-extensions %s | FileCheck -strict-whitespace %s
// This horrible stuff should preprocess into (other than whitespace):
// int foo;
diff --git a/test/Preprocessor/macro_with_initializer_list.cpp b/test/Preprocessor/macro_with_initializer_list.cpp
new file mode 100644
index 000000000000..287eeb4a843c
--- /dev/null
+++ b/test/Preprocessor/macro_with_initializer_list.cpp
@@ -0,0 +1,182 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+namespace std {
+ template <class X>
+ class initializer_list {
+ public:
+ initializer_list();
+ };
+}
+
+class Foo {
+public:
+ Foo();
+ Foo(std::initializer_list<int>);
+ bool operator==(const Foo);
+ Foo operator+(const Foo);
+};
+
+#define EQ(x,y) (void)(x == y) // expected-note 6{{defined here}}
+void test_EQ() {
+ Foo F;
+ F = Foo{1,2};
+
+ EQ(F,F);
+ EQ(F,Foo());
+ EQ(F,Foo({1,2,3}));
+ EQ(Foo({1,2,3}),F);
+ EQ((Foo{1,2,3}),(Foo{1,2,3}));
+ EQ(F, F + F);
+ EQ(F, Foo({1,2,3}) + Foo({1,2,3}));
+ EQ(F, (Foo{1,2,3} + Foo{1,2,3}));
+
+ EQ(F,Foo{1,2,3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+ EQ(Foo{1,2,3},F);
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+ EQ(Foo{1,2,3},Foo{1,2,3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+
+ EQ(Foo{1,2,3} + Foo{1,2,3}, F);
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+ EQ(F, Foo({1,2,3}) + Foo{1,2,3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+ EQ(F, Foo{1,2,3} + Foo{1,2,3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+}
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{33:8-33:8}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{33:18-33:18}:")"
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{36:6-36:6}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{36:16-36:16}:")"
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{39:6-39:6}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{39:16-39:16}:")"
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{39:17-39:17}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{39:27-39:27}:")"
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{43:6-43:6}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{43:29-43:29}:")"
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{46:9-46:9}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{46:34-46:34}:")"
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{49:9-49:9}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{49:32-49:32}:")"
+
+#define NE(x,y) (void)(x != y) // expected-note 6{{defined here}}
+// Operator != isn't defined. This tests that the corrected macro arguments
+// are used in the macro expansion.
+void test_NE() {
+ Foo F;
+
+ NE(F,F);
+ // expected-error@-1 {{invalid operands}}
+ NE(F,Foo());
+ // expected-error@-1 {{invalid operands}}
+ NE(F,Foo({1,2,3}));
+ // expected-error@-1 {{invalid operands}}
+ NE((Foo{1,2,3}),(Foo{1,2,3}));
+ // expected-error@-1 {{invalid operands}}
+
+ NE(F,Foo{1,2,3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+ // expected-error@-3 {{invalid operands}}
+ NE(Foo{1,2,3},F);
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+ // expected-error@-3 {{invalid operands}}
+ NE(Foo{1,2,3},Foo{1,2,3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+ // expected-error@-3 {{invalid operands}}
+
+ NE(Foo{1,2,3} + Foo{1,2,3}, F);
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+ // expected-error@-3 {{invalid operands}}
+ NE(F, Foo({1,2,3}) + Foo{1,2,3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+ // expected-error@-3 {{invalid operands}}
+ NE(F, Foo{1,2,3} + Foo{1,2,3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+ // expected-error@-3 {{invalid operands}}
+}
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{89:8-89:8}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{89:18-89:18}:")"
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{93:6-93:6}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{93:16-93:16}:")"
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{97:6-97:6}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{97:16-97:16}:")"
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{97:17-97:17}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{97:27-97:27}:")"
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{102:6-102:6}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{102:29-102:29}:")"
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{106:9-106:9}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{106:34-106:34}:")"
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{110:9-110:9}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{110:32-110:32}:")"
+
+#define INIT(var, init) Foo var = init; // expected-note 3{{defined here}}
+// Can't use an initializer list as a macro argument. The commas in the list
+// will be interpretted as argument separaters and adding parenthesis will
+// make it no longer an initializer list.
+void test() {
+ INIT(a, Foo());
+ INIT(b, Foo({1, 2, 3}));
+ INIT(c, Foo());
+
+ INIT(d, Foo{1, 2, 3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-note@-2 {{parentheses are required}}
+
+ // Can't be fixed by parentheses.
+ INIT(e, {1, 2, 3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-error@-2 {{use of undeclared identifier}}
+ // expected-note@-3 {{cannot use initializer list at the beginning of a macro argument}}
+
+ // Can't be fixed by parentheses.
+ INIT(e, {1, 2, 3} + {1, 2, 3});
+ // expected-error@-1 {{too many arguments provided}}
+ // expected-error@-2 {{use of undeclared identifier}}
+ // expected-note@-3 {{cannot use initializer list at the beginning of a macro argument}}
+}
+
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{145:11-145:11}:"("
+// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{145:23-145:23}:")"
+
+#define M(name,a,b,c,d,e,f,g,h,i,j,k,l) \
+ Foo name = a + b + c + d + e + f + g + h + i + j + k + l;
+// expected-note@-2 2{{defined here}}
+void test2() {
+ M(F1, Foo(), Foo(), Foo(), Foo(), Foo(), Foo(),
+ Foo(), Foo(), Foo(), Foo(), Foo(), Foo());
+
+ M(F2, Foo{1,2,3}, Foo{1,2,3}, Foo{1,2,3}, Foo{1,2,3}, Foo{1,2,3}, Foo{1,2,3},
+ Foo{1,2,3}, Foo{1,2,3}, Foo{1,2,3}, Foo{1,2,3}, Foo{1,2,3}, Foo{1,2,3});
+ // expected-error@-2 {{too many arguments provided}}
+ // expected-note@-3 {{parentheses are required}}
+
+ M(F3, {1,2,3}, {1,2,3}, {1,2,3}, {1,2,3}, {1,2,3}, {1,2,3},
+ {1,2,3}, {1,2,3}, {1,2,3}, {1,2,3}, {1,2,3}, {1,2,3});
+ // expected-error@-2 {{too many arguments provided}}
+ // expected-error@-3 {{use of undeclared identifier}}
+ // expected-note@-4 {{cannot use initializer list at the beginning of a macro argument}}
+}
diff --git a/test/Preprocessor/microsoft-ext.c b/test/Preprocessor/microsoft-ext.c
index ec10374a1d6a..b03f6775429a 100644
--- a/test/Preprocessor/microsoft-ext.c
+++ b/test/Preprocessor/microsoft-ext.c
@@ -22,3 +22,15 @@ class GMOCK_ACTION_CLASS_(name, value_params) {\
ACTION_TEMPLATE(InvokeArgument,
HAS_1_TEMPLATE_PARAMS(int, k),
AND_2_VALUE_PARAMS(p0, p1));
+
+// This tests compatibility with behaviour needed for type_traits in VS2012
+// Test based on _VARIADIC_EXPAND_0X macros in xstddef of VS2012
+#define _COMMA ,
+
+#define MAKER(_arg1, _comma, _arg2) \
+ void func(_arg1 _comma _arg2) {}
+#define MAKE_FUNC(_makerP1, _makerP2, _arg1, _comma, _arg2) \
+ _makerP1##_makerP2(_arg1, _comma, _arg2)
+
+MAKE_FUNC(MAK, ER, int a, _COMMA, int b);
+// CHECK: void func(int a , int b) {}
diff --git a/test/Preprocessor/optimize.c b/test/Preprocessor/optimize.c
index 0167e70e0122..d7da1056ae46 100644
--- a/test/Preprocessor/optimize.c
+++ b/test/Preprocessor/optimize.c
@@ -9,7 +9,7 @@
#endif
#endif
-// RUN: %clang_cc1 -Eonly %s -DOPT_O0 -O0 -verify
+// RUN: %clang_cc1 -Eonly %s -DOPT_O0 -verify
#ifdef OPT_O0
// expected-no-diagnostics
#ifdef __OPTIMIZE__
diff --git a/test/Preprocessor/pragma_microsoft.c b/test/Preprocessor/pragma_microsoft.c
index c0ddf74340ce..e30069c1c5e7 100644
--- a/test/Preprocessor/pragma_microsoft.c
+++ b/test/Preprocessor/pragma_microsoft.c
@@ -18,6 +18,11 @@
#pragma comment(user, "foo\abar\nbaz\tsome thing")
+#pragma detect_mismatch("test", "1")
+#pragma detect_mismatch() // expected-error {{expected string literal in pragma detect_mismatch}}
+#pragma detect_mismatch("test") // expected-error {{pragma detect_mismatch is malformed; it requires two comma-separated string literals}}
+#pragma detect_mismatch("test", 1) // expected-error {{expected string literal in pragma detect_mismatch}}
+#pragma detect_mismatch("test", BAR)
// __pragma
@@ -82,3 +87,31 @@ void g() {}
// Make sure that empty includes don't work
#pragma include_alias("", "foo.h") // expected-error {{empty filename}}
#pragma include_alias(<foo.h>, <>) // expected-error {{empty filename}}
+
+// Test that we ignore pragma warning.
+#pragma warning(push)
+#pragma warning(push, 1)
+#pragma warning(disable : 4705)
+#pragma warning(disable : 123 456 789 ; error : 321)
+#pragma warning(once : 321)
+#pragma warning(suppress : 321)
+#pragma warning(default : 321)
+#pragma warning(pop)
+
+#pragma warning(push, 0)
+// FIXME: We could probably support pushing warning level 0.
+#pragma warning(pop)
+
+#pragma warning // expected-warning {{expected '('}}
+#pragma warning( // expected-warning {{expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4}}
+#pragma warning() // expected-warning {{expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4}}
+#pragma warning(push 4) // expected-warning {{expected ')'}}
+#pragma warning(push // expected-warning {{expected ')'}}
+#pragma warning(push, 5) // expected-warning {{requires a level between 0 and 4}}
+#pragma warning(pop, 1) // expected-warning {{expected ')'}}
+#pragma warning(push, 1) asdf // expected-warning {{extra tokens at end of #pragma warning directive}}
+#pragma warning(disable 4705) // expected-warning {{expected ':'}}
+#pragma warning(disable : 0) // expected-warning {{expected a warning number}}
+#pragma warning(default 321) // expected-warning {{expected ':'}}
+#pragma warning(asdf : 321) // expected-warning {{expected 'push', 'pop'}}
+#pragma warning(push, -1) // expected-warning {{requires a level between 0 and 4}}
diff --git a/test/Preprocessor/pragma_microsoft.cpp b/test/Preprocessor/pragma_microsoft.cpp
new file mode 100644
index 000000000000..e097d69a208f
--- /dev/null
+++ b/test/Preprocessor/pragma_microsoft.cpp
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 %s -fsyntax-only -std=c++11 -verify -fms-extensions
+
+#pragma warning(push, 4_D) // expected-warning {{requires a level between 0 and 4}}
diff --git a/test/Preprocessor/predefined-arch-macros.c b/test/Preprocessor/predefined-arch-macros.c
index d0125cd0ed5a..26298f9ada34 100644
--- a/test/Preprocessor/predefined-arch-macros.c
+++ b/test/Preprocessor/predefined-arch-macros.c
@@ -1,6 +1,3 @@
-// These tests are generated by running utils/generate_arch_predefine_tests.sh
-// to observe GCC's behavior (or some other system compiler's behavior).
-//
// Begin X86/GCC/Linux tests ----------------
//
// RUN: %clang -march=i386 -m32 -E -dM %s -o - 2>&1 \
@@ -10,7 +7,7 @@
// CHECK_I386_M32: #define __i386__ 1
// CHECK_I386_M32: #define __tune_i386__ 1
// CHECK_I386_M32: #define i386 1
-// RUN: %clang -march=i386 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=i386 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I386_M64
// CHECK_I386_M64: error:
@@ -24,7 +21,7 @@
// CHECK_I486_M32: #define __i486__ 1
// CHECK_I486_M32: #define __tune_i486__ 1
// CHECK_I486_M32: #define i386 1
-// RUN: %clang -march=i486 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=i486 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I486_M64
// CHECK_I486_M64: error:
@@ -41,7 +38,7 @@
// CHECK_I586_M32: #define __tune_i586__ 1
// CHECK_I586_M32: #define __tune_pentium__ 1
// CHECK_I586_M32: #define i386 1
-// RUN: %clang -march=i586 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=i586 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I586_M64
// CHECK_I586_M64: error:
@@ -58,7 +55,7 @@
// CHECK_PENTIUM_M32: #define __tune_i586__ 1
// CHECK_PENTIUM_M32: #define __tune_pentium__ 1
// CHECK_PENTIUM_M32: #define i386 1
-// RUN: %clang -march=pentium -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=pentium -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M64
// CHECK_PENTIUM_M64: error:
@@ -78,7 +75,7 @@
// CHECK_PENTIUM_MMX_M32: #define __tune_pentium__ 1
// CHECK_PENTIUM_MMX_M32: #define __tune_pentium_mmx__ 1
// CHECK_PENTIUM_MMX_M32: #define i386 1
-// RUN: %clang -march=pentium-mmx -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=pentium-mmx -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_MMX_M64
// CHECK_PENTIUM_MMX_M64: error:
@@ -93,7 +90,7 @@
// CHECK_WINCHIP_C6_M32: #define __i486__ 1
// CHECK_WINCHIP_C6_M32: #define __tune_i486__ 1
// CHECK_WINCHIP_C6_M32: #define i386 1
-// RUN: %clang -march=winchip-c6 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=winchip-c6 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP_C6_M64
// CHECK_WINCHIP_C6_M64: error:
@@ -109,7 +106,7 @@
// CHECK_WINCHIP2_M32: #define __i486__ 1
// CHECK_WINCHIP2_M32: #define __tune_i486__ 1
// CHECK_WINCHIP2_M32: #define i386 1
-// RUN: %clang -march=winchip2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=winchip2 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP2_M64
// CHECK_WINCHIP2_M64: error:
@@ -125,7 +122,7 @@
// CHECK_C3_M32: #define __i486__ 1
// CHECK_C3_M32: #define __tune_i486__ 1
// CHECK_C3_M32: #define i386 1
-// RUN: %clang -march=c3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=c3 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_C3_M64
// CHECK_C3_M64: error:
@@ -145,7 +142,7 @@
// CHECK_C3_2_M32: #define __tune_pentium2__ 1
// CHECK_C3_2_M32: #define __tune_pentiumpro__ 1
// CHECK_C3_2_M32: #define i386 1
-// RUN: %clang -march=c3-2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=c3-2 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_C3_2_M64
// CHECK_C3_2_M64: error:
@@ -160,7 +157,7 @@
// CHECK_I686_M32: #define __pentiumpro 1
// CHECK_I686_M32: #define __pentiumpro__ 1
// CHECK_I686_M32: #define i386 1
-// RUN: %clang -march=i686 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=i686 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I686_M64
// CHECK_I686_M64: error:
@@ -177,7 +174,7 @@
// CHECK_PENTIUMPRO_M32: #define __tune_i686__ 1
// CHECK_PENTIUMPRO_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUMPRO_M32: #define i386 1
-// RUN: %clang -march=pentiumpro -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=pentiumpro -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUMPRO_M64
// CHECK_PENTIUMPRO_M64: error:
@@ -196,7 +193,7 @@
// CHECK_PENTIUM2_M32: #define __tune_pentium2__ 1
// CHECK_PENTIUM2_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM2_M32: #define i386 1
-// RUN: %clang -march=pentium2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=pentium2 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM2_M64
// CHECK_PENTIUM2_M64: error:
@@ -217,7 +214,7 @@
// CHECK_PENTIUM3_M32: #define __tune_pentium3__ 1
// CHECK_PENTIUM3_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM3_M32: #define i386 1
-// RUN: %clang -march=pentium3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=pentium3 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3_M64
// CHECK_PENTIUM3_M64: error:
@@ -236,7 +233,7 @@
// CHECK_PENTIUM3M_M32: #define __tune_i686__ 1
// CHECK_PENTIUM3M_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM3M_M32: #define i386 1
-// RUN: %clang -march=pentium3m -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=pentium3m -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3M_M64
// CHECK_PENTIUM3M_M64: error:
@@ -256,7 +253,7 @@
// CHECK_PENTIUM_M_M32: #define __tune_i686__ 1
// CHECK_PENTIUM_M_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM_M_M32: #define i386 1
-// RUN: %clang -march=pentium-m -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=pentium-m -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M_M64
// CHECK_PENTIUM_M_M64: error:
@@ -273,7 +270,7 @@
// CHECK_PENTIUM4_M32: #define __pentium4__ 1
// CHECK_PENTIUM4_M32: #define __tune_pentium4__ 1
// CHECK_PENTIUM4_M32: #define i386 1
-// RUN: %clang -march=pentium4 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=pentium4 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4_M64
// CHECK_PENTIUM4_M64: error:
@@ -290,7 +287,7 @@
// CHECK_PENTIUM4M_M32: #define __pentium4__ 1
// CHECK_PENTIUM4M_M32: #define __tune_pentium4__ 1
// CHECK_PENTIUM4M_M32: #define i386 1
-// RUN: %clang -march=pentium4m -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=pentium4m -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4M_M64
// CHECK_PENTIUM4M_M64: error:
@@ -308,7 +305,7 @@
// CHECK_PRESCOTT_M32: #define __nocona__ 1
// CHECK_PRESCOTT_M32: #define __tune_nocona__ 1
// CHECK_PRESCOTT_M32: #define i386 1
-// RUN: %clang -march=prescott -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=prescott -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PRESCOTT_M64
// CHECK_PRESCOTT_M64: error:
@@ -509,6 +506,7 @@
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE_AVX2_M32
// CHECK_CORE_AVX2_M32: #define __AES__ 1
+// CHECK_CORE_AVX2_M32: #define __AVX2__ 1
// CHECK_CORE_AVX2_M32: #define __AVX__ 1
// CHECK_CORE_AVX2_M32: #define __BMI2__ 1
// CHECK_CORE_AVX2_M32: #define __BMI__ 1
@@ -536,6 +534,7 @@
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE_AVX2_M64
// CHECK_CORE_AVX2_M64: #define __AES__ 1
+// CHECK_CORE_AVX2_M64: #define __AVX2__ 1
// CHECK_CORE_AVX2_M64: #define __AVX__ 1
// CHECK_CORE_AVX2_M64: #define __BMI2__ 1
// CHECK_CORE_AVX2_M64: #define __BMI__ 1
@@ -563,6 +562,74 @@
// CHECK_CORE_AVX2_M64: #define __x86_64 1
// CHECK_CORE_AVX2_M64: #define __x86_64__ 1
//
+// RUN: %clang -march=knl -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_KNL_M32
+// CHECK_KNL_M32: #define __AES__ 1
+// CHECK_KNL_M32: #define __AVX2__ 1
+// CHECK_KNL_M32: #define __AVX512CD__ 1
+// CHECK_KNL_M32: #define __AVX512ER__ 1
+// CHECK_KNL_M32: #define __AVX512F__ 1
+// CHECK_KNL_M32: #define __AVX512PF__ 1
+// CHECK_KNL_M32: #define __AVX__ 1
+// CHECK_KNL_M32: #define __BMI2__ 1
+// CHECK_KNL_M32: #define __BMI__ 1
+// CHECK_KNL_M32: #define __F16C__ 1
+// CHECK_KNL_M32: #define __FMA__ 1
+// CHECK_KNL_M32: #define __LZCNT__ 1
+// CHECK_KNL_M32: #define __MMX__ 1
+// CHECK_KNL_M32: #define __PCLMUL__ 1
+// CHECK_KNL_M32: #define __POPCNT__ 1
+// CHECK_KNL_M32: #define __RDRND__ 1
+// CHECK_KNL_M32: #define __RTM__ 1
+// CHECK_KNL_M32: #define __SSE2__ 1
+// CHECK_KNL_M32: #define __SSE3__ 1
+// CHECK_KNL_M32: #define __SSE4_1__ 1
+// CHECK_KNL_M32: #define __SSE4_2__ 1
+// CHECK_KNL_M32: #define __SSE__ 1
+// CHECK_KNL_M32: #define __SSSE3__ 1
+// CHECK_KNL_M32: #define __i386 1
+// CHECK_KNL_M32: #define __i386__ 1
+// CHECK_KNL_M32: #define __knl 1
+// CHECK_KNL_M32: #define __knl__ 1
+// CHECK_KNL_M32: #define __tune_knl__ 1
+// CHECK_KNL_M32: #define i386 1
+// RUN: %clang -march=knl -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_KNL_M64
+// CHECK_KNL_M64: #define __AES__ 1
+// CHECK_KNL_M64: #define __AVX2__ 1
+// CHECK_KNL_M64: #define __AVX512CD__ 1
+// CHECK_KNL_M64: #define __AVX512ER__ 1
+// CHECK_KNL_M64: #define __AVX512F__ 1
+// CHECK_KNL_M64: #define __AVX512PF__ 1
+// CHECK_KNL_M64: #define __AVX__ 1
+// CHECK_KNL_M64: #define __BMI2__ 1
+// CHECK_KNL_M64: #define __BMI__ 1
+// CHECK_KNL_M64: #define __F16C__ 1
+// CHECK_KNL_M64: #define __FMA__ 1
+// CHECK_KNL_M64: #define __LZCNT__ 1
+// CHECK_KNL_M64: #define __MMX__ 1
+// CHECK_KNL_M64: #define __PCLMUL__ 1
+// CHECK_KNL_M64: #define __POPCNT__ 1
+// CHECK_KNL_M64: #define __RDRND__ 1
+// CHECK_KNL_M64: #define __RTM__ 1
+// CHECK_KNL_M64: #define __SSE2_MATH__ 1
+// CHECK_KNL_M64: #define __SSE2__ 1
+// CHECK_KNL_M64: #define __SSE3__ 1
+// CHECK_KNL_M64: #define __SSE4_1__ 1
+// CHECK_KNL_M64: #define __SSE4_2__ 1
+// CHECK_KNL_M64: #define __SSE_MATH__ 1
+// CHECK_KNL_M64: #define __SSE__ 1
+// CHECK_KNL_M64: #define __SSSE3__ 1
+// CHECK_KNL_M64: #define __amd64 1
+// CHECK_KNL_M64: #define __amd64__ 1
+// CHECK_KNL_M64: #define __knl 1
+// CHECK_KNL_M64: #define __knl__ 1
+// CHECK_KNL_M64: #define __tune_knl__ 1
+// CHECK_KNL_M64: #define __x86_64 1
+// CHECK_KNL_M64: #define __x86_64__ 1
+//
// RUN: %clang -march=atom -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATOM_M32
@@ -595,6 +662,42 @@
// CHECK_ATOM_M64: #define __x86_64 1
// CHECK_ATOM_M64: #define __x86_64__ 1
//
+// RUN: %clang -march=slm -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_SLM_M32
+// CHECK_SLM_M32: #define __MMX__ 1
+// CHECK_SLM_M32: #define __SSE2__ 1
+// CHECK_SLM_M32: #define __SSE3__ 1
+// CHECK_SLM_M32: #define __SSE4_1__ 1
+// CHECK_SLM_M32: #define __SSE4_2__ 1
+// CHECK_SLM_M32: #define __SSE__ 1
+// CHECK_SLM_M32: #define __SSSE3__ 1
+// CHECK_SLM_M32: #define __i386 1
+// CHECK_SLM_M32: #define __i386__ 1
+// CHECK_SLM_M32: #define __slm 1
+// CHECK_SLM_M32: #define __slm__ 1
+// CHECK_SLM_M32: #define __tune_slm__ 1
+// CHECK_SLM_M32: #define i386 1
+// RUN: %clang -march=slm -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_SLM_M64
+// CHECK_SLM_M64: #define __MMX__ 1
+// CHECK_SLM_M64: #define __SSE2_MATH__ 1
+// CHECK_SLM_M64: #define __SSE2__ 1
+// CHECK_SLM_M64: #define __SSE3__ 1
+// CHECK_SLM_M64: #define __SSE4_1__ 1
+// CHECK_SLM_M64: #define __SSE4_2__ 1
+// CHECK_SLM_M64: #define __SSE_MATH__ 1
+// CHECK_SLM_M64: #define __SSE__ 1
+// CHECK_SLM_M64: #define __SSSE3__ 1
+// CHECK_SLM_M64: #define __amd64 1
+// CHECK_SLM_M64: #define __amd64__ 1
+// CHECK_SLM_M64: #define __slm 1
+// CHECK_SLM_M64: #define __slm__ 1
+// CHECK_SLM_M64: #define __tune_slm__ 1
+// CHECK_SLM_M64: #define __x86_64 1
+// CHECK_SLM_M64: #define __x86_64__ 1
+//
// RUN: %clang -march=geode -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_GEODE_M32
@@ -607,7 +710,7 @@
// CHECK_GEODE_M32: #define __i386__ 1
// CHECK_GEODE_M32: #define __tune_geode__ 1
// CHECK_GEODE_M32: #define i386 1
-// RUN: %clang -march=geode -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=geode -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_GEODE_M64
// CHECK_GEODE_M64: error:
@@ -622,7 +725,7 @@
// CHECK_K6_M32: #define __k6__ 1
// CHECK_K6_M32: #define __tune_k6__ 1
// CHECK_K6_M32: #define i386 1
-// RUN: %clang -march=k6 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=k6 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_M64
// CHECK_K6_M64: error:
@@ -640,7 +743,7 @@
// CHECK_K6_2_M32: #define __tune_k6_2__ 1
// CHECK_K6_2_M32: #define __tune_k6__ 1
// CHECK_K6_2_M32: #define i386 1
-// RUN: %clang -march=k6-2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=k6-2 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_2_M64
// CHECK_K6_2_M64: error:
@@ -658,7 +761,7 @@
// CHECK_K6_3_M32: #define __tune_k6_3__ 1
// CHECK_K6_3_M32: #define __tune_k6__ 1
// CHECK_K6_3_M32: #define i386 1
-// RUN: %clang -march=k6-3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=k6-3 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_3_M64
// CHECK_K6_3_M64: error:
@@ -675,7 +778,7 @@
// CHECK_ATHLON_M32: #define __i386__ 1
// CHECK_ATHLON_M32: #define __tune_athlon__ 1
// CHECK_ATHLON_M32: #define i386 1
-// RUN: %clang -march=athlon -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=athlon -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_M64
// CHECK_ATHLON_M64: error:
@@ -692,7 +795,7 @@
// CHECK_ATHLON_TBIRD_M32: #define __i386__ 1
// CHECK_ATHLON_TBIRD_M32: #define __tune_athlon__ 1
// CHECK_ATHLON_TBIRD_M32: #define i386 1
-// RUN: %clang -march=athlon-tbird -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=athlon-tbird -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_TBIRD_M64
// CHECK_ATHLON_TBIRD_M64: error:
@@ -712,7 +815,7 @@
// CHECK_ATHLON_4_M32: #define __tune_athlon__ 1
// CHECK_ATHLON_4_M32: #define __tune_athlon_sse__ 1
// CHECK_ATHLON_4_M32: #define i386 1
-// RUN: %clang -march=athlon-4 -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=athlon-4 -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_4_M64
// CHECK_ATHLON_4_M64: error:
@@ -732,7 +835,7 @@
// CHECK_ATHLON_XP_M32: #define __tune_athlon__ 1
// CHECK_ATHLON_XP_M32: #define __tune_athlon_sse__ 1
// CHECK_ATHLON_XP_M32: #define i386 1
-// RUN: %clang -march=athlon-xp -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=athlon-xp -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_XP_M64
// CHECK_ATHLON_XP_M64: error:
@@ -752,7 +855,7 @@
// CHECK_ATHLON_MP_M32: #define __tune_athlon__ 1
// CHECK_ATHLON_MP_M32: #define __tune_athlon_sse__ 1
// CHECK_ATHLON_MP_M32: #define i386 1
-// RUN: %clang -march=athlon-mp -m64 -E -dM %s -o - 2>&1 \
+// RUN: not %clang -march=athlon-mp -m64 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_MP_M64
// CHECK_ATHLON_MP_M64: error:
@@ -1060,6 +1163,7 @@
// CHECK_BTVER1_M32: #define __LZCNT__ 1
// CHECK_BTVER1_M32: #define __MMX__ 1
// CHECK_BTVER1_M32: #define __POPCNT__ 1
+// CHECK_BTVER1_M32: #define __PRFCHW__ 1
// CHECK_BTVER1_M32: #define __SSE2_MATH__ 1
// CHECK_BTVER1_M32: #define __SSE2__ 1
// CHECK_BTVER1_M32: #define __SSE3__ 1
@@ -1080,6 +1184,7 @@
// CHECK_BTVER1_M64: #define __LZCNT__ 1
// CHECK_BTVER1_M64: #define __MMX__ 1
// CHECK_BTVER1_M64: #define __POPCNT__ 1
+// CHECK_BTVER1_M64: #define __PRFCHW__ 1
// CHECK_BTVER1_M64: #define __SSE2_MATH__ 1
// CHECK_BTVER1_M64: #define __SSE2__ 1
// CHECK_BTVER1_M64: #define __SSE3__ 1
@@ -1104,6 +1209,7 @@
// CHECK_BTVER2_M32: #define __LZCNT__ 1
// CHECK_BTVER2_M32: #define __MMX__ 1
// CHECK_BTVER2_M32: #define __POPCNT__ 1
+// CHECK_BTVER2_M32: #define __PRFCHW__ 1
// CHECK_BTVER2_M32: #define __SSE2_MATH__ 1
// CHECK_BTVER2_M32: #define __SSE2__ 1
// CHECK_BTVER2_M32: #define __SSE3__ 1
@@ -1126,6 +1232,7 @@
// CHECK_BTVER2_M64: #define __LZCNT__ 1
// CHECK_BTVER2_M64: #define __MMX__ 1
// CHECK_BTVER2_M64: #define __POPCNT__ 1
+// CHECK_BTVER2_M64: #define __PRFCHW__ 1
// CHECK_BTVER2_M64: #define __SSE2_MATH__ 1
// CHECK_BTVER2_M64: #define __SSE2__ 1
// CHECK_BTVER2_M64: #define __SSE3__ 1
@@ -1152,6 +1259,7 @@
// CHECK_BDVER1_M32: #define __MMX__ 1
// CHECK_BDVER1_M32: #define __PCLMUL__ 1
// CHECK_BDVER1_M32: #define __POPCNT__ 1
+// CHECK_BDVER1_M32: #define __PRFCHW__ 1
// CHECK_BDVER1_M32: #define __SSE2_MATH__ 1
// CHECK_BDVER1_M32: #define __SSE2__ 1
// CHECK_BDVER1_M32: #define __SSE3__ 1
@@ -1179,6 +1287,7 @@
// CHECK_BDVER1_M64: #define __MMX__ 1
// CHECK_BDVER1_M64: #define __PCLMUL__ 1
// CHECK_BDVER1_M64: #define __POPCNT__ 1
+// CHECK_BDVER1_M64: #define __PRFCHW__ 1
// CHECK_BDVER1_M64: #define __SSE2_MATH__ 1
// CHECK_BDVER1_M64: #define __SSE2__ 1
// CHECK_BDVER1_M64: #define __SSE3__ 1
@@ -1211,6 +1320,7 @@
// CHECK_BDVER2_M32: #define __MMX__ 1
// CHECK_BDVER2_M32: #define __PCLMUL__ 1
// CHECK_BDVER2_M32: #define __POPCNT__ 1
+// CHECK_BDVER2_M32: #define __PRFCHW__ 1
// CHECK_BDVER2_M32: #define __SSE2_MATH__ 1
// CHECK_BDVER2_M32: #define __SSE2__ 1
// CHECK_BDVER2_M32: #define __SSE3__ 1
@@ -1220,6 +1330,7 @@
// CHECK_BDVER2_M32: #define __SSE_MATH__ 1
// CHECK_BDVER2_M32: #define __SSE__ 1
// CHECK_BDVER2_M32: #define __SSSE3__ 1
+// CHECK_BDVER2_M32: #define __TBM__ 1
// CHECK_BDVER2_M32: #define __XOP__ 1
// CHECK_BDVER2_M32: #define __bdver2 1
// CHECK_BDVER2_M32: #define __bdver2__ 1
@@ -1241,6 +1352,7 @@
// CHECK_BDVER2_M64: #define __MMX__ 1
// CHECK_BDVER2_M64: #define __PCLMUL__ 1
// CHECK_BDVER2_M64: #define __POPCNT__ 1
+// CHECK_BDVER2_M64: #define __PRFCHW__ 1
// CHECK_BDVER2_M64: #define __SSE2_MATH__ 1
// CHECK_BDVER2_M64: #define __SSE2__ 1
// CHECK_BDVER2_M64: #define __SSE3__ 1
@@ -1250,6 +1362,7 @@
// CHECK_BDVER2_M64: #define __SSE_MATH__ 1
// CHECK_BDVER2_M64: #define __SSE__ 1
// CHECK_BDVER2_M64: #define __SSSE3__ 1
+// CHECK_BDVER2_M64: #define __TBM__ 1
// CHECK_BDVER2_M64: #define __XOP__ 1
// CHECK_BDVER2_M64: #define __amd64 1
// CHECK_BDVER2_M64: #define __amd64__ 1
@@ -1258,5 +1371,78 @@
// CHECK_BDVER2_M64: #define __tune_bdver2__ 1
// CHECK_BDVER2_M64: #define __x86_64 1
// CHECK_BDVER2_M64: #define __x86_64__ 1
+// RUN: %clang -march=bdver3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_BDVER3_M32
+// CHECK_BDVER3_M32-NOT: #define __3dNOW_A__ 1
+// CHECK_BDVER3_M32-NOT: #define __3dNOW__ 1
+// CHECK_BDVER3_M32: #define __AES__ 1
+// CHECK_BDVER3_M32: #define __AVX__ 1
+// CHECK_BDVER3_M32: #define __BMI__ 1
+// CHECK_BDVER3_M32: #define __F16C__ 1
+// CHECK_BDVER3_M32: #define __FMA4__ 1
+// CHECK_BDVER3_M32: #define __FMA__ 1
+// CHECK_BDVER3_M32: #define __LZCNT__ 1
+// CHECK_BDVER3_M32: #define __MMX__ 1
+// CHECK_BDVER3_M32: #define __PCLMUL__ 1
+// CHECK_BDVER3_M32: #define __POPCNT__ 1
+// CHECK_BDVER3_M32: #define __PRFCHW__ 1
+// CHECK_BDVER3_M32: #define __SSE2_MATH__ 1
+// CHECK_BDVER3_M32: #define __SSE2__ 1
+// CHECK_BDVER3_M32: #define __SSE3__ 1
+// CHECK_BDVER3_M32: #define __SSE4A__ 1
+// CHECK_BDVER3_M32: #define __SSE4_1__ 1
+// CHECK_BDVER3_M32: #define __SSE4_2__ 1
+// CHECK_BDVER3_M32: #define __SSE_MATH__ 1
+// CHECK_BDVER3_M32: #define __SSE__ 1
+// CHECK_BDVER3_M32: #define __SSSE3__ 1
+// CHECK_BDVER3_M32: #define __TBM__ 1
+// CHECK_BDVER3_M32: #define __XOP__ 1
+// CHECK_BDVER3_M32: #define __bdver3 1
+// CHECK_BDVER3_M32: #define __bdver3__ 1
+// CHECK_BDVER3_M32: #define __i386 1
+// CHECK_BDVER3_M32: #define __i386__ 1
+// CHECK_BDVER3_M32: #define __tune_bdver3__ 1
+// RUN: %clang -march=bdver3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_BDVER3_M64
+// CHECK_BDVER3_M64-NOT: #define __3dNOW_A__ 1
+// CHECK_BDVER3_M64-NOT: #define __3dNOW__ 1
+// CHECK_BDVER3_M64: #define __AES__ 1
+// CHECK_BDVER3_M64: #define __AVX__ 1
+// CHECK_BDVER3_M64: #define __BMI__ 1
+// CHECK_BDVER3_M64: #define __F16C__ 1
+// CHECK_BDVER3_M64: #define __FMA4__ 1
+// CHECK_BDVER3_M64: #define __FMA__ 1
+// CHECK_BDVER3_M64: #define __LZCNT__ 1
+// CHECK_BDVER3_M64: #define __MMX__ 1
+// CHECK_BDVER3_M64: #define __PCLMUL__ 1
+// CHECK_BDVER3_M64: #define __POPCNT__ 1
+// CHECK_BDVER3_M64: #define __PRFCHW__ 1
+// CHECK_BDVER3_M64: #define __SSE2_MATH__ 1
+// CHECK_BDVER3_M64: #define __SSE2__ 1
+// CHECK_BDVER3_M64: #define __SSE3__ 1
+// CHECK_BDVER3_M64: #define __SSE4A__ 1
+// CHECK_BDVER3_M64: #define __SSE4_1__ 1
+// CHECK_BDVER3_M64: #define __SSE4_2__ 1
+// CHECK_BDVER3_M64: #define __SSE_MATH__ 1
+// CHECK_BDVER3_M64: #define __SSE__ 1
+// CHECK_BDVER3_M64: #define __SSSE3__ 1
+// CHECK_BDVER3_M64: #define __TBM__ 1
+// CHECK_BDVER3_M64: #define __XOP__ 1
+// CHECK_BDVER3_M64: #define __amd64 1
+// CHECK_BDVER3_M64: #define __amd64__ 1
+// CHECK_BDVER3_M64: #define __bdver3 1
+// CHECK_BDVER3_M64: #define __bdver3__ 1
+// CHECK_BDVER3_M64: #define __tune_bdver3__ 1
+// CHECK_BDVER3_M64: #define __x86_64 1
+// CHECK_BDVER3_M64: #define __x86_64__ 1
//
// End X86/GCC/Linux tests ------------------
+
+// Begin PPC/GCC/Linux tests ----------------
+// RUN: %clang -mvsx -E -dM %s -o - 2>&1 \
+// RUN: -target powerpc64-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_PPC_VSX_M64
+//
+// CHECK_PPC_VSX_M64: #define __VSX__
diff --git a/test/Preprocessor/predefined-macros.c b/test/Preprocessor/predefined-macros.c
index 94671f3335c3..11449f930ef1 100644
--- a/test/Preprocessor/predefined-macros.c
+++ b/test/Preprocessor/predefined-macros.c
@@ -44,3 +44,21 @@
// CHECK-SYNC_CAS_I586: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
// CHECK-SYNC_CAS_I586: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
// CHECK-SYNC_CAS_I586: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
+//
+// RUN: %clang_cc1 %s -E -dM -o - -triple armv6 -target-cpu arm1136j-s \
+// RUN: | FileCheck %s --check-prefix=CHECK-SYNC_CAS_ARM
+// CHECK-SYNC_CAS_ARM: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
+// CHECK-SYNC_CAS_ARM: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
+// CHECK-SYNC_CAS_ARM: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+// CHECK-SYNC_CAS_ARM: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
+//
+// RUN: %clang_cc1 %s -E -dM -o - -triple armv7 -target-cpu cortex-a8 \
+// RUN: | FileCheck %s --check-prefix=CHECK-SYNC_CAS_ARMv7
+// CHECK-SYNC_CAS_ARMv7: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
+// CHECK-SYNC_CAS_ARMv7: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
+// CHECK-SYNC_CAS_ARMv7: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+// CHECK-SYNC_CAS_ARMv7: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
+//
+// RUN: %clang_cc1 %s -E -dM -o - -triple armv6 -target-cpu cortex-m0 \
+// RUN: | FileCheck %s --check-prefix=CHECK-SYNC_CAS_ARMv6
+// CHECK-SYNC_CAS_ARMv6-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP
diff --git a/test/Preprocessor/stdint.c b/test/Preprocessor/stdint.c
index c3be05d97cd0..b92cfe7cf37a 100644
--- a/test/Preprocessor/stdint.c
+++ b/test/Preprocessor/stdint.c
@@ -213,6 +213,220 @@
// I386:INTMAX_C_(0) 0LL
// I386:UINTMAX_C_(0) 0ULL
//
+// RUN: %clang_cc1 -E -ffreestanding -triple=mips-none-none %s | FileCheck -check-prefix MIPS %s
+//
+// MIPS:typedef signed long long int int64_t;
+// MIPS:typedef unsigned long long int uint64_t;
+// MIPS:typedef int64_t int_least64_t;
+// MIPS:typedef uint64_t uint_least64_t;
+// MIPS:typedef int64_t int_fast64_t;
+// MIPS:typedef uint64_t uint_fast64_t;
+//
+// MIPS:typedef signed int int32_t;
+// MIPS:typedef unsigned int uint32_t;
+// MIPS:typedef int32_t int_least32_t;
+// MIPS:typedef uint32_t uint_least32_t;
+// MIPS:typedef int32_t int_fast32_t;
+// MIPS:typedef uint32_t uint_fast32_t;
+//
+// MIPS:typedef signed short int16_t;
+// MIPS:typedef unsigned short uint16_t;
+// MIPS:typedef int16_t int_least16_t;
+// MIPS:typedef uint16_t uint_least16_t;
+// MIPS:typedef int16_t int_fast16_t;
+// MIPS:typedef uint16_t uint_fast16_t;
+//
+// MIPS:typedef signed char int8_t;
+// MIPS:typedef unsigned char uint8_t;
+// MIPS:typedef int8_t int_least8_t;
+// MIPS:typedef uint8_t uint_least8_t;
+// MIPS:typedef int8_t int_fast8_t;
+// MIPS:typedef uint8_t uint_fast8_t;
+//
+// MIPS:typedef int32_t intptr_t;
+// MIPS:typedef uint32_t uintptr_t;
+//
+// MIPS:typedef long long int intmax_t;
+// MIPS:typedef long long unsigned int uintmax_t;
+//
+// MIPS:INT8_MAX_ 127
+// MIPS:INT8_MIN_ (-127 -1)
+// MIPS:UINT8_MAX_ 255
+// MIPS:INT_LEAST8_MIN_ (-127 -1)
+// MIPS:INT_LEAST8_MAX_ 127
+// MIPS:UINT_LEAST8_MAX_ 255
+// MIPS:INT_FAST8_MIN_ (-127 -1)
+// MIPS:INT_FAST8_MAX_ 127
+// MIPS:UINT_FAST8_MAX_ 255
+//
+// MIPS:INT16_MAX_ 32767
+// MIPS:INT16_MIN_ (-32767 -1)
+// MIPS:UINT16_MAX_ 65535
+// MIPS:INT_LEAST16_MIN_ (-32767 -1)
+// MIPS:INT_LEAST16_MAX_ 32767
+// MIPS:UINT_LEAST16_MAX_ 65535
+// MIPS:INT_FAST16_MIN_ (-32767 -1)
+// MIPS:INT_FAST16_MAX_ 32767
+// MIPS:UINT_FAST16_MAX_ 65535
+//
+// MIPS:INT32_MAX_ 2147483647
+// MIPS:INT32_MIN_ (-2147483647 -1)
+// MIPS:UINT32_MAX_ 4294967295U
+// MIPS:INT_LEAST32_MIN_ (-2147483647 -1)
+// MIPS:INT_LEAST32_MAX_ 2147483647
+// MIPS:UINT_LEAST32_MAX_ 4294967295U
+// MIPS:INT_FAST32_MIN_ (-2147483647 -1)
+// MIPS:INT_FAST32_MAX_ 2147483647
+// MIPS:UINT_FAST32_MAX_ 4294967295U
+//
+// MIPS:INT64_MAX_ 9223372036854775807LL
+// MIPS:INT64_MIN_ (-9223372036854775807LL -1)
+// MIPS:UINT64_MAX_ 18446744073709551615ULL
+// MIPS:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
+// MIPS:INT_LEAST64_MAX_ 9223372036854775807LL
+// MIPS:UINT_LEAST64_MAX_ 18446744073709551615ULL
+// MIPS:INT_FAST64_MIN_ (-9223372036854775807LL -1)
+// MIPS:INT_FAST64_MAX_ 9223372036854775807LL
+// MIPS:UINT_FAST64_MAX_ 18446744073709551615ULL
+//
+// MIPS:INTPTR_MIN_ (-2147483647 -1)
+// MIPS:INTPTR_MAX_ 2147483647
+// MIPS:UINTPTR_MAX_ 4294967295U
+// MIPS:PTRDIFF_MIN_ (-2147483647 -1)
+// MIPS:PTRDIFF_MAX_ 2147483647
+// MIPS:SIZE_MAX_ 4294967295U
+//
+// MIPS:INTMAX_MIN_ (-9223372036854775807LL -1)
+// MIPS:INTMAX_MAX_ 9223372036854775807LL
+// MIPS:UINTMAX_MAX_ 18446744073709551615ULL
+//
+// MIPS:SIG_ATOMIC_MIN_ (-2147483647 -1)
+// MIPS:SIG_ATOMIC_MAX_ 2147483647
+// MIPS:WINT_MIN_ (-2147483647 -1)
+// MIPS:WINT_MAX_ 2147483647
+//
+// MIPS:WCHAR_MAX_ 2147483647
+// MIPS:WCHAR_MIN_ (-2147483647 -1)
+//
+// MIPS:INT8_C_(0) 0
+// MIPS:UINT8_C_(0) 0U
+// MIPS:INT16_C_(0) 0
+// MIPS:UINT16_C_(0) 0U
+// MIPS:INT32_C_(0) 0
+// MIPS:UINT32_C_(0) 0U
+// MIPS:INT64_C_(0) 0LL
+// MIPS:UINT64_C_(0) 0ULL
+//
+// MIPS:INTMAX_C_(0) 0LL
+// MIPS:UINTMAX_C_(0) 0ULL
+//
+// RUN: %clang_cc1 -E -ffreestanding -triple=mips64-none-none %s | FileCheck -check-prefix MIPS64 %s
+//
+// MIPS64:typedef signed long long int int64_t;
+// MIPS64:typedef unsigned long long int uint64_t;
+// MIPS64:typedef int64_t int_least64_t;
+// MIPS64:typedef uint64_t uint_least64_t;
+// MIPS64:typedef int64_t int_fast64_t;
+// MIPS64:typedef uint64_t uint_fast64_t;
+//
+// MIPS64:typedef signed int int32_t;
+// MIPS64:typedef unsigned int uint32_t;
+// MIPS64:typedef int32_t int_least32_t;
+// MIPS64:typedef uint32_t uint_least32_t;
+// MIPS64:typedef int32_t int_fast32_t;
+// MIPS64:typedef uint32_t uint_fast32_t;
+//
+// MIPS64:typedef signed short int16_t;
+// MIPS64:typedef unsigned short uint16_t;
+// MIPS64:typedef int16_t int_least16_t;
+// MIPS64:typedef uint16_t uint_least16_t;
+// MIPS64:typedef int16_t int_fast16_t;
+// MIPS64:typedef uint16_t uint_fast16_t;
+//
+// MIPS64:typedef signed char int8_t;
+// MIPS64:typedef unsigned char uint8_t;
+// MIPS64:typedef int8_t int_least8_t;
+// MIPS64:typedef uint8_t uint_least8_t;
+// MIPS64:typedef int8_t int_fast8_t;
+// MIPS64:typedef uint8_t uint_fast8_t;
+//
+// MIPS64:typedef int64_t intptr_t;
+// MIPS64:typedef uint64_t uintptr_t;
+//
+// MIPS64:typedef long long int intmax_t;
+// MIPS64:typedef long long unsigned int uintmax_t;
+//
+// MIPS64:INT8_MAX_ 127
+// MIPS64:INT8_MIN_ (-127 -1)
+// MIPS64:UINT8_MAX_ 255
+// MIPS64:INT_LEAST8_MIN_ (-127 -1)
+// MIPS64:INT_LEAST8_MAX_ 127
+// MIPS64:UINT_LEAST8_MAX_ 255
+// MIPS64:INT_FAST8_MIN_ (-127 -1)
+// MIPS64:INT_FAST8_MAX_ 127
+// MIPS64:UINT_FAST8_MAX_ 255
+//
+// MIPS64:INT16_MAX_ 32767
+// MIPS64:INT16_MIN_ (-32767 -1)
+// MIPS64:UINT16_MAX_ 65535
+// MIPS64:INT_LEAST16_MIN_ (-32767 -1)
+// MIPS64:INT_LEAST16_MAX_ 32767
+// MIPS64:UINT_LEAST16_MAX_ 65535
+// MIPS64:INT_FAST16_MIN_ (-32767 -1)
+// MIPS64:INT_FAST16_MAX_ 32767
+// MIPS64:UINT_FAST16_MAX_ 65535
+//
+// MIPS64:INT32_MAX_ 2147483647
+// MIPS64:INT32_MIN_ (-2147483647 -1)
+// MIPS64:UINT32_MAX_ 4294967295U
+// MIPS64:INT_LEAST32_MIN_ (-2147483647 -1)
+// MIPS64:INT_LEAST32_MAX_ 2147483647
+// MIPS64:UINT_LEAST32_MAX_ 4294967295U
+// MIPS64:INT_FAST32_MIN_ (-2147483647 -1)
+// MIPS64:INT_FAST32_MAX_ 2147483647
+// MIPS64:UINT_FAST32_MAX_ 4294967295U
+//
+// MIPS64:INT64_MAX_ 9223372036854775807LL
+// MIPS64:INT64_MIN_ (-9223372036854775807LL -1)
+// MIPS64:UINT64_MAX_ 18446744073709551615ULL
+// MIPS64:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
+// MIPS64:INT_LEAST64_MAX_ 9223372036854775807LL
+// MIPS64:UINT_LEAST64_MAX_ 18446744073709551615ULL
+// MIPS64:INT_FAST64_MIN_ (-9223372036854775807LL -1)
+// MIPS64:INT_FAST64_MAX_ 9223372036854775807LL
+// MIPS64:UINT_FAST64_MAX_ 18446744073709551615ULL
+//
+// MIPS64:INTPTR_MIN_ (-9223372036854775807LL -1)
+// MIPS64:INTPTR_MAX_ 9223372036854775807LL
+// MIPS64:UINTPTR_MAX_ 18446744073709551615ULL
+// MIPS64:PTRDIFF_MIN_ (-9223372036854775807LL -1)
+// MIPS64:PTRDIFF_MAX_ 9223372036854775807LL
+// MIPS64:SIZE_MAX_ 18446744073709551615ULL
+//
+// MIPS64:INTMAX_MIN_ (-9223372036854775807LL -1)
+// MIPS64:INTMAX_MAX_ 9223372036854775807LL
+// MIPS64:UINTMAX_MAX_ 18446744073709551615ULL
+//
+// MIPS64:SIG_ATOMIC_MIN_ (-2147483647 -1)
+// MIPS64:SIG_ATOMIC_MAX_ 2147483647
+// MIPS64:WINT_MIN_ (-2147483647 -1)
+// MIPS64:WINT_MAX_ 2147483647
+//
+// MIPS64:WCHAR_MAX_ 2147483647
+// MIPS64:WCHAR_MIN_ (-2147483647 -1)
+//
+// MIPS64:INT8_C_(0) 0
+// MIPS64:UINT8_C_(0) 0U
+// MIPS64:INT16_C_(0) 0
+// MIPS64:UINT16_C_(0) 0U
+// MIPS64:INT32_C_(0) 0
+// MIPS64:UINT32_C_(0) 0U
+// MIPS64:INT64_C_(0) 0LL
+// MIPS64:UINT64_C_(0) 0ULL
+//
+// MIPS64:INTMAX_C_(0) 0LL
+// MIPS64:UINTMAX_C_(0) 0ULL
+//
// RUN: %clang_cc1 -E -ffreestanding -triple=msp430-none-none %s | FileCheck -check-prefix MSP430 %s
//
// MSP430:typedef signed long int int32_t;
@@ -239,8 +453,8 @@
// MSP430:typedef int16_t intptr_t;
// MSP430:typedef uint16_t uintptr_t;
//
-// MSP430:typedef long int intmax_t;
-// MSP430:typedef long unsigned int uintmax_t;
+// MSP430:typedef long long int intmax_t;
+// MSP430:typedef long long unsigned int uintmax_t;
//
// MSP430:INT8_MAX_ 127
// MSP430:INT8_MIN_ (-127 -1)
@@ -289,9 +503,9 @@
// MSP430:PTRDIFF_MAX_ 32767
// MSP430:SIZE_MAX_ 65535
//
-// MSP430:INTMAX_MIN_ (-2147483647L -1)
-// MSP430:INTMAX_MAX_ 2147483647L
-// MSP430:UINTMAX_MAX_ 4294967295UL
+// MSP430:INTMAX_MIN_ (-9223372036854775807LL -1)
+// MSP430:INTMAX_MAX_ 9223372036854775807LL
+// MSP430:UINTMAX_MAX_ 18446744073709551615ULL
//
// MSP430:SIG_ATOMIC_MIN_ (-2147483647L -1)
// MSP430:SIG_ATOMIC_MAX_ 2147483647L
@@ -963,6 +1177,114 @@
// I386_MINGW32:WCHAR_MIN_ 0U
//
//
+// RUN: %clang_cc1 -E -ffreestanding -triple=xcore-none-none %s | FileCheck -check-prefix XCORE %s
+//
+// XCORE:typedef signed long long int int64_t;
+// XCORE:typedef unsigned long long int uint64_t;
+// XCORE:typedef int64_t int_least64_t;
+// XCORE:typedef uint64_t uint_least64_t;
+// XCORE:typedef int64_t int_fast64_t;
+// XCORE:typedef uint64_t uint_fast64_t;
+//
+// XCORE:typedef signed int int32_t;
+// XCORE:typedef unsigned int uint32_t;
+// XCORE:typedef int32_t int_least32_t;
+// XCORE:typedef uint32_t uint_least32_t;
+// XCORE:typedef int32_t int_fast32_t;
+// XCORE:typedef uint32_t uint_fast32_t;
+//
+// XCORE:typedef signed short int16_t;
+// XCORE:typedef unsigned short uint16_t;
+// XCORE:typedef int16_t int_least16_t;
+// XCORE:typedef uint16_t uint_least16_t;
+// XCORE:typedef int16_t int_fast16_t;
+// XCORE:typedef uint16_t uint_fast16_t;
+//
+// XCORE:typedef signed char int8_t;
+// XCORE:typedef unsigned char uint8_t;
+// XCORE:typedef int8_t int_least8_t;
+// XCORE:typedef uint8_t uint_least8_t;
+// XCORE:typedef int8_t int_fast8_t;
+// XCORE:typedef uint8_t uint_fast8_t;
+//
+// XCORE:typedef int32_t intptr_t;
+// XCORE:typedef uint32_t uintptr_t;
+//
+// XCORE:typedef long long int intmax_t;
+// XCORE:typedef long long unsigned int uintmax_t;
+//
+// XCORE:INT8_MAX_ 127
+// XCORE:INT8_MIN_ (-127 -1)
+// XCORE:UINT8_MAX_ 255
+// XCORE:INT_LEAST8_MIN_ (-127 -1)
+// XCORE:INT_LEAST8_MAX_ 127
+// XCORE:UINT_LEAST8_MAX_ 255
+// XCORE:INT_FAST8_MIN_ (-127 -1)
+// XCORE:INT_FAST8_MAX_ 127
+// XCORE:UINT_FAST8_MAX_ 255
+//
+// XCORE:INT16_MAX_ 32767
+// XCORE:INT16_MIN_ (-32767 -1)
+// XCORE:UINT16_MAX_ 65535
+// XCORE:INT_LEAST16_MIN_ (-32767 -1)
+// XCORE:INT_LEAST16_MAX_ 32767
+// XCORE:UINT_LEAST16_MAX_ 65535
+// XCORE:INT_FAST16_MIN_ (-32767 -1)
+// XCORE:INT_FAST16_MAX_ 32767
+// XCORE:UINT_FAST16_MAX_ 65535
+//
+// XCORE:INT32_MAX_ 2147483647
+// XCORE:INT32_MIN_ (-2147483647 -1)
+// XCORE:UINT32_MAX_ 4294967295U
+// XCORE:INT_LEAST32_MIN_ (-2147483647 -1)
+// XCORE:INT_LEAST32_MAX_ 2147483647
+// XCORE:UINT_LEAST32_MAX_ 4294967295U
+// XCORE:INT_FAST32_MIN_ (-2147483647 -1)
+// XCORE:INT_FAST32_MAX_ 2147483647
+// XCORE:UINT_FAST32_MAX_ 4294967295U
+//
+// XCORE:INT64_MAX_ 9223372036854775807LL
+// XCORE:INT64_MIN_ (-9223372036854775807LL -1)
+// XCORE:UINT64_MAX_ 18446744073709551615ULL
+// XCORE:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
+// XCORE:INT_LEAST64_MAX_ 9223372036854775807LL
+// XCORE:UINT_LEAST64_MAX_ 18446744073709551615ULL
+// XCORE:INT_FAST64_MIN_ (-9223372036854775807LL -1)
+// XCORE:INT_FAST64_MAX_ 9223372036854775807LL
+// XCORE:UINT_FAST64_MAX_ 18446744073709551615ULL
+//
+// XCORE:INTPTR_MIN_ (-2147483647 -1)
+// XCORE:INTPTR_MAX_ 2147483647
+// XCORE:UINTPTR_MAX_ 4294967295U
+// XCORE:PTRDIFF_MIN_ (-2147483647 -1)
+// XCORE:PTRDIFF_MAX_ 2147483647
+// XCORE:SIZE_MAX_ 4294967295U
+//
+// XCORE:INTMAX_MIN_ (-9223372036854775807LL -1)
+// XCORE:INTMAX_MAX_ 9223372036854775807LL
+// XCORE:UINTMAX_MAX_ 18446744073709551615ULL
+//
+// XCORE:SIG_ATOMIC_MIN_ (-2147483647 -1)
+// XCORE:SIG_ATOMIC_MAX_ 2147483647
+// XCORE:WINT_MIN_ 0U
+// XCORE:WINT_MAX_ 4294967295U
+//
+// XCORE:WCHAR_MAX_ 255U
+// XCORE:WCHAR_MIN_ 0
+//
+// XCORE:INT8_C_(0) 0
+// XCORE:UINT8_C_(0) 0U
+// XCORE:INT16_C_(0) 0
+// XCORE:UINT16_C_(0) 0U
+// XCORE:INT32_C_(0) 0
+// XCORE:UINT32_C_(0) 0U
+// XCORE:INT64_C_(0) 0LL
+// XCORE:UINT64_C_(0) 0ULL
+//
+// XCORE:INTMAX_C_(0) 0LL
+// XCORE:UINTMAX_C_(0) 0ULL
+//
+//
// stdint.h forms several macro definitions by pasting together identifiers
// to form names (eg. int32_t is formed from int ## 32 ## _t). The following
// case tests that these joining operations are performed correctly even if
diff --git a/test/Preprocessor/traditional-cpp.c b/test/Preprocessor/traditional-cpp.c
index 4c4633e03920..aa9f0f146e4c 100644
--- a/test/Preprocessor/traditional-cpp.c
+++ b/test/Preprocessor/traditional-cpp.c
@@ -3,9 +3,9 @@
* things like using /usr/bin/cpp to preprocess non-source files. */
/*
- RUN: %clang_cc1 -traditional-cpp %s -E -o %t
- RUN: FileCheck -strict-whitespace < %t %s
+ RUN: %clang_cc1 -traditional-cpp %s -E | FileCheck -strict-whitespace %s
RUN: %clang_cc1 -traditional-cpp %s -E -C | FileCheck -check-prefix=CHECK-COMMENTS %s
+ RUN: %clang_cc1 -traditional-cpp -x c++ %s -E | FileCheck -check-prefix=CHECK-CXX %s
*/
/* -traditional-cpp should eliminate all C89 comments. */
@@ -13,7 +13,9 @@
* CHECK-COMMENTS: {{^}}/* -traditional-cpp should eliminate all C89 comments. *{{/$}}
*/
+/* -traditional-cpp should only eliminate "//" comments in C++ mode. */
/* CHECK: {{^}}foo // bar{{$}}
+ * CHECK-CXX: {{^}}foo {{$}}
*/
foo // bar
@@ -88,3 +90,20 @@ a b c in skipped block
Preserve URLs: http://clang.llvm.org
/* CHECK: {{^}}Preserve URLs: http://clang.llvm.org{{$}}
*/
+
+/* The following tests ensure we ignore # and ## in macro bodies */
+
+#define FOO_NO_STRINGIFY(a) test(# a)
+FOO_NO_STRINGIFY(foobar)
+/* CHECK: {{^}}test(# foobar){{$}}
+ */
+
+#define FOO_NO_PASTE(a, b) test(b##a)
+FOO_NO_PASTE(foo,bar)
+/* CHECK {{^}}test(bar##foo){{$}}
+ */
+
+#define BAR_NO_STRINGIFY(a) test(#a)
+BAR_NO_STRINGIFY(foobar)
+/* CHECK: {{^}}test(#foobar){{$}}
+ */
diff --git a/test/Preprocessor/ucn-pp-identifier.c b/test/Preprocessor/ucn-pp-identifier.c
index 8616d40ec3f7..6936ed92cb59 100644
--- a/test/Preprocessor/ucn-pp-identifier.c
+++ b/test/Preprocessor/ucn-pp-identifier.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -fsyntax-only -std=c99 -pedantic -verify -Wundef
// RUN: %clang_cc1 %s -fsyntax-only -x c++ -pedantic -verify -Wundef
-// RUN: %clang_cc1 %s -fsyntax-only -std=c99 -pedantic -Wundef 2>&1 | FileCheck -strict-whitespace %s
+// RUN: not %clang_cc1 %s -fsyntax-only -std=c99 -pedantic -Wundef 2>&1 | FileCheck -strict-whitespace %s
#define \u00FC
#define a\u00FD() 0
diff --git a/test/Preprocessor/warn-macro-unused.c b/test/Preprocessor/warn-macro-unused.c
index c33aeb5df9d9..a305cc9966ad 100644
--- a/test/Preprocessor/warn-macro-unused.c
+++ b/test/Preprocessor/warn-macro-unused.c
@@ -2,6 +2,10 @@
#include "warn-macro-unused.h"
+# 1 "warn-macro-unused-fake-header.h" 1
+#define unused_from_fake_header
+# 5 "warn-macro-unused.c" 2
+
#define unused // expected-warning {{macro is not used}}
#define unused
unused
diff --git a/test/Preprocessor/x86_target_features.c b/test/Preprocessor/x86_target_features.c
index ad7ee85eb234..751c8ae95853 100644
--- a/test/Preprocessor/x86_target_features.c
+++ b/test/Preprocessor/x86_target_features.c
@@ -1,32 +1,238 @@
-// RUN: %clang -target 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 -target 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 -target 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 -target i386-unknown-unknown -march=core2 -msse4 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE4 %s
+// SSE4: #define __SSE2_MATH__ 1
+// SSE4: #define __SSE2__ 1
+// SSE4: #define __SSE3__ 1
+// SSE4: #define __SSE4_1__ 1
+// SSE4: #define __SSE4_2__ 1
+// SSE4: #define __SSE_MATH__ 1
+// SSE4: #define __SSE__ 1
+// SSE4: #define __SSSE3__ 1
+// RUN: %clang -target i386-unknown-unknown -march=core2 -msse4 -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE %s
+
+// SSE-NOT: #define __SSE2_MATH__ 1
+// SSE-NOT: #define __SSE2__ 1
+// SSE-NOT: #define __SSE3__ 1
+// SSE-NOT: #define __SSE4_1__ 1
+// SSE-NOT: #define __SSE4_2__ 1
+// SSE: #define __SSE_MATH__ 1
+// SSE: #define __SSE__ 1
+// SSE-NOT: #define __SSSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=pentium-m -x c -E -dM -o - %s | FileCheck --check-prefix=SSE2 %s
+
+// SSE2: #define __SSE2_MATH__ 1
+// SSE2: #define __SSE2__ 1
+// SSE2-NOT: #define __SSE3__ 1
+// SSE2-NOT: #define __SSE4_1__ 1
+// SSE2-NOT: #define __SSE4_2__ 1
+// SSE2: #define __SSE_MATH__ 1
+// SSE2: #define __SSE__ 1
+// SSE2-NOT: #define __SSSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=pentium-m -mno-sse -mavx -x c -E -dM -o - %s | FileCheck --check-prefix=AVX %s
+
+// AVX: #define __AVX__ 1
+// AVX: #define __SSE2_MATH__ 1
+// AVX: #define __SSE2__ 1
+// AVX: #define __SSE3__ 1
+// AVX: #define __SSE4_1__ 1
+// AVX: #define __SSE4_2__ 1
+// AVX: #define __SSE_MATH__ 1
+// AVX: #define __SSE__ 1
+// AVX: #define __SSSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=pentium-m -mxop -mno-avx -x c -E -dM -o - %s | FileCheck --check-prefix=SSE4A %s
+
+// SSE4A: #define __SSE2_MATH__ 1
+// SSE4A: #define __SSE2__ 1
+// SSE4A: #define __SSE3__ 1
+// SSE4A: #define __SSE4A__ 1
+// SSE4A: #define __SSE4_1__ 1
+// SSE4A: #define __SSE4_2__ 1
+// SSE4A: #define __SSE_MATH__ 1
+// SSE4A: #define __SSE__ 1
+// SSE4A: #define __SSSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mavx512f -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512F %s
+
+// AVX512F: #define __AVX2__ 1
+// AVX512F: #define __AVX512F__ 1
+// AVX512F: #define __AVX__ 1
+// AVX512F: #define __SSE2_MATH__ 1
+// AVX512F: #define __SSE2__ 1
+// AVX512F: #define __SSE3__ 1
+// AVX512F: #define __SSE4_1__ 1
+// AVX512F: #define __SSE4_2__ 1
+// AVX512F: #define __SSE_MATH__ 1
+// AVX512F: #define __SSE__ 1
+// AVX512F: #define __SSSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mavx512cd -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512CD %s
+
+// AVX512CD: #define __AVX2__ 1
+// AVX512CD: #define __AVX512CD__ 1
+// AVX512CD: #define __AVX512F__ 1
+// AVX512CD: #define __AVX__ 1
+// AVX512CD: #define __SSE2_MATH__ 1
+// AVX512CD: #define __SSE2__ 1
+// AVX512CD: #define __SSE3__ 1
+// AVX512CD: #define __SSE4_1__ 1
+// AVX512CD: #define __SSE4_2__ 1
+// AVX512CD: #define __SSE_MATH__ 1
+// AVX512CD: #define __SSE__ 1
+// AVX512CD: #define __SSSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mavx512er -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512ER %s
+
+// AVX512ER: #define __AVX2__ 1
+// AVX512ER: #define __AVX512ER__ 1
+// AVX512ER: #define __AVX512F__ 1
+// AVX512ER: #define __AVX__ 1
+// AVX512ER: #define __SSE2_MATH__ 1
+// AVX512ER: #define __SSE2__ 1
+// AVX512ER: #define __SSE3__ 1
+// AVX512ER: #define __SSE4_1__ 1
+// AVX512ER: #define __SSE4_2__ 1
+// AVX512ER: #define __SSE_MATH__ 1
+// AVX512ER: #define __SSE__ 1
+// AVX512ER: #define __SSSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mavx512pf -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512PF %s
+
+// AVX512PF: #define __AVX2__ 1
+// AVX512PF: #define __AVX512F__ 1
+// AVX512PF: #define __AVX512PF__ 1
+// AVX512PF: #define __AVX__ 1
+// AVX512PF: #define __SSE2_MATH__ 1
+// AVX512PF: #define __SSE2__ 1
+// AVX512PF: #define __SSE3__ 1
+// AVX512PF: #define __SSE4_1__ 1
+// AVX512PF: #define __SSE4_2__ 1
+// AVX512PF: #define __SSE_MATH__ 1
+// AVX512PF: #define __SSE__ 1
+// AVX512PF: #define __SSSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mavx512pf -mno-avx512f -x c -E -dM -o - %s | FileCheck --check-prefix=AVX512F2 %s
+
+// AVX512F2: #define __AVX2__ 1
+// AVX512F2-NOT: #define __AVX512F__ 1
+// AVX512F2-NOT: #define __AVX512PF__ 1
+// AVX512F2: #define __AVX__ 1
+// AVX512F2: #define __SSE2_MATH__ 1
+// AVX512F2: #define __SSE2__ 1
+// AVX512F2: #define __SSE3__ 1
+// AVX512F2: #define __SSE4_1__ 1
+// AVX512F2: #define __SSE4_2__ 1
+// AVX512F2: #define __SSE_MATH__ 1
+// AVX512F2: #define __SSE__ 1
+// AVX512F2: #define __SSSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -msse4.2 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE42POPCNT %s
+
+// SSE42POPCNT: #define __POPCNT__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mno-popcnt -msse4.2 -x c -E -dM -o - %s | FileCheck --check-prefix=SSE42NOPOPCNT %s
+
+// SSE42NOPOPCNT-NOT: #define __POPCNT__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mpopcnt -mno-sse4.2 -x c -E -dM -o - %s | FileCheck --check-prefix=NOSSE42POPCNT %s
+
+// NOSSE42POPCNT: #define __POPCNT__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -msse -x c -E -dM -o - %s | FileCheck --check-prefix=SSEMMX %s
+
+// SSEMMX: #define __MMX__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -msse -mno-sse -x c -E -dM -o - %s | FileCheck --check-prefix=SSENOSSEMMX %s
+
+// SSENOSSEMMX-NOT: #define __MMX__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -msse -mno-mmx -x c -E -dM -o - %s | FileCheck --check-prefix=SSENOMMX %s
+
+// SSENOMMX-NOT: #define __MMX__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mf16c -x c -E -dM -o - %s | FileCheck --check-prefix=F16C %s
+
+// F16C: #define __AVX__ 1
+// F16C: #define __F16C__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mf16c -mno-avx -x c -E -dM -o - %s | FileCheck --check-prefix=F16CNOAVX %s
+
+// F16CNOAVX-NOT: #define __AVX__ 1
+// F16CNOAVX-NOT: #define __F16C__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=pentiumpro -mpclmul -x c -E -dM -o - %s | FileCheck --check-prefix=PCLMUL %s
+
+// PCLMUL: #define __PCLMUL__ 1
+// PCLMUL: #define __SSE2__ 1
+// PCLMUL-NOT: #define __SSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=pentiumpro -mpclmul -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=PCLMULNOSSE2 %s
+
+// PCLMULNOSSE2-NOT: #define __PCLMUL__ 1
+// PCLMULNOSSE2-NOT: #define __SSE2__ 1
+// PCLMULNOSSE2-NOT: #define __SSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=pentiumpro -maes -x c -E -dM -o - %s | FileCheck --check-prefix=AES %s
+
+// AES: #define __AES__ 1
+// AES: #define __SSE2__ 1
+// AES-NOT: #define __SSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=pentiumpro -maes -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=AESNOSSE2 %s
+
+// AESNOSSE2-NOT: #define __AES__ 1
+// AESNOSSE2-NOT: #define __SSE2__ 1
+// AESNOSSE2-NOT: #define __SSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=pentiumpro -msha -x c -E -dM -o - %s | FileCheck --check-prefix=SHA %s
+
+// SHA: #define __SHA__ 1
+// SHA: #define __SSE2__ 1
+// SHA-NOT: #define __SSE3__ 1
+
+// run: %clang -target i386-unknown-unknown -march=pentiumpro -msha -mno-sha -x c -e -dm -o - %s | filecheck --check-prefix=SHANOSHA %s
+
+// SHANOSHA-NOT: #define __SHA__ 1
+// SHANOSHA-NOT: #define __SSE2__ 1
+
+// run: %clang -target i386-unknown-unknown -march=pentiumpro -msha -mno-sse2 -x c -e -dm -o - %s | filecheck --check-prefix=SHANOSSE2 %s
+
+// SHANOSSSE2-NOT: #define __SHA__ 1
+// SHANOSSSE2-NOT: #define __SSE2__ 1
+// SHANOSSSE2-NOT: #define __SSE3__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mtbm -x c -E -dM -o - %s | FileCheck --check-prefix=TBM %s
+
+// TBM: #define __TBM__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=bdver2 -mno-tbm -x c -E -dM -o - %s | FileCheck --check-prefix=NOTBM %s
+
+// NOTBM-NOT: #define __TBM__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=pentiumpro -mcx16 -x c -E -dM -o - %s | FileCheck --check-prefix=MCX16 %s
+
+// MCX16: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mprfchw -x c -E -dM -o - %s | FileCheck --check-prefix=PRFCHW %s
+
+// PRFCHW: #define __PRFCHW__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=btver2 -mno-prfchw -x c -E -dM -o - %s | FileCheck --check-prefix=NOPRFCHW %s
+
+// NOPRFCHW-NOT: #define __PRFCHW__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -m3dnow -x c -E -dM -o - %s | FileCheck --check-prefix=3DNOWPRFCHW %s
+
+// 3DNOWPRFCHW: #define __PRFCHW__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mno-prfchw -m3dnow -x c -E -dM -o - %s | FileCheck --check-prefix=3DNOWNOPRFCHW %s
+
+// 3DNOWNOPRFCHW-NOT: #define __PRFCHW__ 1
+
+// RUN: %clang -target i386-unknown-unknown -march=atom -mprfchw -mno-3dnow -x c -E -dM -o - %s | FileCheck --check-prefix=NO3DNOWPRFCHW %s
+
+// NO3DNOWPRFCHW: #define __PRFCHW__ 1
diff --git a/test/Rewriter/blockcast3.mm b/test/Rewriter/blockcast3.mm
index 697a465a9317..1d82609cfb56 100644
--- a/test/Rewriter/blockcast3.mm
+++ b/test/Rewriter/blockcast3.mm
@@ -1,8 +1,8 @@
// RUN: %clang_cc1 -E %s -o %t.mm
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %t.mm -o %t-rw.cpp
-// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o %t-modern-rw.cpp
-// RUN: FileCheck -check-prefix LP --input-file=%t-modern-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-modern-rw.cpp %s
// radar 7607781
typedef struct {
diff --git a/test/Rewriter/dllimport-typedef.c b/test/Rewriter/dllimport-typedef.c
index 72cea70cf2d6..97610ddb28e1 100644
--- a/test/Rewriter/dllimport-typedef.c
+++ b/test/Rewriter/dllimport-typedef.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i686-pc-win32 -fms-extensions -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-NEG %s
-// RUN: %clang_cc1 -triple i686-pc-win32 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-POS %s
+// RUN: not %clang_cc1 -triple i686-pc-win32 -fms-extensions -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-NEG %s
+// RUN: not %clang_cc1 -triple i686-pc-win32 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-POS %s
// Do not report an error with including dllimport in the typedef when -fms-extensions is specified.
// Addresses <rdar://problem/7653870>.
diff --git a/test/Rewriter/inner-block-helper-funcs.mm b/test/Rewriter/inner-block-helper-funcs.mm
index fb565b6e30f3..92ef7e933615 100644
--- a/test/Rewriter/inner-block-helper-funcs.mm
+++ b/test/Rewriter/inner-block-helper-funcs.mm
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
-// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
// rdar://9846759
typedef void (^dispatch_block_t)(void);
diff --git a/test/Rewriter/line-generation-test.m b/test/Rewriter/line-generation-test.m
index dad7371eb165..0e666e1f5fbc 100644
--- a/test/Rewriter/line-generation-test.m
+++ b/test/Rewriter/line-generation-test.m
@@ -1,8 +1,8 @@
// RUN: %clang_cc1 -E %s -o %t.mm
// RUN: %clang_cc1 -fms-extensions -rewrite-objc -g %t.mm -o %t-rw.cpp
-// RUN: FileCheck -check-prefix LINE --input-file=%t-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LINE --input-file=%t-rw.cpp %s
// RUN: %clang_cc1 -fms-extensions -rewrite-objc %t.mm -o %t-rwnog.cpp
-// RUN: FileCheck -check-prefix NOLINE --input-file=%t-rwnog.cpp %s
+// RUN: FileCheck -check-prefix CHECK-NOLINE --input-file=%t-rwnog.cpp %s
// rdar://13138170
__attribute__((objc_root_class)) @interface MyObject {
diff --git a/test/Rewriter/lit.local.cfg b/test/Rewriter/lit.local.cfg
new file mode 100644
index 000000000000..5bbc711c656d
--- /dev/null
+++ b/test/Rewriter/lit.local.cfg
@@ -0,0 +1,2 @@
+if config.root.clang_rewriter == 0:
+ config.unsupported = True
diff --git a/test/Rewriter/missing-dllimport.c b/test/Rewriter/missing-dllimport.c
index 1dfc04c5b80c..127989b0ed8a 100644
--- a/test/Rewriter/missing-dllimport.c
+++ b/test/Rewriter/missing-dllimport.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i686-pc-win32 -fms-extensions -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-NEG %s
-// RUN: %clang_cc1 -triple i686-pc-win32 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-POS %s
+// RUN: not %clang_cc1 -triple i686-pc-win32 -fms-extensions -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-NEG %s
+// RUN: not %clang_cc1 -triple i686-pc-win32 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-POS %s
// Do not report that 'foo()' is redeclared without dllimport attribute with -fms-extensions
// specified. Addresses <rdar://problem/7653912>.
diff --git a/test/Rewriter/objc-modern-StretAPI-3.mm b/test/Rewriter/objc-modern-StretAPI-3.mm
new file mode 100644
index 000000000000..3ada56e939b0
--- /dev/null
+++ b/test/Rewriter/objc-modern-StretAPI-3.mm
@@ -0,0 +1,58 @@
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// rdar://14932320
+
+extern "C" void *sel_registerName(const char *);
+typedef unsigned long size_t;
+
+typedef struct {
+ unsigned long long x;
+ unsigned long long y;
+} myPoint;
+
+typedef struct {
+ unsigned long long x;
+ unsigned long long y;
+} allPoint;
+
+@interface Obj
++ (myPoint)foo;
++ (myPoint)foo : (int)Arg1 : (double)fArg;
++ (allPoint)fee;
+@end
+
+@implementation Obj
++ (allPoint)fee {
+ allPoint a;
+ a.x = a.y = 3;
+
+ return a;
+}
++ (myPoint)foo {
+ myPoint r;
+ r.x = 1;
+ r.y = 2;
+ return r;
+}
+
++ (myPoint)foo : (int)Arg1 : (double)fArg {
+ myPoint r;
+ return r;
+}
+@end
+
+myPoint Ret_myPoint() {
+ return [Obj foo];
+}
+
+allPoint Ret_allPoint() {
+ return [Obj fee];
+}
+
+myPoint Ret_myPoint1(int i, double d) {
+ return [Obj foo:i:d];
+}
+
+myPoint Ret_myPoint2() {
+ return [Obj foo];
+}
diff --git a/test/Rewriter/objc-modern-boxing.mm b/test/Rewriter/objc-modern-boxing.mm
index 4997c24961c2..40eeafbe293e 100644
--- a/test/Rewriter/objc-modern-boxing.mm
+++ b/test/Rewriter/objc-modern-boxing.mm
@@ -66,7 +66,7 @@ int main(int argc, const char *argv[]) {
// CHECK: NSNumber *fortyTwoUnsigned = ((NSNumber *(*)(id, SEL, unsigned int))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithUnsignedInt:"), (42U));
// CHECK: NSNumber *fortyTwoLong = ((NSNumber *(*)(id, SEL, long))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithLong:"), (42L));
// CHECK: NSNumber *fortyTwoLongLong = ((NSNumber *(*)(id, SEL, long long))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithLongLong:"), (42LL));
-// CHECK: NSNumber *piFloat = ((NSNumber *(*)(id, SEL, float))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithFloat:"), (3.1415927F));
-// CHECK: NSNumber *piDouble = ((NSNumber *(*)(id, SEL, double))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithDouble:"), (3.1415926535));
+// CHECK: NSNumber *piFloat = ((NSNumber *(*)(id, SEL, float))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithFloat:"), (3.14159274F));
+// CHECK: NSNumber *piDouble = ((NSNumber *(*)(id, SEL, double))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithDouble:"), (3.1415926535000001));
// CHECK: NSNumber *nsb = ((NSNumber *(*)(id, SEL, BOOL))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithBool:"), (BOOL)(b));
// CHECK: NSString *duplicateString = ((NSString *(*)(id, SEL, const char *))(void *)objc_msgSend)(objc_getClass("NSString"), sel_registerName("stringWithUTF8String:"), (const char *)(strdup("Hello")));
diff --git a/test/Rewriter/objc-modern-fast-enumeration.mm b/test/Rewriter/objc-modern-fast-enumeration.mm
new file mode 100644
index 000000000000..460e79c91e99
--- /dev/null
+++ b/test/Rewriter/objc-modern-fast-enumeration.mm
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -E %s -o %t.mm
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o - | FileCheck %s
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -triple i686-pc-win32 -Werror -Wno-address-of-temporary -D"Class=struct objc_class *" -D"id=struct objc_object *" -D"SEL=void*" -U__declspec -D"__declspec(X)=" %t-rw.cpp -Wno-attributes
+// RUN: %clang_cc1 -fsyntax-only -triple x86_64-pc-win32 -Werror -Wno-address-of-temporary -D_WIN64 -D"Class=struct objc_class *" -D"id=struct objc_object *" -D"SEL=void*" -U__declspec -D"__declspec(X)=" %t-rw.cpp -Wno-attributes
+// rdar://14913632
+
+extern "C" void *sel_registerName(const char *);
+
+void x() {
+ id y;
+ for (id a in y) {
+ }
+}
+
+// CHECK: #ifdef _WIN64
+// CHECK-NEXT: typedef unsigned long long _WIN_NSUInteger;
+// CHECK-NEXT: #else
+// CHECK-NEXT: typedef unsigned int _WIN_NSUInteger;
+// CHECK-NEXT: #endif
+// CHECK: _WIN_NSUInteger limit =
+// CHECK-NEXT: ((_WIN_NSUInteger (*) (id, SEL, struct __objcFastEnumerationState *, id *, _WIN_NSUInteger))(void *)objc_msgSend)
+// CHECK-NEXT: ((id)l_collection,
+// CHECK-NEXT: sel_registerName("countByEnumeratingWithState:objects:count:"),
+// CHECK-NEXT: &enumState, (id *)__rw_items, (_WIN_NSUInteger)16);
diff --git a/test/Rewriter/objc-modern-numeric-literal.mm b/test/Rewriter/objc-modern-numeric-literal.mm
index 5f63d8c52ad2..57f7ca2d9a3b 100644
--- a/test/Rewriter/objc-modern-numeric-literal.mm
+++ b/test/Rewriter/objc-modern-numeric-literal.mm
@@ -61,8 +61,8 @@ int main(int argc, const char *argv[]) {
// CHECK: NSNumber *fortyTwoUnsigned = ((NSNumber *(*)(id, SEL, unsigned int))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithUnsignedInt:"), 42U);
// CHECK: NSNumber *fortyTwoLong = ((NSNumber *(*)(id, SEL, long))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithLong:"), 42L);
// CHECK: NSNumber *fortyTwoLongLong = ((NSNumber *(*)(id, SEL, long long))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithLongLong:"), 42LL);
-// CHECK: NSNumber *piFloat = ((NSNumber *(*)(id, SEL, float))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithFloat:"), 3.1415927F);
-// CHECK: NSNumber *piDouble = ((NSNumber *(*)(id, SEL, double))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithDouble:"), 3.1415926535);
+// CHECK: NSNumber *piFloat = ((NSNumber *(*)(id, SEL, float))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithFloat:"), 3.14159274F);
+// CHECK: NSNumber *piDouble = ((NSNumber *(*)(id, SEL, double))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithDouble:"), 3.1415926535000001);
// CHECK: NSNumber *yesNumber = ((NSNumber *(*)(id, SEL, BOOL))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithBool:"), true);
// CHECK: NSNumber *noNumber = ((NSNumber *(*)(id, SEL, BOOL))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithBool:"), false);
// CHECK: NSNumber *trueNumber = ((NSNumber *(*)(id, SEL, BOOL))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithBool:"), true);
diff --git a/test/Rewriter/objc-modern-property-attributes.mm b/test/Rewriter/objc-modern-property-attributes.mm
index abebb2c0feff..f0d002caf61c 100644
--- a/test/Rewriter/objc-modern-property-attributes.mm
+++ b/test/Rewriter/objc-modern-property-attributes.mm
@@ -16,6 +16,10 @@ typedef void (^void_block_t)(void);
@property (copy) void_block_t completionBlock;
@property (retain) PropertyClass* Yblock;
+@property (readonly) PropertyClass* readonlyAttr;
+@property (readonly,copy) PropertyClass* readonlyCopyAttr;
+@property (readonly,retain) PropertyClass* readonlyRetainAttr;
+@property (readonly,retain,nonatomic) PropertyClass* readonlyNonatomicAttr;
@property (copy) id ID;
@end
@@ -25,6 +29,10 @@ typedef void (^void_block_t)(void);
@dynamic r; // attributes should be "Ti,D"
@synthesize completionBlock=__completion; // "T@?,C,V__completion"
@synthesize Yblock = YVAR; // "T@\"PropertyClass\",&,VYVAR"
+@synthesize readonlyAttr;
+@synthesize readonlyCopyAttr;
+@synthesize readonlyRetainAttr;
+@synthesize readonlyNonatomicAttr;
@synthesize ID; // "T@,C,VID"
@end
@@ -32,6 +40,10 @@ typedef void (^void_block_t)(void);
// CHECK: Ti,D
// CHECK: T@?,C,V__completion
// CHECK: T@\"PropertyClass\",&,VYVAR
+// CHECK: T@\"PropertyClass\",R,VreadonlyAttr
+// CHECK: T@\"PropertyClass\",R,C,VreadonlyCopyAttr
+// CHECK: T@\"PropertyClass\",R,&,VreadonlyRetainAttr
+// CHECK: T@\"PropertyClass\",R,&,N,VreadonlyNonatomicAttr
@interface Test @end
@interface Test (Category)
diff --git a/test/Rewriter/rewrite-cast-ivar-access.mm b/test/Rewriter/rewrite-cast-ivar-access.mm
index 4e50ff142a8c..d5c2796bcf34 100644
--- a/test/Rewriter/rewrite-cast-ivar-access.mm
+++ b/test/Rewriter/rewrite-cast-ivar-access.mm
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
-// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
// radar 7575882
@interface F {
diff --git a/test/Rewriter/rewrite-category-property.mm b/test/Rewriter/rewrite-category-property.mm
index 50ef4326e4e9..c0f530ecda37 100644
--- a/test/Rewriter/rewrite-category-property.mm
+++ b/test/Rewriter/rewrite-category-property.mm
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -x objective-c++ -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
-// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
// radar 7630636
@class Y, Z;
diff --git a/test/Rewriter/rewrite-foreach-5.m b/test/Rewriter/rewrite-foreach-5.m
index 1d3cc57618ec..a783dfc26448 100644
--- a/test/Rewriter/rewrite-foreach-5.m
+++ b/test/Rewriter/rewrite-foreach-5.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
-// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=struct objc_object*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
void *sel_registerName(const char *);
void objc_enumerationMutation(id);
diff --git a/test/Rewriter/rewrite-foreach-6.m b/test/Rewriter/rewrite-foreach-6.m
index 5159d383e577..29d21afb61ff 100644
--- a/test/Rewriter/rewrite-foreach-6.m
+++ b/test/Rewriter/rewrite-foreach-6.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
-// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=struct objc_object*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
// rdar://5716356
// FIXME: Should be able to pipe into clang, but code is not
// yet correct for other reasons: rdar://5716940
diff --git a/test/Rewriter/rewrite-foreach-in-block.mm b/test/Rewriter/rewrite-foreach-in-block.mm
index 2c1023b0c706..4b2f37dc31b5 100644
--- a/test/Rewriter/rewrite-foreach-in-block.mm
+++ b/test/Rewriter/rewrite-foreach-in-block.mm
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
-// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"id=struct objc_object*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
-// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"id=struct objc_object*" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp
// rdar:// 9878420
typedef unsigned long size_t;
diff --git a/test/Rewriter/rewrite-foreach-protocol-id.m b/test/Rewriter/rewrite-foreach-protocol-id.m
index 5680110a524e..a9491f19ae73 100644
--- a/test/Rewriter/rewrite-foreach-protocol-id.m
+++ b/test/Rewriter/rewrite-foreach-protocol-id.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
-// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=struct objc_object*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
// rdar:// 9039342
void *sel_registerName(const char *);
diff --git a/test/Rewriter/rewrite-forward-class.mm b/test/Rewriter/rewrite-forward-class.mm
index 9f4e7e21e862..3d3ef3e6c9af 100644
--- a/test/Rewriter/rewrite-forward-class.mm
+++ b/test/Rewriter/rewrite-forward-class.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
extern "C" {
@@ -42,3 +42,14 @@ int I,J,K;
};
+// rdar://15027032
+@interface ISDPropertyChangeGroup
+@end
+
+@implementation ISDPropertyChangeGroup
+@class ISDClientState;
+- (id)lastModifiedGeneration : (ISDClientState *) obj
+{
+ return obj ;
+}
+@end
diff --git a/test/Rewriter/rewrite-interface-locals.mm b/test/Rewriter/rewrite-interface-locals.mm
new file mode 100644
index 000000000000..ef361051c198
--- /dev/null
+++ b/test/Rewriter/rewrite-interface-locals.mm
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// rdar://15143875
+
+@class NSData, NSError;
+
+@interface Foo
+
+typedef void (^Callback)(NSData *data, NSError *error);
+
+- (void)doSomething:(NSData *)data callback:(Callback)callback;
+@end
+
+@implementation Foo
+
+- (void)doSomething:(NSData *)data callback:(Callback)callback {
+ callback(0, 0);
+}
+
+@end
diff --git a/test/Rewriter/rewrite-line-directive.m b/test/Rewriter/rewrite-line-directive.m
index 5c4e9574c111..ec50a83d3c19 100644
--- a/test/Rewriter/rewrite-line-directive.m
+++ b/test/Rewriter/rewrite-line-directive.m
@@ -1,8 +1,8 @@
// RUN: %clang_cc1 -E %s -o %t.mm
// RUN: %clang -fms-extensions -rewrite-objc %t.mm -o %t-rw.cpp
-// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
// RUN: %clang -g -fms-extensions -rewrite-objc %t.mm -o %t-rw.cpp
-// RUN: FileCheck -check-prefix LPG --input-file=%t-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LPG --input-file=%t-rw.cpp %s
// rdar://13138170
int z();
diff --git a/test/Rewriter/rewrite-message-expr.mm b/test/Rewriter/rewrite-message-expr.mm
index 72569cb8376f..04e27e5d44ae 100644
--- a/test/Rewriter/rewrite-message-expr.mm
+++ b/test/Rewriter/rewrite-message-expr.mm
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
-// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
// radar 7617047
@interface Baz
diff --git a/test/Rewriter/rewrite-modern-default-property-synthesis.mm b/test/Rewriter/rewrite-modern-default-property-synthesis.mm
index fd1a578f083f..f6fe510cba4b 100644
--- a/test/Rewriter/rewrite-modern-default-property-synthesis.mm
+++ b/test/Rewriter/rewrite-modern-default-property-synthesis.mm
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -E %s -o %t.mm
-// RUN: %clang_cc1 -x objective-c++ -fms-extensions -fobjc-default-synthesize-properties -rewrite-objc %t.mm -o %t-rw.cpp
+// RUN: %clang_cc1 -x objective-c++ -fms-extensions -rewrite-objc %t.mm -o %t-rw.cpp
// RUN: FileCheck --input-file=%t-rw.cpp %s
// RUN: %clang_cc1 -fsyntax-only -Werror -DSEL="void *" -Did="struct objc_object *" -Wno-attributes -Wno-address-of-temporary -U__declspec -D"__declspec(X)=" %t-rw.cpp
// rdar://11374235
diff --git a/test/Rewriter/rewrite-modern-synchronized.m b/test/Rewriter/rewrite-modern-synchronized.m
index e89533930388..17c8e9a4ad4f 100644
--- a/test/Rewriter/rewrite-modern-synchronized.m
+++ b/test/Rewriter/rewrite-modern-synchronized.m
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
-// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"SEL=void*" -D"Class=struct objc_class *" -D"__declspec(X)=" %t-rw.cpp
-typedef struct objc_class *Class;
typedef struct objc_object {
Class isa;
} *id;
@@ -33,3 +32,15 @@ void test_sync_with_implicit_finally() {
return; // The rewriter knows how to generate code for implicit finally
}
}
+
+// rdar://14993814
+@interface NSObject @end
+
+@interface I : NSObject @end
+
+@implementation I
++ (void) Meth {
+@synchronized(self) {
+}
+}
+@end
diff --git a/test/Rewriter/rewrite-modern-typeof.mm b/test/Rewriter/rewrite-modern-typeof.mm
index a493c1184967..91e0b62fd588 100644
--- a/test/Rewriter/rewrite-modern-typeof.mm
+++ b/test/Rewriter/rewrite-modern-typeof.mm
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
-// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -Wno-attributes -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
typedef unsigned long size_t;
diff --git a/test/Rewriter/rewrite-typeof.mm b/test/Rewriter/rewrite-typeof.mm
index 02c36f88a569..f6790ea6d47b 100644
--- a/test/Rewriter/rewrite-typeof.mm
+++ b/test/Rewriter/rewrite-typeof.mm
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
-// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
+// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
extern "C" {
extern "C" void *_Block_copy(const void *aBlock);
diff --git a/test/Sema/128bitfloat.cc b/test/Sema/128bitfloat.cc
new file mode 100644
index 000000000000..cb76dac96001
--- /dev/null
+++ b/test/Sema/128bitfloat.cc
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+
+#if !defined(__STRICT_ANSI__)
+__float128 f; // expected-error {{support for type '__float128' is not yet implemented}}
+// But this should work:
+template<typename> struct __is_floating_point_helper {};
+template<> struct __is_floating_point_helper<__float128> {};
+
+// FIXME: This could have a better diag.
+void g(int x, __float128 *y) {
+ x + *y; // expected-error {{invalid operands to binary expression ('int' and '__float128')}}
+}
+
+#else
+__float128 f; // expected-error {{unknown type name '__float128'}}
+template<typename> struct __is_floating_point_helper {};
+template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{use of undeclared identifier '__float128'}}
+
+void g(int x, __float128 *y) { // expected-error {{unknown type name '__float128'}}
+ x + *y;
+}
+
+#endif
diff --git a/test/Sema/128bitint.c b/test/Sema/128bitint.c
index bb8e3d155e57..4272b2d1391e 100644
--- a/test/Sema/128bitint.c
+++ b/test/Sema/128bitint.c
@@ -16,10 +16,10 @@ __uint128_t b = (__uint128_t)-1;
__int128 i = (__int128)0;
unsigned __int128 u = (unsigned __int128)-1;
-long long SignedTooBig = 123456789012345678901234567890; // expected-warning {{integer constant is too large for its type}}
+long long SignedTooBig = 123456789012345678901234567890; // expected-error {{constant is larger than the largest unsigned integer type}}
__int128_t Signed128 = 123456789012345678901234567890i128;
long long Signed64 = 123456789012345678901234567890i128; // expected-warning {{implicit conversion from '__int128' to 'long long' changes value from 123456789012345678901234567890 to -4362896299872285998}}
-unsigned long long UnsignedTooBig = 123456789012345678901234567890; // expected-warning {{integer constant is too large for its type}}
+unsigned long long UnsignedTooBig = 123456789012345678901234567890; // expected-error {{constant is larger than the largest unsigned integer type}}
__uint128_t Unsigned128 = 123456789012345678901234567890Ui128;
unsigned long long Unsigned64 = 123456789012345678901234567890Ui128; // expected-warning {{implicit conversion from 'unsigned __int128' to 'unsigned long long' changes value from 123456789012345678901234567890 to 14083847773837265618}}
diff --git a/test/Sema/Inputs/ms-keyword-system-header.h b/test/Sema/Inputs/ms-keyword-system-header.h
new file mode 100644
index 000000000000..43a3db7a12ba
--- /dev/null
+++ b/test/Sema/Inputs/ms-keyword-system-header.h
@@ -0,0 +1,9 @@
+/* "System header" for testing GNU libc keyword conflict workarounds */
+
+typedef union {
+ union w *__uptr;
+#if defined(MS) && defined(NOT_SYSTEM)
+ // expected-warning@-2 {{keyword '__uptr' will be treated as an identifier here}}
+#endif
+ int *__iptr;
+} WS __attribute__((__transparent_union__));
diff --git a/test/Sema/MicrosoftCompatibility.cpp b/test/Sema/MicrosoftCompatibility.cpp
index 15c25586c47d..90a45dfaaf17 100644
--- a/test/Sema/MicrosoftCompatibility.cpp
+++ b/test/Sema/MicrosoftCompatibility.cpp
@@ -2,3 +2,9 @@
// PR15845
int foo(xxx); // expected-error{{unknown type name}}
+
+struct cls {
+ char *m;
+};
+
+char * cls::* __uptr wrong2 = &cls::m; // expected-error {{'__uptr' attribute cannot be used with pointers to members}}
diff --git a/test/Sema/MicrosoftExtensions.c b/test/Sema/MicrosoftExtensions.c
index 5d7330e3f700..a6caf7acb8a8 100644
--- a/test/Sema/MicrosoftExtensions.c
+++ b/test/Sema/MicrosoftExtensions.c
@@ -76,6 +76,9 @@ void pointer_to_integral_type_conv(char* ptr) {
short sh = (short)ptr;
ch = (char)ptr;
sh = (short)ptr;
+
+ // This is valid ISO C.
+ _Bool b = (_Bool)ptr;
}
@@ -93,7 +96,7 @@ struct __declspec(deprecated) DS1 { int i; float f; }; // expected-note {{declar
#define MY_TEXT "This is also deprecated"
__declspec(deprecated(MY_TEXT)) void Dfunc1( void ) {} // expected-note {{'Dfunc1' declared here}}
-struct __declspec(deprecated(123)) DS2 {}; // expected-error {{argument to deprecated attribute was not a string literal}}
+struct __declspec(deprecated(123)) DS2 {}; // expected-error {{'deprecated' attribute requires a string}}
void test( void ) {
e1 = one; // expected-warning {{'e1' is deprecated: This is deprecated}}
@@ -102,3 +105,32 @@ void test( void ) {
enum DE1 no; // no warning because E1 is not deprecated
}
+
+int __sptr wrong1; // expected-error {{'__sptr' attribute only applies to pointer arguments}}
+// The modifier must follow the asterisk
+int __sptr *wrong_psp; // expected-error {{'__sptr' attribute only applies to pointer arguments}}
+int * __sptr __uptr wrong2; // expected-error {{'__sptr' and '__uptr' attributes are not compatible}}
+int * __sptr __sptr wrong3; // expected-warning {{attribute '__sptr' is already applied}}
+
+// It is illegal to overload based on the type attribute.
+void ptr_func(int * __ptr32 i) {} // expected-note {{previous definition is here}}
+void ptr_func(int * __ptr64 i) {} // expected-error {{redefinition of 'ptr_func'}}
+
+// It is also illegal to overload based on the pointer type attribute.
+void ptr_func2(int * __sptr __ptr32 i) {} // expected-note {{previous definition is here}}
+void ptr_func2(int * __uptr __ptr32 i) {} // expected-error {{redefinition of 'ptr_func2'}}
+
+int * __sptr __ptr32 __sptr wrong4; // expected-warning {{attribute '__sptr' is already applied}}
+
+__ptr32 int *wrong5; // expected-error {{'__ptr32' attribute only applies to pointer arguments}}
+
+int *wrong6 __ptr32; // expected-error {{expected ';' after top level declarator}} expected-warning {{declaration does not declare anything}}
+
+int * __ptr32 __ptr64 wrong7; // expected-error {{'__ptr32' and '__ptr64' attributes are not compatible}}
+
+int * __ptr32 __ptr32 wrong8; // expected-warning {{attribute '__ptr32' is already applied}}
+
+int *(__ptr32 __sptr wrong9); // expected-error {{'__sptr' attribute only applies to pointer arguments}} // expected-error {{'__ptr32' attribute only applies to pointer arguments}}
+
+typedef int *T;
+T __ptr32 wrong10; // expected-error {{'__ptr32' attribute only applies to pointer arguments}}
diff --git a/test/Sema/aarch64-neon-vector-types.c b/test/Sema/aarch64-neon-vector-types.c
new file mode 100644
index 000000000000..894cf6de1b0c
--- /dev/null
+++ b/test/Sema/aarch64-neon-vector-types.c
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 %s -triple aarch64-none-linux-gnu -target-feature +neon -fsyntax-only -verify
+
+typedef float float32_t;
+typedef unsigned char poly8_t;
+typedef unsigned short poly16_t;
+typedef unsigned long long uint64_t;
+
+// Define some valid Neon types.
+typedef __attribute__((neon_vector_type(2))) int int32x2_t;
+typedef __attribute__((neon_vector_type(4))) int int32x4_t;
+typedef __attribute__((neon_vector_type(1))) uint64_t uint64x1_t;
+typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t;
+typedef __attribute__((neon_vector_type(2))) float32_t float32x2_t;
+typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t;
+typedef __attribute__((neon_polyvector_type(16))) poly8_t poly8x16_t;
+typedef __attribute__((neon_polyvector_type(8))) poly16_t poly16x8_t;
+
+// The attributes must have a single argument.
+typedef __attribute__((neon_vector_type(2, 4))) int only_one_arg; // expected-error{{attribute takes one argument}}
+
+// The number of elements must be an ICE.
+typedef __attribute__((neon_vector_type(2.0))) int non_int_width; // expected-error{{attribute requires an integer constant}}
+
+// Only certain element types are allowed.
+typedef __attribute__((neon_vector_type(2))) double double_elt;
+typedef __attribute__((neon_vector_type(4))) void* ptr_elt; // expected-error{{invalid vector element type}}
+typedef __attribute__((neon_polyvector_type(4))) float32_t bad_poly_elt; // expected-error{{invalid vector element type}}
+struct aggr { signed char c; };
+typedef __attribute__((neon_vector_type(8))) struct aggr aggregate_elt; // expected-error{{invalid vector element type}}
+
+// The total vector size must be 64 or 128 bits.
+typedef __attribute__((neon_vector_type(1))) int int32x1_t; // expected-error{{Neon vector size must be 64 or 128 bits}}
+typedef __attribute__((neon_vector_type(3))) int int32x3_t; // expected-error{{Neon vector size must be 64 or 128 bits}}
diff --git a/test/Sema/address_spaces.c b/test/Sema/address_spaces.c
index 0ae3230a6189..4756af9d9528 100644
--- a/test/Sema/address_spaces.c
+++ b/test/Sema/address_spaces.c
@@ -65,3 +65,5 @@ void access_as_field()
(void) bar.as_field;
}
+typedef int PR4997 __attribute__((address_space(Foobar))); // expected-error {{use of undeclared identifier 'Foobar'}}
+__attribute__((address_space("12"))) int *i; // expected-error {{'address_space' attribute requires an integer constant}}
diff --git a/test/Sema/alias-redefinition.c b/test/Sema/alias-redefinition.c
new file mode 100644
index 000000000000..6c6ebf80250b
--- /dev/null
+++ b/test/Sema/alias-redefinition.c
@@ -0,0 +1,44 @@
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
+
+void f0() {}
+void fun0(void) __attribute((alias("f0")));
+
+void f1() {}
+void fun1() {} // expected-note {{previous definition}}
+void fun1(void) __attribute((alias("f1"))); // expected-error {{redefinition of 'fun1'}}
+
+void f2() {}
+void fun2(void) __attribute((alias("f2"))); // expected-note {{previous definition}}
+void fun2() {} // expected-error {{redefinition of 'fun2'}}
+
+void f3() {}
+void fun3(void) __attribute((alias("f3"))); // expected-note {{previous definition}}
+void fun3(void) __attribute((alias("f3"))); // expected-error {{redefinition of 'fun3'}}
+
+void f4() {}
+void fun4(void) __attribute((alias("f4")));
+void fun4(void);
+
+// FIXME: We should produce a special case error for this.
+void f5() {}
+void __attribute((alias("f5"))) fun5(void) {} // expected-error {{redefinition of 'fun5'}} // expected-note {{previous definition}}
+
+int v1;
+int var1 __attribute((alias("v1"))); // expected-note {{previous definition}}
+int var1 __attribute((alias("v1"))); // expected-error {{redefinition of 'var1'}}
+
+int v2;
+int var2 = 2; // expected-note {{previous definition}}
+int var2 __attribute((alias("v2"))); // expected-error {{redefinition of 'var2'}}
+
+int v3;
+int var3 __attribute((alias("v3"))); // expected-note {{previous definition}}
+int var3 = 2; // expected-error {{redefinition of 'var3'}}
+
+int v4;
+int var4; // expected-note {{previous definition}}
+int var4 __attribute((alias("v4"))); // expected-error {{alias definition of 'var4' after tentative definition}}
+
+int v5;
+int var5 __attribute((alias("v5"))); // expected-note {{previous definition}}
+int var5; // expected-error {{tentative definition of 'var5' after alias definition}}
diff --git a/test/Sema/align-x86-64.c b/test/Sema/align-x86-64.c
index 09bf63390f35..b34d85942d0e 100644
--- a/test/Sema/align-x86-64.c
+++ b/test/Sema/align-x86-64.c
@@ -1,16 +1,6 @@
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
// expected-no-diagnostics
-// PR5599
-
-void frob(void *);
-
-void foo(void) {
- float x[4];
- char y[__alignof__(x) == 16 ? 1 : -1];
- frob(y);
-}
-
// PR5637
typedef __attribute__((aligned(16))) struct {
diff --git a/test/Sema/alloc_size.c b/test/Sema/alloc_size.c
index 84f393204659..053323a9f11b 100644
--- a/test/Sema/alloc_size.c
+++ b/test/Sema/alloc_size.c
@@ -5,9 +5,9 @@ void* my_calloc(unsigned char, short) __attribute__((alloc_size(1,2)));
void* my_realloc(void*, unsigned) __attribute__((alloc_size(2)));
-void* fn1(int) __attribute__((alloc_size("xpto"))); // expected-error{{attribute requires integer constant}}
+void* fn1(int) __attribute__((alloc_size("xpto"))); // expected-error{{'alloc_size' attribute requires parameter 1 to be an integer constant}}
-void* fn2(void*) __attribute__((alloc_size(1))); // expected-error{{attribute requires integer constant}}
+void* fn2(void*) __attribute__((alloc_size(1))); // expected-error{{'alloc_size' attribute requires an integer constant}}
void* fn3(unsigned) __attribute__((alloc_size(0))); // expected-error{{attribute parameter 1 is out of bounds}}
void* fn4(unsigned) __attribute__((alloc_size(2))); // expected-error{{attribute parameter 1 is out of bounds}}
@@ -19,7 +19,7 @@ void* fn7(unsigned) __attribute__((alloc_size)); // expected-error {{attribute t
void *fn8(int, int) __attribute__((alloc_size(1, 1))); // OK
-void* fn9(unsigned) __attribute__((alloc_size(12345678901234567890123))); // expected-warning {{integer constant is too large for its type}} // expected-error {{attribute parameter 1 is out of bounds}}
+void* fn9(unsigned) __attribute__((alloc_size(12345678901234567890123))); // expected-error {{integer constant is larger than the largest unsigned integer type}} // expected-error {{attribute parameter 1 is out of bounds}}
void* fn10(size_t, size_t) __attribute__((alloc_size(1,2))); // expected-error{{redefinition of parameter}} \
// expected-error{{a parameter list without types is only allowed in a function definition}} \
diff --git a/test/Sema/annotate.c b/test/Sema/annotate.c
index ef878d4c9824..4a786d0a0163 100644
--- a/test/Sema/annotate.c
+++ b/test/Sema/annotate.c
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 %s -fsyntax-only -verify
-void __attribute__((annotate("foo"))) foo(float *a) {
+void __attribute__((annotate("foo"))) foo(float *a) {
__attribute__((annotate("bar"))) int x;
- __attribute__((annotate(1))) int y; // expected-error {{argument to annotate attribute was not a string literal}}
- __attribute__((annotate("bar", 1))) int z; // expected-error {{attribute takes one argument}}
+ __attribute__((annotate(1))) int y; // expected-error {{'annotate' attribute requires a string}}
+ __attribute__((annotate("bar", 1))) int z; // expected-error {{'annotate' attribute takes one argument}}
int u = __builtin_annotation(z, (char*) 0); // expected-error {{second argument to __builtin_annotation must be a non-wide string constant}}
int v = __builtin_annotation(z, (char*) L"bar"); // expected-error {{second argument to __builtin_annotation must be a non-wide string constant}}
int w = __builtin_annotation(z, "foo");
diff --git a/test/Sema/arm-asm.c b/test/Sema/arm-asm.c
index 3fc0eeb7543a..e48718b0a2ac 100644
--- a/test/Sema/arm-asm.c
+++ b/test/Sema/arm-asm.c
@@ -5,3 +5,8 @@ void f (void) {
asm volatile ("lw (r1), %0[val]": "=&b"(Val)); // expected-error {{invalid output constraint '=&b' in asm}}
return;
}
+
+void test_64bit_r(void) {
+ long long foo = 0, bar = 0;
+ asm volatile("INST %0, %1" : "=r"(foo) : "r"(bar));
+}
diff --git a/test/Sema/arm-darwin-aapcs.cpp b/test/Sema/arm-darwin-aapcs.cpp
new file mode 100644
index 000000000000..1359a1dc15aa
--- /dev/null
+++ b/test/Sema/arm-darwin-aapcs.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -triple thumbv7-apple-ios -target-abi aapcs -verify -fsyntax-only
+// expected-no-diagnostics
+
+// ARM's AAPCS normally has size_t defined as unsigned int, but on Darwin
+// some embedded targets use AAPCS with the iOS header files, which define
+// size_t as unsigned long. Make sure that works.
+typedef unsigned long size_t;
+void* malloc(size_t);
+void* operator new(size_t size)
+{
+ return (malloc(size));
+}
diff --git a/test/Sema/arm-interrupt-attr.c b/test/Sema/arm-interrupt-attr.c
new file mode 100644
index 000000000000..b2cedc2e4d20
--- /dev/null
+++ b/test/Sema/arm-interrupt-attr.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -triple arm-apple-darwin -verify -fsyntax-only
+
+__attribute__((interrupt(IRQ))) void foo() {} // expected-error {{'interrupt' attribute requires a string}}
+__attribute__((interrupt("irq"))) void foo1() {} // expected-warning {{'interrupt' attribute argument not supported: irq}}
+
+__attribute__((interrupt("IRQ", 1))) void foo2() {} // expected-error {{attribute takes no more than 1 argument}}
+
+__attribute__((interrupt("IRQ"))) void foo3() {}
+__attribute__((interrupt("FIQ"))) void foo4() {}
+__attribute__((interrupt("SWI"))) void foo5() {}
+__attribute__((interrupt("ABORT"))) void foo6() {}
+__attribute__((interrupt("UNDEF"))) void foo7() {}
+
+__attribute__((interrupt)) void foo8() {}
+__attribute__((interrupt())) void foo9() {}
+__attribute__((interrupt(""))) void foo10() {}
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index f92852f341b6..ae2c7425662b 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -226,7 +226,8 @@ void emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct is a GN
// expected-error{{initializer for aggregate with no elements}}
void noNamedInit() {
- struct {int:5;} x[] = {6}; //expected-error{{initializer for aggregate with no elements}}
+ struct {int:5;} x[] = {6}; //expected-error{{initializer for aggregate with no elements}} \
+// expected-warning {{struct without named members is a GNU extension}}
}
struct {int a; int:5;} noNamedImplicit[] = {1,2,3};
int noNamedImplicitCheck[sizeof(noNamedImplicit) == 3 * sizeof(*noNamedImplicit) ? 1 : -1];
diff --git a/test/Sema/array-size-64.c b/test/Sema/array-size-64.c
index f22e8e77d215..0e094bfa6bd7 100644
--- a/test/Sema/array-size-64.c
+++ b/test/Sema/array-size-64.c
@@ -2,6 +2,11 @@
void f() {
int a[2147483647U][2147483647U]; // expected-error{{array is too large}}
- int b[1073741825U - 1U][2147483647U];
- int c[18446744073709551615U/sizeof(int)/2];
+ int b[1073741825U - 1U][2147483647U]; // expected-error{{array is too large}}
}
+
+void pr8256 () {
+ typedef char a[1LL<<61]; // expected-error {{array is too large}}
+ typedef char b[(long long)sizeof(a)-1];
+}
+
diff --git a/test/Sema/atomic-expr.c b/test/Sema/atomic-expr.c
index ecc04c4c68d6..5602d545cc7f 100644
--- a/test/Sema/atomic-expr.c
+++ b/test/Sema/atomic-expr.c
@@ -45,3 +45,16 @@ void func_09 (int* xp) {
void func_10 (int* xp) {
*xp <<= data2;
}
+
+int func_11 (int x) {
+ return data1 == x;
+}
+
+int func_12 () {
+ return data1 < data2;
+}
+
+int func_13 (int x, unsigned y) {
+ return x ? data1 : y;
+}
+
diff --git a/test/Sema/atomic-ops.c b/test/Sema/atomic-ops.c
index b3daa0704dc9..c2d38e714bf2 100644
--- a/test/Sema/atomic-ops.c
+++ b/test/Sema/atomic-ops.c
@@ -86,8 +86,8 @@ void f(_Atomic(int) *i, _Atomic(int*) *p, _Atomic(float) *d,
__c11_atomic_init(I, 5); // expected-error {{pointer to _Atomic}}
__c11_atomic_load(0); // expected-error {{too few arguments to function}}
__c11_atomic_load(0,0,0); // expected-error {{too many arguments to function}}
- __c11_atomic_store(0,0,0); // expected-error {{first argument to atomic builtin must be a pointer}}
- __c11_atomic_store((int*)0,0,0); // expected-error {{first argument to atomic operation must be a pointer to _Atomic}}
+ __c11_atomic_store(0,0,0); // expected-error {{address argument to atomic builtin must be a pointer}}
+ __c11_atomic_store((int*)0,0,0); // expected-error {{address argument to atomic operation must be a pointer to _Atomic}}
__c11_atomic_load(i, memory_order_seq_cst);
__c11_atomic_load(p, memory_order_seq_cst);
@@ -169,10 +169,16 @@ void f(_Atomic(int) *i, _Atomic(int*) *p, _Atomic(float) *d,
(int)__atomic_clear(&flag, memory_order_seq_cst); // expected-error {{operand of type 'void'}}
const _Atomic(int) const_atomic;
- __c11_atomic_init(&const_atomic, 0); // expected-error {{first argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}}
- __c11_atomic_store(&const_atomic, 0, memory_order_release); // expected-error {{first argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}}
- __c11_atomic_load(&const_atomic, memory_order_acquire); // expected-error {{first argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}}
+ __c11_atomic_init(&const_atomic, 0); // expected-error {{address argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}}
+ __c11_atomic_store(&const_atomic, 0, memory_order_release); // expected-error {{address argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}}
+ __c11_atomic_load(&const_atomic, memory_order_acquire); // expected-error {{address argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}}
}
_Atomic(int*) PR12527_a;
void PR12527() { int *b = PR12527_a; }
+
+void PR16931(int* x) { // expected-note {{passing argument to parameter 'x' here}}
+ typedef struct { _Atomic(_Bool) flag; } flag;
+ flag flagvar = { 0 };
+ PR16931(&flagvar); // expected-warning {{incompatible pointer types}}
+}
diff --git a/test/Sema/atomic-requires-library-error.c b/test/Sema/atomic-requires-library-error.c
new file mode 100644
index 000000000000..b0aa2783544b
--- /dev/null
+++ b/test/Sema/atomic-requires-library-error.c
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 %s -triple=i686-apple-darwin9 -verify
+// rdar://13973577
+
+struct foo {
+ int big[128];
+};
+struct bar {
+ char c[3];
+};
+
+struct bar smallThing;
+struct foo bigThing;
+_Atomic(struct foo) bigAtomic;
+
+void structAtomicStore() {
+ struct foo f = {0};
+ __c11_atomic_store(&bigAtomic, f, 5); // expected-error {{atomic store requires runtime support that is not available for this target}}
+
+ struct bar b = {0};
+ __atomic_store(&smallThing, &b, 5);
+
+ __atomic_store(&bigThing, &f, 5);
+}
+
+void structAtomicLoad() {
+ struct foo f = __c11_atomic_load(&bigAtomic, 5); // expected-error {{atomic load requires runtime support that is not available for this target}}
+ struct bar b;
+ __atomic_load(&smallThing, &b, 5);
+
+ __atomic_load(&bigThing, &f, 5);
+}
diff --git a/test/Sema/attr-alias-elf.c b/test/Sema/attr-alias-elf.c
new file mode 100644
index 000000000000..88bd7b70958b
--- /dev/null
+++ b/test/Sema/attr-alias-elf.c
@@ -0,0 +1,54 @@
+// RUN: %clang_cc1 -triple x86_64-pc-linux -fsyntax-only -verify -emit-llvm-only %s
+
+void f1(void) __attribute__((alias("g1")));
+void g1(void) {
+}
+
+void f2(void) __attribute__((alias("g2"))); // expected-error {{alias must point to a defined variable or function}}
+
+
+void f3(void) __attribute__((alias("g3"))); // expected-error {{alias must point to a defined variable or function}}
+void g3(void);
+
+
+void f4() __attribute__((alias("g4")));
+void g4() {}
+void h4() __attribute__((alias("f4")));
+
+void f5() __attribute__((alias("g5")));
+void h5() __attribute__((alias("f5")));
+void g5() {}
+
+void g6() {}
+void f6() __attribute__((alias("g6")));
+void h6() __attribute__((alias("f6")));
+
+void g7() {}
+void h7() __attribute__((alias("f7")));
+void f7() __attribute__((alias("g7")));
+
+void h8() __attribute__((alias("f8")));
+void g8() {}
+void f8() __attribute__((alias("g8")));
+
+void h9() __attribute__((alias("f9")));
+void f9() __attribute__((alias("g9")));
+void g9() {}
+
+void f10() __attribute__((alias("g10"))); // expected-error {{alias definition is part of a cycle}}
+void g10() __attribute__((alias("f10"))); // expected-error {{alias definition is part of a cycle}}
+
+// FIXME: This could be a bit better, h10 is not part of the cycle, it points
+// to it.
+void h10() __attribute__((alias("g10"))); // expected-error {{alias definition is part of a cycle}}
+
+extern int a1 __attribute__((alias("b1")));
+int b1 = 42;
+
+extern int a2 __attribute__((alias("b2"))); // expected-error {{alias must point to a defined variable or function}}
+
+extern int a3 __attribute__((alias("b3"))); // expected-error {{alias must point to a defined variable or function}}
+extern int b3;
+
+extern int a4 __attribute__((alias("b4"))); // expected-error {{alias must point to a defined variable or function}}
+typedef int b4;
diff --git a/test/Sema/attr-args.c b/test/Sema/attr-args.c
index 61358016fbe1..1981de522995 100644
--- a/test/Sema/attr-args.c
+++ b/test/Sema/attr-args.c
@@ -1,40 +1,14 @@
-// RUN: %clang_cc1 -DATTR=noreturn -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=always_inline -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=cdecl -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=const -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=fastcall -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=malloc -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=nothrow -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=stdcall -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=used -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=unused -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=weak -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-
-#define ATTR_DECL(a) __attribute__((ATTR(a)))
-
-int a;
-
-inline ATTR_DECL(a) void* foo(); // expected-error{{attribute takes no arguments}}
-
-
-
-// RUN: %clang_cc1 -DATTR=noreturn -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=always_inline -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=cdecl -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=const -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=fastcall -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=malloc -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=nothrow -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=stdcall -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=used -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=unused -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-// RUN: %clang_cc1 -DATTR=weak -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
-
-#define ATTR_DECL(a) __attribute__((ATTR(a)))
-
+// RUN: %clang_cc1 -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -fsyntax-only %s
int a;
-inline ATTR_DECL(a) void* foo(); // expected-error{{attribute takes no arguments}}
-
-
-
+inline __attribute__((noreturn(a))) void *f1(); // expected-error {{'noreturn' attribute takes no arguments}}
+inline __attribute__((always_inline(a))) void *f2(); // expected-error {{'always_inline' attribute takes no arguments}}
+inline __attribute__((cdecl(a))) void *f3(); // expected-error {{'cdecl' attribute takes no arguments}}
+inline __attribute__((const(a))) void *f4(); // expected-error {{'const' attribute takes no arguments}}
+inline __attribute__((fastcall(a))) void *f5(); // expected-error {{'fastcall' attribute takes no arguments}}
+inline __attribute__((malloc(a))) void *f5(); // expected-error {{'malloc' attribute takes no arguments}}
+inline __attribute__((nothrow(a))) void *f7(); // expected-error {{'nothrow' attribute takes no arguments}}
+inline __attribute__((stdcall(a))) void *f8(); // expected-error {{'stdcall' attribute takes no arguments}}
+inline __attribute__((used(a))) void *f9(); // expected-error {{'used' attribute takes no arguments}}
+inline __attribute__((unused(a))) void *f10(); // expected-error {{'unused' attribute takes no arguments}}
+inline __attribute__((weak(a))) void *f11(); // expected-error {{'weak' attribute takes no arguments}}
diff --git a/test/Sema/attr-bounded.c b/test/Sema/attr-bounded.c
new file mode 100644
index 000000000000..bf71fedf2d3f
--- /dev/null
+++ b/test/Sema/attr-bounded.c
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -fsyntax-only %s
+// Make sure OpenBSD's bounded extension is accepted.
+
+typedef long ssize_t;
+typedef unsigned long size_t;
+typedef struct FILE FILE;
+
+ssize_t read(int, void *, size_t)
+ __attribute__((__bounded__(__buffer__,2,3)));
+int readlink(const char *, char *, size_t)
+ __attribute__((__bounded__(__string__,2,3)));
+size_t fread(void *, size_t, size_t, FILE *)
+ __attribute__((__bounded__(__size__,1,3,2)));
+char *getwd(char *)
+ __attribute__((__bounded__(__minbytes__,1,1024))); \ No newline at end of file
diff --git a/test/Sema/attr-cleanup.c b/test/Sema/attr-cleanup.c
index 991822e402e0..f5cbc385c689 100644
--- a/test/Sema/attr-cleanup.c
+++ b/test/Sema/attr-cleanup.c
@@ -2,18 +2,18 @@
void c1(int *a);
-extern int g1 __attribute((cleanup(c1))); // expected-warning {{cleanup attribute ignored}}
-int g2 __attribute((cleanup(c1))); // expected-warning {{cleanup attribute ignored}}
-static int g3 __attribute((cleanup(c1))); // expected-warning {{cleanup attribute ignored}}
+extern int g1 __attribute((cleanup(c1))); // expected-warning {{'cleanup' attribute ignored}}
+int g2 __attribute((cleanup(c1))); // expected-warning {{'cleanup' attribute ignored}}
+static int g3 __attribute((cleanup(c1))); // expected-warning {{'cleanup' attribute ignored}}
void t1()
{
- int v1 __attribute((cleanup)); // expected-error {{attribute takes one argument}}
- int v2 __attribute((cleanup(1, 2))); // expected-error {{attribute takes one argument}}
-
- static int v3 __attribute((cleanup(c1))); // expected-warning {{cleanup attribute ignored}}
-
- int v4 __attribute((cleanup(h))); // expected-error {{'cleanup' argument 'h' not found}}
+ int v1 __attribute((cleanup)); // expected-error {{'cleanup' attribute takes one argument}}
+ int v2 __attribute((cleanup(1, 2))); // expected-error {{'cleanup' attribute takes one argument}}
+
+ static int v3 __attribute((cleanup(c1))); // expected-warning {{'cleanup' attribute ignored}}
+
+ int v4 __attribute((cleanup(h))); // expected-error {{use of undeclared identifier 'h'}}
int v5 __attribute((cleanup(c1)));
int v6 __attribute((cleanup(v3))); // expected-error {{'cleanup' argument 'v3' is not a function}}
@@ -42,3 +42,7 @@ void c5(void*) __attribute__((deprecated)); // expected-note{{'c5' declared her
void t5() {
int i __attribute__((cleanup(c5))); // expected-warning {{'c5' is deprecated}}
}
+
+void t6(void) {
+ int i __attribute__((cleanup((void *)0))); // expected-error {{'cleanup' argument is not a function}}
+}
diff --git a/test/Sema/attr-deprecated.c b/test/Sema/attr-deprecated.c
index 565be7ff5997..8124ab0ddd02 100644
--- a/test/Sema/attr-deprecated.c
+++ b/test/Sema/attr-deprecated.c
@@ -120,3 +120,7 @@ struct test22 {
foo_dep c, d __attribute((deprecated)); // expected-warning {{'foo_dep' is deprecated}}
__attribute((deprecated)) foo_dep e, f;
};
+
+typedef int test23_ty __attribute((deprecated)); // expected-note {{previous definition is here}}
+typedef int test23_ty; // expected-note {{'test23_ty' declared here}} expected-warning {{redefinition of typedef 'test23_ty' is a C11 feature}}
+test23_ty test23_v; // expected-warning {{'test23_ty' is deprecated}}
diff --git a/test/Sema/attr-endian.c b/test/Sema/attr-endian.c
new file mode 100644
index 000000000000..db24dafd4213
--- /dev/null
+++ b/test/Sema/attr-endian.c
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 %s -verify -fsyntax-only
+
+int p1 __attribute__((endian(host))); // expected-warning {{unknown attribute 'endian' ignored}}
diff --git a/test/Sema/attr-format.c b/test/Sema/attr-format.c
index a223e08f5a48..21d9585a57e9 100644
--- a/test/Sema/attr-format.c
+++ b/test/Sema/attr-format.c
@@ -78,3 +78,5 @@ extern void gcc_cxxformat (const char *, ...)
__attribute__ ((__format__(__gcc_cxxdiag__, 1, 2)));
extern void gcc_tformat (const char *, ...)
__attribute__ ((__format__(__gcc_tdiag__, 1, 2)));
+
+const char *foo3(const char *format) __attribute__((format_arg("foo"))); // expected-error{{'format_arg' attribute requires parameter 1 to be an integer constant}}
diff --git a/test/Sema/attr-mode.c b/test/Sema/attr-mode.c
index a89c8397e0a0..49e41d210d03 100644
--- a/test/Sema/attr-mode.c
+++ b/test/Sema/attr-mode.c
@@ -2,6 +2,8 @@
// RUN: -verify %s
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -DTEST_64BIT_X86 -fsyntax-only \
// RUN: -verify %s
+// RUN: %clang_cc1 -triple powerpc64-pc-linux-gnu -DTEST_64BIT_PPC64 -fsyntax-only \
+// RUN: -verify %s
typedef int i16_1 __attribute((mode(HI)));
int i16_1_test[sizeof(i16_1) == 2 ? 1 : -1];
@@ -11,11 +13,12 @@ int i16_2_test[sizeof(i16_1) == 2 ? 1 : -1];
typedef float f64 __attribute((mode(DF)));
int f64_test[sizeof(f64) == 8 ? 1 : -1];
-typedef int invalid_1 __attribute((mode)); // expected-error{{attribute requires unquoted parameter}}
-typedef int invalid_2 __attribute((mode())); // expected-error{{attribute requires unquoted parameter}}
+typedef int invalid_1 __attribute((mode)); // expected-error{{'mode' attribute takes one argument}}
+typedef int invalid_2 __attribute((mode())); // expected-error{{'mode' attribute takes one argument}}
typedef int invalid_3 __attribute((mode(II))); // expected-error{{unknown machine mode}}
typedef struct {int i,j,k;} invalid_4 __attribute((mode(SI))); // expected-error{{mode attribute only supported for integer and floating-point types}}
typedef float invalid_5 __attribute((mode(SI))); // expected-error{{type of machine mode does not match type of base type}}
+typedef int invalid_6 __attribute__((mode(12))); // expected-error{{'mode' attribute requires an identifier}}
typedef unsigned unwind_word __attribute((mode(unwind_word)));
@@ -24,7 +27,10 @@ int **__attribute((mode(QI)))* i32; // expected-error{{mode attribute}}
typedef _Complex double c32 __attribute((mode(SC)));
int c32_test[sizeof(c32) == 8 ? 1 : -1];
typedef _Complex float c64 __attribute((mode(DC)));
+
+#ifndef TEST_64BIT_PPC64 // Note, 'XC' mode is illegal for PPC64 machines.
typedef _Complex float c80 __attribute((mode(XC)));
+#endif
// PR6108: Correctly select 'long' built in type on 64-bit platforms for 64 bit
// modes. Also test other mode-based conversions.
@@ -56,6 +62,14 @@ void test_long_to_ui64(unsigned long long* y) { f_ui64_arg(y); }
#elif TEST_64BIT_X86
void test_long_to_i64(long* y) { f_i64_arg(y); }
void test_long_to_ui64(unsigned long* y) { f_ui64_arg(y); }
+typedef float f128ibm __attribute__ ((mode (TF))); // expected-error{{unsupported machine mode 'TF'}}
+#elif TEST_64BIT_PPC64
+typedef float f128ibm __attribute__ ((mode (TF)));
+typedef _Complex float c128ibm __attribute__ ((mode (TC)));
+void f_ft128_arg(long double *x);
+void f_ft128_complex_arg(_Complex long double *x);
+void test_TFtype(f128ibm *a) { f_ft128_arg (a); }
+void test_TCtype(c128ibm *a) { f_ft128_complex_arg (a); }
#else
#error Unknown test architecture.
#endif
diff --git a/test/Sema/attr-naked.c b/test/Sema/attr-naked.c
index d9fa5423d9ef..55c6b326ef15 100644
--- a/test/Sema/attr-naked.c
+++ b/test/Sema/attr-naked.c
@@ -2,11 +2,11 @@
int a __attribute__((naked)); // expected-warning {{'naked' attribute only applies to functions}}
-__attribute__((naked)) int t0(void) {
+__attribute__((naked)) int t0(void) {
__asm__ volatile("mov r0, #0");
}
void t1() __attribute__((naked));
-void t2() __attribute__((naked(2))); // expected-error {{attribute takes no arguments}}
+void t2() __attribute__((naked(2))); // expected-error {{'naked' attribute takes no arguments}}
diff --git a/test/Sema/attr-nodebug.c b/test/Sema/attr-nodebug.c
index 3cc4088e4b3c..03ec49b850d6 100644
--- a/test/Sema/attr-nodebug.c
+++ b/test/Sema/attr-nodebug.c
@@ -4,8 +4,8 @@ int a __attribute__((nodebug));
void b() {
int b __attribute__((nodebug)); // expected-warning {{'nodebug' only applies to variables with static storage duration and functions}}
-}
+}
void t1() __attribute__((nodebug));
-void t2() __attribute__((nodebug(2))); // expected-error {{attribute takes no arguments}}
+void t2() __attribute__((nodebug(2))); // expected-error {{'nodebug' attribute takes no arguments}}
diff --git a/test/Sema/attr-noinline.c b/test/Sema/attr-noinline.c
index dfc88a8d8fcb..cadf9d6c186a 100644
--- a/test/Sema/attr-noinline.c
+++ b/test/Sema/attr-noinline.c
@@ -4,5 +4,5 @@ int a __attribute__((noinline)); // expected-warning {{'noinline' attribute only
void t1() __attribute__((noinline));
-void t2() __attribute__((noinline(2))); // expected-error {{attribute takes no arguments}}
+void t2() __attribute__((noinline(2))); // expected-error {{'noinline' attribute takes no arguments}}
diff --git a/test/Sema/attr-noreturn.c b/test/Sema/attr-noreturn.c
index 5c643fff718d..dab571064a22 100644
--- a/test/Sema/attr-noreturn.c
+++ b/test/Sema/attr-noreturn.c
@@ -13,7 +13,7 @@ int f1() __attribute__((noreturn));
int g0 __attribute__((noreturn)); // expected-warning {{'noreturn' only applies to function types; type here is 'int'}}
-int f2() __attribute__((noreturn(1, 2))); // expected-error {{attribute takes no arguments}}
+int f2() __attribute__((noreturn(1, 2))); // expected-error {{'noreturn' attribute takes no arguments}}
void f3() __attribute__((noreturn));
void f3() {
@@ -33,7 +33,7 @@ extern void f5 (unsigned long) __attribute__ ((__noreturn__));
void
f5 (unsigned long size)
{
-
+
}
// PR2461
@@ -41,4 +41,4 @@ __attribute__((noreturn)) void f(__attribute__((noreturn)) void (*x)(void)) {
x();
}
-typedef void (*Fun)(void) __attribute__ ((noreturn(2))); // expected-error {{attribute takes no arguments}}
+typedef void (*Fun)(void) __attribute__ ((noreturn(2))); // expected-error {{'noreturn' attribute takes no arguments}}
diff --git a/test/Sema/attr-ownership.c b/test/Sema/attr-ownership.c
new file mode 100644
index 000000000000..e31b429ef6ed
--- /dev/null
+++ b/test/Sema/attr-ownership.c
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 %s -verify
+
+void f1(void) __attribute__((ownership_takes("foo"))); // expected-error {{'ownership_takes' attribute requires parameter 1 to be an identifier}}
+void *f2(void) __attribute__((ownership_returns(foo, 1, 2))); // expected-error {{attribute takes no more than 1 argument}}
+void f3(void) __attribute__((ownership_holds(foo, 1))); // expected-error {{'ownership_holds' attribute parameter 1 is out of bounds}}
+void *f4(void) __attribute__((ownership_returns(foo)));
+void f5(void) __attribute__((ownership_holds(foo))); // expected-error {{attribute takes at least 2 arguments}}
+void f6(void) __attribute__((ownership_holds(foo, 1, 2, 3))); // expected-error {{'ownership_holds' attribute parameter 1 is out of bounds}}
+void f7(void) __attribute__((ownership_takes(foo))); // expected-error {{attribute takes at least 2 arguments}}
+void f8(int *i, int *j, int k) __attribute__((ownership_holds(foo, 1, 2, 4))); // expected-error {{'ownership_holds' attribute parameter 3 is out of bounds}}
+
+int f9 __attribute__((ownership_takes(foo, 1))); // expected-warning {{'ownership_takes' attribute only applies to functions}}
+
+void f10(int i) __attribute__((ownership_holds(foo, 1))); // expected-error {{'ownership_holds' attribute only applies to pointer arguments}}
+void *f11(float i) __attribute__((ownership_returns(foo, 1))); // expected-error {{'ownership_returns' attribute only applies to integer arguments}}
+void *f12(float i, int k, int f, int *j) __attribute__((ownership_returns(foo, 4))); // expected-error {{'ownership_returns' attribute only applies to integer arguments}}
+
+void f13(int *i, int *j) __attribute__((ownership_holds(foo, 1))) __attribute__((ownership_takes(foo, 2)));
+void f14(int i, int j, int *k) __attribute__((ownership_holds(foo, 3))) __attribute__((ownership_takes(foo, 3))); // expected-error {{'ownership_holds' and 'ownership_takes' attributes are not compatible}}
diff --git a/test/Sema/attr-print.c b/test/Sema/attr-print.c
index 2659508e5625..b3bdfd72e645 100644
--- a/test/Sema/attr-print.c
+++ b/test/Sema/attr-print.c
@@ -13,9 +13,22 @@ void foo() __attribute__((const));
// CHECK: void bar() __attribute__((__const));
void bar() __attribute__((__const));
-// FIXME: Print these at a valid location for these attributes.
-// CHECK: int *p32 __ptr32;
+// CHECK: int * __ptr32 p32;
int * __ptr32 p32;
-// CHECK: int *p64 __ptr64;
+// CHECK: int * __ptr64 p64;
int * __ptr64 p64;
+
+// TODO: the Type Printer has no way to specify the order to print attributes
+// in, and so it currently always prints them in reverse order. Fix this.
+// CHECK: int * __ptr32 __uptr p32_2;
+int * __uptr __ptr32 p32_2;
+
+// CHECK: int * __ptr64 __sptr p64_2;
+int * __sptr __ptr64 p64_2;
+
+// CHECK: int * __ptr32 __uptr p32_3;
+int * __uptr __ptr32 p32_3;
+
+// CHECK: int * __sptr * __ptr32 ppsp32;
+int * __sptr * __ptr32 ppsp32;
diff --git a/test/Sema/attr-regparm.c b/test/Sema/attr-regparm.c
index ccd894e606d5..d50dd113f70f 100644
--- a/test/Sema/attr-regparm.c
+++ b/test/Sema/attr-regparm.c
@@ -1,10 +1,10 @@
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
__attribute((regparm(2))) int x0(void);
-__attribute((regparm(1.0))) int x1(void); // expected-error{{'regparm' attribute requires integer constant}}
+__attribute((regparm(1.0))) int x1(void); // expected-error{{'regparm' attribute requires an integer constant}}
__attribute((regparm(-1))) int x2(void); // expected-error{{'regparm' parameter must be between 0 and 3 inclusive}}
__attribute((regparm(5))) int x3(void); // expected-error{{'regparm' parameter must be between 0 and 3 inclusive}}
-__attribute((regparm(5,3))) int x4(void); // expected-error{{attribute takes one argument}}
+__attribute((regparm(5,3))) int x4(void); // expected-error{{'regparm' attribute takes one argument}}
void __attribute__((regparm(3))) x5(int);
void x5(int); // expected-note{{previous declaration is here}}
diff --git a/test/Sema/attr-returns-twice.c b/test/Sema/attr-returns-twice.c
index 13f53e36de79..aa32b243b106 100644
--- a/test/Sema/attr-returns-twice.c
+++ b/test/Sema/attr-returns-twice.c
@@ -7,6 +7,6 @@ __attribute__((returns_twice)) void t0(void) {
void t1() __attribute__((returns_twice));
-void t2() __attribute__((returns_twice(2))); // expected-error {{attribute takes no arguments}}
+void t2() __attribute__((returns_twice(2))); // expected-error {{'returns_twice' attribute takes no arguments}}
typedef void (*t3)(void) __attribute__((returns_twice)); // expected-warning {{'returns_twice' attribute only applies to functions}}
diff --git a/test/Sema/attr-section.c b/test/Sema/attr-section.c
index 69ca732517af..396892a1c5e9 100644
--- a/test/Sema/attr-section.c
+++ b/test/Sema/attr-section.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -verify -fsyntax-only -triple x86_64-apple-darwin9 %s
int x __attribute__((section(
- 42))); // expected-error {{argument to section attribute was not a string literal}}
+ 42))); // expected-error {{'section' attribute requires a string}}
// rdar://4341926
diff --git a/test/Sema/attr-tls_model.c b/test/Sema/attr-tls_model.c
index e184ebc82af0..c4f92f1f80de 100644
--- a/test/Sema/attr-tls_model.c
+++ b/test/Sema/attr-tls_model.c
@@ -9,6 +9,6 @@ int f() __attribute((tls_model("global-dynamic"))); // expected-error {{'tls_mod
int x __attribute((tls_model("global-dynamic"))); // expected-error {{'tls_model' attribute only applies to thread-local variables}}
static __thread int y __attribute((tls_model("global-dynamic"))); // no-warning
-static __thread int y __attribute((tls_model("local", "dynamic"))); // expected-error {{attribute takes one argument}}
-static __thread int y __attribute((tls_model(123))); // expected-error {{argument to tls_model attribute was not a string literal}}
+static __thread int y __attribute((tls_model("local", "dynamic"))); // expected-error {{'tls_model' attribute takes one argument}}
+static __thread int y __attribute((tls_model(123))); // expected-error {{'tls_model' attribute requires a string}}
static __thread int y __attribute((tls_model("foobar"))); // expected-error {{tls_model must be "global-dynamic", "local-dynamic", "initial-exec" or "local-exec"}}
diff --git a/test/Sema/attr-unavailable-message.c b/test/Sema/attr-unavailable-message.c
index 97104960e5e4..ebdf945867fe 100644
--- a/test/Sema/attr-unavailable-message.c
+++ b/test/Sema/attr-unavailable-message.c
@@ -6,6 +6,11 @@ double dfoo(double) __attribute__((__unavailable__("NO LONGER"))); // expected-
void bar() __attribute__((__unavailable__)); // expected-note {{explicitly marked unavailable}}
+int quux(void) __attribute__((__unavailable__(12))); // expected-error {{'__unavailable__' attribute requires a string}}
+
+#define ACCEPTABLE "Use something else"
+int quux2(void) __attribute__((__unavailable__(ACCEPTABLE)));
+
void test_foo() {
int ir = foo(1); // expected-error {{'foo' is unavailable: USE IFOO INSTEAD}}
double dr = dfoo(1.0); // expected-error {{'dfoo' is unavailable: NO LONGER}}
@@ -32,13 +37,13 @@ enum foo {
a = 1, // expected-note {{declared here}}
b __attribute__((deprecated())) = 2, // expected-note {{declared here}}
c = 3
-}__attribute__((deprecated()));
+}__attribute__((deprecated()));
enum fee { // expected-note {{declaration has been explicitly marked unavailable here}}
r = 1, // expected-note {{declaration has been explicitly marked unavailable here}}
s = 2,
t = 3
-}__attribute__((unavailable()));
+}__attribute__((unavailable()));
enum fee f() { // expected-error {{'fee' is unavailable}}
int i = a; // expected-warning {{'a' is deprecated}}
diff --git a/test/Sema/attr-unused.c b/test/Sema/attr-unused.c
index 07c65cbd9aed..c0c7b9b97adb 100644
--- a/test/Sema/attr-unused.c
+++ b/test/Sema/attr-unused.c
@@ -9,7 +9,7 @@ int f1() __attribute__((unused));
int g0 __attribute__((unused));
-int f2() __attribute__((unused(1, 2))); // expected-error {{attribute takes no arguments}}
+int f2() __attribute__((unused(1, 2))); // expected-error {{'unused' attribute takes no arguments}}
struct Test0_unused {} __attribute__((unused));
struct Test0_not_unused {};
diff --git a/test/Sema/attr-visibility.c b/test/Sema/attr-visibility.c
index 7f7fd546f095..ed52ec2743f9 100644
--- a/test/Sema/attr-visibility.c
+++ b/test/Sema/attr-visibility.c
@@ -24,3 +24,5 @@ extern int test7 __attribute__((visibility("hidden"))); // expected-error {{visi
typedef int __attribute__((visibility("default"))) bar; // expected-warning {{'visibility' attribute ignored}}
int x __attribute__((type_visibility("default"))); // expected-error {{'type_visibility' attribute only applies to types and namespaces}}
+
+int PR17105 __attribute__((visibility(hidden))); // expected-error {{'visibility' attribute requires a string}}
diff --git a/test/Sema/block-args.c b/test/Sema/block-args.c
index 5ee383eebb02..c6beead3915b 100644
--- a/test/Sema/block-args.c
+++ b/test/Sema/block-args.c
@@ -45,3 +45,14 @@ void test5_helper(void (^)(int, int[*]));
void test5(void) {
test5_helper(^(int n, int array[n]) {});
}
+
+// Reduced from a problem on platforms where va_list is an array.
+struct tag {
+ int x;
+};
+typedef struct tag array_ty[1];
+void test6(void) {
+ void (^block)(array_ty) = ^(array_ty arr) { };
+ array_ty arr;
+ block(arr);
+}
diff --git a/test/Sema/builtin-clear_cache.c b/test/Sema/builtin-clear_cache.c
new file mode 100644
index 000000000000..e21aad79d12a
--- /dev/null
+++ b/test/Sema/builtin-clear_cache.c
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -triple armv7-none-linux-gnu -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+void __clear_cache(void *a, void *b) {}
diff --git a/test/Sema/builtins-aarch64.c b/test/Sema/builtins-aarch64.c
index 03e03343eb94..b0557532fab6 100644
--- a/test/Sema/builtins-aarch64.c
+++ b/test/Sema/builtins-aarch64.c
@@ -1,4 +1,9 @@
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -DTEST1 -fsyntax-only -verify %s
+
+#ifdef TEST1
+void __clear_cache(void *start, void *end);
+#endif
void test_clear_cache_chars(char *start, char *end) {
__clear_cache(start, end);
diff --git a/test/Sema/builtins-arm-exclusive.c b/test/Sema/builtins-arm-exclusive.c
new file mode 100644
index 000000000000..8c784031142b
--- /dev/null
+++ b/test/Sema/builtins-arm-exclusive.c
@@ -0,0 +1,61 @@
+// RUN: %clang_cc1 -triple armv7 -fsyntax-only -verify %s
+
+struct Simple {
+ char a, b;
+};
+
+int test_ldrex(char *addr) {
+ int sum = 0;
+ sum += __builtin_arm_ldrex(addr);
+ sum += __builtin_arm_ldrex((short *)addr);
+ sum += __builtin_arm_ldrex((int *)addr);
+ sum += __builtin_arm_ldrex((long long *)addr);
+ sum += __builtin_arm_ldrex((float *)addr);
+ sum += __builtin_arm_ldrex((double *)addr);
+ sum += *__builtin_arm_ldrex((int **)addr);
+ sum += __builtin_arm_ldrex((struct Simple **)addr)->a;
+ sum += __builtin_arm_ldrex((volatile char *)addr);
+ sum += __builtin_arm_ldrex((const volatile char *)addr);
+
+ // In principle this might be valid, but stick to ints and floats for scalar
+ // types at the moment.
+ sum += __builtin_arm_ldrex((struct Simple *)addr).a; // expected-error {{address argument to atomic builtin must be a pointer to}}
+
+ sum += __builtin_arm_ldrex((__int128 *)addr); // expected-error {{__int128 is not supported on this target}} expected-error {{address argument to load or store exclusive builtin must be a pointer to 1,2,4 or 8 byte type}}
+
+ __builtin_arm_ldrex(); // expected-error {{too few arguments to function call}}
+ __builtin_arm_ldrex(1, 2); // expected-error {{too many arguments to function call}}
+ return sum;
+}
+
+int test_strex(char *addr) {
+ int res = 0;
+ struct Simple var = {0};
+ res |= __builtin_arm_strex(4, addr);
+ res |= __builtin_arm_strex(42, (short *)addr);
+ res |= __builtin_arm_strex(42, (int *)addr);
+ res |= __builtin_arm_strex(42, (long long *)addr);
+ res |= __builtin_arm_strex(2.71828f, (float *)addr);
+ res |= __builtin_arm_strex(3.14159, (double *)addr);
+ res |= __builtin_arm_strex(&var, (struct Simple **)addr);
+
+ res |= __builtin_arm_strex(42, (volatile char *)addr);
+ res |= __builtin_arm_strex(42, (char *const)addr);
+ res |= __builtin_arm_strex(42, (const char *)addr); // expected-warning {{passing 'const char *' to parameter of type 'volatile char *' discards qualifiers}}
+
+
+ res |= __builtin_arm_strex(var, (struct Simple *)addr); // expected-error {{address argument to atomic builtin must be a pointer to}}
+ res |= __builtin_arm_strex(var, (struct Simple **)addr); // expected-error {{passing 'struct Simple' to parameter of incompatible type 'struct Simple *'}}
+ res |= __builtin_arm_strex(&var, (struct Simple **)addr).a; // expected-error {{is not a structure or union}}
+
+ res |= __builtin_arm_strex(1, (__int128 *)addr); // expected-error {{__int128 is not supported on this target}} expected-error {{address argument to load or store exclusive builtin must be a pointer to 1,2,4 or 8 byte type}}
+
+ __builtin_arm_strex(1); // expected-error {{too few arguments to function call}}
+ __builtin_arm_strex(1, 2, 3); // expected-error {{too many arguments to function call}}
+ return res;
+}
+
+void test_clrex() {
+ __builtin_arm_clrex();
+ __builtin_arm_clrex(1); // expected-error {{too many arguments to function call}}
+}
diff --git a/test/Sema/builtins-arm-strex-rettype.c b/test/Sema/builtins-arm-strex-rettype.c
new file mode 100644
index 000000000000..4ee96ce3277e
--- /dev/null
+++ b/test/Sema/builtins-arm-strex-rettype.c
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -triple thumbv7m-apple-darwin-eabi -ast-dump %s | FileCheck %s
+
+// CHECK: CallExpr {{.*}} 'int'
+
+void foo(int a, int *b) {
+ do {
+ } while (__builtin_arm_strex(a, b));
+}
diff --git a/test/Sema/builtins-arm.c b/test/Sema/builtins-arm.c
index 7b48af155ee8..3ac1da0aa93d 100644
--- a/test/Sema/builtins-arm.c
+++ b/test/Sema/builtins-arm.c
@@ -1,15 +1,15 @@
-// RUN: %clang_cc1 -triple armv7 -fsyntax-only -verify -DTEST0 %s
-// RUN: %clang_cc1 -triple armv7 -fsyntax-only -verify -DTEST1 %s
+// RUN: %clang_cc1 -triple armv7 -fsyntax-only -verify %s
// RUN: %clang_cc1 -triple armv7 -target-abi apcs-gnu \
-// RUN: -fsyntax-only -verify -DTEST1 %s
+// RUN: -fsyntax-only -verify %s
-#ifdef TEST0
-void __clear_cache(char*, char*);
-#endif
+void f(void *a, void *b) {
+ __clear_cache(); // expected-error {{too few arguments to function call, expected 2, have 0}} // expected-note {{'__clear_cache' is a builtin with type 'void (void *, void *)}}
+ __clear_cache(a); // expected-error {{too few arguments to function call, expected 2, have 1}}
+ __clear_cache(a, b);
+}
-#ifdef TEST1
+void __clear_cache(char*, char*); // expected-error {{conflicting types for '__clear_cache'}}
void __clear_cache(void*, void*);
-#endif
#if defined(__ARM_PCS) || defined(__ARM_EABI__)
// va_list on ARM AAPCS is struct { void* __ap }.
diff --git a/test/Sema/builtins-gnu-mode.c b/test/Sema/builtins-gnu-mode.c
new file mode 100644
index 000000000000..718803eabe2a
--- /dev/null
+++ b/test/Sema/builtins-gnu-mode.c
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c99 %s
+// PR16138
+// expected-no-diagnostics
+
+int alloca;
+int stpcpy;
+int stpncpy;
+int strdup;
+int strndup;
+int index;
+int rindex;
+int bzero;
+int strcasecmp;
+int strncasecmp;
+int _exit;
+int vfork;
+int _setjmp;
+int __sigsetjmp;
+int sigsetjmp;
+int setjmp_syscall;
+int savectx;
+int qsetjmp;
+int getcontext;
+int _longjmp;
+int siglongjmp;
+int strlcpy;
+int strlcat;
diff --git a/test/Sema/builtins.c b/test/Sema/builtins.c
index d525ac012e11..8ca33c8e7527 100644
--- a/test/Sema/builtins.c
+++ b/test/Sema/builtins.c
@@ -2,7 +2,7 @@
// This test needs to set the target because it uses __builtin_ia32_vec_ext_v4si
int test1(float a, int b) {
- return __builtin_isless(a, b);
+ return __builtin_isless(a, b); // expected-note {{declared here}}
}
int test2(int a, int b) {
return __builtin_islessequal(a, b); // expected-error {{floating point type}}
@@ -191,3 +191,9 @@ void test18() {
ptr = __builtin___strlcpy_chk(dst, src, sizeof(src), sizeof(dst)); // expected-warning {{incompatible integer to pointer conversion}}
ptr = __builtin___strlcat_chk(dst, src, sizeof(src), sizeof(dst)); // expected-warning {{incompatible integer to pointer conversion}}
}
+
+void no_ms_builtins() {
+ __assume(1); // expected-warning {{implicit declaration}}
+ __noop(1); // expected-warning {{implicit declaration}}
+ __debugbreak(); // expected-warning {{implicit declaration}}
+}
diff --git a/test/Sema/c89.c b/test/Sema/c89.c
index a410a626edac..b746d383f306 100644
--- a/test/Sema/c89.c
+++ b/test/Sema/c89.c
@@ -90,7 +90,7 @@ void test16() {
printg("Hello, world!\n"); /* expected-warning {{implicit declaration of function 'printg'}} */
}
-struct x { int x,y[]; }; /* expected-warning {{Flexible array members are a C99-specific feature}} */
+struct x { int x,y[]; }; /* expected-warning {{flexible array members are a C99 feature}} */
/* Duplicated type-qualifiers aren't allowed by C90 */
const const int c_i; /* expected-warning {{duplicate 'const' declaration specifier}} */
@@ -116,3 +116,12 @@ long long ll1 = /* expected-warning {{'long long' is an extension when C99 mode
unsigned long long ull1 = /* expected-warning {{'long long' is an extension when C99 mode is not enabled}} */
42ULL; /* expected-warning {{'long long' is an extension when C99 mode is not enabled}} */
+struct Test17 { int a; };
+struct Test17 test17_aux(void);
+
+void test17(int v, int w) {
+ int a[2] = { v, w }; /* expected-warning {{initializer for aggregate is not a compile-time constant}} */
+ struct Test17 t0 = { v }; /* expected-warning {{initializer for aggregate is not a compile-time constant}} */
+ struct Test17 t1 = test17_aux(); /* this is allowed */
+}
+
diff --git a/test/Sema/callingconv-ms_abi.c b/test/Sema/callingconv-ms_abi.c
new file mode 100644
index 000000000000..64c5970adf1d
--- /dev/null
+++ b/test/Sema/callingconv-ms_abi.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-pc-win32 %s
+
+void __attribute__((ms_abi)) foo(void);
+void (*pfoo)(void) = foo;
+
+void __attribute__((sysv_abi)) bar(void);
+void (*pbar)(void) = bar; // expected-warning{{incompatible pointer types}}
+
+void (__attribute__((sysv_abi)) *pfoo2)(void) = foo; // expected-warning{{incompatible pointer types}}
diff --git a/test/Sema/callingconv-sysv_abi.c b/test/Sema/callingconv-sysv_abi.c
new file mode 100644
index 000000000000..015357d054f7
--- /dev/null
+++ b/test/Sema/callingconv-sysv_abi.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-pc-linux-gnu %s
+
+void __attribute__((ms_abi)) foo(void);
+void (*pfoo)(void) = foo; // expected-warning{{incompatible pointer types}}
+
+void __attribute__((sysv_abi)) bar(void);
+void (*pbar)(void) = bar;
+
+void (__attribute__((ms_abi)) *pbar2)(void) = bar; // expected-warning{{incompatible pointer types}}
diff --git a/test/Sema/callingconv.c b/test/Sema/callingconv.c
index e487020c4c53..500c0fbfb275 100644
--- a/test/Sema/callingconv.c
+++ b/test/Sema/callingconv.c
@@ -1,12 +1,13 @@
// RUN: %clang_cc1 %s -fsyntax-only -triple i386-unknown-unknown -verify
+// RUN: %clang_cc1 %s -fsyntax-only -triple i386-unknown-unknown -fms-compatibility -DWIN -verify
-void __attribute__((fastcall)) foo(float *a) {
+void __attribute__((fastcall)) foo(float *a) {
}
-void __attribute__((stdcall)) bar(float *a) {
+void __attribute__((stdcall)) bar(float *a) {
}
-void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{attribute takes no arguments}}
+void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{'fastcall' attribute takes no arguments}}
}
void __attribute__((fastcall)) test0() { // expected-error {{function with no prototype cannot use fastcall calling convention}}
@@ -15,12 +16,16 @@ void __attribute__((fastcall)) test0() { // expected-error {{function with no pr
void __attribute__((fastcall)) test1(void) {
}
-void __attribute__((fastcall)) test2(int a, ...) { // expected-error {{variadic function cannot use fastcall calling convention}}
+void __attribute__((fastcall)) test2(int a, ...) { // expected-warning {{fastcall calling convention ignored on variadic function}}
+}
+void __attribute__((stdcall)) test3(int a, ...) { // expected-warning {{stdcall calling convention ignored on variadic function}}
+}
+void __attribute__((thiscall)) test4(int a, ...) { // expected-error {{variadic function cannot use thiscall calling convention}}
}
void __attribute__((cdecl)) ctest0() {}
-void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{attribute takes no arguments}}
+void __attribute__((cdecl(1))) ctest1(float x) {} // expected-error {{'cdecl' attribute takes no arguments}}
void (__attribute__((fastcall)) *pfoo)(float*) = foo;
@@ -36,10 +41,11 @@ void (__attribute__((cdecl)) *pctest2)() = ctest2;
typedef void (__attribute__((fastcall)) *Handler) (float *);
Handler H = foo;
-int __attribute__((pcs("aapcs", "aapcs"))) pcs1(void); // expected-error {{attribute takes one argument}}
-int __attribute__((pcs())) pcs2(void); // expected-error {{attribute takes one argument}}
-int __attribute__((pcs(pcs1))) pcs3(void); // expected-error {{attribute takes one argument}}
-int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires parameter 1 to be a string}}
+int __attribute__((pcs("aapcs", "aapcs"))) pcs1(void); // expected-error {{'pcs' attribute takes one argument}}
+int __attribute__((pcs())) pcs2(void); // expected-error {{'pcs' attribute takes one argument}}
+int __attribute__((pcs(pcs1))) pcs3(void); // expected-error {{'pcs' attribute requires a string}} \
+ // expected-error {{invalid PCS type}}
+int __attribute__((pcs(0))) pcs4(void); // expected-error {{'pcs' attribute requires a string}}
/* These are ignored because the target is i386 and not ARM */
int __attribute__((pcs("aapcs"))) pcs5(void); // expected-warning {{calling convention 'pcs' ignored for this target}}
int __attribute__((pcs("aapcs-vfp"))) pcs6(void); // expected-warning {{calling convention 'pcs' ignored for this target}}
@@ -56,3 +62,7 @@ PROC __attribute__((cdecl)) ctest4(const char *x) {}
void __attribute__((pnaclcall)) pnaclfunc(float *a) {} // expected-warning {{calling convention 'pnaclcall' ignored for this target}}
void __attribute__((intel_ocl_bicc)) inteloclbifunc(float *a) {}
+
+typedef void typedef_fun_t(int);
+typedef_fun_t typedef_fun; // expected-note {{previous declaration is here}}
+void __attribute__((stdcall)) typedef_fun(int x) { } // expected-error {{function declared 'stdcall' here was previously declared without calling convention}}
diff --git a/test/Sema/captured-statements.c b/test/Sema/captured-statements.c
index 9285a7802d50..86e9273944bf 100644
--- a/test/Sema/captured-statements.c
+++ b/test/Sema/captured-statements.c
@@ -49,29 +49,29 @@ void test_nest() {
}
void test_nest_block() {
- __block int x;
+ __block int x; // expected-note {{'x' declared here}}
int y;
^{
int z;
#pragma clang __debug captured
{
- x = y; // OK
+ x = y; // expected-error{{__block variable 'x' cannot be captured in a captured statement}}
y = z; // expected-error{{variable is not assignable (missing __block type specifier)}}
z = y; // OK
}
}();
- __block int a;
+ __block int a; // expected-note 2 {{'a' declared here}}
int b;
#pragma clang __debug captured
{
__block int c;
int d;
^{
- a = b; // OK
- a = c; // OK
+ a = b; // expected-error{{__block variable 'a' cannot be captured in a captured statement}}
b = d; // OK - Consistent with block inside a lambda
- c = a; // OK
+ c = a; // expected-error{{__block variable 'a' cannot be captured in a captured statement}}
+ c = d; // OK
d = b; // expected-error{{variable is not assignable (missing __block type specifier)}}
}();
}
diff --git a/test/Sema/carbon.c b/test/Sema/carbon.c
index 045d72c86aed..0498116dd181 100644
--- a/test/Sema/carbon.c
+++ b/test/Sema/carbon.c
@@ -1,5 +1,4 @@
-// RUN: %clang -fsyntax-only %s -print-stats
+// RUN: %clang -fsyntax-only %s
#ifdef __APPLE__
#include <Carbon/Carbon.h>
#endif
-
diff --git a/test/Sema/cast.c b/test/Sema/cast.c
index 25ef1d03a4fe..7971163c12d0 100644
--- a/test/Sema/cast.c
+++ b/test/Sema/cast.c
@@ -54,6 +54,14 @@ void testInt(Int v) {
(void) (CDouble) v;
(void) (VoidPtr) v; // expected-warning{{cast to 'VoidPtr' (aka 'void *') from smaller integer type 'Int' (aka 'int')}}
(void) (CharPtr) v; // expected-warning{{cast to 'CharPtr' (aka 'char *') from smaller integer type 'Int' (aka 'int')}}
+
+ // Test that casts to void* can be controlled separately
+ // from other -Wint-to-pointer-cast warnings.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast"
+ (void) (VoidPtr) v; // no-warning
+ (void) (CharPtr) v; // expected-warning{{cast to 'CharPtr' (aka 'char *') from smaller integer type 'Int' (aka 'int')}}
+#pragma clang diagnostic pop
}
void testLong(Long v) {
diff --git a/test/Sema/constant-builtins-2.c b/test/Sema/constant-builtins-2.c
index 13d81fe13cbf..d2d221c5e12b 100644
--- a/test/Sema/constant-builtins-2.c
+++ b/test/Sema/constant-builtins-2.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
// Math stuff
@@ -37,10 +37,126 @@ float g16 = __builtin_copysign(1.0, -1.0);
double g17 = __builtin_copysignf(1.0f, -1.0f);
long double g18 = __builtin_copysignl(1.0L, -1.0L);
+char classify_nan [__builtin_fpclassify(+1, -1, -1, -1, -1, __builtin_nan(""))];
+char classify_snan [__builtin_fpclassify(+1, -1, -1, -1, -1, __builtin_nans(""))];
+char classify_inf [__builtin_fpclassify(-1, +1, -1, -1, -1, __builtin_inf())];
+char classify_neg_inf [__builtin_fpclassify(-1, +1, -1, -1, -1, -__builtin_inf())];
+char classify_normal [__builtin_fpclassify(-1, -1, +1, -1, -1, 1.539)];
+char classify_normal2 [__builtin_fpclassify(-1, -1, +1, -1, -1, 1e-307)];
+char classify_denorm [__builtin_fpclassify(-1, -1, -1, +1, -1, 1e-308)];
+char classify_denorm2 [__builtin_fpclassify(-1, -1, -1, +1, -1, -1e-308)];
+char classify_zero [__builtin_fpclassify(-1, -1, -1, -1, +1, 0.0)];
+char classify_neg_zero[__builtin_fpclassify(-1, -1, -1, -1, +1, -0.0)];
+
+char isinf_sign_noninf1[__builtin_isinf_sign(-0.0) == 0 ? 1 : -1];
+char isinf_sign_noninf2[__builtin_isinf_sign(1e307) == 0 ? 1 : -1];
+char isinf_sign_noninf3[__builtin_isinf_sign(__builtin_nan("")) == 0 ? 1 : -1];
+char isinf_sign_noninf4[__builtin_isinf_sign(-436.) == 0 ? 1 : -1];
+char isinf_sign_inf [__builtin_isinf_sign(__builtin_inf()) == 1 ? 1 : -1];
+char isinf_sign_neg_inf[__builtin_isinf_sign(-__builtin_inf()) == -1 ? 1 : -1];
+
+char isinf_inf_pos[__builtin_isinf(__builtin_inf()) ? 1 : -1];
+char isinf_pos [!__builtin_isinf(1.0) ? 1 : -1];
+char isinf_normf [!__builtin_isinf(1e-37f) ? 1 : -1];
+char isinf_denormf[!__builtin_isinf(1e-38f) ? 1 : -1];
+char isinf_norm [!__builtin_isinf(1e-307) ? 1 : -1];
+char isinf_denorm [!__builtin_isinf(1e-308) ? 1 : -1];
+char isinf_zero [!__builtin_isinf(0.0) ? 1 : -1];
+char isinf_negzero[!__builtin_isinf(-0.0) ? 1 : -1];
+char isinf_neg [!__builtin_isinf(-1.0) ? 1 : -1];
+char isinf_inf_neg[__builtin_isinf(-__builtin_inf()) ? 1 : -1];
+char isinf_nan [!__builtin_isinf(__builtin_nan("")) ? 1 : -1];
+char isinf_snan [!__builtin_isinf(__builtin_nans("")) ? 1 : -1];
+
+char isfinite_inf_pos[!__builtin_isfinite(__builtin_inf()) ? 1 : -1];
+char isfinite_pos [__builtin_isfinite(1.0) ? 1 : -1];
+char isfinite_normf [__builtin_isfinite(1e-37f) ? 1 : -1];
+char isfinite_denormf[__builtin_isfinite(1e-38f) ? 1 : -1];
+char isfinite_norm [__builtin_isfinite(1e-307) ? 1 : -1];
+char isfinite_denorm [__builtin_isfinite(1e-308) ? 1 : -1];
+char isfinite_zero [__builtin_isfinite(0.0) ? 1 : -1];
+char isfinite_negzero[__builtin_isfinite(-0.0) ? 1 : -1];
+char isfinite_neg [__builtin_isfinite(-1.0) ? 1 : -1];
+char isfinite_inf_neg[!__builtin_isfinite(-__builtin_inf()) ? 1 : -1];
+char isfinite_nan [!__builtin_isfinite(__builtin_nan("")) ? 1 : -1];
+char isfinite_snan [!__builtin_isfinite(__builtin_nans("")) ? 1 : -1];
+
+char isnan_inf_pos[!__builtin_isnan(__builtin_inf()) ? 1 : -1];
+char isnan_pos [!__builtin_isnan(1.0) ? 1 : -1];
+char isnan_normf [!__builtin_isnan(1e-37f) ? 1 : -1];
+char isnan_denormf[!__builtin_isnan(1e-38f) ? 1 : -1];
+char isnan_norm [!__builtin_isnan(1e-307) ? 1 : -1];
+char isnan_denorm [!__builtin_isnan(1e-308) ? 1 : -1];
+char isnan_zero [!__builtin_isnan(0.0) ? 1 : -1];
+char isnan_negzero[!__builtin_isnan(-0.0) ? 1 : -1];
+char isnan_neg [!__builtin_isnan(-1.0) ? 1 : -1];
+char isnan_inf_neg[!__builtin_isnan(-__builtin_inf()) ? 1 : -1];
+char isnan_nan [__builtin_isnan(__builtin_nan("")) ? 1 : -1];
+char isnan_snan [__builtin_isnan(__builtin_nans("")) ? 1 : -1];
+
+char isnormal_inf_pos[!__builtin_isnormal(__builtin_inf()) ? 1 : -1];
+char isnormal_pos [__builtin_isnormal(1.0) ? 1 : -1];
+char isnormal_normf [__builtin_isnormal(1e-37f) ? 1 : -1];
+char isnormal_denormf[!__builtin_isnormal(1e-38f) ? 1 : -1];
+char isnormal_norm [__builtin_isnormal(1e-307) ? 1 : -1];
+char isnormal_denorm [!__builtin_isnormal(1e-308) ? 1 : -1];
+char isnormal_zero [!__builtin_isnormal(0.0) ? 1 : -1];
+char isnormal_negzero[!__builtin_isnormal(-0.0) ? 1 : -1];
+char isnormal_neg [__builtin_isnormal(-1.0) ? 1 : -1];
+char isnormal_inf_neg[!__builtin_isnormal(-__builtin_inf()) ? 1 : -1];
+char isnormal_nan [!__builtin_isnormal(__builtin_nan("")) ? 1 : -1];
+char isnormal_snan [!__builtin_isnormal(__builtin_nans("")) ? 1 : -1];
+
//double g19 = __builtin_powi(2.0, 4);
//float g20 = __builtin_powif(2.0f, 4);
//long double g21 = __builtin_powil(2.0L, 4);
+#define BITSIZE(x) (sizeof(x) * 8)
+char g22[__builtin_clz(1) == BITSIZE(int) - 1 ? 1 : -1];
+char g23[__builtin_clz(7) == BITSIZE(int) - 3 ? 1 : -1];
+char g24[__builtin_clz(1 << (BITSIZE(int) - 1)) == 0 ? 1 : -1];
+int g25 = __builtin_clz(0); // expected-error {{not a compile-time constant}}
+char g26[__builtin_clzl(0xFL) == BITSIZE(long) - 4 ? 1 : -1];
+char g27[__builtin_clzll(0xFFLL) == BITSIZE(long long) - 8 ? 1 : -1];
+
+char g28[__builtin_ctz(1) == 0 ? 1 : -1];
+char g29[__builtin_ctz(8) == 3 ? 1 : -1];
+char g30[__builtin_ctz(1 << (BITSIZE(int) - 1)) == BITSIZE(int) - 1 ? 1 : -1];
+int g31 = __builtin_ctz(0); // expected-error {{not a compile-time constant}}
+char g32[__builtin_ctzl(0x10L) == 4 ? 1 : -1];
+char g33[__builtin_ctzll(0x100LL) == 8 ? 1 : -1];
+
+char g34[__builtin_popcount(0) == 0 ? 1 : -1];
+char g35[__builtin_popcount(0xF0F0) == 8 ? 1 : -1];
+char g36[__builtin_popcount(~0) == BITSIZE(int) ? 1 : -1];
+char g37[__builtin_popcount(~0L) == BITSIZE(int) ? 1 : -1];
+char g38[__builtin_popcountl(0L) == 0 ? 1 : -1];
+char g39[__builtin_popcountl(0xF0F0L) == 8 ? 1 : -1];
+char g40[__builtin_popcountl(~0L) == BITSIZE(long) ? 1 : -1];
+char g41[__builtin_popcountll(0LL) == 0 ? 1 : -1];
+char g42[__builtin_popcountll(0xF0F0LL) == 8 ? 1 : -1];
+char g43[__builtin_popcountll(~0LL) == BITSIZE(long long) ? 1 : -1];
+
+char g44[__builtin_parity(0) == 0 ? 1 : -1];
+char g45[__builtin_parity(0xb821) == 0 ? 1 : -1];
+char g46[__builtin_parity(0xb822) == 0 ? 1 : -1];
+char g47[__builtin_parity(0xb823) == 1 ? 1 : -1];
+char g48[__builtin_parity(0xb824) == 0 ? 1 : -1];
+char g49[__builtin_parity(0xb825) == 1 ? 1 : -1];
+char g50[__builtin_parity(0xb826) == 1 ? 1 : -1];
+char g51[__builtin_parity(~0) == 0 ? 1 : -1];
+char g52[__builtin_parityl(1L << (BITSIZE(long) - 1)) == 1 ? 1 : -1];
+char g53[__builtin_parityll(1LL << (BITSIZE(long long) - 1)) == 1 ? 1 : -1];
+
+char g54[__builtin_ffs(0) == 0 ? 1 : -1];
+char g55[__builtin_ffs(1) == 1 ? 1 : -1];
+char g56[__builtin_ffs(0xfbe71) == 1 ? 1 : -1];
+char g57[__builtin_ffs(0xfbe70) == 5 ? 1 : -1];
+char g58[__builtin_ffs(1U << (BITSIZE(int) - 1)) == BITSIZE(int) ? 1 : -1];
+char g59[__builtin_ffsl(0x10L) == 5 ? 1 : -1];
+char g60[__builtin_ffsll(0x100LL) == 9 ? 1 : -1];
+#undef BITSIZE
+
// GCC misc stuff
extern int f();
diff --git a/test/Sema/convertvector.c b/test/Sema/convertvector.c
new file mode 100644
index 000000000000..ccdd87f9e40c
--- /dev/null
+++ b/test/Sema/convertvector.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+typedef double vector4double __attribute__((__vector_size__(32)));
+typedef float vector8float __attribute__((__vector_size__(32)));
+
+vector8float foo1(vector4double x) {
+ return __builtin_convertvector(x, vector8float); // expected-error {{same number of elements}}
+}
+
+float foo2(vector4double x) {
+ return __builtin_convertvector(x, float); // expected-error {{must be a vector type}}
+}
+
+vector8float foo3(double x) {
+ return __builtin_convertvector(x, vector8float); // expected-error {{must be a vector}}
+}
+
diff --git a/test/Sema/declspec.c b/test/Sema/declspec.c
index 30c009201cef..d810632eeea5 100644
--- a/test/Sema/declspec.c
+++ b/test/Sema/declspec.c
@@ -36,3 +36,16 @@ void test2() {}
struct test3s {
} // expected-error {{expected ';' after struct}}
typedef int test3g;
+
+// PR8264
+const const int pr8264_1 = 0; // expected-warning {{duplicate 'const' declaration specifier}}
+volatile volatile int pr8264_2; // expected-warning {{duplicate 'volatile' declaration specifier}}
+char * restrict restrict pr8264_3; // expected-warning {{duplicate 'restrict' declaration specifier}}
+
+extern extern int pr8264_4; // expected-warning {{duplicate 'extern' declaration specifier}}
+void pr8264_5() {
+ register register int x; // expected-warning {{duplicate 'register' declaration specifier}}
+}
+
+inline inline void pr8264_6() {} // expected-warning {{duplicate 'inline' declaration specifier}}
+_Noreturn _Noreturn void pr8264_7(); // expected-warning {{duplicate '_Noreturn' declaration specifier}}
diff --git a/test/Sema/designated-initializers.c b/test/Sema/designated-initializers.c
index c9a8482e85db..6630da67c5bd 100644
--- a/test/Sema/designated-initializers.c
+++ b/test/Sema/designated-initializers.c
@@ -137,7 +137,6 @@ void test() {
};
}
-// FIXME: How do we test that this initializes the long properly?
union { char c; long l; } u1 = { .l = 0xFFFF };
extern float global_float;
@@ -223,6 +222,55 @@ struct Enigma enigma = {
};
+/// PR16644
+typedef union {
+ struct {
+ int zero;
+ int one;
+ int two;
+ int three;
+ } a;
+ int b[4];
+} union_16644_t;
+
+union_16644_t union_16644_instance_0 =
+{
+ .b[0] = 0, // expected-note{{previous}}
+ .a.one = 1, // expected-warning{{overrides}} expected-note{{previous}}
+ .b[2] = 2, // expected-warning{{overrides}} expected-note{{previous}}
+ .a.three = 3, // expected-warning{{overrides}}
+};
+
+union_16644_t union_16644_instance_1 =
+{
+ .a.three = 13, // expected-note{{previous}}
+ .b[2] = 12, // expected-warning{{overrides}} expected-note{{previous}}
+ .a.one = 11, // expected-warning{{overrides}} expected-note{{previous}}
+ .b[0] = 10, // expected-warning{{overrides}}
+};
+
+union_16644_t union_16644_instance_2 =
+{
+ .a.one = 21, // expected-note{{previous}}
+ .b[1] = 20, // expected-warning{{overrides}}
+};
+
+union_16644_t union_16644_instance_3 =
+{
+ .b[1] = 30, // expected-note{{previous}}
+ .a = { // expected-warning{{overrides}}
+ .one = 31
+ }
+};
+
+union_16644_t union_16644_instance_4[2] =
+{
+ [0].a.one = 2,
+ [1].a.zero = 3,// expected-note{{previous}}
+ [0].a.zero = 5,
+ [1].b[1] = 4 // expected-warning{{overrides}}
+};
+
/// PR4073
/// Should use evaluate to fold aggressively and emit a warning if not an ice.
extern int crazy_x;
@@ -277,3 +325,19 @@ struct ds ds2 = { { {
.a = 0,
.b = 1 // expected-error{{field designator 'b' does not refer to any field}}
} } };
+
+// Check initializer override warnings overriding a character in a string
+struct overwrite_string_struct {
+ char L[6];
+ int M;
+} overwrite_string[] = {
+ { { "foo" }, 1 }, // expected-note {{previous initialization is here}}
+ [0].L[2] = 'x' // expected-warning{{initializer overrides prior initialization of this subobject}}
+};
+struct overwrite_string_struct2 {
+ char L[6];
+ int M;
+} overwrite_string2[] = {
+ { { "foo" }, 1 },
+ [0].L[4] = 'x' // no-warning
+ };
diff --git a/test/Sema/dllimport-dllexport.c b/test/Sema/dllimport-dllexport.c
index 00c9df594b6f..80810d696e8c 100644
--- a/test/Sema/dllimport-dllexport.c
+++ b/test/Sema/dllimport-dllexport.c
@@ -41,3 +41,8 @@ void __attribute__((dllexport)) foo13();
extern int foo14 __attribute__((dllexport));
extern int foo14 __attribute__((dllimport)); // expected-warning{{dllimport attribute ignored}}
+
+__declspec(dllimport) int foo15 = 54; // expected-warning{{'dllimport' attribute cannot be specified on a definition}}
+
+extern __declspec(dllimport) int foo17;
+int foo17 = 54; // expected-warning{{'dllimport' attribute cannot be specified on a definition}}
diff --git a/test/Sema/empty1.c b/test/Sema/empty1.c
new file mode 100644
index 000000000000..de922f775ef7
--- /dev/null
+++ b/test/Sema/empty1.c
@@ -0,0 +1,85 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify -Wc++-compat
+
+struct emp_1 { // expected-warning {{empty struct has size 0 in C, size 1 in C++}}
+};
+
+union emp_2 { // expected-warning {{empty union has size 0 in C, size 1 in C++}}
+};
+
+struct emp_3 { // expected-warning {{struct has size 0 in C, size 1 in C++}}
+ int : 0;
+};
+
+union emp_4 { // expected-warning {{union has size 0 in C, size 1 in C++}}
+ int : 0;
+};
+
+struct emp_5 { // expected-warning {{struct has size 0 in C, size 1 in C++}}
+ int : 0;
+ int : 0;
+};
+
+union emp_6 { // expected-warning {{union has size 0 in C, size 1 in C++}}
+ int : 0;
+ int : 0;
+};
+
+struct emp_7 { // expected-warning {{struct has size 0 in C, size 1 in C++}}
+ struct emp_1 f1;
+};
+
+union emp_8 { // expected-warning {{union has size 0 in C, size 1 in C++}}
+ struct emp_1 f1;
+};
+
+struct emp_9 { // expected-warning {{struct has size 0 in C, non-zero size in C++}}
+ struct emp_1 f1;
+ union emp_2 f2;
+};
+
+// Checks for pointer subtraction (PR15683)
+struct emp_1 *func_1p(struct emp_1 *x) { return x - 5; }
+
+int func_1() {
+ struct emp_1 v[1];
+ return v - v; // expected-warning {{subtraction of pointers to type 'struct emp_1' of zero size has undefined behavior}}
+}
+
+int func_2(struct emp_1 *x) {
+ return 1 + x - x; // expected-warning {{subtraction of pointers to type 'struct emp_1' of zero size has undefined behavior}}
+}
+
+int func_3(struct emp_1 *x, struct emp_1 *y) {
+ return x - y; // expected-warning {{subtraction of pointers to type 'struct emp_1' of zero size has undefined behavior}}
+}
+
+int func_4(struct emp_1 *x, const struct emp_1 *y) {
+ return x - y; // expected-warning {{subtraction of pointers to type 'struct emp_1' of zero size has undefined behavior}}
+}
+
+int func_5(volatile struct emp_1 *x, const struct emp_1 *y) {
+ return x - y; // expected-warning {{subtraction of pointers to type 'struct emp_1' of zero size has undefined behavior}}
+}
+
+int func_6() {
+ union emp_2 v[1];
+ return v - v; // expected-warning {{subtraction of pointers to type 'union emp_2' of zero size has undefined behavior}}
+}
+
+struct A; // expected-note {{forward declaration of 'struct A'}}
+
+int func_7(struct A *x, struct A *y) {
+ return x - y; // expected-error {{arithmetic on a pointer to an incomplete type 'struct A'}}
+}
+
+int func_8(struct emp_1 (*x)[10], struct emp_1 (*y)[10]) {
+ return x - y; // expected-warning {{subtraction of pointers to type 'struct emp_1 [10]' of zero size has undefined behavior}}
+}
+
+int func_9(struct emp_1 (*x)[], struct emp_1 (*y)[]) {
+ return x - y; // expected-error {{arithmetic on a pointer to an incomplete type 'struct emp_1 []'}}
+}
+
+int func_10(int (*x)[0], int (*y)[0]) {
+ return x - y; // expected-warning {{subtraction of pointers to type 'int [0]' of zero size has undefined behavior}}
+}
diff --git a/test/Sema/empty2.c b/test/Sema/empty2.c
new file mode 100644
index 000000000000..68da5a8ee8ac
--- /dev/null
+++ b/test/Sema/empty2.c
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic
+
+struct emp_1 { // expected-warning {{empty struct is a GNU extension}}
+};
+
+union emp_2 { // expected-warning {{empty union is a GNU extension}}
+};
+
+struct emp_3 { // expected-warning {{struct without named members is a GNU extension}}
+ int : 0;
+};
+
+union emp_4 { // expected-warning {{union without named members is a GNU extension}}
+ int : 0;
+};
+
+struct emp_5 { // expected-warning {{struct without named members is a GNU extension}}
+ int : 0;
+ int : 0;
+};
+
+union emp_6 { // expected-warning {{union without named members is a GNU extension}}
+ int : 0;
+ int : 0;
+};
+
+struct nonamed_1 { // expected-warning {{struct without named members is a GNU extension}}
+ int : 4;
+};
+
+union nonamed_2 { // expected-warning {{union without named members is a GNU extension}}
+ int : 4;
+};
+
+struct nonamed_3 { // expected-warning {{struct without named members is a GNU extension}}
+ int : 4;
+ unsigned int : 4;
+};
+
+union nonamed_4 { // expected-warning {{union without named members is a GNU extension}}
+ int : 4;
+ unsigned int : 4;
+};
diff --git a/test/Sema/enum-increment.c b/test/Sema/enum-increment.c
new file mode 100644
index 000000000000..baaa3489b958
--- /dev/null
+++ b/test/Sema/enum-increment.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fsyntax-only %s -verify
+// expected-no-diagnostics
+enum A { A1, A2, A3 };
+typedef enum A A;
+void test() {
+ A a;
+ a++;
+ a--;
+ ++a;
+ --a;
+ a = a + 1;
+ a = a - 1;
+}
diff --git a/test/Sema/ext_vector_casts.c b/test/Sema/ext_vector_casts.c
index 848ec1f106f6..66004b03ff8c 100644
--- a/test/Sema/ext_vector_casts.c
+++ b/test/Sema/ext_vector_casts.c
@@ -1,10 +1,13 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fno-lax-vector-conversions %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fsyntax-only -verify -fno-lax-vector-conversions %s
typedef __attribute__(( ext_vector_type(2) )) float float2;
typedef __attribute__(( ext_vector_type(4) )) int int4;
typedef __attribute__(( ext_vector_type(8) )) short short8;
typedef __attribute__(( ext_vector_type(4) )) float float4;
typedef float t3 __attribute__ ((vector_size (16)));
+typedef __typeof__(sizeof(int)) size_t;
+typedef unsigned long ulong2 __attribute__ ((ext_vector_type(2)));
+typedef size_t stride4 __attribute__((ext_vector_type(4)));
static void test() {
float2 vec2;
@@ -50,3 +53,24 @@ void inc(float2 f2) {
f2++; // expected-error{{cannot increment value of type 'float2'}}
__real f2; // expected-error{{invalid type 'float2' to __real operator}}
}
+
+typedef enum
+{
+ uchar_stride = 1,
+ uchar4_stride = 4,
+ ushort4_stride = 8,
+ short4_stride = 8,
+ uint4_stride = 16,
+ int4_stride = 16,
+ float4_stride = 16,
+} PixelByteStride;
+
+stride4 RDar15091442_get_stride4(int4 x, PixelByteStride pixelByteStride);
+stride4 RDar15091442_get_stride4(int4 x, PixelByteStride pixelByteStride)
+{
+ stride4 stride;
+ // This previously caused an assertion failure.
+ stride.lo = ((ulong2) x) * pixelByteStride; // no-warning
+ return stride;
+}
+
diff --git a/test/Sema/extern-redecl.c b/test/Sema/extern-redecl.c
index e9a4c571bd2d..6bdb66e07f55 100644
--- a/test/Sema/extern-redecl.c
+++ b/test/Sema/extern-redecl.c
@@ -62,3 +62,27 @@ void test5c() {
void *(*_malloc)() = &malloc;
float *(*_calloc)() = &calloc;
}
+
+void test6() {
+ extern int test6_array1[100];
+ extern int test6_array2[100];
+ void test6_fn1(int*);
+ void test6_fn2(int*);
+ {
+ // Types are only merged from visible declarations.
+ char test6_array2;
+ char test6_fn2;
+ {
+ extern int test6_array1[];
+ extern int test6_array2[];
+ (void)sizeof(test6_array1); // ok
+ (void)sizeof(test6_array2); // expected-error {{incomplete type}}
+
+ void test6_fn1();
+ void test6_fn2();
+ test6_fn1(1.2); // expected-error {{passing 'double' to parameter of incompatible type 'int *'}}
+ // FIXME: This is valid, but we should warn on it.
+ test6_fn2(1.2);
+ }
+ }
+}
diff --git a/test/Sema/format-strings-ms.c b/test/Sema/format-strings-ms.c
new file mode 100644
index 000000000000..b89ee421ced8
--- /dev/null
+++ b/test/Sema/format-strings-ms.c
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -fms-compatibility -triple=i386-pc-win32 -pedantic %s
+
+int printf(const char *format, ...) __attribute__((format(printf, 1, 2)));
+
+void signed_test() {
+ short val = 30;
+ printf("val = %I64d\n", val); // expected-warning{{'I64' length modifier is not supported by ISO C}} \
+ // expected-warning{{format specifies type '__int64' (aka 'long long') but the argument has type 'short'}}
+ long long bigval = 30;
+ printf("val = %I32d\n", bigval); // expected-warning{{'I32' length modifier is not supported by ISO C}} \
+ // expected-warning{{format specifies type '__int32' (aka 'int') but the argument has type 'long long'}}
+ printf("val = %Id\n", bigval); // expected-warning{{'I' length modifier is not supported by ISO C}} \
+ // expected-warning{{format specifies type '__int32' (aka 'int') but the argument has type 'long long'}}
+}
+
+void unsigned_test() {
+ unsigned short val = 30;
+ printf("val = %I64u\n", val); // expected-warning{{'I64' length modifier is not supported by ISO C}} \
+ // expected-warning{{format specifies type 'unsigned __int64' (aka 'unsigned long long') but the argument has type 'unsigned short'}}
+ unsigned long long bigval = 30;
+ printf("val = %I32u\n", bigval); // expected-warning{{'I32' length modifier is not supported by ISO C}} \
+ // expected-warning{{format specifies type 'unsigned __int32' (aka 'unsigned int') but the argument has type 'unsigned long long'}}
+ printf("val = %Iu\n", bigval); // expected-warning{{'I' length modifier is not supported by ISO C}} \
+ // expected-warning{{format specifies type 'unsigned __int32' (aka 'unsigned int') but the argument has type 'unsigned long long'}}
+}
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index ba1272148973..6da027e02c65 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -591,3 +591,13 @@ void test_qualifiers(volatile int *vip, const int *cip,
printf("%n", (ip_t)0); // No warning.
printf("%n", (cip_t)0); // expected-warning{{format specifies type 'int *' but the argument has type 'cip_t' (aka 'const int *')}}
}
+
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#pragma GCC diagnostic warning "-Wformat-security"
+// <rdar://problem/14178260>
+extern void test_format_security_extra_args(const char*, int, ...)
+ __attribute__((__format__(__printf__, 1, 3)));
+void test_format_security_pos(char* string) {
+ test_format_security_extra_args(string, 5); // expected-warning {{format string is not a string literal (potentially insecure)}}
+}
+#pragma GCC diagnostic warning "-Wformat-nonliteral"
diff --git a/test/Sema/freemain.c b/test/Sema/freemain.c
index eed644d483ac..ff000c62cc70 100644
--- a/test/Sema/freemain.c
+++ b/test/Sema/freemain.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding %s
+// RUN: %clang_cc1 -triple i686-pc-openbsd -fsyntax-only -verify -ffreestanding %s
// Tests that -ffreestanding disables all special treatment of main().
diff --git a/test/Sema/function.c b/test/Sema/function.c
index bbf81a56cbb6..81d303c27f62 100644
--- a/test/Sema/function.c
+++ b/test/Sema/function.c
@@ -103,3 +103,13 @@ int func_e(int x) {
}
return x + 3;
}
+
+void decays(int a[3][3]); // expected-note {{passing argument to parameter 'a' here}}
+void no_decay(int (*a)[3]); // expected-note {{passing argument to parameter 'a' here}}
+
+void t22(int *ptr, int (*array)[3]) {
+ decays(ptr); // expected-warning {{incompatible pointer types passing 'int *' to parameter of type 'int (*)[3]'}}
+ no_decay(ptr); // expected-warning {{incompatible pointer types passing 'int *' to parameter of type 'int (*)[3]'}}
+ decays(array);
+ no_decay(array);
+}
diff --git a/test/Sema/gnu-flags.c b/test/Sema/gnu-flags.c
new file mode 100644
index 000000000000..e7588b7b371e
--- /dev/null
+++ b/test/Sema/gnu-flags.c
@@ -0,0 +1,171 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wno-gnu
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wgnu
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wno-gnu \
+// RUN: -Wgnu-alignof-expression -Wgnu-case-range -Wgnu-complex-integer -Wgnu-conditional-omitted-operand \
+// RUN: -Wgnu-empty-initializer -Wgnu-label-as-value -Wgnu-statement-expression \
+// RUN: -Wgnu-compound-literal-initializer -Wgnu-flexible-array-initializer \
+// RUN: -Wgnu-redeclared-enum -Wgnu-folding-constant -Wgnu-empty-struct \
+// RUN: -Wgnu-union-cast -Wgnu-variable-sized-type-not-at-end
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wgnu \
+// RUN: -Wno-gnu-alignof-expression -Wno-gnu-case-range -Wno-gnu-complex-integer -Wno-gnu-conditional-omitted-operand \
+// RUN: -Wno-gnu-empty-initializer -Wno-gnu-label-as-value -Wno-gnu-statement-expression \
+// RUN: -Wno-gnu-compound-literal-initializer -Wno-gnu-flexible-array-initializer \
+// RUN: -Wno-gnu-redeclared-enum -Wno-gnu-folding-constant -Wno-gnu-empty-struct \
+// RUN: -Wno-gnu-union-cast -Wno-gnu-variable-sized-type-not-at-end
+// Additional disabled tests:
+// %clang_cc1 -fsyntax-only -verify %s -DALIGNOF -Wno-gnu -Wgnu-alignof-expression
+// %clang_cc1 -fsyntax-only -verify %s -DCASERANGE -Wno-gnu -Wgnu-case-range
+// %clang_cc1 -fsyntax-only -verify %s -DCOMPLEXINT -Wno-gnu -Wgnu-complex-integer
+// %clang_cc1 -fsyntax-only -verify %s -DOMITTEDOPERAND -Wno-gnu -Wgnu-conditional-omitted-operand
+// %clang_cc1 -fsyntax-only -verify %s -DEMPTYINIT -Wno-gnu -Wgnu-empty-initializer
+// %clang_cc1 -fsyntax-only -verify %s -DLABELVALUE -Wno-gnu -Wgnu-label-as-value
+// %clang_cc1 -fsyntax-only -verify %s -DSTATEMENTEXP -Wno-gnu -Wgnu-statement-expression
+// %clang_cc1 -fsyntax-only -verify %s -DCOMPOUNDLITERALINITIALIZER -Wno-gnu -Wgnu-compound-literal-initializer
+// %clang_cc1 -fsyntax-only -verify %s -DFLEXIBLEARRAYINITIALIZER -Wno-gnu -Wgnu-flexible-array-initializer
+// %clang_cc1 -fsyntax-only -verify %s -DREDECLAREDENUM -Wno-gnu -Wgnu-redeclared-enum
+// %clang_cc1 -fsyntax-only -verify %s -DUNIONCAST -Wno-gnu -Wgnu-union-cast
+// %clang_cc1 -fsyntax-only -verify %s -DVARIABLESIZEDTYPENOTATEND -Wno-gnu -Wgnu-variable-sized-type-not-at-end
+// %clang_cc1 -fsyntax-only -verify %s -DFOLDINGCONSTANT -Wno-gnu -Wgnu-folding-constant
+// %clang_cc1 -fsyntax-only -verify %s -DEMPTYSTRUCT -Wno-gnu -Wgnu-empty-struct
+
+#if NONE
+// expected-no-diagnostics
+#endif
+
+
+#if ALL || ALIGNOF
+// expected-warning@+4 {{'_Alignof' applied to an expression is a GNU extension}}
+#endif
+
+char align;
+_Static_assert(_Alignof(align) > 0, "align's alignment is wrong");
+
+
+#if ALL || CASERANGE
+// expected-warning@+5 {{use of GNU case range extension}}
+#endif
+
+void caserange(int x) {
+ switch (x) {
+ case 42 ... 44: ;
+ }
+}
+
+
+#if ALL || COMPLEXINT
+// expected-warning@+3 {{complex integer types are a GNU extension}}
+#endif
+
+_Complex short int complexint;
+
+
+#if ALL || OMITTEDOPERAND
+// expected-warning@+3 {{use of GNU ?: conditional expression extension, omitting middle operand}}
+#endif
+
+static const char* omittedoperand = (const char*)0 ?: "Null";
+
+
+#if ALL || EMPTYINIT
+// expected-warning@+3 {{use of GNU empty initializer extension}}
+#endif
+
+struct { int x; } emptyinit = {};
+
+
+#if ALL || LABELVALUE
+// expected-warning@+6 {{use of GNU address-of-label extension}}
+// expected-warning@+7 {{use of GNU indirect-goto extension}}
+#endif
+
+void labelvalue() {
+ void *ptr;
+ ptr = &&foo;
+foo:
+ goto *ptr;
+}
+
+
+#if ALL || STATEMENTEXP
+// expected-warning@+5 {{use of GNU statement expression extension}}
+#endif
+
+void statementexp()
+{
+ int a = ({ 1; });
+}
+
+
+#if ALL || COMPOUNDLITERALINITIALIZER
+// expected-warning@+4 {{initialization of an array of type 'int [5]' from a compound literal of type 'int [5]' is a GNU extension}}
+#endif
+
+typedef int int5[5];
+int cli[5] = (int[]){1, 2, 3, 4, 5};
+
+
+#if ALL || FLEXIBLEARRAYINITIALIZER
+// expected-note@+6 {{initialized flexible array member 'y' is here}}
+// expected-warning@+6 {{flexible array initialization is a GNU extension}}
+#endif
+
+struct fai {
+ int x;
+ int y[];
+} fai = { 1, { 2, 3, 4 } };
+
+
+#if ALL || FOLDINGCONSTANT
+// expected-warning@+5 {{expression is not an integer constant expression; folding it to a constant is a GNU extension}}
+// expected-warning@+7 {{variable length array folded to constant array as an extension}}
+#endif
+
+enum {
+ fic = (int)(0.75 * 1000 * 1000)
+};
+static const int size = 100;
+void foo(void) { int data[size]; }
+
+#if ALL || REDECLAREDENUM
+// expected-note@+4 {{previous definition is here}}
+// expected-warning@+8 {{redeclaration of already-defined enum 'RE' is a GNU extension}}
+#endif
+
+enum RE {
+ Val1,
+ Val2
+};
+
+enum RE;
+
+
+#if ALL || UNIONCAST
+// expected-warning@+4 {{cast to union type is a GNU extension}}
+#endif
+
+union uc { int i; unsigned : 3; };
+union uc w = (union uc)2;
+
+
+#if ALL || VARIABLESIZEDTYPENOTATEND
+// expected-warning@+8 {{field 'hdr' with variable sized type 'struct vst' not at the end of a struct or class is a GNU extension}}
+#endif
+
+struct vst {
+ short tag_type;
+ char tag_data[];
+};
+struct vstnae {
+ struct vst hdr;
+ char data;
+};
+
+
+#if ALL || EMPTYSTRUCT
+// expected-warning@+4 {{empty struct is a GNU extension}}
+// expected-warning@+4 {{struct without named members is a GNU extension}}
+#endif
+
+const struct {} es;
+struct {int:5;} swnm;
+
diff --git a/test/Sema/init.c b/test/Sema/init.c
index 81a665dc6297..4a5fc558c51b 100644
--- a/test/Sema/init.c
+++ b/test/Sema/init.c
@@ -157,3 +157,6 @@ int PR4386_zed() __attribute((weak));
typedef char strty[10];
struct vortexstruct { strty s; };
struct vortexstruct vortexvar = { "asdf" };
+
+typedef struct { uintptr_t x : 2; } StructWithBitfield;
+StructWithBitfield bitfieldvar = { (uintptr_t)&bitfieldvar }; // expected-error {{initializer element is not a compile-time constant}}
diff --git a/test/Sema/inline.c b/test/Sema/inline.c
index 496e282ecacd..8a3835b71ada 100644
--- a/test/Sema/inline.c
+++ b/test/Sema/inline.c
@@ -83,6 +83,19 @@ extern inline void defineStaticVarInExtern() {
static int y = 0; // ok
}
+// Check behavior of line markers.
+# 1 "XXX.h" 1
+inline int useStaticMainFileInLineMarker() { // expected-note 2 {{use 'static' to give inline function 'useStaticMainFileInLineMarker' internal linkage}}
+ staticFunction(); // expected-warning{{static function 'staticFunction' is used in an inline function with external linkage}}
+ return staticVar; // expected-warning{{static variable 'staticVar' is used in an inline function with external linkage}}
+}
+# 100 "inline.c" 2
+
+inline int useStaticMainFileAfterLineMarker() {
+ staticFunction(); // no-warning
+ return staticVar; // no-warning
+}
+
#endif
diff --git a/test/Sema/member-reference.c b/test/Sema/member-reference.c
index edbbea59ac87..8939fd515709 100644
--- a/test/Sema/member-reference.c
+++ b/test/Sema/member-reference.c
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 %s -verify -fsyntax-only
-// expected-no-diagnostics
struct simple { int i; };
@@ -19,3 +18,7 @@ void g(void) {
s->x = 1;
s->z = 2;
}
+
+int PR17762(struct simple c) {
+ return c->i; // expected-error {{member reference type 'struct simple' is not a pointer; maybe you meant to use '.'?}}
+}
diff --git a/test/Sema/mips16_attr_allowed.c b/test/Sema/mips16_attr_allowed.c
index 21a94e773f92..c712e902f5fb 100644
--- a/test/Sema/mips16_attr_allowed.c
+++ b/test/Sema/mips16_attr_allowed.c
@@ -2,22 +2,22 @@
void foo32();
void foo16();
-void __attribute__((nomips16)) foo32();
-void __attribute__((mips16)) foo16();
+void __attribute__((nomips16)) foo32();
+void __attribute__((mips16)) foo16();
-void __attribute__((nomips16)) foo32_();
-void __attribute__((mips16)) foo16_();
+void __attribute__((nomips16)) foo32_();
+void __attribute__((mips16)) foo16_();
void foo32_();
void foo16_();
-void foo32__() __attribute__((nomips16));
-void foo32__() __attribute__((mips16));
+void foo32__() __attribute__((nomips16));
+void foo32__() __attribute__((mips16));
-void foo32a() __attribute__((nomips16(xyz))) ; // expected-error {{attribute takes no arguments}}
-void __attribute__((mips16(xyz))) foo16a(); // expected-error {{attribute takes no arguments}}
+void foo32a() __attribute__((nomips16(0))) ; // expected-error {{'nomips16' attribute takes no arguments}}
+void __attribute__((mips16(1))) foo16a(); // expected-error {{'mips16' attribute takes no arguments}}
-void __attribute__((nomips16(1, 2))) foo32b(); // expected-error {{attribute takes no arguments}}
-void __attribute__((mips16(1, 2))) foo16b(); // expected-error {{attribute takes no arguments}}
+void __attribute__((nomips16(1, 2))) foo32b(); // expected-error {{'nomips16' attribute takes no arguments}}
+void __attribute__((mips16(1, 2))) foo16b(); // expected-error {{'mips16' attribute takes no arguments}}
__attribute((nomips16)) int a; // expected-error {{attribute only applies to functions}}
diff --git a/test/Sema/mrtd.c b/test/Sema/mrtd.c
new file mode 100644
index 000000000000..ba1720e8d7dc
--- /dev/null
+++ b/test/Sema/mrtd.c
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -DMRTD -mrtd -triple i386-unknown-unknown -verify %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -verify %s
+
+#ifndef MRTD
+// expected-note@+5 {{previous declaration is here}}
+// expected-error@+5 {{function declared 'stdcall' here was previously declared without calling convention}}
+// expected-note@+5 {{previous declaration is here}}
+// expected-error@+5 {{function declared 'stdcall' here was previously declared without calling convention}}
+#endif
+void nonvariadic1(int a, int b, int c);
+void __attribute__((stdcall)) nonvariadic1(int a, int b, int c);
+void nonvariadic2(int a, int b, int c);
+void __attribute__((stdcall)) nonvariadic2(int a, int b, int c) { }
+
+// expected-warning@+2 {{stdcall calling convention ignored on variadic function}}
+void variadic(int a, ...);
+void __attribute__((stdcall)) variadic(int a, ...);
+
+#ifdef MRTD
+// expected-note@+3 {{previous definition is here}}
+// expected-error@+3 {{redefinition of 'a' with a different type: 'void ((*))(int, int) __attribute__((cdecl))' vs 'void (*)(int, int) __attribute__((stdcall))'}}
+#endif
+extern void (*a)(int, int);
+__attribute__((cdecl)) extern void (*a)(int, int);
+
+extern void (*b)(int, ...);
+__attribute__((cdecl)) extern void (*b)(int, ...);
+
+#ifndef MRTD
+// expected-note@+3 {{previous definition is here}}
+// expected-error@+3 {{redefinition of 'c' with a different type: 'void ((*))(int, int) __attribute__((stdcall))' vs 'void (*)(int, int)'}}
+#endif
+extern void (*c)(int, int);
+__attribute__((stdcall)) extern void (*c)(int, int);
+
+// expected-warning@+2 {{stdcall calling convention ignored on variadic function}}
+extern void (*d)(int, ...);
+__attribute__((stdcall)) extern void (*d)(int, ...);
diff --git a/test/Sema/ms-inline-asm.c b/test/Sema/ms-inline-asm.c
index 1916d3463de5..69f234e5e9ae 100644
--- a/test/Sema/ms-inline-asm.c
+++ b/test/Sema/ms-inline-asm.c
@@ -1,4 +1,4 @@
-// REQUIRES: disabled
+// REQUIRES: x86-64-registered-target
// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fasm-blocks -Wno-microsoft -verify -fsyntax-only
void t1(void) {
@@ -13,22 +13,22 @@ void f() {
}
f();
__asm {
- mov eax, 1+=2 // expected-error 2 {{unknown token in expression}}
+ mov eax, 1+=2 // expected-error {{unknown token in expression}}
}
f();
__asm {
- mov eax, 1+++ // expected-error 2 {{unknown token in expression}}
+ mov eax, 1+++ // expected-error {{unknown token in expression}}
}
f();
__asm {
- mov eax, LENGTH bar // expected-error {{Unable to lookup expr!}}
+ mov eax, LENGTH bar // expected-error {{unable to lookup expression}}
}
f();
__asm {
- mov eax, SIZE bar // expected-error {{Unable to lookup expr!}}
+ mov eax, SIZE bar // expected-error {{unable to lookup expression}}
}
f();
__asm {
- mov eax, TYPE bar // expected-error {{Unable to lookup expr!}}
+ mov eax, TYPE bar // expected-error {{unable to lookup expression}}
}
}
diff --git a/test/Sema/ms-keyword-system-header.c b/test/Sema/ms-keyword-system-header.c
new file mode 100644
index 000000000000..b4ff5683cdfd
--- /dev/null
+++ b/test/Sema/ms-keyword-system-header.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fms-extensions -D MS -isystem %S/Inputs %s -fsyntax-only -verify
+// RUN: %clang_cc1 -fms-extensions -D MS -Wno-keyword-compat -I %S/Inputs %s -fsyntax-only -verify
+// RUN: %clang_cc1 -fms-extensions -D MS -D NOT_SYSTEM -I %S/Inputs %s -fsyntax-only -verify
+// RUN: %clang_cc1 -isystem %S/Inputs %s -fsyntax-only -verify
+
+// PR17824: GNU libc uses MS keyword __uptr as an identifier in C mode
+#include <ms-keyword-system-header.h>
+
+void fn() {
+ WS ws;
+ ws.__uptr = 0;
+#ifdef MS
+ // expected-error@-2 {{expected identifier}}
+#else
+ // expected-no-diagnostics
+#endif
+}
diff --git a/test/Sema/ms-wchar.c b/test/Sema/ms-wchar.c
new file mode 100644
index 000000000000..febaf283b338
--- /dev/null
+++ b/test/Sema/ms-wchar.c
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions -triple i386-pc-win32 %s
+
+// C++ mode with -fno-wchar works the same as C mode for wchar_t.
+// RUN: %clang_cc1 -x c++ -fno-wchar -fsyntax-only -verify -fms-extensions -triple i386-pc-win32 %s
+
+wchar_t f(); // expected-error{{unknown type name 'wchar_t'}}
+
+// __wchar_t is available as an MS extension.
+__wchar_t g = L'a'; // expected-note {{previous}}
+
+// __wchar_t is a distinct type, separate from the target's integer type for wide chars.
+unsigned short g; // expected-error {{redefinition of 'g' with a different type: 'unsigned short' vs '__wchar_t'}}
+
+// The type of a wide string literal is actually not __wchar_t.
+__wchar_t s[] = L"Hello world!"; // expected-error-re {{array initializer must be an initializer list$}}
+
+// Do not suggest initializing with a string here, because it would not work.
+__wchar_t t[] = 1; // expected-error-re {{array initializer must be an initializer list$}}
diff --git a/test/Sema/ms_abi-sysv_abi.c b/test/Sema/ms_abi-sysv_abi.c
new file mode 100644
index 000000000000..35a5fad9ceb3
--- /dev/null
+++ b/test/Sema/ms_abi-sysv_abi.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-pc-linux-gnu %s
+
+// CC qualifier can be applied only to functions
+int __attribute__((ms_abi)) var1; // expected-warning{{'ms_abi' only applies to function types; type here is 'int'}}
+int __attribute__((sysv_abi)) var2; // expected-warning{{'sysv_abi' only applies to function types; type here is 'int'}}
+
+// Different CC qualifiers are not compatible
+// FIXME: Should say 'sysv_abi' instead of 'cdecl'
+void __attribute__((ms_abi, sysv_abi)) foo3(void); // expected-error{{cdecl and ms_abi attributes are not compatible}}
+void __attribute__((ms_abi)) foo4(); // expected-note{{previous declaration is here}}
+void __attribute__((sysv_abi)) foo4(void); // expected-error{{function declared 'cdecl' here was previously declared 'ms_abi'}}
+
+void bar(int i, int j) __attribute__((ms_abi, cdecl)); // expected-error{{cdecl and ms_abi attributes are not compatible}}
+void bar2(int i, int j) __attribute__((sysv_abi, cdecl)); // no-error
diff --git a/test/Sema/ms_bitfield_layout.c b/test/Sema/ms_bitfield_layout.c
new file mode 100644
index 000000000000..4a2076c1dbac
--- /dev/null
+++ b/test/Sema/ms_bitfield_layout.c
@@ -0,0 +1,243 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -cxx-abi microsoft -fdump-record-layouts %s 2>/dev/null \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -cxx-abi microsoft -fdump-record-layouts %s 2>/dev/null \
+// RUN: | FileCheck %s
+
+typedef struct A {
+ char x;
+ int a : 22;
+ int : 0;
+ int c : 10;
+ char b : 3;
+ char d: 4;
+ short y;
+} A;
+
+// CHECK: Type: struct A
+// CHECK: Size:128
+// CHECK: Alignment:32
+// CHECK: FieldOffsets: [0, 32, 64, 64, 96, 99, 112]>
+
+typedef struct B {
+ char x;
+ int : 0;
+ short a : 4;
+ char y;
+} B;
+
+// CHECK: Type: struct B
+// CHECK: Size:48
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 8, 16, 32]>
+
+typedef struct C {
+ char x;
+ short a : 4;
+ int : 0;
+ char y;
+} C;
+
+// CHECK: Type: struct C
+// CHECK: Size:64
+// CHECK: Alignment:32
+// CHECK: FieldOffsets: [0, 16, 32, 32]>
+
+typedef struct D {
+ char x;
+ short : 0;
+ int : 0;
+ char y;
+} D;
+
+// CHECK: Type: struct D
+// CHECK: Size:16
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 8, 8]>
+
+typedef union E {
+ char x;
+ long long a : 3;
+ int b : 3;
+ long long : 0;
+ short y;
+} E;
+
+// CHECK: Type: union E
+// CHECK: Size:64
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>
+
+typedef struct F {
+ char x;
+ char a : 3;
+ char b : 3;
+ char c : 3;
+ short d : 6;
+ short e : 6;
+ short f : 6;
+ short g : 11;
+ short h : 11;
+ short i : 11;
+ short y;
+} F;
+
+// CHECK: Type: struct F
+// CHECK: Size:128
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 8, 11, 16, 32, 38, 48, 64, 80, 96, 112]>
+
+typedef union G {
+ char x;
+ int a : 3;
+ int : 0;
+ long long : 0;
+ short y;
+} G;
+
+// CHECK: Type: union G
+// CHECK: Size:32
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>
+
+typedef struct H {
+ unsigned short a : 1;
+ unsigned char : 0;
+ unsigned long : 0;
+ unsigned short c : 1;
+} H;
+
+// CHECK: Type: struct H
+// CHECK: Size:32
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 16, 16, 16]>
+
+#pragma pack(push, 1)
+
+typedef struct A1 {
+ char x;
+ int a : 22;
+ int : 0;
+ int c : 10;
+ char b : 3;
+ char d: 4;
+ short y;
+} A1;
+
+// CHECK: Type: struct A1
+// CHECK: Size:96
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 40, 40, 72, 75, 80]>
+
+typedef struct B1 {
+ char x;
+ int : 0;
+ short a : 4;
+ char y;
+} B1;
+
+// CHECK: Type: struct B1
+// CHECK: Size:32
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 8, 24]>
+
+typedef struct C1 {
+ char x;
+ short a : 4;
+ int : 0;
+ char y;
+} C1;
+
+// CHECK: Type: struct C1
+// CHECK: Size:32
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 24, 24]>
+
+typedef struct D1 {
+ char x;
+ short : 0;
+ int : 0;
+ char y;
+} D1;
+
+// CHECK: Type: struct D1
+// CHECK: Size:16
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 8, 8]>
+
+typedef union E1 {
+ char x;
+ long long a : 3;
+ int b : 3;
+ long long : 0;
+ short y;
+} E1;
+
+// CHECK: Type: union E1
+// CHECK: Size:64
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>
+
+typedef struct F1 {
+ char x;
+ char a : 3;
+ char b : 3;
+ char c : 3;
+ short d : 6;
+ short e : 6;
+ short f : 6;
+ short g : 11;
+ short h : 11;
+ short i : 11;
+ short y;
+} F1;
+
+// CHECK: Type: struct F1
+// CHECK: Size:120
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 11, 16, 24, 30, 40, 56, 72, 88, 104]>
+
+typedef union G1 {
+ char x;
+ int a : 3;
+ int : 0;
+ long long : 0;
+ short y;
+} G1;
+
+// CHECK: Type: union G1
+// CHECK: Size:32
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>
+
+typedef struct H1 {
+ unsigned long a : 1;
+ unsigned char : 0;
+ unsigned long : 0;
+ unsigned long c : 1;
+} H1;
+
+// CHECK: Type: struct H1
+// CHECK: Size:64
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 32, 32, 32]>
+
+#pragma pack(pop)
+
+int x[
+sizeof(A ) +
+sizeof(B ) +
+sizeof(C ) +
+sizeof(D ) +
+sizeof(E ) +
+sizeof(F ) +
+sizeof(G ) +
+sizeof(H ) +
+sizeof(A1) +
+sizeof(B1) +
+sizeof(C1) +
+sizeof(D1) +
+sizeof(E1) +
+sizeof(F1) +
+sizeof(G1) +
+sizeof(H1) +
+0];
diff --git a/test/Sema/ms_class_layout.cpp b/test/Sema/ms_class_layout.cpp
index f48494733184..bb8052e12ec3 100644
--- a/test/Sema/ms_class_layout.cpp
+++ b/test/Sema/ms_class_layout.cpp
@@ -164,7 +164,7 @@ int main() {
// CHECK-NEXT: 0 | (D vftable pointer)
// CHECK-NEXT: 8 | double a
-// CHECK-NEXT: sizeof=16, dsize=16, align=8
+// CHECK-NEXT: sizeof=16, align=8
// CHECK-NEXT: nvsize=16, nvalign=8
// CHECK: %class.D = type { i32 (...)**, double }
@@ -173,7 +173,7 @@ int main() {
// CHECK-NEXT: 0 | (B vftable pointer)
// CHECK-NEXT: 4 | int b_field
-// CHECK-NEXT: sizeof=8, dsize=8, align=4
+// CHECK-NEXT: sizeof=8, align=4
// CHECK-NEXT: nvsize=8, nvalign=4
// CHECK: %class.B = type { i32 (...)**, i32 }
@@ -185,7 +185,7 @@ int main() {
// CHECK-NEXT: 8 | int a_field
// CHECK-NEXT: 12 | char one
-// CHECK-NEXT: sizeof=16, dsize=16, align=4
+// CHECK-NEXT: sizeof=16, align=4
// CHECK-NEXT: nvsize=16, nvalign=4
// CHECK: 0 | class C
@@ -207,7 +207,7 @@ int main() {
// CHECK-NEXT: 72 | int a_field
// CHECK-NEXT: 76 | char one
-// CHECK-NEXT: sizeof=80, dsize=80, align=8
+// CHECK-NEXT: sizeof=80, align=8
// CHECK-NEXT: nvsize=64, nvalign=8
// CHECK: %class.A = type { %class.B, i32, i8 }
@@ -237,10 +237,10 @@ int main() {
// CHECK-NEXT: 88 | int a_field
// CHECK-NEXT: 92 | char one
-// CHECK-NEXT: sizeof=80, dsize=80, align=8
+// CHECK-NEXT: sizeof=80, align=8
// CHECK-NEXT: nvsize=64, nvalign=8
-// CHECK: sizeof=96, dsize=96, align=8
+// CHECK: sizeof=96, align=8
// CHECK-NEXT: nvsize=96, nvalign=8
// CHECK: %struct.BaseStruct = type { double, float, %class.C }
@@ -267,18 +267,18 @@ int main() {
// CHECK-NEXT: 84 | int b_field
// CHECK-NEXT: 88 | int a_field
// CHECK-NEXT: 92 | char one
-// CHECK-NEXT: sizeof=80, dsize=80, align=8
+// CHECK-NEXT: sizeof=80, align=8
// CHECK-NEXT: nvsize=64, nvalign=8
// CHECK: 96 | int x
-// CHECK-NEXT: sizeof=104, dsize=104, align=8
+// CHECK-NEXT: sizeof=104, align=8
// CHECK-NEXT: nvsize=104, nvalign=8
// CHECK: %struct.DerivedStruct = type { %struct.BaseStruct, i32 }
// CHECK: 0 | struct G
// CHECK-NEXT: 0 | int g_field
-// CHECK-NEXT: sizeof=4, dsize=4, align=4
+// CHECK-NEXT: sizeof=4, align=4
// CHECK-NEXT: nvsize=4, nvalign=4
// CHECK: 0 | struct H
@@ -288,7 +288,7 @@ int main() {
// CHECK-NEXT: 8 | class D (virtual base)
// CHECK-NEXT: 8 | (D vftable pointer)
// CHECK-NEXT: 16 | double a
-// CHECK-NEXT: sizeof=24, dsize=24, align=8
+// CHECK-NEXT: sizeof=24, align=8
// CHECK-NEXT: nvsize=8, nvalign=4
// CHECK: %struct.H = type { %struct.G, i32*, %class.D }
@@ -300,7 +300,7 @@ int main() {
// CHECK-NEXT: 24 | class D (virtual base)
// CHECK-NEXT: 24 | (D vftable pointer)
// CHECK-NEXT: 32 | double a
-// CHECK-NEXT: sizeof=40, dsize=40, align=8
+// CHECK-NEXT: sizeof=40, align=8
// CHECK-NEXT: nvsize=24, nvalign=8
// CHECK: %struct.I = type { i32 (...)**, [4 x i8], i32*, double, %class.D }
@@ -308,12 +308,12 @@ int main() {
// CHECK: 0 | struct L
// CHECK-NEXT: 0 | int l
-// CHECK-NEXT: sizeof=4, dsize=4, align=4
+// CHECK-NEXT: sizeof=4, align=4
// CHECK-NEXT: nvsize=4, nvalign=4
// CHECK: 0 | struct K
// CHECK-NEXT: 0 | int k
-// CHECK-NEXT: sizeof=4, dsize=4, align=4
+// CHECK-NEXT: sizeof=4, align=4
// CHECK-NEXT: nvsize=4, nvalign=4
// CHECK: 0 | struct M
@@ -321,42 +321,42 @@ int main() {
// CHECK-NEXT: 4 | int m
// CHECK-NEXT: 8 | struct K (virtual base)
// CHECK-NEXT: 8 | int k
-// CHECK-NEXT: sizeof=12, dsize=12, align=4
+// CHECK-NEXT: sizeof=12, align=4
//CHECK: %struct.M = type { i32*, i32, %struct.K }
//CHECK: %struct.M.base = type { i32*, i32 }
// CHECK: 0 | struct N
+// CHECK-NEXT: 0 | (N vftable pointer)
// CHECK-NEXT: 4 | struct L (base)
// CHECK-NEXT: 4 | int l
// CHECK-NEXT: 8 | struct M (base)
// CHECK-NEXT: 8 | (M vbtable pointer)
// CHECK-NEXT: 12 | int m
-// CHECK-NEXT: 0 | (N vftable pointer)
// CHECK-NEXT: 16 | struct K (virtual base)
// CHECK-NEXT: 16 | int k
-// CHECK-NEXT: sizeof=20, dsize=20, align=4
+// CHECK-NEXT: sizeof=20, align=4
// CHECK-NEXT: nvsize=16, nvalign=4
//CHECK: %struct.N = type { i32 (...)**, %struct.L, %struct.M.base, %struct.K }
-// FIXME: MSVC place struct H at offset 8.
// CHECK: 0 | struct O
-// CHECK-NEXT: 4 | struct H (base)
-// CHECK-NEXT: 4 | struct G (base)
-// CHECK-NEXT: 4 | int g_field
-// CHECK-NEXT: 8 | (H vbtable pointer)
-// CHECK-NEXT: 12 | struct G (base)
-// CHECK-NEXT: 12 | int g_field
// CHECK-NEXT: 0 | (O vftable pointer)
-// CHECK-NEXT: 16 | class D (virtual base)
-// CHECK-NEXT: 16 | (D vftable pointer)
-// CHECK-NEXT: 24 | double a
-// CHECK-NEXT: sizeof=32, dsize=32, align=8
-// CHECK-NEXT: nvsize=16, nvalign=4
+// CHECK-NEXT: 8 | struct H (base)
+// CHECK-NEXT: 8 | struct G (base)
+// CHECK-NEXT: 8 | int g_field
+// CHECK-NEXT: 12 | (H vbtable pointer)
+// CHECK-NEXT: 16 | struct G (base)
+// CHECK-NEXT: 16 | int g_field
+// CHECK-NEXT: 24 | class D (virtual base)
+// CHECK-NEXT: 24 | (D vftable pointer)
+// CHECK-NEXT: 32 | double a
+// CHECK-NEXT: | [sizeof=40, align=8
+// CHECK-NEXT: | nvsize=24, nvalign=8]
+
+// CHECK: struct.O = type { i32 (...)**, [4 x i8], %struct.H.base, %struct.G, [4 x i8], %class.D }
+// CHECK: struct.O.base = type { i32 (...)**, [4 x i8], %struct.H.base, %struct.G, [4 x i8] }
-//CHECK: %struct.O = type { i32 (...)**, %struct.H.base, %struct.G, %class.D }
-//CHECK: %struct.O.base = type { i32 (...)**, %struct.H.base, %struct.G }
// CHECK: 0 | struct P
// CHECK-NEXT: 0 | struct M (base)
@@ -367,20 +367,20 @@ int main() {
// CHECK-NEXT: 12 | int k
// CHECK-NEXT: 16 | struct L (virtual base)
// CHECK-NEXT: 16 | int l
-// CHECK-NEXT: sizeof=20, dsize=20, align=4
+// CHECK-NEXT: sizeof=20, align=4
// CHECK-NEXT: nvsize=12, nvalign=4
//CHECK: %struct.P = type { %struct.M.base, i32, %struct.K, %struct.L }
// CHECK: 0 | struct R (empty)
-// CHECK-NEXT: sizeof=1, dsize=0, align=1
+// CHECK-NEXT: sizeof=1, align=1
// CHECK-NEXT: nvsize=0, nvalign=1
//CHECK: %struct.R = type { i8 }
// CHECK: 0 | struct f
// CHECK-NEXT: 0 | (f vftable pointer)
-// CHECK-NEXT: sizeof=4, dsize=4, align=4
+// CHECK-NEXT: sizeof=4, align=4
// CHECK-NEXT: nvsize=4, nvalign=4
// CHECK: 0 | struct s
@@ -390,12 +390,12 @@ int main() {
// CHECK-NEXT: 12 | (vtordisp for vbase f)
// CHECK-NEXT: 16 | struct f (virtual base)
// CHECK-NEXT: 16 | (f vftable pointer)
-// CHECK-NEXT: sizeof=20, dsize=20, align=4
+// CHECK-NEXT: sizeof=20, align=4
// CHECK-NEXT: nvsize=12, nvalign=4
// CHECK: 0 | class IA
// CHECK-NEXT: 0 | (IA vftable pointer)
-// CHECK-NEXT: sizeof=4, dsize=4, align=4
+// CHECK-NEXT: sizeof=4, align=4
// CHECK-NEXT: nvsize=4, nvalign=4
// CHECK: 0 | class ICh
@@ -404,7 +404,7 @@ int main() {
// CHECK-NEXT: 8 | (vtordisp for vbase IA)
// CHECK-NEXT: 12 | class IA (virtual base)
// CHECK-NEXT: 12 | (IA vftable pointer)
-// CHECK-NEXT: sizeof=16, dsize=16, align=4
+// CHECK-NEXT: sizeof=16, align=4
// CHECK-NEXT: nvsize=8, nvalign=4
// CHECK: 0 | struct sd
@@ -424,7 +424,7 @@ int main() {
// CHECK-NEXT: 40 | class ICh (virtual base)
// CHECK-NEXT: 40 | (ICh vftable pointer)
// CHECK-NEXT: 44 | (ICh vbtable pointer)
-// CHECK-NEXT: sizeof=48, dsize=48, align=4
+// CHECK-NEXT: sizeof=48, align=4
// CHECK-NEXT: nvsize=12, nvalign=4
// CHECK: %struct.f = type { i32 (...)** }
@@ -435,14 +435,14 @@ int main() {
// CHECK: 0 | struct AV
// CHECK-NEXT: 0 | (AV vftable pointer)
-// CHECK-NEXT: sizeof=4, dsize=4, align=4
+// CHECK-NEXT: sizeof=4, align=4
// CHECK-NEXT: nvsize=4, nvalign=4
// CHECK: 0 | struct BV
// CHECK-NEXT: 0 | struct AV (primary base)
// CHECK-NEXT: 0 | (AV vftable pointer)
-// CHECK-NEXT: sizeof=4, dsize=4, align=4
+// CHECK-NEXT: sizeof=4, align=4
// CHECK-NEXT: nvsize=4, nvalign=4
@@ -452,7 +452,7 @@ int main() {
// CHECK-NEXT: 8 | struct BV (virtual base)
// CHECK-NEXT: 8 | struct AV (primary base)
// CHECK-NEXT: 8 | (AV vftable pointer)
-// CHECK-NEXT: sizeof=12, dsize=12, align=4
+// CHECK-NEXT: sizeof=12, align=4
// CHECK-NEXT: nvsize=4, nvalign=4
// CHECK: %struct.AV = type { i32 (...)** }
@@ -464,7 +464,7 @@ int main() {
// CHECK-NEXT: 0 | struct BV (primary base)
// CHECK-NEXT: 0 | struct AV (primary base)
// CHECK-NEXT: 0 | (AV vftable pointer)
-// CHECK-NEXT: sizeof=4, dsize=4, align=4
+// CHECK-NEXT: sizeof=4, align=4
// CHECK-NEXT: nvsize=4, nvalign=4
// CHECK: %struct.DV = type { %struct.BV }
@@ -480,14 +480,14 @@ int main() {
// CHECK-NEXT: 12 | struct BV (virtual base)
// CHECK-NEXT: 12 | struct AV (primary base)
// CHECK-NEXT: 12 | (AV vftable pointer)
-// CHECK-NEXT: sizeof=16, dsize=16, align=4
+// CHECK-NEXT: sizeof=16, align=4
// CHECK-NEXT: nvsize=8, nvalign=4
// CHECK: %struct.EV = type { %struct.DV, %struct.CV.base, [4 x i8], %struct.BV }
// CHECK: %struct.EV.base = type { %struct.DV, %struct.CV.base }
// Overriding a method means that all the vbases containing that
-// method need a vtordisp.
+// method need a vtordisp. Note: this code will cause an error in cl.exe.
namespace test1 {
struct A { virtual void foo(); };
struct B : A {};
@@ -503,6 +503,6 @@ namespace test1 {
// CHECK-NEXT: 16 | struct test1::B (virtual base)
// CHECK-NEXT: 16 | struct test1::A (primary base)
// CHECK-NEXT: 16 | (A vftable pointer)
-// CHECK-NEXT: sizeof=20, dsize=20, align=4
+// CHECK-NEXT: sizeof=20, align=4
// CHECK-NEXT: nvsize=4, nvalign=4
}
diff --git a/test/Sema/neon-vector-types-support.c b/test/Sema/neon-vector-types-support.c
new file mode 100644
index 000000000000..6bf8539e47bd
--- /dev/null
+++ b/test/Sema/neon-vector-types-support.c
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 %s -triple armv7 -fsyntax-only -verify
+
+typedef __attribute__((neon_vector_type(2))) int int32x2_t; // expected-error{{'neon_vector_type' attribute is not supported for this target}}
+typedef __attribute__((neon_polyvector_type(16))) short poly8x16_t; // expected-error{{'neon_polyvector_type' attribute is not supported for this target}}
diff --git a/test/Sema/neon-vector-types.c b/test/Sema/neon-vector-types.c
index cbf013398a26..d8dd41225a32 100644
--- a/test/Sema/neon-vector-types.c
+++ b/test/Sema/neon-vector-types.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -triple armv7 -target-feature +neon -fsyntax-only -verify
+// RUN: %clang_cc1 %s -triple armv8 -target-feature +neon -fsyntax-only -verify
typedef float float32_t;
typedef signed char poly8_t;
@@ -16,10 +17,10 @@ typedef __attribute__((neon_polyvector_type(16))) poly8_t poly8x16_t;
typedef __attribute__((neon_polyvector_type(8))) poly16_t poly16x8_t;
// The attributes must have a single argument.
-typedef __attribute__((neon_vector_type(2, 4))) int only_one_arg; // expected-error{{attribute takes one argument}}
+typedef __attribute__((neon_vector_type(2, 4))) int only_one_arg; // expected-error{{'neon_vector_type' attribute takes one argument}}
// The number of elements must be an ICE.
-typedef __attribute__((neon_vector_type(2.0))) int non_int_width; // expected-error{{attribute requires integer constant}}
+typedef __attribute__((neon_vector_type(2.0))) int non_int_width; // expected-error{{'neon_vector_type' attribute requires an integer constant}}
// Only certain element types are allowed.
typedef __attribute__((neon_vector_type(2))) double double_elt; // expected-error{{invalid vector element type}}
diff --git a/test/Sema/nonnull.c b/test/Sema/nonnull.c
index cea8e3d0ddc4..4e6171160f64 100644
--- a/test/Sema/nonnull.c
+++ b/test/Sema/nonnull.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
// rdar://9584012
typedef struct {
@@ -19,3 +19,4 @@ int main(void) {
Class_init(obj, "Hello World");
}
+void foo(const char *str) __attribute__((nonnull("foo"))); // expected-error{{'nonnull' attribute requires parameter 1 to be an integer constant}}
diff --git a/test/Sema/offsetof-64.c b/test/Sema/offsetof-64.c
new file mode 100644
index 000000000000..4a80dee2fc2f
--- /dev/null
+++ b/test/Sema/offsetof-64.c
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -triple x86_64-linux-gnu
+
+// PR15216
+// Don't crash when taking computing the offset of structs with large arrays.
+const unsigned long Size = (1l << 60);
+
+struct Chunk1 {
+ char padding[Size];
+ char more_padding[1][Size];
+ char data;
+};
+
+int test1 = __builtin_offsetof(struct Chunk1, data);
+
+struct Chunk2 {
+ char padding[Size][Size][Size]; // expected-error 2{{array is too large}}
+ char data;
+};
+
+// FIXME: Remove this error when the constant evaluator learns to
+// ignore bad types.
+int test2 = __builtin_offsetof(struct Chunk2, data); // expected-error{{initializer element is not a compile-time constant}}
diff --git a/test/Sema/offsetof.c b/test/Sema/offsetof.c
index 46fb515c7f2e..9e876ad5898e 100644
--- a/test/Sema/offsetof.c
+++ b/test/Sema/offsetof.c
@@ -69,3 +69,4 @@ int test4 = __builtin_offsetof(Array, array);
int test5() {
return __builtin_offsetof(Array, array[*(int*)0]); // expected-warning{{indirection of non-volatile null pointer}} expected-note{{__builtin_trap}}
}
+
diff --git a/test/Sema/overloadable.c b/test/Sema/overloadable.c
index 5d39f15ec81f..b93c39fc1a2d 100644
--- a/test/Sema/overloadable.c
+++ b/test/Sema/overloadable.c
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
int var __attribute__((overloadable)); // expected-error{{'overloadable' attribute can only be applied to a function}}
+void params(void) __attribute__((overloadable(12))); // expected-error {{'overloadable' attribute takes no arguments}}
int *f(int) __attribute__((overloadable)); // expected-note 2{{previous overload of function is here}}
float *f(float); // expected-error{{overloaded function 'f' must have the 'overloadable' attribute}}
@@ -65,7 +66,22 @@ extern int __attribute__((overloadable)) f0(); // expected-error{{'overloadable'
typedef int f1_type();
f1_type __attribute__((overloadable)) f1; // expected-error{{'overloadable' function 'f1' must have a prototype}}
-void test() {
+void test() {
f0();
f1();
}
+
+void before_local_1(int) __attribute__((overloadable)); // expected-note {{here}}
+void before_local_2(int); // expected-note {{here}}
+void before_local_3(int) __attribute__((overloadable));
+void local() {
+ void before_local_1(char); // expected-error {{must have the 'overloadable' attribute}}
+ void before_local_2(char) __attribute__((overloadable)); // expected-error {{conflicting types}}
+ void before_local_3(char) __attribute__((overloadable));
+ void after_local_1(char); // expected-note {{here}}
+ void after_local_2(char) __attribute__((overloadable)); // expected-note {{here}}
+ void after_local_3(char) __attribute__((overloadable));
+}
+void after_local_1(int) __attribute__((overloadable)); // expected-error {{conflicting types}}
+void after_local_2(int); // expected-error {{must have the 'overloadable' attribute}}
+void after_local_3(int) __attribute__((overloadable));
diff --git a/test/Sema/parentheses.c b/test/Sema/parentheses.c
index 300e58558867..b7f1b6e93aa5 100644
--- a/test/Sema/parentheses.c
+++ b/test/Sema/parentheses.c
@@ -118,5 +118,5 @@ void conditional_op(int x, int y, _Bool b) {
(void)(x % 2 ? 1 : 2); // no warning
}
-// RUN: %clang_cc1 -fsyntax-only -Wparentheses -Werror -fdiagnostics-show-option %s 2>&1 | FileCheck %s -check-prefix=CHECK-FLAG
+// RUN: not %clang_cc1 -fsyntax-only -Wparentheses -Werror -fdiagnostics-show-option %s 2>&1 | FileCheck %s -check-prefix=CHECK-FLAG
// CHECK-FLAG: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
diff --git a/test/Sema/pragma-weak.c b/test/Sema/pragma-weak.c
new file mode 100644
index 000000000000..c14125eac9f7
--- /dev/null
+++ b/test/Sema/pragma-weak.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
+
+void __both3(void);
+#pragma weak both3 = __both3 // expected-note {{previous definition}}
+void both3(void) __attribute((alias("__both3"))); // expected-error {{redefinition of 'both3'}}
+void __both3(void) {}
+
+void __a3(void) __attribute((noinline));
+#pragma weak a3 = __a3 // expected-note {{previous definition}}
+void a3(void) __attribute((alias("__a3"))); // expected-error {{redefinition of 'a3'}}
+void __a3(void) {}
diff --git a/test/Sema/string-init.c b/test/Sema/string-init.c
new file mode 100644
index 000000000000..96ee360e4452
--- /dev/null
+++ b/test/Sema/string-init.c
@@ -0,0 +1,51 @@
+// RUN: %clang_cc1 -std=c11 -fsyntax-only -triple x86_64-pc-linux -verify %s
+
+// Note: these match the types specified by the target above.
+typedef int wchar_t;
+typedef unsigned short char16_t;
+typedef unsigned int char32_t;
+
+void f() {
+ char a1[] = "a"; // No error.
+ char a2[] = u8"a"; // No error.
+ char a3[] = u"a"; // expected-error{{initializing char array with wide string literal}}
+ char a4[] = U"a"; // expected-error{{initializing char array with wide string literal}}
+ char a5[] = L"a"; // expected-error{{initializing char array with wide string literal}}
+
+ wchar_t b1[] = "a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ wchar_t b2[] = u8"a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ wchar_t b3[] = u"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+ wchar_t b4[] = U"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+ wchar_t b5[] = L"a"; // No error.
+
+ char16_t c1[] = "a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ char16_t c2[] = u8"a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ char16_t c3[] = u"a"; // No error.
+ char16_t c4[] = U"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+ char16_t c5[] = L"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+
+ char32_t d1[] = "a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ char32_t d2[] = u8"a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ char32_t d3[] = u"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+ char32_t d4[] = U"a"; // No error.
+ char32_t d5[] = L"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+
+ int e1[] = "a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ int e2[] = u8"a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ int e3[] = u"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+ int e4[] = U"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+ int e5[] = L"a"; // No error.
+
+ long f1[] = "a"; // expected-error{{array initializer must be an initializer list}}
+ long f2[] = u8"a"; // expected-error{{array initializer must be an initializer list}}}
+ long f3[] = u"a"; // expected-error{{array initializer must be an initializer list}}
+ long f4[] = U"a"; // expected-error{{array initializer must be an initializer list}}
+ long f5[] = L"a"; // expected-error{{array initializer must be an initializer list}}
+}
+
+void g() {
+ char a[] = 1; // expected-error{{array initializer must be an initializer list or string literal}}
+ wchar_t b[] = 1; // expected-error{{array initializer must be an initializer list or wide string literal}}
+ char16_t c[] = 1; // expected-error{{array initializer must be an initializer list or wide string literal}}
+ char32_t d[] = 1; // expected-error{{array initializer must be an initializer list or wide string literal}}
+}
diff --git a/test/Sema/string-plus-char.c b/test/Sema/string-plus-char.c
new file mode 100644
index 000000000000..322e8f5962be
--- /dev/null
+++ b/test/Sema/string-plus-char.c
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+void f(const char *s) {
+ char *str = 0;
+ char *str2 = str + 'c'; // expected-warning {{adding 'char' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}
+
+ const char *constStr = s + 'c'; // expected-warning {{adding 'char' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}
+
+ str = 'c' + str;// expected-warning {{adding 'char' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}
+
+ // no-warning
+ char c = 'c';
+ str = str + c;
+ str = c + str;
+}
diff --git a/test/Sema/struct-decl.c b/test/Sema/struct-decl.c
index 819e856ac8cb..8d3d74de7671 100644
--- a/test/Sema/struct-decl.c
+++ b/test/Sema/struct-decl.c
@@ -57,3 +57,12 @@ const struct test2 { // expected-warning {{'const' ignored on this declaration}}
inline struct test3 { // expected-error {{'inline' can only appear on functions}}
int x;
};
+
+struct hiding_1 {};
+struct hiding_2 {};
+void test_hiding() {
+ struct hiding_1 *hiding_1();
+ extern struct hiding_2 *hiding_2;
+ struct hiding_1 *p = hiding_1();
+ struct hiding_2 *q = hiding_2;
+}
diff --git a/test/Sema/thread-specifier.c b/test/Sema/thread-specifier.c
index 9d516e8f1413..bf1ce9e26e4a 100644
--- a/test/Sema/thread-specifier.c
+++ b/test/Sema/thread-specifier.c
@@ -2,8 +2,8 @@
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic -x c++ %s -DGNU
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic %s -DC11 -D__thread=_Thread_local
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic -x c++ %s -DC11 -D__thread=_Thread_local
-// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic -x c++ %s -DCXX11 -D__thread=thread_local -std=c++11
-// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic -x c++ %s -DC11 -D__thread=_Thread_local -std=c++11
+// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic -x c++ %s -DCXX11 -D__thread=thread_local -std=c++11 -Wno-deprecated
+// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic -x c++ %s -DC11 -D__thread=_Thread_local -std=c++11 -Wno-deprecated
#ifdef __cplusplus
// In C++, we define __private_extern__ to extern.
diff --git a/test/Sema/types.c b/test/Sema/types.c
index d0637cca61a2..dac0bfe9fe82 100644
--- a/test/Sema/types.c
+++ b/test/Sema/types.c
@@ -64,3 +64,11 @@ void test(int i) {
void test2(int i) {
char c = (char __attribute__((may_alias))) i;
}
+
+// vector size too large
+int __attribute__ ((vector_size(8192))) x1; // expected-error {{vector size too large}}
+typedef int __attribute__ ((ext_vector_type(8192))) x2; // expected-error {{vector size too large}}
+
+// no support for vector enum type
+enum { e_2 } x3 __attribute__((vector_size(64))); // expected-error {{invalid vector element type}}
+
diff --git a/test/Sema/varargs.c b/test/Sema/varargs.c
index 663d3d594758..5329c2e61c98 100644
--- a/test/Sema/varargs.c
+++ b/test/Sema/varargs.c
@@ -76,3 +76,10 @@ void f9(__builtin_va_list args)
(void)__builtin_va_arg(args, short); // expected-warning {{second argument to 'va_arg' is of promotable type 'short'}}
(void)__builtin_va_arg(args, char); // expected-warning {{second argument to 'va_arg' is of promotable type 'char'}}
}
+
+void f10(int a, ...) {
+ int i;
+ __builtin_va_list ap;
+ i = __builtin_va_start(ap, a); // expected-error {{assigning to 'int' from incompatible type 'void'}}
+ __builtin_va_end(ap);
+}
diff --git a/test/Sema/varargs.cpp b/test/Sema/varargs.cpp
new file mode 100644
index 000000000000..48a7b2fdf103
--- /dev/null
+++ b/test/Sema/varargs.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+class string;
+void f(const string& s, ...) { // expected-note {{parameter of type 'const string &' is declared here}}
+ __builtin_va_list ap;
+ __builtin_va_start(ap, s); // expected-warning {{'va_start' has undefined behavior with reference types}}
+}
diff --git a/test/Sema/vfprintf-valid-redecl.c b/test/Sema/vfprintf-valid-redecl.c
index 5c5ce8d12b00..8ed18786ab7e 100644
--- a/test/Sema/vfprintf-valid-redecl.c
+++ b/test/Sema/vfprintf-valid-redecl.c
@@ -1,7 +1,16 @@
// RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
+// RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify -DPREDECLARE
// expected-no-diagnostics
-// PR4290
+#ifdef PREDECLARE
+// PR16344
+// Clang has defined 'vfprint' in builtin list. If the following line occurs before any other
+// `vfprintf' in this file, and we getPreviousDecl()->getTypeSourceInfo() on it, then we will
+// get a null pointer since the one in builtin list doesn't has valid TypeSourceInfo.
+int vfprintf(void) { return 0; }
+#endif
+
+// PR4290
// The following declaration is compatible with vfprintf, so we shouldn't
// warn.
int vfprintf();
diff --git a/test/Sema/warn-documentation-fixits.cpp b/test/Sema/warn-documentation-fixits.cpp
index a47b77637506..675d86c366db 100644
--- a/test/Sema/warn-documentation-fixits.cpp
+++ b/test/Sema/warn-documentation-fixits.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -verify %s
-// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -fcomment-block-commands=foobar -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -fcomment-block-commands=foobar -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
// expected-warning@+1 {{parameter 'ZZZZZZZZZZ' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}}
/// \param ZZZZZZZZZZ Blah blah.
@@ -57,6 +57,24 @@ struct test_deprecated_6 {
/// \deprecated
void test_deprecated_9(int a);
+// rdar://12381408
+// expected-warning@+2 {{unknown command tag name 'retur'; did you mean 'return'?}}
+/// \brief testing fixit
+/// \retur int in FooBar
+int FooBar();
+
+// expected-warning@+1 {{unknown command tag name 'fooba'; did you mean 'foobar'?}}
+/// \fooba bbb IS_DOXYGEN_END
+int gorf();
+
+/// \t bbb IS_DOXYGEN_END
+int Bar();
+
+// expected-warning@+2 {{unknown command tag name 'encode'; did you mean 'endcode'?}}
+// expected-warning@+1 {{'\endcode' command does not terminate a verbatim text block}}
+/// \encode PR18051
+int PR18051();
+
// CHECK: fix-it:"{{.*}}":{5:12-5:22}:"a"
// CHECK: fix-it:"{{.*}}":{9:12-9:15}:"aaa"
// CHECK: fix-it:"{{.*}}":{13:13-13:23}:"T"
@@ -68,4 +86,6 @@ void test_deprecated_9(int a);
// CHECK: fix-it:"{{.*}}":{46:27-46:27}:" __attribute__((deprecated))"
// CHECK: fix-it:"{{.*}}":{50:27-50:27}:" __attribute__((deprecated))"
// CHECK: fix-it:"{{.*}}":{58:30-58:30}:" MY_ATTR_DEPRECATED"
-
+// CHECK: fix-it:"{{.*}}":{63:6-63:11}:"return"
+// CHECK: fix-it:"{{.*}}":{67:6-67:11}:"foobar"
+// CHECK: fix-it:"{{.*}}":{75:6-75:12}:"endcode"
diff --git a/test/Sema/warn-documentation.cpp b/test/Sema/warn-documentation.cpp
index b3ab0199dcb4..7166a4990945 100644
--- a/test/Sema/warn-documentation.cpp
+++ b/test/Sema/warn-documentation.cpp
@@ -136,37 +136,33 @@ int test_duplicate_brief2(int);
int test_duplicate_brief3(int);
-// expected-warning@+5 {{duplicated command '\return'}} expected-note@+1 {{previous command '\return' here}}
/// \return Aaa
///
/// Bbb
///
/// \return Ccc
-int test_duplicate_returns1(int);
+int test_multiple_returns1(int);
-// expected-warning@+5 {{duplicated command '\returns'}} expected-note@+1 {{previous command '\returns' here}}
/// \returns Aaa
///
/// Bbb
///
/// \returns Ccc
-int test_duplicate_returns2(int);
+int test_multiple_returns2(int);
-// expected-warning@+5 {{duplicated command '\result'}} expected-note@+1 {{previous command '\result' here}}
/// \result Aaa
///
/// Bbb
///
/// \result Ccc
-int test_duplicate_returns3(int);
+int test_multiple_returns3(int);
-// expected-warning@+5 {{duplicated command '\return'}} expected-note@+1 {{previous command '\returns' (an alias of '\return') here}}
/// \returns Aaa
///
/// Bbb
///
/// \return Ccc
-int test_duplicate_returns4(int);
+int test_multiple_returns4(int);
// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
@@ -309,6 +305,22 @@ typedef test_param27 test_param28;
typedef unsigned int test_param29;
+/// \param aaa Aaa
+/// \param ... Vararg
+int test_vararg_param1(int aaa, ...);
+
+/// \param ... Vararg
+int test_vararg_param2(...);
+
+// expected-warning@+1 {{parameter '...' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
+/// \param ... Vararg
+int test_vararg_param3(int aaa);
+
+// expected-warning@+1 {{parameter '...' not found in the function declaration}}
+/// \param ... Vararg
+int test_vararg_param4();
+
+
// expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
/// \tparam T Aaa
int test_tparam1;
@@ -592,6 +604,25 @@ int test4; ///< \brief
///< \author Aaa
+class TestRelates {};
+
+/// \relates TestRelates
+/// \brief Aaa
+void test_relates_1();
+
+/// \related TestRelates
+/// \brief Aaa
+void test_relates_2();
+
+/// \relatesalso TestRelates
+/// \brief Aaa
+void test_relates_3();
+
+/// \relatedalso TestRelates
+/// \brief Aaa
+void test_relates_4();
+
+
// Check that we attach the comment to the declaration during parsing in the
// following cases. The test is based on the fact that we don't parse
// documentation comments that are not attached to anything.
@@ -950,3 +981,47 @@ class C1;
@struct S3;
*/
class S3;
+
+// rdar://14124702
+//----------------------------------------------------------------------
+/// @class Predicate Predicate.h "lldb/Host/Predicate.h"
+/// @brief A C++ wrapper class for providing threaded access to a value
+/// of type T.
+///
+/// A templatized class.
+/// specified values.
+//----------------------------------------------------------------------
+template <class T, class T1>
+class Predicate
+{
+};
+
+//----------------------------------------------------------------------
+/// @class Predicate<int, char> Predicate.h "lldb/Host/Predicate.h"
+/// @brief A C++ wrapper class for providing threaded access to a value
+/// of type T.
+///
+/// A template specilization class.
+//----------------------------------------------------------------------
+template<> class Predicate<int, char>
+{
+};
+
+//----------------------------------------------------------------------
+/// @class Predicate<T, int> Predicate.h "lldb/Host/Predicate.h"
+/// @brief A C++ wrapper class for providing threaded access to a value
+/// of type T.
+///
+/// A partial specialization template class.
+//----------------------------------------------------------------------
+template<class T> class Predicate<T, int>
+{
+};
+
+/*! @function test_function
+*/
+template <class T> T test_function (T arg);
+
+/*! @function test_function<int>
+*/
+template <> int test_function<int> (int arg);
diff --git a/test/Sema/warn-documentation.m b/test/Sema/warn-documentation.m
index 0737a8dedd03..5e95e2a1e8a2 100644
--- a/test/Sema/warn-documentation.m
+++ b/test/Sema/warn-documentation.m
@@ -172,3 +172,60 @@ struct S;
@struct S1 THIS IS IT
*/
@interface S1 @end
+
+// expected-warning@+1 {{unknown command tag name}}
+/// \t bbb IS_DOXYGEN_END
+int FooBar();
+
+// rdar://13836387
+/** \brief Module handling the incoming notifications from the system.
+ *
+ * This includes:
+ * - Network Reachability
+ * - Power State
+ * - Low Disk
+ */
+@interface BRC : NSObject
+- (void)removeReach:(NSObject*)observer;
+@end
+
+@implementation BRC : NSObject
+- (void)removeReach:(NSObject*)observer // expected-note {{previous declaration is here}}
+{
+}
+- (void)removeReach:(NSObject*)observer // expected-error {{duplicate declaration of method 'removeReach:'}}
+{
+}
+@end
+
+// rdar://13927330
+/// @class Asset <- '@class' may be used in a comment attached to a an interface declaration
+@interface Asset : NSObject
+@end
+
+// rdar://14024851 Check that this does not enter an infinite loop
+@interface rdar14024851
+-(void)meth; // expected-note {{declared here}}
+@end
+
+@implementation rdar14024851 // expected-warning {{method definition for 'meth' not found}} expected-note {{previous definition}}
+@end
+
+@implementation rdar14024851 // expected-error {{reimplementation}}
+/// \brief comment
+-(void)meth {}
+@end
+
+// rdar://14124644
+@interface test_vararg1
+/// @param[in] arg somthing
+/// @param[in] ... This is vararg
+- (void) VarArgMeth : (id)arg, ...;
+@end
+
+@implementation test_vararg1
+/// @param[in] arg somthing
+/// @param[in] ... This is vararg
+- (void) VarArgMeth : (id)arg, ... {}
+@end
+
diff --git a/test/Sema/warn-main-return-type.c b/test/Sema/warn-main-return-type.c
index bd7c59f2d390..c6f3a0c1011a 100644
--- a/test/Sema/warn-main-return-type.c
+++ b/test/Sema/warn-main-return-type.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s
// expected-note@+1 5{{previous definition is here}}
int main() {
diff --git a/test/Sema/warn-main.c b/test/Sema/warn-main.c
index 8a4eafc1325c..58a6dfde108d 100644
--- a/test/Sema/warn-main.c
+++ b/test/Sema/warn-main.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s
// expected-note@+1 2{{previous definition is here}}
int main() {
@@ -14,16 +14,14 @@ static int main() {
return 0;
}
-// expected-error@+3 {{redefinition of 'main'}}
-// expected-error@+2 {{'main' is not allowed to be declared inline}}
-// expected-note@+1 {{previous definition is here}}
+// expected-error@+2 {{redefinition of 'main'}}
+// expected-error@+1 {{'main' is not allowed to be declared inline}}
inline int main() {
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:1-[[@LINE-1]]:8}:""
return 0;
}
-// expected-warning@+6 {{function 'main' declared 'noreturn' should not return}}
-// expected-error@+3 {{redefinition of 'main'}}
+// expected-warning@+5 {{function 'main' declared 'noreturn' should not return}}
// expected-warning@+2 {{'main' is not allowed to be declared _Noreturn}}
// expected-note@+1 {{remove '_Noreturn'}}
_Noreturn int main() {
diff --git a/test/Sema/warn-null.c b/test/Sema/warn-null.c
new file mode 100644
index 000000000000..28fb6a5f691c
--- /dev/null
+++ b/test/Sema/warn-null.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -verify
+
+// PR10837: Warn if a non-pointer-typed expression is folded to a null pointer
+int *p = 0;
+int *q = '\0'; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}
+int *r = (1 - 1); // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}
+void f() {
+ p = 0;
+ q = '\0'; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}
+ r = 1 - 1; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}
+}
diff --git a/test/Sema/warn-outof-range-assign-enum.c b/test/Sema/warn-outof-range-assign-enum.c
index 2e79e66f49bd..43eea0cef41f 100644
--- a/test/Sema/warn-outof-range-assign-enum.c
+++ b/test/Sema/warn-outof-range-assign-enum.c
@@ -21,6 +21,18 @@ enum Test2 test2(enum Test2 *t) {
return 10; // expected-warning {{integer constant not in range of enumerated type 'enum Test2'}}
}
+// PR15069
+typedef enum
+{
+ a = 0
+} T;
+
+void f()
+{
+ T x = a;
+ x += 1; // expected-warning {{integer constant not in range of enumerated type}}
+}
+
int main() {
CCTestEnum test = 1; // expected-warning {{integer constant not in range of enumerated type 'CCTestEnum'}}
test = 600; // expected-warning {{integer constant not in range of enumerated type 'CCTestEnum'}}
diff --git a/test/Sema/warn-shadow-intrinsics.c b/test/Sema/warn-shadow-intrinsics.c
new file mode 100644
index 000000000000..b291426395c9
--- /dev/null
+++ b/test/Sema/warn-shadow-intrinsics.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -ffreestanding -triple x86_64-apple-macosx10.8.0 -fsyntax-only %s
+
+#include <emmintrin.h>
+
+// Test that using two macros from emmintrin do not cause a
+// useless -Wshadow warning.
+void rdar10679282() {
+ __m128i qf = _mm_setzero_si128();
+ qf = _mm_slli_si128(_mm_add_epi64(qf, _mm_srli_si128(qf, 8)), 8); // no-warning
+ (void) qf;
+}
diff --git a/test/Sema/warn-thread-safety-analysis.c b/test/Sema/warn-thread-safety-analysis.c
new file mode 100644
index 000000000000..1918aceee6da
--- /dev/null
+++ b/test/Sema/warn-thread-safety-analysis.c
@@ -0,0 +1,123 @@
+// RUN: %clang -fsyntax-only -verify -Wthread-safety -Wthread-safety-beta -fcxx-exceptions %s
+
+#define LOCKABLE __attribute__ ((lockable))
+#define SCOPED_LOCKABLE __attribute__ ((scoped_lockable))
+#define GUARDED_BY(x) __attribute__ ((guarded_by(x)))
+#define GUARDED_VAR __attribute__ ((guarded_var))
+#define PT_GUARDED_BY(x) __attribute__ ((pt_guarded_by(x)))
+#define PT_GUARDED_VAR __attribute__ ((pt_guarded_var))
+#define ACQUIRED_AFTER(...) __attribute__ ((acquired_after(__VA_ARGS__)))
+#define ACQUIRED_BEFORE(...) __attribute__ ((acquired_before(__VA_ARGS__)))
+#define EXCLUSIVE_LOCK_FUNCTION(...) __attribute__ ((exclusive_lock_function(__VA_ARGS__)))
+#define SHARED_LOCK_FUNCTION(...) __attribute__ ((shared_lock_function(__VA_ARGS__)))
+#define ASSERT_EXCLUSIVE_LOCK(...) __attribute__ ((assert_exclusive_lock(__VA_ARGS__)))
+#define ASSERT_SHARED_LOCK(...) __attribute__ ((assert_shared_lock(__VA_ARGS__)))
+#define EXCLUSIVE_TRYLOCK_FUNCTION(...) __attribute__ ((exclusive_trylock_function(__VA_ARGS__)))
+#define SHARED_TRYLOCK_FUNCTION(...) __attribute__ ((shared_trylock_function(__VA_ARGS__)))
+#define UNLOCK_FUNCTION(...) __attribute__ ((unlock_function(__VA_ARGS__)))
+#define LOCK_RETURNED(x) __attribute__ ((lock_returned(x)))
+#define LOCKS_EXCLUDED(...) __attribute__ ((locks_excluded(__VA_ARGS__)))
+#define EXCLUSIVE_LOCKS_REQUIRED(...) \
+ __attribute__ ((exclusive_locks_required(__VA_ARGS__)))
+#define SHARED_LOCKS_REQUIRED(...) \
+ __attribute__ ((shared_locks_required(__VA_ARGS__)))
+#define NO_THREAD_SAFETY_ANALYSIS __attribute__ ((no_thread_safety_analysis))
+
+// Define the mutex struct.
+// Simplified only for test purpose.
+struct LOCKABLE Mutex {};
+
+struct Foo {
+ struct Mutex *mu_;
+};
+
+// Define mutex lock/unlock functions.
+void mutex_exclusive_lock(struct Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) {
+}
+
+void mutex_shared_lock(struct Mutex *mu) SHARED_LOCK_FUNCTION(mu) {
+}
+
+void mutex_unlock(struct Mutex *mu) UNLOCK_FUNCTION(mu) {
+}
+
+// Define global variables.
+struct Mutex mu1;
+struct Mutex mu2 ACQUIRED_AFTER(mu1);
+struct Foo foo_ = {&mu1};
+int a_ GUARDED_BY(foo_.mu_);
+int *b_ PT_GUARDED_BY(foo_.mu_) = &a_;
+int c_ GUARDED_VAR;
+int *d_ PT_GUARDED_VAR = &c_;
+
+// Define test functions.
+int Foo_fun1(int i) SHARED_LOCKS_REQUIRED(mu2) EXCLUSIVE_LOCKS_REQUIRED(mu1) {
+ return i;
+}
+
+int Foo_fun2(int i) EXCLUSIVE_LOCKS_REQUIRED(mu2) SHARED_LOCKS_REQUIRED(mu1) {
+ return i;
+}
+
+int Foo_func3(int i) LOCKS_EXCLUDED(mu1, mu2) {
+ return i;
+}
+
+static int Bar_fun1(int i) EXCLUSIVE_LOCKS_REQUIRED(mu1) {
+ return i;
+}
+
+void set_value(int *a, int value) EXCLUSIVE_LOCKS_REQUIRED(foo_.mu_) {
+ *a = value;
+}
+
+int get_value(int *p) SHARED_LOCKS_REQUIRED(foo_.mu_){
+ return *p;
+}
+
+int main() {
+
+ Foo_fun1(1); // expected-warning{{calling function 'Foo_fun1' requires shared lock on 'mu2'}} \
+ expected-warning{{calling function 'Foo_fun1' requires exclusive lock on 'mu1'}}
+
+ mutex_exclusive_lock(&mu1);
+ mutex_shared_lock(&mu2);
+ Foo_fun1(1);
+
+ mutex_shared_lock(&mu1); // expected-warning{{locking 'mu1' that is already locked}}
+ mutex_unlock(&mu1);
+ mutex_unlock(&mu2);
+ mutex_shared_lock(&mu1);
+ mutex_exclusive_lock(&mu2);
+ Foo_fun2(2);
+
+ mutex_unlock(&mu2);
+ mutex_unlock(&mu1);
+ mutex_exclusive_lock(&mu1);
+ Bar_fun1(3);
+ mutex_unlock(&mu1);
+
+ mutex_exclusive_lock(&mu1);
+ Foo_func3(4); // expected-warning{{cannot call function 'Foo_func3' while mutex 'mu1' is locked}}
+ mutex_unlock(&mu1);
+
+ Foo_func3(5);
+
+ set_value(&a_, 0); // expected-warning{{calling function 'setA' requires exclusive lock on 'foo_.mu_'}}
+ get_value(b_); // expected-warning{{calling function 'getB' requires shared lock on 'foo_.mu_'}}
+ mutex_exclusive_lock(foo_.mu_);
+ set_value(&a_, 1);
+ mutex_unlock(foo_.mu_);
+ mutex_shared_lock(foo_.mu_);
+ (void)(get_value(b_) == 1);
+ mutex_unlock(foo_.mu_);
+
+ c_ = 0; // expected-warning{{writing variable 'c_' requires locking any mutex exclusively}}
+ (void)(*d_ == 0); // expected-warning{{reading the value pointed to by 'd_' requires locking any mutex}}
+ mutex_exclusive_lock(foo_.mu_);
+ c_ = 1;
+ (void)(*d_ == 1);
+ mutex_unlock(foo_.mu_);
+
+ return 0;
+}
diff --git a/test/Sema/warn-type-safety.c b/test/Sema/warn-type-safety.c
index 4ac453d380bd..dfab8f8c818b 100644
--- a/test/Sema/warn-type-safety.c
+++ b/test/Sema/warn-type-safety.c
@@ -7,7 +7,7 @@ struct A {};
typedef struct A *MPI_Datatype;
int wrong1(void *buf, MPI_Datatype datatype)
- __attribute__(( pointer_with_type_tag )); // expected-error {{attribute requires parameter 1 to be an identifier}}
+ __attribute__(( pointer_with_type_tag )); // expected-error {{'pointer_with_type_tag' attribute requires parameter 1 to be an identifier}}
int wrong2(void *buf, MPI_Datatype datatype)
__attribute__(( pointer_with_type_tag(mpi,0,7) )); // expected-error {{attribute parameter 2 is out of bounds}}
@@ -39,7 +39,7 @@ int wrong10(double buf, MPI_Datatype type)
extern struct A datatype_wrong1
- __attribute__(( type_tag_for_datatype )); // expected-error {{attribute requires parameter 1 to be an identifier}}
+ __attribute__(( type_tag_for_datatype )); // expected-error {{'type_tag_for_datatype' attribute requires parameter 1 to be an identifier}}
extern struct A datatype_wrong2
__attribute__(( type_tag_for_datatype(mpi,1,2) )); // expected-error {{expected a type}}
diff --git a/test/Sema/warn-unsequenced.c b/test/Sema/warn-unsequenced.c
new file mode 100644
index 000000000000..a14d3281662b
--- /dev/null
+++ b/test/Sema/warn-unsequenced.c
@@ -0,0 +1,88 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -Wno-unused %s
+
+int f(int, int);
+
+typedef struct A {
+ int x, y;
+} A;
+
+void test() {
+ int a;
+ int xs[10];
+ a + ++a; // expected-warning {{unsequenced modification and access to 'a'}}
+ a = ++a; // expected-warning {{multiple unsequenced modifications to 'a'}}
+ a + a++; // expected-warning {{unsequenced modification and access to 'a'}}
+ a = a++; // expected-warning {{multiple unsequenced modifications to 'a'}}
+ (a++, a++); // ok
+ ++a + ++a; // expected-warning {{multiple unsequenced modifications}}
+ a++ + a++; // expected-warning {{multiple unsequenced modifications}}
+ a = xs[++a]; // expected-warning {{multiple unsequenced modifications}}
+ a = xs[a++]; // expected-warning {{multiple unsequenced modifications}}
+ a = (++a, ++a); // expected-warning {{multiple unsequenced modifications}}
+ a = (a++, ++a); // expected-warning {{multiple unsequenced modifications}}
+ a = (a++, a++); // expected-warning {{multiple unsequenced modifications}}
+ f(a, a); // ok
+ f(a = 0, a); // expected-warning {{unsequenced modification and access}}
+ f(a, a += 0); // expected-warning {{unsequenced modification and access}}
+ f(a = 0, a = 0); // expected-warning {{multiple unsequenced modifications}}
+ a = f(++a, 0); // ok
+ a = f(a++, 0); // ok
+ a = f(++a, a++); // expected-warning {{multiple unsequenced modifications}}
+
+ a = ++a; // expected-warning {{multiple unsequenced modifications}}
+ a += ++a; // expected-warning {{unsequenced modification and access}}
+
+ A agg1 = { a++, a++ }; // expected-warning {{multiple unsequenced modifications}}
+ A agg2 = { a++ + a, a++ }; // expected-warning {{unsequenced modification and access}}
+
+ (xs[2] && (a = 0)) + a; // ok
+ (0 && (a = 0)) + a; // ok
+ (1 && (a = 0)) + a; // expected-warning {{unsequenced modification and access}}
+
+ (xs[3] || (a = 0)) + a; // ok
+ (0 || (a = 0)) + a; // expected-warning {{unsequenced modification and access}}
+ (1 || (a = 0)) + a; // ok
+
+ (xs[4] ? a : ++a) + a; // ok
+ (0 ? a : ++a) + a; // expected-warning {{unsequenced modification and access}}
+ (1 ? a : ++a) + a; // ok
+ (xs[5] ? ++a : ++a) + a; // FIXME: warn here
+
+ (++a, xs[6] ? ++a : 0) + a; // FIXME: warn here
+
+ // Here, the read of the fourth 'a' might happen before or after the write to
+ // the second 'a'.
+ a += (a++, a) + a; // expected-warning {{unsequenced modification and access}}
+
+ int *p = xs;
+ a = *(a++, p); // ok
+ a = a++ && a; // ok
+
+ A *q = &agg1;
+ (q = &agg2)->y = q->x; // expected-warning {{unsequenced modification and access to 'q'}}
+
+ // This has undefined behavior if a == 0; otherwise, the side-effect of the
+ // increment is sequenced before the value computation of 'f(a, a)', which is
+ // sequenced before the value computation of the '&&', which is sequenced
+ // before the assignment. We treat the sequencing in '&&' as being
+ // unconditional.
+ a = a++ && f(a, a);
+
+ // This has undefined behavior if a != 0. FIXME: We should diagnose this.
+ (a && a++) + a;
+
+ (xs[7] && ++a) * (!xs[7] && ++a); // ok
+
+ xs[0] = (a = 1, a); // ok
+
+ xs[8] ? ++a + a++ : 0; // expected-warning {{multiple unsequenced modifications}}
+ xs[8] ? 0 : ++a + a++; // expected-warning {{multiple unsequenced modifications}}
+ xs[8] ? ++a : a++; // ok
+
+ xs[8] && (++a + a++); // expected-warning {{multiple unsequenced modifications}}
+ xs[8] || (++a + a++); // expected-warning {{multiple unsequenced modifications}}
+
+ (__builtin_classify_type(++a) ? 1 : 0) + ++a; // ok
+ (__builtin_constant_p(++a) ? 1 : 0) + ++a; // ok
+ (__builtin_expect(++a, 0) ? 1 : 0) + ++a; // FIXME: warn here
+}
diff --git a/test/Sema/warn-unused-function.c b/test/Sema/warn-unused-function.c
index a334e71e5067..013b925f89d8 100644
--- a/test/Sema/warn-unused-function.c
+++ b/test/Sema/warn-unused-function.c
@@ -12,10 +12,8 @@ int x = sizeof(f0());
static void f3();
extern void f3() { } // expected-warning{{unused}}
-// FIXME: This will trigger a warning when it should not.
-// Update once PR6281 is fixed.
-//inline static void f4();
-//void f4() { }
+inline static void f4();
+void f4() { } // expected-warning{{unused}}
static void __attribute__((used)) f5() {}
static void f6();
diff --git a/test/Sema/warn-unused-label.c b/test/Sema/warn-unused-label.c
index 48370a5fd641..4b1dbbf24692 100644
--- a/test/Sema/warn-unused-label.c
+++ b/test/Sema/warn-unused-label.c
@@ -9,3 +9,7 @@ void f() {
goto d;
return;
}
+
+void PR8455() {
+ L: __attribute__((unused)) return; // ok, no semicolon required
+}
diff --git a/test/Sema/warn-unused-parameters.c b/test/Sema/warn-unused-parameters.c
index af048e77e886..11db7300c5c4 100644
--- a/test/Sema/warn-unused-parameters.c
+++ b/test/Sema/warn-unused-parameters.c
@@ -22,7 +22,7 @@ static void achor() {};
// CHECK-unused: 1 warning generated
// RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything %s 2>&1 | FileCheck -check-prefix=CHECK-everything %s
-// RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything -Werror %s 2>&1 | FileCheck -check-prefix=CHECK-everything-error %s
+// RUN: not %clang_cc1 -fblocks -fsyntax-only -Weverything -Werror %s 2>&1 | FileCheck -check-prefix=CHECK-everything-error %s
// RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything -Wno-unused %s 2>&1 | FileCheck -check-prefix=CHECK-everything-no-unused %s
// CHECK-everything: 6 warnings generated
// CHECK-everything-error: 5 errors generated
diff --git a/test/Sema/warn-variable-not-needed.c b/test/Sema/warn-variable-not-needed.c
new file mode 100644
index 000000000000..472ac8298999
--- /dev/null
+++ b/test/Sema/warn-variable-not-needed.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall %s
+// expected-no-diagnostics
+
+static int a;
+int bar() {
+ extern int a;
+ return a;
+}
+static int a;
diff --git a/test/Sema/wchar.c b/test/Sema/wchar.c
index 816245f3c041..13c2f5855d5e 100644
--- a/test/Sema/wchar.c
+++ b/test/Sema/wchar.c
@@ -19,6 +19,6 @@ int check_wchar_size[sizeof(*L"") == sizeof(wchar_t) ? 1 : -1];
void foo() {
WCHAR_T_TYPE t1[] = L"x";
wchar_t tab[] = L"x";
- WCHAR_T_TYPE t2[] = "x"; // expected-error {{initializer}}
- char t3[] = L"x"; // expected-error {{initializer}}
+ WCHAR_T_TYPE t2[] = "x"; // expected-error {{initializing wide char array with non-wide string literal}}
+ char t3[] = L"x"; // expected-error {{initializing char array with wide string literal}}
}
diff --git a/test/SemaCXX/Inputs/lit.local.cfg b/test/SemaCXX/Inputs/lit.local.cfg
deleted file mode 100644
index e6f55eef7af5..000000000000
--- a/test/SemaCXX/Inputs/lit.local.cfg
+++ /dev/null
@@ -1 +0,0 @@
-config.suffixes = []
diff --git a/test/SemaCXX/Inputs/register.h b/test/SemaCXX/Inputs/register.h
new file mode 100644
index 000000000000..3c412eeb1205
--- /dev/null
+++ b/test/SemaCXX/Inputs/register.h
@@ -0,0 +1,5 @@
+#pragma GCC system_header
+#pragma once
+
+inline void f() { register int k; }
+#define to_int(x) ({ register int n = (x); n; })
diff --git a/test/SemaCXX/Inputs/warn-unused-variables.h b/test/SemaCXX/Inputs/warn-unused-variables.h
index 5fac45922c99..56990e0a33de 100644
--- a/test/SemaCXX/Inputs/warn-unused-variables.h
+++ b/test/SemaCXX/Inputs/warn-unused-variables.h
@@ -7,5 +7,7 @@ class A {};
class B {
static A a;
+ static A b;
+ static const int x = sizeof(b);
};
}
diff --git a/test/SemaCXX/MicrosoftCompatibility.cpp b/test/SemaCXX/MicrosoftCompatibility.cpp
index 6a48f36801bd..05037ac6a0d0 100644
--- a/test/SemaCXX/MicrosoftCompatibility.cpp
+++ b/test/SemaCXX/MicrosoftCompatibility.cpp
@@ -178,3 +178,19 @@ namespace PR11791 {
del((void*)a); // expected-note {{in instantiation of function template specialization}}
}
}
+
+namespace IntToNullPtrConv {
+ struct Foo {
+ static const int ZERO = 0;
+ typedef void (Foo::*MemberFcnPtr)();
+ };
+
+ struct Bar {
+ const Foo::MemberFcnPtr pB;
+ };
+
+ Bar g_bar = { (Foo::MemberFcnPtr)Foo::ZERO };
+
+ template<int N> int *get_n() { return N; } // expected-warning {{expression which evaluates to zero treated as a null pointer constant}}
+ int *g_nullptr = get_n<0>(); // expected-note {{in instantiation of function template specialization}}
+}
diff --git a/test/SemaCXX/MicrosoftExtensions.cpp b/test/SemaCXX/MicrosoftExtensions.cpp
index ab3ff69f27be..c5b45a2905c8 100644
--- a/test/SemaCXX/MicrosoftExtensions.cpp
+++ b/test/SemaCXX/MicrosoftExtensions.cpp
@@ -167,8 +167,14 @@ void pointer_to_integral_type_conv(char* ptr) {
short sh = (short)ptr;
ch = (char)ptr;
sh = (short)ptr;
-}
+ // These are valid C++.
+ bool b = (bool)ptr;
+ b = static_cast<bool>(ptr);
+
+ // This is bad.
+ b = reinterpret_cast<bool>(ptr); // expected-error {{cast from pointer to smaller type 'bool' loses information}}
+}
namespace friend_as_a_forward_decl {
@@ -333,3 +339,74 @@ void TestSP9() {
c3.g(); // Overloaded incdec op operand
c3.h(); // Overloaded unary op operand
}
+
+union u {
+ int *i1;
+ int &i2; // expected-warning {{union member 'i2' has reference type 'int &', which is a Microsoft extension}}
+};
+
+// Property getter using reference.
+struct SP11 {
+ __declspec(property(get=GetV)) int V;
+ int _v;
+ int& GetV() { return _v; }
+ void UseV();
+ void TakePtr(int *) {}
+ void TakeRef(int &) {}
+ void TakeVal(int) {}
+};
+
+void SP11::UseV() {
+ TakePtr(&V);
+ TakeRef(V);
+ TakeVal(V);
+}
+
+struct StructWithUnnamedMember {
+ __declspec(property(get=GetV)) int : 10; // expected-error {{anonymous property is not supported}}
+};
+
+namespace rdar14250378 {
+ class Bar {};
+
+ namespace NyNamespace {
+ class Foo {
+ public:
+ Bar* EnsureBar();
+ };
+
+ class Baz : public Foo {
+ public:
+ friend class Bar;
+ };
+
+ Bar* Foo::EnsureBar() {
+ return 0;
+ }
+ }
+}
+
+// expected-error@+1 {{'sealed' keyword not permitted with interface types}}
+__interface InterfaceWithSealed sealed {
+};
+
+struct SomeBase {
+ virtual void OverrideMe();
+
+ // expected-note@+2 {{overridden virtual function is here}}
+ // expected-warning@+1 {{'sealed' keyword is a Microsoft extension}}
+ virtual void SealedFunction() sealed;
+};
+
+// expected-note@+2 {{'SealedType' declared here}}
+// expected-warning@+1 {{'sealed' keyword is a Microsoft extension}}
+struct SealedType sealed : SomeBase {
+ // expected-error@+1 {{declaration of 'SealedFunction' overrides a 'sealed' function}}
+ virtual void SealedFunction();
+
+ // expected-warning@+1 {{'override' keyword is a C++11 extension}}
+ virtual void OverrideMe() override;
+};
+
+// expected-error@+1 {{base 'SealedType' is marked 'sealed'}}
+struct InheritFromSealed : SealedType {};
diff --git a/test/SemaCXX/PR10447.cpp b/test/SemaCXX/PR10447.cpp
index 5ba74aaba36c..0c57177b872a 100644
--- a/test/SemaCXX/PR10447.cpp
+++ b/test/SemaCXX/PR10447.cpp
@@ -4,7 +4,7 @@
// PR12223
namespace test1 {
namespace N {
- extern "C" void f(struct S*);
+ extern "C" void f_test1(struct S*);
void g(S*);
}
namespace N {
@@ -17,7 +17,7 @@ namespace test1 {
// PR10447
namespace test2 {
extern "C" {
- void f(struct Bar*) { }
+ void f_test2(struct Bar*) { }
test2::Bar *ptr;
}
}
diff --git a/test/SemaCXX/PR12778.cpp b/test/SemaCXX/PR12778.cpp
new file mode 100644
index 000000000000..f4d25f3e8fc9
--- /dev/null
+++ b/test/SemaCXX/PR12778.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+void operator delete() throw(void*); // expected-error{{'operator delete' must have at least one parameter}}
+void* allocate(int __n) {
+ return ::operator new(__n);
+}
+
diff --git a/test/SemaCXX/PR9572.cpp b/test/SemaCXX/PR9572.cpp
index b475b57416c6..d6dc2e06062c 100644
--- a/test/SemaCXX/PR9572.cpp
+++ b/test/SemaCXX/PR9572.cpp
@@ -7,7 +7,7 @@ struct Foo : public Base { // expected-error {{base class 'Base' has private des
Foo();
};
struct Bar : public Foo {
- Bar() { } // expected-note {{implicit default destructor for 'Foo' first required here}}
+ Bar() { } // expected-note {{implicit destructor for 'Foo' first required here}}
};
struct Baz {
Foo f;
diff --git a/test/SemaCXX/__try.cpp b/test/SemaCXX/__try.cpp
index a0f503abe6c8..1c45581b32f9 100644
--- a/test/SemaCXX/__try.cpp
+++ b/test/SemaCXX/__try.cpp
@@ -57,3 +57,23 @@ int main()
}
return e;
}
+
+namespace PR17584 {
+template <typename>
+void Except() {
+ __try {
+ } __except(true) {
+ }
+}
+
+template <typename>
+void Finally() {
+ __try {
+ } __finally {
+ }
+}
+
+template void Except<void>();
+template void Finally<void>();
+
+}
diff --git a/test/SemaCXX/abstract.cpp b/test/SemaCXX/abstract.cpp
index e20a89009bd9..d7e2d0a3dcf9 100644
--- a/test/SemaCXX/abstract.cpp
+++ b/test/SemaCXX/abstract.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 -Wabstract-vbase-init
#ifndef __GXX_EXPERIMENTAL_CXX0X__
#define __CONCAT(__X, __Y) __CONCAT1(__X, __Y)
@@ -250,6 +250,13 @@ namespace test4 {
};
}
+namespace test5 {
+ struct A { A(int); virtual ~A() = 0; }; // expected-note {{pure virtual method}}
+ const A &a = 0; // expected-error {{abstract class}}
+ void f(const A &a = 0); // expected-error {{abstract class}}
+ void g() { f(0); } // expected-error {{abstract class}}
+}
+
// PR9247: Crash on invalid in clang::Sema::ActOnFinishCXXMemberSpecification
namespace pr9247 {
struct A {
@@ -273,3 +280,30 @@ namespace pr12658 {
foo(C(99)); // expected-error {{allocating an object of abstract class type 'pr12658::C'}}
}
}
+
+namespace pr16659 {
+ struct A {
+ A(int);
+ virtual void x() = 0; // expected-note {{unimplemented pure virtual method 'x' in 'RedundantInit'}}
+ };
+ struct B : virtual A {};
+ struct C : B {
+ C() : A(37) {}
+ void x() override {}
+ };
+
+ struct X {
+ friend class Z;
+ private:
+ X &operator=(const X&);
+ };
+ struct Y : virtual X { // expected-note {{::X' has an inaccessible copy assignment}}
+ virtual ~Y() = 0;
+ };
+ struct Z : Y {}; // expected-note {{::Y' has a deleted copy assignment}}
+ void f(Z &a, const Z &b) { a = b; } // expected-error {{copy assignment operator is implicitly deleted}}
+
+ struct RedundantInit : virtual A {
+ RedundantInit() : A(0) {} // expected-warning {{initializer for virtual base class 'pr16659::A' of abstract class 'RedundantInit' will never be used}}
+ };
+}
diff --git a/test/SemaCXX/access.cpp b/test/SemaCXX/access.cpp
index 50f2eff87bfb..5ccd418c1b76 100644
--- a/test/SemaCXX/access.cpp
+++ b/test/SemaCXX/access.cpp
@@ -26,9 +26,11 @@ private:
namespace test1 {
class A {
private:
- class X; // expected-note {{previously declared 'private' here}}
+ class X; // expected-note {{previously declared 'private' here}} \
+ // expected-note {{previous declaration is here}}
public:
- class X; // expected-error {{'X' redeclared with 'public' access}}
+ class X; // expected-error {{'X' redeclared with 'public' access}} \
+ // expected-warning {{class member cannot be redeclared}}
class X {};
};
}
@@ -106,3 +108,31 @@ namespace PR15209 {
}
}
}
+
+namespace PR7434 {
+ namespace comment0 {
+ template <typename T> struct X;
+ namespace N {
+ class Y {
+ template<typename T> friend struct X;
+ int t; // expected-note {{here}}
+ };
+ }
+ template<typename T> struct X {
+ X() { (void)N::Y().t; } // expected-error {{private}}
+ };
+ X<char> x;
+ }
+ namespace comment2 {
+ struct X;
+ namespace N {
+ class Y {
+ friend struct X;
+ int t; // expected-note {{here}}
+ };
+ }
+ struct X {
+ X() { (void)N::Y().t; } // expected-error {{private}}
+ };
+ }
+}
diff --git a/test/SemaCXX/addr-of-overloaded-function-casting.cpp b/test/SemaCXX/addr-of-overloaded-function-casting.cpp
index cfd55eed81d5..784c8a000744 100644
--- a/test/SemaCXX/addr-of-overloaded-function-casting.cpp
+++ b/test/SemaCXX/addr-of-overloaded-function-casting.cpp
@@ -4,8 +4,12 @@ void g();
void f(); // expected-note 9{{candidate function}}
void f(int); // expected-note 9{{candidate function}}
-template<class T> void t(T); // expected-note 6{{candidate function}}
-template<class T> void t(T*); // expected-note 6{{candidate function}}
+template <class T>
+void t(T); // expected-note 3{{candidate function}} \
+ // expected-note 3{{candidate template ignored: could not match 'void' against 'int'}}
+template <class T>
+void t(T *); // expected-note 3{{candidate function}} \
+ // expected-note 3{{candidate template ignored: could not match 'void' against 'int'}}
template<class T> void u(T);
diff --git a/test/SemaCXX/addr-of-overloaded-function.cpp b/test/SemaCXX/addr-of-overloaded-function.cpp
index 096f74823a42..230a1eb994e1 100644
--- a/test/SemaCXX/addr-of-overloaded-function.cpp
+++ b/test/SemaCXX/addr-of-overloaded-function.cpp
@@ -57,11 +57,12 @@ struct B
struct C {
C &getC() {
- return makeAC; // expected-error{{reference to non-static member function must be called}}
+ return makeAC; // expected-error{{reference to non-static member function must be called; did you mean to call it with no arguments?}}
}
- C &makeAC();
- const C &makeAC() const;
+ // FIXME: filter by const so we can unambiguously suggest '()' & point to just the one candidate, probably
+ C &makeAC(); // expected-note{{possible target for call}}
+ const C &makeAC() const; // expected-note{{possible target for call}}
static void f(); // expected-note{{candidate function}}
static void f(int); // expected-note{{candidate function}}
@@ -69,6 +70,32 @@ struct C {
void g() {
int (&fp)() = f; // expected-error{{address of overloaded function 'f' does not match required type 'int ()'}}
}
+
+ template<typename T>
+ void q1(int); // expected-note{{possible target for call}}
+ template<typename T>
+ void q2(T t = T()); // expected-note{{possible target for call}}
+ template<typename T>
+ void q3(); // expected-note{{possible target for call}}
+ template<typename T1, typename T2>
+ void q4(); // expected-note{{possible target for call}}
+ template<typename T1 = int> // expected-warning{{default template arguments for a function template are a C++11 extension}}
+ void q5(); // expected-note{{possible target for call}}
+
+ void h() {
+ // Do not suggest '()' since an int argument is required
+ q1<int>; // expected-error-re{{reference to non-static member function must be called$}}
+ // Suggest '()' since there's a default value for the only argument & the
+ // type argument is already provided
+ q2<int>; // expected-error{{reference to non-static member function must be called; did you mean to call it with no arguments?}}
+ // Suggest '()' since no arguments are required & the type argument is
+ // already provided
+ q3<int>; // expected-error{{reference to non-static member function must be called; did you mean to call it with no arguments?}}
+ // Do not suggest '()' since another type argument is required
+ q4<int>; // expected-error-re{{reference to non-static member function must be called$}}
+ // Suggest '()' since the type parameter has a default value
+ q5; // expected-error{{reference to non-static member function must be called; did you mean to call it with no arguments?}}
+ }
};
// PR6886
@@ -208,3 +235,7 @@ namespace test1 {
void (Qualifiers::*X)() = &Dummy::N; // expected-error{{cannot initialize a variable of type 'void (test1::Qualifiers::*)()' with an rvalue of type 'void (test1::Dummy::*)()': different classes ('test1::Qualifiers' vs 'test1::Dummy')}}
}
+
+template <typename T> class PR16561 {
+ virtual bool f() { if (f) {} return false; } // expected-error {{reference to non-static member function must be called}}
+};
diff --git a/test/SemaCXX/alignment-of-derived-class.cpp b/test/SemaCXX/alignment-of-derived-class.cpp
new file mode 100644
index 000000000000..28c1fa9144b7
--- /dev/null
+++ b/test/SemaCXX/alignment-of-derived-class.cpp
@@ -0,0 +1,41 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
+
+// Test that the alignment of a empty direct base class is correctly
+// inherited by the derived class.
+
+struct A {
+} __attribute__ ((aligned(16)));
+
+static_assert(__alignof(A) == 16, "A should be aligned to 16 bytes");
+
+struct B1 : public A {
+};
+
+static_assert(__alignof(B1) == 16, "B1 should be aligned to 16 bytes");
+
+struct B2 : public A {
+} __attribute__ ((aligned(2)));
+
+static_assert(__alignof(B2) == 16, "B2 should be aligned to 16 bytes");
+
+struct B3 : public A {
+} __attribute__ ((aligned(4)));
+
+static_assert(__alignof(B3) == 16, "B3 should be aligned to 16 bytes");
+
+struct B4 : public A {
+} __attribute__ ((aligned(8)));
+
+static_assert(__alignof(B4) == 16, "B4 should be aligned to 16 bytes");
+
+struct B5 : public A {
+} __attribute__ ((aligned(16)));
+
+static_assert(__alignof(B5) == 16, "B5 should be aligned to 16 bytes");
+
+struct B6 : public A {
+} __attribute__ ((aligned(32)));
+
+static_assert(__alignof(B6) == 32, "B6 should be aligned to 32 bytes");
+
diff --git a/test/SemaCXX/alignof-sizeof-reference.cpp b/test/SemaCXX/alignof-sizeof-reference.cpp
index d76fcf55c2d8..3e37d615bbcf 100644
--- a/test/SemaCXX/alignof-sizeof-reference.cpp
+++ b/test/SemaCXX/alignof-sizeof-reference.cpp
@@ -10,8 +10,8 @@ void test() {
static_assert(sizeof(char&) == 1, "bad size");
}
-void f(); // expected-note{{possible target for call}}
-void f(int); // expected-note{{possible target for call}}
+int f(); // expected-note{{possible target for call}}
+int f(int); // expected-note{{possible target for call}}
void g() {
sizeof(&f); // expected-error{{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}} \
// expected-warning{{expression result unused}}
diff --git a/test/SemaCXX/alignof.cpp b/test/SemaCXX/alignof.cpp
index a9de1ad07c9f..f0b89eef656d 100644
--- a/test/SemaCXX/alignof.cpp
+++ b/test/SemaCXX/alignof.cpp
@@ -9,7 +9,7 @@ struct S0 {
auto test2() -> char(&)[__alignof__(x)]; // expected-error {{invalid application of 'alignof' to a field of a class still being defined}}
};
-struct S1; // expected-note 5 {{forward declaration}}
+struct S1; // expected-note 6 {{forward declaration}}
extern S1 s1;
const int test3 = __alignof__(s1); // expected-error {{invalid application of 'alignof' to an incomplete type 'S1'}}
@@ -50,3 +50,15 @@ struct S4 {
static const int test1 = __alignof__(S0::x);
auto test2() -> char(&)[__alignof__(x)];
};
+
+// Regression test for asking for the alignment of a field within an invalid
+// record.
+struct S5 {
+ S1 s; // expected-error {{incomplete type}}
+ int x;
+};
+const int test8 = __alignof__(S5::x);
+
+long long int test14[2];
+
+static_assert(alignof(test14) == 8, "foo"); // expected-warning {{'alignof' applied to an expression is a GNU extension}}
diff --git a/test/SemaCXX/ambiguous-conversion-show-overload.cpp b/test/SemaCXX/ambiguous-conversion-show-overload.cpp
index 64296512ffd7..5cd26fc31aef 100644
--- a/test/SemaCXX/ambiguous-conversion-show-overload.cpp
+++ b/test/SemaCXX/ambiguous-conversion-show-overload.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fshow-overloads=best -fno-caret-diagnostics %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fshow-overloads=best -fno-caret-diagnostics %s 2>&1 | FileCheck %s
struct S {
S(void*);
S(char*);
diff --git a/test/SemaCXX/anonymous-union.cpp b/test/SemaCXX/anonymous-union.cpp
index 9c2cf24a83fc..fde27b049d88 100644
--- a/test/SemaCXX/anonymous-union.cpp
+++ b/test/SemaCXX/anonymous-union.cpp
@@ -197,3 +197,12 @@ namespace PR8326 {
Foo<int> baz;
}
+
+namespace PR16630 {
+ struct A { union { int x; float y; }; }; // expected-note {{member is declared here}}
+ struct B : private A { using A::x; } b; // expected-note 2 {{private}}
+ void foo () {
+ b.x = 10;
+ b.y = 0; // expected-error {{cannot cast 'struct B' to its private base class 'PR16630::A'}} expected-error {{'y' is a private member of 'PR16630::A'}}
+ }
+}
diff --git a/test/SemaCXX/ast-print.cpp b/test/SemaCXX/ast-print.cpp
index 921f7d8baaae..a1975b4ac264 100644
--- a/test/SemaCXX/ast-print.cpp
+++ b/test/SemaCXX/ast-print.cpp
@@ -103,6 +103,7 @@ int test11() {
struct DefaultArgClass
{
DefaultArgClass(int a = 1) {}
+ DefaultArgClass(int a, int b, int c = 1) {}
};
struct NoArgClass
@@ -124,6 +125,8 @@ struct ConstrWithCleanupsClass
// CHECK: test12
// CHECK-NEXT: DefaultArgClass useDefaultArg;
// CHECK-NEXT: DefaultArgClass overrideDefaultArg(1);
+// CHECK-NEXT: DefaultArgClass(1, 2);
+// CHECK-NEXT: DefaultArgClass(1, 2, 3);
// CHECK-NEXT: NoArgClass noArg;
// CHECK-NEXT: ConstrWithCleanupsClass cwcNoArg;
// CHECK-NEXT: ConstrWithCleanupsClass cwcOverrideArg(48);
@@ -131,6 +134,8 @@ struct ConstrWithCleanupsClass
void test12() {
DefaultArgClass useDefaultArg;
DefaultArgClass overrideDefaultArg(1);
+ DefaultArgClass tempWithDefaultArg = DefaultArgClass(1, 2);
+ DefaultArgClass tempWithExplictArg = DefaultArgClass(1, 2, 3);
NoArgClass noArg;
ConstrWithCleanupsClass cwcNoArg;
ConstrWithCleanupsClass cwcOverrideArg(48);
@@ -148,3 +153,14 @@ void test13() {
__c11_atomic_load(&i, 0);
}
+
+// CHECK: void test14() {
+// CHECK: struct X {
+// CHECK: union {
+// CHECK: int x;
+// CHECK: } x;
+// CHECK: };
+// CHECK: }
+void test14() {
+ struct X { union { int x; } x; };
+}
diff --git a/test/SemaCXX/attr-aligned.cpp b/test/SemaCXX/attr-aligned.cpp
new file mode 100644
index 000000000000..4b9c55f4c7dd
--- /dev/null
+++ b/test/SemaCXX/attr-aligned.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+typedef struct S1 { char c; } S1 __attribute__((aligned(8)));
+static_assert(alignof(S1) == 8, "attribute ignored");
+static_assert(alignof(struct S1) == 1, "attribute applied to original type");
+
+typedef struct __attribute__((aligned(8))) S2 { char c; } AS;
+static_assert(alignof(S2) == 8, "attribute not propagated");
+static_assert(alignof(struct S2) == 8, "attribute ignored");
+
+typedef struct __attribute__((aligned(4))) S3 {
+ char c;
+} S3 __attribute__((aligned(8)));
+static_assert(alignof(S3) == 8, "attribute ignored");
+static_assert(alignof(struct S3) == 4, "attribute clobbered");
diff --git a/test/SemaCXX/attr-cleanup-gcc.cpp b/test/SemaCXX/attr-cleanup-gcc.cpp
new file mode 100644
index 000000000000..daebbe66c8d0
--- /dev/null
+++ b/test/SemaCXX/attr-cleanup-gcc.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -verify -fsyntax-only -Wgcc-compat
+
+namespace N {
+ void c1(int *a) {}
+}
+
+void c2(int *a) {}
+
+template <typename Ty>
+void c3(Ty *a) {}
+
+void t3() {
+ int v1 __attribute__((cleanup(N::c1))); // expected-warning {{GCC does not allow the 'cleanup' attribute argument to be anything other than a simple identifier}}
+ int v2 __attribute__((cleanup(c2)));
+ int v3 __attribute__((cleanup(c3<int>))); // expected-warning {{GCC does not allow the 'cleanup' attribute argument to be anything other than a simple identifier}}
+}
diff --git a/test/SemaCXX/attr-cleanup.cpp b/test/SemaCXX/attr-cleanup.cpp
new file mode 100644
index 000000000000..32d10683edeb
--- /dev/null
+++ b/test/SemaCXX/attr-cleanup.cpp
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 %s -verify -fsyntax-only -Wno-gcc-compat
+
+namespace N {
+ void c1(int *a) {}
+}
+
+class C {
+ static void c2(int *a) {} // expected-note {{implicitly declared private here}} expected-note {{implicitly declared private here}}
+};
+
+void t1() {
+ int v1 __attribute__((cleanup(N::c1)));
+ int v2 __attribute__((cleanup(N::c2))); // expected-error {{no member named 'c2' in namespace 'N'}}
+ int v3 __attribute__((cleanup(C::c2))); // expected-error {{'c2' is a private member of 'C'}}
+}
+
+class D : public C {
+ void t2() {
+ int v1 __attribute__((cleanup(c2))); // expected-error {{'c2' is a private member of 'C'}}
+ }
+};
+
+namespace E {
+ void c3(int *a) {} // expected-note {{candidate function}}
+ void c3() {} // expected-note {{candidate function}}
+ void t3() {
+ int v1 __attribute__((cleanup(c3))); // expected-error {{'c3' is not a single function}}
+ }
+}
diff --git a/test/SemaCXX/attr-common.cpp b/test/SemaCXX/attr-common.cpp
new file mode 100644
index 000000000000..58b30133f52f
--- /dev/null
+++ b/test/SemaCXX/attr-common.cpp
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+__attribute__((common)) int x; // expected-error {{common attribute is not supported in C++}}
diff --git a/test/SemaCXX/attr-cxx0x.cpp b/test/SemaCXX/attr-cxx0x.cpp
index e9276cd2d9ee..e24e12e50c4e 100644
--- a/test/SemaCXX/attr-cxx0x.cpp
+++ b/test/SemaCXX/attr-cxx0x.cpp
@@ -12,7 +12,7 @@ struct align_member {
};
void f(alignas(1) char c) { // expected-error {{'alignas' attribute cannot be applied to a function parameter}}
- alignas(1) register char k; // expected-error {{'alignas' attribute cannot be applied to a variable with 'register' storage class}}
+ alignas(1) register char k; // expected-error {{'alignas' attribute cannot be applied to a variable with 'register' storage class}} expected-warning {{deprecated}}
try {
} catch (alignas(4) int n) { // expected-error {{'alignas' attribute cannot be applied to a 'catch' variable}}
}
@@ -44,4 +44,4 @@ static_assert(alignof(align_class_temp_pack_type<short, int, long>) == alignof(l
static_assert(alignof(align_class_temp_pack_expr<8, 16, 32>) == 32, "template's alignment is wrong");
static_assert(alignof(outer<int,char>::inner<double,short>) == alignof(int) * alignof(double), "template's alignment is wrong");
-static_assert(alignof(int(int)) >= 1, "alignof(function) not positive"); // expected-warning{{invalid application of 'alignof' to a function type}}
+static_assert(alignof(int(int)) >= 1, "alignof(function) not positive"); // expected-error{{invalid application of 'alignof' to a function type}}
diff --git a/test/SemaCXX/attr-deprecated.cpp b/test/SemaCXX/attr-deprecated.cpp
index d09faf34d7a5..b3223f399799 100644
--- a/test/SemaCXX/attr-deprecated.cpp
+++ b/test/SemaCXX/attr-deprecated.cpp
@@ -244,3 +244,9 @@ namespace test7 {
X *x = new X; // expected-warning{{'operator new' is deprecated}} expected-warning{{'operator delete' is deprecated}}
}
}
+
+// rdar://problem/15044218
+typedef struct TDS {
+} TDS __attribute__((deprecated)); // expected-note {{'TDS' declared here}}
+TDS tds; // expected-warning {{'TDS' is deprecated}}
+struct TDS tds2; // no warning, attribute only applies to the typedef.
diff --git a/test/SemaCXX/attr-no-sanitize-address.cpp b/test/SemaCXX/attr-no-sanitize-address.cpp
index dc4d79758c16..f1803496fa55 100644
--- a/test/SemaCXX/attr-no-sanitize-address.cpp
+++ b/test/SemaCXX/attr-no-sanitize-address.cpp
@@ -9,7 +9,7 @@
void noanal_fun() NO_SANITIZE_ADDRESS;
void noanal_fun_args() __attribute__((no_sanitize_address(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'no_sanitize_address' attribute takes no arguments}}
int noanal_testfn(int y) NO_SANITIZE_ADDRESS;
diff --git a/test/SemaCXX/attr-no-sanitize-memory.cpp b/test/SemaCXX/attr-no-sanitize-memory.cpp
index 84acdaca838f..d6eca1b69dc1 100644
--- a/test/SemaCXX/attr-no-sanitize-memory.cpp
+++ b/test/SemaCXX/attr-no-sanitize-memory.cpp
@@ -9,7 +9,7 @@
void noanal_fun() NO_SANITIZE_MEMORY;
void noanal_fun_args() __attribute__((no_sanitize_memory(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'no_sanitize_memory' attribute takes no arguments}}
int noanal_testfn(int y) NO_SANITIZE_MEMORY;
diff --git a/test/SemaCXX/attr-no-sanitize-thread.cpp b/test/SemaCXX/attr-no-sanitize-thread.cpp
index 50960c42b931..d6372bceff8a 100644
--- a/test/SemaCXX/attr-no-sanitize-thread.cpp
+++ b/test/SemaCXX/attr-no-sanitize-thread.cpp
@@ -9,7 +9,7 @@
void noanal_fun() NO_SANITIZE_THREAD;
void noanal_fun_args() __attribute__((no_sanitize_thread(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'no_sanitize_thread' attribute takes no arguments}}
int noanal_testfn(int y) NO_SANITIZE_THREAD;
diff --git a/test/SemaCXX/attr-print.cpp b/test/SemaCXX/attr-print.cpp
index 2e7478904f12..a07eeff5646e 100644
--- a/test/SemaCXX/attr-print.cpp
+++ b/test/SemaCXX/attr-print.cpp
@@ -16,3 +16,9 @@ void bar() __attribute__((__const));
// FIXME: Print this with correct format and order.
// CHECK: void foo1() __attribute__((pure)) __attribute__((noinline));
void foo1() __attribute__((noinline, pure));
+
+// CHECK: typedef int Small1 __attribute__((mode(byte)));
+typedef int Small1 __attribute__((mode(byte)));
+
+// CHECK: int small __attribute__((mode(byte)));
+int small __attribute__((mode(byte)));
diff --git a/test/SemaCXX/attr-selectany.cpp b/test/SemaCXX/attr-selectany.cpp
new file mode 100644
index 000000000000..0f9776dbf5db
--- /dev/null
+++ b/test/SemaCXX/attr-selectany.cpp
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -fms-extensions -fsyntax-only -verify %s
+// MSVC produces similar diagnostics.
+
+__declspec(selectany) void foo() { } // expected-error{{'selectany' can only be applied to data items with external linkage}}
+
+__declspec(selectany) int x1 = 1;
+
+const __declspec(selectany) int x2 = 2; // expected-error{{'selectany' can only be applied to data items with external linkage}}
+
+extern const __declspec(selectany) int x3 = 3;
+
+extern const int x4;
+const __declspec(selectany) int x4 = 4;
+
+// MSDN says this is incorrect, but MSVC doesn't diagnose it.
+extern __declspec(selectany) int x5;
+
+static __declspec(selectany) int x6 = 2; // expected-error{{'selectany' can only be applied to data items with external linkage}}
+
+// FIXME: MSVC accepts this and makes x7 externally visible and comdat, but keep
+// it as internal and not weak/linkonce.
+static int x7; // expected-note{{previous definition}}
+extern __declspec(selectany) int x7; // expected-warning{{attribute declaration must precede definition}}
+
+int asdf() { return x7; }
+
+class X {
+ public:
+ X(int i) { i++; };
+ int i;
+};
+
+__declspec(selectany) X x(1);
diff --git a/test/SemaCXX/attr-used.cpp b/test/SemaCXX/attr-used.cpp
new file mode 100644
index 000000000000..9bae3edc7f8b
--- /dev/null
+++ b/test/SemaCXX/attr-used.cpp
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+extern char test1[] __attribute__((used)); // expected-warning {{used attribute ignored}}
+extern const char test2[] __attribute__((used)); // expected-warning {{used attribute ignored}}
+extern const char test3[] __attribute__((used)) = "";
diff --git a/test/SemaCXX/attr-weakref.cpp b/test/SemaCXX/attr-weakref.cpp
index f3d7a6241c91..0c3f1d20e7f7 100644
--- a/test/SemaCXX/attr-weakref.cpp
+++ b/test/SemaCXX/attr-weakref.cpp
@@ -32,3 +32,5 @@ int a9 __attribute__((weakref)); // expected-error {{weakref declaration of 'a9
static int a10();
int a10() __attribute__((weakref ("foo")));
+
+static int v __attribute__((weakref(a1), alias("foo"))); // expected-error {{'weakref' attribute requires a string}}
diff --git a/test/SemaCXX/blocks-1.cpp b/test/SemaCXX/blocks-1.cpp
index 02e9cac62ebe..e11fd92cf236 100644
--- a/test/SemaCXX/blocks-1.cpp
+++ b/test/SemaCXX/blocks-1.cpp
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks -std=c++11
-// expected-no-diagnostics
+// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks -std=c++1y
extern "C" int exit(int);
@@ -57,3 +56,18 @@ namespace rdar11055105 {
foo(a);
};
}
+
+namespace LocalDecls {
+ void f() {
+ (void) ^{
+ extern int a; // expected-note {{previous}}
+ extern int b(); // expected-note {{previous}}
+ };
+ }
+ void g() {
+ (void) ^{
+ extern float a; // expected-error {{different type}}
+ extern float b(); // expected-error {{cannot be overloaded}}
+ };
+ }
+}
diff --git a/test/SemaCXX/bool.cpp b/test/SemaCXX/bool.cpp
index f027186735b3..69c011935781 100644
--- a/test/SemaCXX/bool.cpp
+++ b/test/SemaCXX/bool.cpp
@@ -1,4 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion \
+// RUN: -Wno-deprecated -Wdeprecated-increment-bool %s
// Bool literals can be enum values.
enum {
diff --git a/test/SemaCXX/builtins.cpp b/test/SemaCXX/builtins.cpp
index 5d61690c16e5..69bdfa614517 100644
--- a/test/SemaCXX/builtins.cpp
+++ b/test/SemaCXX/builtins.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++11
typedef const struct __CFString * CFStringRef;
#define CFSTR __builtin___CFStringMakeConstantString
@@ -24,3 +24,23 @@ void f2() {
// pr14895
typedef __typeof(sizeof(int)) size_t;
extern "C" void *__builtin_alloca (size_t);
+
+namespace addressof {
+ struct S {} s;
+ static_assert(__builtin_addressof(s) == &s, "");
+
+ struct T { constexpr T *operator&() const { return nullptr; } int n; } t;
+ constexpr T *pt = __builtin_addressof(t);
+ static_assert(&pt->n == &t.n, "");
+
+ struct U { int n : 5; } u;
+ int *pbf = __builtin_addressof(u.n); // expected-error {{address of bit-field requested}}
+
+ S *ptmp = __builtin_addressof(S{}); // expected-error {{taking the address of a temporary}}
+}
+
+void no_ms_builtins() {
+ __assume(1); // expected-error {{use of undeclared}}
+ __noop(1); // expected-error {{use of undeclared}}
+ __debugbreak(); // expected-error {{use of undeclared}}
+}
diff --git a/test/SemaCXX/c99.cpp b/test/SemaCXX/c99.cpp
index 13918dcf5ef6..7afcdd509f9d 100644
--- a/test/SemaCXX/c99.cpp
+++ b/test/SemaCXX/c99.cpp
@@ -2,7 +2,7 @@
void f1(int i[static 5]) { // expected-error{{C99}}
}
-struct Point { int x; int y; };
+struct Point { int x; int y; int z[]; }; // expected-warning{{flexible array members are a C99 feature}}
Point p1 = { .x = 17, // expected-warning{{designated initializers are a C99 feature}}
y: 25 }; // expected-warning{{designated initializers are a C99 feature}} \
diff --git a/test/SemaCXX/calling-conv-compat.cpp b/test/SemaCXX/calling-conv-compat.cpp
new file mode 100644
index 000000000000..2d52386add16
--- /dev/null
+++ b/test/SemaCXX/calling-conv-compat.cpp
@@ -0,0 +1,387 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -fms-extensions -cxx-abi microsoft -verify -triple i686-pc-win32 %s
+
+// Pointers to free functions
+void free_func_default();
+void __cdecl free_func_cdecl();
+void __stdcall free_func_stdcall();
+void __fastcall free_func_fastcall();
+
+typedef void ( *fptr_default)();
+typedef void (__cdecl *fptr_cdecl)();
+typedef void (__stdcall *fptr_stdcall)();
+typedef void (__fastcall *fptr_fastcall)();
+
+// expected-note@+4 {{candidate function not viable: no known conversion from 'void () __attribute__((stdcall))' to 'fptr_default' (aka 'void (*)()') for 1st argument}}
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void () __attribute__((fastcall))' to 'fptr_default' (aka 'void (*)()') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (*)() __attribute__((stdcall))' to 'fptr_default' (aka 'void (*)()') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (*)() __attribute__((fastcall))' to 'fptr_default' (aka 'void (*)()') for 1st argument}}
+void cb_fptr_default(fptr_default ptr);
+// expected-note@+4 {{candidate function not viable: no known conversion from 'void () __attribute__((stdcall))' to 'fptr_cdecl' (aka 'void (*)()') for 1st argument}}
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void () __attribute__((fastcall))' to 'fptr_cdecl' (aka 'void (*)()') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (*)() __attribute__((stdcall))' to 'fptr_cdecl' (aka 'void (*)()') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (*)() __attribute__((fastcall))' to 'fptr_cdecl' (aka 'void (*)()') for 1st argument}}
+void cb_fptr_cdecl(fptr_cdecl ptr);
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void ()' to 'fptr_stdcall' (aka 'void (*)() __attribute__((stdcall))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void () __attribute__((cdecl))' to 'fptr_stdcall' (aka 'void (*)() __attribute__((stdcall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void () __attribute__((fastcall))' to 'fptr_stdcall' (aka 'void (*)() __attribute__((stdcall))') for 1st argument}}
+void cb_fptr_stdcall(fptr_stdcall ptr);
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void ()' to 'fptr_fastcall' (aka 'void (*)() __attribute__((fastcall))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void () __attribute__((cdecl))' to 'fptr_fastcall' (aka 'void (*)() __attribute__((fastcall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void () __attribute__((stdcall))' to 'fptr_fastcall' (aka 'void (*)() __attribute__((fastcall))') for 1st argument}}
+void cb_fptr_fastcall(fptr_fastcall ptr);
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void () __attribute__((stdcall))' to 'const fptr_default' (aka 'void (*const)()') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void () __attribute__((fastcall))' to 'const fptr_default' (aka 'void (*const)()') for 1st argument}}
+void cb_fptr_const_default(const fptr_default ptr);
+
+void call_free_func() {
+ cb_fptr_default(free_func_default);
+ cb_fptr_default(free_func_cdecl);
+ cb_fptr_default(free_func_stdcall); // expected-error {{no matching function for call to 'cb_fptr_default'}}
+ cb_fptr_default(free_func_fastcall); // expected-error {{no matching function for call to 'cb_fptr_default'}}
+ cb_fptr_default(&free_func_default);
+ cb_fptr_default(&free_func_cdecl);
+ cb_fptr_default(&free_func_stdcall); // expected-error {{no matching function for call to 'cb_fptr_default'}}
+ cb_fptr_default(&free_func_fastcall); // expected-error {{no matching function for call to 'cb_fptr_default'}}
+
+ cb_fptr_cdecl(free_func_default);
+ cb_fptr_cdecl(free_func_cdecl);
+ cb_fptr_cdecl(free_func_stdcall); // expected-error {{no matching function for call to 'cb_fptr_cdecl'}}
+ cb_fptr_cdecl(free_func_fastcall); // expected-error {{no matching function for call to 'cb_fptr_cdecl'}}
+ cb_fptr_cdecl(&free_func_default);
+ cb_fptr_cdecl(&free_func_cdecl);
+ cb_fptr_cdecl(&free_func_stdcall); // expected-error {{no matching function for call to 'cb_fptr_cdecl'}}
+ cb_fptr_cdecl(&free_func_fastcall); // expected-error {{no matching function for call to 'cb_fptr_cdecl'}}
+
+ cb_fptr_stdcall(free_func_default); // expected-error {{no matching function for call to 'cb_fptr_stdcall'}}
+ cb_fptr_stdcall(free_func_cdecl); // expected-error {{no matching function for call to 'cb_fptr_stdcall'}}
+ cb_fptr_stdcall(free_func_stdcall);
+ cb_fptr_stdcall(free_func_fastcall); // expected-error {{no matching function for call to 'cb_fptr_stdcall'}}
+
+ cb_fptr_fastcall(free_func_default); // expected-error {{no matching function for call to 'cb_fptr_fastcall'}}
+ cb_fptr_fastcall(free_func_cdecl); // expected-error {{no matching function for call to 'cb_fptr_fastcall'}}
+ cb_fptr_fastcall(free_func_stdcall); // expected-error {{no matching function for call to 'cb_fptr_fastcall'}}
+ cb_fptr_fastcall(free_func_fastcall);
+
+ cb_fptr_const_default(free_func_default);
+ cb_fptr_const_default(free_func_cdecl);
+ cb_fptr_const_default(free_func_stdcall); // expected-error {{no matching function for call to 'cb_fptr_const_default'}}
+ cb_fptr_const_default(free_func_fastcall); // expected-error {{no matching function for call to 'cb_fptr_const_default'}}
+
+}
+
+// Pointers to variadic functions
+// variadic function can't declared stdcall or fastcall
+void free_func_variadic_default(int, ...);
+void __cdecl free_func_variadic_cdecl(int, ...);
+
+typedef void ( *fptr_variadic_default)(int, ...);
+typedef void (__cdecl *fptr_variadic_cdecl)(int, ...);
+
+void cb_fptr_variadic_default(fptr_variadic_default ptr);
+void cb_fptr_variadic_cdecl(fptr_variadic_cdecl ptr);
+
+void call_free_variadic_func() {
+ cb_fptr_variadic_default(free_func_variadic_default);
+ cb_fptr_variadic_default(free_func_variadic_cdecl);
+ cb_fptr_variadic_default(&free_func_variadic_default);
+ cb_fptr_variadic_default(&free_func_variadic_cdecl);
+
+ cb_fptr_variadic_cdecl(free_func_variadic_default);
+ cb_fptr_variadic_cdecl(free_func_variadic_cdecl);
+ cb_fptr_variadic_cdecl(&free_func_variadic_default);
+ cb_fptr_variadic_cdecl(&free_func_variadic_cdecl);
+}
+
+// References to functions
+typedef void ( &fref_default)();
+typedef void (__cdecl &fref_cdecl)();
+typedef void (__stdcall &fref_stdcall)();
+typedef void (__fastcall &fref_fastcall)();
+
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void () __attribute__((stdcall))' to 'fref_default' (aka 'void (&)()') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void () __attribute__((fastcall))' to 'fref_default' (aka 'void (&)()') for 1st argument}}
+void cb_fref_default(fref_default ptr);
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void () __attribute__((stdcall))' to 'fref_cdecl' (aka 'void (&)()') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void () __attribute__((fastcall))' to 'fref_cdecl' (aka 'void (&)()') for 1st argument}}
+void cb_fref_cdecl(fref_cdecl ptr);
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void ()' to 'fref_stdcall' (aka 'void (&)() __attribute__((stdcall))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void () __attribute__((cdecl))' to 'fref_stdcall' (aka 'void (&)() __attribute__((stdcall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void () __attribute__((fastcall))' to 'fref_stdcall' (aka 'void (&)() __attribute__((stdcall))') for 1st argument}}
+void cb_fref_stdcall(fref_stdcall ptr);
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void ()' to 'fref_fastcall' (aka 'void (&)() __attribute__((fastcall))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void () __attribute__((cdecl))' to 'fref_fastcall' (aka 'void (&)() __attribute__((fastcall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void () __attribute__((stdcall))' to 'fref_fastcall' (aka 'void (&)() __attribute__((fastcall))') for 1st argument}}
+void cb_fref_fastcall(fref_fastcall ptr);
+
+void call_free_func_ref() {
+ cb_fref_default(free_func_default);
+ cb_fref_default(free_func_cdecl);
+ cb_fref_default(free_func_stdcall); // expected-error {{no matching function for call to 'cb_fref_default'}}
+ cb_fref_default(free_func_fastcall); // expected-error {{no matching function for call to 'cb_fref_default'}}
+
+ cb_fref_cdecl(free_func_default);
+ cb_fref_cdecl(free_func_cdecl);
+ cb_fref_cdecl(free_func_stdcall); // expected-error {{no matching function for call to 'cb_fref_cdecl'}}
+ cb_fref_cdecl(free_func_fastcall); // expected-error {{no matching function for call to 'cb_fref_cdecl'}}
+
+ cb_fref_stdcall(free_func_default); // expected-error {{no matching function for call to 'cb_fref_stdcall'}}
+ cb_fref_stdcall(free_func_cdecl); // expected-error {{no matching function for call to 'cb_fref_stdcall'}}
+ cb_fref_stdcall(free_func_stdcall);
+ cb_fref_stdcall(free_func_fastcall); // expected-error {{no matching function for call to 'cb_fref_stdcall'}}
+
+ cb_fref_fastcall(free_func_default); // expected-error {{no matching function for call to 'cb_fref_fastcall'}}
+ cb_fref_fastcall(free_func_cdecl); // expected-error {{no matching function for call to 'cb_fref_fastcall'}}
+ cb_fref_fastcall(free_func_stdcall); // expected-error {{no matching function for call to 'cb_fref_fastcall'}}
+ cb_fref_fastcall(free_func_fastcall);
+}
+
+// References to variadic functions
+// variadic function can't declared stdcall or fastcall
+typedef void ( &fref_variadic_default)(int, ...);
+typedef void (__cdecl &fref_variadic_cdecl)(int, ...);
+
+void cb_fref_variadic_default(fptr_variadic_default ptr);
+void cb_fref_variadic_cdecl(fptr_variadic_cdecl ptr);
+
+void call_free_variadic_func_ref() {
+ cb_fref_variadic_default(free_func_variadic_default);
+ cb_fref_variadic_default(free_func_variadic_cdecl);
+
+ cb_fref_variadic_cdecl(free_func_variadic_default);
+ cb_fref_variadic_cdecl(free_func_variadic_cdecl);
+}
+
+// Pointers to members
+namespace NonVariadic {
+
+struct A {
+ void member_default();
+ void __cdecl member_cdecl();
+ void __thiscall member_thiscall();
+};
+
+struct B : public A {
+};
+
+struct C {
+ void member_default();
+ void __cdecl member_cdecl();
+ void __thiscall member_thiscall();
+};
+
+typedef void ( A::*memb_a_default)();
+typedef void (__cdecl A::*memb_a_cdecl)();
+typedef void (__thiscall A::*memb_a_thiscall)();
+typedef void ( B::*memb_b_default)();
+typedef void (__cdecl B::*memb_b_cdecl)();
+typedef void (__thiscall B::*memb_b_thiscall)();
+typedef void ( C::*memb_c_default)();
+typedef void (__cdecl C::*memb_c_cdecl)();
+typedef void (__thiscall C::*memb_c_thiscall)();
+
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_a_default' (aka 'void (NonVariadic::A::*)() __attribute__((thiscall))') for 1st argument}}
+void cb_memb_a_default(memb_a_default ptr);
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_a_cdecl' (aka 'void (NonVariadic::A::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_a_cdecl' (aka 'void (NonVariadic::A::*)() __attribute__((cdecl))') for 1st argument}}
+void cb_memb_a_cdecl(memb_a_cdecl ptr);
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_a_thiscall' (aka 'void (NonVariadic::A::*)() __attribute__((thiscall))') for 1st argument}}
+void cb_memb_a_thiscall(memb_a_thiscall ptr);
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_b_default' (aka 'void (NonVariadic::B::*)() __attribute__((thiscall))') for 1st argument}}
+void cb_memb_b_default(memb_b_default ptr);
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_b_cdecl' (aka 'void (NonVariadic::B::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_b_cdecl' (aka 'void (NonVariadic::B::*)() __attribute__((cdecl))') for 1st argument}}
+void cb_memb_b_cdecl(memb_b_cdecl ptr);
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_b_thiscall' (aka 'void (NonVariadic::B::*)() __attribute__((thiscall))') for 1st argument}}
+void cb_memb_b_thiscall(memb_b_thiscall ptr);
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_default' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_c_default' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_default' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+void cb_memb_c_default(memb_c_default ptr);
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_cdecl' (aka 'void (NonVariadic::C::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_c_cdecl' (aka 'void (NonVariadic::C::*)() __attribute__((cdecl))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_cdecl' (aka 'void (NonVariadic::C::*)() __attribute__((cdecl))') for 1st argument}}
+void cb_memb_c_cdecl(memb_c_cdecl ptr);
+// expected-note@+3 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_thiscall' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((cdecl))' to 'memb_c_thiscall' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (NonVariadic::A::*)() __attribute__((thiscall))' to 'memb_c_thiscall' (aka 'void (NonVariadic::C::*)() __attribute__((thiscall))') for 1st argument}}
+void cb_memb_c_thiscall(memb_c_thiscall ptr);
+
+void call_member() {
+ cb_memb_a_default(&A::member_default);
+ cb_memb_a_default(&A::member_cdecl); // expected-error {{no matching function for call to 'cb_memb_a_default'}}
+ cb_memb_a_default(&A::member_thiscall);
+
+ cb_memb_a_cdecl(&A::member_default); // expected-error {{no matching function for call to 'cb_memb_a_cdecl'}}
+ cb_memb_a_cdecl(&A::member_cdecl);
+ cb_memb_a_cdecl(&A::member_thiscall); // expected-error {{no matching function for call to 'cb_memb_a_cdecl'}}
+
+ cb_memb_a_thiscall(&A::member_default);
+ cb_memb_a_thiscall(&A::member_cdecl); // expected-error {{no matching function for call to 'cb_memb_a_thiscall'}}
+ cb_memb_a_thiscall(&A::member_thiscall);
+}
+
+void call_member_inheritance() {
+ cb_memb_b_default(&A::member_default);
+ cb_memb_b_default(&A::member_cdecl); // expected-error {{no matching function for call to 'cb_memb_b_default'}}
+ cb_memb_b_default(&A::member_thiscall);
+ cb_memb_c_default(&A::member_default); // expected-error {{no matching function for call to 'cb_memb_c_default'}}
+ cb_memb_c_default(&A::member_cdecl); // expected-error {{no matching function for call to 'cb_memb_c_default'}}
+ cb_memb_c_default(&A::member_thiscall); // expected-error {{no matching function for call to 'cb_memb_c_default'}}
+
+ cb_memb_b_cdecl(&A::member_default); // expected-error {{no matching function for call to 'cb_memb_b_cdecl'}}
+ cb_memb_b_cdecl(&A::member_cdecl);
+ cb_memb_b_cdecl(&A::member_thiscall); // expected-error {{no matching function for call to 'cb_memb_b_cdecl'}}
+ cb_memb_c_cdecl(&A::member_default); // expected-error {{no matching function for call to 'cb_memb_c_cdecl'}}
+ cb_memb_c_cdecl(&A::member_cdecl); // expected-error {{no matching function for call to 'cb_memb_c_cdecl'}}
+ cb_memb_c_cdecl(&A::member_thiscall); // expected-error {{no matching function for call to 'cb_memb_c_cdecl'}}
+
+ cb_memb_b_thiscall(&A::member_default);
+ cb_memb_b_thiscall(&A::member_cdecl); // expected-error {{no matching function for call to 'cb_memb_b_thiscall'}}
+ cb_memb_b_thiscall(&A::member_thiscall);
+ cb_memb_c_thiscall(&A::member_default); // expected-error {{no matching function for call to 'cb_memb_c_thiscall'}}
+ cb_memb_c_thiscall(&A::member_cdecl); // expected-error {{no matching function for call to 'cb_memb_c_thiscall'}}
+ cb_memb_c_thiscall(&A::member_thiscall); // expected-error {{no matching function for call to 'cb_memb_c_thiscall'}}
+}
+} // end namespace NonVariadic
+
+namespace Variadic {
+struct A {
+ void member_default(int, ...);
+ void __cdecl member_cdecl(int, ...);
+ void __thiscall member_thiscall(int, ...); // expected-error {{variadic function cannot use thiscall calling convention}}
+};
+
+struct B : public A {
+};
+
+struct C {
+ void member_default(int, ...);
+ void __cdecl member_cdecl(int, ...);
+};
+
+typedef void ( A::*memb_a_default)(int, ...);
+typedef void (__cdecl A::*memb_a_cdecl)(int, ...);
+typedef void ( B::*memb_b_default)(int, ...);
+typedef void (__cdecl B::*memb_b_cdecl)(int, ...);
+typedef void ( C::*memb_c_default)(int, ...);
+typedef void (__cdecl C::*memb_c_cdecl)(int, ...);
+
+void cb_memb_a_default(memb_a_default ptr);
+void cb_memb_a_cdecl(memb_a_cdecl ptr);
+void cb_memb_b_default(memb_b_default ptr);
+void cb_memb_b_cdecl(memb_b_cdecl ptr);
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...)' to 'memb_c_default' (aka 'void (Variadic::C::*)(int, ...)') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...) __attribute__((cdecl))' to 'memb_c_default' (aka 'void (Variadic::C::*)(int, ...)') for 1st argument}}
+void cb_memb_c_default(memb_c_default ptr);
+// expected-note@+2 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...)' to 'memb_c_cdecl' (aka 'void (Variadic::C::*)(int, ...) __attribute__((cdecl))') for 1st argument}}
+// expected-note@+1 {{candidate function not viable: no known conversion from 'void (Variadic::A::*)(int, ...) __attribute__((cdecl))' to 'memb_c_cdecl' (aka 'void (Variadic::C::*)(int, ...) __attribute__((cdecl))') for 1st argument}}
+void cb_memb_c_cdecl(memb_c_cdecl ptr);
+
+void call_member() {
+ cb_memb_a_default(&A::member_default);
+ cb_memb_a_default(&A::member_cdecl);
+
+ cb_memb_a_cdecl(&A::member_default);
+ cb_memb_a_cdecl(&A::member_cdecl);
+}
+
+void call_member_inheritance() {
+ cb_memb_b_default(&A::member_default);
+ cb_memb_b_default(&A::member_cdecl);
+ cb_memb_c_default(&A::member_default); // expected-error {{no matching function for call to 'cb_memb_c_default'}}
+ cb_memb_c_default(&A::member_cdecl); // expected-error {{no matching function for call to 'cb_memb_c_default'}}
+
+ cb_memb_b_cdecl(&A::member_default);
+ cb_memb_b_cdecl(&A::member_cdecl);
+ cb_memb_c_cdecl(&A::member_default); // expected-error {{no matching function for call to 'cb_memb_c_cdecl'}}
+ cb_memb_c_cdecl(&A::member_cdecl); // expected-error {{no matching function for call to 'cb_memb_c_cdecl'}}
+}
+} // end namespace Variadic
+
+namespace MultiChunkDecls {
+
+// Try to test declarators that have multiple DeclaratorChunks.
+struct A {
+ void __thiscall member_thiscall(int);
+};
+
+void (A::*return_mptr(short))(int) {
+ return &A::member_thiscall;
+}
+
+void (A::*(*return_fptr_mptr(char))(short))(int) {
+ return return_mptr;
+}
+
+typedef void (A::*mptr_t)(int);
+mptr_t __stdcall return_mptr_std(short) {
+ return &A::member_thiscall;
+}
+
+void (A::*(*return_fptr_std_mptr(char))(short))(int) {
+ return return_mptr_std; // expected-error {{cannot initialize return object of type 'void (MultiChunkDecls::A::*(*)(short))(int) __attribute__((thiscall))' with an lvalue of type 'mptr_t (short) __attribute__((stdcall))'}}
+}
+
+void call_return() {
+ A o;
+ void (A::*(*fptr)(short))(int) = return_fptr_mptr('a');
+ void (A::*mptr)(int) = fptr(1);
+ (o.*mptr)(2);
+}
+
+} // end namespace MultiChunkDecls
+
+namespace MemberPointers {
+
+struct A {
+ void __thiscall method_thiscall();
+ void __cdecl method_cdecl();
+ void __stdcall method_stdcall();
+ void __fastcall method_fastcall();
+};
+
+void ( A::*mp1)() = &A::method_thiscall;
+void (__cdecl A::*mp2)() = &A::method_cdecl;
+void (__stdcall A::*mp3)() = &A::method_stdcall;
+void (__fastcall A::*mp4)() = &A::method_fastcall;
+
+// Use a typedef to form the member pointer and verify that cdecl is adjusted.
+typedef void ( fun_default)();
+typedef void (__cdecl fun_cdecl)();
+typedef void (__stdcall fun_stdcall)();
+typedef void (__fastcall fun_fastcall)();
+
+// FIXME: Adjust cdecl to thiscall when forming a member pointer.
+//fun_default A::*td1 = &A::method_thiscall;
+fun_cdecl A::*td2 = &A::method_cdecl;
+fun_stdcall A::*td3 = &A::method_stdcall;
+fun_fastcall A::*td4 = &A::method_fastcall;
+
+// Round trip the function type through a template, and verify that only cdecl
+// gets adjusted.
+template<typename Fn> struct X {
+ typedef Fn A::*p;
+};
+
+// FIXME: Adjust cdecl to thiscall when forming a member pointer.
+//X<void ()>::p tmpl1 = &A::method_thiscall;
+//X<void __cdecl ()>::p tmpl2 = &A::method_thiscall;
+X<void __stdcall ()>::p tmpl3 = &A::method_stdcall;
+X<void __fastcall ()>::p tmpl4 = &A::method_fastcall;
+
+} // end namespace MemberPointers
+
+// Test that lambdas that capture nothing convert to cdecl function pointers.
+namespace Lambdas {
+
+void pass_fptr_cdecl (void (__cdecl *fp)());
+void pass_fptr_stdcall (void (__stdcall *fp)()); // expected-note {{candidate function not viable}}
+void pass_fptr_fastcall(void (__fastcall *fp)()); // expected-note {{candidate function not viable}}
+
+void conversion_to_fptr() {
+ pass_fptr_cdecl ([]() { } );
+ pass_fptr_stdcall ([]() { } ); // expected-error {{no matching function for call}}
+ pass_fptr_fastcall([]() { } ); // expected-error {{no matching function for call}}
+}
+
+}
diff --git a/test/SemaCXX/captured-statements.cpp b/test/SemaCXX/captured-statements.cpp
index dbb18a7b6765..5fb686c3c913 100644
--- a/test/SemaCXX/captured-statements.cpp
+++ b/test/SemaCXX/captured-statements.cpp
@@ -164,3 +164,10 @@ void test_capture_variadic() {
(void)captured_sum(1, 2, 3); // OK
(void)captured_sum(1, 2, 3, 4, 5); // OK
}
+
+void test_capture_with_attributes() {
+ [[]] // expected-error {{an attribute list cannot appear here}}
+ #pragma clang __debug captured
+ {
+ }
+}
diff --git a/test/SemaCXX/cast-conversion.cpp b/test/SemaCXX/cast-conversion.cpp
index 270f96831bd4..4d5abfdcfb1e 100644
--- a/test/SemaCXX/cast-conversion.cpp
+++ b/test/SemaCXX/cast-conversion.cpp
@@ -16,8 +16,7 @@ struct B { // expected-note 3 {{candidate constructor (the implicit copy constru
int main () {
B(10); // expected-error {{no matching conversion for functional-style cast from 'int' to 'B'}}
(B)10; // expected-error {{no matching conversion for C-style cast from 'int' to 'B'}}
- static_cast<B>(10); // expected-error {{no matching conversion for static_cast from 'int' to 'B'}} \\
- // expected-warning {{expression result unused}}
+ static_cast<B>(10); // expected-error {{no matching conversion for static_cast from 'int' to 'B'}}
}
template<class T>
@@ -65,3 +64,18 @@ void *intToPointer4() {
void *intToPointer5(long l) {
return (void*)l;
}
+
+struct AmbiguousCast {
+ operator int(); // expected-note {{candidate function}}
+ operator unsigned int(); // expected-note {{candidate function}}
+};
+long long AmbiguousCastFunc(AmbiguousCast& a) {
+ return static_cast<long long>(a); // expected-error {{ambiguous conversion for static_cast from 'AmbiguousCast' to 'long long'}}
+}
+
+namespace PR16680 {
+ void f(int (*__pf)());
+ int g() {
+ f(reinterpret_cast<int>(0.0f)); // expected-error {{reinterpret_cast from 'float' to 'int' is not allowed}}
+ }
+}
diff --git a/test/SemaCXX/class-base-member-init.cpp b/test/SemaCXX/class-base-member-init.cpp
index 2cdca829ffb9..8344e6f49a67 100644
--- a/test/SemaCXX/class-base-member-init.cpp
+++ b/test/SemaCXX/class-base-member-init.cpp
@@ -98,3 +98,13 @@ namespace rdar13185264 {
union { void *a; };
};
}
+
+namespace PR16596 {
+ class A { public: virtual ~A(); };
+ typedef const A Foo;
+ void Apply(Foo processor);
+ struct Bar : public Foo {};
+ void Fetch() {
+ Apply(Bar());
+ }
+}
diff --git a/test/SemaCXX/class-layout.cpp b/test/SemaCXX/class-layout.cpp
index f2ff9fcfd7c1..64c8ceba995e 100644
--- a/test/SemaCXX/class-layout.cpp
+++ b/test/SemaCXX/class-layout.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++98
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11
// expected-no-diagnostics
#define SA(n, p) int a##n[(p) ? 1 : -1]
@@ -103,3 +104,469 @@ struct H { G g; };
SA(0, sizeof(H) == 24);
}
+
+namespace PR16537 {
+namespace test1 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct tail_padded_pod_in_11_only {
+ pod_in_11_only pod11;
+ char tail_padding;
+ };
+
+ struct might_use_tail_padding : public tail_padded_pod_in_11_only {
+ char may_go_into_tail_padding;
+ };
+
+ SA(0, sizeof(might_use_tail_padding) == 16);
+}
+
+namespace test2 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct tail_padded_pod_in_11_only {
+ pod_in_11_only pod11 __attribute__((aligned(16)));
+ };
+
+ struct might_use_tail_padding : public tail_padded_pod_in_11_only {
+ char may_go_into_tail_padding;
+ };
+
+ SA(0, sizeof(might_use_tail_padding) == 16);
+}
+
+namespace test3 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct tail_padded_pod_in_11_only {
+ pod_in_11_only pod11;
+ char tail_padding;
+ };
+
+ struct second_base {
+ char foo;
+ };
+
+ struct might_use_tail_padding : public tail_padded_pod_in_11_only, public second_base {
+
+ };
+ SA(0, sizeof(might_use_tail_padding) == 16);
+}
+
+namespace test4 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct tail_padded_pod_in_11_only {
+ pod_in_11_only pod11;
+ char tail_padding;
+ };
+
+ struct second_base {
+ char foo;
+ };
+
+ struct might_use_tail_padding : public tail_padded_pod_in_11_only, public second_base {
+ char may_go_into_tail_padding;
+ };
+ SA(0, sizeof(might_use_tail_padding) == 16);
+}
+
+namespace test5 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct pod_in_11_only2 {
+ private:
+ long long x;
+ };
+
+ struct tail_padded_pod_in_11_only {
+ pod_in_11_only pod11;
+ char tail_padding;
+ };
+
+ struct second_base {
+ pod_in_11_only2 two;
+ char foo;
+ };
+
+ struct might_use_tail_padding : public tail_padded_pod_in_11_only, public second_base {
+ char may_go_into_tail_padding;
+ };
+ SA(0, sizeof(might_use_tail_padding) == 32);
+}
+
+namespace test6 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct pod_in_11_only2 {
+ private:
+ long long x;
+ };
+
+ struct tail_padded_pod_in_11_only {
+ pod_in_11_only pod11;
+ char tail_padding;
+ };
+
+ struct second_base {
+ pod_in_11_only2 two;
+ char foo;
+ };
+
+ struct might_use_tail_padding : public tail_padded_pod_in_11_only, public second_base {
+ char may_go_into_tail_padding;
+ };
+ SA(0, sizeof(might_use_tail_padding) == 32);
+}
+
+namespace test7 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct tail_padded_pod_in_11_only {
+ pod_in_11_only pod11;
+ pod_in_11_only pod12;
+ char tail_padding;
+ };
+
+ struct might_use_tail_padding : public tail_padded_pod_in_11_only {
+ char may_go_into_tail_padding;
+ };
+
+ SA(0, sizeof(might_use_tail_padding) == 24);
+}
+
+namespace test8 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct tail_padded_pod_in_11_only {
+ pod_in_11_only pod11;
+ char tail_padding;
+ };
+
+ struct another_layer {
+ tail_padded_pod_in_11_only pod;
+ char padding;
+ };
+
+ struct might_use_tail_padding : public another_layer {
+ char may_go_into_tail_padding;
+ };
+
+ SA(0, sizeof(might_use_tail_padding) == 24);
+}
+
+namespace test9 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct tail_padded_pod_in_11_only {
+ pod_in_11_only pod11;
+ char tail_padding;
+ };
+
+ struct another_layer : tail_padded_pod_in_11_only {
+ };
+
+ struct might_use_tail_padding : public another_layer {
+ char may_go_into_tail_padding;
+ };
+
+ SA(0, sizeof(might_use_tail_padding) == 16);
+}
+
+namespace test10 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct A {
+ pod_in_11_only a;
+ char apad;
+ };
+
+ struct B {
+ char b;
+ };
+
+ struct C {
+ pod_in_11_only c;
+ char cpad;
+ };
+
+ struct D {
+ char d;
+ };
+
+ struct might_use_tail_padding : public A, public B, public C, public D {
+ };
+
+ SA(0, sizeof(might_use_tail_padding) == 32);
+}
+
+namespace test11 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct A {
+ pod_in_11_only a;
+ char apad;
+ };
+
+ struct B {
+ char b_pre;
+ pod_in_11_only b;
+ char bpad;
+ };
+
+ struct C {
+ char c_pre;
+ pod_in_11_only c;
+ char cpad;
+ };
+
+ struct D {
+ char d_pre;
+ pod_in_11_only d;
+ char dpad;
+ };
+
+ struct might_use_tail_padding : public A, public B, public C, public D {
+ char m;
+ };
+
+ SA(0, sizeof(might_use_tail_padding) == 88);
+}
+
+namespace test12 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct A {
+ pod_in_11_only a __attribute__((aligned(128)));
+ };
+
+ struct B {
+ char bpad;
+ };
+
+ struct C {
+ char cpad;
+ };
+
+ struct D {
+ char dpad;
+ };
+
+ struct might_use_tail_padding : public A, public B, public C, public D {
+ char m;
+ };
+ SA(0, sizeof(might_use_tail_padding) == 128);
+}
+
+namespace test13 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct A {
+ pod_in_11_only a;
+ char apad;
+ };
+
+ struct B {
+ };
+
+ struct C {
+ char c_pre;
+ pod_in_11_only c;
+ char cpad;
+ };
+
+ struct D {
+ };
+
+ struct might_use_tail_padding : public A, public B, public C, public D {
+ char m;
+ };
+ SA(0, sizeof(might_use_tail_padding) == 40);
+}
+
+namespace test14 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct A {
+ pod_in_11_only a;
+ char apad;
+ };
+
+ struct might_use_tail_padding : public A {
+ struct {
+ int : 0;
+ } x;
+ };
+ SA(0, sizeof(might_use_tail_padding) == 16);
+}
+
+namespace test15 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct A {
+ pod_in_11_only a;
+ char apad;
+ };
+
+ struct might_use_tail_padding : public A {
+ struct {
+ char a:1;
+ char b:2;
+ char c:2;
+ char d:2;
+ char e:1;
+ } x;
+ };
+ SA(0, sizeof(might_use_tail_padding) == 16);
+}
+
+namespace test16 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct A {
+ pod_in_11_only a;
+ char apad;
+ };
+
+ struct B {
+ char bpod;
+ pod_in_11_only b;
+ char bpad;
+ };
+
+ struct C : public A, public B {
+ };
+
+ struct D : public C {
+ };
+
+ struct might_use_tail_padding : public D {
+ char m;
+ };
+ SA(0, sizeof(might_use_tail_padding) == 40);
+}
+
+namespace test17 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct A {
+ pod_in_11_only a __attribute__((aligned(512)));
+ };
+
+ struct B {
+ char bpad;
+ pod_in_11_only foo;
+ char btail;
+ };
+
+ struct C {
+ char cpad;
+ };
+
+ struct D {
+ char dpad;
+ };
+
+ struct might_use_tail_padding : public A, public B, public C, public D {
+ char a;
+ };
+ SA(0, sizeof(might_use_tail_padding) == 512);
+}
+
+namespace test18 {
+ struct pod_in_11_only {
+ private:
+ long long x;
+ };
+
+ struct A {
+ pod_in_11_only a;
+ char apad;
+ };
+
+ struct B {
+ char bpod;
+ pod_in_11_only b;
+ char bpad;
+ };
+
+ struct A1 {
+ pod_in_11_only a;
+ char apad;
+ };
+
+ struct B1 {
+ char bpod;
+ pod_in_11_only b;
+ char bpad;
+ };
+
+ struct C : public A, public B {
+ };
+
+ struct D : public A1, public B1 {
+ };
+
+ struct E : public D, public C {
+ };
+
+ struct F : public E {
+ };
+
+ struct might_use_tail_padding : public F {
+ char m;
+ };
+ SA(0, sizeof(might_use_tail_padding) == 80);
+}
+} // namespace PR16537
diff --git a/test/SemaCXX/class.cpp b/test/SemaCXX/class.cpp
index 972a79bb6090..636f584cf625 100644
--- a/test/SemaCXX/class.cpp
+++ b/test/SemaCXX/class.cpp
@@ -126,12 +126,8 @@ struct S
// Don't crash on this bogus code.
namespace pr6629 {
- // TODO: most of these errors are spurious
template<class T1, class T2> struct foo :
- bogus<foo<T1,T2> > // expected-error {{unknown template name 'bogus'}} \
- // BOGUS expected-error {{expected '{' after base class list}} \
- // BOGUS expected-error {{expected ';' after struct}} \
- // BOGUS expected-error {{expected unqualified-id}}
+ bogus<foo<T1,T2> > // expected-error {{unknown template name 'bogus'}}
{ };
template<> struct foo<unknown,unknown> { // expected-error {{undeclared identifier 'unknown'}}
diff --git a/test/SemaCXX/compare.cpp b/test/SemaCXX/compare.cpp
index feb1ccb9a20d..8214f7899ecf 100644
--- a/test/SemaCXX/compare.cpp
+++ b/test/SemaCXX/compare.cpp
@@ -355,3 +355,70 @@ void test9(int x) {
};
(void)((E)x == 1);
}
+
+namespace templates {
+ template<class T> T max();
+
+ template<> constexpr int max<int>() { return 2147483647; };
+
+ template<typename T>
+ bool less_than_max(short num, T value) {
+ const T vmax = max<T>();
+ return (vmax >= num); // no warning
+ }
+
+ template<typename T>
+ bool less_than_max(short num) {
+ // This should trigger one warning on the template pattern, and not a
+ // warning per specialization.
+ return num < max<int>(); // expected-warning{{comparison of constant 2147483647 with expression of type 'short' is always true}}
+ }
+
+ void test10(short num, int x) {
+ less_than_max(num, x);
+ less_than_max<int>(num);
+ less_than_max<long>(num);
+ less_than_max<short>(num);
+ }
+
+ template<typename T>
+ inline bool less_than_zero(T num, T value) {
+ return num < 0; // no warning
+ }
+
+ template<typename T>
+ inline bool less_than_zero(unsigned num) {
+ // This should trigger one warning on the template pattern, and not a
+ // warning per specialization.
+ return num < 0; // expected-warning{{comparison of unsigned expression < 0 is always false}}
+ }
+
+ void test11(unsigned num) {
+ less_than_zero(num, num);
+ less_than_zero<int>(num);
+ less_than_zero<long>(num);
+ less_than_zero<short>(num);
+ }
+
+ template<unsigned n> bool compare(unsigned k) { return k >= n; }
+
+ void test12() {
+ compare<0>(42);
+ }
+
+ struct A { static int x; };
+ struct B { static int x; };
+ typedef A otherA;
+
+ template <typename T>
+ void testx() {
+ if (A::x == T::x && // no warning
+ A::x == otherA::x) // expected-warning{{self-comparison always evaluates to true}}
+ return;
+ }
+
+ void test13() {
+ testx<A>();
+ testx<B>();
+ }
+}
diff --git a/test/SemaCXX/complex-overload.cpp b/test/SemaCXX/complex-overload.cpp
index 719a850dbf77..1381968751af 100644
--- a/test/SemaCXX/complex-overload.cpp
+++ b/test/SemaCXX/complex-overload.cpp
@@ -42,9 +42,15 @@ void test_promote_or_convert2(float _Complex fc) {
int *cp = promote_or_convert2(fc);
}
-char *promote_or_convert3(int _Complex);
-int *promote_or_convert3(long _Complex);
+char *promote_or_convert3(int _Complex); // expected-note {{candidate}}
+int *promote_or_convert3(long _Complex); // expected-note {{candidate}}
void test_promote_or_convert3(short _Complex sc) {
- char *cp = promote_or_convert3(sc);
+ char *cp1 = promote_or_convert3(sc);
+ char *cp2 = promote_or_convert3(1i);
+ int *cp3 = promote_or_convert3(1il);
+ int *cp4 = promote_or_convert3(1ill); // expected-error {{ambiguous}}
}
+
+char &convert4(short _Complex);
+char &test_convert4 = convert4(1i);
diff --git a/test/SemaCXX/compound-literal.cpp b/test/SemaCXX/compound-literal.cpp
index 595747e40ce6..3fc61505dfee 100644
--- a/test/SemaCXX/compound-literal.cpp
+++ b/test/SemaCXX/compound-literal.cpp
@@ -76,3 +76,13 @@ namespace brace_initializers {
(void)(PrivateDtor){1, 2}; // expected-error {{temporary of type 'brace_initializers::PrivateDtor' has private destructor}}
}
}
+
+// This doesn't necessarily need to be an error, but CodeGen can't handle it
+// at the moment.
+int PR17415 = (int){PR17415}; // expected-error {{initializer element is not a compile-time constant}}
+
+// Make sure we accept this. (Not sure if we actually should... but we do
+// at the moment.)
+template<unsigned> struct Value { };
+template<typename T>
+int &check_narrowed(Value<sizeof((T){1.1})>);
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp
index 692aaefc9d54..5abee4a3c4f8 100644
--- a/test/SemaCXX/conditional-expr.cpp
+++ b/test/SemaCXX/conditional-expr.cpp
@@ -81,6 +81,8 @@ void test()
i1 ? test() : test();
i1 = i1 ? throw 0 : 0;
i1 = i1 ? 0 : throw 0;
+ i1 = i1 ? (throw 0) : 0;
+ i1 = i1 ? 0 : (throw 0);
i1 ? 0 : test(); // expected-error {{right operand to ? is void, but left operand is of type 'int'}}
i1 ? test() : 0; // expected-error {{left operand to ? is void, but right operand is of type 'int'}}
(i1 ? throw 0 : i1) = 0; // expected-error {{expression is not assignable}}
diff --git a/test/SemaCXX/const-cast.cpp b/test/SemaCXX/const-cast.cpp
index 62851f81280f..1fe350d1977a 100644
--- a/test/SemaCXX/const-cast.cpp
+++ b/test/SemaCXX/const-cast.cpp
@@ -38,6 +38,7 @@ char ***good_const_cast_test(ccvpcvpp var)
f *fpp = const_cast<f*>(&fp);
int const A::* const A::*icapcap = 0;
int A::* A::* iapap = const_cast<int A::* A::*>(icapcap);
+ (void)const_cast<A&&>(A()); // expected-warning {{C++11}}
return var4;
}
@@ -60,5 +61,6 @@ short *bad_const_cast_test(char const *volatile *const volatile *var)
f fp2 = const_cast<f>(fp1); // expected-error {{const_cast to 'f' (aka 'int (*)(int)'), which is not a reference, pointer-to-object, or pointer-to-data-member}}
void (A::*mfn)() = 0;
(void)const_cast<void (A::*)()>(mfn); // expected-error {{const_cast to 'void (A::*)()', which is not a reference, pointer-to-object, or pointer-to-data-member}}
+ (void)const_cast<int&&>(0); // expected-error {{const_cast from rvalue to reference type 'int &&'}} expected-warning {{C++11}}
return **var3;
}
diff --git a/test/SemaCXX/constant-expression-cxx11.cpp b/test/SemaCXX/constant-expression-cxx11.cpp
index 09a9cb5dd8db..6724be7c8204 100644
--- a/test/SemaCXX/constant-expression-cxx11.cpp
+++ b/test/SemaCXX/constant-expression-cxx11.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-linux -Wno-string-plus-int -fsyntax-only -fcxx-exceptions -verify -std=c++11 -pedantic %s -Wno-comment
+// RUN: %clang_cc1 -triple i686-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -fsyntax-only -fcxx-exceptions -verify -std=c++11 -pedantic %s -Wno-comment
namespace StaticAssertFoldTest {
@@ -79,6 +79,11 @@ constexpr int **n6 = const_cast<int**>(&n3);
constexpr int n7 = **n5;
constexpr int n8 = **n6;
+// const_cast from prvalue to xvalue.
+struct A { int n; };
+constexpr int n9 = (const_cast<A&&>(A{123})).n;
+static_assert(n9 == 123, "");
+
}
namespace TemplateArgumentConversion {
@@ -339,6 +344,46 @@ static_assert(!same(4, 4), "");
static_assert(same(n, n), "");
static_assert(sameTemporary(9), "");
+struct A { int &&r; };
+struct B { A &&a1; A &&a2; };
+
+constexpr B b1 { { 1 }, { 2 } }; // expected-note {{temporary created here}}
+static_assert(&b1.a1 != &b1.a2, "");
+static_assert(&b1.a1.r != &b1.a2.r, ""); // expected-error {{constant expression}} expected-note {{outside the expression that created the temporary}}
+
+constexpr B &&b2 { { 3 }, { 4 } }; // expected-note {{temporary created here}}
+static_assert(&b1 != &b2, "");
+static_assert(&b1.a1 != &b2.a1, ""); // expected-error {{constant expression}} expected-note {{outside the expression that created the temporary}}
+
+constexpr thread_local B b3 { { 1 }, { 2 } }; // expected-error {{constant expression}} expected-note {{reference to temporary}} expected-note {{here}}
+void foo() {
+ constexpr static B b1 { { 1 }, { 2 } }; // ok
+ constexpr thread_local B b2 { { 1 }, { 2 } }; // expected-error {{constant expression}} expected-note {{reference to temporary}} expected-note {{here}}
+ constexpr B b3 { { 1 }, { 2 } }; // expected-error {{constant expression}} expected-note {{reference to temporary}} expected-note {{here}}
+}
+
+constexpr B &&b4 = ((1, 2), 3, 4, B { {10}, {{20}} }); // expected-warning 4{{unused}}
+static_assert(&b4 != &b2, "");
+
+// Proposed DR: copy-elision doesn't trigger lifetime extension.
+constexpr B b5 = B{ {0}, {0} }; // expected-error {{constant expression}} expected-note {{reference to temporary}} expected-note {{here}}
+
+namespace NestedNonStatic {
+ // Proposed DR: for a reference constant expression to refer to a static
+ // storage duration temporary, that temporary must itself be initialized
+ // by a constant expression (a core constant expression is not enough).
+ struct A { int &&r; };
+ struct B { A &&a; };
+ constexpr B a = { A{0} }; // ok
+ constexpr B b = { A(A{0}) }; // expected-error {{constant expression}} expected-note {{reference to temporary}} expected-note {{here}}
+}
+
+namespace FakeInitList {
+ struct init_list_3_ints { const int (&x)[3]; };
+ struct init_list_2_init_list_3_ints { const init_list_3_ints (&x)[2]; };
+ constexpr init_list_2_init_list_3_ints ils = { { { { 1, 2, 3 } }, { { 4, 5, 6 } } } };
+}
+
}
constexpr int strcmp_ce(const char *p, const char *q) {
@@ -572,7 +617,7 @@ struct E {
constexpr E() : p(&p) {}
void *p;
};
-constexpr const E &e1 = E(); // expected-error {{constant expression}} expected-note {{reference to temporary is not a constant expression}} expected-note {{temporary created here}}
+constexpr const E &e1 = E();
// This is a constant expression if we elide the copy constructor call, and
// is not a constant expression if we don't! But we do, so it is.
constexpr E e2 = E();
@@ -729,15 +774,22 @@ static_assert(&ok2 == pok2, "");
static_assert((Base2*)(Derived*)(Base*)pb1 == pok2, "");
static_assert((Derived*)(Base*)pb1 == (Derived*)pok2, "");
-constexpr Base *nullB = 42 - 6 * 7; // expected-warning {{expression which evaluates to zero treated as a null pointer constant of type 'Class::Base *const'}}
+// Core issue 903: we do not perform constant evaluation when checking for a
+// null pointer in C++11. Just check for an integer literal with value 0.
+constexpr Base *nullB = 42 - 6 * 7; // expected-error {{cannot initialize a variable of type 'Class::Base *const' with an rvalue of type 'int'}}
+constexpr Base *nullB1 = 0;
static_assert((Bottom*)nullB == 0, "");
static_assert((Derived*)nullB == 0, "");
static_assert((void*)(Bottom*)nullB == (void*)(Derived*)nullB, "");
-Base * nullB2 = '\0'; // expected-warning {{expression which evaluates to zero treated as a null pointer constant of type 'Class::Base *'}}
-Base * nullB3 = (0);
-// We suppress the warning in unevaluated contexts to workaround some gtest
-// behavior. Once this becomes an error this isn't a problem anymore.
-static_assert(nullB == (1 - 1), "");
+Base *nullB2 = '\0'; // expected-error {{cannot initialize a variable of type 'Class::Base *' with an rvalue of type 'char'}}
+Base *nullB3 = (0);
+Base *nullB4 = false; // expected-error {{cannot initialize a variable of type 'Class::Base *' with an rvalue of type 'bool'}}
+Base *nullB5 = ((0ULL));
+Base *nullB6 = 0.; // expected-error {{cannot initialize a variable of type 'Class::Base *' with an rvalue of type 'double'}}
+enum Null { kNull };
+Base *nullB7 = kNull; // expected-error {{cannot initialize a variable of type 'Class::Base *' with an rvalue of type 'Class::Null'}}
+static_assert(nullB1 == (1 - 1), ""); // expected-error {{comparison between pointer and integer}}
+
namespace ConversionOperators {
@@ -778,21 +830,26 @@ namespace Temporaries {
struct S {
constexpr S() {}
constexpr int f() const;
+ constexpr int g() const;
};
struct T : S {
constexpr T(int n) : S(), n(n) {}
int n;
};
constexpr int S::f() const {
- // 'this' must be the postfix-expression in a class member access expression,
- // so we can't just use
- // return static_cast<T*>(this)->n;
- return this->*(int(S::*))&T::n;
+ return static_cast<const T*>(this)->n; // expected-note {{cannot cast}}
+}
+constexpr int S::g() const {
+ // FIXME: Better diagnostic for this.
+ return this->*(int(S::*))&T::n; // expected-note {{subexpression}}
}
// The T temporary is implicitly cast to an S subobject, but we can recover the
// T full-object via a base-to-derived cast, or a derived-to-base-casted member
// pointer.
+static_assert(S().f(), ""); // expected-error {{constant expression}} expected-note {{in call to '&Temporaries::S()->f()'}}
+static_assert(S().g(), ""); // expected-error {{constant expression}} expected-note {{in call to '&Temporaries::S()->g()'}}
static_assert(T(3).f() == 3, "");
+static_assert(T(4).g() == 4, "");
constexpr int f(const S &s) {
return static_cast<const T&>(s).n;
@@ -1138,6 +1195,31 @@ namespace ComplexConstexpr {
static_assert(&__imag test6 == &__real test6 + 1, "");
}
+// _Atomic(T) is exactly like T for the purposes of constant expression
+// evaluation..
+namespace Atomic {
+ constexpr _Atomic int n = 3;
+
+ struct S { _Atomic(double) d; };
+ constexpr S s = { 0.5 };
+ constexpr double d1 = s.d;
+ constexpr double d2 = n;
+ constexpr _Atomic double d3 = n;
+
+ constexpr _Atomic(int) n2 = d3;
+ static_assert(d1 == 0.5, "");
+ static_assert(d3 == 3.0, "");
+
+ namespace PR16056 {
+ struct TestVar {
+ _Atomic(int) value;
+ constexpr TestVar(int value) : value(value) {}
+ };
+ constexpr TestVar testVar{-1};
+ static_assert(testVar.value == -1, "");
+ }
+}
+
namespace InstantiateCaseStmt {
template<int x> constexpr int f() { return x; }
template<int x> int g(int c) { switch(c) { case f<x>(): return 1; } return 0; }
@@ -1252,8 +1334,23 @@ struct Wrap {
constexpr const Wrap &g(const Wrap &w) { return w; }
constexpr int k2 = g({0}).value; // ok
-constexpr const int &i = 0; // expected-error {{constant expression}} expected-note {{temporary}} expected-note 2{{here}}
-constexpr const int j = i; // expected-error {{constant expression}} expected-note {{initializer of 'i' is not a constant expression}}
+// The temporary here has static storage duration, so we can bind a constexpr
+// reference to it.
+constexpr const int &i = 1;
+constexpr const int j = i;
+static_assert(j == 1, "");
+
+// The temporary here is not const, so it can't be read outside the expression
+// in which it was created (per the C++14 rules, which we use to avoid a C++11
+// defect).
+constexpr int &&k = 1; // expected-note {{temporary created here}}
+constexpr const int l = k; // expected-error {{constant expression}} expected-note {{read of temporary}}
+
+void f() {
+ // The temporary here has automatic storage duration, so we can't bind a
+ // constexpr reference to it.
+ constexpr const int &i = 1; // expected-error {{constant expression}} expected-note 2{{temporary}}
+}
}
@@ -1503,3 +1600,266 @@ namespace PR15884 {
// expected-note@-3 {{pointer to temporary is not a constant expression}}
// expected-note@-4 {{temporary created here}}
}
+
+namespace AfterError {
+ // FIXME: Suppress the 'no return statements' diagnostic if the body is invalid.
+ constexpr int error() { // expected-error {{no return statement}}
+ return foobar; // expected-error {{undeclared identifier}}
+ }
+ constexpr int k = error(); // expected-error {{must be initialized by a constant expression}}
+}
+
+namespace std {
+ typedef decltype(sizeof(int)) size_t;
+
+ template <class _E>
+ class initializer_list
+ {
+ const _E* __begin_;
+ size_t __size_;
+
+ constexpr initializer_list(const _E* __b, size_t __s)
+ : __begin_(__b),
+ __size_(__s)
+ {}
+
+ public:
+ typedef _E value_type;
+ typedef const _E& reference;
+ typedef const _E& const_reference;
+ typedef size_t size_type;
+
+ typedef const _E* iterator;
+ typedef const _E* const_iterator;
+
+ constexpr initializer_list() : __begin_(nullptr), __size_(0) {}
+
+ constexpr size_t size() const {return __size_;}
+ constexpr const _E* begin() const {return __begin_;}
+ constexpr const _E* end() const {return __begin_ + __size_;}
+ };
+}
+
+namespace InitializerList {
+ constexpr int sum(const int *b, const int *e) {
+ return b != e ? *b + sum(b+1, e) : 0;
+ }
+ constexpr int sum(std::initializer_list<int> ints) {
+ return sum(ints.begin(), ints.end());
+ }
+ static_assert(sum({1, 2, 3, 4, 5}) == 15, "");
+}
+
+namespace StmtExpr {
+ struct A { int k; };
+ void f() {
+ static_assert(({ const int x = 5; x * 3; }) == 15, ""); // expected-warning {{extension}}
+ constexpr auto a = ({ A(); }); // expected-warning {{extension}}
+ }
+ constexpr int g(int k) {
+ return ({ // expected-warning {{extension}}
+ const int x = k;
+ x * x;
+ });
+ }
+ static_assert(g(123) == 15129, "");
+ constexpr int h() { // expected-error {{never produces a constant}}
+ return ({ // expected-warning {{extension}}
+ return 0; // expected-note {{not supported}}
+ 1;
+ });
+ }
+}
+
+namespace VirtualFromBase {
+ struct S1 {
+ virtual int f() const;
+ };
+ struct S2 {
+ virtual int f();
+ };
+ template <typename T> struct X : T {
+ constexpr X() {}
+ double d = 0.0;
+ constexpr int f() { return sizeof(T); } // expected-warning {{will not be implicitly 'const' in C++1y}}
+ };
+
+ // Virtual f(), not OK.
+ constexpr X<X<S1>> xxs1;
+ constexpr X<S1> *p = const_cast<X<X<S1>>*>(&xxs1);
+ static_assert(p->f() == sizeof(X<S1>), ""); // expected-error {{constant expression}} expected-note {{virtual function call}}
+
+ // Non-virtual f(), OK.
+ constexpr X<X<S2>> xxs2;
+ constexpr X<S2> *q = const_cast<X<X<S2>>*>(&xxs2);
+ static_assert(q->f() == sizeof(S2), "");
+}
+
+namespace ConstexprConstructorRecovery {
+ class X {
+ public:
+ enum E : short {
+ headers = 0x1,
+ middlefile = 0x2,
+ choices = 0x4
+ };
+ constexpr X() noexcept {};
+ protected:
+ E val{0}; // expected-error {{cannot initialize a member subobject of type 'ConstexprConstructorRecovery::X::E' with an rvalue of type 'int'}}
+ };
+ constexpr X x{};
+}
+
+namespace Lifetime {
+ void f() {
+ constexpr int &n = n; // expected-error {{constant expression}} expected-note {{use of reference outside its lifetime}} expected-warning {{not yet bound to a value}}
+ constexpr int m = m; // expected-error {{constant expression}} expected-note {{read of object outside its lifetime}}
+ }
+
+ constexpr int &get(int &&n) { return n; }
+ struct S {
+ int &&r; // expected-note 2{{declared here}}
+ int &s;
+ int t;
+ constexpr S() : r(0), s(get(0)), t(r) {} // expected-warning {{temporary}}
+ constexpr S(int) : r(0), s(get(0)), t(s) {} // expected-warning {{temporary}} expected-note {{read of object outside its lifetime}}
+ };
+ constexpr int k1 = S().t; // ok, int is lifetime-extended to end of constructor
+ constexpr int k2 = S(0).t; // expected-error {{constant expression}} expected-note {{in call}}
+}
+
+namespace Bitfields {
+ struct A {
+ bool b : 1;
+ unsigned u : 5;
+ int n : 5;
+ bool b2 : 3;
+ unsigned u2 : 74; // expected-warning {{exceeds the size of its type}}
+ int n2 : 81; // expected-warning {{exceeds the size of its type}}
+ };
+
+ constexpr A a = { false, 33, 31, false, 0xffffffff, 0x7fffffff }; // expected-warning 2{{truncation}}
+ static_assert(a.b == 0 && a.u == 1 && a.n == -1 && a.b2 == 0 &&
+ a.u2 + 1 == 0 && a.n2 == 0x7fffffff,
+ "bad truncation of bitfield values");
+
+ struct B {
+ int n : 3;
+ constexpr B(int k) : n(k) {}
+ };
+ static_assert(B(3).n == 3, "");
+ static_assert(B(4).n == -4, "");
+ static_assert(B(7).n == -1, "");
+ static_assert(B(8).n == 0, "");
+ static_assert(B(-1).n == -1, "");
+ static_assert(B(-8889).n == -1, "");
+
+ namespace PR16755 {
+ struct X {
+ int x : 1;
+ constexpr static int f(int x) {
+ return X{x}.x;
+ }
+ };
+ static_assert(X::f(3) == -1, "3 should truncate to -1");
+ }
+}
+
+namespace ZeroSizeTypes {
+ constexpr int (*p1)[0] = 0, (*p2)[0] = 0;
+ constexpr int k = p2 - p1;
+ // expected-error@-1 {{constexpr variable 'k' must be initialized by a constant expression}}
+ // expected-note@-2 {{subtraction of pointers to type 'int [0]' of zero size}}
+
+ int arr[5][0];
+ constexpr int f() { // expected-error {{never produces a constant expression}}
+ return &arr[3] - &arr[0]; // expected-note {{subtraction of pointers to type 'int [0]' of zero size}}
+ }
+}
+
+namespace BadDefaultInit {
+ template<int N> struct X { static const int n = N; };
+
+ struct A { // expected-note {{subexpression}}
+ int k = X<A().k>::n; // expected-error {{defaulted default constructor of 'A' cannot be used}} expected-error {{not a constant expression}} expected-note {{in call to 'A()'}}
+ };
+
+ // FIXME: The "constexpr constructor must initialize all members" diagnostic
+ // here is bogus (we discard the k(k) initializer because the parameter 'k'
+ // has been marked invalid).
+ struct B { // expected-note 2{{candidate}}
+ constexpr B( // expected-error {{must initialize all members}} expected-note {{candidate}}
+ int k = X<B().k>::n) : // expected-error {{no matching constructor}}
+ k(k) {}
+ int k; // expected-note {{not initialized}}
+ };
+}
+
+namespace NeverConstantTwoWays {
+ // If we see something non-constant but foldable followed by something
+ // non-constant and not foldable, we want the first diagnostic, not the
+ // second.
+ constexpr int f(int n) { // expected-error {{never produces a constant expression}}
+ return (int *)(long)&n == &n ? // expected-note {{reinterpret_cast}}
+ 1 / 0 : // expected-warning {{division by zero}}
+ 0;
+ }
+
+ // FIXME: We should diagnose the cast to long here, not the division by zero.
+ constexpr int n = // expected-error {{must be initialized by a constant expression}}
+ (int *)(long)&n == &n ?
+ 1 / 0 : // expected-warning {{division by zero}} expected-note {{division by zero}}
+ 0;
+}
+
+namespace PR17800 {
+ struct A {
+ constexpr int operator()() const { return 0; }
+ };
+ template <typename ...T> constexpr int sink(T ...) {
+ return 0;
+ }
+ template <int ...N> constexpr int run() {
+ return sink(A()() + N ...);
+ }
+ constexpr int k = run<1, 2, 3>();
+}
+
+namespace BuiltinStrlen {
+ constexpr const char *a = "foo\0quux";
+ constexpr char b[] = "foo\0quux";
+ constexpr int f() { return 'u'; }
+ constexpr char c[] = { 'f', 'o', 'o', 0, 'q', f(), 'u', 'x', 0 };
+
+ static_assert(__builtin_strlen("foo") == 3, "");
+ static_assert(__builtin_strlen("foo\0quux") == 3, "");
+ static_assert(__builtin_strlen("foo\0quux" + 4) == 4, "");
+
+ constexpr bool check(const char *p) {
+ return __builtin_strlen(p) == 3 &&
+ __builtin_strlen(p + 1) == 2 &&
+ __builtin_strlen(p + 2) == 1 &&
+ __builtin_strlen(p + 3) == 0 &&
+ __builtin_strlen(p + 4) == 4 &&
+ __builtin_strlen(p + 5) == 3 &&
+ __builtin_strlen(p + 6) == 2 &&
+ __builtin_strlen(p + 7) == 1 &&
+ __builtin_strlen(p + 8) == 0;
+ }
+
+ static_assert(check(a), "");
+ static_assert(check(b), "");
+ static_assert(check(c), "");
+
+ constexpr int over1 = __builtin_strlen(a + 9); // expected-error {{constant expression}} expected-note {{one-past-the-end}}
+ constexpr int over2 = __builtin_strlen(b + 9); // expected-error {{constant expression}} expected-note {{one-past-the-end}}
+ constexpr int over3 = __builtin_strlen(c + 9); // expected-error {{constant expression}} expected-note {{one-past-the-end}}
+
+ constexpr int under1 = __builtin_strlen(a - 1); // expected-error {{constant expression}} expected-note {{cannot refer to element -1}}
+ constexpr int under2 = __builtin_strlen(b - 1); // expected-error {{constant expression}} expected-note {{cannot refer to element -1}}
+ constexpr int under3 = __builtin_strlen(c - 1); // expected-error {{constant expression}} expected-note {{cannot refer to element -1}}
+
+ // FIXME: The diagnostic here could be better.
+ constexpr char d[] = { 'f', 'o', 'o' }; // no nul terminator.
+ constexpr int bad = __builtin_strlen(d); // expected-error {{constant expression}} expected-note {{one-past-the-end}}
+}
diff --git a/test/SemaCXX/constant-expression-cxx1y.cpp b/test/SemaCXX/constant-expression-cxx1y.cpp
index 60ec82062de5..521526ddba44 100644
--- a/test/SemaCXX/constant-expression-cxx1y.cpp
+++ b/test/SemaCXX/constant-expression-cxx1y.cpp
@@ -128,10 +128,10 @@ constexpr int namespace_alias() {
namespace assign {
constexpr int a = 0;
const int b = 0;
- int c = 0; // expected-note 2{{here}}
+ int c = 0; // expected-note {{here}}
constexpr void set(const int &a, int b) {
- const_cast<int&>(a) = b; // expected-note 2{{constant expression cannot modify an object that is visible outside that expression}}
+ const_cast<int&>(a) = b; // expected-note 3{{constant expression cannot modify an object that is visible outside that expression}}
}
constexpr int wrap(int a, int b) {
set(a, b);
@@ -140,7 +140,7 @@ namespace assign {
static_assert((set(a, 1), a) == 1, ""); // expected-error {{constant expression}} expected-note {{in call to 'set(a, 1)'}}
static_assert((set(b, 1), b) == 1, ""); // expected-error {{constant expression}} expected-note {{in call to 'set(b, 1)'}}
- static_assert((set(c, 1), c) == 1, ""); // expected-error {{constant expression}} expected-note {{read of non-const variable 'c'}}
+ static_assert((set(c, 1), c) == 1, ""); // expected-error {{constant expression}} expected-note {{in call to 'set(c, 1)'}}
static_assert(wrap(a, 1) == 1, "");
static_assert(wrap(b, 1) == 1, "");
@@ -250,11 +250,12 @@ namespace lifetime {
}
namespace const_modify {
- constexpr int modify(int &n) { return n = 1; } // expected-note {{modification of object of const-qualified type 'const int'}}
+ constexpr int modify(int &n) { return n = 1; } // expected-note 2 {{modification of object of const-qualified type 'const int'}}
constexpr int test1() { int k = 0; return modify(k); }
- constexpr int test2() { const int k = 0; return modify(const_cast<int&>(k)); } // expected-note {{in call}}
+ constexpr int test2() { const int k = 0; return modify(const_cast<int&>(k)); } // expected-note 2 {{in call}}
static_assert(test1() == 1, "");
static_assert(test2() == 1, ""); // expected-error {{constant expression}} expected-note {{in call}}
+ constexpr int i = test2(); // expected-error {{constant expression}} expected-note {{in call}}
}
namespace null {
@@ -334,6 +335,99 @@ namespace incdec {
static_assert(incr(0) == 101, "");
}
+namespace compound_assign {
+ constexpr bool test_int() {
+ int a = 3;
+ a += 6;
+ if (a != 9) return false;
+ a -= 2;
+ if (a != 7) return false;
+ a *= 3;
+ if (a != 21) return false;
+ if (&(a /= 10) != &a) return false;
+ if (a != 2) return false;
+ a <<= 3;
+ if (a != 16) return false;
+ a %= 6;
+ if (a != 4) return false;
+ a >>= 1;
+ if (a != 2) return false;
+ a ^= 10;
+ if (a != 8) return false;
+ a |= 5;
+ if (a != 13) return false;
+ a &= 14;
+ if (a != 12) return false;
+ return true;
+ }
+ static_assert(test_int(), "");
+
+ constexpr bool test_float() {
+ float f = 123.;
+ f *= 2;
+ if (f != 246.) return false;
+ if ((f -= 0.5) != 245.5) return false;
+ if (f != 245.5) return false;
+ f /= 0.5;
+ if (f != 491.) return false;
+ f += -40;
+ if (f != 451.) return false;
+ return true;
+ }
+ static_assert(test_float(), "");
+
+ constexpr bool test_ptr() {
+ int arr[123] = {};
+ int *p = arr;
+ if ((p += 4) != &arr[4]) return false;
+ if (p != &arr[4]) return false;
+ p += -1;
+ if (p != &arr[3]) return false;
+ if ((p -= -10) != &arr[13]) return false;
+ if (p != &arr[13]) return false;
+ p -= 11;
+ if (p != &arr[2]) return false;
+ return true;
+ }
+ static_assert(test_ptr(), "");
+
+ template<typename T>
+ constexpr bool test_overflow() {
+ T a = 1;
+ while (a != a / 2)
+ a *= 2; // expected-note {{value 2147483648 is outside the range}} expected-note {{ 9223372036854775808 }} expected-note {{floating point arithmetic produces an infinity}}
+ return true;
+ }
+
+ static_assert(test_overflow<int>(), ""); // expected-error {{constant}} expected-note {{call}}
+ static_assert(test_overflow<unsigned>(), ""); // ok, unsigned overflow is defined
+ static_assert(test_overflow<short>(), ""); // ok, short is promoted to int before multiplication
+ static_assert(test_overflow<unsigned short>(), ""); // ok
+ static_assert(test_overflow<unsigned long long>(), ""); // ok
+ static_assert(test_overflow<long long>(), ""); // expected-error {{constant}} expected-note {{call}}
+ static_assert(test_overflow<float>(), ""); // expected-error {{constant}} expected-note {{call}}
+
+ constexpr short test_promotion(short k) {
+ short s = k;
+ s *= s;
+ return s;
+ }
+ static_assert(test_promotion(100) == 10000, "");
+ static_assert(test_promotion(200) == -25536, "");
+ static_assert(test_promotion(256) == 0, "");
+
+ constexpr const char *test_bounds(const char *p, int o) {
+ return p += o; // expected-note {{element 5 of}} expected-note {{element -1 of}} expected-note {{element 1000 of}}
+ }
+ static_assert(test_bounds("foo", 0)[0] == 'f', "");
+ static_assert(test_bounds("foo", 3)[0] == 0, "");
+ static_assert(test_bounds("foo", 4)[-3] == 'o', "");
+ static_assert(test_bounds("foo" + 4, -4)[0] == 'f', "");
+ static_assert(test_bounds("foo", 5) != 0, ""); // expected-error {{constant}} expected-note {{call}}
+ static_assert(test_bounds("foo", -1) != 0, ""); // expected-error {{constant}} expected-note {{call}}
+ static_assert(test_bounds("foo", 1000) != 0, ""); // expected-error {{constant}} expected-note {{call}}
+}
+
namespace loops {
constexpr int fib_loop(int a) {
int f_k = 0, f_k_plus_one = 1;
@@ -407,7 +501,7 @@ namespace loops {
int arr[] = { 1, 2, 3, 4, 5 };
int sum = 0;
for (int x : arr)
- sum = sum + x;
+ sum += x;
return sum;
}
static_assert(range_for() == 15, "");
@@ -450,10 +544,370 @@ namespace loops {
array<int, 5> arr { 1, 2, 3, 4, 5 };
int sum = 0;
for (int k : arr) {
- sum = sum + k;
+ sum += k;
if (sum > 8) break;
}
return sum;
}
static_assert(range_for_2() == 10, "");
}
+
+namespace assignment_op {
+ struct A {
+ constexpr A() : n(5) {}
+ int n;
+ struct B {
+ int k = 1;
+ union U {
+ constexpr U() : y(4) {}
+ int x;
+ int y;
+ } u;
+ } b;
+ };
+ constexpr bool testA() {
+ A a, b;
+ a.n = 7;
+ a.b.u.y = 5;
+ b = a;
+ return b.n == 7 && b.b.u.y == 5 && b.b.k == 1;
+ }
+ static_assert(testA(), "");
+
+ struct B {
+ bool assigned = false;
+ constexpr B &operator=(const B&) {
+ assigned = true;
+ return *this;
+ }
+ };
+ struct C : B {
+ B b;
+ int n = 5;
+ };
+ constexpr bool testC() {
+ C c, d;
+ c.n = 7;
+ d = c;
+ c.n = 3;
+ return d.n == 7 && d.assigned && d.b.assigned;
+ }
+ static_assert(testC(), "");
+}
+
+namespace switch_stmt {
+ constexpr int f(char k) {
+ bool b = false;
+ int z = 6;
+ switch (k) {
+ return -1;
+ case 0:
+ if (false) {
+ case 1:
+ z = 1;
+ for (; b;) {
+ return 5;
+ while (0)
+ case 2: return 2;
+ case 7: z = 7;
+ do case 6: {
+ return z;
+ if (false)
+ case 3: return 3;
+ case 4: z = 4;
+ } while (1);
+ case 5: b = true;
+ case 9: z = 9;
+ }
+ return z;
+ } else if (false) case 8: z = 8;
+ else if (false) {
+ case 10:
+ z = -10;
+ break;
+ }
+ else z = 0;
+ return z;
+ default:
+ return -1;
+ }
+ return -z;
+ }
+ static_assert(f(0) == 0, "");
+ static_assert(f(1) == 1, "");
+ static_assert(f(2) == 2, "");
+ static_assert(f(3) == 3, "");
+ static_assert(f(4) == 4, "");
+ static_assert(f(5) == 5, "");
+ static_assert(f(6) == 6, "");
+ static_assert(f(7) == 7, "");
+ static_assert(f(8) == 8, "");
+ static_assert(f(9) == 9, "");
+ static_assert(f(10) == 10, "");
+
+ // Check that we can continue an outer loop from within a switch.
+ constexpr bool contin() {
+ for (int n = 0; n != 10; ++n) {
+ switch (n) {
+ case 0:
+ ++n;
+ continue;
+ case 1:
+ return false;
+ case 2:
+ return true;
+ }
+ }
+ return false;
+ }
+ static_assert(contin(), "");
+
+ constexpr bool switch_into_for() {
+ int n = 0;
+ switch (n) {
+ for (; n == 1; ++n) {
+ return n == 1;
+ case 0: ;
+ }
+ }
+ return false;
+ }
+ static_assert(switch_into_for(), "");
+
+ constexpr void duff_copy(char *a, const char *b, int n) {
+ switch ((n - 1) % 8 + 1) {
+ for ( ; n; n = (n - 1) & ~7) {
+ case 8: a[n-8] = b[n-8];
+ case 7: a[n-7] = b[n-7];
+ case 6: a[n-6] = b[n-6];
+ case 5: a[n-5] = b[n-5];
+ case 4: a[n-4] = b[n-4];
+ case 3: a[n-3] = b[n-3];
+ case 2: a[n-2] = b[n-2];
+ case 1: a[n-1] = b[n-1];
+ }
+ case 0: ;
+ }
+ }
+
+ constexpr bool test_copy(const char *str, int n) {
+ char buffer[16] = {};
+ duff_copy(buffer, str, n);
+ for (int i = 0; i != sizeof(buffer); ++i)
+ if (buffer[i] != (i < n ? str[i] : 0))
+ return false;
+ return true;
+ }
+ static_assert(test_copy("foo", 0), "");
+ static_assert(test_copy("foo", 1), "");
+ static_assert(test_copy("foo", 2), "");
+ static_assert(test_copy("hello world", 0), "");
+ static_assert(test_copy("hello world", 7), "");
+ static_assert(test_copy("hello world", 8), "");
+ static_assert(test_copy("hello world", 9), "");
+ static_assert(test_copy("hello world", 10), "");
+ static_assert(test_copy("hello world", 10), "");
+}
+
+namespace deduced_return_type {
+ constexpr auto f() { return 0; }
+ template<typename T> constexpr auto g(T t) { return t; }
+ static_assert(f() == 0, "");
+ static_assert(g(true), "");
+}
+
+namespace modify_temporary_during_construction {
+ struct A { int &&temporary; int x; int y; };
+ constexpr int f(int &r) { r *= 9; return r - 12; }
+ // FIXME: The 'uninitialized' warning here is bogus.
+ constexpr A a = { 6, f(a.temporary), a.temporary }; // expected-warning {{uninitialized}} expected-note {{temporary created here}}
+ static_assert(a.x == 42, "");
+ static_assert(a.y == 54, "");
+ constexpr int k = a.temporary++; // expected-error {{constant expression}} expected-note {{outside the expression that created the temporary}}
+}
+
+namespace std {
+ typedef decltype(sizeof(int)) size_t;
+
+ template <class _E>
+ class initializer_list
+ {
+ const _E* __begin_;
+ size_t __size_;
+
+ constexpr initializer_list(const _E* __b, size_t __s)
+ : __begin_(__b),
+ __size_(__s)
+ {}
+
+ public:
+ typedef _E value_type;
+ typedef const _E& reference;
+ typedef const _E& const_reference;
+ typedef size_t size_type;
+
+ typedef const _E* iterator;
+ typedef const _E* const_iterator;
+
+ constexpr initializer_list() : __begin_(nullptr), __size_(0) {}
+
+ constexpr size_t size() const {return __size_;}
+ constexpr const _E* begin() const {return __begin_;}
+ constexpr const _E* end() const {return __begin_ + __size_;}
+ };
+}
+
+namespace InitializerList {
+ constexpr int sum(std::initializer_list<int> ints) {
+ int total = 0;
+ for (int n : ints) total += n;
+ return total;
+ }
+ static_assert(sum({1, 2, 3, 4, 5}) == 15, "");
+}
+
+namespace StmtExpr {
+ constexpr int f(int k) {
+ switch (k) {
+ case 0:
+ return 0;
+
+ ({
+ case 1: // expected-note {{not supported}}
+ return 1;
+ });
+ }
+ }
+ static_assert(f(1) == 1, ""); // expected-error {{constant expression}} expected-note {{in call}}
+
+ constexpr int g() { // expected-error {{never produces a constant}}
+ return ({ int n; n; }); // expected-note {{object of type 'int' is not initialized}}
+ }
+
+ // FIXME: We should handle the void statement expression case.
+ constexpr int h() { // expected-error {{never produces a constant}}
+ ({ if (true) {} }); // expected-note {{not supported}}
+ return 0;
+ }
+}
+
+namespace VirtualFromBase {
+ struct S1 {
+ virtual int f() const;
+ };
+ struct S2 {
+ virtual int f();
+ };
+ template <typename T> struct X : T {
+ constexpr X() {}
+ double d = 0.0;
+ constexpr int f() { return sizeof(T); }
+ };
+
+ // Non-virtual f(), OK.
+ constexpr X<X<S1>> xxs1;
+ constexpr X<S1> *p = const_cast<X<X<S1>>*>(&xxs1);
+ static_assert(p->f() == sizeof(S1), "");
+
+ // Virtual f(), not OK.
+ constexpr X<X<S2>> xxs2;
+ constexpr X<S2> *q = const_cast<X<X<S2>>*>(&xxs2);
+ static_assert(q->f() == sizeof(X<S2>), ""); // expected-error {{constant expression}} expected-note {{virtual function call}}
+}
+
+namespace Lifetime {
+ constexpr int &get(int &&r) { return r; }
+ constexpr int f() {
+ int &r = get(123);
+ return r; // expected-note {{read of object outside its lifetime}}
+ }
+ static_assert(f() == 123, ""); // expected-error {{constant expression}} expected-note {{in call}}
+
+ constexpr int g() {
+ int *p = 0;
+ {
+ int n = 0;
+ p = &n;
+ n = 42;
+ }
+ *p = 123; // expected-note {{assignment to object outside its lifetime}}
+ return *p;
+ }
+ static_assert(g() == 42, ""); // expected-error {{constant expression}} expected-note {{in call}}
+
+ constexpr int h(int n) {
+ int *p[4] = {};
+ int &&r = 1;
+ p[0] = &r;
+ while (int a = 1) {
+ p[1] = &a;
+ for (int b = 1; int c = 1; ) {
+ p[2] = &b, p[3] = &c;
+ break;
+ }
+ break;
+ }
+ *p[n] = 0; // expected-note 3{{assignment to object outside its lifetime}}
+ return *p[n];
+ }
+ static_assert(h(0) == 0, ""); // ok, lifetime-extended
+ static_assert(h(1) == 0, ""); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(h(2) == 0, ""); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(h(3) == 0, ""); // expected-error {{constant expression}} expected-note {{in call}}
+
+ // FIXME: This function should be treated as non-constant.
+ constexpr void lifetime_versus_loops() {
+ int *p = 0;
+ for (int i = 0; i != 2; ++i) {
+ int *q = p;
+ int n = 0;
+ p = &n;
+ if (i)
+ // This modifies the 'n' from the previous iteration of the loop outside
+ // its lifetime.
+ ++*q;
+ }
+ }
+ static_assert((lifetime_versus_loops(), true), "");
+}
+
+namespace Bitfields {
+ struct A {
+ bool b : 3;
+ int n : 4;
+ unsigned u : 5;
+ };
+ constexpr bool test() {
+ A a {};
+ a.b += 2;
+ --a.n;
+ --a.u;
+ a.n = -a.n * 3;
+ return a.b == false && a.n == 3 && a.u == 31;
+ }
+ static_assert(test(), "");
+}
+
+namespace PR17615 {
+ struct A {
+ int &&r;
+ constexpr A(int &&r) : r(static_cast<int &&>(r)) {}
+ constexpr A() : A(0) {
+ (void)+r; // expected-note {{outside its lifetime}}
+ }
+ };
+ constexpr int k = A().r; // expected-error {{constant expression}} expected-note {{in call to}}
+}
+
+namespace PR17331 {
+ template<typename T, unsigned int N>
+ constexpr T sum(const T (&arr)[N]) {
+ T result = 0;
+ for (T i : arr)
+ result += i;
+ return result;
+ }
+
+ constexpr int ARR[] = { 1, 2, 3, 4, 5 };
+ static_assert(sum(ARR) == 15, "");
+}
diff --git a/test/SemaCXX/constexpr-backtrace-limit.cpp b/test/SemaCXX/constexpr-backtrace-limit.cpp
index 9c40eedabd08..64a26cf29992 100644
--- a/test/SemaCXX/constexpr-backtrace-limit.cpp
+++ b/test/SemaCXX/constexpr-backtrace-limit.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 0 -fconstexpr-depth 4 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST1
+// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 0 -fconstexpr-depth 4 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST1
// TEST1: constant expression
// TEST1-NEXT: exceeded maximum depth of 4
// TEST1-NEXT: in call to 'recurse(2)'
@@ -6,21 +6,21 @@
// TEST1-NEXT: in call to 'recurse(4)'
// TEST1-NEXT: in call to 'recurse(5)'
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 2 -fconstexpr-depth 4 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST2
+// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 2 -fconstexpr-depth 4 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST2
// TEST2: constant expression
// TEST2-NEXT: exceeded maximum depth of 4
// TEST2-NEXT: in call to 'recurse(2)'
// TEST2-NEXT: skipping 2 calls
// TEST2-NEXT: in call to 'recurse(5)'
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 2 -fconstexpr-depth 8 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST3
+// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 2 -fconstexpr-depth 8 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST3
// TEST3: constant expression
// TEST3-NEXT: reinterpret_cast
// TEST3-NEXT: in call to 'recurse(0)'
// TEST3-NEXT: skipping 4 calls
// TEST3-NEXT: in call to 'recurse(5)'
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 8 -fconstexpr-depth 8 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST4
+// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 8 -fconstexpr-depth 8 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST4
// TEST4: constant expression
// TEST4-NEXT: reinterpret_cast
// TEST4-NEXT: in call to 'recurse(0)'
diff --git a/test/SemaCXX/constexpr-duffs-device.cpp b/test/SemaCXX/constexpr-duffs-device.cpp
new file mode 100644
index 000000000000..f77d989b9d36
--- /dev/null
+++ b/test/SemaCXX/constexpr-duffs-device.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -std=c++1y -verify %s
+
+// expected-no-diagnostics
+constexpr void copy(const char *from, unsigned long count, char *to) {
+ unsigned long n = (count + 7) / 8;
+ switch(count % 8) {
+ case 0: do { *to++ = *from++;
+ case 7: *to++ = *from++;
+ case 6: *to++ = *from++;
+ case 5: *to++ = *from++;
+ case 4: *to++ = *from++;
+ case 3: *to++ = *from++;
+ case 2: *to++ = *from++;
+ case 1: *to++ = *from++;
+ } while(--n > 0);
+ }
+}
+
+struct S {
+ char stuff[14];
+ constexpr S() : stuff{} {
+ copy("Hello, world!", 14, stuff);
+ }
+};
+
+constexpr bool streq(const char *a, const char *b) {
+ while (*a && *a == *b) ++a, ++b;
+ return *a == *b;
+}
+
+static_assert(streq(S().stuff, "Hello, world!"), "should be same");
+static_assert(!streq(S().stuff, "Something else"), "should be different");
diff --git a/test/SemaCXX/constexpr-steps.cpp b/test/SemaCXX/constexpr-steps.cpp
new file mode 100644
index 000000000000..f7967eee9f78
--- /dev/null
+++ b/test/SemaCXX/constexpr-steps.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -std=c++1y -fsyntax-only -verify %s -DMAX=1234 -fconstexpr-steps 1234
+// RUN: %clang_cc1 -std=c++1y -fsyntax-only -verify %s -DMAX=10 -fconstexpr-steps 10
+// RUN: %clang -std=c++1y -fsyntax-only -Xclang -verify %s -DMAX=12345 -fconstexpr-steps=12345
+
+// This takes a total of n + 4 steps according to our current rules:
+// - One for the compound-statement that is the function body
+// - One for the 'for' statement
+// - One for the 'int k = 0;' statement
+// - One for each of the n evaluations of the compound-statement in the 'for' body
+// - One for the 'return' statemnet
+constexpr bool steps(int n) {
+ for (int k = 0; k != n; ++k) {}
+ return true; // expected-note {{step limit}}
+}
+
+static_assert(steps((MAX - 4)), ""); // ok
+static_assert(steps((MAX - 3)), ""); // expected-error {{constant}} expected-note{{call}}
diff --git a/test/SemaCXX/constexpr-turing.cpp b/test/SemaCXX/constexpr-turing.cpp
index 07c04eff3083..75aefbf2ab7a 100644
--- a/test/SemaCXX/constexpr-turing.cpp
+++ b/test/SemaCXX/constexpr-turing.cpp
@@ -33,24 +33,24 @@ constexpr Tape move(const Tape &old, Dir dir) { return Tape(old, dir); }
// Run turing machine 'tm' on tape 'tape' from state 'state'. Return number of
// steps taken until halt.
constexpr unsigned run(const State *tm, const Tape &tape, unsigned state) {
- return state == halt ? 1 :
+ return state == halt ? 0 :
run(tm, move(update(tape, tm[state][tape.val].tape),
tm[state][tape.val].dir),
tm[state][tape.val].next) + 1;
}
-// 3-state busy beaver. 14 steps.
+// 3-state busy beaver. S(bb3) = 21.
constexpr State bb3[] = {
- { { true, R, 1 }, { true, L, 2 } },
- { { true, L, 0 }, { true, R, 1 } },
- { { true, L, 1 }, { true, R, halt } }
+ { { true, R, 1 }, { true, R, halt } },
+ { { true, L, 1 }, { false, R, 2 } },
+ { { true, L, 2 }, { true, L, 0 } }
};
-static_assert(run(bb3, Tape(), 0) == 14, "");
+static_assert(run(bb3, Tape(), 0) == 21, "");
-// 4-state busy beaver. 108 steps.
+// 4-state busy beaver. S(bb4) = 107.
constexpr State bb4[] = {
{ { true, R, 1 }, { true, L, 1 } },
{ { true, L, 0 }, { false, L, 2 } },
{ { true, R, halt }, { true, L, 3 } },
{ { true, R, 3 }, { false, R, 0 } } };
-static_assert(run(bb4, Tape(), 0) == 108, "");
+static_assert(run(bb4, Tape(), 0) == 107, "");
diff --git a/test/SemaCXX/constexpr-value-init.cpp b/test/SemaCXX/constexpr-value-init.cpp
index d137bd88db0b..e5b7db50eb65 100644
--- a/test/SemaCXX/constexpr-value-init.cpp
+++ b/test/SemaCXX/constexpr-value-init.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -std=c++11 -fsyntax-only -verify
+// RUN: %clang_cc1 %s -Wno-uninitialized -std=c++11 -fsyntax-only -verify
struct A {
constexpr A() : a(b + 1), b(a + 1) {} // expected-note {{outside its lifetime}}
diff --git a/test/SemaCXX/conversion-delete-expr.cpp b/test/SemaCXX/conversion-delete-expr.cpp
index 0f298a819fa3..a1ddeb2689ad 100644
--- a/test/SemaCXX/conversion-delete-expr.cpp
+++ b/test/SemaCXX/conversion-delete-expr.cpp
@@ -2,11 +2,11 @@
// Test1
struct B {
- operator char *(); // expected-note {{candidate function}}
+ operator char *(); // expected-note {{conversion to pointer type}}
};
struct D : B {
- operator int *(); // expected-note {{candidate function}}
+ operator int *(); // expected-note {{conversion to pointer type}}
};
void f (D d)
@@ -30,11 +30,11 @@ void f1 (D1 d)
// Test3
struct B2 {
- operator const int *(); // expected-note {{candidate function}}
+ operator const int *(); // expected-note {{conversion to pointer type}}
};
struct D2 : B2 {
- operator int *(); // expected-note {{candidate function}}
+ operator int *(); // expected-note {{conversion to pointer type}}
};
void f2 (D2 d)
@@ -44,11 +44,11 @@ void f2 (D2 d)
// Test4
struct B3 {
- operator const int *(); // expected-note {{candidate function}}
+ operator const int *(); // expected-note {{conversion to pointer type}}
};
struct A3 {
- operator const int *(); // expected-note {{candidate function}}
+ operator const int *(); // expected-note {{conversion to pointer type}}
};
struct D3 : A3, B3 {
@@ -78,7 +78,7 @@ void f5(X1 x) { delete x; } // OK. In selecting a conversion to pointer functio
// Test7
struct Base {
- operator int*();
+ operator int*();
};
struct Derived : Base {
@@ -87,9 +87,9 @@ struct Derived : Base {
};
void foo6(const Derived cd, Derived d) {
- // overload resolution selects Derived::operator int*() const;
- delete cd;
- delete d;
+ // overload resolution selects Derived::operator int*() const;
+ delete cd;
+ delete d;
}
// Test8
@@ -104,6 +104,6 @@ struct DD : BB {
void foo7 (DD d)
{
- // OK. In selecting a conversion to pointer function, template convesions are skipped.
- delete d;
+ // OK. In selecting a conversion to pointer function, template convesions are skipped.
+ delete d;
}
diff --git a/test/SemaCXX/conversion-function.cpp b/test/SemaCXX/conversion-function.cpp
index 6fca0503ba72..7eaed54934b3 100644
--- a/test/SemaCXX/conversion-function.cpp
+++ b/test/SemaCXX/conversion-function.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
class X {
public:
operator bool();
@@ -11,6 +11,8 @@ public:
float g() {
return operator float(); // expected-error{{use of undeclared 'operator float'}}
}
+
+ static operator short(); // expected-error{{conversion function must be a non-static member function}}
};
operator int(); // expected-error{{conversion function must be a non-static member function}}
diff --git a/test/SemaCXX/conversion-incomplete-type.cpp b/test/SemaCXX/conversion-incomplete-type.cpp
new file mode 100644
index 000000000000..ebedd04047b9
--- /dev/null
+++ b/test/SemaCXX/conversion-incomplete-type.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct string {};
+
+class StringPiece; // expected-note {{forward declaration of 'StringPiece'}} \
+ // expected-note {{forward declaration of 'StringPiece'}}
+
+struct Test {
+ void expectStringPiece(const StringPiece& blah) {}; // expected-note {{passing argument to parameter 'blah' here}}
+
+ void test(const string& s) {
+ expectStringPiece(s); // expected-error {{no viable conversion from 'const string' to incomplete type 'const StringPiece'}}
+ }
+};
+
+struct TestStatic {
+ static void expectStringPiece(const StringPiece& blah) {}; // expected-note {{passing argument to parameter 'blah' here}}
+
+ static void test(const string& s) {
+ expectStringPiece(s); // expected-error {{no viable conversion from 'const string' to incomplete type 'const StringPiece'}}
+ }
+};
+
diff --git a/test/SemaCXX/crashes.cpp b/test/SemaCXX/crashes.cpp
index f5682bd74d92..0b15bb0386c2 100644
--- a/test/SemaCXX/crashes.cpp
+++ b/test/SemaCXX/crashes.cpp
@@ -171,3 +171,50 @@ namespace test3 {
int& x = dimenX.*sides;
}
}
+
+namespace pr16964 {
+ template<typename> struct bs {
+ bs();
+ static int* member();
+ member(); // expected-error{{C++ requires a type specifier for all declarations}}
+ static member(); // expected-error{{C++ requires a type specifier for all declarations}}
+ static int* member(int);
+ };
+
+ template<typename T> bs<T>::bs() { member; }
+
+ bs<int> test() {
+ return bs<int>();
+ }
+}
+
+namespace pr12791 {
+ template<class _Alloc> class allocator {};
+ template<class _CharT> struct char_traits;
+ struct input_iterator_tag {};
+ struct forward_iterator_tag : public input_iterator_tag {};
+
+ template<typename _CharT, typename _Traits, typename _Alloc> struct basic_string {
+ struct _Alloc_hider : _Alloc {};
+ mutable _Alloc_hider _M_dataplus;
+ template<class _InputIterator> basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a = _Alloc());
+ template<class _InIterator> static _CharT* _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, input_iterator_tag);
+ template<class _FwdIterator> static _CharT* _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a, forward_iterator_tag);
+ static _CharT* _S_construct(size_type __req, _CharT __c, const _Alloc& __a); // expected-error{{unknown type name 'size_type'}}
+ };
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ template<typename _InputIterator>
+ basic_string<_CharT, _Traits, _Alloc>:: basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a)
+ : _M_dataplus(_S_construct(__beg, __end, __a), __a) {}
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > struct basic_stringbuf {
+ typedef _CharT char_type;
+ typedef basic_string<char_type, _Traits, _Alloc> __string_type;
+ typedef typename __string_type::size_type __size_type;
+ __string_type str() const {__string_type((char_type*)0,(char_type*)0);}
+ };
+
+ template class basic_stringbuf<char>;
+}
+
diff --git a/test/SemaCXX/cxx0x-class.cpp b/test/SemaCXX/cxx0x-class.cpp
index 074591e7063c..2b1338f97fd7 100644
--- a/test/SemaCXX/cxx0x-class.cpp
+++ b/test/SemaCXX/cxx0x-class.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wno-error=static-float-init %s
+// RUN: %clang_cc1 -Wno-uninitialized -fsyntax-only -verify -std=c++11 -Wno-error=static-float-init %s
int vs = 0;
diff --git a/test/SemaCXX/cxx0x-compat.cpp b/test/SemaCXX/cxx0x-compat.cpp
index 123008aadd81..ffbd20fda373 100644
--- a/test/SemaCXX/cxx0x-compat.cpp
+++ b/test/SemaCXX/cxx0x-compat.cpp
@@ -1,4 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wc++11-compat -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++1y -Wc++11-compat -verify %s
+
+#if __cplusplus < 201103L
namespace N {
template<typename T> void f(T) {} // expected-note 2{{here}}
@@ -37,3 +40,9 @@ void h(size_t foo, size_t bar) {
#define _x + 1
char c = 'x'_x; // expected-warning {{will be treated as a user-defined literal suffix}}
+
+#else
+
+auto init_capture = [a(0)] {}; // expected-warning {{initialized lambda captures are incompatible with C++ standards before C++1y}}
+
+#endif
diff --git a/test/SemaCXX/cxx0x-initializer-aggregates.cpp b/test/SemaCXX/cxx0x-initializer-aggregates.cpp
index f53ac6dff930..0e9a97d5bb07 100644
--- a/test/SemaCXX/cxx0x-initializer-aggregates.cpp
+++ b/test/SemaCXX/cxx0x-initializer-aggregates.cpp
@@ -4,7 +4,6 @@ struct one { char c[1]; };
struct two { char c[2]; };
namespace aggregate {
- // Direct list initialization does NOT allow braces to be elided!
struct S {
int ar[2];
struct T {
@@ -20,25 +19,25 @@ namespace aggregate {
};
void bracing() {
- S s1 = { 1, 2, 3 ,4, 5, 6, 7, 8 }; // no-error
- S s2{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } }; // completely braced
- S s3{ 1, 2, 3, 4, 5, 6 }; // expected-error 5 {{cannot omit braces}}
- S s4{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } }; // expected-error 2 {{cannot omit braces}}
- S s5{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} }; // expected-error {{cannot omit braces}}
+ S s1 = { 1, 2, 3 ,4, 5, 6, 7, 8 };
+ S s2{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } };
+ S s3{ 1, 2, 3, 4, 5, 6 };
+ S s4{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } };
+ S s5{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} };
}
void bracing_new() {
- new S{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } }; // completely braced
- new S{ 1, 2, 3, 4, 5, 6 }; // expected-error 5 {{cannot omit braces}}
- new S{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } }; // expected-error 2 {{cannot omit braces}}
- new S{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} }; // expected-error {{cannot omit braces}}
+ new S{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } };
+ new S{ 1, 2, 3, 4, 5, 6 };
+ new S{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } };
+ new S{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} };
}
void bracing_construct() {
- (void) S{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } }; // completely braced
- (void) S{ 1, 2, 3, 4, 5, 6 }; // expected-error 5 {{cannot omit braces}}
- (void) S{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } }; // expected-error 2 {{cannot omit braces}}
- (void) S{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} }; // expected-error {{cannot omit braces}}
+ (void) S{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } };
+ (void) S{ 1, 2, 3, 4, 5, 6 };
+ (void) S{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } };
+ (void) S{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} };
}
struct String {
diff --git a/test/SemaCXX/cxx0x-initializer-references.cpp b/test/SemaCXX/cxx0x-initializer-references.cpp
index 283c32ac2efc..9096c8a1c2d5 100644
--- a/test/SemaCXX/cxx0x-initializer-references.cpp
+++ b/test/SemaCXX/cxx0x-initializer-references.cpp
@@ -36,10 +36,10 @@ namespace reference {
};
void call() {
- void f(const int&);
+ one f(const int&);
f({1});
- void g(int&); // expected-note {{passing argument}}
+ one g(int&); // expected-note {{passing argument}}
g({1}); // expected-error {{cannot bind to an initializer list temporary}}
int i = 0;
g({i});
@@ -97,3 +97,24 @@ namespace b7891773 {
int g(const ptr &);
int k = g({ f<int> });
}
+
+namespace inner_init {
+ struct A { int n; };
+ struct B { A &&r; };
+ B b1 { 0 }; // expected-error {{reference to type 'inner_init::A' could not bind to an rvalue of type 'int'}}
+ B b2 { { 0 } };
+ B b3 { { { 0 } } }; // expected-warning {{braces around scalar init}}
+
+ struct C { C(int); };
+ struct D { C &&r; };
+ D d1 { 0 }; // ok, 0 implicitly converts to C
+ D d2 { { 0 } }; // ok, { 0 } calls C(0)
+ D d3 { { { 0 } } }; // ok, { { 0 } } calls C({ 0 })
+ D d4 { { { { 0 } } } }; // expected-warning {{braces around scalar init}}
+
+ struct E { explicit E(int); }; // expected-note 2{{here}}
+ struct F { E &&r; };
+ F f1 { 0 }; // expected-error {{could not bind to an rvalue of type 'int'}}
+ F f2 { { 0 } }; // expected-error {{chosen constructor is explicit}}
+ F f3 { { { 0 } } }; // expected-error {{chosen constructor is explicit}}
+}
diff --git a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
index 88571d671b07..9d89cce67b38 100644
--- a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
+++ b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
@@ -144,7 +144,7 @@ namespace PR12119 {
template<typename T> void g(std::initializer_list<std::initializer_list<T>>);
void foo() {
- f({0, {1}});
+ f({0, {1}}); // expected-warning{{braces around scalar initializer}}
g({{0, 1}, {2, 3}});
std::initializer_list<int> il = {1, 2};
g({il, {2, 3}});
@@ -208,3 +208,25 @@ namespace init_list_deduction_failure {
void h() { g({f}); }
// expected-error@-1 {{no matching function for call to 'g'}}
}
+
+namespace deleted_copy {
+ struct X {
+ X(int i) {}
+ X(const X& x) = delete; // expected-note {{here}}
+ void operator=(const X& x) = delete;
+ };
+
+ std::initializer_list<X> x{1}; // expected-error {{invokes deleted constructor}}
+}
+
+namespace RefVersusInitList {
+ struct S {};
+ void f(const S &) = delete;
+ void f(std::initializer_list<S>);
+ void g(S s) { f({S()}); }
+}
+
+namespace PR18013 {
+ int f();
+ std::initializer_list<long (*)()> x = {f}; // expected-error {{cannot initialize an array element of type 'long (*const)()' with an lvalue of type 'int ()': different return type ('long' vs 'int')}}
+}
diff --git a/test/SemaCXX/cxx0x-nontrivial-union.cpp b/test/SemaCXX/cxx0x-nontrivial-union.cpp
index 0e4add84955e..db296bd57d71 100644
--- a/test/SemaCXX/cxx0x-nontrivial-union.cpp
+++ b/test/SemaCXX/cxx0x-nontrivial-union.cpp
@@ -122,3 +122,25 @@ namespace optional {
o2 = optional<non_trivial>();
}
}
+
+namespace pr16061 {
+ struct X { X(); };
+
+ template<typename T> struct Test1 {
+ union {
+ struct {
+ X x;
+ };
+ };
+ };
+
+ template<typename T> struct Test2 {
+ union {
+ struct { // expected-note {{default constructor of 'Test2<pr16061::X>' is implicitly deleted because variant field '' has a non-trivial default constructor}}
+ T x;
+ };
+ };
+ };
+
+ Test2<X> t2x; // expected-error {{call to implicitly-deleted default constructor of 'Test2<pr16061::X>'}}
+}
diff --git a/test/SemaCXX/cxx11-attr-print.cpp b/test/SemaCXX/cxx11-attr-print.cpp
index 19de5b5a640b..01325d3c8bf3 100644
--- a/test/SemaCXX/cxx11-attr-print.cpp
+++ b/test/SemaCXX/cxx11-attr-print.cpp
@@ -52,7 +52,7 @@ inline void f6() __attribute__((gnu_inline));
inline void f7 [[gnu::gnu_inline]] ();
// arguments printing
-// CHECK: __attribute__((format("printf", 2, 3)));
+// CHECK: __attribute__((format(printf, 2, 3)));
void f8 (void *, const char *, ...) __attribute__ ((format (printf, 2, 3)));
// CHECK: int m __attribute__((aligned(4
@@ -75,3 +75,6 @@ template <typename T> struct S {
// CHECK: static int f() __attribute__((pure))
// CHECK: static int g() {{\[}}[gnu::pure]]
template struct S<int>;
+
+// CHECK: using Small2 {{\[}}[gnu::mode(byte)]] = int;
+using Small2 [[gnu::mode(byte)]] = int;
diff --git a/test/SemaCXX/cxx11-crashes.cpp b/test/SemaCXX/cxx11-crashes.cpp
index a4d4829f3fc2..bd51af1da2fa 100644
--- a/test/SemaCXX/cxx11-crashes.cpp
+++ b/test/SemaCXX/cxx11-crashes.cpp
@@ -70,9 +70,7 @@ namespace b6981007 {
for (auto x : s) {
// We used to attempt to evaluate the initializer of this variable,
// and crash because it has an undeduced type.
- // FIXME: We should set the loop variable to be invalid if we can't build
- // the loop, to suppress this follow-on error.
- const int &n(x); // expected-error {{could not bind to an lvalue of type 'auto'}}
+ const int &n(x);
}
}
}
diff --git a/test/SemaCXX/cxx11-gnu-attrs.cpp b/test/SemaCXX/cxx11-gnu-attrs.cpp
index def83a94ea2b..22d61a1978fb 100644
--- a/test/SemaCXX/cxx11-gnu-attrs.cpp
+++ b/test/SemaCXX/cxx11-gnu-attrs.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang -cc1 -triple x86_64-unknown-unknown -std=c++11 -verify %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++11 -verify %s
// Error cases.
@@ -11,8 +11,9 @@ int *[[gnu::unused]] attr_on_ptr;
// Valid cases.
+void aliasb [[gnu::alias("_Z6alias1v")]] ();
void alias1() {}
-void alias2 [[gnu::alias("_Z6alias1v")]] ();
+void aliasa [[gnu::alias("_Z6alias1v")]] ();
[[gnu::aligned(8)]] int aligned;
void aligned_fn [[gnu::aligned(32)]] ();
diff --git a/test/SemaCXX/cxx11-thread-local-print.cpp b/test/SemaCXX/cxx11-thread-local-print.cpp
index 9d9a82b7e6a4..1adafbda4905 100644
--- a/test/SemaCXX/cxx11-thread-local-print.cpp
+++ b/test/SemaCXX/cxx11-thread-local-print.cpp
@@ -7,3 +7,9 @@ __thread int gnu_tl;
_Thread_local int c11_tl;
thread_local int cxx11_tl;
+// CHECK: void foo() {
+// CHECK: thread_local int cxx11_tl;
+// CHECK: }
+void foo() {
+ thread_local int cxx11_tl;
+}
diff --git a/test/SemaCXX/cxx1y-array-runtime-bound.cpp b/test/SemaCXX/cxx1y-array-runtime-bound.cpp
deleted file mode 100644
index 1643adbe0b09..000000000000
--- a/test/SemaCXX/cxx1y-array-runtime-bound.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-// RUN: %clang_cc1 -std=c++1y %s -verify -triple=x86_64-linux-gnu -pedantic-errors
-
-// FIXME: many diagnostics here say 'variably modified type'.
-// catch this case and say 'array of runtime bound' instead.
-
-namespace std { struct type_info; }
-
-struct S {
- int arr[__SIZE_MAX__ / 32];
-};
-S s[32]; // expected-error {{array is too large}}
-
-int n;
-int a[n]; // expected-error {{not allowed at file scope}}
-
-struct T {
- int a[n]; // expected-error {{fields must have a constant size}}
- static int b[n]; // expected-error {{not allowed at file scope}}
-};
-
-int g(int n, int a[n]);
-
-template<typename T> struct X {};
-template<int N, int[N]> struct Y {};
-template<int[n]> struct Z {}; // expected-error {{of variably modified type}}
-
-int f(int n) {
- int arb[n]; // expected-note 3{{here}}
- [arb] {} (); // expected-error {{cannot be captured}}
-
- // FIXME: an array of runtime bound can be captured by reference.
- [&arb] { // expected-error {{cannot be captured}}
- // Capturing the array implicitly captures the bound, if we need it
- // in a range-based for loop.
- for (auto &n : arb) { } // expected-error {{cannot be captured}}
- } ();
-
- X<int[n]> x; // expected-error {{variably modified type}}
-
- int arb_neg[-1]; // expected-error {{negative size}}
- int arb_of_array[n][2];
- int arr[3] = { 1, 2, 3, 4 }; // expected-error {{excess elements}}
- char foo[4] = "fool"; // expected-error {{initializer-string for char array is too long}}
-
- static int not_auto1[n]; // expected-error {{can not have 'static'}}
- extern int not_auto2[n]; // expected-error {{can not have 'extern'}}
- // FIXME: say 'thread_local' not 'static'.
- thread_local int not_auto1[n]; // expected-error {{can not have 'static'}}
-
- // FIXME: these should all be invalid.
- auto &&ti1 = typeid(arb);
- auto &&ti2 = typeid(int[n]);
- auto &&so1 = sizeof(arb);
- auto &&so2 = sizeof(int[n]);
- auto *p = &arb;
- decltype(arb) arb2;
- int (*arbp)[n] = 0;
- const int (&arbr)[n] = arbr; // expected-warning {{not yet bound}}
- typedef int arbty[n];
- int array_of_arb[2][n];
-
- struct Dyn { Dyn() {} Dyn(int) {} ~Dyn() {} };
-
- // FIXME: these should be valid.
- int arb_dynamic[n] = { 1, 2, 3, 4 }; // expected-error {{may not be initialized}}
- Dyn dyn[n]; // expected-error {{non-POD}}
- Dyn dyn_init[n] = { 1, 2, 3, 4 }; // expected-error {{non-POD}}
-}
diff --git a/test/SemaCXX/cxx1y-contextual-conversion-tweaks.cpp b/test/SemaCXX/cxx1y-contextual-conversion-tweaks.cpp
new file mode 100644
index 000000000000..58bbbb2a0442
--- /dev/null
+++ b/test/SemaCXX/cxx1y-contextual-conversion-tweaks.cpp
@@ -0,0 +1,177 @@
+// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only %s
+// RUN: %clang_cc1 -std=c++1y %s -verify -DCXX1Y
+
+// Explicit member declarations behave as in C++11.
+
+namespace n3323_example {
+
+ template <class T> class zero_init {
+ public:
+ zero_init() : val(static_cast<T>(0)) {}
+ zero_init(T val) : val(val) {}
+
+ operator T &() { return val; } //@13
+ operator T() const { return val; } //@14
+
+ private:
+ T val;
+ };
+
+ void Delete() {
+ zero_init<int *> p;
+ p = new int(7);
+ delete p; //@23
+ delete (p + 0);
+ delete + p;
+ }
+
+ void Switch() {
+ zero_init<int> i;
+ i = 7;
+ switch (i) {} // @31
+ switch (i + 0) {}
+ switch (+i) {}
+ }
+}
+
+#ifdef CXX1Y
+#else
+//expected-error@23 {{ambiguous conversion of delete expression of type 'zero_init<int *>' to a pointer}}
+//expected-note@13 {{conversion to pointer type 'int *'}}
+//expected-note@14 {{conversion to pointer type 'int *'}}
+//expected-error@31 {{multiple conversions from switch condition type 'zero_init<int>' to an integral or enumeration type}}
+//expected-note@13 {{conversion to integral type 'int'}}
+//expected-note@14 {{conversion to integral type 'int'}}
+#endif
+
+namespace extended_examples {
+
+ struct A0 {
+ operator int(); // matching and viable
+ };
+
+ struct A1 {
+ operator int() &&; // matching and not viable
+ };
+
+ struct A2 {
+ operator float(); // not matching
+ };
+
+ struct A3 {
+ template<typename T> operator T(); // not matching (ambiguous anyway)
+ };
+
+ struct A4 {
+ template<typename T> operator int(); // not matching (ambiguous anyway)
+ };
+
+ struct B1 {
+ operator int() &&; // @70
+ operator int(); // @71 -- duplicate declaration with different qualifier is not allowed
+ };
+
+ struct B2 {
+ operator int() &&; // matching but not viable
+ operator float(); // not matching
+ };
+
+ void foo(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, B2 b2) {
+ switch (a0) {}
+ switch (a1) {} // @81 -- fails for different reasons
+ switch (a2) {} // @82
+ switch (a3) {} // @83
+ switch (a4) {} // @84
+ switch (b2) {} // @85 -- fails for different reasons
+ }
+}
+
+//expected-error@71 {{cannot overload a member function without a ref-qualifier with a member function with ref-qualifier '&&'}}
+//expected-note@70 {{previous declaration is here}}
+//expected-error@82 {{statement requires expression of integer type ('extended_examples::A2' invalid)}}
+//expected-error@83 {{statement requires expression of integer type ('extended_examples::A3' invalid)}}
+//expected-error@84 {{statement requires expression of integer type ('extended_examples::A4' invalid)}}
+
+#ifdef CXX1Y
+//expected-error@81 {{statement requires expression of integer type ('extended_examples::A1' invalid)}}
+//expected-error@85 {{statement requires expression of integer type ('extended_examples::B2' invalid)}}
+#else
+//expected-error@81 {{cannot initialize object parameter of type 'extended_examples::A1' with an expression of type 'extended_examples::A1'}}
+//expected-error@85 {{cannot initialize object parameter of type 'extended_examples::B2' with an expression of type 'extended_examples::B2'}}
+#endif
+
+namespace extended_examples_cxx1y {
+
+ struct A1 { // leads to viable match in C++1y, and no viable match in C++11
+ operator int() &&; // matching but not viable
+ template <typename T> operator T(); // In C++1y: matching and viable, since disambiguated by L.100
+ };
+
+ struct A2 { // leads to ambiguity in C++1y, and no viable match in C++11
+ operator int() &&; // matching but not viable
+ template <typename T> operator int(); // In C++1y: matching but ambiguous (disambiguated by L.105).
+ };
+
+ struct B1 { // leads to one viable match in both cases
+ operator int(); // matching and viable
+ template <typename T> operator T(); // In C++1y: matching and viable, since disambiguated by L.110
+ };
+
+ struct B2 { // leads to one viable match in both cases
+ operator int(); // matching and viable
+ template <typename T> operator int(); // In C++1y: matching but ambiguous, since disambiguated by L.115
+ };
+
+ struct C { // leads to no match in both cases
+ operator float(); // not matching
+ template <typename T> operator T(); // In C++1y: not matching, nor viable.
+ };
+
+ struct D { // leads to viable match in C++1y, and no viable match in C++11
+ operator int() &&; // matching but not viable
+ operator float(); // not matching
+ template <typename T> operator T(); // In C++1y: matching and viable, since disambiguated by L.125
+ };
+
+
+ void foo(A1 a1, A2 a2, B1 b1, B2 b2, C c, D d) {
+ switch (a1) {} // @138 -- should presumably call templated conversion operator to convert to int.
+ switch (a2) {} // @139
+ switch (b1) {}
+ switch (b2) {}
+ switch (c) {} // @142
+ switch (d) {} // @143
+ }
+}
+
+//expected-error@142 {{statement requires expression of integer type ('extended_examples_cxx1y::C' invalid)}}
+
+#ifdef CXX1Y
+//expected-error@139 {{statement requires expression of integer type ('extended_examples_cxx1y::A2' invalid)}}
+#else
+//expected-error@138 {{cannot initialize object parameter of type 'extended_examples_cxx1y::A1' with an expression of type 'extended_examples_cxx1y::A1'}}
+//expected-error@139 {{cannot initialize object parameter of type 'extended_examples_cxx1y::A2' with an expression of type 'extended_examples_cxx1y::A2'}}
+//expected-error@143 {{cannot initialize object parameter of type 'extended_examples_cxx1y::D' with an expression of type 'extended_examples_cxx1y::D'}}
+#endif
+
+namespace extended_examples_array_bounds {
+
+ typedef decltype(sizeof(int)) size_t;
+
+ struct Foo {
+ operator size_t(); // @162
+ operator unsigned short(); // @163
+ };
+
+ void bar() {
+ Foo x;
+ int *p = new int[x]; // @168
+ }
+}
+
+#ifdef CXX1Y
+#else
+//expected-error@168 {{ambiguous conversion of array size expression of type 'extended_examples_array_bounds::Foo' to an integral or enumeration type}}
+//expected-note@162 {{conversion to integral type 'size_t'}}
+//expected-note@163 {{conversion to integral type 'unsigned short' declared here}}
+#endif
diff --git a/test/SemaCXX/cxx1y-deduced-return-type.cpp b/test/SemaCXX/cxx1y-deduced-return-type.cpp
index f0146f88d686..d3308b3fd50b 100644
--- a/test/SemaCXX/cxx1y-deduced-return-type.cpp
+++ b/test/SemaCXX/cxx1y-deduced-return-type.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only %s
+// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only %s -fdelayed-template-parsing -DDELAYED_TEMPLATE_PARSING
auto f(); // expected-note {{previous}}
int f(); // expected-error {{differ only in their return type}}
@@ -112,7 +113,8 @@ namespace Templates {
int e = fwd_decl<int>(); // expected-error {{cannot be used before it is defined}}
template<typename T> auto fwd_decl() { return 0; }
int f = fwd_decl<int>();
- template<typename T> auto fwd_decl();
+ template <typename T>
+ auto fwd_decl(); // expected-note {{candidate template ignored: could not match 'auto ()' against 'int ()'}}
int g = fwd_decl<char>();
auto (*p)() = f1; // expected-error {{incompatible initializer}}
@@ -126,7 +128,8 @@ namespace Templates {
extern template int fwd_decl<char>(); // expected-error {{does not refer to a function template}}
int k2 = fwd_decl<char>();
- template<typename T> auto instantiate() { T::error; } // expected-error {{has no members}}
+ template <typename T> auto instantiate() { T::error; } // expected-error {{has no members}} \
+ // expected-note {{candidate template ignored: could not match 'auto ()' against 'void ()'}}
extern template auto instantiate<int>(); // ok
int k = instantiate<int>(); // expected-note {{in instantiation of}}
template<> auto instantiate<char>() {} // ok
@@ -157,7 +160,7 @@ namespace Templates {
double &mem_check4 = take_fn<double>(Outer<double>::arg_multi);
namespace Deduce1 {
- template<typename T> auto f() { return 0; } // expected-note {{candidate}}
+ template <typename T> auto f() { return 0; } // expected-note {{couldn't infer template argument 'T'}}
template<typename T> void g(T(*)()); // expected-note 2{{candidate}}
void h() {
auto p = f<int>;
@@ -170,7 +173,7 @@ namespace Templates {
}
namespace Deduce2 {
- template<typename T> auto f(int) { return 0; } // expected-note {{candidate}}
+ template <typename T> auto f(int) { return 0; } // expected-note {{couldn't infer template argument 'T'}}
template<typename T> void g(T(*)(int)); // expected-note 2{{candidate}}
void h() {
auto p = f<int>;
@@ -253,7 +256,7 @@ namespace DefaultedMethods {
auto operator=(const A&) = default; // expected-error {{must return 'DefaultedMethods::A &'}}
A &operator=(A&&); // expected-note {{previous}}
};
- auto A::operator=(A&&) = default; // expected-error {{differs from the declaration in the return type}}
+ auto A::operator=(A&&) = default; // expected-error {{return type of out-of-line definition of 'DefaultedMethods::A::operator=' differs from that in the declaration}}
}
namespace Constexpr {
@@ -295,7 +298,12 @@ namespace NoReturn {
auto f() {}
void (*p)() = &f;
+ auto f(); // ok
+
auto *g() {} // expected-error {{cannot deduce return type 'auto *' for function with no return statements}}
+
+ auto h() = delete; // expected-note {{explicitly deleted}}
+ auto x = h(); // expected-error {{call to deleted}}
}
namespace UseBeforeComplete {
@@ -317,7 +325,8 @@ namespace Redecl {
int f(); // expected-error {{functions that differ only in their return type cannot be overloaded}}
decltype(auto) f(); // expected-error {{cannot be overloaded}}
- template<typename T> auto g(T t) { return t; } // expected-note {{candidate}}
+ template <typename T> auto g(T t) { return t; } // expected-note {{candidate}} \
+ // expected-note {{candidate function [with T = int]}}
template auto g(int);
template char g(char); // expected-error {{does not refer to a function}}
template<> auto g(double);
@@ -334,5 +343,136 @@ namespace ExplicitInstantiationDecl {
extern template auto f(int);
int (*p)(int) = f;
}
+namespace MemberTemplatesWithDeduction {
+ struct M {
+ template<class T> auto foo(T t) { return t; }
+ template<class T> auto operator()(T t) const { return t; }
+ template<class T> static __attribute__((unused)) int static_foo(T) {
+ return 5;
+ }
+ template<class T> operator T() { return T{}; }
+ operator auto() { return &static_foo<int>; }
+ };
+ struct N : M {
+ using M::foo;
+ using M::operator();
+ using M::static_foo;
+ using M::operator auto;
+ };
+
+ template <class T> int test() {
+ int i = T{}.foo(3);
+ T m = T{}.foo(M{});
+ int j = T{}(3);
+ M m2 = M{}(M{});
+ int k = T{}.static_foo(4);
+ int l = T::static_foo(5);
+ int l2 = T{};
+ struct X { };
+ X x = T{};
+ return 0;
+ }
+ int Minst = test<M>();
+ int Ninst = test<N>();
+
+}
+}
+
+namespace CurrentInstantiation {
+ // PR16875
+ template<typename T> struct S {
+ auto f() { return T(); }
+ int g() { return f(); }
+ auto h(bool b) {
+ if (b)
+ return T();
+ return h(true);
+ }
+ };
+ int k1 = S<int>().g();
+ int k2 = S<int>().h(false);
+
+ template<typename T> struct U {
+ #ifndef DELAYED_TEMPLATE_PARSING
+ auto f(); // expected-note {{here}}
+ int g() { return f(); } // expected-error {{cannot be used before it is defined}}
+ #else
+ auto f();
+ int g() { return f(); }
+ #endif
+ };
+ #ifndef DELAYED_TEMPLATE_PARSING
+ template int U<int>::g(); // expected-note {{in instantiation of}}
+ #else
+ template int U<int>::g();
+ #endif
+ template<typename T> auto U<T>::f() { return T(); }
+ template int U<short>::g(); // ok
+}
+
+namespace WithDefaultArgs {
+ template<typename U> struct A {
+ template<typename T = U> friend auto f(A) { return []{}; }
+ };
+ template<typename T> void f();
+ using T = decltype(f(A<int>()));
+ using T = decltype(f<int>(A<int>()));
+}
+
+namespace MultilevelDeduction {
+
+auto F() -> auto* { return (int*)0; }
+
+auto (*G())() -> int* { return F; }
+
+auto run = G();
+
+namespace Templated {
+template<class T>
+auto F(T t) -> auto* { return (T*)0; }
+
+template<class T>
+auto (*G(T t))(T) -> T* { return &F<T>; }
+
+
+template<class T>
+auto (*G2(T t))(T) -> auto* { return &F<T>; }
+
+auto run_int = G(1);
+auto run_char = G2('a');
+
+}
+}
+
+namespace rnk {
+extern "C" int puts(const char *s);
+template <typename T>
+auto foo(T x) -> decltype(x) {
+#ifdef DELAYED_TEMPLATE_PARSING
+ ::rnk::bar();
+#endif
+ return x;
+}
+void bar() { puts("bar"); }
+int main() { return foo(0); }
}
+
+namespace OverloadedOperators {
+ template<typename T> struct A {
+ auto operator()() { return T{}; }
+ auto operator[](int) { return T{}; }
+ auto operator+(int) { return T{}; }
+ auto operator+() { return T{}; }
+ friend auto operator-(A) { return T{}; }
+ friend auto operator-(A, A) { return T{}; }
+ };
+ void f(A<int> a) {
+ int b = a();
+ int c = a[0];
+ int d = a + 0;
+ int e = +a;
+ int f = -a;
+ int g = a - a;
+ }
+}
diff --git a/test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp b/test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
new file mode 100644
index 000000000000..8bd4f4242c1d
--- /dev/null
+++ b/test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
@@ -0,0 +1,1363 @@
+// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only -fblocks -emit-llvm-only %s
+// DONTRUNYET: %clang_cc1 -std=c++1y -verify -fsyntax-only -fblocks -fdelayed-template-parsing %s -DDELAYED_TEMPLATE_PARSING
+// DONTRUNYET: %clang_cc1 -std=c++1y -verify -fsyntax-only -fblocks -fms-extensions %s -DMS_EXTENSIONS
+// DONTRUNYET: %clang_cc1 -std=c++1y -verify -fsyntax-only -fblocks -fdelayed-template-parsing -fms-extensions %s -DMS_EXTENSIONS -DDELAYED_TEMPLATE_PARSING
+
+constexpr int ODRUSE_SZ = sizeof(char);
+
+template<class T, int N>
+void f(T, const int (&)[N]) { }
+
+template<class T>
+void f(const T&, const int (&)[ODRUSE_SZ]) { }
+
+#define DEFINE_SELECTOR(x) \
+ int selector_ ## x[sizeof(x) == ODRUSE_SZ ? ODRUSE_SZ : ODRUSE_SZ + 5]
+
+#define F_CALL(x, a) f(x, selector_ ## a)
+
+// This is a risky assumption, because if an empty class gets captured by value
+// the lambda's size will still be '1'
+#define ASSERT_NO_CAPTURES(L) static_assert(sizeof(L) == 1, "size of closure with no captures must be 1")
+#define ASSERT_CLOSURE_SIZE_EXACT(L, N) static_assert(sizeof(L) == (N), "size of closure must be " #N)
+#define ASSERT_CLOSURE_SIZE(L, N) static_assert(sizeof(L) >= (N), "size of closure must be >=" #N)
+
+
+namespace sample {
+ struct X {
+ int i;
+ X(int i) : i(i) { }
+ };
+}
+
+namespace test_transformations_in_templates {
+template<class T> void foo(T t) {
+ auto L = [](auto a) { return a; };
+}
+template<class T> void foo2(T t) {
+ auto L = [](auto a) -> void {
+ auto M = [](char b) -> void {
+ auto N = [](auto c) -> void {
+ int selector[sizeof(c) == 1 ?
+ (sizeof(b) == 1 ? 1 : 2)
+ : 2
+ ]{};
+ };
+ N('a');
+ };
+ };
+ L(3.14);
+}
+
+void doit() {
+ foo(3);
+ foo('a');
+ foo2('A');
+}
+}
+
+namespace test_return_type_deduction {
+
+void doit() {
+
+ auto L = [](auto a, auto b) {
+ if ( a > b ) return a;
+ return b;
+ };
+ L(2, 4);
+ {
+ auto L2 = [](auto a, int i) {
+ return a + i;
+ };
+ L2(3.14, 2);
+ }
+ {
+ int a; //expected-note{{declared here}}
+ auto B = []() { return ^{ return a; }; }; //expected-error{{cannot be implicitly capture}}\
+ //expected-note{{begins here}}
+ //[](){ return ({int b = 5; return 'c'; 'x';}); };
+
+ //auto X = ^{ return a; };
+
+ //auto Y = []() -> auto { return 3; return 'c'; };
+
+ }
+}
+}
+
+
+namespace test_no_capture{
+void doit() {
+ const int x = 10; //expected-note{{declared here}}
+ {
+ // should not capture 'x' - variable undergoes lvalue-to-rvalue
+ auto L = [=](auto a) {
+ int y = x;
+ return a + y;
+ };
+ ASSERT_NO_CAPTURES(L);
+ }
+ {
+ // should not capture 'x' - even though certain instantiations require
+ auto L = [](auto a) { //expected-note{{begins here}}
+ DEFINE_SELECTOR(a);
+ F_CALL(x, a); //expected-error{{'x' cannot be implicitly captured}}
+ };
+ ASSERT_NO_CAPTURES(L);
+ L('s'); //expected-note{{in instantiation of}}
+ }
+ {
+ // Does not capture because no default capture in inner most lambda 'b'
+ auto L = [=](auto a) {
+ return [=](int p) {
+ return [](auto b) {
+ DEFINE_SELECTOR(a);
+ F_CALL(x, a);
+ return 0;
+ };
+ };
+ };
+ ASSERT_NO_CAPTURES(L);
+ }
+} // doit
+} // namespace
+
+namespace test_capture_of_potentially_evaluated_expression {
+void doit() {
+ const int x = 5;
+ {
+ auto L = [=](auto a) {
+ DEFINE_SELECTOR(a);
+ F_CALL(x, a);
+ };
+ static_assert(sizeof(L) == 4, "Must be captured");
+ }
+ {
+ int j = 0; //expected-note{{declared}}
+ auto L = [](auto a) { //expected-note{{begins here}}
+ return j + 1; //expected-error{{cannot be implicitly captured}}
+ };
+ }
+ {
+ const int x = 10;
+ auto L = [](auto a) {
+ //const int y = 20;
+ return [](int p) {
+ return [](auto b) {
+ DEFINE_SELECTOR(a);
+ F_CALL(x, a);
+ return 0;
+ };
+ };
+ };
+ auto M = L(3);
+ auto N = M(5);
+
+ }
+
+ { // if the nested capture does not implicitly or explicitly allow any captures
+ // nothing should capture - and instantiations will create errors if needed.
+ const int x = 0;
+ auto L = [=](auto a) { // <-- #A
+ const int y = 0;
+ return [](auto b) { // <-- #B
+ int c[sizeof(b)];
+ f(x, c);
+ f(y, c);
+ int i = x;
+ };
+ };
+ ASSERT_NO_CAPTURES(L);
+ auto M_int = L(2);
+ ASSERT_NO_CAPTURES(M_int);
+ }
+ { // Permutations of this example must be thoroughly tested!
+ const int x = 0;
+ sample::X cx{5};
+ auto L = [=](auto a) {
+ const int z = 3;
+ return [&,a](auto b) {
+ const int y = 5;
+ return [=](auto c) {
+ int d[sizeof(a) == sizeof(c) || sizeof(c) == sizeof(b) ? 2 : 1];
+ f(x, d);
+ f(y, d);
+ f(z, d);
+ decltype(a) A = a;
+ decltype(b) B = b;
+ const int &i = cx.i;
+ };
+ };
+ };
+ auto M = L(3)(3.5);
+ M(3.14);
+ }
+}
+namespace Test_no_capture_of_clearly_no_odr_use {
+auto foo() {
+ const int x = 10;
+ auto L = [=](auto a) {
+ return [=](auto b) {
+ return [=](auto c) {
+ int A = x;
+ return A;
+ };
+ };
+ };
+ auto M = L(1);
+ auto N = M(2.14);
+ ASSERT_NO_CAPTURES(L);
+ ASSERT_NO_CAPTURES(N);
+
+ return 0;
+}
+}
+
+namespace Test_capture_of_odr_use_var {
+auto foo() {
+ const int x = 10;
+ auto L = [=](auto a) {
+ return [=](auto b) {
+ return [=](auto c) {
+ int A = x;
+ const int &i = x;
+ decltype(a) A2 = a;
+ return A;
+ };
+ };
+ };
+ auto M_int = L(1);
+ auto N_int_int = M_int(2);
+ ASSERT_CLOSURE_SIZE_EXACT(L, sizeof(x));
+ // M_int captures both a & x
+ ASSERT_CLOSURE_SIZE_EXACT(M_int, sizeof(x) + sizeof(int));
+ // N_int_int captures both a & x
+ ASSERT_CLOSURE_SIZE_EXACT(N_int_int, sizeof(x) + sizeof(int));
+ auto M_double = L(3.14);
+ ASSERT_CLOSURE_SIZE(M_double, sizeof(x) + sizeof(double));
+
+ return 0;
+}
+auto run = foo();
+}
+
+}
+namespace more_nested_captures_1 {
+template<class T> struct Y {
+ static void f(int, double, ...) { }
+ template<class R>
+ static void f(const int&, R, ...) { }
+ template<class R>
+ void foo(R t) {
+ const int x = 10; //expected-note{{declared here}}
+ auto L = [](auto a) {
+ return [=](auto b) {
+ return [=](auto c) {
+ f(x, c, b, a); //expected-error{{reference to local variable 'x'}}
+ return 0;
+ };
+ };
+ };
+ auto M = L(t);
+ auto N = M('b');
+ N(3.14);
+ N(5); //expected-note{{in instantiation of}}
+ }
+};
+Y<int> yi;
+int run = (yi.foo(3.14), 0); //expected-note{{in instantiation of}}
+}
+
+
+namespace more_nested_captures_1_1 {
+template<class T> struct Y {
+ static void f(int, double, ...) { }
+ template<class R>
+ static void f(const int&, R, ...) { }
+ template<class R>
+ void foo(R t) {
+ const int x = 10; //expected-note{{declared here}}
+ auto L = [](auto a) {
+ return [=](char b) {
+ return [=](auto c) {
+ f(x, c, b, a); //expected-error{{reference to local variable 'x'}}
+ return 0;
+ };
+ };
+ };
+ auto M = L(t);
+ auto N = M('b');
+ N(3.14);
+ N(5); //expected-note{{in instantiation of}}
+ }
+};
+Y<int> yi;
+int run = (yi.foo(3.14), 0); //expected-note{{in instantiation of}}
+}
+namespace more_nested_captures_1_2 {
+template<class T> struct Y {
+ static void f(int, double, ...) { }
+ template<class R>
+ static void f(const int&, R, ...) { }
+ template<class R>
+ void foo(R t) {
+ const int x = 10;
+ auto L = [=](auto a) {
+ return [=](char b) {
+ return [=](auto c) {
+ f(x, c, b, a);
+ return 0;
+ };
+ };
+ };
+ auto M = L(t);
+ auto N = M('b');
+ N(3.14);
+ N(5);
+ }
+};
+Y<int> yi;
+int run = (yi.foo(3.14), 0);
+}
+
+namespace more_nested_captures_1_3 {
+template<class T> struct Y {
+ static void f(int, double, ...) { }
+ template<class R>
+ static void f(const int&, R, ...) { }
+ template<class R>
+ void foo(R t) {
+ const int x = 10; //expected-note{{declared here}}
+ auto L = [=](auto a) {
+ return [](auto b) {
+ const int y = 0;
+ return [=](auto c) {
+ f(x, c, b); //expected-error{{reference to local variable 'x'}}
+ f(y, b, c);
+ return 0;
+ };
+ };
+ };
+ auto M = L(t);
+ auto N = M('b');
+ N(3.14);
+ N(5); //expected-note{{in instantiation of}}
+ }
+};
+Y<int> yi;
+int run = (yi.foo(3.14), 0); //expected-note{{in instantiation of}}
+}
+
+
+namespace more_nested_captures_1_4 {
+template<class T> struct Y {
+ static void f(int, double, ...) { }
+ template<class R>
+ static void f(const int&, R, ...) { }
+ template<class R>
+ void foo(R t) {
+ const int x = 10; //expected-note{{declared here}}
+ auto L = [=](auto a) {
+ T t2{t};
+ return [](auto b) {
+ const int y = 0; //expected-note{{declared here}}
+ return [](auto c) { //expected-note 2{{lambda expression begins here}}
+ f(x, c); //expected-error{{variable 'x'}}
+ f(y, c); //expected-error{{variable 'y'}}
+ return 0;
+ };
+ };
+ };
+ auto M = L(t);
+ auto N_char = M('b');
+ N_char(3.14);
+ auto N_double = M(3.14);
+ N_double(3.14);
+ N_char(3); //expected-note{{in instantiation of}}
+ }
+};
+Y<int> yi;
+int run = (yi.foo('a'), 0); //expected-note{{in instantiation of}}
+}
+
+
+namespace more_nested_captures_2 {
+template<class T> struct Y {
+ static void f(int, double) { }
+ template<class R>
+ static void f(const int&, R) { }
+ template<class R>
+ void foo(R t) {
+ const int x = 10;
+ auto L = [=](auto a) {
+ return [=](auto b) {
+ return [=](auto c) {
+ f(x, c);
+ return 0;
+ };
+ };
+ };
+ auto M = L(t);
+ auto N = M('b');
+ N(3);
+ N(3.14);
+ }
+};
+Y<int> yi;
+int run = (yi.foo(3.14), 0);
+
+}
+
+namespace more_nested_captures_3 {
+template<class T> struct Y {
+ static void f(int, double) { }
+ template<class R>
+ static void f(const int&, R) { }
+ template<class R>
+ void foo(R t) {
+ const int x = 10; //expected-note{{declared here}}
+ auto L = [](auto a) {
+ return [=](auto b) {
+ return [=](auto c) {
+ f(x, c); //expected-error{{reference to local variable 'x'}}
+ return 0;
+ };
+ };
+ };
+ auto M = L(t);
+ auto N = M('b');
+ N(3); //expected-note{{in instantiation of}}
+ N(3.14);
+ }
+};
+Y<int> yi;
+int run = (yi.foo(3.14), 0); //expected-note{{in instantiation of}}
+
+}
+
+namespace more_nested_captures_4 {
+template<class T> struct Y {
+ static void f(int, double) { }
+ template<class R>
+ static void f(const int&, R) { }
+ template<class R>
+ void foo(R t) {
+ const int x = 10; //expected-note{{'x' declared here}}
+ auto L = [](auto a) {
+ return [=](char b) {
+ return [=](auto c) {
+ f(x, c); //expected-error{{reference to local variable 'x'}}
+ return 0;
+ };
+ };
+ };
+ auto M = L(t);
+ auto N = M('b');
+ N(3); //expected-note{{in instantiation of}}
+ N(3.14);
+ }
+};
+Y<int> yi;
+int run = (yi.foo(3.14), 0); //expected-note{{in instantiation of}}
+
+}
+
+namespace more_nested_captures_5 {
+template<class T> struct Y {
+ static void f(int, double) { }
+ template<class R>
+ static void f(const int&, R) { }
+ template<class R>
+ void foo(R t) {
+ const int x = 10;
+ auto L = [=](auto a) {
+ return [=](char b) {
+ return [=](auto c) {
+ f(x, c);
+ return 0;
+ };
+ };
+ };
+ auto M = L(t);
+ auto N = M('b');
+ N(3);
+ N(3.14);
+ }
+};
+Y<int> yi;
+int run = (yi.foo(3.14), 0);
+
+}
+
+namespace lambdas_in_NSDMIs {
+template<class T>
+ struct L {
+ T t{};
+ T t2 = ([](auto a) { return [](auto b) { return b; };})(t)(t);
+ T t3 = ([](auto a) { return a; })(t);
+ };
+ L<int> l;
+ int run = l.t2;
+}
+namespace test_nested_decltypes_in_trailing_return_types {
+int foo() {
+ auto L = [](auto a) {
+ return [](auto b, decltype(a) b2) -> decltype(a) {
+ return decltype(a){};
+ };
+ };
+ auto M = L(3.14);
+ M('a', 6.26);
+ return 0;
+}
+}
+
+namespace more_this_capture_1 {
+struct X {
+ void f(int) { }
+ static void f(double) { }
+ void foo() {
+ {
+ auto L = [=](auto a) {
+ f(a);
+ };
+ L(3);
+ L(3.13);
+ }
+ {
+ auto L = [](auto a) {
+ f(a); //expected-error{{this}}
+ };
+ L(3.13);
+ L(2); //expected-note{{in instantiation}}
+ }
+ }
+
+ int g() {
+ auto L = [=](auto a) {
+ return [](int i) {
+ return [=](auto b) {
+ f(b);
+ int x = i;
+ };
+ };
+ };
+ auto M = L(0.0);
+ auto N = M(3);
+ N(5.32); // OK
+ return 0;
+ }
+};
+int run = X{}.g();
+}
+namespace more_this_capture_1_1 {
+struct X {
+ void f(int) { }
+ static void f(double) { }
+
+ int g() {
+ auto L = [=](auto a) {
+ return [](int i) {
+ return [=](auto b) {
+ f(decltype(a){}); //expected-error{{this}}
+ int x = i;
+ };
+ };
+ };
+ auto M = L(0.0);
+ auto N = M(3);
+ N(5.32); // OK
+ L(3); // expected-note{{instantiation}}
+ return 0;
+ }
+};
+int run = X{}.g();
+}
+
+namespace more_this_capture_1_1_1 {
+struct X {
+ void f(int) { }
+ static void f(double) { }
+
+ int g() {
+ auto L = [=](auto a) {
+ return [](auto b) {
+ return [=](int i) {
+ f(b);
+ f(decltype(a){}); //expected-error{{this}}
+ };
+ };
+ };
+ auto M = L(0.0); // OK
+ auto N = M(3.3); //OK
+ auto M_int = L(0); //expected-note{{instantiation}}
+ return 0;
+ }
+};
+int run = X{}.g();
+}
+
+
+namespace more_this_capture_1_1_1_1 {
+struct X {
+ void f(int) { }
+ static void f(double) { }
+
+ int g() {
+ auto L = [=](auto a) {
+ return [](auto b) {
+ return [=](int i) {
+ f(b); //expected-error{{this}}
+ f(decltype(a){});
+ };
+ };
+ };
+ auto M_double = L(0.0); // OK
+ auto N = M_double(3); //expected-note{{instantiation}}
+
+ return 0;
+ }
+};
+int run = X{}.g();
+}
+
+namespace more_this_capture_2 {
+struct X {
+ void f(int) { }
+ static void f(double) { }
+
+ int g() {
+ auto L = [=](auto a) {
+ return [](int i) {
+ return [=](auto b) {
+ f(b); //expected-error{{'this' cannot}}
+ int x = i;
+ };
+ };
+ };
+ auto M = L(0.0);
+ auto N = M(3);
+ N(5); // NOT OK expected-note{{in instantiation of}}
+ return 0;
+ }
+};
+int run = X{}.g();
+}
+namespace diagnose_errors_early_in_generic_lambdas {
+
+int foo()
+{
+
+ { // This variable is used and must be caught early, do not need instantiation
+ const int x = 0; //expected-note{{declared}}
+ auto L = [](auto a) { //expected-note{{begins}}
+ const int &r = x; //expected-error{{variable}}
+ };
+ }
+ { // This variable is not used
+ const int x = 0;
+ auto L = [](auto a) {
+ int i = x;
+ };
+ }
+ {
+
+ const int x = 0; //expected-note{{declared}}
+ auto L = [=](auto a) { // <-- #A
+ const int y = 0;
+ return [](auto b) { //expected-note{{begins}}
+ int c[sizeof(b)];
+ f(x, c);
+ f(y, c);
+ int i = x;
+ // This use will always be an error regardless of instantatiation
+ // so diagnose this early.
+ const int &r = x; //expected-error{{variable}}
+ };
+ };
+
+ }
+ return 0;
+}
+
+int run = foo();
+}
+
+namespace generic_nongenerics_interleaved_1 {
+int foo() {
+ {
+ auto L = [](int a) {
+ int y = 10;
+ return [=](auto b) {
+ return a + y;
+ };
+ };
+ auto M = L(3);
+ M(5);
+ }
+ {
+ int x;
+ auto L = [](int a) {
+ int y = 10;
+ return [=](auto b) {
+ return a + y;
+ };
+ };
+ auto M = L(3);
+ M(5);
+ }
+ {
+ // FIXME: why are there 2 error messages here?
+ int x;
+ auto L = [](auto a) { //expected-note {{declared here}}
+ int y = 10; //expected-note {{declared here}}
+ return [](int b) { //expected-note 2{{expression begins here}}
+ return [=] (auto c) {
+ return a + y; //expected-error 2{{cannot be implicitly captured}}
+ };
+ };
+ };
+ }
+ {
+ int x;
+ auto L = [](auto a) {
+ int y = 10;
+ return [=](int b) {
+ return [=] (auto c) {
+ return a + y;
+ };
+ };
+ };
+ }
+ return 1;
+}
+
+int run = foo();
+}
+namespace dont_capture_refs_if_initialized_with_constant_expressions {
+
+auto foo(int i) {
+ // This is surprisingly not odr-used within the lambda!
+ static int j;
+ j = i;
+ int &ref_j = j;
+ return [](auto a) { return ref_j; }; // ok
+}
+
+template<class T>
+auto foo2(T t) {
+ // This is surprisingly not odr-used within the lambda!
+ static T j;
+ j = t;
+ T &ref_j = j;
+ return [](auto a) { return ref_j; }; // ok
+}
+
+int do_test() {
+ auto L = foo(3);
+ auto L_int = L(3);
+ auto L_char = L('a');
+ auto L1 = foo2(3.14);
+ auto L1_int = L1(3);
+ auto L1_char = L1('a');
+ return 0;
+}
+
+} // dont_capture_refs_if_initialized_with_constant_expressions
+
+namespace test_conversion_to_fptr {
+
+template<class T> struct X {
+
+ T (*fp)(T) = [](auto a) { return a; };
+
+};
+
+X<int> xi;
+
+template<class T>
+void fooT(T t, T (*fp)(T) = [](auto a) { return a; }) {
+ fp(t);
+}
+
+int test() {
+{
+ auto L = [](auto a) { return a; };
+ int (*fp)(int) = L;
+ fp(5);
+ L(3);
+ char (*fc)(char) = L;
+ fc('b');
+ L('c');
+ double (*fd)(double) = L;
+ fd(3.14);
+ fd(6.26);
+ L(4.25);
+}
+{
+ auto L = [](auto a) ->int { return a; }; //expected-note 2{{candidate template ignored}}
+ int (*fp)(int) = L;
+ char (*fc)(char) = L; //expected-error{{no viable conversion}}
+ double (*fd)(double) = L; //expected-error{{no viable conversion}}
+}
+{
+ int x = 5;
+ auto L = [=](auto b, char c = 'x') {
+ int i = x;
+ return [](auto a) ->decltype(a) { return a; };
+ };
+ int (*fp)(int) = L(8);
+ fp(5);
+ L(3);
+ char (*fc)(char) = L('a');
+ fc('b');
+ L('c');
+ double (*fd)(double) = L(3.14);
+ fd(3.14);
+ fd(6.26);
+
+}
+{
+ auto L = [=](auto b) {
+ return [](auto a) ->decltype(b)* { return (decltype(b)*)0; };
+ };
+ int* (*fp)(int) = L(8);
+ fp(5);
+ L(3);
+ char* (*fc)(char) = L('a');
+ fc('b');
+ L('c');
+ double* (*fd)(double) = L(3.14);
+ fd(3.14);
+ fd(6.26);
+}
+{
+ auto L = [=](auto b) {
+ return [](auto a) ->decltype(b)* { return (decltype(b)*)0; }; //expected-note{{candidate template ignored}}
+ };
+ char* (*fp)(int) = L('8');
+ fp(5);
+ char* (*fc)(char) = L('a');
+ fc('b');
+ double* (*fi)(int) = L(3.14);
+ fi(5);
+ int* (*fi2)(int) = L(3.14); //expected-error{{no viable conversion}}
+}
+
+{
+ auto L = [=](auto b) {
+ return [](auto a) {
+ return [=](auto c) {
+ return [](auto d) ->decltype(a + b + c + d) { return d; };
+ };
+ };
+ };
+ int (*fp)(int) = L('8')(3)(short{});
+ double (*fs)(char) = L(3.14)(short{})('4');
+}
+
+ fooT(3);
+ fooT('a');
+ fooT(3.14);
+ fooT("abcdefg");
+ return 0;
+}
+int run2 = test();
+
+}
+
+
+namespace this_capture {
+void f(char, int) { }
+template<class T>
+void f(T, const int&) { }
+
+struct X {
+ int x = 0;
+ void foo() {
+ auto L = [=](auto a) {
+ return [=](auto b) {
+ //f(a, x++);
+ x++;
+ };
+ };
+ L('a')(5);
+ L('b')(4);
+ L(3.14)('3');
+
+ }
+
+};
+
+int run = (X{}.foo(), 0);
+
+namespace this_capture_unresolvable {
+struct X {
+ void f(int) { }
+ static void f(double) { }
+
+ int g() {
+ auto lam = [=](auto a) { f(a); }; // captures 'this'
+ lam(0); // ok.
+ lam(0.0); // ok.
+ return 0;
+ }
+ int g2() {
+ auto lam = [](auto a) { f(a); }; // expected-error{{'this'}}
+ lam(0); // expected-note{{in instantiation of}}
+ lam(0.0); // ok.
+ return 0;
+ }
+ double (*fd)(double) = [](auto a) { f(a); return a; };
+
+};
+
+int run = X{}.g();
+
+}
+
+namespace check_nsdmi_and_this_capture_of_member_functions {
+
+struct FunctorDouble {
+ template<class T> FunctorDouble(T t) { t(2.14); };
+};
+struct FunctorInt {
+ template<class T> FunctorInt(T t) { t(2); }; //expected-note{{in instantiation of}}
+};
+
+template<class T> struct YUnresolvable {
+ void f(int) { }
+ static void f(double) { }
+
+ T t = [](auto a) { f(a); return a; };
+ T t2 = [=](auto b) { f(b); return b; };
+};
+
+template<class T> struct YUnresolvable2 {
+ void f(int) { }
+ static void f(double) { }
+
+ T t = [](auto a) { f(a); return a; }; //expected-error{{'this'}} \
+ //expected-note{{in instantiation of}}
+ T t2 = [=](auto b) { f(b); return b; };
+};
+
+
+YUnresolvable<FunctorDouble> yud;
+// This will cause an error since it call's with an int and calls a member function.
+YUnresolvable2<FunctorInt> yui;
+
+
+template<class T> struct YOnlyStatic {
+ static void f(double) { }
+
+ T t = [](auto a) { f(a); return a; };
+};
+YOnlyStatic<FunctorDouble> yos;
+template<class T> struct YOnlyNonStatic {
+ void f(int) { }
+
+ T t = [](auto a) { f(a); return a; }; //expected-error{{'this'}}
+};
+
+
+}
+
+
+namespace check_nsdmi_and_this_capture_of_data_members {
+
+struct FunctorDouble {
+ template<class T> FunctorDouble(T t) { t(2.14); };
+};
+struct FunctorInt {
+ template<class T> FunctorInt(T t) { t(2); };
+};
+
+template<class T> struct YThisCapture {
+ const int x = 10;
+ static double d;
+ T t = [](auto a) { return x; }; //expected-error{{'this'}}
+ T t2 = [](auto b) { return d; };
+ T t3 = [this](auto a) {
+ return [=](auto b) {
+ return x;
+ };
+ };
+ T t4 = [=](auto a) {
+ return [=](auto b) {
+ return x;
+ };
+ };
+ T t5 = [](auto a) {
+ return [=](auto b) {
+ return x; //expected-error{{'this'}}
+ };
+ };
+};
+
+template<class T> double YThisCapture<T>::d = 3.14;
+
+
+}
+
+
+#ifdef DELAYED_TEMPLATE_PARSING
+template<class T> void foo_no_error(T t) {
+ auto L = []()
+ { return t; };
+}
+template<class T> void foo(T t) { //expected-note 2{{declared here}}
+ auto L = []() //expected-note 2{{begins here}}
+ { return t; }; //expected-error 2{{cannot be implicitly captured}}
+}
+template void foo(int); //expected-note{{in instantiation of}}
+
+#else
+
+template<class T> void foo(T t) { //expected-note{{declared here}}
+ auto L = []() //expected-note{{begins here}}
+ { return t; }; //expected-error{{cannot be implicitly captured}}
+}
+
+#endif
+}
+
+namespace no_this_capture_for_static {
+
+struct X {
+ static void f(double) { }
+
+ int g() {
+ auto lam = [=](auto a) { f(a); };
+ lam(0); // ok.
+ ASSERT_NO_CAPTURES(lam);
+ return 0;
+ }
+};
+
+int run = X{}.g();
+}
+
+namespace this_capture_for_non_static {
+
+struct X {
+ void f(double) { }
+
+ int g() {
+ auto L = [=](auto a) { f(a); };
+ L(0);
+ auto L2 = [](auto a) { f(a); }; //expected-error {{cannot be implicitly captured}}
+ return 0;
+ }
+};
+
+int run = X{}.g();
+}
+
+namespace this_captures_with_num_args_disambiguation {
+
+struct X {
+ void f(int) { }
+ static void f(double, int i) { }
+ int g() {
+ auto lam = [](auto a) { f(a, a); };
+ lam(0);
+ return 0;
+ }
+};
+
+int run = X{}.g();
+}
+namespace enclosing_function_is_template_this_capture {
+// Only error if the instantiation tries to use the member function.
+struct X {
+ void f(int) { }
+ static void f(double) { }
+ template<class T>
+ int g(T t) {
+ auto L = [](auto a) { f(a); }; //expected-error{{'this'}}
+ L(t); // expected-note{{in instantiation of}}
+ return 0;
+ }
+};
+
+int run = X{}.g(0.0); // OK.
+int run2 = X{}.g(0); // expected-note{{in instantiation of}}
+
+
+}
+
+namespace enclosing_function_is_template_this_capture_2 {
+// This should error, even if not instantiated, since
+// this would need to be captured.
+struct X {
+ void f(int) { }
+ template<class T>
+ int g(T t) {
+ auto L = [](auto a) { f(a); }; //expected-error{{'this'}}
+ L(t);
+ return 0;
+ }
+};
+
+}
+
+
+namespace enclosing_function_is_template_this_capture_3 {
+// This should not error, this does not need to be captured.
+struct X {
+ static void f(int) { }
+ template<class T>
+ int g(T t) {
+ auto L = [](auto a) { f(a); };
+ L(t);
+ return 0;
+ }
+};
+
+int run = X{}.g(0.0); // OK.
+int run2 = X{}.g(0); // OK.
+
+}
+
+namespace nested_this_capture_1 {
+struct X {
+ void f(int) { }
+ static void f(double) { }
+
+ int g() {
+ auto L = [=](auto a) {
+ return [this]() {
+ return [=](auto b) {
+ f(b);
+ };
+ };
+ };
+ auto M = L(0);
+ auto N = M();
+ N(5);
+ return 0;
+ }
+};
+
+int run = X{}.g();
+
+}
+
+
+namespace nested_this_capture_2 {
+struct X {
+ void f(int) { }
+ static void f(double) { }
+
+ int g() {
+ auto L = [=](auto a) {
+ return [&]() {
+ return [=](auto b) {
+ f(b);
+ };
+ };
+ };
+ auto M = L(0);
+ auto N = M();
+ N(5);
+ N(3.14);
+ return 0;
+ }
+};
+
+int run = X{}.g();
+
+}
+
+namespace nested_this_capture_3_1 {
+struct X {
+ template<class T>
+ void f(int, T t) { }
+ template<class T>
+ static void f(double, T t) { }
+
+ int g() {
+ auto L = [=](auto a) {
+ return [&](auto c) {
+ return [=](auto b) {
+ f(b, c);
+ };
+ };
+ };
+ auto M = L(0);
+ auto N = M('a');
+ N(5);
+ N(3.14);
+ return 0;
+ }
+};
+
+int run = X{}.g();
+
+}
+
+
+namespace nested_this_capture_3_2 {
+struct X {
+ void f(int) { }
+ static void f(double) { }
+
+ int g() {
+ auto L = [=](auto a) {
+ return [](int i) {
+ return [=](auto b) {
+ f(b); //expected-error {{'this' cannot}}
+ int x = i;
+ };
+ };
+ };
+ auto M = L(0.0);
+ auto N = M(3);
+ N(5); //expected-note {{in instantiation of}}
+ N(3.14); // OK.
+ return 0;
+ }
+};
+
+int run = X{}.g();
+
+}
+
+namespace nested_this_capture_4 {
+struct X {
+ void f(int) { }
+ static void f(double) { }
+
+ int g() {
+ auto L = [](auto a) {
+ return [=](auto i) {
+ return [=](auto b) {
+ f(b); //expected-error {{'this' cannot}}
+ int x = i;
+ };
+ };
+ };
+ auto M = L(0.0);
+ auto N = M(3);
+ N(5); //expected-note {{in instantiation of}}
+ N(3.14); // OK.
+ return 0;
+ }
+};
+
+int run = X{}.g();
+
+}
+namespace capture_enclosing_function_parameters {
+
+
+inline auto foo(int x) {
+ int i = 10;
+ auto lambda = [=](auto z) { return x + z; };
+ return lambda;
+}
+
+int foo2() {
+ auto L = foo(3);
+ L(4);
+ L('a');
+ L(3.14);
+ return 0;
+}
+
+inline auto foo3(int x) {
+ int local = 1;
+ auto L = [=](auto a) {
+ int i = a[local];
+ return [=](auto b) mutable {
+ auto n = b;
+ return [&, n](auto c) mutable {
+ ++local;
+ return ++x;
+ };
+ };
+ };
+ auto M = L("foo-abc");
+ auto N = M("foo-def");
+ auto O = N("foo-ghi");
+
+ return L;
+}
+
+int main() {
+ auto L3 = foo3(3);
+ auto M3 = L3("L3-1");
+ auto N3 = M3("M3-1");
+ auto O3 = N3("N3-1");
+ N3("N3-2");
+ M3("M3-2");
+ M3("M3-3");
+ L3("L3-2");
+}
+} // end ns
+
+namespace capture_arrays {
+
+inline int sum_array(int n) {
+ int array2[5] = { 1, 2, 3, 4, 5};
+
+ auto L = [=](auto N) -> int {
+ int sum = 0;
+ int array[5] = { 1, 2, 3, 4, 5 };
+ sum += array2[sum];
+ sum += array2[N];
+ return 0;
+ };
+ L(2);
+ return L(n);
+}
+}
+
+namespace capture_non_odr_used_variable_because_named_in_instantiation_dependent_expressions {
+
+// even though 'x' is not odr-used, it should be captured.
+
+int test() {
+ const int x = 10;
+ auto L = [=](auto a) {
+ (void) +x + a;
+ };
+ ASSERT_CLOSURE_SIZE_EXACT(L, sizeof(x));
+}
+
+} //end ns
+#ifdef MS_EXTENSIONS
+namespace explicit_spec {
+template<class R> struct X {
+ template<class T> int foo(T t) {
+ auto L = [](auto a) { return a; };
+ L(&t);
+ return 0;
+ }
+
+ template<> int foo<char>(char c) { //expected-warning{{explicit specialization}}
+ const int x = 10;
+ auto LC = [](auto a) { return a; };
+ R r;
+ LC(&r);
+ auto L = [=](auto a) {
+ return [=](auto b) {
+ int d[sizeof(a)];
+ f(x, d);
+ };
+ };
+ auto M = L(1);
+
+ ASSERT_NO_CAPTURES(M);
+ return 0;
+ }
+
+};
+
+int run_char = X<int>{}.foo('a');
+int run_int = X<double>{}.foo(4);
+}
+
+#endif // MS_EXTENSIONS
+
diff --git a/test/SemaCXX/cxx1y-generic-lambdas.cpp b/test/SemaCXX/cxx1y-generic-lambdas.cpp
new file mode 100644
index 000000000000..20e06f48a1ce
--- /dev/null
+++ b/test/SemaCXX/cxx1y-generic-lambdas.cpp
@@ -0,0 +1,908 @@
+// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only -fblocks -emit-llvm-only %s
+// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only -fblocks -fdelayed-template-parsing %s -DDELAYED_TEMPLATE_PARSING
+// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only -fblocks -fms-extensions %s -DMS_EXTENSIONS
+// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only -fblocks -fdelayed-template-parsing -fms-extensions %s -DMS_EXTENSIONS -DDELAYED_TEMPLATE_PARSING
+
+namespace explicit_call {
+int test() {
+ auto L = [](auto a) { return a; };
+ L.operator()(3);
+ L.operator()<char>(3.14); //expected-warning{{implicit conversion}}
+ return 0;
+}
+} //end ns
+
+namespace test_conversion_to_fptr_2 {
+
+template<class T> struct X {
+
+ T (*fp)(T) = [](auto a) { return a; };
+
+};
+
+X<int> xi;
+
+template<class T>
+void fooT(T t, T (*fp)(T) = [](auto a) { return a; }) {
+ fp(t);
+}
+
+int test() {
+{
+ auto L = [](auto a) { return a; };
+ int (*fp)(int) = L;
+ fp(5);
+ L(3);
+ char (*fc)(char) = L;
+ fc('b');
+ L('c');
+ double (*fd)(double) = L;
+ fd(3.14);
+ fd(6.26);
+ L(4.25);
+}
+{
+ auto L = [](auto a) ->int { return a; }; //expected-note 2{{candidate template ignored}}
+ int (*fp)(int) = L;
+ char (*fc)(char) = L; //expected-error{{no viable conversion}}
+ double (*fd)(double) = L; //expected-error{{no viable conversion}}
+}
+{
+ int x = 5;
+ auto L = [=](auto b, char c = 'x') {
+ int i = x;
+ return [](auto a) ->decltype(a) { return a; };
+ };
+ int (*fp)(int) = L(8);
+ fp(5);
+ L(3);
+ char (*fc)(char) = L('a');
+ fc('b');
+ L('c');
+ double (*fd)(double) = L(3.14);
+ fd(3.14);
+ fd(6.26);
+
+}
+{
+ auto L = [=](auto b) {
+ return [](auto a) ->decltype(b)* { return (decltype(b)*)0; };
+ };
+ int* (*fp)(int) = L(8);
+ fp(5);
+ L(3);
+ char* (*fc)(char) = L('a');
+ fc('b');
+ L('c');
+ double* (*fd)(double) = L(3.14);
+ fd(3.14);
+ fd(6.26);
+}
+{
+ auto L = [=](auto b) {
+ return [](auto a) ->decltype(b)* { return (decltype(b)*)0; }; //expected-note{{candidate template ignored}}
+ };
+ char* (*fp)(int) = L('8');
+ fp(5);
+ char* (*fc)(char) = L('a');
+ fc('b');
+ double* (*fi)(int) = L(3.14);
+ fi(5);
+ int* (*fi2)(int) = L(3.14); //expected-error{{no viable conversion}}
+}
+
+{
+ auto L = [=](auto b) {
+ return [](auto a) {
+ return [=](auto c) {
+ return [](auto d) ->decltype(a + b + c + d) { return d; };
+ };
+ };
+ };
+ int (*fp)(int) = L('8')(3)(short{});
+ double (*fs)(char) = L(3.14)(short{})('4');
+}
+
+ fooT(3);
+ fooT('a');
+ fooT(3.14);
+ fooT("abcdefg");
+ return 0;
+}
+int run2 = test();
+
+}
+
+
+namespace test_conversion_to_fptr {
+
+void f1(int (*)(int)) { }
+void f2(char (*)(int)) { } // expected-note{{candidate}}
+void g(int (*)(int)) { } // #1 expected-note{{candidate}}
+void g(char (*)(char)) { } // #2 expected-note{{candidate}}
+void h(int (*)(int)) { } // #3
+void h(char (*)(int)) { } // #4
+
+int test() {
+{
+ auto glambda = [](auto a) { return a; };
+ glambda(1);
+ f1(glambda); // OK
+ f2(glambda); // expected-error{{no matching function}}
+ g(glambda); // expected-error{{call to 'g' is ambiguous}}
+ h(glambda); // OK: calls #3 since it is convertible from ID
+
+ int& (*fpi)(int*) = [](auto* a) -> auto& { return *a; }; // OK
+
+}
+{
+
+ auto L = [](auto a) { return a; };
+ int (*fp)(int) = L;
+ fp(5);
+ L(3);
+ char (*fc)(char) = L;
+ fc('b');
+ L('c');
+ double (*fd)(double) = L;
+ fd(3.14);
+ fd(6.26);
+ L(4.25);
+}
+{
+ auto L = [](auto a) ->int { return a; }; //expected-note 2{{candidate template ignored}}
+ int (*fp)(int) = L;
+ char (*fc)(char) = L; //expected-error{{no viable conversion}}
+ double (*fd)(double) = L; //expected-error{{no viable conversion}}
+}
+{
+ int* (*fp)(int*) = [](auto *a) -> auto* { return a; };
+ fp(0);
+}
+}
+
+namespace more_converion_to_ptr_to_function_tests {
+
+
+int test() {
+ {
+ int& (*fpi)(int*) = [](auto* a) -> auto& { return *a; }; // OK
+ int (*fp2)(int) = [](auto b) -> int { return b; };
+ int (*fp3)(char) = [](auto c) -> int { return c; };
+ char (*fp4)(int) = [](auto d) { return d; }; //expected-error{{no viable conversion}}\
+ //expected-note{{candidate template ignored}}
+ char (*fp5)(char) = [](auto e) -> int { return e; }; //expected-error{{no viable conversion}}\
+ //expected-note{{candidate template ignored}}
+
+ fp2(3);
+ fp3('\n');
+ fp3('a');
+ return 0;
+ }
+} // end test()
+
+template<class ... Ts> void vfun(Ts ... ) { }
+
+int variadic_test() {
+
+ int (*fp)(int, char, double) = [](auto ... a) -> int { vfun(a...); return 4; };
+ fp(3, '4', 3.14);
+
+ int (*fp2)(int, char, double) = [](auto ... a) { vfun(a...); return 4; };
+ fp(3, '4', 3.14);
+ return 2;
+}
+
+} // end ns
+
+namespace conversion_operator {
+void test() {
+ auto L = [](auto a) -> int { return a; };
+ int (*fp)(int) = L;
+ int (&fp2)(int) = [](auto a) { return a; }; // expected-error{{non-const lvalue}}
+ int (&&fp3)(int) = [](auto a) { return a; }; // expected-error{{no viable conversion}}\
+ //expected-note{{candidate}}
+ }
+}
+}
+
+namespace return_type_deduction_ok {
+ auto l = [](auto a) ->auto { return a; }(2);
+ auto l2 = [](auto a) ->decltype(auto) { return a; }(2);
+ auto l3 = [](auto a) { return a; }(2);
+
+}
+
+namespace generic_lambda_as_default_argument_ok {
+ void test(int i = [](auto a)->int { return a; }(3)) {
+ }
+}
+
+namespace nested_non_capturing_lambda_tests {
+template<class ... Ts> void print(Ts ...) { }
+int test() {
+{
+ auto L = [](auto a) {
+ return [](auto b) {
+ return b;
+ };
+ };
+ auto M = L(3);
+ M(4.15);
+ }
+{
+ int i = 10; //expected-note 3{{declared here}}
+ auto L = [](auto a) {
+ return [](auto b) { //expected-note 3{{begins here}}
+ i = b; //expected-error 3{{cannot be implicitly captured}}
+ return b;
+ };
+ };
+ auto M = L(3); //expected-note{{instantiation}}
+ M(4.15); //expected-note{{instantiation}}
+ }
+ {
+ int i = 10;
+ auto L = [](auto a) {
+ return [](auto b) {
+ b = sizeof(i); //ok
+ return b;
+ };
+ };
+ }
+ {
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ return [](auto b) ->decltype(a) {
+ print("b = ", b, "\n");
+ return b;
+ };
+ };
+ auto M = L(3);
+ M(4.15);
+ }
+
+{
+ auto L = [](auto a) ->decltype(a) {
+ print("a = ", a, "\n");
+ return [](auto b) ->decltype(a) { //expected-error{{no viable conversion}}\
+ //expected-note{{candidate template ignored}}
+ print("b = ", b, "\n");
+ return b;
+ };
+ };
+ auto M = L(3); //expected-note{{in instantiation of}}
+ }
+{
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ return [](auto ... b) ->decltype(a) {
+ print("b = ", b ..., "\n");
+ return 4;
+ };
+ };
+ auto M = L(3);
+ M(4.15, 3, "fv");
+}
+
+{
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ return [](auto ... b) ->decltype(a) {
+ print("b = ", b ..., "\n");
+ return 4;
+ };
+ };
+ auto M = L(3);
+ int (*fp)(double, int, const char*) = M;
+ fp(4.15, 3, "fv");
+}
+
+{
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ return [](char b) {
+ return [](auto ... c) ->decltype(b) {
+ print("c = ", c ..., "\n");
+ return 42;
+ };
+ };
+ };
+ L(4);
+ auto M = L(3);
+ M('a');
+ auto N = M('x');
+ N("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+ char (*np)(const char*, int, const char*, double, const char*, int) = N;
+ np("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+}
+
+
+{
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ return [](decltype(a) b) {
+ return [](auto ... c) ->decltype(b) {
+ print("c = ", c ..., "\n");
+ return 42;
+ };
+ };
+ };
+ L('4');
+ auto M = L('3');
+ M('a');
+ auto N = M('x');
+ N("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+ char (*np)(const char*, int, const char*, double, const char*, int) = N;
+ np("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+}
+
+
+{
+ struct X {
+ static void foo(double d) { }
+ void test() {
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ foo(a);
+ return [](decltype(a) b) {
+ foo(b);
+ foo(sizeof(a) + sizeof(b));
+ return [](auto ... c) ->decltype(b) {
+ print("c = ", c ..., "\n");
+ foo(decltype(b){});
+ foo(sizeof(decltype(a)*) + sizeof(decltype(b)*));
+ return 42;
+ };
+ };
+ };
+ L('4');
+ auto M = L('3');
+ M('a');
+ auto N = M('x');
+ N("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+ char (*np)(const char*, int, const char*, double, const char*, int) = N;
+ np("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+ }
+};
+X x;
+x.test();
+}
+// Make sure we can escape the function
+{
+ struct X {
+ static void foo(double d) { }
+ auto test() {
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ foo(a);
+ return [](decltype(a) b) {
+ foo(b);
+ foo(sizeof(a) + sizeof(b));
+ return [](auto ... c) ->decltype(b) {
+ print("c = ", c ..., "\n");
+ foo(decltype(b){});
+ foo(sizeof(decltype(a)*) + sizeof(decltype(b)*));
+ return 42;
+ };
+ };
+ };
+ return L;
+ }
+};
+ X x;
+ auto L = x.test();
+ L('4');
+ auto M = L('3');
+ M('a');
+ auto N = M('x');
+ N("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+ char (*np)(const char*, int, const char*, double, const char*, int) = N;
+ np("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+}
+
+{
+ struct X {
+ static void foo(double d) { }
+ auto test() {
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ foo(a);
+ return [](decltype(a) b) {
+ foo(b);
+ foo(sizeof(a) + sizeof(b));
+ return [](auto ... c) {
+ print("c = ", c ..., "\n");
+ foo(decltype(b){});
+ foo(sizeof(decltype(a)*) + sizeof(decltype(b)*));
+ return [](decltype(c) ... d) ->decltype(a) { //expected-note{{candidate}}
+ print("d = ", d ..., "\n");
+ foo(decltype(b){});
+ foo(sizeof(decltype(a)*) + sizeof(decltype(b)*));
+ return decltype(a){};
+ };
+ };
+ };
+ };
+ return L;
+ }
+};
+ X x;
+ auto L = x.test();
+ L('4');
+ auto M = L('3');
+ M('a');
+ auto N = M('x');
+ auto O = N("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+ char (*np)(const char*, int, const char*, double, const char*, int) = O;
+ np("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+ int (*np2)(const char*, int, const char*, double, const char*, int) = O; // expected-error{{no viable conversion}}
+
+}
+} // end test()
+
+namespace wrapped_within_templates {
+
+namespace explicit_return {
+template<class T> int fooT(T t) {
+ auto L = [](auto a) -> void {
+ auto M = [](char b) -> void {
+ auto N = [](auto c) -> void {
+ int x = 0;
+ x = sizeof(a);
+ x = sizeof(b);
+ x = sizeof(c);
+ };
+ N('a');
+ N(decltype(a){});
+ };
+ };
+ L(t);
+ L(3.14);
+ return 0;
+}
+
+int run = fooT('a') + fooT(3.14);
+
+} // end explicit_return
+
+namespace implicit_return_deduction {
+template<class T> auto fooT(T t) {
+ auto L = [](auto a) {
+ auto M = [](char b) {
+ auto N = [](auto c) {
+ int x = 0;
+ x = sizeof(a);
+ x = sizeof(b);
+ x = sizeof(c);
+ };
+ N('a');
+ N(decltype(a){});
+ };
+ };
+ L(t);
+ L(3.14);
+ return 0;
+}
+
+int run = fooT('a') + fooT(3.14);
+
+template<class ... Ts> void print(Ts ... ts) { }
+
+template<class F, class ... Rest> using first = F;
+
+template<class ... Ts> auto fooV(Ts ... ts) {
+ auto L = [](auto ... a) {
+ auto M = [](decltype(a) ... b) {
+ auto N = [](auto c) {
+ int x = 0;
+ x = sizeof...(a);
+ x = sizeof...(b);
+ x = sizeof(c);
+ };
+ N('a');
+ N(N);
+ N(first<Ts...>{});
+ };
+ M(a...);
+ print("a = ", a..., "\n");
+ };
+ L(L, ts...);
+ print("ts = ", ts..., "\n");
+ return 0;
+}
+
+int run2 = fooV(3.14, " ", '4', 5) + fooV("BC", 3, 2.77, 'A', float{}, short{}, unsigned{});
+
+} //implicit_return_deduction
+
+
+} //wrapped_within_templates
+
+namespace at_ns_scope {
+ void foo(double d) { }
+ auto test() {
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ foo(a);
+ return [](decltype(a) b) {
+ foo(b);
+ foo(sizeof(a) + sizeof(b));
+ return [](auto ... c) {
+ print("c = ", c ..., "\n");
+ foo(decltype(b){});
+ foo(sizeof(decltype(a)*) + sizeof(decltype(b)*));
+ return [](decltype(c) ... d) ->decltype(a) { //expected-note{{candidate}}
+ print("d = ", d ..., "\n");
+ foo(decltype(b){});
+ foo(sizeof(decltype(a)*) + sizeof(decltype(b)*));
+ return decltype(a){};
+ };
+ };
+ };
+ };
+ return L;
+ }
+auto L = test();
+auto L_test = L('4');
+auto M = L('3');
+auto M_test = M('a');
+auto N = M('x');
+auto O = N("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+char (*np)(const char*, int, const char*, double, const char*, int) = O;
+auto NP_result = np("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+int (*np2)(const char*, int, const char*, double, const char*, int) = O; // expected-error{{no viable conversion}}
+
+
+
+}
+
+namespace variadic_tests_1 {
+template<class ... Ts> void print(Ts ... ts) { }
+
+template<class F, class ... Rest> using FirstType = F;
+template<class F, class ... Rest> F& FirstArg(F& f, Rest...) { return f; }
+
+template<class ... Ts> int fooV(Ts ... ts) {
+ auto L = [](auto ... a) -> void {
+ auto M = [](decltype(a) ... b) -> void {
+ auto N = [](auto c) -> void {
+ int x = 0;
+ x = sizeof...(a);
+ x = sizeof...(b);
+ x = sizeof(c);
+ };
+ N('a');
+ N(N);
+ N(FirstType<Ts...>{});
+ };
+ M(a...);
+ print("a = ", a..., "\n");
+ };
+ L(L, ts...);
+ print("ts = ", ts..., "\n");
+ return 0;
+}
+
+int run2 = fooV(3.14, " ", '4', 5) + fooV("BC", 3, 2.77, 'A', float{}, short{}, unsigned{});
+
+namespace more_variadic_1 {
+
+template<class ... Ts> int fooV(Ts ... ts) {
+ auto L = [](auto ... a) {
+ auto M = [](decltype(a) ... b) -> void {
+ auto N = [](auto c) -> void {
+ int x = 0;
+ x = sizeof...(a);
+ x = sizeof...(b);
+ x = sizeof(c);
+ };
+ N('a');
+ N(N);
+ N(FirstType<Ts...>{});
+ };
+ M(a...);
+ return M;
+ };
+ auto M = L(L, ts...);
+ decltype(L(L, ts...)) (*fp)(decltype(L), decltype(ts) ...) = L;
+ void (*fp2)(decltype(L), decltype(ts) ...) = L(L, ts...);
+
+ {
+ auto L = [](auto ... a) {
+ auto M = [](decltype(a) ... b) {
+ auto N = [](auto c) -> void {
+ int x = 0;
+ x = sizeof...(a);
+ x = sizeof...(b);
+ x = sizeof(c);
+ };
+ N('a');
+ N(N);
+ N(FirstType<Ts...>{});
+ return N;
+ };
+ M(a...);
+ return M;
+ };
+ auto M = L(L, ts...);
+ decltype(L(L, ts...)) (*fp)(decltype(L), decltype(ts) ...) = L;
+ fp(L, ts...);
+ decltype(L(L, ts...)(L, ts...)) (*fp2)(decltype(L), decltype(ts) ...) = L(L, ts...);
+ fp2 = fp(L, ts...);
+ void (*fp3)(char) = fp2(L, ts...);
+ fp3('a');
+ }
+ return 0;
+}
+
+int run2 = fooV(3.14, " ", '4', 5) + fooV("BC", 3, 2.77, 'A', float{}, short{}, unsigned{});
+
+
+} //end ns more_variadic_1
+
+} // end ns variadic_tests_1
+
+namespace at_ns_scope_within_class_member {
+ struct X {
+ static void foo(double d) { }
+ auto test() {
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ foo(a);
+ return [](decltype(a) b) {
+ foo(b);
+ foo(sizeof(a) + sizeof(b));
+ return [](auto ... c) {
+ print("c = ", c ..., "\n");
+ foo(decltype(b){});
+ foo(sizeof(decltype(a)*) + sizeof(decltype(b)*));
+ return [](decltype(c) ... d) ->decltype(a) { //expected-note{{candidate}}
+ print("d = ", d ..., "\n");
+ foo(decltype(b){});
+ foo(sizeof(decltype(a)*) + sizeof(decltype(b)*));
+ return decltype(a){};
+ };
+ };
+ };
+ };
+ return L;
+ }
+};
+X x;
+auto L = x.test();
+auto L_test = L('4');
+auto M = L('3');
+auto M_test = M('a');
+auto N = M('x');
+auto O = N("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+char (*np)(const char*, int, const char*, double, const char*, int) = O;
+auto NP_result = np("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+int (*np2)(const char*, int, const char*, double, const char*, int) = O; // expected-error{{no viable conversion}}
+
+} //end at_ns_scope_within_class_member
+
+
+namespace at_ns_scope_within_class_template_member {
+ struct X {
+ static void foo(double d) { }
+ template<class T = int>
+ auto test(T = T{}) {
+ auto L = [](auto a) {
+ print("a = ", a, "\n");
+ foo(a);
+ return [](decltype(a) b) {
+ foo(b);
+ foo(sizeof(a) + sizeof(b));
+ return [](auto ... c) {
+ print("c = ", c ..., "\n");
+ foo(decltype(b){});
+ foo(sizeof(decltype(a)*) + sizeof(decltype(b)*));
+ return [](decltype(c) ... d) ->decltype(a) { //expected-note{{candidate}}
+ print("d = ", d ..., "\n");
+ foo(decltype(b){});
+ foo(sizeof(decltype(a)*) + sizeof(decltype(b)*));
+ return decltype(a){};
+ };
+ };
+ };
+ };
+ return L;
+ }
+
+};
+X x;
+auto L = x.test();
+auto L_test = L('4');
+auto M = L('3');
+auto M_test = M('a');
+auto N = M('x');
+auto O = N("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+char (*np)(const char*, int, const char*, double, const char*, int) = O;
+auto NP_result = np("\n3 = ", 3, "\n6.14 = ", 6.14, "\n4'123'456 = ", 4'123'456);
+int (*np2)(const char*, int, const char*, double, const char*, int) = O; // expected-error{{no viable conversion}}
+
+} //end at_ns_scope_within_class_member
+
+
+namespace nested_generic_lambdas_123 {
+void test() {
+ auto L = [](auto a) -> int {
+ auto M = [](auto b, decltype(a) b2) -> int {
+ return 1;
+ };
+ M(a, a);
+ };
+ L(3);
+}
+template<class T> void foo(T) {
+ auto L = [](auto a) { return a; };
+}
+template void foo(int);
+} // end ns nested_generic_lambdas_123
+
+namespace nested_fptr_235 {
+int test()
+{
+ auto L = [](auto b) {
+ return [](auto a) ->decltype(a) { return a; };
+ };
+ int (*fp)(int) = L(8);
+ fp(5);
+ L(3);
+ char (*fc)(char) = L('a');
+ fc('b');
+ L('c');
+ double (*fd)(double) = L(3.14);
+ fd(3.14);
+ fd(6.26);
+ return 0;
+}
+int run = test();
+}
+
+
+namespace fptr_with_decltype_return_type {
+template<class F, class ... Ts> using FirstType = F;
+template<class F, class ... Rest> F& FirstArg(F& f, Rest& ... r) { return f; };
+template<class ... Ts> auto vfun(Ts&& ... ts) {
+ print(ts...);
+ return FirstArg(ts...);
+}
+int test()
+{
+ {
+ auto L = [](auto ... As) {
+ return [](auto b) ->decltype(b) {
+ vfun([](decltype(As) a) -> decltype(a) { return a; } ...)(FirstType<decltype(As)...>{});
+ return decltype(b){};
+ };
+ };
+ auto LL = L(1, 'a', 3.14, "abc");
+ LL("dim");
+ }
+ return 0;
+}
+int run = test();
+}
+
+} // end ns nested_non_capturing_lambda_tests
+
+namespace PR17476 {
+struct string {
+ string(const char *__s) { }
+ string &operator+=(const string &__str) { return *this; }
+};
+
+template <class T>
+void finalizeDefaultAtomValues() {
+ auto startEnd = [](const char * sym) -> void {
+ string start("__");
+ start += sym;
+ };
+ startEnd("preinit_array");
+}
+
+void f() { finalizeDefaultAtomValues<char>(); }
+
+}
+
+namespace PR17476_variant {
+struct string {
+ string(const char *__s) { }
+ string &operator+=(const string &__str) { return *this; }
+};
+
+template <class T>
+void finalizeDefaultAtomValues() {
+ auto startEnd = [](const T *sym) -> void {
+ string start("__");
+ start += sym;
+ };
+ startEnd("preinit_array");
+}
+
+void f() { finalizeDefaultAtomValues<char>(); }
+
+}
+
+namespace PR17877_lambda_declcontext_and_get_cur_lambda_disconnect {
+
+
+template<class T> struct U {
+ int t = 0;
+};
+
+template<class T>
+struct V {
+ U<T> size() const { return U<T>{}; }
+};
+
+template<typename T>
+void Do() {
+ V<int> v{};
+ [=] { v.size(); };
+}
+
+}
+
+namespace inclass_lambdas_within_nested_classes {
+namespace ns1 {
+
+struct X1 {
+ struct X2 {
+ enum { E = [](auto i) { return i; }(3) }; //expected-error{{inside of a constant expression}}\
+ //expected-error{{not an integral constant}}
+ int L = ([] (int i) { return i; })(2);
+ void foo(int i = ([] (int i) { return i; })(2)) { }
+ int B : ([](int i) { return i; })(3); //expected-error{{inside of a constant expression}}\
+ //expected-error{{not an integral constant}}
+ int arr[([](int i) { return i; })(3)]; //expected-error{{inside of a constant expression}}\
+ //expected-error{{must have a constant size}}
+ int (*fp)(int) = [](int i) { return i; };
+ void fooptr(int (*fp)(char) = [](char c) { return 0; }) { }
+ int L2 = ([](auto i) { return i; })(2);
+ void fooG(int i = ([] (auto i) { return i; })(2)) { }
+ int BG : ([](auto i) { return i; })(3); //expected-error{{inside of a constant expression}} \
+ //expected-error{{not an integral constant}}
+ int arrG[([](auto i) { return i; })(3)]; //expected-error{{inside of a constant expression}}\
+ //expected-error{{must have a constant size}}
+ int (*fpG)(int) = [](auto i) { return i; };
+ void fooptrG(int (*fp)(char) = [](auto c) { return 0; }) { }
+ };
+};
+} //end ns
+
+namespace ns2 {
+struct X1 {
+ template<class T>
+ struct X2 {
+ int L = ([] (T i) { return i; })(2);
+ void foo(int i = ([] (int i) { return i; })(2)) { }
+ int B : ([](T i) { return i; })(3); //expected-error{{inside of a constant expression}}\
+ //expected-error{{not an integral constant}}
+ int arr[([](T i) { return i; })(3)]; //expected-error{{inside of a constant expression}}\
+ //expected-error{{must have a constant size}}
+ int (*fp)(T) = [](T i) { return i; };
+ void fooptr(T (*fp)(char) = [](char c) { return 0; }) { }
+ int L2 = ([](auto i) { return i; })(2);
+ void fooG(T i = ([] (auto i) { return i; })(2)) { }
+ int BG : ([](auto i) { return i; })(3); //expected-error{{not an integral constant}}
+ int arrG[([](auto i) { return i; })(3)]; //expected-error{{must have a constant size}}
+ int (*fpG)(T) = [](auto i) { return i; };
+ void fooptrG(T (*fp)(char) = [](auto c) { return 0; }) { }
+ template<class U = char> int fooG2(T (*fp)(U) = [](auto a) { return 0; }) { return 0; }
+ template<class U = char> int fooG3(T (*fp)(U) = [](auto a) { return 0; });
+ };
+};
+template<class T>
+template<class U>
+int X1::X2<T>::fooG3(T (*fp)(U)) { return 0; }
+X1::X2<int> x2; //expected-note 3{{in instantiation of}}
+int run1 = x2.fooG2();
+int run2 = x2.fooG3();
+} // end ns
+
+
+
+} //end ns inclass_lambdas_within_nested_classes \ No newline at end of file
diff --git a/test/SemaCXX/cxx1y-init-captures.cpp b/test/SemaCXX/cxx1y-init-captures.cpp
new file mode 100644
index 000000000000..2cb4d31ffc4b
--- /dev/null
+++ b/test/SemaCXX/cxx1y-init-captures.cpp
@@ -0,0 +1,169 @@
+// RUN: %clang_cc1 -std=c++1y %s -verify -emit-llvm-only
+
+namespace variadic_expansion {
+ int f(int &, char &) { return 0; }
+ template<class ... Ts> char fv(Ts ... ts) { return 0; }
+ // FIXME: why do we get 2 error messages
+ template <typename ... T> void g(T &... t) { //expected-note3{{declared here}}
+ f([&a(t)]()->decltype(auto) {
+ return a;
+ }() ...);
+
+ auto L = [x = f([&a(t)]()->decltype(auto) { return a; }()...)]() { return x; };
+ const int y = 10;
+ auto M = [x = y,
+ &z = y](T& ... t) { };
+ auto N = [x = y,
+ &z = y, n = f(t...),
+ o = f([&a(t)](T& ... t)->decltype(auto) { return a; }(t...)...), t...](T& ... s) {
+ fv([&a(t)]()->decltype(auto) {
+ return a;
+ }() ...);
+ };
+ auto N2 = [x = y, //expected-note3{{begins here}}
+ &z = y, n = f(t...),
+ o = f([&a(t)](T& ... t)->decltype(auto) { return a; }(t...)...)](T& ... s) {
+ fv([&a(t)]()->decltype(auto) { //expected-error 3{{captured}}
+ return a;
+ }() ...);
+ };
+
+ }
+
+ void h(int i, char c) { g(i, c); } //expected-note{{in instantiation}}
+}
+
+namespace odr_use_within_init_capture {
+
+int test() {
+
+ { // no captures
+ const int x = 10;
+ auto L = [z = x + 2](int a) {
+ auto M = [y = x - 2](char b) {
+ return y;
+ };
+ return M;
+ };
+
+ }
+ { // should not capture
+ const int x = 10;
+ auto L = [&z = x](int a) {
+ return a;;
+ };
+
+ }
+ {
+ const int x = 10;
+ auto L = [k = x](char a) { //expected-note {{declared}}
+ return [](int b) { //expected-note {{begins}}
+ return [j = k](int c) { //expected-error {{cannot be implicitly captured}}
+ return c;
+ };
+ };
+ };
+ }
+ {
+ const int x = 10;
+ auto L = [k = x](char a) {
+ return [=](int b) {
+ return [j = k](int c) {
+ return c;
+ };
+ };
+ };
+ }
+ {
+ const int x = 10;
+ auto L = [k = x](char a) {
+ return [k](int b) {
+ return [j = k](int c) {
+ return c;
+ };
+ };
+ };
+ }
+
+ return 0;
+}
+
+int run = test();
+
+}
+
+namespace odr_use_within_init_capture_template {
+
+template<class T = int>
+int test(T t = T{}) {
+
+ { // no captures
+ const T x = 10;
+ auto L = [z = x](char a) {
+ auto M = [y = x](T b) {
+ return y;
+ };
+ return M;
+ };
+
+ }
+ { // should not capture
+ const T x = 10;
+ auto L = [&z = x](T a) {
+ return a;;
+ };
+
+ }
+ { // will need to capture x in outer lambda
+ const T x = 10; //expected-note {{declared}}
+ auto L = [z = x](char a) { //expected-note {{begins}}
+ auto M = [&y = x](T b) { //expected-error {{cannot be implicitly captured}}
+ return y;
+ };
+ return M;
+ };
+
+ }
+ { // will need to capture x in outer lambda
+ const T x = 10;
+ auto L = [=,z = x](char a) {
+ auto M = [&y = x](T b) {
+ return y;
+ };
+ return M;
+ };
+
+ }
+ { // will need to capture x in outer lambda
+ const T x = 10;
+ auto L = [x, z = x](char a) {
+ auto M = [&y = x](T b) {
+ return y;
+ };
+ return M;
+ };
+ }
+ { // will need to capture x in outer lambda
+ const int x = 10; //expected-note 2{{declared}}
+ auto L = [z = x](char a) { //expected-note 2{{begins}}
+ auto M = [&y = x](T b) { //expected-error 2{{cannot be implicitly captured}}
+ return y;
+ };
+ return M;
+ };
+ }
+ {
+ // no captures
+ const T x = 10;
+ auto L = [z =
+ [z = x, &y = x](char a) { return z + y; }('a')](char a)
+ { return z; };
+
+ }
+
+ return 0;
+}
+
+int run = test(); //expected-note {{instantiation}}
+
+} \ No newline at end of file
diff --git a/test/SemaCXX/cxx1y-sized-deallocation.cpp b/test/SemaCXX/cxx1y-sized-deallocation.cpp
new file mode 100644
index 000000000000..81a8eeb6df93
--- /dev/null
+++ b/test/SemaCXX/cxx1y-sized-deallocation.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -std=c++1y -verify %s -fsized-deallocation -fexceptions -fcxx-exceptions
+
+using size_t = decltype(sizeof(0));
+
+void f(void *p, void *q) {
+ // OK, implicitly declared.
+ operator delete(p, 8);
+ operator delete[](q, 12);
+ static_assert(noexcept(operator delete(p, 8)), "");
+ static_assert(noexcept(operator delete[](q, 12)), "");
+}
+
+void *operator new(size_t bad, size_t idea);
+struct S { S() { throw 0; } };
+void g() {
+ new (123) S; // expected-error {{'new' expression with placement arguments refers to non-placement 'operator delete'}}
+}
diff --git a/test/SemaCXX/cxx1y-user-defined-literals.cpp b/test/SemaCXX/cxx1y-user-defined-literals.cpp
new file mode 100644
index 000000000000..fa4ff03fad7f
--- /dev/null
+++ b/test/SemaCXX/cxx1y-user-defined-literals.cpp
@@ -0,0 +1,44 @@
+// RUN: %clang_cc1 -std=c++1y %s -include %s -verify
+
+#ifndef INCLUDED
+#define INCLUDED
+
+#pragma clang system_header
+namespace std {
+ using size_t = decltype(sizeof(0));
+
+ struct duration {};
+ duration operator""ns(unsigned long long);
+ duration operator""us(unsigned long long);
+ duration operator""ms(unsigned long long);
+ duration operator""s(unsigned long long);
+ duration operator""min(unsigned long long);
+ duration operator""h(unsigned long long);
+
+ struct string {};
+ string operator""s(const char*, size_t);
+
+ template<typename T> struct complex {};
+ complex<float> operator""if(long double);
+ complex<float> operator""if(unsigned long long);
+ complex<double> operator""i(long double);
+ complex<double> operator""i(unsigned long long);
+ complex<long double> operator""il(long double);
+ complex<long double> operator""il(unsigned long long);
+}
+
+#else
+
+using namespace std;
+duration a = 1ns, b = 1us, c = 1ms, d = 1s, e = 1min, f = 1h;
+string s = "foo"s;
+char error = 'x's; // expected-error {{invalid suffix}} expected-error {{expected ';'}}
+
+int _1z = 1z; // expected-error {{invalid suffix}}
+int _1b = 1b; // expected-error {{invalid digit}}
+
+complex<float> cf1 = 1if, cf2 = 2.if, cf3 = 0x3if;
+complex<double> cd1 = 1i, cd2 = 2.i, cd3 = 0b0110101i;
+complex<long double> cld1 = 1il, cld2 = 2.il, cld3 = 0047il;
+
+#endif
diff --git a/test/SemaCXX/cxx1y-variable-templates_in_class.cpp b/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
new file mode 100644
index 000000000000..94d0f16f06ed
--- /dev/null
+++ b/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
@@ -0,0 +1,299 @@
+// RUN: %clang_cc1 -verify -fsyntax-only %s -Wno-c++11-extensions -Wno-c++1y-extensions -DPRECXX11
+// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -Wno-c++1y-extensions %s
+// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only %s
+
+#define CONST const
+
+#ifdef PRECXX11
+#define static_assert(expr, msg) typedef int static_assert[(expr) ? 1 : -1];
+#endif
+
+class A {
+ template<typename T> CONST T wrong; // expected-error {{member 'wrong' declared as a template}}
+ template<typename T> CONST T wrong_init = 5; // expected-error {{member 'wrong_init' declared as a template}}
+ template<typename T, typename T0> static CONST T right = T(100);
+ template<typename T> static CONST T right<T,int> = 5;
+ template<typename T> CONST int right<int,T>; // expected-error {{member 'right' declared as a template}}
+ template<typename T> CONST float right<float,T> = 5; // expected-error {{member 'right' declared as a template}}
+ template<> static CONST int right<int,int> = 7; // expected-error {{explicit specialization of 'right' in class scope}}
+ template<> static CONST float right<float,int>; // expected-error {{explicit specialization of 'right' in class scope}}
+ template static CONST int right<int,int>; // expected-error {{template specialization requires 'template<>'}} \
+ // expected-error {{explicit specialization of 'right' in class scope}}
+};
+
+namespace out_of_line {
+ class B0 {
+ template<typename T, typename T0> static CONST T right = T(100);
+ template<typename T> static CONST T right<T,int> = T(5);
+ };
+ template<> CONST int B0::right<int,int> = 7;
+ template CONST int B0::right<int,int>;
+ template<> CONST int B0::right<int,float>;
+ template CONST int B0::right<int,float>;
+
+ class B1 {
+ template<typename T, typename T0> static CONST T right;
+ template<typename T> static CONST T right<T,int>;
+ };
+ template<typename T, typename T0> CONST T B1::right = T(100);
+ template<typename T> CONST T B1::right<T,int> = T(5);
+
+ class B2 {
+ template<typename T, typename T0> static CONST T right = T(100); // expected-note {{previous definition is here}}
+ template<typename T> static CONST T right<T,int> = T(5); // expected-note {{previous definition is here}}
+ };
+ template<typename T, typename T0> CONST T B2::right = T(100); // expected-error {{redefinition of 'right'}}
+ template<typename T> CONST T B2::right<T,int> = T(5); // expected-error {{redefinition of 'right'}}
+
+ class B3 {
+ template<typename T, typename T0> static CONST T right = T(100);
+ template<typename T> static CONST T right<T,int> = T(5);
+ };
+ template<typename T, typename T0> CONST T B3::right;
+ template<typename T> CONST T B3::right<T,int>;
+
+ class B4 {
+ template<typename T, typename T0> static CONST T a;
+ template<typename T> static CONST T a<T,int> = T(100);
+ template<typename T, typename T0> static CONST T b = T(100);
+ template<typename T> static CONST T b<T,int>;
+ };
+ template<typename T, typename T0> CONST T B4::a; // expected-error {{default initialization of an object of const type 'const int'}}
+ template<typename T> CONST T B4::a<T,int>;
+ template CONST int B4::a<int,char>; // expected-note {{in instantiation of}}
+ template CONST int B4::a<int,int>;
+
+ template<typename T, typename T0> CONST T B4::b;
+ template<typename T> CONST T B4::b<T,int>; // expected-error {{default initialization of an object of const type 'const int'}}
+ template CONST int B4::b<int,char>;
+ template CONST int B4::b<int,int>; // expected-note {{in instantiation of}}
+}
+
+namespace non_const_init {
+ class A {
+ template<typename T> static T wrong_inst_undefined = T(10); // expected-note {{refers here}}
+ template<typename T> static T wrong_inst_defined = T(10); // expected-error {{non-const static data member must be initialized out of line}}
+ template<typename T> static T wrong_inst_out_of_line;
+ };
+
+ template const int A::wrong_inst_undefined<const int>; // expected-error {{undefined}}
+
+ template<typename T> T A::wrong_inst_defined;
+ template const int A::wrong_inst_defined<const int>;
+ template int A::wrong_inst_defined<int>; // expected-note {{in instantiation of static data member 'non_const_init::A::wrong_inst_defined<int>' requested here}}
+
+ template<typename T> T A::wrong_inst_out_of_line = T(10);
+ template int A::wrong_inst_out_of_line<int>;
+
+ class B {
+ template<typename T> static T wrong_inst; // expected-note {{refers here}}
+ template<typename T> static T wrong_inst<T*> = T(100); // expected-error {{non-const static data member must be initialized out of line}} expected-note {{refers here}}
+
+ template<typename T> static T wrong_inst_fixed;
+ template<typename T> static T wrong_inst_fixed<T*>;
+ };
+ template int B::wrong_inst<int>; // expected-error {{undefined}}
+ // FIXME: It'd be better to produce the 'explicit instantiation of undefined
+ // template' diagnostic here, not the 'must be initialized out of line'
+ // diagnostic.
+ template int B::wrong_inst<int*>; // expected-note {{in instantiation of static data member 'non_const_init::B::wrong_inst<int *>' requested here}}
+ template const int B::wrong_inst<const int*>; // expected-error {{undefined}}
+ template<typename T> T B::wrong_inst_fixed = T(100);
+ template int B::wrong_inst_fixed<int>;
+
+ class C {
+ template<typename T> static CONST T right_inst = T(10); // expected-note {{here}}
+ template<typename T> static CONST T right_inst<T*> = T(100); // expected-note {{here}}
+ };
+ template CONST int C::right_inst<int>; // expected-error {{undefined variable template}}
+ template CONST int C::right_inst<int*>; // expected-error {{undefined variable template}}
+
+ namespace pointers {
+
+ struct C0 {
+ template<typename U> static U Data;
+ template<typename U> static CONST U Data<U*> = U(); // expected-note {{here}}
+
+ template<typename U> static U Data2;
+ template<typename U> static CONST U Data2<U*> = U();
+ };
+ const int c0_test = C0::Data<int*>;
+ static_assert(c0_test == 0, "");
+ template const int C0::Data<int*>; // expected-error {{undefined}}
+
+ template<typename U> const U C0::Data2<U*>;
+ template const int C0::Data2<int*>;
+
+ struct C1a {
+ template<typename U> static U Data;
+ template<typename U> static U* Data<U*>; // Okay, with out-of-line definition
+ };
+ template<typename T> T* C1a::Data<T*> = new T();
+ template int* C1a::Data<int*>;
+
+ struct C1b {
+ template<typename U> static U Data;
+ template<typename U> static CONST U* Data<U*>; // Okay, with out-of-line definition
+ };
+ template<typename T> CONST T* C1b::Data<T*> = (T*)(0);
+ template CONST int* C1b::Data<int*>;
+
+ struct C2a {
+ template<typename U> static int Data;
+ template<typename U> static U* Data<U*> = new U(); // expected-error {{non-const static data member must be initialized out of line}}
+ };
+ template int* C2a::Data<int*>; // expected-note {{in instantiation of static data member 'non_const_init::pointers::C2a::Data<int *>' requested here}}
+
+ struct C2b {
+ template<typename U> static int Data;
+ template<typename U> static U *const Data<U*> = (U*)(0); // expected-error {{static data member of type 'int *const'}}
+ };
+ template<typename U> U *const C2b::Data<U*>;
+ template int *const C2b::Data<int*>; // expected-note {{in instantiation of static data member 'non_const_init::pointers::C2b::Data<int *>' requested here}}
+ }
+}
+
+#ifndef PRECXX11
+namespace constexpred {
+ class A {
+ template<typename T> constexpr T wrong; // expected-error {{member 'wrong' declared as a template}} \
+ // expected-error {{non-static data member cannot be constexpr; did you intend to make it const?}}
+ template<typename T> constexpr T wrong_init = 5; // expected-error {{non-static data member cannot be constexpr; did you intend to make it static?}}
+ template<typename T, typename T0> static constexpr T right = T(100);
+ template<typename T> static constexpr T right<T,int> = 5;
+ template<typename T> constexpr int right<int,T>; // expected-error {{member 'right' declared as a template}} \
+ // expected-error {{non-static data member cannot be constexpr; did you intend to make it const?}}
+ template<typename T> constexpr float right<float,T> = 5; // expected-error {{non-static data member cannot be constexpr; did you intend to make it static?}}
+ template<> static constexpr int right<int,int> = 7; // expected-error {{explicit specialization of 'right' in class scope}}
+ template<> static constexpr float right<float,int>; // expected-error {{explicit specialization of 'right' in class scope}}
+ template static constexpr int right<int,int>; // expected-error {{template specialization requires 'template<>'}} \
+ // expected-error {{explicit specialization of 'right' in class scope}}
+ };
+}
+#endif
+
+namespace in_class_template {
+
+ template<typename T>
+ class D0 {
+ template<typename U> static U Data; // expected-note {{here}}
+ template<typename U> static CONST U Data<U*> = U();
+ };
+ template CONST int D0<float>::Data<int*>;
+ template int D0<float>::Data<int>; // expected-error {{undefined}}
+ template<typename T> template<typename U> const U D0<T>::Data<U*>;
+
+ template<typename T>
+ class D1 {
+ template<typename U> static U Data;
+ template<typename U> static U* Data<U*>;
+ };
+ template<typename T>
+ template<typename U> U* D1<T>::Data<U*> = (U*)(0);
+ template int* D1<float>::Data<int*>; // expected-note {{previous}}
+ template int* D1<float>::Data<int*>; // expected-error {{duplicate explicit instantiation}}
+
+ template<typename T>
+ class D2 {
+ template<typename U> static U Data;
+ template<typename U> static U* Data<U*>;
+ };
+ template<>
+ template<typename U> U* D2<float>::Data<U*> = (U*)(0) + 1;
+ template int* D2<float>::Data<int*>; // expected-note {{previous}}
+ template int* D2<float>::Data<int*>; // expected-error {{duplicate explicit instantiation}}
+
+ template<typename T>
+ struct D3 {
+ template<typename U> static CONST U Data = U(100); // expected-note {{here}}
+ };
+ static_assert(D3<float>::Data<int> == 100, "");
+ template const char D3<float>::Data<char>; // expected-error {{undefined}}
+
+ namespace bug_files {
+ template<typename T>
+ class D0a {
+ template<typename U> static U Data;
+ template<typename U> static CONST U Data<U*> = U(10); // expected-note {{previous definition is here}}
+ };
+ template<>
+ template<typename U> U D0a<float>::Data<U*> = U(100); // expected-error {{redefinition of 'Data'}}
+
+ // FIXME: We should accept this, and the corresponding case for class
+ // templates.
+ //
+ // [temp.class.spec.mfunc]/2: If the primary member template is explicitly
+ // specialized for a given specialization of the enclosing class template,
+ // the partial specializations of the member template are ignored
+ template<typename T>
+ class D1 {
+ template<typename U> static U Data;
+ template<typename U> static CONST U Data<U*> = U(10); // expected-note {{previous definition is here}}
+ };
+ template<>
+ template<typename U> U D1<float>::Data = U(10);
+ template<>
+ template<typename U> U D1<float>::Data<U*> = U(100); // expected-error{{redefinition of 'Data'}}
+ }
+
+ namespace definition_after_outer_instantiation {
+ template<typename A> struct S {
+ template<typename B> static const int V1;
+ template<typename B> static const int V2;
+ };
+ template struct S<int>;
+ template<typename A> template<typename B> const int S<A>::V1 = 123;
+ template<typename A> template<typename B> const int S<A>::V2<B*> = 456;
+
+ static_assert(S<int>::V1<int> == 123, "");
+
+ // FIXME: The first and third case below possibly should be accepted. We're
+ // not picking up partial specializations added after the primary template
+ // is instantiated. This is kind of implied by [temp.class.spec.mfunc]/2,
+ // and matches our behavior for member class templates, but it's not clear
+ // that this is intentional. See PR17294 and core-24030.
+ static_assert(S<int>::V2<int*> == 456, ""); // FIXME expected-error {{}}
+ static_assert(S<int>::V2<int&> == 789, ""); // expected-error {{}}
+
+ template<typename A> template<typename B> const int S<A>::V2<B&> = 789;
+ static_assert(S<int>::V2<int&> == 789, ""); // FIXME expected-error {{}}
+
+ // All is OK if the partial specialization is declared before the implicit
+ // instantiation of the class template specialization.
+ static_assert(S<char>::V1<int> == 123, "");
+ static_assert(S<char>::V2<int*> == 456, "");
+ static_assert(S<char>::V2<int&> == 789, "");
+ }
+
+ namespace incomplete_array {
+ template<typename T> extern T var[];
+ template<typename T> T var[] = { 1, 2, 3 };
+ template<> char var<char>[] = "hello";
+ template<typename T> char var<T*>[] = "pointer";
+
+ static_assert(sizeof(var<int>) == 12, "");
+ static_assert(sizeof(var<char>) == 6, "");
+ static_assert(sizeof(var<void*>) == 8, "");
+
+ template<typename...> struct tuple;
+
+ template<typename T> struct A {
+ template<typename U> static T x[];
+ template<typename U> static T y[];
+
+ template<typename...U> static T y<tuple<U...> >[];
+ };
+
+ int *use_before_definition = A<int>::x<char>;
+ template<typename T> template<typename U> T A<T>::x[sizeof(U)];
+ static_assert(sizeof(A<int>::x<char>) == 4, "");
+
+ template<typename T> template<typename...U> T A<T>::y<tuple<U...> >[] = { U()... };
+ static_assert(sizeof(A<int>::y<tuple<char, char, char> >) == 12, "");
+ }
+}
+
+namespace in_nested_classes {
+ // TODO:
+}
+
diff --git a/test/SemaCXX/cxx1y-variable-templates_top_level.cpp b/test/SemaCXX/cxx1y-variable-templates_top_level.cpp
new file mode 100644
index 000000000000..b6e8762f5d59
--- /dev/null
+++ b/test/SemaCXX/cxx1y-variable-templates_top_level.cpp
@@ -0,0 +1,434 @@
+// RUN: %clang_cc1 -verify -fsyntax-only -Wno-c++11-extensions -Wno-c++1y-extensions %s -DPRECXX11
+// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -Wno-c++1y-extensions %s
+// RUN: %clang_cc1 -std=c++1y -verify -fsyntax-only %s
+
+#ifdef PRECXX11
+ #define CONST const
+#else
+ #define CONST constexpr
+#endif
+
+template<typename T>
+T pi = T(3.1415926535897932385); // expected-note {{template is declared here}}
+
+template<typename T>
+CONST T cpi = T(3.1415926535897932385); // expected-note {{template is declared here}}
+
+template<typename T> extern CONST T vc;
+#ifndef PRECXX11
+// expected-error@-2 {{constexpr variable declaration must be a definition}}
+#endif
+
+namespace use_in_top_level_funcs {
+
+ void good() {
+ int ipi = pi<int>;
+ int icpi = cpi<int>;
+ double dpi = pi<double>;
+ double dcpi = cpi<double>;
+ }
+
+ void no_deduce() {
+ // template arguments are not deduced for uses of variable templates.
+ int ipi = pi; // expected-error {{cannot refer to variable template 'pi' without a template argument list}}
+ int icpi = cpi; // expected-error {{cannot refer to variable template 'cpi' without a template argument list}}
+ }
+
+ template<typename T>
+ T circular_area(T r) {
+ return pi<T> * r * r;
+ }
+
+ template<typename T>
+ CONST T const_circular_area(T r) {
+ return cpi<T> * r * r;
+ }
+
+ double use_circular_area(double r) {
+ CONST float t = const_circular_area(2.0) - 12;
+#ifndef PRECXX11
+ static_assert(const_circular_area(2) == 12, "");
+ CONST int test = (t > 0) && (t < 1);
+ static_assert(test, "");
+#endif
+ return circular_area(r);
+ }
+}
+
+namespace shadow {
+ void foo() {
+ int ipi0 = pi<int>;
+ int pi;
+ int a = pi;
+ int ipi = pi<int>; // expected-error {{expected '(' for function-style cast or type construction}} \
+ // expected-error {{expected expression}}
+ }
+}
+
+namespace odr_tmpl {
+ namespace pv_cvt {
+ int v; // expected-note {{previous definition is here}}
+ template<typename T> T v; // expected-error {{redefinition of 'v' as different kind of symbol}}
+ }
+ namespace pvt_cv {
+ template<typename T> T v; // expected-note {{previous definition is here}}
+ int v; // expected-error {{redefinition of 'v' as different kind of symbol}}
+ }
+ namespace pvt_cvt {
+ template<typename T> T v0; // expected-note {{previous definition is here}}
+ template<typename T> T v0; // expected-error {{redefinition of 'v0'}}
+
+ template<typename T> T v; // expected-note {{previous definition is here}}
+ template<typename T> int v; // expected-error {{redefinition of 'v'}}
+
+ template<typename T> int v1; // expected-note {{previous template declaration is here}}
+ template<int I> int v1; // expected-error {{template parameter has a different kind in template redeclaration}}
+ }
+ namespace pvt_use {
+ template<typename T> T v;
+ v = 10; // expected-error {{C++ requires a type specifier for all declarations}}
+ }
+
+ namespace pvt_diff_params {
+ // FIXME: (?) Redefinitions should simply be not allowed, whether the
+ // template parameters match or not. However, this current behaviour also
+ // matches that of class templates...
+ template<typename T, typename> T v; // expected-note 2{{previous template declaration is here}}
+ template<typename T> T v; // expected-error {{too few template parameters in template redeclaration}}
+ template<typename T, typename, typename> T v; // expected-error {{too many template parameters in template redeclaration}}
+ }
+
+ namespace pvt_extern {
+ template<typename T> T v = T();
+ template<typename T> extern T v; // redeclaration is allowed \
+ // expected-note {{previous definition is here}}
+ template<typename T> extern int v; // expected-error {{redefinition of 'v' with a different type: 'int' vs 'T'}}
+
+#ifndef PRECXX11
+ template<typename T> extern auto v; // expected-error {{declaration of variable 'v' with type 'auto' requires an initializer}}
+#endif
+
+ template<typename T> T var = T(); // expected-note {{previous definition is here}}
+ extern int var; // expected-error {{redefinition of 'var' as different kind of symbol}}
+ }
+
+#ifndef PRECXX11
+ namespace pvt_auto {
+ template<typename T> auto v0; // expected-error {{declaration of variable 'v0' with type 'auto' requires an initializer}}
+ template<typename T> auto v1 = T(); // expected-note {{previous definition is here}}
+ template<typename T> int v1; // expected-error {{redefinition of 'v1' with a different type: 'int' vs 'auto'}}
+ template<typename T> auto v2 = T(); // expected-note {{previous definition is here}}
+ template<typename T> T v2; // expected-error {{redefinition of 'v2'}}
+ template<typename T> auto v3 = T(); // expected-note {{previous definition is here}}
+ template<typename T> extern T v3; // expected-error {{redefinition of 'v3' with a different type: 'T' vs 'auto'}}
+ template<typename T> auto v4 = T();
+ template<typename T> extern auto v4; // expected-error {{declaration of variable 'v4' with type 'auto' requires an initializer}}
+ }
+#endif
+
+}
+
+namespace explicit_instantiation {
+ template<typename T>
+ T pi0a = T(3.1415926535897932385); // expected-note {{variable template 'pi0a' declared here}}
+ template float pi0a<int>; // expected-error {{type 'float' of explicit instantiation of 'pi0a' does not match expected type 'int'}}
+
+ template<typename T>
+ T pi0b = T(3.1415926535897932385); // expected-note {{variable template 'pi0b' declared here}}
+ template CONST int pi0b<int>; // expected-error {{type 'const int' of explicit instantiation of 'pi0b' does not match expected type 'int'}}
+
+ template<typename T>
+ T pi0c = T(3.1415926535897932385); // expected-note {{variable template 'pi0c' declared here}}
+ template int pi0c<const int>; // expected-error {{type 'int' of explicit instantiation of 'pi0c' does not match expected type 'const int'}}
+
+ template<typename T>
+ T pi0 = T(3.1415926535897932385);
+ template int pi0<int>; // expected-note {{previous explicit instantiation is here}}
+ template int pi0<int>; // expected-error {{duplicate explicit instantiation of 'pi0<int>'}}
+
+ template<typename T>
+ CONST T pi1a = T(3.1415926535897932385); // expected-note {{variable template 'pi1a' declared here}}
+ template int pi1a<int>; // expected-error {{type 'int' of explicit instantiation of 'pi1a' does not match expected type 'const int'}}
+
+ template<typename T>
+ CONST T pi1b = T(3.1415926535897932385); // expected-note {{variable template 'pi1b' declared here}}
+ template int pi1b<const int>; // expected-error {{type 'int' of explicit instantiation of 'pi1b' does not match expected type 'const const int'}}
+
+ template<typename T>
+ CONST T pi1 = T(3.1415926535897932385);
+ template CONST int pi1<int>; // expected-note {{previous explicit instantiation is here}}
+ template CONST int pi1<int>; // expected-error {{duplicate explicit instantiation of 'pi1<int>'}}
+
+#ifndef PRECXX11
+ namespace auto_var {
+ template<typename T> auto var0 = T();
+ template auto var0<int>; // expected-error {{'auto' variable template instantiation is not allowed}}
+
+ template<typename T> auto var = T();
+ template int var<int>;
+ }
+#endif
+
+ template<typename=int> int missing_args; // expected-note {{here}}
+ template int missing_args; // expected-error {{must specify a template argument list}}
+
+ namespace extern_var {
+ // TODO:
+ }
+}
+
+namespace explicit_specialization {
+
+ namespace good {
+ template<typename T1, typename T2>
+ CONST int pi2 = 1;
+
+ template<typename T>
+ CONST int pi2<T,int> = 2;
+
+ template<typename T>
+ CONST int pi2<int,T> = 3;
+
+ template<> CONST int pi2<int,int> = 4;
+
+#ifndef PRECXX11
+ void foo() {
+ static_assert(pi2<int,int> == 4, "");
+ static_assert(pi2<float,int> == 2, "");
+ static_assert(pi2<int,float> == 3, "");
+ static_assert(pi2<int,float> == pi2<int,double>, "");
+ static_assert(pi2<float,float> == 1, "");
+ static_assert(pi2<float,float> == pi2<float,double>, "");
+ }
+#endif
+ }
+
+ namespace ambiguous {
+
+ template<typename T1, typename T2>
+ CONST int pi2 = 1;
+
+ template<typename T>
+ CONST int pi2<T,int> = 2; // expected-note {{partial specialization matches [with T = int]}}
+
+ template<typename T>
+ CONST int pi2<int,T> = 3; // expected-note {{partial specialization matches [with T = int]}}
+
+ void foo() {
+ int a = pi2<int,int>; // expected-error {{ambiguous partial specializations of 'pi2<int, int>'}}
+ }
+ }
+
+ namespace type_changes {
+
+ template<typename T>
+ T pi0 = T(3.1415926535897932385);
+
+ template<> float pi0<int> = 10;
+ template<> int pi0<const int> = 10;
+
+ template<typename T>
+ T pi1 = T(3.1415926535897932385);
+ template<> CONST int pi1<int> = 10;
+
+ template<typename T>
+ T pi2 = T(3.1415926535897932385);
+ template<> int pi2<const int> = 10;
+
+ template<typename T>
+ CONST T pi4 = T(3.1415926535897932385);
+ template<> int pi4<int> = 10;
+ }
+
+ namespace redefinition {
+ template<typename T>
+ T pi0 = T(3.1415926535897932385);
+
+ template<> int pi0<int> = 10; // expected-note 3{{previous definition is here}}
+#ifndef PRECXX11
+// expected-note@-2 {{previous definition is here}}
+#endif
+ template<> int pi0<int> = 10; // expected-error {{redefinition of 'pi0<int>'}}
+ template<> CONST int pi0<int> = 10; // expected-error {{redefinition of 'pi0' with a different type: 'const int' vs 'int'}}
+ template<> float pi0<int> = 10; // expected-error {{redefinition of 'pi0' with a different type: 'float' vs 'int'}}
+#ifndef PRECXX11
+ template<> auto pi0<int> = 10; // expected-error {{redefinition of 'pi0<int>'}}
+#endif
+
+
+ template<typename T>
+ CONST T pi1 = T(3.1415926535897932385);
+
+ template<> CONST int pi1<int> = 10; // expected-note {{previous definition is here}}
+ template<> CONST int pi1<int> = 10; // expected-error {{redefinition of 'pi1<int>'}}
+ }
+
+ namespace before_instantiation {
+ template<typename T>
+ T pi0 = T(3.1415926535897932385); // expected-note {{variable template 'pi0' declared here}}
+
+ template<> int pi0<int> = 10;
+ template int pi0<int>;
+ template float pi0<int>; // expected-error {{type 'float' of explicit instantiation of 'pi0' does not match expected type}}
+
+ template<typename T1, typename T2>
+ CONST int pi2 = 1;
+
+ template<typename T> CONST int pi2<T,int> = 2;
+ template CONST int pi2<int,int>;
+ }
+ namespace after_instantiation {
+ template<typename T>
+ T pi0 = T(3.1415926535897932385);
+
+ template int pi0<int>; // expected-note 2{{explicit instantiation first required here}}
+ template<> int pi0<int> = 10; // expected-error {{explicit specialization of 'pi0' after instantiation}}
+ template<> float pi0<int>; // expected-error {{explicit specialization of 'pi0' after instantiation}}
+
+ template<typename T1, typename T2>
+ CONST int pi2 = 1;
+
+ template CONST int pi2<int,int>;
+ template<typename T> CONST int pi2<T,int> = 2;
+ }
+
+#ifndef PRECXX11
+ namespace auto_var {
+ template<typename T, typename> auto var0 = T();
+ template<typename T> auto var0<T,int> = T();
+ template<> auto var0<int,int> = 7;
+
+ template<typename T, typename> auto var = T();
+ template<typename T> T var<T,int> = T(5);
+ template<> int var<int,int> = 7;
+
+ void foo() {
+ int i0 = var0<int,int>;
+ int b = var<int,int>;
+ }
+ }
+#endif
+
+ namespace extern_var {
+ // TODO:
+ }
+
+ namespace diff_type {
+ // TODO:
+ template<typename T> T* var = new T();
+#ifndef PRECXX11
+ template<typename T> auto var<T*> = T(); // expected-note {{previous definition is here}}
+ template<typename T> T var<T*> = T(); // expected-error {{redefinition of 'var' with a different type: 'T' vs 'auto'}}
+#endif
+ }
+}
+
+namespace narrowing {
+ template<typename T> T v = {1234}; // expected-warning {{implicit conversion from 'int' to 'char' changes value from 1234 to}}
+#ifndef PRECXX11
+ // expected-error@-2 {{constant expression evaluates to 1234 which cannot be narrowed to type 'char'}}\
+ // expected-note@-2 {{override this message by inserting an explicit cast}}
+#endif
+ int k = v<char>; // expected-note {{in instantiation of variable template specialization 'narrowing::v<char>' requested here}}
+}
+
+namespace use_in_structs {
+ // TODO:
+}
+
+namespace attributes {
+ // TODO:
+}
+
+#ifndef PRECXX11
+namespace arrays {
+ template<typename T>
+ T* arr = new T[10]{T(10), T(23)};
+
+ float f = 10.5;
+ template<> float* arr<float> = &f;
+
+ void bar() {
+ int *iarr = arr<int>;
+ iarr[0] = 1;
+ iarr[2] = 3;
+ iarr[6] = -2;
+
+ float ff = *arr<float>;
+ float nof = arr<float>[3]; // No bounds-check in C++
+ }
+}
+#endif
+
+namespace nested {
+
+ namespace n0a {
+ template<typename T>
+ T pi0a = T(3.1415926535897932385);
+ }
+
+ using namespace n0a;
+ int i0a = pi0a<int>;
+
+ template float pi0a<float>;
+ float f0a = pi0a<float>;
+
+ template<> double pi0a<double> = 5.2;
+ double d0a = pi0a<double>;
+
+ namespace n0b {
+ template<typename T>
+ T pi0b = T(3.1415926535897932385);
+ }
+
+ int i0b = n0b::pi0b<int>;
+
+ template float n0b::pi0b<float>;
+ float f0b = n0b::pi0b<float>;
+
+ template<> double n0b::pi0b<double> = 5.2;
+ double d0b = n0b::pi0b<double>;
+
+ namespace n1 {
+ template<typename T>
+ T pi1a = T(3.1415926535897932385);
+#ifndef PRECXX11
+// expected-note@-2 {{explicit instantiation refers here}}
+#endif
+
+ template<typename T>
+ T pi1b = T(3.1415926535897932385); // expected-note {{explicitly specialized declaration is here}}
+#ifndef PRECXX11
+// expected-note@-2 {{explicit instantiation refers here}}
+#endif
+ }
+
+ namespace use_n1a {
+ using namespace n1;
+ int i1 = pi1a<int>;
+
+ template float pi1a<float>;
+#ifndef PRECXX11
+// expected-error@-2 {{explicit instantiation of 'pi1a<float>' not in a namespace enclosing 'n1'}}
+#endif
+ float f1 = pi1a<float>;
+
+ template<> double pi1a<double> = 5.2; // expected-error {{no variable template matches specialization}}
+ double d1 = pi1a<double>;
+ }
+
+ namespace use_n1b {
+ int i1 = n1::pi1b<int>;
+
+ template float n1::pi1b<float>;
+#ifndef PRECXX11
+// expected-error@-2 {{explicit instantiation of 'pi1b<float>' not in a namespace enclosing 'n1'}}
+#endif
+ float f1 = n1::pi1b<float>;
+
+ template<> double n1::pi1b<double> = 5.2; // expected-error {{cannot define or redeclare 'pi1b' here because namespace 'use_n1b' does not enclose namespace 'n1'}} \
+ // expected-error {{variable template specialization of 'pi1b' must originally be declared in namespace 'n1'}}
+ double d1 = n1::pi1b<double>;
+ }
+}
+
diff --git a/test/SemaCXX/cxx98-compat-pedantic.cpp b/test/SemaCXX/cxx98-compat-pedantic.cpp
index 208ea4ce9238..b74dcb4238ae 100644
--- a/test/SemaCXX/cxx98-compat-pedantic.cpp
+++ b/test/SemaCXX/cxx98-compat-pedantic.cpp
@@ -1,9 +1,11 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++1y -DCXX1Y -Wc++98-compat-pedantic -verify %s
-// RUN: %clang_cc1 -fsyntax-only -std=c++1y -DCXX1Y -Wc++98-compat -Werror %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++1y -DCXX1Y -Wc++98-compat-pedantic -verify %s -DCXX1Y2
+// RUN: %clang_cc1 -fsyntax-only -std=c++1y -DCXX1Y -Wc++98-compat -Werror %s -DCXX1Y2
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat-pedantic -verify %s
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -Werror %s
// RUN: %clang_cc1 -fsyntax-only -std=c++98 -Werror %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++1y -Wc++98-compat-pedantic -verify %s -Wno-c++98-c++11-compat-pedantic -DCXX1Y2
+
// -Wc++98-compat-pedantic warns on C++11 features which we accept without a
// warning in C++98 mode.
@@ -30,7 +32,12 @@ void *FnVoidPtr = (void*)&dlsym; // expected-warning {{cast between pointer-to-f
struct ConvertToInt {
operator int();
};
-int *ArraySizeConversion = new int[ConvertToInt()]; // expected-warning {{implicit conversion from array size expression of type 'ConvertToInt' to integral type 'int' is incompatible with C++98}}
+int *ArraySizeConversion = new int[ConvertToInt()];
+#ifdef CXX1Y2
+// expected-warning@-2 {{implicit conversion from array size expression of type 'ConvertToInt' to integral type 'size_t' is incompatible with C++98}}
+#else
+// expected-warning@-4 {{implicit conversion from array size expression of type 'ConvertToInt' to integral type 'int' is incompatible with C++98}}
+#endif
template<typename T> class ExternTemplate {};
extern template class ExternTemplate<int>; // expected-warning {{extern templates are incompatible with C++98}}
@@ -44,8 +51,3 @@ int k = 0b1001;
#ifdef CXX1Y
// expected-warning@-2 {{binary integer literals are incompatible with C++ standards before C++1y}}
#endif
-
-void f(int n) { int a[n]; }
-#ifdef CXX1Y
-// expected-warning@-2 {{arrays of runtime bound are incompatible with C++ standards before C++1y}}
-#endif
diff --git a/test/SemaCXX/cxx98-compat.cpp b/test/SemaCXX/cxx98-compat.cpp
index 7d36770f5d20..9690638ce025 100644
--- a/test/SemaCXX/cxx98-compat.cpp
+++ b/test/SemaCXX/cxx98-compat.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -verify %s
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++1y -Wc++98-compat -verify %s -DCXX1YCOMPAT
namespace std {
struct type_info;
@@ -73,7 +73,7 @@ int InitList(int i = {}) { // expected-warning {{generalized initializer lists a
Ctor c2 = { 3.0, 4l }; // expected-warning {{constructor call from initializer list is incompatible with C++98}}
InitListCtor ilc = { true, false }; // expected-warning {{initialization of initializer_list object is incompatible with C++98}}
const int &r = { 0 }; // expected-warning {{reference initialized from initializer list is incompatible with C++98}}
- struct { int a; const int &r; } rr = { 0, {{0}} }; // expected-warning {{reference initialized from initializer list is incompatible with C++98}}
+ struct { int a; const int &r; } rr = { 0, {0} }; // expected-warning {{reference initialized from initializer list is incompatible with C++98}}
return { 0 }; // expected-warning {{generalized initializer lists are incompatible with C++98}}
}
struct DelayedDefaultArgumentParseInitList {
@@ -147,16 +147,12 @@ bool no_except_expr = noexcept(1 + 1); // expected-warning {{noexcept expression
void *null = nullptr; // expected-warning {{'nullptr' is incompatible with C++98}}
static_assert(true, "!"); // expected-warning {{static_assert declarations are incompatible with C++98}}
-// FIXME: Reintroduce this test if support for inheriting constructors is
-// implemented.
-#if 0
struct InhCtorBase {
InhCtorBase(int);
};
struct InhCtorDerived : InhCtorBase {
- using InhCtorBase::InhCtorBase; // xpected-warning {{inheriting constructors are incompatible with C++98}}
+ using InhCtorBase::InhCtorBase; // expected-warning {{inheriting constructors are incompatible with C++98}}
};
-#endif
struct FriendMember {
static void MemberFn();
@@ -382,3 +378,79 @@ namespace rdar11736429 {
X x; // expected-warning{{union member 'x' with a non-trivial constructor is incompatible with C++98}}
};
}
+
+template<typename T> T var = T(10);
+#ifdef CXX1YCOMPAT
+// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}}
+#else
+// expected-warning@-4 {{variable templates are a C++1y extension}}
+#endif
+
+template<typename T> T* var<T*> = new T();
+#ifdef CXX1YCOMPAT
+// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}}
+#else
+// expected-warning@-4 {{variable templates are a C++1y extension}}
+#endif
+
+template<> int var<int> = 10;
+#ifdef CXX1YCOMPAT
+// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}}
+#else
+// expected-warning@-4 {{variable templates are a C++1y extension}}
+#endif
+
+template int var<int>;
+float fvar = var<float>;
+
+class A {
+ template<typename T> static T var = T(10);
+#ifdef CXX1YCOMPAT
+// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}}
+#else
+// expected-warning@-4 {{variable templates are a C++1y extension}}
+#endif
+
+ template<typename T> static T* var<T*> = new T();
+#ifdef CXX1YCOMPAT
+// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}}
+#else
+// expected-warning@-4 {{variable templates are a C++1y extension}}
+#endif
+
+};
+
+struct B { template<typename T> static T v; };
+#ifdef CXX1YCOMPAT
+// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}}
+#else
+// expected-warning@-4 {{variable templates are a C++1y extension}}
+#endif
+
+template<typename T> T B::v = T();
+#ifdef CXX1YCOMPAT
+// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}}
+#else
+// expected-warning@-4 {{variable templates are a C++1y extension}}
+#endif
+
+template<typename T> T* B::v<T*> = new T();
+#ifdef CXX1YCOMPAT
+// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}}
+#else
+// expected-warning@-4 {{variable templates are a C++1y extension}}
+#endif
+
+template<> int B::v<int> = 10;
+#ifdef CXX1YCOMPAT
+// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}}
+#else
+// expected-warning@-4 {{variable templates are a C++1y extension}}
+#endif
+
+template int B::v<int>;
+float fsvar = B::v<float>;
+
+#ifdef CXX1YCOMPAT
+int digit_seps = 123'456; // expected-warning {{digit separators are incompatible with C++ standards before C++1y}}
+#endif
diff --git a/test/SemaCXX/dcl_ambig_res.cpp b/test/SemaCXX/dcl_ambig_res.cpp
index 97780e41f0c4..c0f1e2e96a4d 100644
--- a/test/SemaCXX/dcl_ambig_res.cpp
+++ b/test/SemaCXX/dcl_ambig_res.cpp
@@ -44,9 +44,7 @@ S4<int(1)> y; // expected-error{{must be a type}}
void foo5()
{
(void)sizeof(int(1)); //expression
- // FIXME: should we make this an error rather than a warning?
- // (It affects SFINAE)
- (void)sizeof(int()); // expected-warning{{function type}}
+ (void)sizeof(int()); // expected-error{{function type}}
}
// [dcl.ambig.res]p6:
diff --git a/test/SemaCXX/decl-expr-ambiguity.cpp b/test/SemaCXX/decl-expr-ambiguity.cpp
index 87fd2dad316c..8164b2bc91e7 100644
--- a/test/SemaCXX/decl-expr-ambiguity.cpp
+++ b/test/SemaCXX/decl-expr-ambiguity.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -Wno-int-to-pointer-cast -fsyntax-only -verify -pedantic-errors %s
+// RUN: %clang_cc1 -Wno-int-to-pointer-cast -fsyntax-only -verify -pedantic-errors -x objective-c++ %s
void f() {
int a;
diff --git a/test/SemaCXX/decl-init-ref.cpp b/test/SemaCXX/decl-init-ref.cpp
index 4c635c1a2447..2d0c9cb4ffbe 100644
--- a/test/SemaCXX/decl-init-ref.cpp
+++ b/test/SemaCXX/decl-init-ref.cpp
@@ -26,4 +26,13 @@ int main() {
}
struct PR6139 { A (&x)[1]; };
-PR6139 x = {{A()}}; // expected-error{{non-const lvalue reference to type 'A [1]' cannot bind to a temporary of type 'A'}}
+PR6139 x = {{A()}}; // expected-error{{non-const lvalue reference to type 'A [1]' cannot bind to an initializer list temporary}}
+
+struct PR6139b { A (&x)[1]; };
+PR6139b y = {A()}; // expected-error{{non-const lvalue reference to type 'A [1]' cannot bind to a temporary of type 'A'}}
+
+namespace PR16502 {
+ struct A { int &&temporary; int x, y; };
+ int f();
+ const A &c = { 10, ++c.temporary };
+}
diff --git a/test/SemaCXX/decl-microsoft-call-conv.cpp b/test/SemaCXX/decl-microsoft-call-conv.cpp
index 3175af7f1b07..9f1463245ba2 100644
--- a/test/SemaCXX/decl-microsoft-call-conv.cpp
+++ b/test/SemaCXX/decl-microsoft-call-conv.cpp
@@ -1,21 +1,24 @@
// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi microsoft -fms-extensions -verify %s
+typedef void void_fun_t();
+typedef void __cdecl cdecl_fun_t();
+
// Pointers to free functions
-void free_func_default();
-void __cdecl free_func_cdecl();
-void __stdcall free_func_stdcall(); // expected-note {{previous declaration is here}}
+void free_func_default(); // expected-note 2 {{previous declaration is here}}
+void __cdecl free_func_cdecl(); // expected-note 2 {{previous declaration is here}}
+void __stdcall free_func_stdcall(); // expected-note 2 {{previous declaration is here}}
void __fastcall free_func_fastcall(); // expected-note 2 {{previous declaration is here}}
-void __cdecl free_func_default(); // expected-note 2 {{previous declaration is here}}
+void __cdecl free_func_default();
void __stdcall free_func_default(); // expected-error {{function declared 'stdcall' here was previously declared without calling convention}}
void __fastcall free_func_default(); // expected-error {{function declared 'fastcall' here was previously declared without calling convention}}
-void free_func_cdecl(); // expected-note 2 {{previous declaration is here}}
+void free_func_cdecl();
void __stdcall free_func_cdecl(); // expected-error {{function declared 'stdcall' here was previously declared 'cdecl'}}
void __fastcall free_func_cdecl(); // expected-error {{function declared 'fastcall' here was previously declared 'cdecl'}}
+void free_func_stdcall();
void __cdecl free_func_stdcall(); // expected-error {{function declared 'cdecl' here was previously declared 'stdcall'}}
-void free_func_stdcall(); // expected-note {{previous declaration is here}}
void __fastcall free_func_stdcall(); // expected-error {{function declared 'fastcall' here was previously declared 'stdcall'}}
void __cdecl free_func_fastcall(); // expected-error {{function declared 'cdecl' here was previously declared 'fastcall'}}
@@ -29,6 +32,8 @@ void __cdecl free_func_default(int *);
void __thiscall free_func_cdecl(char *);
void __cdecl free_func_cdecl(double);
+typedef void void_fun_t();
+typedef void __cdecl cdecl_fun_t();
// Pointers to member functions
struct S {
@@ -38,10 +43,17 @@ struct S {
void __cdecl member_cdecl2(); // expected-note {{previous declaration is here}}
void __thiscall member_thiscall1();
void __thiscall member_thiscall2(); // expected-note {{previous declaration is here}}
-
+
+ // Typedefs carrying the __cdecl convention are adjusted to __thiscall.
+ void_fun_t member_typedef_default; // expected-note {{previous declaration is here}}
+ cdecl_fun_t member_typedef_cdecl1; // expected-note {{previous declaration is here}}
+ cdecl_fun_t __cdecl member_typedef_cdecl2;
+ void_fun_t __stdcall member_typedef_stdcall;
+
// Static member functions can't be __thiscall
static void static_member_default1();
- static void static_member_default2(); // expected-note {{previous declaration is here}}
+ static void static_member_default2();
+ static void static_member_default3(); // expected-note {{previous declaration is here}}
static void __cdecl static_member_cdecl1();
static void __cdecl static_member_cdecl2(); // expected-note {{previous declaration is here}}
static void __stdcall static_member_stdcall1();
@@ -58,29 +70,124 @@ struct S {
void __cdecl S::member_default1() {} // expected-error {{function declared 'cdecl' here was previously declared without calling convention}}
void __thiscall S::member_default2() {}
+void __cdecl S::member_typedef_default() {} // expected-error {{function declared 'cdecl' here was previously declared without calling convention}}
+void __cdecl S::member_typedef_cdecl1() {} // expected-error {{function declared 'cdecl' here was previously declared without calling convention}}
+void __cdecl S::member_typedef_cdecl2() {}
+void __stdcall S::member_typedef_stdcall() {}
+
void S::member_cdecl1() {}
void __thiscall S::member_cdecl2() {} // expected-error {{function declared 'thiscall' here was previously declared 'cdecl'}}
void S::member_thiscall1() {}
void __cdecl S::member_thiscall2() {} // expected-error {{function declared 'cdecl' here was previously declared 'thiscall'}}
-void __cdecl S::static_member_default1() {}
-void __stdcall S::static_member_default2() {} // expected-error {{function declared 'stdcall' here was previously declared without calling convention}}
+void S::static_member_default1() {}
+void __cdecl S::static_member_default2() {}
+void __stdcall S::static_member_default3() {} // expected-error {{function declared 'stdcall' here was previously declared without calling convention}}
void S::static_member_cdecl1() {}
void __stdcall S::static_member_cdecl2() {} // expected-error {{function declared 'stdcall' here was previously declared 'cdecl'}}
-void __cdecl S::member_variadic_default(int x, ...) {
- (void)x;
+void __cdecl S::member_variadic_default(int x, ...) { (void)x; }
+void S::member_variadic_cdecl(int x, ...) { (void)x; }
+
+void __cdecl S::static_member_variadic_default(int x, ...) { (void)x; }
+void S::static_member_variadic_cdecl(int x, ...) { (void)x; }
+
+// Declare a template using a calling convention.
+template <class CharT> inline int __cdecl mystrlen(const CharT *str) {
+ int i;
+ for (i = 0; str[i]; i++) { }
+ return i;
}
-void S::member_variadic_cdecl(int x, ...) {
- (void)x;
+extern int sse_strlen(const char *str);
+template <> inline int __cdecl mystrlen(const char *str) {
+ return sse_strlen(str);
+}
+void use_tmpl(const char *str, const int *ints) {
+ mystrlen(str);
+ mystrlen(ints);
+}
+
+struct MixedCCStaticOverload {
+ static void overloaded(int a);
+ static void __stdcall overloaded(short a);
+};
+
+void MixedCCStaticOverload::overloaded(int a) {}
+void MixedCCStaticOverload::overloaded(short a) {}
+
+// Friend function decls are cdecl by default, not thiscall. Friend method
+// decls should always be redeclarations, because the class cannot be
+// incomplete.
+struct FriendClass {
+ void friend_method() {}
+};
+void __stdcall friend_stdcall1() {}
+class MakeFriendDecls {
+ int x;
+ friend void FriendClass::friend_method();
+ friend void friend_default();
+ friend void friend_stdcall1();
+ friend void __stdcall friend_stdcall2();
+ friend void friend_stdcall3(); // expected-note {{previous declaration is here}}
+};
+void friend_default() {}
+void __stdcall friend_stdcall3() {} // expected-error {{function declared 'stdcall' here was previously declared without calling convention}}
+void __stdcall friend_stdcall2() {}
+
+// Test functions with multiple attributes.
+void __attribute__((noreturn)) __stdcall __attribute__((regparm(1))) multi_attribute(int x);
+void multi_attribute(int x) { __builtin_unreachable(); }
+
+
+// expected-error@+2 {{stdcall and cdecl attributes are not compatible}}
+// expected-error@+1 {{fastcall and cdecl attributes are not compatible}}
+void __cdecl __cdecl __stdcall __cdecl __fastcall multi_cc(int x);
+
+template <typename T> void __stdcall StdcallTemplate(T) {}
+template <> void StdcallTemplate<int>(int) {}
+template <> void __stdcall StdcallTemplate<short>(short) {}
+
+// FIXME: Note the template, not the implicit instantiation.
+// expected-error@+2 {{function declared 'cdecl' here was previously declared 'stdcall}}
+// expected-note@+1 {{previous declaration is here}}
+template <> void __cdecl StdcallTemplate<long>(long) {}
+
+struct ExactlyInt {
+ template <typename T> static int cast_to_int(T) {
+ return T::this_is_not_an_int();
+ }
+};
+template <> inline int ExactlyInt::cast_to_int<int>(int x) { return x; }
+
+namespace test2 {
+ class foo {
+ template <typename T> void bar(T v);
+ };
+ extern template void foo::bar(const void *);
}
-void __cdecl S::static_member_variadic_default(int x, ...) {
- (void)x;
+namespace test3 {
+ struct foo {
+ typedef void bar();
+ };
+ bool zed(foo::bar *);
+ void bah() {}
+ void baz() { zed(bah); }
}
-void S::static_member_variadic_cdecl(int x, ...) {
- (void)x;
+
+namespace test4 {
+ class foo {
+ template <typename T> static void bar(T v);
+ };
+ extern template void foo::bar(const void *);
}
+namespace test5 {
+ template <class T>
+ class valarray {
+ void bar();
+ };
+ extern template void valarray<int>::bar();
+}
diff --git a/test/SemaCXX/decltype.cpp b/test/SemaCXX/decltype.cpp
index ccde3dcfb312..d6e85d285dd1 100644
--- a/test/SemaCXX/decltype.cpp
+++ b/test/SemaCXX/decltype.cpp
@@ -37,6 +37,14 @@ struct C {
// expected-error {{expected ')'}} expected-note {{to match this '('}}
};
+namespace PR16529 {
+ struct U {};
+ template <typename T> struct S {
+ static decltype(T{}, U{}) &f();
+ };
+ U &r = S<int>::f();
+}
+
template<typename>
class conditional {
};
diff --git a/test/SemaCXX/default-assignment-operator.cpp b/test/SemaCXX/default-assignment-operator.cpp
index 668c60036662..7ef6f7778529 100644
--- a/test/SemaCXX/default-assignment-operator.cpp
+++ b/test/SemaCXX/default-assignment-operator.cpp
@@ -1,12 +1,12 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-class Base { // expected-error {{cannot define the implicit default assignment operator for 'Base', because non-static reference member 'ref' can't use default assignment operator}} \
+class Base { // expected-error {{cannot define the implicit copy assignment operator for 'Base', because non-static reference member 'ref' can't use copy assignment operator}} \
// expected-warning{{class 'Base' does not declare any constructor to initialize its non-modifiable members}}
int &ref; // expected-note {{declared here}} \
// expected-note{{reference member 'ref' will never be initialized}}
};
-class X : Base { // // expected-error {{cannot define the implicit default assignment operator for 'X', because non-static const member 'cint' can't use default assignment operator}} \
+class X : Base { // // expected-error {{cannot define the implicit copy assignment operator for 'X', because non-static const member 'cint' can't use copy assignment operator}} \
// expected-note{{assignment operator for 'Base' first required here}}
public:
X();
@@ -73,7 +73,7 @@ void i() {
// Test5
-class E1 { // expected-error{{cannot define the implicit default assignment operator for 'E1', because non-static const member 'a' can't use default assignment operator}}
+class E1 { // expected-error{{cannot define the implicit copy assignment operator for 'E1', because non-static const member 'a' can't use copy assignment operator}}
public:
const int a; // expected-note{{declared here}}
@@ -101,7 +101,7 @@ namespace ProtectedCheck {
X x;
};
- void f(Z z) { z = z; } // expected-note{{implicit default copy assignment operator}}
+ void f(Z z) { z = z; } // expected-note{{implicit copy assignment operator}}
}
diff --git a/test/SemaCXX/default1.cpp b/test/SemaCXX/default1.cpp
index c8c197e153d4..b661776b6ef5 100644
--- a/test/SemaCXX/default1.cpp
+++ b/test/SemaCXX/default1.cpp
@@ -21,7 +21,7 @@ struct X {
X(int);
};
-void j(X x = 17);
+void j(X x = 17); // expected-note{{'::j' declared here}}
struct Y { // expected-note 2{{candidate}}
explicit Y(int);
@@ -46,8 +46,13 @@ int l () {
int i () {
void j (int f = 4);
{
- void j (int f); // expected-note{{'j' declared here}}
- j(); // expected-error{{too few arguments to function call, single argument 'f' was not specified}}
+ void j (int f);
+ j(); // expected-error{{too few arguments to function call, expected 1, have 0; did you mean '::j'?}}
+ }
+ void jj (int f = 4);
+ {
+ void jj (int f); // expected-note{{'jj' declared here}}
+ jj(); // expected-error{{too few arguments to function call, single argument 'f' was not specified}}
}
}
diff --git a/test/SemaCXX/deprecated.cpp b/test/SemaCXX/deprecated.cpp
new file mode 100644
index 000000000000..0335a80ffc5d
--- /dev/null
+++ b/test/SemaCXX/deprecated.cpp
@@ -0,0 +1,67 @@
+// RUN: %clang_cc1 -std=c++98 %s -Wdeprecated -verify -triple x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -triple x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++1y %s -Wdeprecated -verify -triple x86_64-linux-gnu
+
+// RUN: %clang_cc1 -std=c++1y %s -Wdeprecated -verify -triple x86_64-linux-gnu -Wno-deprecated-register -DNO_DEPRECATED_FLAGS
+
+#include "Inputs/register.h"
+
+void f() throw();
+void g() throw(int);
+void h() throw(...);
+#if __cplusplus >= 201103L
+// expected-warning@-4 {{dynamic exception specifications are deprecated}} expected-note@-4 {{use 'noexcept' instead}}
+// expected-warning@-4 {{dynamic exception specifications are deprecated}} expected-note@-4 {{use 'noexcept(false)' instead}}
+// expected-warning@-4 {{dynamic exception specifications are deprecated}} expected-note@-4 {{use 'noexcept(false)' instead}}
+#endif
+
+void stuff() {
+ register int n;
+#if __cplusplus >= 201103L && !defined(NO_DEPRECATED_FLAGS)
+ // expected-warning@-2 {{'register' storage class specifier is deprecated}}
+#endif
+
+ register int m asm("rbx"); // no-warning
+
+ int k = to_int(n); // no-warning
+
+ bool b;
+ ++b; // expected-warning {{incrementing expression of type bool is deprecated}}
+
+ // FIXME: This is ill-formed in C++11.
+ char *p = "foo"; // expected-warning {{conversion from string literal to 'char *' is deprecated}}
+}
+
+struct S { int n; };
+struct T : private S {
+ S::n;
+#if __cplusplus < 201103L
+ // expected-warning@-2 {{access declarations are deprecated; use using declarations instead}}
+#else
+ // expected-error@-4 {{ISO C++11 does not allow access declarations; use using declarations instead}}
+#endif
+};
+
+#if __cplusplus >= 201103L
+namespace DeprecatedCopy {
+ struct Assign {
+ Assign &operator=(const Assign&); // expected-warning {{definition of implicit copy constructor for 'Assign' is deprecated because it has a user-declared copy assignment operator}}
+ };
+ Assign a1, a2(a1); // expected-note {{implicit copy constructor for 'Assign' first required here}}
+
+ struct Ctor {
+ Ctor();
+ Ctor(const Ctor&); // expected-warning {{definition of implicit copy assignment operator for 'Ctor' is deprecated because it has a user-declared copy constructor}}
+ };
+ Ctor b1, b2;
+ void f() { b1 = b2; } // expected-note {{implicit copy assignment operator for 'Ctor' first required here}}
+
+ struct Dtor {
+ ~Dtor();
+ // expected-warning@-1 {{definition of implicit copy constructor for 'Dtor' is deprecated because it has a user-declared destructor}}
+ // expected-warning@-2 {{definition of implicit copy assignment operator for 'Dtor' is deprecated because it has a user-declared destructor}}
+ };
+ Dtor c1, c2(c1); // expected-note {{implicit copy constructor for 'Dtor' first required here}}
+ void g() { c1 = c2; } // expected-note {{implicit copy assignment operator for 'Dtor' first required here}}
+}
+#endif
diff --git a/test/SemaCXX/destructor.cpp b/test/SemaCXX/destructor.cpp
index f3c6ab0b737f..e511be011662 100644
--- a/test/SemaCXX/destructor.cpp
+++ b/test/SemaCXX/destructor.cpp
@@ -363,3 +363,7 @@ namespace PR7900 {
(&b)->~A(); // expected-error{{destructor type 'PR7900::A' in object destruction expression does not match the type 'PR7900::B' of the object being destroyed}}
}
}
+
+namespace PR16892 {
+ auto p = &A::~A; // expected-error{{taking the address of a destructor}}
+}
diff --git a/test/SemaCXX/dynamic-cast.cpp b/test/SemaCXX/dynamic-cast.cpp
index b73e8c57b9f3..b605194ecd64 100644
--- a/test/SemaCXX/dynamic-cast.cpp
+++ b/test/SemaCXX/dynamic-cast.cpp
@@ -37,6 +37,8 @@ void basic_bad()
(void)dynamic_cast<Incomplete*>((A*)0); // expected-error {{'Incomplete' is an incomplete type}}
// incomplete -> ptr
(void)dynamic_cast<A*>((Incomplete*)0); // expected-error {{'Incomplete' is an incomplete type}}
+ // rvalue -> lvalue
+ (void)dynamic_cast<A&>(A()); // expected-error {{dynamic_cast from rvalue to reference type 'A &'}}
}
void same()
diff --git a/test/SemaCXX/enum-increment.cpp b/test/SemaCXX/enum-increment.cpp
new file mode 100644
index 000000000000..dc1a921852e6
--- /dev/null
+++ b/test/SemaCXX/enum-increment.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -fsyntax-only %s -verify
+
+enum A { A1, A2, A3 };
+void test() {
+ A a;
+ a++; // expected-error{{cannot increment expression of enum type 'A'}}
+ a--; // expected-error{{cannot decrement expression of enum type 'A'}}
+ ++a; // expected-error{{cannot increment expression of enum type 'A'}}
+ --a; // expected-error{{cannot decrement expression of enum type 'A'}}
+}
+
+enum B {B1, B2};
+inline B &operator++ (B &b) { b = B((int)b+1); return b; }
+inline B operator++ (B &b, int) { B ret = b; ++b; return b; }
+
+void foo(enum B b) { ++b; b++; }
diff --git a/test/SemaCXX/enum-scoped.cpp b/test/SemaCXX/enum-scoped.cpp
index d01000d22bb4..b4aad18b17c9 100644
--- a/test/SemaCXX/enum-scoped.cpp
+++ b/test/SemaCXX/enum-scoped.cpp
@@ -266,3 +266,33 @@ namespace PR15633 {
struct B { enum class E; };
template<typename T> enum class B::E { e }; // expected-error {{enumeration cannot be a template}}
}
+
+namespace PR16900 {
+ enum class A;
+ A f(A a) { return -a; } // expected-error {{invalid argument type 'PR16900::A' to unary expression}}
+}
+
+namespace rdar15124329 {
+ enum class B : bool { F, T };
+
+ const rdar15124329::B T1 = B::T;
+ typedef B C; const C T2 = B::T;
+
+ static_assert(T1 != B::F, "");
+ static_assert(T2 == B::T, "");
+}
+
+namespace PR18044 {
+ enum class E { a };
+
+ int E::e = 0; // expected-error {{does not refer into a class}}
+ void E::f() {} // expected-error {{does not refer into a class}}
+ struct E::S {}; // expected-error {{no struct named 'S'}}
+ struct T : E::S {}; // expected-error {{expected class name}}
+ enum E::E {}; // expected-error {{no enum named 'E'}}
+ int E::*p; // expected-error {{does not point into a class}}
+ using E::f; // expected-error {{no member named 'f'}}
+
+ using E::a; // ok!
+ E b = a;
+}
diff --git a/test/SemaCXX/enum-unscoped-nonexistent.cpp b/test/SemaCXX/enum-unscoped-nonexistent.cpp
index e9da38f558d3..7da9a96d6054 100644
--- a/test/SemaCXX/enum-unscoped-nonexistent.cpp
+++ b/test/SemaCXX/enum-unscoped-nonexistent.cpp
@@ -6,7 +6,7 @@ struct Base {
template<typename T> struct S : Base {
enum E : int;
constexpr int f() const;
- constexpr int g() const; // expected-note {{declared here}}
+ constexpr int g() const;
void h();
};
template<> enum S<char>::E : int {}; // expected-note {{enum 'S<char>::E' was explicitly specialized here}}
@@ -23,7 +23,7 @@ static_assert(S<int>().f() == 1, "");
// The unqualified-id here names a member of the current instantiation, which
// bizarrely might not exist in some instantiations.
template<typename T> constexpr int S<T>::g() const { return b; } // expected-error {{enumerator 'b' does not exist in instantiation of 'S<char>'}}
-static_assert(S<char>().g() == 1, ""); // expected-note {{here}} expected-error {{not an integral constant expression}} expected-note {{undefined}}
+static_assert(S<char>().g() == 1, ""); // expected-note {{here}} expected-error {{not an integral constant expression}}
static_assert(S<short>().g() == 2, "");
static_assert(S<long>().g() == 8, "");
diff --git a/test/SemaCXX/err_init_conversion_failed.cpp b/test/SemaCXX/err_init_conversion_failed.cpp
new file mode 100644
index 000000000000..0652e7a9ea6a
--- /dev/null
+++ b/test/SemaCXX/err_init_conversion_failed.cpp
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+void test0() {
+ char variable = (void)0;
+ // expected-error@-1{{cannot initialize a variable}}
+}
+
+void test1(int x = (void)0) {}
+ // expected-error@-1{{cannot initialize a parameter}}
+ // expected-note@-2{{here}}
+
+int test2() {
+ return (void)0;
+ // expected-error@-1{{cannot initialize return object}}
+}
+
+struct S4 {
+ S4() : x((void)0) {};
+ // expected-error@-1{{cannot initialize a member subobject}}
+ int x;
+};
+
+void test5() {
+ int foo[2] = {1, (void)0};
+ // expected-error@-1{{cannot initialize an array element}}
+}
+
+void test6() {
+ new int((void)0);
+ // expected-error@-1{{cannot initialize a new value}}
+}
+
+typedef short short2 __attribute__ ((__vector_size__ (2)));
+void test10() {
+ short2 V = { (void)0 };
+ // expected-error@-1{{cannot initialize a vector element}}
+}
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+typedef float float4 __attribute__((ext_vector_type(4)));
+
+void test14(const float2 in, const float2 out) {
+ const float4 V = (float4){ in, out };
+ // expected-error@-1{{cannot initialize a compound literal initializer}}
+}
diff --git a/test/SemaCXX/explicit.cpp b/test/SemaCXX/explicit.cpp
index 5ce2cf19132c..1c4d7704511b 100644
--- a/test/SemaCXX/explicit.cpp
+++ b/test/SemaCXX/explicit.cpp
@@ -4,11 +4,11 @@ struct A {
A(int);
};
-struct B {
+struct B { // expected-note+ {{candidate}}
explicit B(int);
};
-B::B(int) { }
+B::B(int) { } // expected-note+ {{here}}
struct C {
void f(const A&);
@@ -18,6 +18,22 @@ struct C {
void f(C c) {
c.f(10);
}
+
+A a0 = 0;
+A a1(0);
+A &&a2 = 0;
+A &&a3(0);
+A a4{0};
+A &&a5 = {0};
+A &&a6{0};
+
+B b0 = 0; // expected-error {{no viable conversion}}
+B b1(0);
+B &&b2 = 0; // expected-error {{could not bind}}
+B &&b3(0); // expected-error {{could not bind}}
+B b4{0};
+B &&b5 = {0}; // expected-error {{chosen constructor is explicit}}
+B &&b6{0};
}
namespace Conversion {
@@ -40,12 +56,11 @@ namespace Conversion {
void testExplicit()
{
// Taken from 12.3.2p2
- class Y { }; // expected-note {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'Z' to 'const Y &' for 1st argument}} \
- expected-note {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'Z' to 'Y &&' for 1st argument}} \
- expected-note {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'Z' to 'const Y &' for 1st argument}} \
- expected-note {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'Z' to 'Y &&' for 1st argument}}
+ class X { X(); }; // expected-note+ {{candidate constructor}}
+ class Y { }; // expected-note+ {{candidate constructor (the implicit}}
struct Z {
+ explicit operator X() const;
explicit operator Y() const;
explicit operator int() const;
};
@@ -53,6 +68,7 @@ namespace Conversion {
Z z;
// 13.3.1.4p1 & 8.5p16:
Y y2 = z; // expected-error {{no viable conversion from 'Z' to 'Y'}}
+ Y y2b(z);
Y y3 = (Y)z;
Y y4 = Y(z);
Y y5 = static_cast<Y>(z);
@@ -63,7 +79,24 @@ namespace Conversion {
int i4(z);
// 13.3.1.6p1 & 8.5.3p5:
const Y& y6 = z; // expected-error {{no viable conversion from 'Z' to 'const Y'}}
- const int& y7(z);
+ const int& y7 = z; // expected-error {{no viable conversion from 'Z' to 'const int'}}
+ const Y& y8(z);
+ const int& y9(z);
+
+ // Y is an aggregate, so aggregate-initialization is performed and the
+ // conversion function is not considered.
+ const Y y10{z}; // expected-error {{excess elements}}
+ const Y& y11{z}; // expected-error {{no viable conversion from 'Z' to 'const Y'}}
+ const int& y12{z};
+
+ // X is not an aggregate, so constructors are considered.
+ // However, by 13.3.3.1/4, only standard conversion sequences and
+ // ellipsis conversion sequences are considered here, so this is not
+ // allowed.
+ // FIXME: It's not really clear that this is a sensible restriction for this
+ // case. g++ allows this, EDG does not.
+ const X x1{z}; // expected-error {{no matching constructor}}
+ const X& x2{z}; // expected-error {{no matching constructor}}
}
void testBool() {
@@ -119,6 +152,40 @@ namespace Conversion {
// 6.5.3:
for (;b;) {}
for (;n;) {}
+
+ // 13.3.1.5p1:
+ bool direct1(b);
+ bool direct2(n);
+ int direct3(b);
+ int direct4(n); // expected-error {{no viable conversion}}
+ const bool &direct5(b);
+ const bool &direct6(n);
+ const int &direct7(b);
+ const int &direct8(n); // expected-error {{no viable conversion}}
+ bool directList1{b};
+ bool directList2{n};
+ int directList3{b};
+ int directList4{n}; // expected-error {{no viable conversion}}
+ const bool &directList5{b};
+ const bool &directList6{n};
+ const int &directList7{b};
+ const int &directList8{n}; // expected-error {{no viable conversion}}
+ bool copy1 = b;
+ bool copy2 = n; // expected-error {{no viable conversion}}
+ int copy3 = b;
+ int copy4 = n; // expected-error {{no viable conversion}}
+ const bool &copy5 = b;
+ const bool &copy6 = n; // expected-error {{no viable conversion}}
+ const int &copy7 = b;
+ const int &copy8 = n; // expected-error {{no viable conversion}}
+ bool copyList1 = {b};
+ bool copyList2 = {n}; // expected-error {{no viable conversion}}
+ int copyList3 = {b};
+ int copyList4 = {n}; // expected-error {{no viable conversion}}
+ const bool &copyList5 = {b};
+ const bool &copyList6 = {n}; // expected-error {{no viable conversion}}
+ const int &copyList7 = {b};
+ const int &copyList8 = {n}; // expected-error {{no viable conversion}}
}
void testNew()
@@ -145,14 +212,14 @@ namespace Conversion {
operator int*();
};
struct NotPtr {
- explicit operator int*();
+ explicit operator int*(); // expected-note {{conversion}}
};
Ptr p;
NotPtr np;
delete p;
- delete np; // expected-error {{cannot delete expression of type 'NotPtr'}}
+ delete np; // expected-error {{converting delete expression from type 'NotPtr' to type 'int *' invokes an explicit conversion function}}
}
void testFunctionPointer()
@@ -173,3 +240,9 @@ namespace Conversion {
nfp(1); // expected-error {{type 'NotFP' does not provide a call operator}}
}
}
+
+namespace pr8264 {
+ struct Test {
+ explicit explicit Test(int x); // expected-warning{{duplicate 'explicit' declaration specifier}}
+ };
+}
diff --git a/test/SemaCXX/expression-traits.cpp b/test/SemaCXX/expression-traits.cpp
index 2767d4a159c7..3a00687f1125 100644
--- a/test/SemaCXX/expression-traits.cpp
+++ b/test/SemaCXX/expression-traits.cpp
@@ -189,12 +189,12 @@ struct Class : BaseClass
static int& NestedFuncTemplate() { return variable; } // expected-note{{possible target for call}}
template <class T>
- int& NestedMemfunTemplate() { return variable; }
+ int& NestedMemfunTemplate() { return variable; } // expected-note{{possible target for call}}
int operator*() const;
template <class T>
- int operator+(T) const;
+ int operator+(T) const; // expected-note{{possible target for call}}
int NonstaticMemberFunction();
static int StaticMemberFunction();
diff --git a/test/SemaCXX/extern-c.cpp b/test/SemaCXX/extern-c.cpp
index c55b10d9d6e3..dfbf38667c5e 100644
--- a/test/SemaCXX/extern-c.cpp
+++ b/test/SemaCXX/extern-c.cpp
@@ -2,25 +2,25 @@
namespace test1 {
extern "C" {
- void f() {
- void test1_g(int); // expected-note {{previous declaration is here}}
+ void test1_f() {
+ void test1_g(int);
}
}
}
-int test1_g(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+int test1_g(int);
namespace test2 {
extern "C" {
- void f() {
- extern int test2_x; // expected-note {{previous definition is here}}
+ void test2_f() {
+ extern int test2_x; // expected-note {{declared with C language linkage here}}
}
}
}
-float test2_x; // expected-error {{redefinition of 'test2_x' with a different type: 'float' vs 'int'}}
+float test2_x; // expected-error {{declaration of 'test2_x' in global scope conflicts with declaration with C language linkage}}
namespace test3 {
extern "C" {
- void f() {
+ void test3_f() {
extern int test3_b; // expected-note {{previous definition is here}}
}
}
@@ -29,20 +29,40 @@ namespace test3 {
}
}
+namespace N {
+ extern "C" {
+ void test4_f() {
+ extern int test4_b; // expected-note {{declared with C language linkage here}}
+ }
+ }
+}
+static float test4_b; // expected-error {{declaration of 'test4_b' in global scope conflicts with declaration with C language linkage}}
+
extern "C" {
- void test4_f() {
- extern int test4_b; // expected-note {{previous definition is here}}
+ void test4c_f() {
+ extern int test4_c; // expected-note {{previous}}
+ }
+}
+static float test4_c; // expected-error {{redefinition of 'test4_c' with a different type: 'float' vs 'int'}}
+
+namespace N {
+ extern "C" {
+ void test5_f() {
+ extern int test5_b; // expected-note {{declared with C language linkage here}}
+ }
}
}
-static float test4_b; // expected-error {{redefinition of 'test4_b' with a different type: 'float' vs 'int'}}
+extern "C" {
+ static float test5_b; // expected-error {{declaration of 'test5_b' in global scope conflicts with declaration with C language linkage}}
+}
extern "C" {
- void test5_f() {
- extern int test5_b; // expected-note {{previous definition is here}}
+ void test5c_f() {
+ extern int test5_c; // expected-note {{previous}}
}
}
extern "C" {
- static float test5_b; // expected-error {{redefinition of 'test5_b' with a different type: 'float' vs 'int'}}
+ static float test5_c; // expected-error {{redefinition of 'test5_c' with a different type: 'float' vs 'int'}}
}
extern "C" {
@@ -56,3 +76,131 @@ namespace foo {
extern float test6_b;
}
}
+
+namespace linkage {
+ namespace redecl {
+ extern "C" {
+ static void linkage_redecl();
+ static void linkage_redecl(int);
+ void linkage_redecl(); // ok, still not extern "C"
+ void linkage_redecl(int); // ok, still not extern "C"
+ void linkage_redecl(float); // expected-note {{previous}}
+ void linkage_redecl(double); // expected-error {{conflicting types}}
+ }
+ }
+ namespace from_outer {
+ void linkage_from_outer_1(); // expected-note {{previous}}
+ void linkage_from_outer_2(); // expected-note {{previous}}
+ extern "C" {
+ void linkage_from_outer_1(int);
+ void linkage_from_outer_1(); // expected-error {{different language linkage}}
+ void linkage_from_outer_2(); // expected-error {{different language linkage}}
+ }
+ }
+ namespace mixed {
+ extern "C" {
+ void linkage_mixed_1();
+ static void linkage_mixed_1(int);
+
+ static void linkage_mixed_2(int);
+ void linkage_mixed_2();
+ }
+ }
+ namespace across_scopes {
+ namespace X {
+ extern "C" void linkage_across_scopes_f() {
+ void linkage_across_scopes_g(); // expected-note {{previous}}
+ }
+ }
+ namespace Y {
+ extern "C" void linkage_across_scopes_g(int); // expected-error {{conflicting}}
+ }
+ }
+}
+
+int lookup_in_global_f; // expected-note {{here}}
+namespace lookup_in_global {
+ void lookup_in_global_f();
+ void lookup_in_global_g();
+ extern "C" {
+ void lookup_in_global_f(int); // expected-error {{conflicts with declaration in global scope}}
+ void lookup_in_global_g(int); // expected-note {{here}}
+ }
+}
+int lookup_in_global_g; // expected-error {{conflicts with declaration with C language linkage}}
+
+namespace N1 {
+ extern "C" int different_kind_1; // expected-note {{here}}
+ extern "C" void different_kind_2(); // expected-note {{here}}
+}
+namespace N2 {
+ extern "C" void different_kind_1(); // expected-error {{different kind of symbol}}
+ extern "C" int different_kind_2; // expected-error {{different kind of symbol}}
+}
+
+// We allow all these even though the standard says they are ill-formed.
+extern "C" {
+ struct stat {}; // expected-warning{{empty struct has size 0 in C, size 1 in C++}}
+ void stat(struct stat);
+}
+namespace X {
+ extern "C" {
+ void stat(struct ::stat);
+ }
+}
+int stat(int *p);
+void global_fn_vs_extern_c_var_1();
+namespace X {
+ extern "C" int global_fn_vs_extern_c_var_1;
+ extern "C" int global_fn_vs_extern_c_var_2;
+}
+void global_fn_vs_extern_c_var_2();
+void global_fn_vs_extern_c_fn_1();
+namespace X {
+ extern "C" int global_fn_vs_extern_c_fn_1(int);
+ extern "C" int global_fn_vs_extern_c_fn_2(int);
+}
+void global_fn_vs_extern_c_fn_2();
+extern "C" void name_with_using_decl_1(int);
+namespace using_decl {
+ void name_with_using_decl_1();
+ void name_with_using_decl_2();
+ void name_with_using_decl_3();
+}
+using using_decl::name_with_using_decl_1;
+using using_decl::name_with_using_decl_2;
+extern "C" void name_with_using_decl_2(int);
+extern "C" void name_with_using_decl_3(int);
+using using_decl::name_with_using_decl_3;
+
+// We do not allow a global variable and an extern "C" function to have the same
+// name, because such entities may have the same mangled name.
+int global_var_vs_extern_c_fn_1; // expected-note {{here}}
+namespace X {
+ extern "C" void global_var_vs_extern_c_fn_1(); // expected-error {{conflicts with declaration in global scope}}
+ extern "C" void global_var_vs_extern_c_fn_2(); // expected-note {{here}}
+}
+int global_var_vs_extern_c_fn_2; // expected-error {{conflicts with declaration with C language linkage}}
+int global_var_vs_extern_c_var_1; // expected-note {{here}}
+namespace X {
+ extern "C" double global_var_vs_extern_c_var_1; // expected-error {{conflicts with declaration in global scope}}
+ extern "C" double global_var_vs_extern_c_var_2; // expected-note {{here}}
+}
+int global_var_vs_extern_c_var_2; // expected-error {{conflicts with declaration with C language linkage}}
+
+template <class T> struct pr5065_n1 {};
+extern "C" {
+ union pr5065_1 {}; // expected-warning{{empty union has size 0 in C, size 1 in C++}}
+ struct pr5065_2 { int: 0; }; // expected-warning{{struct has size 0 in C, size 1 in C++}}
+ struct pr5065_3 {}; // expected-warning{{empty struct has size 0 in C, size 1 in C++}}
+ struct pr5065_4 { // expected-warning{{empty struct has size 0 in C, size 1 in C++}}
+ struct Inner {}; // expected-warning{{empty struct has size 0 in C, size 1 in C++}}
+ };
+ // These should not warn
+ class pr5065_n3 {};
+ pr5065_n1<int> pr5065_v;
+ struct pr5065_n4 { void m() {} };
+ struct pr5065_n5 : public pr5065_3 {};
+ struct pr5065_n6 : public virtual pr5065_3 {};
+}
+struct pr5065_n7 {};
diff --git a/test/SemaCXX/flexible-array-test.cpp b/test/SemaCXX/flexible-array-test.cpp
index e6c3132801f8..f287711eeb6a 100644
--- a/test/SemaCXX/flexible-array-test.cpp
+++ b/test/SemaCXX/flexible-array-test.cpp
@@ -66,4 +66,8 @@ struct Storage : StorageBase {
int data[];
};
+struct VirtStorage : virtual StorageBase {
+ int data[]; // expected-error {{flexible array member 'data' not allowed in struct which has a virtual base class}}
+};
+
}
diff --git a/test/SemaCXX/for-range-examples.cpp b/test/SemaCXX/for-range-examples.cpp
index 953c98b4c818..b3cf9c326421 100644
--- a/test/SemaCXX/for-range-examples.cpp
+++ b/test/SemaCXX/for-range-examples.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
namespace value_range_detail {
template<typename T>
@@ -180,3 +180,32 @@ namespace test4 {
for (y : {1, 2, 3}) {} // expected-error {{must declare a variable}} expected-warning {{result unused}}
}
}
+
+namespace test5 {
+ // Test error-recovery.
+ void f() {
+ for (auto x : undeclared_identifier) // expected-error {{undeclared identifier}}
+ for (auto y : x->foo)
+ y->bar();
+ for (auto x : 123) // expected-error {{no viable 'begin'}}
+ x->foo();
+ }
+}
+
+namespace test6 {
+ void foo(int arr[]) { // expected-note {{declared here}}
+ for (auto i : arr) { }
+ // expected-error@-1 {{cannot build range expression with array function parameter 'arr' since parameter with array type 'int []' is treated as pointer type 'int *'}}
+ }
+
+ struct vector {
+ int *begin() { return 0; }
+ int *end() { return 0; }
+ };
+
+ void foo(vector arr[]) { // expected-note {{declared here}}
+ // Don't suggest to dereference arr.
+ for (auto i : arr) { }
+ // expected-error@-1 {{cannot build range expression with array function parameter 'arr' since parameter with array type 'test6::vector []' is treated as pointer type 'test6::vector *'}}
+ }
+}
diff --git a/test/SemaCXX/format-strings-0x.cpp b/test/SemaCXX/format-strings-0x.cpp
index 7b3aef1ee5da..7e41c7fdbf9d 100644
--- a/test/SemaCXX/format-strings-0x.cpp
+++ b/test/SemaCXX/format-strings-0x.cpp
@@ -24,4 +24,8 @@ void f(char **sp, float *fp) {
\u1234\U0010fffe
%d)foo" // expected-warning {{more '%' conversions than data arguments}}
);
+
+ printf("init list: %d", { 0 }); // expected-error {{cannot pass initializer list to variadic function; expected type from format string was 'int'}}
+ printf("void: %d", f(sp, fp)); // expected-error {{cannot pass expression of type 'void' to variadic function; expected type from format string was 'int'}}
+ printf(0, { 0 }); // expected-error {{cannot pass initializer list to variadic function}}
}
diff --git a/test/SemaCXX/friend.cpp b/test/SemaCXX/friend.cpp
index b401a06a7ecf..aed2ab2c7d0c 100644
--- a/test/SemaCXX/friend.cpp
+++ b/test/SemaCXX/friend.cpp
@@ -44,7 +44,7 @@ namespace test2 {
// PR5134
namespace test3 {
class Foo {
- friend const int getInt(int inInt = 0);
+ friend const int getInt(int inInt = 0) {}
};
}
@@ -134,7 +134,7 @@ namespace test6_3 {
namespace test7 {
extern "C" {
class X {
- friend int f() { return 42; }
+ friend int test7_f() { return 42; }
};
}
}
@@ -154,3 +154,137 @@ namespace test8 {
friend void B::f(); // expected-error {{cannot befriend target of using declaration}}
};
}
+
+// PR16423
+namespace test9 {
+ class C {
+ };
+ struct A {
+ friend void C::f(int, int, int) {} // expected-error {{no function named 'f' with type 'void (int, int, int)' was found in the specified scope}}
+ };
+}
+
+namespace test10 {
+ struct X {};
+ extern void f10_a();
+ extern void f10_a(X);
+ struct A {
+ friend void f10_a();
+ friend void f10_b();
+ friend void f10_c();
+ friend void f10_d();
+ friend void f10_a(X);
+ friend void f10_b(X);
+ friend void f10_c(X);
+ friend void f10_d(X);
+ };
+ extern void f10_b();
+ extern void f10_b(X);
+ struct B {
+ friend void f10_a();
+ friend void f10_b();
+ friend void f10_c();
+ friend void f10_d();
+ friend void f10_a(X);
+ friend void f10_b(X);
+ friend void f10_c(X);
+ friend void f10_d(X);
+ };
+ extern void f10_c();
+ extern void f10_c(X);
+
+ // FIXME: Give a better diagnostic for the case where a function exists but is
+ // not visible.
+ void g(X x) {
+ f10_a();
+ f10_b();
+ f10_c();
+ f10_d(); // expected-error {{undeclared identifier}}
+
+ ::test10::f10_a();
+ ::test10::f10_b();
+ ::test10::f10_c();
+ ::test10::f10_d(); // expected-error {{no member named 'f10_d'}}
+
+ f10_a(x);
+ f10_b(x);
+ f10_c(x);
+ f10_d(x); // PR16597: expected-error {{undeclared identifier}}
+
+ ::test10::f10_a(x);
+ ::test10::f10_b(x);
+ ::test10::f10_c(x);
+ ::test10::f10_d(x); // expected-error {{no type named 'f10_d'}}
+ }
+
+ struct Y : X {
+ friend void f10_d();
+ friend void f10_d(X);
+ };
+
+ struct Z {
+ operator X();
+ friend void f10_d();
+ friend void f10_d(X);
+ };
+
+ void g(X x, Y y, Z z) {
+ f10_d(); // expected-error {{undeclared identifier}}
+ ::test10::f10_d(); // expected-error {{no member named 'f10_d'}}
+
+ // f10_d is visible to ADL in the second and third cases.
+ f10_d(x); // expected-error {{undeclared identifier}}
+ f10_d(y);
+ f10_d(z);
+
+ // No ADL here.
+ ::test10::f10_d(x); // expected-error {{no type named 'f10_d'}}
+ ::test10::f10_d(y); // expected-error {{no type named 'f10_d'}}
+ ::test10::f10_d(z); // expected-error {{no type named 'f10_d'}}
+ }
+
+ void local_externs(X x, Y y) {
+ extern void f10_d();
+ extern void f10_d(X);
+ f10_d();
+ f10_d(x);
+ // FIXME: This lookup should fail, because the local extern declaration
+ // should suppress ADL.
+ f10_d(y);
+ {
+ int f10_d;
+ f10_d(); // expected-error {{not a function}}
+ f10_d(x); // expected-error {{not a function}}
+ f10_d(y); // expected-error {{not a function}}
+ }
+ }
+
+ void i(X x, Y y) {
+ f10_d(); // expected-error {{undeclared identifier}}
+ f10_d(x); // expected-error {{undeclared identifier}}
+ f10_d(y);
+ }
+
+ struct C {
+ friend void f10_d();
+ friend void f10_d(X);
+ };
+
+ void j(X x, Y y) {
+ f10_d(); // expected-error {{undeclared identifier}}
+ f10_d(x); // expected-error {{undeclared identifier}}
+ f10_d(y);
+ }
+
+ extern void f10_d();
+ extern void f10_d(X);
+ void k(X x, Y y, Z z) {
+ // All OK now.
+ f10_d();
+ f10_d(x);
+ ::test10::f10_d();
+ ::test10::f10_d(x);
+ ::test10::f10_d(y);
+ ::test10::f10_d(z);
+ }
+}
diff --git a/test/SemaCXX/function-pointer-arguments.cpp b/test/SemaCXX/function-pointer-arguments.cpp
new file mode 100644
index 000000000000..9f3fb0a4ec20
--- /dev/null
+++ b/test/SemaCXX/function-pointer-arguments.cpp
@@ -0,0 +1,52 @@
+//RUN: %clang_cc1 -fsyntax-only -verify %s
+
+namespace PR16570 {
+ int f1(int, int);
+ int f2(const int, int);
+ int f3(int&, int);
+ int f4(const int&, int);
+
+ void good() {
+ int(*g1)(int, int) = f1;
+ int(*g2)(const int, int) = f1;
+ int(*g3)(volatile int, int) = f1;
+ int(*g4)(int, int) = f2;
+ int(*g5)(const int, int) = f2;
+ int(*g6)(volatile int, int) = f2;
+ int(*g7)(int&, int) = f3;
+ int(*g8)(const int&, int) = f4;
+ }
+
+ void bad() {
+ void (*g1)(int, int) = f1;
+ // expected-error@-1 {{different return type ('void' vs 'int'}}
+ const int (*g2)(int, int) = f1;
+ // expected-error@-1 {{different return type ('const int' vs 'int')}}
+
+ int (*g3)(char, int) = f1;
+ // expected-error@-1 {{type mismatch at 1st parameter ('char' vs 'int')}}
+ int (*g4)(int, char) = f1;
+ // expected-error@-1 {{type mismatch at 2nd parameter ('char' vs 'int')}}
+
+ int (*g5)(int) = f1;
+ // expected-error@-1 {{different number of parameters (1 vs 2)}}
+
+ int (*g6)(int, int, int) = f1;
+ // expected-error@-1 {{different number of parameters (3 vs 2)}}
+
+ int (*g7)(const int, char) = f1;
+ // expected-error@-1 {{type mismatch at 2nd parameter ('char' vs 'int')}}
+ int (*g8)(int, char) = f2;
+ // expected-error@-1 {{type mismatch at 2nd parameter ('char' vs 'int')}}
+ int (*g9)(const int&, char) = f3;
+ // expected-error@-1 {{type mismatch at 1st parameter ('const int &' vs 'int &')}}
+ int (*g10)(int&, char) = f4;
+ // expected-error@-1 {{type mismatch at 1st parameter ('int &' vs 'const int &')}}
+ }
+
+ typedef void (*F)(const char * __restrict__, int);
+ void g(const char *, unsigned);
+ F f = g;
+ // expected-error@-1 {{type mismatch at 2nd parameter ('int' vs 'unsigned int')}}
+
+}
diff --git a/test/SemaCXX/function-redecl.cpp b/test/SemaCXX/function-redecl.cpp
index b9d1f23af402..2bc0d90cd627 100644
--- a/test/SemaCXX/function-redecl.cpp
+++ b/test/SemaCXX/function-redecl.cpp
@@ -4,22 +4,24 @@ int foo(int);
namespace N {
void f1() {
void foo(int); // okay
+ void bar(int); // expected-note 2{{previous declaration is here}}
}
- // FIXME: we shouldn't even need this declaration to detect errors
- // below.
- void foo(int); // expected-note{{previous declaration is here}}
+ void foo(int); // expected-note 2{{previous declaration is here}}
void f2() {
- int foo(int); // expected-error{{functions that differ only in their return type cannot be overloaded}}
+ int foo(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+ int bar(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+ int baz(int); // expected-note {{previous declaration is here}}
{
int foo;
+ int bar;
+ int baz;
{
- // FIXME: should diagnose this because it's incompatible with
- // N::foo. However, name lookup isn't properly "skipping" the
- // "int foo" above.
- float foo(int);
+ float foo(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+ float bar(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+ float baz(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
}
}
}
diff --git a/test/SemaCXX/function-type-qual.cpp b/test/SemaCXX/function-type-qual.cpp
index ccb57472925d..613ac9b200f1 100644
--- a/test/SemaCXX/function-type-qual.cpp
+++ b/test/SemaCXX/function-type-qual.cpp
@@ -29,3 +29,11 @@ cfn C::*mpg;
// Don't crash!
void (PR14171)() const; // expected-error {{non-member function cannot have 'const' qualifier}}
+
+// Test template instantiation of decayed array types. Not really related to
+// type quals.
+template <typename T> void arrayDecay(const T a[]) { }
+void instantiateArrayDecay() {
+ int a[1];
+ arrayDecay(a);
+}
diff --git a/test/SemaCXX/gnu-flags.cpp b/test/SemaCXX/gnu-flags.cpp
new file mode 100644
index 000000000000..05770c53704e
--- /dev/null
+++ b/test/SemaCXX/gnu-flags.cpp
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wno-gnu
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wgnu
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wno-gnu \
+// RUN: -Wgnu-anonymous-struct -Wredeclared-class-member \
+// RUN: -Wgnu-flexible-array-union-member -Wgnu-folding-constant \
+// RUN: -Wgnu-empty-struct
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wgnu \
+// RUN: -Wno-gnu-anonymous-struct -Wno-redeclared-class-member \
+// RUN: -Wno-gnu-flexible-array-union-member -Wno-gnu-folding-constant \
+// RUN: -Wno-gnu-empty-struct
+// Additional disabled tests:
+// %clang_cc1 -fsyntax-only -verify %s -DANONYMOUSSTRUCT -Wno-gnu -Wgnu-anonymous-struct
+// %clang_cc1 -fsyntax-only -verify %s -DREDECLAREDCLASSMEMBER -Wno-gnu -Wredeclared-class-member
+// %clang_cc1 -fsyntax-only -verify %s -DFLEXIBLEARRAYUNIONMEMBER -Wno-gnu -Wgnu-flexible-array-union-member
+// %clang_cc1 -fsyntax-only -verify %s -DFOLDINGCONSTANT -Wno-gnu -Wgnu-folding-constant
+// %clang_cc1 -fsyntax-only -verify %s -DEMPTYSTRUCT -Wno-gnu -Wgnu-empty-struct
+
+#if NONE
+// expected-no-diagnostics
+#endif
+
+
+#if ALL || ANONYMOUSSTRUCT
+// expected-warning@+5 {{anonymous structs are a GNU extension}}
+#endif
+
+struct as {
+ int x;
+ struct {
+ int a;
+ float b;
+ };
+};
+
+
+#if ALL || REDECLAREDCLASSMEMBER
+// expected-note@+6 {{previous declaration is here}}
+// expected-warning@+6 {{class member cannot be redeclared}}
+#endif
+
+namespace rcm {
+ class A {
+ class X;
+ class X;
+ class X {};
+ };
+}
+
+
+#if ALL || FLEXIBLEARRAYUNIONMEMBER
+// expected-warning@+6 {{flexible array member 'c1' in a union is a GNU extension}}
+#endif
+
+struct faum {
+ int l;
+ union {
+ int c1[];
+ };
+};
+
+
+#if ALL || FOLDINGCONSTANT
+// expected-warning@+4 {{in-class initializer for static data member is not a constant expression; folding it to a constant is a GNU extension}}
+#endif
+
+struct fic {
+ static const int B = int(0.75 * 1000 * 1000);
+};
+
+
+#if ALL || EMPTYSTRUCT
+// expected-warning@+3 {{flexible array member 'a' in otherwise empty struct is a GNU extension}}
+#endif
+
+struct ofam {int a[];};
+
diff --git a/test/SemaCXX/i-c-e-cxx.cpp b/test/SemaCXX/i-c-e-cxx.cpp
index c80323ccd78a..39c6b1fc1320 100644
--- a/test/SemaCXX/i-c-e-cxx.cpp
+++ b/test/SemaCXX/i-c-e-cxx.cpp
@@ -16,7 +16,7 @@ void f() {
}
int a() {
- const int t=t; // expected-note {{declared here}}
+ const int t=t; // expected-note {{declared here}} expected-note {{read of object outside its lifetime}}
switch(1) { // expected-warning {{no case matching constant switch condition '1'}}
case t:; // expected-error {{not an integral constant expression}} expected-note {{initializer of 't' is not a constant expression}}
}
diff --git a/test/SemaCXX/implicit-virtual-member-functions.cpp b/test/SemaCXX/implicit-virtual-member-functions.cpp
index f6082e5699cc..cd547f576459 100644
--- a/test/SemaCXX/implicit-virtual-member-functions.cpp
+++ b/test/SemaCXX/implicit-virtual-member-functions.cpp
@@ -9,7 +9,7 @@ struct B : A { // expected-error {{no suitable member 'operator delete' in 'B'}}
void operator delete (void *, int); // expected-note {{'operator delete' declared here}}
};
-void B::f() { // expected-note {{implicit default destructor for 'B' first required here}}
+void B::f() { // expected-note {{implicit destructor for 'B' first required here}}
}
struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}}
@@ -17,13 +17,13 @@ struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}}
void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
};
-C::C() { } // expected-note {{implicit default destructor for 'C' first required here}}
+C::C() { } // expected-note {{implicit destructor for 'C' first required here}}
struct D : A { // expected-error {{no suitable member 'operator delete' in 'D'}}
void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
};
void f() {
- new D; // expected-note {{implicit default destructor for 'D' first required here}}
+ new D; // expected-note {{implicit destructor for 'D' first required here}}
}
diff --git a/test/SemaCXX/inherit.cpp b/test/SemaCXX/inherit.cpp
index a926c812514c..abeed9ab4755 100644
--- a/test/SemaCXX/inherit.cpp
+++ b/test/SemaCXX/inherit.cpp
@@ -30,3 +30,6 @@ typedef G_copy G_copy_3;
class H : G_copy, A, G_copy_2, // expected-error{{base class 'G_copy' (aka 'G') specified more than once as a direct base class}}
public G_copy_3 { }; // expected-error{{base class 'G_copy' (aka 'G') specified more than once as a direct base class}}
+
+struct J { char c; int i[]; };
+struct K : J { }; // expected-error{{base class 'J' has a flexible array member}}
diff --git a/test/SemaCXX/init-priority-attr.cpp b/test/SemaCXX/init-priority-attr.cpp
index 6facebf0d000..a91eb60ba96c 100644
--- a/test/SemaCXX/init-priority-attr.cpp
+++ b/test/SemaCXX/init-priority-attr.cpp
@@ -19,11 +19,11 @@ extern Two koo[];
Two foo __attribute__((init_priority(101))) ( 5, 6 );
-Two goo __attribute__((init_priority(2,3))) ( 5, 6 ); // expected-error {{attribute takes one argument}}
+Two goo __attribute__((init_priority(2,3))) ( 5, 6 ); // expected-error {{'init_priority' attribute takes one argument}}
Two coo[2] __attribute__((init_priority(3))); // expected-error {{init_priority attribute requires integer constant between 101 and 65535 inclusive}}
-Two koo[4] __attribute__((init_priority(1.13))); // expected-error {{'init_priority' attribute requires integer constant}}
+Two koo[4] __attribute__((init_priority(1.13))); // expected-error {{'init_priority' attribute requires an integer constant}}
Two func() __attribute__((init_priority(1001))); // expected-error {{can only use 'init_priority' attribute on file-scope definitions of objects of class type}}
diff --git a/test/SemaCXX/lambda-expressions.cpp b/test/SemaCXX/lambda-expressions.cpp
index a333f38530b3..e2904247c4b4 100644
--- a/test/SemaCXX/lambda-expressions.cpp
+++ b/test/SemaCXX/lambda-expressions.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -std=c++0x -Wno-unused-value -fsyntax-only -verify -fblocks %s
+// RUN: %clang_cc1 -std=c++11 -Wno-unused-value -fsyntax-only -verify -fblocks %s
+// RUN: %clang_cc1 -std=c++1y -Wno-unused-value -fsyntax-only -verify -fblocks %s
namespace std { class type_info; };
@@ -109,27 +110,30 @@ namespace PR12031 {
}
}
-namespace NullPtr {
+namespace Array {
int &f(int *p);
char &f(...);
void g() {
- int n = 0;
+ int n = -1;
[=] {
- char &k = f(n); // not a null pointer constant
+ int arr[n]; // VLA
} ();
- const int m = 0;
- [=] {
- int &k = f(m); // expected-warning{{expression which evaluates to zero treated as a null pointer constant of type 'int *'}}
+ const int m = -1;
+ [] {
+ int arr[m]; // expected-error{{negative size}}
} ();
- [=] () -> bool {
- int &k = f(m); // expected-warning{{expression which evaluates to zero treated as a null pointer constant of type 'int *'}}
- return &m == 0;
+ [&] {
+ int arr[m]; // expected-error{{negative size}}
+ } ();
+
+ [=] {
+ int arr[m]; // expected-error{{negative size}}
} ();
[m] {
- int &k = f(m); // expected-warning{{expression which evaluates to zero treated as a null pointer constant of type 'int *'}}
+ int arr[m]; // expected-error{{negative size}}
} ();
}
}
@@ -240,3 +244,42 @@ namespace PR13854 {
namespace PR14518 {
auto f = [](void) { return __func__; }; // no-warning
}
+
+namespace PR16708 {
+ auto L = []() {
+ auto ret = 0;
+ return ret;
+ return 0;
+ };
+}
+
+namespace TypeDeduction {
+ struct S {};
+ void f() {
+ const S s {};
+ S &&t = [&] { return s; } ();
+#if __cplusplus <= 201103L
+ // expected-error@-2 {{drops qualifiers}}
+#else
+ S &&u = [&] () -> auto { return s; } ();
+#endif
+ }
+}
+
+
+namespace lambdas_in_NSDMIs {
+ template<class T>
+ struct L {
+ T t{};
+ T t2 = ([](int a) { return [](int b) { return b; };})(t)(t);
+ };
+ L<int> l;
+
+ namespace non_template {
+ struct L {
+ int t = 0;
+ int t2 = ([](int a) { return [](int b) { return b; };})(t)(t);
+ };
+ L l;
+ }
+} \ No newline at end of file
diff --git a/test/SemaCXX/libstdcxx_pointer_return_false_hack.cpp b/test/SemaCXX/libstdcxx_pointer_return_false_hack.cpp
new file mode 100644
index 000000000000..17e1548ac50d
--- /dev/null
+++ b/test/SemaCXX/libstdcxx_pointer_return_false_hack.cpp
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -fsyntax-only %s -std=c++11 -verify
+
+// This is a test for an egregious hack in Clang that works around
+// an issue with libstdc++-4.2's <tr1/hashtable> implementation.
+// The code in question returns 'false' from a function with a pointer
+// return type, which is ill-formed in C++11.
+
+#ifdef BE_THE_HEADER
+
+#pragma GCC system_header
+namespace std {
+ namespace tr1 {
+ template<typename T> struct hashnode;
+ template<typename T> struct hashtable {
+ typedef hashnode<T> node;
+ node *find_node() {
+ // This is ill-formed in C++11, per core issue 903, but we accept
+ // it anyway in a system header.
+ return false;
+ }
+ };
+ }
+}
+
+#else
+
+#define BE_THE_HEADER
+#include "libstdcxx_pointer_return_false_hack.cpp"
+
+auto *test1 = std::tr1::hashtable<int>().find_node();
+
+void *test2() { return false; } // expected-error {{cannot initialize}}
+
+#endif
diff --git a/test/SemaCXX/linkage-spec.cpp b/test/SemaCXX/linkage-spec.cpp
index 504df0d35c2d..1598d0e35a05 100644
--- a/test/SemaCXX/linkage-spec.cpp
+++ b/test/SemaCXX/linkage-spec.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wretained-language-linkage -DW_RETAINED_LANGUAGE_LINKAGE %s
extern "C" {
extern "C" void f(int);
}
@@ -41,7 +42,7 @@ namespace pr5430 {
using namespace pr5430;
extern "C" void pr5430::func(void) { }
-// PR5404
+// PR5405
int f2(char *)
{
return 0;
@@ -55,6 +56,18 @@ extern "C"
}
}
+namespace PR5405 {
+ int f2b(char *) {
+ return 0;
+ }
+
+ extern "C" {
+ int f2b(int) {
+ return f2b((char *)0); // ok
+ }
+ }
+}
+
// PR6991
extern "C" typedef int (*PutcFunc_t)(int);
@@ -114,3 +127,49 @@ namespace pr14958 {
}
int js::ObjectClass;
}
+
+extern "C" void PR16167; // expected-error {{variable has incomplete type 'void'}}
+extern void PR16167_0; // expected-error {{variable has incomplete type 'void'}}
+
+// PR7927
+enum T_7927 {
+ E_7927
+};
+
+extern "C" void f_pr7927(int);
+
+namespace {
+ extern "C" void f_pr7927(int);
+
+ void foo_pr7927() {
+ f_pr7927(E_7927);
+ f_pr7927(0);
+ ::f_pr7927(E_7927);
+ ::f_pr7927(0);
+ }
+}
+
+void bar_pr7927() {
+ f_pr7927(E_7927);
+ f_pr7927(0);
+ ::f_pr7927(E_7927);
+ ::f_pr7927(0);
+}
+
+namespace PR17337 {
+ extern "C++" {
+ class Foo;
+ extern "C" int bar3(Foo *y);
+ class Foo {
+ int x;
+ friend int bar3(Foo *y);
+#ifdef W_RETAINED_LANGUAGE_LINKAGE
+// expected-note@-5 {{previous declaration is here}}
+// expected-warning@-3 {{retaining previous language linkage}}
+#endif
+ };
+ extern "C" int bar3(Foo *y) {
+ return y->x;
+ }
+ }
+}
diff --git a/test/SemaCXX/linkage2.cpp b/test/SemaCXX/linkage2.cpp
index 3cfa98138bab..075f5e70c247 100644
--- a/test/SemaCXX/linkage2.cpp
+++ b/test/SemaCXX/linkage2.cpp
@@ -1,5 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fsyntax-only -verify -fmodules %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++11-extensions -Wno-local-type-template-args %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++11-extensions -Wno-local-type-template-args -fmodules %s
namespace test1 {
int x; // expected-note {{previous definition is here}}
@@ -65,7 +66,7 @@ namespace test6 {
get_future();
template <class _Rp>
struct shared_future<_Rp&> {
- shared_future(future<_Rp&>&& __f); // expected-warning {{rvalue references are a C++11 extension}}
+ shared_future(future<_Rp&>&& __f);
};
void f() {
typedef int T;
@@ -164,3 +165,51 @@ namespace test16 {
}
}
}
+
+namespace test17 {
+ namespace {
+ struct I {
+ };
+ }
+ template <typename T1, typename T2> void foo() {}
+ template <typename T, T x> void bar() {} // expected-note {{candidate function}}
+ inline void *g() {
+ struct L {
+ };
+ // foo<L, I>'s linkage should be the merge of UniqueExternalLinkage (or
+ // InternalLinkage in c++11) and VisibleNoLinkage. The correct answer is
+ // NoLinkage in both cases. This means that using foo<L, I> as a template
+ // argument should fail.
+ return reinterpret_cast<void*>(bar<typeof(foo<L, I>), foo<L, I> >); // expected-error {{reinterpret_cast cannot resolve overloaded function 'bar' to type 'void *}}
+ }
+ void h() {
+ g();
+ }
+}
+
+namespace test18 {
+ template <typename T> struct foo {
+ template <T *P> static void f() {}
+ static void *g() { return (void *)f<&x>; }
+ static T x;
+ };
+ template <typename T> T foo<T>::x;
+ inline void *f() {
+ struct S {
+ };
+ return foo<S>::g();
+ }
+ void *h() { return f(); }
+}
+
+extern "C" void pr16247_foo(int);
+static void pr16247_foo(double);
+void pr16247_foo(int) {}
+void pr16247_foo(double) {}
+
+namespace PR16247 {
+ extern "C" void pr16247_bar(int);
+ static void pr16247_bar(double);
+ void pr16247_bar(int) {}
+ void pr16247_bar(double) {}
+}
diff --git a/test/SemaCXX/member-expr.cpp b/test/SemaCXX/member-expr.cpp
index 515bcd43b2c0..239aecff815d 100644
--- a/test/SemaCXX/member-expr.cpp
+++ b/test/SemaCXX/member-expr.cpp
@@ -87,7 +87,7 @@ namespace test5 {
}
void test2(A &x) {
- x->A::foo<int>(); // expected-error {{'test5::A' is not a pointer}}
+ x->A::foo<int>(); // expected-error {{'test5::A' is not a pointer; maybe you meant to use '.'?}}
}
}
@@ -172,3 +172,55 @@ void f(int i) {
j = 0;
}
}
+
+namespace PR15045 {
+ class Cl0 {
+ public:
+ int a;
+ };
+
+ int f() {
+ Cl0 c;
+ return c->a; // expected-error {{member reference type 'PR15045::Cl0' is not a pointer; maybe you meant to use '.'?}}
+ }
+
+ struct bar {
+ void func(); // expected-note {{'func' declared here}}
+ };
+
+ struct foo {
+ bar operator->(); // expected-note 2 {{'->' applied to return value of the operator->() declared here}}
+ };
+
+ template <class T> void call_func(T t) {
+ t->func(); // expected-error-re 2 {{member reference type 'PR15045::bar' is not a pointer$}} \
+ // expected-note {{did you mean to use '.' instead?}}
+ }
+
+ void test_arrow_on_non_pointer_records() {
+ bar e;
+ foo f;
+
+ // Show that recovery has happened by also triggering typo correction
+ e->Func(); // expected-error {{member reference type 'PR15045::bar' is not a pointer; maybe you meant to use '.'?}} \
+ // expected-error {{no member named 'Func' in 'PR15045::bar'; did you mean 'func'?}}
+
+ // Make sure a fixit isn't given in the case that the '->' isn't actually
+ // the problem (the problem is with the return value of an operator->).
+ f->func(); // expected-error-re {{member reference type 'PR15045::bar' is not a pointer$}}
+
+ call_func(e); // expected-note {{in instantiation of function template specialization 'PR15045::call_func<PR15045::bar>' requested here}}
+
+ call_func(f); // expected-note {{in instantiation of function template specialization 'PR15045::call_func<PR15045::foo>' requested here}}
+ }
+}
+
+namespace pr16676 {
+ struct S { int i; };
+ struct T { S* get_s(); };
+ int f(S* s) {
+ T t;
+ return t.get_s // expected-error {{reference to non-static member function must be called; did you mean to call it with no arguments?}}
+ .i; // expected-error {{member reference type 'pr16676::S *' is a pointer; maybe you meant to use '->'}}
+ }
+}
diff --git a/test/SemaCXX/member-init.cpp b/test/SemaCXX/member-init.cpp
index 19e8e7597e85..6e4fd5df5a08 100644
--- a/test/SemaCXX/member-init.cpp
+++ b/test/SemaCXX/member-init.cpp
@@ -89,3 +89,14 @@ namespace PR14838 {
const function &r; // expected-note {{reference member declared here}}
} af;
}
+
+namespace rdar14084171 {
+ struct Point { // expected-note 3 {{candidate constructor}}
+ double x;
+ double y;
+ };
+ struct Sprite {
+ Point location = Point(0,0); // expected-error {{no matching constructor for initialization of 'rdar14084171::Point'}}
+ };
+ void f(Sprite& x) { x = x; }
+}
diff --git a/test/SemaCXX/member-pointer-ms.cpp b/test/SemaCXX/member-pointer-ms.cpp
index 7dca12190584..aee8e2eca774 100644
--- a/test/SemaCXX/member-pointer-ms.cpp
+++ b/test/SemaCXX/member-pointer-ms.cpp
@@ -5,8 +5,6 @@
// 2012, which supports C++11 and static_assert. It should pass for both 64-bit
// and 32-bit x86.
//
-// expected-no-diagnostics
-
// Test the size of various member pointer combinations:
// - complete and incomplete
// - single, multiple, and virtual inheritance (and unspecified for incomplete)
@@ -165,3 +163,6 @@ struct MemPtrInTemplate {
int T::*data_ptr;
void (T::*func_ptr)();
};
+
+int Virtual::*CastTest = reinterpret_cast<int Virtual::*>(&AA::x);
+ // expected-error@-1 {{cannot reinterpret_cast from member pointer type}}
diff --git a/test/SemaCXX/microsoft-dtor-lookup.cpp b/test/SemaCXX/microsoft-dtor-lookup.cpp
new file mode 100644
index 000000000000..d264bab09bf7
--- /dev/null
+++ b/test/SemaCXX/microsoft-dtor-lookup.cpp
@@ -0,0 +1,87 @@
+// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi itanium -fsyntax-only %s
+// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi microsoft -verify -DMSVC_ABI %s
+
+namespace Test1 {
+
+// Should be accepted under the Itanium ABI (first RUN line) but rejected
+// under the Microsoft ABI (second RUN line), as Microsoft ABI requires
+// operator delete() lookups to be done at all virtual destructor declaration
+// points.
+
+struct A {
+ void operator delete(void *); // expected-note {{member found by ambiguous name lookup}}
+};
+
+struct B {
+ void operator delete(void *); // expected-note {{member found by ambiguous name lookup}}
+};
+
+struct C : A, B {
+ ~C();
+};
+
+struct VC : A, B {
+ virtual ~VC(); // expected-error {{member 'operator delete' found in multiple base classes of different types}}
+};
+
+}
+
+namespace Test2 {
+
+// In the MSVC ABI, functions must destroy their aggregate arguments. foo
+// requires a dtor for B, but we can't implicitly define it because ~A is
+// private. bar should be able to call A's private dtor without error, even
+// though MSVC rejects bar.
+
+class A {
+private:
+ ~A(); // expected-note 2{{declared private here}}
+ int a;
+};
+
+struct B : public A { // expected-error {{base class 'Test2::A' has private destructor}}
+ int b;
+};
+
+struct C {
+ ~C();
+ int c;
+};
+
+struct D {
+ // D has a non-trivial implicit dtor that destroys C.
+ C o;
+};
+
+void foo(B b) { } // expected-note {{implicit destructor for 'Test2::B' first required here}}
+void bar(A a) { } // expected-error {{variable of type 'Test2::A' has private destructor}}
+void baz(D d) { } // no error
+
+}
+
+#ifdef MSVC_ABI
+namespace Test3 {
+
+class A {
+ A();
+ ~A(); // expected-note 2{{implicitly declared private here}}
+ friend void bar(A);
+ int a;
+};
+
+void bar(A a) { }
+void baz(A a) { } // expected-error {{variable of type 'Test3::A' has private destructor}}
+
+// MSVC accepts foo() but we reject it for consistency with Itanium. MSVC also
+// rejects this if A has a copy ctor or if we call A's ctor.
+void foo(A *a) {
+ bar(*a); // expected-error {{temporary of type 'Test3::A' has private destructor}}
+}
+}
+#endif
+
+namespace Test4 {
+// Don't try to access the dtor of an incomplete on a function declaration.
+class A;
+void foo(A a);
+}
diff --git a/test/SemaCXX/microsoft-new-delete.cpp b/test/SemaCXX/microsoft-new-delete.cpp
new file mode 100644
index 000000000000..e0d25dcd86f7
--- /dev/null
+++ b/test/SemaCXX/microsoft-new-delete.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fms-compatibility -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+#include <stddef.h>
+
+struct arbitrary_t {} arbitrary;
+void *operator new(size_t size, arbitrary_t);
+
+void f() {
+ // Expect no error in MSVC compatibility mode
+ int *p = new(arbitrary) int[4];
+}
diff --git a/test/SemaCXX/missing-members.cpp b/test/SemaCXX/missing-members.cpp
index 529ba1023dcd..619bc61f2501 100644
--- a/test/SemaCXX/missing-members.cpp
+++ b/test/SemaCXX/missing-members.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
namespace A {
namespace B {
- class C { };
+ class C { }; // expected-note 2 {{'A::B::C' declared here}}
struct S { };
union U { };
}
@@ -19,8 +19,12 @@ namespace B {
void g() {
A::B::D::E; // expected-error {{no member named 'D' in namespace 'A::B'}}
- B::B::C::D; // expected-error {{no member named 'C' in 'B::B'}}
- ::C::D; // expected-error {{no member named 'C' in the global namespace}}
+ // FIXME: The typo corrections below should be suppressed since A::B::C
+ // doesn't have a member named D.
+ B::B::C::D; // expected-error {{no member named 'C' in 'B::B'; did you mean 'A::B::C'?}} \
+ // expected-error {{no member named 'D' in 'A::B::C'}}
+ ::C::D; // expected-error {{no member named 'C' in the global namespace; did you mean 'A::B::C'?}}\
+ // expected-error {{no member named 'D' in 'A::B::C'}}
}
int A::B::i = 10; // expected-error {{no member named 'i' in namespace 'A::B'}}
diff --git a/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp b/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
index 40bcf45bca32..6195e0395515 100644
--- a/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
+++ b/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
@@ -19,7 +19,7 @@ namespace fizbin {
// expected-note{{'fizbin::nested::lessFoobar' declared here}}
class dummy { // expected-note 2 {{'fizbin::dummy' declared here}}
public:
- static bool moreFoobar() { return false; } // expected-note{{'moreFoobar' declared here}}
+ static bool morebar() { return false; } // expected-note{{'morebar' declared here}}
};
}
void Check() { // expected-note{{'Check' declared here}}
@@ -29,9 +29,9 @@ void Check() { // expected-note{{'Check' declared here}}
if (lessFoobar()) Double(7); // expected-error{{use of undeclared identifier 'lessFoobar'; did you mean 'fizbin::nested::lessFoobar'?}}
if (baztool::toFoobar()) Double(7); // expected-error{{use of undeclared identifier 'baztool'; did you mean 'fizbin::baztool'?}}
if (nested::moreFoobar()) Double(7); // expected-error{{use of undeclared identifier 'nested'; did you mean 'fizbin::nested'?}}
- if (dummy::moreFoobar()) Double(7); // expected-error{{use of undeclared identifier 'dummy'; did you mean 'fizbin::dummy'?}}
- if (dummy::mreFoobar()) Double(7); // expected-error{{use of undeclared identifier 'dummy'; did you mean 'fizbin::dummy'?}} \
- // expected-error{{no member named 'mreFoobar' in 'fizbin::dummy'; did you mean 'moreFoobar'?}}
+ if (dummy::morebar()) Double(7); // expected-error{{use of undeclared identifier 'dummy'; did you mean 'fizbin::dummy'?}}
+ if (dummy::mrebar()) Double(7); // expected-error{{use of undeclared identifier 'dummy'; did you mean 'fizbin::dummy'?}} \
+ // expected-error{{no member named 'mrebar' in 'fizbin::dummy'; did you mean 'morebar'?}}
if (moFoobin()) Double(7); // expected-error{{use of undeclared identifier 'moFoobin'}}
}
diff --git a/test/SemaCXX/ms-overload-entry-point.cpp b/test/SemaCXX/ms-overload-entry-point.cpp
new file mode 100644
index 000000000000..67fed01f6317
--- /dev/null
+++ b/test/SemaCXX/ms-overload-entry-point.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions -triple i386-pc-win32 %s
+
+template <typename T>
+int wmain() { // expected-error{{'wmain' cannot be a template}}
+ return 0;
+}
+
+namespace {
+int WinMain(void) { return 0; }
+int WinMain(int) { return 0; }
+}
+
+void wWinMain(void) {} // expected-note{{previous definition is here}}
+void wWinMain(int) {} // expected-error{{conflicting types for 'wWinMain'}}
+
+int foo() {
+ wmain<void>(); // expected-error{{no matching function for call to 'wmain'}}
+ wmain<int>(); // expected-error{{no matching function for call to 'wmain'}}
+ WinMain();
+ return 0;
+}
diff --git a/test/SemaCXX/ms-wchar.cpp b/test/SemaCXX/ms-wchar.cpp
new file mode 100644
index 000000000000..878d8cadcebe
--- /dev/null
+++ b/test/SemaCXX/ms-wchar.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions -triple i386-pc-win32 %s
+
+wchar_t f();
+__wchar_t f(); // No error, wchar_t and __wchar_t are the same type.
+
+__wchar_t g = L'a';
+__wchar_t s[] = L"Hello world!";
+
+unsigned short t[] = L"Hello world!"; // expected-error{{array initializer must be an initializer list}}
+
+wchar_t u[] = 1; // expected-error{{array initializer must be an initializer list or wide string literal}}
+__wchar_t v[] = 1; // expected-error{{array initializer must be an initializer list or wide string literal}}
diff --git a/test/SemaCXX/ms_struct.cpp b/test/SemaCXX/ms_struct.cpp
new file mode 100644
index 000000000000..37fa9a7c687c
--- /dev/null
+++ b/test/SemaCXX/ms_struct.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -triple i686-apple-darwin9 -std=c++11 %s
+// expected-no-diagnostics
+
+#pragma ms_struct on
+
+struct A {
+ unsigned long a:4;
+ unsigned char b;
+};
+
+struct B : public A {
+ unsigned long c:16;
+ int d;
+ B();
+};
+
+static_assert(__builtin_offsetof(B, d) == 12,
+ "We can't allocate the bitfield into the padding under ms_struct"); \ No newline at end of file
diff --git a/test/SemaCXX/ms_wide_bitfield.cpp b/test/SemaCXX/ms_wide_bitfield.cpp
new file mode 100644
index 000000000000..d917390ef14c
--- /dev/null
+++ b/test/SemaCXX/ms_wide_bitfield.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -mms-bitfields -verify %s 2>&1
+
+struct A {
+ char a : 9; // expected-error{{size of bit-field 'a' (9 bits) exceeds size of its type (8 bits)}}
+ int b : 33; // expected-error{{size of bit-field 'b' (33 bits) exceeds size of its type (32 bits)}}
+ bool c : 9; // expected-error{{size of bit-field 'c' (9 bits) exceeds size of its type (8 bits)}}
+};
+
+int a[sizeof(A) == 1 ? 1 : -1];
diff --git a/test/SemaCXX/neon-vector-types.cpp b/test/SemaCXX/neon-vector-types.cpp
index 336fcd4f18d6..c2953d713b2a 100644
--- a/test/SemaCXX/neon-vector-types.cpp
+++ b/test/SemaCXX/neon-vector-types.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify "-triple" "thumbv7-apple-ios3.0.0" %s
+// RUN: %clang_cc1 -fsyntax-only -verify "-triple" "thumbv7-apple-ios3.0.0" -target-feature +neon %s
// rdar://9208404
typedef int MP4Err;
diff --git a/test/SemaCXX/nested-name-spec.cpp b/test/SemaCXX/nested-name-spec.cpp
index 7239646d8d7e..df4f1b269d70 100644
--- a/test/SemaCXX/nested-name-spec.cpp
+++ b/test/SemaCXX/nested-name-spec.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++98 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++98 -verify -fblocks %s
namespace A {
struct C {
static int cx;
@@ -50,6 +50,7 @@ namespace B {
void f1() {
void A::Af(); // expected-error {{definition or redeclaration of 'Af' not allowed inside a function}}
+ void (^x)() = ^{ void A::Af(); }; // expected-error {{definition or redeclaration of 'Af' not allowed inside a block}}
}
void f2() {
@@ -166,9 +167,7 @@ void N::f() { } // okay
struct Y; // expected-note{{forward declaration of 'Y'}}
Y::foo y; // expected-error{{incomplete type 'Y' named in nested name specifier}}
-X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}} \
- // expected-error{{C++ requires a type specifier for all declarations}} \
- // expected-error{{only constructors take base initializers}}
+X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}}
struct foo_S {
static bool value;
@@ -260,7 +259,7 @@ namespace PR8159 {
namespace rdar7980179 {
class A { void f0(); }; // expected-note {{previous}}
- int A::f0() {} // expected-error {{out-of-line definition of 'rdar7980179::A::f0' differs from the declaration in the return type}}
+ int A::f0() {} // expected-error {{return type of out-of-line definition of 'rdar7980179::A::f0' differs}}
}
namespace alias = A;
@@ -297,3 +296,16 @@ namespace NS {
int foobar = a + longer_b; // expected-error {{use of undeclared identifier 'a'; did you mean 'NS::a'?}} \
// expected-error {{use of undeclared identifier 'longer_b'; did you mean 'NS::longer_b'?}}
}
+
+// <rdar://problem/13853540>
+namespace N {
+ struct X { };
+ namespace N {
+ struct Foo {
+ struct N::X *foo(); // expected-error{{no struct named 'X' in namespace 'N::N'}}
+ };
+ }
+}
+
+namespace TypedefNamespace { typedef int F; };
+TypedefNamespace::F::NonexistentName BadNNSWithCXXScopeSpec; // expected-error {{expected a class or namespace}}
diff --git a/test/SemaCXX/new-delete-0x.cpp b/test/SemaCXX/new-delete-0x.cpp
index 9e3b4928b141..a11392d5896c 100644
--- a/test/SemaCXX/new-delete-0x.cpp
+++ b/test/SemaCXX/new-delete-0x.cpp
@@ -21,7 +21,9 @@ void bad_news(int *ip)
auto s = new int*[[]{return 1;}()][2]; // expected-error {{expected ']'}}
// ... but not here:
auto t = new (int(*)[[]]); // expected-error {{an attribute list cannot appear here}}
- auto u = new (int(*)[[]{return 1;}()][2]); // expected-error {{C++11 only allows consecutive left square brackets when introducing an attribute}} expected-error {{variably modified type}}
+ auto u = new (int(*)[[]{return 1;}()][2]); // expected-error {{C++11 only allows consecutive left square brackets when introducing an attribute}} \
+ expected-error {{variably modified type}} \
+ expected-error {{a lambda expression may not appear inside of a constant expression}}
}
void good_deletes()
diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp
index 8b352954a331..7facd10ca5fc 100644
--- a/test/SemaCXX/new-delete.cpp
+++ b/test/SemaCXX/new-delete.cpp
@@ -18,6 +18,13 @@ struct V : U
{
};
+inline void operator delete(void *); // expected-warning {{replacement function 'operator delete' cannot be declared 'inline'}}
+
+__attribute__((used))
+inline void *operator new(size_t) { // no warning, due to __attribute__((used))
+ return 0;
+}
+
// PR5823
void* operator new(const size_t); // expected-note 2 {{candidate}}
void* operator new(size_t, int*); // expected-note 3 {{candidate}}
@@ -116,8 +123,8 @@ struct X1 {
};
struct X2 {
- operator int*(); // expected-note {{candidate function}}
- operator float*(); // expected-note {{candidate function}}
+ operator int*(); // expected-note {{conversion}}
+ operator float*(); // expected-note {{conversion}}
};
void test_delete_conv(X0 x0, X1 x1, X2 x2) {
@@ -209,7 +216,7 @@ struct X11 : X10 { // expected-error {{no suitable member 'operator delete' in '
};
void f() {
- X11 x11; // expected-note {{implicit default destructor for 'X11' first required here}}
+ X11 x11; // expected-note {{implicit destructor for 'X11' first required here}}
}
struct X12 {
@@ -394,7 +401,7 @@ namespace ArrayNewNeedsDtor {
struct A { A(); private: ~A(); }; // expected-note {{declared private here}}
struct B { B(); A a; }; // expected-error {{field of type 'ArrayNewNeedsDtor::A' has private destructor}}
B *test9() {
- return new B[5]; // expected-note {{implicit default destructor for 'ArrayNewNeedsDtor::B' first required here}}
+ return new B[5]; // expected-note {{implicit destructor for 'ArrayNewNeedsDtor::B' first required here}}
}
}
diff --git a/test/SemaCXX/no-rtti.cpp b/test/SemaCXX/no-rtti.cpp
index 75167050dca2..a171b3cde2c3 100644
--- a/test/SemaCXX/no-rtti.cpp
+++ b/test/SemaCXX/no-rtti.cpp
@@ -8,3 +8,22 @@ void f()
{
(void)typeid(int); // expected-error {{cannot use typeid with -fno-rtti}}
}
+
+namespace {
+struct A {
+ virtual ~A(){};
+};
+
+struct B : public A {
+ B() : A() {}
+};
+}
+
+bool isa_B(A *a) {
+ return dynamic_cast<B *>(a) != 0; // expected-error {{cannot use dynamic_cast with -fno-rtti}}
+}
+
+void* getMostDerived(A* a) {
+ // This cast does not use RTTI.
+ return dynamic_cast<void *>(a);
+}
diff --git a/test/SemaCXX/no-warn-unused-const-variables.cpp b/test/SemaCXX/no-warn-unused-const-variables.cpp
new file mode 100644
index 000000000000..c146ca04f832
--- /dev/null
+++ b/test/SemaCXX/no-warn-unused-const-variables.cpp
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wno-unused-const-variable -verify %s
+
+namespace {
+ int i = 0; // expected-warning {{unused variable 'i'}}
+ const int j = 0;;
+}
diff --git a/test/SemaCXX/nullptr.cpp b/test/SemaCXX/nullptr.cpp
index b49f63b98051..28798a4f8ce8 100644
--- a/test/SemaCXX/nullptr.cpp
+++ b/test/SemaCXX/nullptr.cpp
@@ -64,6 +64,9 @@ nullptr_t f(nullptr_t null)
(void)reinterpret_cast<uintptr_t>(nullptr);
(void)reinterpret_cast<uintptr_t>(*pn);
+ // You can't reinterpret_cast nullptr to any integer
+ (void)reinterpret_cast<char>(nullptr); // expected-error {{cast from pointer to smaller type 'char' loses information}}
+
int *ip = *pn;
if (*pn) { }
diff --git a/test/SemaCXX/offsetof.cpp b/test/SemaCXX/offsetof.cpp
index a5f5d347c282..e6069ac9c0a0 100644
--- a/test/SemaCXX/offsetof.cpp
+++ b/test/SemaCXX/offsetof.cpp
@@ -73,3 +73,13 @@ struct LtoRCheck {
};
int ltor = __builtin_offsetof(struct LtoRCheck, a[LtoRCheck().f]); // \
expected-error {{reference to non-static member function must be called}}
+
+namespace PR17578 {
+struct Base {
+ int Field;
+};
+struct Derived : virtual Base {
+ void Fun() { (void)__builtin_offsetof(Derived, Field); } // expected-warning {{offset of on non-POD type}} \
+ expected-error {{invalid application of 'offsetof' to a field of a virtual base}}
+};
+}
diff --git a/test/SemaCXX/operator-arrow-depth.cpp b/test/SemaCXX/operator-arrow-depth.cpp
new file mode 100644
index 000000000000..3e2ba8e45228
--- /dev/null
+++ b/test/SemaCXX/operator-arrow-depth.cpp
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DMAX=128 -foperator-arrow-depth 128
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DMAX=2 -foperator-arrow-depth 2
+// RUN: %clang -fsyntax-only -Xclang -verify %s -DMAX=10 -foperator-arrow-depth=10
+
+template<int N> struct B;
+template<int N> struct A {
+ B<N> operator->(); // expected-note +{{'operator->' declared here produces an object of type 'B<}}
+};
+template<int N> struct B {
+ A<N-1> operator->(); // expected-note +{{'operator->' declared here produces an object of type 'A<}}
+#if MAX != 2
+ // expected-note-re@-2 {{(skipping (120|2) 'operator->'s in backtrace)}}
+#endif
+};
+
+struct X { int n; };
+template<> struct B<1> {
+ X *operator->();
+};
+
+A<MAX/2> good;
+int n = good->n;
+
+B<MAX/2 + 1> bad;
+int m = bad->n; // expected-error-re {{use of 'operator->' on type 'B<(2|10|128) / 2 \+ 1>' would invoke a sequence of more than (2|10|128) 'operator->' calls}}
+ // expected-note@-1 {{use -foperator-arrow-depth=N to increase 'operator->' limit}}
diff --git a/test/SemaCXX/overload-decl.cpp b/test/SemaCXX/overload-decl.cpp
index 9bba47adfdda..fdb14cb173eb 100644
--- a/test/SemaCXX/overload-decl.cpp
+++ b/test/SemaCXX/overload-decl.cpp
@@ -26,8 +26,14 @@ class X {
void g(int, float); // expected-note {{previous declaration is here}}
int g(int, Float); // expected-error {{functions that differ only in their return type cannot be overloaded}}
- static void g(float);
+ static void g(float); // expected-note {{previous declaration is here}}
static void g(int); // expected-error {{static and non-static member functions with the same parameter types cannot be overloaded}}
+ static void g(float); // expected-error {{class member cannot be redeclared}}
+
+ void h(); // expected-note {{previous declaration is here}} \
+ expected-note {{previous declaration is here}}
+ void h() __restrict; // expected-error {{class member cannot be redeclared}} \
+ expected-error {{conflicting types for 'h'}}
};
int main() {} // expected-note {{previous definition is here}}
diff --git a/test/SemaCXX/overloaded-operator.cpp b/test/SemaCXX/overloaded-operator.cpp
index e5b3fab33c8c..99105cb5b60b 100644
--- a/test/SemaCXX/overloaded-operator.cpp
+++ b/test/SemaCXX/overloaded-operator.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
class X { };
X operator+(X, X);
@@ -387,8 +387,8 @@ void test_lookup_through_using() {
namespace rdar9136502 {
struct X {
- int i();
- int i(int);
+ int i(); // expected-note{{possible target for call}}
+ int i(int); // expected-note{{possible target for call}}
};
struct Y {
@@ -396,7 +396,8 @@ namespace rdar9136502 {
};
void f(X x, Y y) {
- y << x.i; // expected-error{{reference to non-static member function must be called}}
+ y << x
+ .i; // expected-error{{reference to non-static member function must be called; did you mean to call it with no arguments?}}
}
}
@@ -440,3 +441,14 @@ namespace test10 {
a[bar<float>];
}
}
+
+struct InvalidOperatorEquals {
+ InvalidOperatorEquals operator=() = delete; // expected-error {{overloaded 'operator=' must be a binary operator}}
+};
+
+namespace PR7681 {
+ template <typename PT1, typename PT2> class PointerUnion;
+ void foo(PointerUnion<int*, float*> &Result) {
+ Result = 1; // expected-error {{no viable overloaded '='}} // expected-note {{type 'PointerUnion<int *, float *>' is incomplete}}
+ }
+}
diff --git a/test/SemaCXX/parentheses.cpp b/test/SemaCXX/parentheses.cpp
new file mode 100644
index 000000000000..b430b25e5d68
--- /dev/null
+++ b/test/SemaCXX/parentheses.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -verify %s
+
+// PR16930, PR16727:
+template<class Foo>
+bool test(Foo f, int *array)
+{
+ return false && false || array[f.get()]; // expected-warning {{'&&' within '||'}} expected-note {{parentheses}}
+}
diff --git a/test/SemaCXX/pr13394-crash-on-invalid.cpp b/test/SemaCXX/pr13394-crash-on-invalid.cpp
index 413c52af858c..841e3c203402 100644
--- a/test/SemaCXX/pr13394-crash-on-invalid.cpp
+++ b/test/SemaCXX/pr13394-crash-on-invalid.cpp
@@ -9,8 +9,21 @@ namespace stretch_v1 {
namespace gatekeeper_v1 {
namespace gatekeeper_factory_v1 {
struct closure_t { // expected-note {{'closure_t' declared here}}
- gatekeeper_v1::closure_t* create(); // expected-error {{no type named 'closure_t' in namespace 'gatekeeper_v1'; did you mean 'closure_t'?}}
+ gatekeeper_v1::closure_t* create(); // expected-error {{no type named 'closure_t' in namespace 'gatekeeper_v1'; did you mean simply 'closure_t'?}}
};
}
- gatekeeper_v1::closure_t *x; // expected-error {{no type named 'closure_t' in namespace 'gatekeeper_v1}}
+ // FIXME: Typo correction should remove the 'gatekeeper_v1::' name specifier
+ gatekeeper_v1::closure_t *x; // expected-error-re {{no type named 'closure_t' in namespace 'gatekeeper_v1'$}}
}
+
+namespace Foo {
+struct Base {
+ void Bar() {} // expected-note{{'Bar' declared here}}
+};
+}
+
+struct Derived : public Foo::Base {
+ void test() {
+ Foo::Bar(); // expected-error{{no member named 'Bar' in namespace 'Foo'; did you mean simply 'Bar'?}}
+ }
+};
diff --git a/test/SemaCXX/predefined-expr.cpp b/test/SemaCXX/predefined-expr.cpp
new file mode 100644
index 000000000000..257d44c60069
--- /dev/null
+++ b/test/SemaCXX/predefined-expr.cpp
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -std=c++1y -fblocks -fsyntax-only -verify %s
+// PR16946
+// expected-no-diagnostics
+
+auto foo() {
+ static_assert(sizeof(__func__) == 4, "foo");
+ static_assert(sizeof(__FUNCTION__) == 4, "foo");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 11, "auto foo()");
+ return 0;
+}
+
+auto bar() -> decltype(42) {
+ static_assert(sizeof(__func__) == 4, "bar");
+ static_assert(sizeof(__FUNCTION__) == 4, "bar");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 10, "int bar()");
+ return 0;
+}
+
+// Within templates.
+template <typename T>
+int baz() {
+ static_assert(sizeof(__func__) == 4, "baz");
+ static_assert(sizeof(__FUNCTION__) == 4, "baz");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 20, "int baz() [T = int]");
+
+ []() {
+ static_assert(sizeof(__func__) == 11, "operator()");
+ static_assert(sizeof(__FUNCTION__) == 11, "operator()");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 50,
+ "auto baz()::<anonymous class>::operator()() const");
+ return 0;
+ }
+ ();
+
+ ^{
+ // FIXME: This is obviously wrong.
+ static_assert(sizeof(__func__) == 1, "__baz_block_invoke");
+ static_assert(sizeof(__FUNCTION__) == 1, "__baz_block_invoke");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 1, "__baz_block_invoke");
+ }
+ ();
+
+ #pragma clang __debug captured
+ {
+ static_assert(sizeof(__func__) == 4, "baz");
+ static_assert(sizeof(__FUNCTION__) == 4, "baz");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 20, "int baz() [T = int]");
+ }
+
+ return 0;
+}
+
+int main() {
+ static_assert(sizeof(__func__) == 5, "main");
+ static_assert(sizeof(__FUNCTION__) == 5, "main");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 11, "int main()");
+
+ []() {
+ static_assert(sizeof(__func__) == 11, "operator()");
+ static_assert(sizeof(__FUNCTION__) == 11, "operator()");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 51,
+ "auto main()::<anonymous class>::operator()() const");
+ return 0;
+ }
+ ();
+
+ ^{
+ // FIXME: This is obviously wrong.
+ static_assert(sizeof(__func__) == 1, "__main_block_invoke");
+ static_assert(sizeof(__FUNCTION__) == 1, "__main_block_invoke");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 1, "__main_block_invoke");
+ }
+ ();
+
+ #pragma clang __debug captured
+ {
+ static_assert(sizeof(__func__) == 5, "main");
+ static_assert(sizeof(__FUNCTION__) == 5, "main");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 11, "int main()");
+
+ #pragma clang __debug captured
+ {
+ static_assert(sizeof(__func__) == 5, "main");
+ static_assert(sizeof(__FUNCTION__) == 5, "main");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 11, "int main()");
+ }
+ }
+
+ []() {
+ #pragma clang __debug captured
+ {
+ static_assert(sizeof(__func__) == 11, "operator()");
+ static_assert(sizeof(__FUNCTION__) == 11, "operator()");
+ static_assert(sizeof(__PRETTY_FUNCTION__) == 51,
+ "auto main()::<anonymous class>::operator()() const");
+ }
+ }
+ ();
+
+ baz<int>();
+
+ return 0;
+}
diff --git a/test/SemaCXX/qualified-id-lookup.cpp b/test/SemaCXX/qualified-id-lookup.cpp
index a14193cc7ac8..23164fa42f32 100644
--- a/test/SemaCXX/qualified-id-lookup.cpp
+++ b/test/SemaCXX/qualified-id-lookup.cpp
@@ -86,13 +86,13 @@ namespace a {
namespace a {
namespace a { // A1
namespace a { // A2
- int i; // expected-note{{'::a::a::a::i' declared here}}
+ int i; // expected-note{{'a::a::a::i' declared here}}
}
}
}
void test_a() {
- a::a::i = 3; // expected-error{{no member named 'i' in namespace 'a::a'; did you mean '::a::a::a::i'?}}
+ a::a::i = 3; // expected-error{{no member named 'i' in namespace 'a::a'; did you mean 'a::a::a::i'?}}
a::a::a::i = 4;
a::a::j = 3; // expected-error-re{{no member named 'j' in namespace 'a::a'$}}
}
@@ -149,6 +149,6 @@ namespace PR6830 {
}
namespace pr12339 {
- extern "C" void i;
+ extern "C" void i; // expected-error{{variable has incomplete type 'void'}}
pr12339::FOO // expected-error{{no type named 'FOO' in namespace 'pr12339'}}
} // expected-error{{expected unqualified-id}}
diff --git a/test/SemaCXX/references.cpp b/test/SemaCXX/references.cpp
index 4f3dab0514b9..37fc2a856fd9 100644
--- a/test/SemaCXX/references.cpp
+++ b/test/SemaCXX/references.cpp
@@ -137,3 +137,10 @@ namespace PR8608 {
// The following crashed trying to recursively evaluate the LValue.
const int &do_not_crash = do_not_crash; // expected-warning{{reference 'do_not_crash' is not yet bound to a value when used within its own initialization}}
+
+namespace ExplicitRefInit {
+ // This is invalid: we can't copy-initialize an 'A' temporary using an
+ // explicit constructor.
+ struct A { explicit A(int); };
+ const A &a(0); // expected-error {{reference to type 'const ExplicitRefInit::A' could not bind to an rvalue of type 'int'}}
+}
diff --git a/test/SemaCXX/scope-check.cpp b/test/SemaCXX/scope-check.cpp
index de276ae3d3d6..90c9317ecdfb 100644
--- a/test/SemaCXX/scope-check.cpp
+++ b/test/SemaCXX/scope-check.cpp
@@ -276,6 +276,27 @@ namespace test15 {
}
namespace test16 {
+ struct S { int n; };
+ int f() {
+ goto x; // expected-error {{goto into protected scope}}
+ const S &s = S(); // expected-note {{jump bypasses variable initialization}}
+x: return s.n;
+ }
+}
+
+#if __cplusplus >= 201103L
+namespace test17 {
+ struct S { int get(); private: int n; };
+ int f() {
+ goto x; // expected-error {{goto into protected scope}}
+ S s = {}; // expected-note {{jump bypasses variable initialization}}
+x: return s.get();
+ }
+}
+#endif
+
+// This test must be last, because the error prohibits further jump diagnostics.
+namespace testInvalid {
Invalid inv; // expected-error {{unknown type name}}
// Make sure this doesn't assert.
void fn()
diff --git a/test/SemaCXX/self-comparison.cpp b/test/SemaCXX/self-comparison.cpp
new file mode 100644
index 000000000000..fb15ec843061
--- /dev/null
+++ b/test/SemaCXX/self-comparison.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+int foo(int x) {
+ return x == x; // expected-warning {{self-comparison always evaluates to true}}
+}
+
+struct X {
+ bool operator==(const X &x);
+};
+
+struct A {
+ int x;
+ X x2;
+ int a[3];
+ int b[3];
+ bool f() { return x == x; } // expected-warning {{self-comparison always evaluates to true}}
+ bool g() { return x2 == x2; } // no-warning
+ bool h() { return a == b; } // expected-warning {{array comparison always evaluates to false}}
+ bool i() {
+ int c[3];
+ return a == c; // expected-warning {{array comparison always evaluates to false}}
+ }
+};
diff --git a/test/SemaCXX/static-data-member.cpp b/test/SemaCXX/static-data-member.cpp
new file mode 100644
index 000000000000..9fe87b1c1d3c
--- /dev/null
+++ b/test/SemaCXX/static-data-member.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -w %s
+
+struct ABC {
+ static double a;
+ static double b;
+ static double c;
+ static double d;
+ static double e;
+ static double f;
+};
+
+double ABC::a = 1.0;
+extern double ABC::b = 1.0; // expected-error {{static data member definition cannot specify a storage class}}
+static double ABC::c = 1.0; // expected-error {{'static' can only be specified inside the class definition}}
+__private_extern__ double ABC::d = 1.0; // expected-error {{static data member definition cannot specify a storage class}}
+auto double ABC::e = 1.0; // expected-error {{static data member definition cannot specify a storage class}}
+register double ABC::f = 1.0; // expected-error {{static data member definition cannot specify a storage class}}
diff --git a/test/SemaCXX/storage-class.cpp b/test/SemaCXX/storage-class.cpp
index 74121843e5e4..decf1e7ac362 100644
--- a/test/SemaCXX/storage-class.cpp
+++ b/test/SemaCXX/storage-class.cpp
@@ -4,4 +4,4 @@ extern int PR6495b = 42; // expected-warning{{'extern' variable has an initializ
extern const int PR6495c[] = {42,43,44};
extern struct Test1 {}; // expected-warning {{'extern' is not permitted on a declaration of a type}}
-extern "C" struct Test0 {}; // no warning
+extern "C" struct Test0 { int x; }; // no warning
diff --git a/test/SemaCXX/string-init.cpp b/test/SemaCXX/string-init.cpp
new file mode 100644
index 000000000000..7e62d1855aca
--- /dev/null
+++ b/test/SemaCXX/string-init.cpp
@@ -0,0 +1,40 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+
+void f() {
+ char a1[] = "a"; // No error.
+ char a2[] = u8"a"; // No error.
+ char a3[] = u"a"; // expected-error{{initializing char array with wide string literal}}
+ char a4[] = U"a"; // expected-error{{initializing char array with wide string literal}}
+ char a5[] = L"a"; // expected-error{{initializing char array with wide string literal}}
+
+ wchar_t b1[] = "a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ wchar_t b2[] = u8"a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ wchar_t b3[] = u"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+ wchar_t b4[] = U"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+ wchar_t b5[] = L"a"; // No error.
+
+ char16_t c1[] = "a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ char16_t c2[] = u8"a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ char16_t c3[] = u"a"; // No error.
+ char16_t c4[] = U"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+ char16_t c5[] = L"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+
+ char32_t d1[] = "a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ char32_t d2[] = u8"a"; // expected-error{{initializing wide char array with non-wide string literal}}
+ char32_t d3[] = u"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+ char32_t d4[] = U"a"; // No error.
+ char32_t d5[] = L"a"; // expected-error{{initializing wide char array with incompatible wide string literal}}
+
+ int e1[] = "a"; // expected-error{{array initializer must be an initializer list}}
+ int e2[] = u8"a"; // expected-error{{array initializer must be an initializer list}}
+ int e3[] = u"a"; // expected-error{{array initializer must be an initializer list}}
+ int e4[] = U"a"; // expected-error{{array initializer must be an initializer list}}
+ int e5[] = L"a"; // expected-error{{array initializer must be an initializer list}}
+}
+
+void g() {
+ char a[] = 1; // expected-error{{array initializer must be an initializer list or string literal}}
+ wchar_t b[] = 1; // expected-error{{array initializer must be an initializer list or wide string literal}}
+ char16_t c[] = 1; // expected-error{{array initializer must be an initializer list or wide string literal}}
+ char32_t d[] = 1; // expected-error{{array initializer must be an initializer list or wide string literal}}
+}
diff --git a/test/SemaCXX/string-plus-char.cpp b/test/SemaCXX/string-plus-char.cpp
new file mode 100644
index 000000000000..00a2c4550dc0
--- /dev/null
+++ b/test/SemaCXX/string-plus-char.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
+
+class A {
+public:
+ A(): str() { }
+ A(const char *p) { }
+ A(char *p) : str(p + 'a') { } // expected-warning {{adding 'char' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}
+ A& operator+(const char *p) { return *this; }
+ A& operator+(char ch) { return *this; }
+ char * str;
+};
+
+void f(const char *s) {
+ A a = s + 'a'; // // expected-warning {{adding 'char' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}
+ a = a + s + 'b'; // no-warning
+
+ char *str = 0;
+ char *str2 = str + 'c'; // expected-warning {{adding 'char' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}
+
+ const char *constStr = s + 'c'; // expected-warning {{adding 'char' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}
+
+ str = 'c' + str;// expected-warning {{adding 'char' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}
+
+ wchar_t *wstr;
+ wstr = wstr + L'c'; // expected-warning {{adding 'wchar_t' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}
+ str2 = str + u'a'; // expected-warning {{adding 'char16_t' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}
+
+ // no-warning
+ char c = 'c';
+ str = str + c;
+ str = c + str;
+}
diff --git a/test/SemaCXX/struct-class-redecl.cpp b/test/SemaCXX/struct-class-redecl.cpp
index 5c59578d6eb5..e1b95ba8d63c 100644
--- a/test/SemaCXX/struct-class-redecl.cpp
+++ b/test/SemaCXX/struct-class-redecl.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -Wmismatched-tags -verify %s
-// RUN: %clang_cc1 -fsyntax-only -Wmismatched-tags %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -Wmismatched-tags %s 2>&1 | FileCheck %s
class X; // expected-note 2{{here}}
typedef struct X * X_t; // expected-warning{{previously declared}}
union X { int x; float y; }; // expected-error{{use of 'X' with tag type that does not match previous declaration}}
diff --git a/test/SemaCXX/switch.cpp b/test/SemaCXX/switch.cpp
index 517faa9a696d..392dcd869802 100644
--- a/test/SemaCXX/switch.cpp
+++ b/test/SemaCXX/switch.cpp
@@ -85,3 +85,18 @@ void local_class(int n) {
}();
}
}
+
+namespace Conversion {
+ struct S {
+ explicit operator int(); // expected-note {{conversion}}
+ };
+ template<typename T> void f(T t) {
+ switch (t) { // expected-error {{explicit conversion}}
+ case 0:
+ return;
+ default:
+ break;
+ }
+ }
+ template void f(S); // expected-note {{instantiation of}}
+}
diff --git a/test/SemaCXX/trailing-return-0x.cpp b/test/SemaCXX/trailing-return-0x.cpp
index bd601db2ac1d..f7e3433a7608 100644
--- a/test/SemaCXX/trailing-return-0x.cpp
+++ b/test/SemaCXX/trailing-return-0x.cpp
@@ -94,3 +94,11 @@ namespace DR1608 {
auto f() -> decltype((*this)[0]); // expected-error {{cannot be overloaded}}
};
}
+
+namespace PR16273 {
+ struct A {
+ template <int N> void f();
+ auto g()->decltype(this->f<0>());
+ };
+}
+
diff --git a/test/SemaCXX/type-traits.cpp b/test/SemaCXX/type-traits.cpp
index aa18ff4e67af..3e479215838e 100644
--- a/test/SemaCXX/type-traits.cpp
+++ b/test/SemaCXX/type-traits.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++11 %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++11 -fms-extensions -Wno-microsoft %s
#define T(b) (b) ? 1 : -1
#define F(b) (b) ? -1 : 1
@@ -308,6 +308,37 @@ void is_final()
{ int arr[F(__is_final(PotentiallyFinal<float>))]; }
}
+struct SealedClass sealed {
+};
+
+template<typename T>
+struct PotentiallySealed { };
+
+template<typename T>
+struct PotentiallySealed<T*> sealed { };
+
+template<>
+struct PotentiallySealed<int> sealed { };
+
+void is_sealed()
+{
+ { int arr[T(__is_sealed(SealedClass))]; }
+ { int arr[T(__is_sealed(PotentiallySealed<float*>))]; }
+ { int arr[T(__is_sealed(PotentiallySealed<int>))]; }
+
+ { int arr[F(__is_sealed(int))]; }
+ { int arr[F(__is_sealed(Union))]; }
+ { int arr[F(__is_sealed(Int))]; }
+ { int arr[F(__is_sealed(IntAr))]; }
+ { int arr[F(__is_sealed(UnionAr))]; }
+ { int arr[F(__is_sealed(Derives))]; }
+ { int arr[F(__is_sealed(ClassType))]; }
+ { int arr[F(__is_sealed(cvoid))]; }
+ { int arr[F(__is_sealed(IntArNB))]; }
+ { int arr[F(__is_sealed(HasAnonymousUnion))]; }
+ { int arr[F(__is_sealed(PotentiallyFinal<float>))]; }
+}
+
typedef HasVirt Polymorph;
struct InheritPolymorph : Polymorph {};
@@ -1072,6 +1103,9 @@ void is_trivially_copyable2()
int t31[F(__is_trivially_copyable(SuperNonTrivialStruct))];
int t32[F(__is_trivially_copyable(NonTCStruct))];
int t33[F(__is_trivially_copyable(ExtDefaulted))];
+
+ int t34[T(__is_trivially_copyable(const int))];
+ int t35[F(__is_trivially_copyable(volatile int))];
}
struct CStruct {
@@ -1244,14 +1278,14 @@ void has_trivial_default_constructor() {
void has_trivial_move_constructor() {
// n3376 12.8 [class.copy]/12
- // A copy/move constructor for class X is trivial if it is not
- // user-provided, its declared parameter type is the same as
+ // A copy/move constructor for class X is trivial if it is not
+ // user-provided, its declared parameter type is the same as
// if it had been implicitly declared, and if
- // — class X has no virtual functions (10.3) and no virtual
+ // - class X has no virtual functions (10.3) and no virtual
// base classes (10.1), and
- // — the constructor selected to copy/move each direct base
+ // - the constructor selected to copy/move each direct base
// class subobject is trivial, and
- // — for each non-static data member of X that is of class
+ // - for each non-static data member of X that is of class
// type (or array thereof), the constructor selected
// to copy/move that member is trivial;
// otherwise the copy/move constructor is non-trivial.
@@ -1445,14 +1479,14 @@ void has_nothrow_move_assign() {
void has_trivial_move_assign() {
// n3376 12.8 [class.copy]/25
- // A copy/move assignment operator for class X is trivial if it
- // is not user-provided, its declared parameter type is the same
+ // A copy/move assignment operator for class X is trivial if it
+ // is not user-provided, its declared parameter type is the same
// as if it had been implicitly declared, and if:
- // — class X has no virtual functions (10.3) and no virtual base
+ // - class X has no virtual functions (10.3) and no virtual base
// classes (10.1), and
- // — the assignment operator selected to copy/move each direct
+ // - the assignment operator selected to copy/move each direct
// base class subobject is trivial, and
- // — for each non-static data member of X that is of class type
+ // - for each non-static data member of X that is of class type
// (or array thereof), the assignment operator
// selected to copy/move that member is trivial;
{ int arr[T(__has_trivial_move_assign(Int))]; }
@@ -1571,7 +1605,7 @@ template<typename T> struct DerivedB : BaseA<T> { };
template<typename T> struct CrazyDerived : T { };
-class class_forward; // expected-note {{forward declaration of 'class_forward'}}
+class class_forward; // expected-note 2 {{forward declaration of 'class_forward'}}
template <typename Base, typename Derived>
void isBaseOfT() {
@@ -1770,6 +1804,8 @@ void is_trivial()
{ int arr[F(__is_trivial(cvoid))]; }
}
+template<typename T> struct TriviallyConstructibleTemplate {};
+
void trivial_checks()
{
{ int arr[T(__is_trivially_copyable(int))]; }
@@ -1848,6 +1884,11 @@ void trivial_checks()
{ int arr[F((__is_trivially_constructible(ExtDefaulted,
ExtDefaulted &&)))]; }
+ { int arr[T((__is_trivially_constructible(TriviallyConstructibleTemplate<int>)))]; }
+ { int arr[F((__is_trivially_constructible(class_forward)))]; } // expected-error {{incomplete type 'class_forward' used in type trait expression}}
+ { int arr[F((__is_trivially_constructible(class_forward[])))]; }
+ { int arr[F((__is_trivially_constructible(void)))]; }
+
{ int arr[T((__is_trivially_assignable(int&, int)))]; }
{ int arr[T((__is_trivially_assignable(int&, int&)))]; }
{ int arr[T((__is_trivially_assignable(int&, int&&)))]; }
diff --git a/test/SemaCXX/typo-correction-pt2.cpp b/test/SemaCXX/typo-correction-pt2.cpp
new file mode 100644
index 000000000000..525d11b0a67b
--- /dev/null
+++ b/test/SemaCXX/typo-correction-pt2.cpp
@@ -0,0 +1,201 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++11-extensions %s
+//
+// FIXME: This file is overflow from test/SemaCXX/typo-correction.cpp due to a
+// hard-coded limit of 20 different typo corrections Sema::CorrectTypo will
+// attempt within a single file (which is to avoid having very broken files take
+// minutes to finally be rejected by the parser).
+
+namespace bogus_keyword_suggestion {
+void test() {
+ status = "OK"; // expected-error-re {{use of undeclared identifier 'status'$}}
+ return status; // expected-error-re {{use of undeclared identifier 'status'$}}
+ }
+}
+
+namespace PR13387 {
+struct A {
+ void CreateFoo(float, float);
+ void CreateBar(float, float);
+};
+struct B : A {
+ using A::CreateFoo;
+ void CreateFoo(int, int);
+};
+void f(B &x) {
+ x.Createfoo(0,0); // expected-error {{no member named 'Createfoo' in 'PR13387::B'; did you mean 'CreateFoo'?}}
+}
+}
+
+struct DataStruct {void foo();};
+struct T {
+ DataStruct data_struct;
+ void f();
+};
+// should be void T::f();
+void f() {
+ data_struct->foo(); // expected-error-re{{use of undeclared identifier 'data_struct'$}}
+}
+
+namespace PR12287 {
+class zif {
+ void nab(int);
+};
+void nab(); // expected-note{{'::PR12287::nab' declared here}}
+void zif::nab(int) {
+ nab(); // expected-error{{too few arguments to function call, expected 1, have 0; did you mean '::PR12287::nab'?}}
+}
+}
+
+namespace TemplateFunction {
+template <class T>
+void A(T) { } // expected-note {{'::TemplateFunction::A' declared here}}
+
+template <class T>
+void B(T) { } // expected-note {{'::TemplateFunction::B' declared here}}
+
+class Foo {
+ public:
+ void A(int, int) {}
+ void B() {}
+};
+
+void test(Foo F, int num) {
+ F.A(num); // expected-error {{too few arguments to function call, expected 2, have 1; did you mean '::TemplateFunction::A'?}}
+ F.B(num); // expected-error {{too many arguments to function call, expected 0, have 1; did you mean '::TemplateFunction::B'?}}
+}
+}
+namespace using_suggestion_val_dropped_specifier {
+void FFF() {} // expected-note {{'::using_suggestion_val_dropped_specifier::FFF' declared here}}
+namespace N { }
+using N::FFF; // expected-error {{no member named 'FFF' in namespace 'using_suggestion_val_dropped_specifier::N'; did you mean '::using_suggestion_val_dropped_specifier::FFF'?}}
+}
+
+namespace class_member_typo_corrections {
+class Outer {
+public:
+ class Inner {}; // expected-note {{'Outer::Inner' declared here}}
+ Inner MyMethod(Inner arg);
+};
+
+Inner Outer::MyMethod(Inner arg) { // expected-error {{unknown type name 'Inner'; did you mean 'Outer::Inner'?}}
+ return Inner();
+}
+
+class Result {
+public:
+ enum ResultType {
+ ENTITY, // expected-note {{'Result::ENTITY' declared here}}
+ PREDICATE, // expected-note {{'Result::PREDICATE' declared here}}
+ LITERAL // expected-note {{'Result::LITERAL' declared here}}
+ };
+
+ ResultType type();
+};
+
+void test() {
+ Result result_cell;
+ switch (result_cell.type()) {
+ case ENTITY: // expected-error {{use of undeclared identifier 'ENTITY'; did you mean 'Result::ENTITY'?}}
+ case LITERAL: // expected-error {{use of undeclared identifier 'LITERAL'; did you mean 'Result::LITERAL'?}}
+ case PREDICAT: // expected-error {{use of undeclared identifier 'PREDICAT'; did you mean 'Result::PREDICATE'?}}
+ break;
+ }
+}
+
+class Figure {
+ enum ResultType {
+ SQUARE,
+ TRIANGLE,
+ CIRCLE
+ };
+
+public:
+ ResultType type();
+};
+
+void testAccess() {
+ Figure obj;
+ switch (obj.type()) { // expected-warning {{enumeration values 'SQUARE', 'TRIANGLE', and 'CIRCLE' not handled in switch}}
+ case SQUARE: // expected-error-re {{use of undeclared identifier 'SQUARE'$}}
+ case TRIANGLE: // expected-error-re {{use of undeclared identifier 'TRIANGLE'$}}
+ case CIRCE: // expected-error-re {{use of undeclared identifier 'CIRCE'$}}
+ break;
+ }
+}
+}
+
+long readline(const char *, char *, unsigned long);
+void assign_to_unknown_var() {
+ deadline_ = 1; // expected-error-re {{use of undeclared identifier 'deadline_'$}}
+}
+
+namespace no_ns_before_dot {
+namespace re2 {}
+void test() {
+ req.set_check(false); // expected-error-re {{use of undeclared identifier 'req'$}}
+}
+}
+
+namespace PR17394 {
+ class A {
+ protected:
+ long zzzzzzzzzz;
+ };
+ class B : private A {};
+ B zzzzzzzzzy<>; // expected-error {{expected ';' after top level declarator}}{}
+}
+
+namespace correct_fields_in_member_funcs {
+struct S {
+ int my_member; // expected-note {{'my_member' declared here}}
+ void f() { my_menber = 1; } // expected-error {{use of undeclared identifier 'my_menber'; did you mean 'my_member'?}}
+};
+}
+
+namespace PR17019 {
+ template<class F>
+ struct evil {
+ evil(F de) { // expected-note {{'de' declared here}}
+ de_; // expected-error {{use of undeclared identifier 'de_'; did you mean 'de'?}} \
+ // expected-warning {{expression result unused}}
+ }
+ ~evil() {
+ de_->bar() // expected-error {{use of undeclared identifier 'de_'}}
+ }
+ };
+
+ void meow() {
+ evil<int> Q(0); // expected-note {{in instantiation of member function}}
+ }
+}
+
+namespace fix_class_name_qualifier {
+class MessageHeaders {};
+class MessageUtils {
+ public:
+ static void ParseMessageHeaders(int, int); // expected-note {{'MessageUtils::ParseMessageHeaders' declared here}}
+};
+
+void test() {
+ // No, we didn't mean to call MessageHeaders::MessageHeaders.
+ MessageHeaders::ParseMessageHeaders(5, 4); // expected-error {{no member named 'ParseMessageHeaders' in 'fix_class_name_qualifier::MessageHeaders'; did you mean 'MessageUtils::ParseMessageHeaders'?}}
+}
+}
+
+namespace PR18213 { // expected-note {{'PR18213' declared here}}
+struct WrapperInfo {
+ int i;
+};
+
+template <typename T> struct Wrappable {
+ static WrapperInfo kWrapperInfo;
+};
+
+// Note the space before "::PR18213" is intended and needed, as it highlights
+// the actual typo, which is the leading "::".
+// TODO: Suggest removing the "::" from "::PR18213" (the right correction)
+// instead of incorrectly suggesting dropping "PR18213::WrapperInfo::".
+template <>
+PR18213::WrapperInfo ::PR18213::Wrappable<int>::kWrapperInfo = { 0 }; // expected-error {{no member named 'PR18213' in 'PR18213::WrapperInfo'; did you mean simply 'PR18213'?}} \
+ // expected-error {{C++ requires a type specifier for all declarations}}
+}
diff --git a/test/SemaCXX/typo-correction.cpp b/test/SemaCXX/typo-correction.cpp
index caa6355fe958..4047e6a18cee 100644
--- a/test/SemaCXX/typo-correction.cpp
+++ b/test/SemaCXX/typo-correction.cpp
@@ -1,4 +1,8 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++11-extensions %s
+//
+// WARNING: Do not add more typo correction test cases to this file lest you run
+// afoul the hard-coded limit (escape hatch) of 20 different typos whose
+// correction was attempted by Sema::CorrectTypo
struct errc {
int v_;
@@ -213,10 +217,14 @@ namespace PR13051 {
operator bool() const;
};
- void f() {
- f(&S<int>::tempalte f<int>); // expected-error{{did you mean 'template'?}}
- f(&S<int>::opeartor bool); // expected-error{{did you mean 'operator'?}}
- f(&S<int>::foo); // expected-error-re{{no member named 'foo' in 'PR13051::S<int>'$}}
+ void foo(); // expected-note{{'foo' declared here}}
+ void g(void(*)());
+ void g(bool(S<int>::*)() const);
+
+ void test() {
+ g(&S<int>::tempalte f<int>); // expected-error{{did you mean 'template'?}}
+ g(&S<int>::opeartor bool); // expected-error{{did you mean 'operator'?}}
+ g(&S<int>::foo); // expected-error{{no member named 'foo' in 'PR13051::S<int>'; did you mean simply 'foo'?}}
}
}
@@ -230,33 +238,67 @@ class foo { }; // expected-note{{'foo' declared here}}
class bar : boo { }; // expected-error{{unknown class name 'boo'; did you mean 'foo'?}}
}
-namespace bogus_keyword_suggestion {
-void test() {
- status = "OK"; // expected-error-re{{use of undeclared identifier 'status'$}}
- return status; // expected-error-re{{use of undeclared identifier 'status'$}}
- }
+namespace outer {
+ void somefunc(); // expected-note{{'::outer::somefunc' declared here}}
+ void somefunc(int, int); // expected-note{{'::outer::somefunc' declared here}}
+
+ namespace inner {
+ void somefunc(int) {
+ someFunc(); // expected-error{{use of undeclared identifier 'someFunc'; did you mean '::outer::somefunc'?}}
+ someFunc(1, 2); // expected-error{{use of undeclared identifier 'someFunc'; did you mean '::outer::somefunc'?}}
+ }
+ }
}
-namespace PR13387 {
-struct A {
- void CreateFoo(float, float); // expected-note {{'CreateFoo' declared here}}
- void CreateBar(float, float);
-};
-struct B : A {
- using A::CreateFoo;
- void CreateFoo(int, int);
-};
-void f(B &x) {
- x.Createfoo(0,0); // expected-error {{no member named 'Createfoo' in 'PR13387::B'; did you mean 'CreateFoo'?}}
+namespace b6956809_test1 {
+ struct A {};
+ struct B {};
+
+ struct S1 {
+ void method(A*); // no note here
+ void method(B*);
+ };
+
+ void test1() {
+ B b;
+ S1 s;
+ s.methodd(&b); // expected-error{{no member named 'methodd' in 'b6956809_test1::S1'; did you mean 'method'}}
+ }
+
+ struct S2 {
+ S2();
+ void method(A*) const; // expected-note{{candidate function not viable}}
+ private:
+ void method(B*); // expected-note{{candidate function not viable}}
+ };
+
+ void test2() {
+ B b;
+ const S2 s;
+ s.methodd(&b); // expected-error{{no member named 'methodd' in 'b6956809_test1::S2'; did you mean 'method'}} expected-error{{no matching member function for call to 'method'}}
+ }
}
+
+namespace b6956809_test2 {
+ template<typename T> struct Err { typename T::error n; }; // expected-error{{type 'void *' cannot be used prior to '::' because it has no members}}
+ struct S {
+ template<typename T> typename Err<T>::type method(T); // expected-note{{in instantiation of template class 'b6956809_test2::Err<void *>' requested here}} expected-note{{while substituting deduced template arguments into function template 'method' [with T = void *]}}
+ template<typename T> int method(T *);
+ };
+
+ void test() {
+ S s;
+ int k = s.methodd((void*)0); // expected-error{{no member named 'methodd' in 'b6956809_test2::S'; did you mean 'method'?}}
+ }
}
-struct DataStruct {void foo();};
-struct T {
- DataStruct data_struct;
- void f();
+// This test should have one correction, followed by an error without a
+// suggestion due to exceeding the maximum number of typos for which correction
+// is attempted.
+namespace CorrectTypo_has_reached_its_limit {
+int flibberdy(); // expected-note{{'flibberdy' declared here}}
+int no_correction() {
+ return hibberdy() + // expected-error{{use of undeclared identifier 'hibberdy'; did you mean 'flibberdy'?}}
+ gibberdy(); // expected-error-re{{use of undeclared identifier 'gibberdy'$}}
};
-// should be void T::f();
-void f() {
- data_struct->foo(); // expected-error-re{{use of undeclared identifier 'data_struct'$}}
}
diff --git a/test/SemaCXX/uninitialized.cpp b/test/SemaCXX/uninitialized.cpp
index 665cfe7e9118..4991ebee8b31 100644
--- a/test/SemaCXX/uninitialized.cpp
+++ b/test/SemaCXX/uninitialized.cpp
@@ -340,7 +340,10 @@ namespace {
};
struct E {
- int a, b, c;
+ int b = 1;
+ int c = 1;
+ int a; // This field needs to be last to prevent the cross field
+ // uninitialized warning.
E(char (*)[1]) : a(a ? b : c) {} // expected-warning {{field 'a' is uninitialized when used here}}
E(char (*)[2]) : a(b ? a : a) {} // expected-warning 2{{field 'a' is uninitialized when used here}}
E(char (*)[3]) : a(b ? (a) : c) {} // expected-warning {{field 'a' is uninitialized when used here}}
@@ -459,7 +462,7 @@ namespace in_class_initializers {
};
struct U {
- U() : a(b + 1), b(a + 1) {} // FIXME: Warn here.
+ U() : a(b + 1), b(a + 1) {} // expected-warning{{field 'b' is uninitialized when used here}}
int a = 42; // Note: because a and b are in the member initializer list, these initializers are ignored.
int b = 1;
};
@@ -484,7 +487,8 @@ namespace references {
}
struct T {
- T() : a(b), b(a) {} // FIXME: Warn here.
+ T() // expected-note{{during field initialization in this constructor}}
+ : a(b), b(a) {} // expected-warning{{reference 'b' is not yet bound to a value when used here}}
int &a, &b;
int &c = c; // expected-warning{{reference 'c' is not yet bound to a value when used here}}
};
@@ -523,3 +527,204 @@ namespace lambdas {
A a2([&] { return a2.x; }); // ok
}
}
+
+namespace record_fields {
+ struct A {
+ A() {}
+ A get();
+ static A num();
+ static A copy(A);
+ static A something(A&);
+ };
+
+ A ref(A&);
+ A const_ref(const A&);
+ A pointer(A*);
+ A normal(A);
+
+ struct B {
+ A a;
+ B(char (*)[1]) : a(a) {} // expected-warning {{uninitialized}}
+ B(char (*)[2]) : a(a.get()) {} // expected-warning {{uninitialized}}
+ B(char (*)[3]) : a(a.num()) {}
+ B(char (*)[4]) : a(a.copy(a)) {} // expected-warning {{uninitialized}}
+ B(char (*)[5]) : a(a.something(a)) {}
+ B(char (*)[6]) : a(ref(a)) {}
+ B(char (*)[7]) : a(const_ref(a)) {}
+ B(char (*)[8]) : a(pointer(&a)) {}
+ B(char (*)[9]) : a(normal(a)) {} // expected-warning {{uninitialized}}
+ };
+ struct C {
+ C() {} // expected-note4{{in this constructor}}
+ A a1 = a1; // expected-warning {{uninitialized}}
+ A a2 = a2.get(); // expected-warning {{uninitialized}}
+ A a3 = a3.num();
+ A a4 = a4.copy(a4); // expected-warning {{uninitialized}}
+ A a5 = a5.something(a5);
+ A a6 = ref(a6);
+ A a7 = const_ref(a7);
+ A a8 = pointer(&a8);
+ A a9 = normal(a9); // expected-warning {{uninitialized}}
+ };
+ struct D { // expected-note4{{in the implicit default constructor}}
+ A a1 = a1; // expected-warning {{uninitialized}}
+ A a2 = a2.get(); // expected-warning {{uninitialized}}
+ A a3 = a3.num();
+ A a4 = a4.copy(a4); // expected-warning {{uninitialized}}
+ A a5 = a5.something(a5);
+ A a6 = ref(a6);
+ A a7 = const_ref(a7);
+ A a8 = pointer(&a8);
+ A a9 = normal(a9); // expected-warning {{uninitialized}}
+ };
+ D d;
+ struct E {
+ A a1 = a1;
+ A a2 = a2.get();
+ A a3 = a3.num();
+ A a4 = a4.copy(a4);
+ A a5 = a5.something(a5);
+ A a6 = ref(a6);
+ A a7 = const_ref(a7);
+ A a8 = pointer(&a8);
+ A a9 = normal(a9);
+ };
+}
+
+namespace cross_field_warnings {
+ struct A {
+ int a, b;
+ A() {}
+ A(char (*)[1]) : b(a) {} // expected-warning{{field 'a' is uninitialized when used here}}
+ A(char (*)[2]) : a(b) {} // expected-warning{{field 'b' is uninitialized when used here}}
+ };
+
+ struct B {
+ int a = b; // expected-warning{{field 'b' is uninitialized when used here}}
+ int b;
+ B() {} // expected-note{{during field initialization in this constructor}}
+ };
+
+ struct C {
+ int a;
+ int b = a; // expected-warning{{field 'a' is uninitialized when used here}}
+ C(char (*)[1]) : a(5) {}
+ C(char (*)[2]) {} // expected-note{{during field initialization in this constructor}}
+ };
+
+ struct D {
+ int a;
+ int &b;
+ int &c = a;
+ int d = b;
+ D() : b(a) {}
+ };
+
+ struct E {
+ int a;
+ int get();
+ static int num();
+ E() {}
+ E(int) {}
+ };
+
+ struct F {
+ int a;
+ E e;
+ int b;
+ F(char (*)[1]) : a(e.get()) {} // expected-warning{{field 'e' is uninitialized when used here}}
+ F(char (*)[2]) : a(e.num()) {}
+ F(char (*)[3]) : e(a) {} // expected-warning{{field 'a' is uninitialized when used here}}
+ F(char (*)[4]) : a(4), e(a) {}
+ F(char (*)[5]) : e(b) {} // expected-warning{{field 'b' is uninitialized when used here}}
+ F(char (*)[6]) : e(b), b(4) {} // expected-warning{{field 'b' is uninitialized when used here}}
+ };
+
+ struct G {
+ G(const A&) {};
+ };
+
+ struct H {
+ A a1;
+ G g;
+ A a2;
+ H() : g(a1) {}
+ H(int) : g(a2) {}
+ };
+
+ struct I {
+ I(int*) {}
+ };
+
+ struct J : public I {
+ int *a;
+ int *b;
+ int c;
+ J() : I((a = new int(5))), b(a), c(*a) {}
+ };
+
+ struct K {
+ int a = (b = 5);
+ int b = b + 5;
+ };
+
+ struct L {
+ int a = (b = 5);
+ int b = b + 5; // expected-warning{{field 'b' is uninitialized when used here}}
+ L() : a(5) {} // expected-note{{during field initialization in this constructor}}
+ };
+
+ struct M { };
+
+ struct N : public M {
+ int a;
+ int b;
+ N() : b(a) { } // expected-warning{{field 'a' is uninitialized when used here}}
+ };
+
+ struct O {
+ int x = 42;
+ int get() { return x; }
+ };
+
+ struct P {
+ O o;
+ int x = o.get();
+ P() : x(o.get()) { }
+ };
+
+ struct Q {
+ int a;
+ int b;
+ int &c;
+ Q() :
+ a(c = 5), // expected-warning{{reference 'c' is not yet bound to a value when used here}}
+ b(c), // expected-warning{{reference 'c' is not yet bound to a value when used here}}
+ c(a) {}
+ };
+
+ struct R {
+ int a;
+ int b;
+ int c;
+ int d = a + b + c;
+ R() : a(c = 5), b(c), c(a) {}
+ };
+}
+
+namespace base_class {
+ struct A {
+ A (int) {}
+ };
+
+ struct B : public A {
+ int x;
+ B() : A(x) {} // expected-warning{{field 'x' is uninitialized when used here}}
+ };
+
+ struct C : public A {
+ int x;
+ int y;
+ C() : A(y = 4), x(y) {}
+ };
+}
diff --git a/test/SemaCXX/unknown-type-name.cpp b/test/SemaCXX/unknown-type-name.cpp
index ce5972bf2dc5..f2c84df242ff 100644
--- a/test/SemaCXX/unknown-type-name.cpp
+++ b/test/SemaCXX/unknown-type-name.cpp
@@ -93,14 +93,14 @@ template<typename T> int A<T>::h(T::type x, char) {} // expected-error{{missing
template<typename T> int h(T::type, int); // expected-error{{missing 'typename'}}
template<typename T> int h(T::type x, char); // expected-error{{missing 'typename'}}
-template<typename T> int junk1(T::junk); // expected-error{{declared as a template}}
+template<typename T> int junk1(T::junk); // expected-warning{{variable templates are a C++1y extension}}
template<typename T> int junk2(T::junk) throw(); // expected-error{{missing 'typename'}}
template<typename T> int junk3(T::junk) = delete; // expected-error{{missing 'typename'}} expected-warning{{C++11}}
template<typename T> int junk4(T::junk j); // expected-error{{missing 'typename'}}
// FIXME: We can tell this was intended to be a function because it does not
// have a dependent nested name specifier.
-template<typename T> int i(T::type, int()); // expected-error{{variable 'i' declared as a template}}
+template<typename T> int i(T::type, int()); // expected-warning{{variable templates are a C++1y extension}}
// FIXME: We know which type specifier should have been specified here. Provide
// a fix-it to add 'typename A<T>::type'
diff --git a/test/SemaCXX/using-decl-1.cpp b/test/SemaCXX/using-decl-1.cpp
index ebe97f6cca0d..24d92f175c30 100644
--- a/test/SemaCXX/using-decl-1.cpp
+++ b/test/SemaCXX/using-decl-1.cpp
@@ -118,3 +118,45 @@ namespace foo
using ::foo::Class1::Function; // expected-error{{incomplete type 'foo::Class1' named in nested name specifier}}
};
}
+
+// Don't suggest non-typenames for positions requiring typenames.
+namespace using_suggestion_tyname_val {
+namespace N { void FFF() {} }
+using typename N::FFG; // expected-error {{no member named 'FFG' in namespace 'using_suggestion_tyname_val::N'}}
+}
+
+namespace using_suggestion_member_tyname_val {
+class CCC { public: void AAA() { } };
+class DDD : public CCC { public: using typename CCC::AAB; }; // expected-error {{no member named 'AAB' in 'using_suggestion_member_tyname_val::CCC'}}
+}
+
+namespace using_suggestion_tyname_val_dropped_specifier {
+void FFF() {}
+namespace N { }
+using typename N::FFG; // expected-error {{no member named 'FFG' in namespace 'using_suggestion_tyname_val_dropped_specifier::N'}}
+}
+
+// Currently hints aren't provided to drop out the incorrect M::.
+namespace using_suggestion_ty_dropped_nested_specifier {
+namespace N {
+class AAA {}; // expected-note {{'N::AAA' declared here}}
+namespace M { }
+}
+using N::M::AAA; // expected-error {{no member named 'AAA' in namespace 'using_suggestion_ty_dropped_nested_specifier::N::M'; did you mean 'N::AAA'?}}
+}
+
+namespace using_suggestion_tyname_ty_dropped_nested_specifier {
+namespace N {
+class AAA {}; // expected-note {{'N::AAA' declared here}}
+namespace M { }
+}
+using typename N::M::AAA; // expected-error {{no member named 'AAA' in namespace 'using_suggestion_tyname_ty_dropped_nested_specifier::N::M'; did you mean 'N::AAA'?}}
+}
+
+namespace using_suggestion_val_dropped_nested_specifier {
+namespace N {
+void FFF() {} // expected-note {{'N::FFF' declared here}}
+namespace M { }
+}
+using N::M::FFF; // expected-error {{no member named 'FFF' in namespace 'using_suggestion_val_dropped_nested_specifier::N::M'; did you mean 'N::FFF'?}}
+}
diff --git a/test/SemaCXX/using-decl-templates.cpp b/test/SemaCXX/using-decl-templates.cpp
index 2f8abca02d6e..8314688bcbc7 100644
--- a/test/SemaCXX/using-decl-templates.cpp
+++ b/test/SemaCXX/using-decl-templates.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
template<typename T> struct A {
void f() { }
@@ -80,3 +80,15 @@ namespace PR10883 {
void foo(const Container& current); // expected-error {{unknown type name 'Container'}}
};
}
+
+template<typename T> class UsingTypenameNNS {
+ using typename T::X;
+ typename X::X x;
+};
+
+namespace aliastemplateinst {
+ template<typename T> struct A { };
+ template<typename T> using APtr = A<T*>; // expected-note{{previous use is here}}
+
+ template struct APtr<int>; // expected-error{{elaborated type refers to a non-tag type}}
+}
diff --git a/test/SemaCXX/vararg-non-pod.cpp b/test/SemaCXX/vararg-non-pod.cpp
index da06d957180e..56dafc41f132 100644
--- a/test/SemaCXX/vararg-non-pod.cpp
+++ b/test/SemaCXX/vararg-non-pod.cpp
@@ -17,6 +17,10 @@ void t1()
g(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic function; call will abort at runtime}}
g(10, version);
+
+ void (*ptr)(int, ...) = g;
+ ptr(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic function; call will abort at runtime}}
+ ptr(10, version);
}
void t2()
@@ -25,9 +29,17 @@ void t2()
c.g(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic method; call will abort at runtime}}
c.g(10, version);
-
+
+ void (C::*ptr)(int, ...) = &C::g;
+ (c.*ptr)(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic method; call will abort at runtime}}
+ (c.*ptr)(10, version);
+
C::h(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic function; call will abort at runtime}}
C::h(10, version);
+
+ void (*static_ptr)(int, ...) = &C::h;
+ static_ptr(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic function; call will abort at runtime}}
+ static_ptr(10, version);
}
int (^block)(int, ...);
@@ -141,3 +153,39 @@ namespace t10 {
s(f);
}
}
+
+namespace t11 {
+ typedef void(*function_ptr)(int, ...);
+ typedef void(C::*member_ptr)(int, ...);
+ typedef void(^block_ptr)(int, ...);
+
+ function_ptr get_f_ptr();
+ member_ptr get_m_ptr();
+ block_ptr get_b_ptr();
+
+ function_ptr arr_f_ptr[5];
+ member_ptr arr_m_ptr[5];
+ block_ptr arr_b_ptr[5];
+
+ void test() {
+ C c(10);
+
+ (get_f_ptr())(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic function; call will abort at runtime}}
+ (get_f_ptr())(10, version);
+
+ (c.*get_m_ptr())(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic method; call will abort at runtime}}
+ (c.*get_m_ptr())(10, version);
+
+ (get_b_ptr())(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic block; call will abort at runtime}}
+ (get_b_ptr())(10, version);
+
+ (arr_f_ptr[3])(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic function; call will abort at runtime}}
+ (arr_f_ptr[3])(10, version);
+
+ (c.*arr_m_ptr[3])(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic method; call will abort at runtime}}
+ (c.*arr_m_ptr[3])(10, version);
+
+ (arr_b_ptr[3])(10, c); // expected-warning{{cannot pass object of non-POD type 'C' through variadic block; call will abort at runtime}}
+ (arr_b_ptr[3])(10, version);
+ }
+}
diff --git a/test/SemaCXX/vector.cpp b/test/SemaCXX/vector.cpp
index 4d2d064b32f1..7957c23e3e24 100644
--- a/test/SemaCXX/vector.cpp
+++ b/test/SemaCXX/vector.cpp
@@ -37,7 +37,7 @@ void f2_test(char16 c16, longlong16 ll16, char16_e c16e, longlong16_e ll16e) {
}
// Test the conditional operator with vector types.
-void conditional(bool Cond, char16 c16, longlong16 ll16, char16_e c16e,
+void conditional(bool Cond, char16 c16, longlong16 ll16, char16_e c16e,
longlong16_e ll16e) {
// Conditional operators with the same type.
__typeof__(Cond? c16 : c16) *c16p1 = &c16;
@@ -105,11 +105,11 @@ struct convertible_to { // expected-note 3 {{candidate function (the implicit co
operator T() const;
};
-void test_implicit_conversions(bool Cond, char16 c16, longlong16 ll16,
+void test_implicit_conversions(bool Cond, char16 c16, longlong16 ll16,
char16_e c16e, longlong16_e ll16e,
- convertible_to<char16> to_c16,
- convertible_to<longlong16> to_ll16,
- convertible_to<char16_e> to_c16e,
+ convertible_to<char16> to_c16,
+ convertible_to<longlong16> to_ll16,
+ convertible_to<char16_e> to_c16e,
convertible_to<longlong16_e> to_ll16e,
convertible_to<char16&> rto_c16,
convertible_to<char16_e&> rto_c16e) {
@@ -183,7 +183,7 @@ void test_implicit_conversions(bool Cond, char16 c16, longlong16 ll16,
(void)(Cond? to_c16 : to_c16e);
(void)(Cond? to_ll16e : to_ll16);
-
+
// These 2 are convertable with -flax-vector-conversions (default)
(void)(Cond? to_c16 : to_ll16);
(void)(Cond? to_c16e : to_ll16e);
@@ -278,3 +278,10 @@ void test_pseudo_dtor(fltx4 *f) {
(*f).~fltx4();
test_pseudo_dtor_tmpl(f);
}
+
+// PR16204
+typedef __attribute__((ext_vector_type(4))) int vi4;
+const int &reference_to_vec_element = vi4(1).x;
+
+// PR12649
+typedef bool bad __attribute__((__vector_size__(16))); // expected-error {{invalid vector element type 'bool'}}
diff --git a/test/SemaCXX/virtual-base-used.cpp b/test/SemaCXX/virtual-base-used.cpp
index d147b13f04fd..04518ce4d47b 100644
--- a/test/SemaCXX/virtual-base-used.cpp
+++ b/test/SemaCXX/virtual-base-used.cpp
@@ -13,19 +13,19 @@ struct D : public virtual B {
virtual void foo();
~D();
};
-void D::foo() { // expected-note {{implicit default destructor for 'B' first required here}}
+void D::foo() { // expected-note {{implicit destructor for 'B' first required here}}
}
struct E : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
-struct F : public E { // expected-note {{implicit default destructor for 'E' first required here}}
+struct F : public E { // expected-note {{implicit destructor for 'E' first required here}}
};
struct G : public virtual F {
virtual void foo();
~G();
};
-void G::foo() { // expected-note {{implicit default destructor for 'F' first required here}}
+void G::foo() { // expected-note {{implicit destructor for 'F' first required here}}
}
struct H : public virtual A {
@@ -38,5 +38,5 @@ struct J : public I {
virtual void foo();
~J();
};
-void J::foo() { // expected-note {{implicit default destructor for 'H' first required here}}
+void J::foo() { // expected-note {{implicit destructor for 'H' first required here}}
}
diff --git a/test/SemaCXX/virtual-member-functions-key-function.cpp b/test/SemaCXX/virtual-member-functions-key-function.cpp
index 09a30b93605e..80ce0298ba98 100644
--- a/test/SemaCXX/virtual-member-functions-key-function.cpp
+++ b/test/SemaCXX/virtual-member-functions-key-function.cpp
@@ -4,7 +4,7 @@ struct A {
};
struct B : A { // expected-error {{no suitable member 'operator delete' in 'B'}}
- B() { } // expected-note {{implicit default destructor for 'B' first required here}}
+ B() { } // expected-note {{implicit destructor for 'B' first required here}}
void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
};
@@ -14,7 +14,7 @@ struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}
void f() {
(void)new B;
- (void)new C; // expected-note {{implicit default destructor for 'C' first required here}}
+ (void)new C; // expected-note {{implicit destructor for 'C' first required here}}
}
// Make sure that the key-function computation is consistent when the
diff --git a/test/SemaCXX/virtual-override-x86.cpp b/test/SemaCXX/virtual-override-x86.cpp
index ad70d3f22437..75d8af3b3ea3 100644
--- a/test/SemaCXX/virtual-override-x86.cpp
+++ b/test/SemaCXX/virtual-override-x86.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple=i686-pc-unknown -fsyntax-only -verify %s -std=c++11
+// RUN: %clang_cc1 -triple=i686-pc-unknown -fsyntax-only -verify %s -std=c++11 -cxx-abi microsoft
namespace PR14339 {
class A {
@@ -28,6 +28,6 @@ namespace PR14339 {
class F : public E {
public:
- void g(); // expected-error{{virtual function 'g' has different calling convention attributes ('void ()') than the function it overrides (which has calling convention 'void () __attribute__((stdcall))'}}
+ void g(); // expected-error{{virtual function 'g' has different calling convention attributes ('void () __attribute__((thiscall))') than the function it overrides (which has calling convention 'void () __attribute__((stdcall))'}}
};
}
diff --git a/test/SemaCXX/virtuals.cpp b/test/SemaCXX/virtuals.cpp
index a340e9d86b65..6b8231d4e1e2 100644
--- a/test/SemaCXX/virtuals.cpp
+++ b/test/SemaCXX/virtuals.cpp
@@ -45,3 +45,9 @@ namespace rdar9670557 {
func *h = 0;
};
}
+
+namespace pr8264 {
+ struct Test {
+ virtual virtual void func(); // expected-warning {{duplicate 'virtual' declaration specifier}}
+ };
+}
diff --git a/test/SemaCXX/warn-consumed-analysis.cpp b/test/SemaCXX/warn-consumed-analysis.cpp
new file mode 100644
index 000000000000..64fdc00dc516
--- /dev/null
+++ b/test/SemaCXX/warn-consumed-analysis.cpp
@@ -0,0 +1,795 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wconsumed -fcxx-exceptions -std=c++11 %s
+
+// TODO: Switch to using macros for the expected warnings.
+
+#define CALLABLE_WHEN(...) __attribute__ ((callable_when(__VA_ARGS__)))
+#define CONSUMABLE(state) __attribute__ ((consumable(state)))
+#define PARAM_TYPESTATE(state) __attribute__ ((param_typestate(state)))
+#define RETURN_TYPESTATE(state) __attribute__ ((return_typestate(state)))
+#define SET_TYPESTATE(state) __attribute__ ((set_typestate(state)))
+#define TEST_TYPESTATE(state) __attribute__ ((test_typestate(state)))
+
+typedef decltype(nullptr) nullptr_t;
+
+template <typename T>
+class CONSUMABLE(unconsumed) ConsumableClass {
+ T var;
+
+public:
+ ConsumableClass();
+ ConsumableClass(nullptr_t p) RETURN_TYPESTATE(consumed);
+ ConsumableClass(T val) RETURN_TYPESTATE(unconsumed);
+ ConsumableClass(ConsumableClass<T> &other);
+ ConsumableClass(ConsumableClass<T> &&other);
+
+ ConsumableClass<T>& operator=(ConsumableClass<T> &other);
+ ConsumableClass<T>& operator=(ConsumableClass<T> &&other);
+ ConsumableClass<T>& operator=(nullptr_t) SET_TYPESTATE(consumed);
+
+ template <typename U>
+ ConsumableClass<T>& operator=(ConsumableClass<U> &other);
+
+ template <typename U>
+ ConsumableClass<T>& operator=(ConsumableClass<U> &&other);
+
+ void operator()(int a) SET_TYPESTATE(consumed);
+ void operator*() const CALLABLE_WHEN("unconsumed");
+ void unconsumedCall() const CALLABLE_WHEN("unconsumed");
+ void callableWhenUnknown() const CALLABLE_WHEN("unconsumed", "unknown");
+
+ bool isValid() const TEST_TYPESTATE(unconsumed);
+ operator bool() const TEST_TYPESTATE(unconsumed);
+ bool operator!=(nullptr_t) const TEST_TYPESTATE(unconsumed);
+ bool operator==(nullptr_t) const TEST_TYPESTATE(consumed);
+
+ void constCall() const;
+ void nonconstCall();
+
+ void consume() SET_TYPESTATE(consumed);
+ void unconsume() SET_TYPESTATE(unconsumed);
+};
+
+class CONSUMABLE(unconsumed) DestructorTester {
+public:
+ DestructorTester() RETURN_TYPESTATE(unconsumed);
+ DestructorTester(int);
+
+ void operator*() CALLABLE_WHEN("unconsumed");
+
+ ~DestructorTester() CALLABLE_WHEN("consumed");
+};
+
+void baf0(const ConsumableClass<int> var);
+void baf1(const ConsumableClass<int> &var);
+void baf2(const ConsumableClass<int> *var);
+
+void baf3(ConsumableClass<int> var);
+void baf4(ConsumableClass<int> &var);
+void baf5(ConsumableClass<int> *var);
+void baf6(ConsumableClass<int> &&var);
+
+ConsumableClass<int> returnsUnconsumed() {
+ return ConsumableClass<int>(); // expected-warning {{return value not in expected state; expected 'unconsumed', observed 'consumed'}}
+}
+
+ConsumableClass<int> returnsConsumed() RETURN_TYPESTATE(consumed);
+ConsumableClass<int> returnsConsumed() {
+ return ConsumableClass<int>();
+}
+
+ConsumableClass<int> returnsUnknown() RETURN_TYPESTATE(unknown);
+
+void testInitialization() {
+ ConsumableClass<int> var0;
+ ConsumableClass<int> var1 = ConsumableClass<int>();
+
+ var0 = ConsumableClass<int>();
+
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+
+ if (var0.isValid()) {
+ *var0;
+ *var1;
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ }
+}
+
+void testDestruction() {
+ DestructorTester D0(42), D1(42);
+
+ *D0;
+ *D1;
+
+ DestructorTester D2;
+ *D2;
+
+ D0.~DestructorTester(); // expected-warning {{invalid invocation of method '~DestructorTester' on object 'D0' while it is in the 'unconsumed' state}}
+
+ return; // expected-warning {{invalid invocation of method '~DestructorTester' on object 'D0' while it is in the 'unconsumed' state}} \
+ expected-warning {{invalid invocation of method '~DestructorTester' on object 'D1' while it is in the 'unconsumed' state}} \
+ expected-warning {{invalid invocation of method '~DestructorTester' on object 'D2' while it is in the 'unconsumed' state}}
+}
+
+void testTempValue() {
+ *ConsumableClass<int>(); // expected-warning {{invalid invocation of method 'operator*' on a temporary object while it is in the 'consumed' state}}
+}
+
+void testSimpleRValueRefs() {
+ ConsumableClass<int> var0;
+ ConsumableClass<int> var1(42);
+
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1;
+
+ var0 = static_cast<ConsumableClass<int>&&>(var1);
+
+ *var0;
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+}
+
+void testIfStmt() {
+ ConsumableClass<int> var;
+
+ if (var.isValid()) {
+ *var;
+ } else {
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+ }
+
+ if (!var.isValid()) {
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+ } else {
+ *var;
+ }
+
+ if (var) {
+ // Empty
+ } else {
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+ }
+
+ if (var != nullptr) {
+ // Empty
+ } else {
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+ }
+
+ if (var == nullptr) {
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+ } else {
+ // Empty
+ }
+}
+
+void testComplexConditionals0() {
+ ConsumableClass<int> var0, var1, var2;
+
+ if (var0 && var1) {
+ *var0;
+ *var1;
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+ }
+
+ if (var0 || var1) {
+ *var0;
+ *var1;
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+ }
+
+ if (var0 && !var1) {
+ *var0;
+ *var1;
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+ }
+
+ if (var0 || !var1) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+
+ } else {
+ *var0;
+ *var1;
+ }
+
+ if (!var0 && !var1) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+
+ } else {
+ *var0;
+ *var1;
+ }
+
+ if (!var0 || !var1) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+
+ } else {
+ *var0;
+ *var1;
+ }
+
+ if (!(var0 && var1)) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+
+ } else {
+ *var0;
+ *var1;
+ }
+
+ if (!(var0 || var1)) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+
+ } else {
+ *var0;
+ *var1;
+ }
+
+ if (var0 && var1 && var2) {
+ *var0;
+ *var1;
+ *var2;
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+ *var2; // expected-warning {{invalid invocation of method 'operator*' on object 'var2' while it is in the 'consumed' state}}
+ }
+
+#if 0
+ // FIXME: Get this test to pass.
+ if (var0 || var1 || var2) {
+ *var0;
+ *var1;
+ *var2;
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+ *var2; // expected-warning {{invalid invocation of method 'operator*' on object 'var2' while it is in the 'consumed' state}}
+ }
+#endif
+}
+
+void testComplexConditionals1() {
+ ConsumableClass<int> var0, var1, var2;
+
+ // Coerce all variables into the unknown state.
+ baf4(var0);
+ baf4(var1);
+ baf4(var2);
+
+ if (var0 && var1) {
+ *var0;
+ *var1;
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'unknown' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'unknown' state}}
+ }
+
+ if (var0 || var1) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'unknown' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'unknown' state}}
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+ }
+
+ if (var0 && !var1) {
+ *var0;
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'unknown' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'unknown' state}}
+ }
+
+ if (var0 || !var1) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'unknown' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'unknown' state}}
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1;
+ }
+
+ if (!var0 && !var1) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'unknown' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'unknown' state}}
+ }
+
+ if (!(var0 || var1)) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'unknown' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'unknown' state}}
+ }
+
+ if (!var0 || !var1) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'unknown' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'unknown' state}}
+
+ } else {
+ *var0;
+ *var1;
+ }
+
+ if (!(var0 && var1)) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'unknown' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'unknown' state}}
+
+ } else {
+ *var0;
+ *var1;
+ }
+
+ if (var0 && var1 && var2) {
+ *var0;
+ *var1;
+ *var2;
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'unknown' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'unknown' state}}
+ *var2; // expected-warning {{invalid invocation of method 'operator*' on object 'var2' while it is in the 'unknown' state}}
+ }
+
+#if 0
+ // FIXME: Get this test to pass.
+ if (var0 || var1 || var2) {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'unknown' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'unknown' state}}
+ *var2; // expected-warning {{invalid invocation of method 'operator*' on object 'var2' while it is in the 'unknown' state}}
+
+ } else {
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+ *var2; // expected-warning {{invalid invocation of method 'operator*' on object 'var2' while it is in the 'consumed' state}}
+ }
+#endif
+}
+
+void testStateChangeInBranch() {
+ ConsumableClass<int> var;
+
+ // Make var enter the 'unknown' state.
+ baf4(var);
+
+ if (!var) {
+ var = ConsumableClass<int>(42);
+ }
+
+ *var;
+}
+
+void testFunctionParam(ConsumableClass<int> param) {
+
+ if (param.isValid()) {
+ *param;
+ } else {
+ *param;
+ }
+
+ param = nullptr;
+ *param; // expected-warning {{invocation of method 'operator*' on object 'param' while it is in the 'consumed' state}}
+}
+
+void testParamReturnTypestateCallee(bool cond, ConsumableClass<int> &Param RETURN_TYPESTATE(unconsumed)) { // expected-warning {{parameter 'Param' not in expected state when the function returns: expected 'unconsumed', observed 'consumed'}}
+
+ if (cond) {
+ Param.consume();
+ return; // expected-warning {{parameter 'Param' not in expected state when the function returns: expected 'unconsumed', observed 'consumed'}}
+ }
+
+ Param.consume();
+}
+
+void testParamReturnTypestateCaller() {
+ ConsumableClass<int> var;
+
+ testParamReturnTypestateCallee(true, var);
+
+ *var;
+}
+
+void testParamTypestateCallee(ConsumableClass<int> Param0 PARAM_TYPESTATE(consumed),
+ ConsumableClass<int> &Param1 PARAM_TYPESTATE(consumed)) {
+
+ *Param0; // expected-warning {{invalid invocation of method 'operator*' on object 'Param0' while it is in the 'consumed' state}}
+ *Param1; // expected-warning {{invalid invocation of method 'operator*' on object 'Param1' while it is in the 'consumed' state}}
+}
+
+void testParamTypestateCaller() {
+ ConsumableClass<int> Var0, Var1(42);
+
+ testParamTypestateCallee(Var0, Var1); // expected-warning {{argument not in expected state; expected 'consumed', observed 'unconsumed'}}
+}
+
+void baf3(ConsumableClass<int> var) {
+ *var;
+}
+
+void baf4(ConsumableClass<int> &var) {
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'unknown' state}}
+}
+
+void baf6(ConsumableClass<int> &&var) {
+ *var;
+}
+
+void testCallingConventions() {
+ ConsumableClass<int> var(42);
+
+ baf0(var);
+ *var;
+
+ baf1(var);
+ *var;
+
+ baf2(&var);
+ *var;
+
+ baf4(var);
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'unknown' state}}
+
+ var = ConsumableClass<int>(42);
+ baf5(&var);
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'unknown' state}}
+
+ var = ConsumableClass<int>(42);
+ baf6(static_cast<ConsumableClass<int>&&>(var));
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+}
+
+void testConstAndNonConstMemberFunctions() {
+ ConsumableClass<int> var(42);
+
+ var.constCall();
+ *var;
+
+ var.nonconstCall();
+ *var;
+}
+
+void testFunctionParam0(ConsumableClass<int> param) {
+ *param;
+}
+
+void testFunctionParam1(ConsumableClass<int> &param) {
+ *param; // expected-warning {{invalid invocation of method 'operator*' on object 'param' while it is in the 'unknown' state}}
+}
+
+void testReturnStates() {
+ ConsumableClass<int> var;
+
+ var = returnsUnconsumed();
+ *var;
+
+ var = returnsConsumed();
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+}
+
+void testCallableWhen() {
+ ConsumableClass<int> var(42);
+
+ *var;
+
+ baf4(var);
+
+ var.callableWhenUnknown();
+}
+
+void testMoveAsignmentish() {
+ ConsumableClass<int> var0;
+ ConsumableClass<long> var1(42);
+
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+ *var1;
+
+ var0 = static_cast<ConsumableClass<long>&&>(var1);
+
+ *var0;
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+
+ var1 = ConsumableClass<long>(42);
+ var1 = nullptr;
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+}
+
+void testConditionalMerge() {
+ ConsumableClass<int> var;
+
+ if (var.isValid()) {
+ // Empty
+ }
+
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+
+ if (var.isValid()) {
+ // Empty
+ } else {
+ // Empty
+ }
+
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+}
+
+void testSetTypestate() {
+ ConsumableClass<int> var(42);
+
+ *var;
+
+ var.consume();
+
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+
+ var.unconsume();
+
+ *var;
+}
+
+void testConsumes0() {
+ ConsumableClass<int> var(nullptr);
+
+ *var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'consumed' state}}
+}
+
+void testConsumes1() {
+ ConsumableClass<int> var(42);
+
+ var.unconsumedCall();
+ var(6);
+
+ var.unconsumedCall(); // expected-warning {{invalid invocation of method 'unconsumedCall' on object 'var' while it is in the 'consumed' state}}
+}
+
+void testUnreachableBlock() {
+ ConsumableClass<int> var(42);
+
+ if (var) {
+ *var;
+ } else {
+ *var;
+ }
+
+ *var;
+}
+
+
+void testForLoop1() {
+ ConsumableClass<int> var0, var1(42);
+
+ for (int i = 0; i < 10; ++i) { // expected-warning {{state of variable 'var1' must match at the entry and exit of loop}}
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+
+ *var1;
+ var1.consume();
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+ }
+
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+}
+
+void testWhileLoop1() {
+ int i = 10;
+
+ ConsumableClass<int> var0, var1(42);
+
+ while (i-- > 0) { // expected-warning {{state of variable 'var1' must match at the entry and exit of loop}}
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+
+ *var1;
+ var1.consume();
+ *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}}
+ }
+
+ *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
+}
+
+typedef const int*& IntegerPointerReference;
+void testIsRValueRefishAndCanonicalType(IntegerPointerReference a) {}
+
+namespace ContinueICETest {
+
+bool cond1();
+bool cond2();
+
+static void foo1() {
+ while (cond1()) {
+ if (cond2())
+ continue;
+ }
+}
+
+static void foo2() {
+ while (true) {
+ if (false)
+ continue;
+ }
+}
+
+class runtime_error
+{
+public:
+ virtual ~runtime_error();
+};
+
+void read(bool sf) {
+ while (sf) {
+ if(sf) throw runtime_error();
+ }
+}
+
+} // end namespace ContinueICETest
+
+
+namespace InitializerAssertionFailTest {
+
+class CONSUMABLE(unconsumed) Status {
+ int code;
+
+public:
+ Status() RETURN_TYPESTATE(consumed);
+ Status(int c) RETURN_TYPESTATE(unconsumed);
+
+ Status(const Status &other);
+ Status(Status &&other);
+
+ Status& operator=(const Status &other) CALLABLE_WHEN("unknown", "consumed");
+ Status& operator=(Status &&other) CALLABLE_WHEN("unknown", "consumed");
+
+ bool check() const SET_TYPESTATE(consumed);
+ void ignore() const SET_TYPESTATE(consumed);
+ // Status& markAsChecked() { return *this; }
+
+ void clear() CALLABLE_WHEN("unknown", "consumed") SET_TYPESTATE(consumed);
+
+ ~Status() CALLABLE_WHEN("unknown", "consumed");
+};
+
+
+bool cond();
+Status doSomething();
+void handleStatus(const Status& s RETURN_TYPESTATE(consumed));
+void handleStatusPtr(const Status* s);
+
+void testSimpleTemporaries0() {
+ doSomething(); // expected-warning {{invalid invocation of method '~Status' on a temporary object while it is in the 'unconsumed' state}}
+}
+
+void testSimpleTemporaries1() {
+ doSomething().ignore();
+}
+
+void testSimpleTemporaries2() {
+ handleStatus(doSomething());
+}
+
+void testSimpleTemporaries3() {
+ Status s = doSomething();
+} // expected-warning {{invalid invocation of method '~Status' on object 's' while it is in the 'unconsumed' state}}
+
+void testSimpleTemporaries4() {
+ Status s = doSomething();
+ s.check();
+}
+
+void testSimpleTemporaries5() {
+ Status s = doSomething();
+ s.clear(); // expected-warning {{invalid invocation of method 'clear' on object 's' while it is in the 'unconsumed' state}}
+}
+
+void testSimpleTemporaries6() {
+ Status s = doSomething();
+ handleStatus(s);
+}
+
+void testSimpleTemporaries7() {
+ Status s;
+ s = doSomething();
+} // expected-warning {{invalid invocation of method '~Status' on object 's' while it is in the 'unconsumed' state}}
+
+void testTemporariesWithConditionals0() {
+ int a;
+
+ Status s = doSomething();
+ if (cond()) a = 0;
+ else a = 1;
+} // expected-warning {{invalid invocation of method '~Status' on object 's' while it is in the 'unconsumed' state}}
+
+void testTemporariesWithConditionals1() {
+ int a;
+
+ Status s = doSomething();
+ if (cond()) a = 0;
+ else a = 1;
+ s.ignore();
+}
+
+void testTemporariesWithConditionals2() {
+ int a;
+
+ Status s = doSomething();
+ s.ignore();
+ if (cond()) a = 0;
+ else a = 1;
+}
+
+void testTemporariesWithConditionals3() {
+ Status s = doSomething();
+ if (cond()) {
+ s.check();
+ }
+}
+
+void testTemporariesAndConstructors0() {
+ Status s(doSomething());
+ s.check();
+}
+
+void testTemporariesAndConstructors1() {
+ // Test the copy constructor.
+
+ Status s1 = doSomething();
+ Status s2(s1);
+ s2.check();
+} // expected-warning {{invalid invocation of method '~Status' on object 's1' while it is in the 'unconsumed' state}}
+
+void testTemporariesAndConstructors2() {
+ // Test the move constructor.
+
+ Status s1 = doSomething();
+ Status s2(static_cast<Status&&>(s1));
+ s2.check();
+}
+
+void testTemporariesAndOperators0() {
+ // Test the assignment operator.
+
+ Status s1 = doSomething();
+ Status s2;
+ s2 = s1;
+ s2.check();
+} // expected-warning {{invalid invocation of method '~Status' on object 's1' while it is in the 'unconsumed' state}}
+
+void testTemporariesAndOperators1() {
+ // Test the move assignment operator.
+
+ Status s1 = doSomething();
+ Status s2;
+ s2 = static_cast<Status&&>(s1);
+ s2.check();
+}
+
+void testTemporariesAndOperators2() {
+ Status s1 = doSomething();
+ Status s2 = doSomething();
+ s1 = s2; // expected-warning {{invalid invocation of method 'operator=' on object 's1' while it is in the 'unconsumed' state}}
+ s1.check();
+ s2.check();
+}
+
+} // end namespace InitializerAssertionFailTest
+
diff --git a/test/SemaCXX/warn-consumed-parsing.cpp b/test/SemaCXX/warn-consumed-parsing.cpp
new file mode 100644
index 000000000000..0a91636ea949
--- /dev/null
+++ b/test/SemaCXX/warn-consumed-parsing.cpp
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wconsumed -std=c++11 %s
+
+#define CALLABLE_WHEN(...) __attribute__ ((callable_when(__VA_ARGS__)))
+#define CONSUMABLE(state) __attribute__ ((consumable(state)))
+#define SET_TYPESTATE(state) __attribute__ ((set_typestate(state)))
+#define RETURN_TYPESTATE(state) __attribute__ ((return_typestate(state)))
+#define TEST_TYPESTATE(state) __attribute__ ((test_typestate(state)))
+
+// FIXME: This test is here because the warning is issued by the Consumed
+// analysis, not SemaDeclAttr. The analysis won't run after an error
+// has been issued. Once the attribute propagation for template
+// instantiation has been fixed, this can be moved somewhere else and the
+// definition can be removed.
+int returnTypestateForUnconsumable() RETURN_TYPESTATE(consumed); // expected-warning {{return state set for an unconsumable type 'int'}}
+int returnTypestateForUnconsumable() {
+ return 0;
+}
+
+class AttrTester0 {
+ void consumes() __attribute__ ((set_typestate())); // expected-error {{attribute takes one argument}}
+ bool testUnconsumed() __attribute__ ((test_typestate())); // expected-error {{attribute takes one argument}}
+ void callableWhen() __attribute__ ((callable_when())); // expected-error {{attribute takes at least 1 argument}}
+};
+
+int var0 SET_TYPESTATE(consumed); // expected-warning {{'set_typestate' attribute only applies to methods}}
+int var1 TEST_TYPESTATE(consumed); // expected-warning {{'test_typestate' attribute only applies to methods}}
+int var2 CALLABLE_WHEN("consumed"); // expected-warning {{'callable_when' attribute only applies to methods}}
+int var3 CONSUMABLE(consumed); // expected-warning {{'consumable' attribute only applies to classes}}
+int var4 RETURN_TYPESTATE(consumed); // expected-warning {{'return_typestate' attribute only applies to functions}}
+
+void function0() SET_TYPESTATE(consumed); // expected-warning {{'set_typestate' attribute only applies to methods}}
+void function1() TEST_TYPESTATE(consumed); // expected-warning {{'test_typestate' attribute only applies to methods}}
+void function2() CALLABLE_WHEN("consumed"); // expected-warning {{'callable_when' attribute only applies to methods}}
+void function3() CONSUMABLE(consumed); // expected-warning {{'consumable' attribute only applies to classes}}
+
+class CONSUMABLE(unknown) AttrTester1 {
+ void callableWhen0() CALLABLE_WHEN("unconsumed");
+ void callableWhen1() CALLABLE_WHEN(42); // expected-error {{'callable_when' attribute requires a string}}
+ void callableWhen2() CALLABLE_WHEN("foo"); // expected-warning {{'callable_when' attribute argument not supported: foo}}
+ void consumes() SET_TYPESTATE(consumed);
+ bool testUnconsumed() TEST_TYPESTATE(consumed);
+};
+
+AttrTester1 returnTypestateTester0() RETURN_TYPESTATE(not_a_state); // expected-warning {{'return_typestate' attribute argument not supported: 'not_a_state'}}
+AttrTester1 returnTypestateTester1() RETURN_TYPESTATE(42); // expected-error {{'return_typestate' attribute requires an identifier}}
+
+void returnTypestateTester2(AttrTester1 &Param RETURN_TYPESTATE(unconsumed));
+
+class AttrTester2 {
+ void callableWhen() CALLABLE_WHEN("unconsumed"); // expected-warning {{consumed analysis attribute is attached to member of class 'AttrTester2' which isn't marked as consumable}}
+ void consumes() SET_TYPESTATE(consumed); // expected-warning {{consumed analysis attribute is attached to member of class 'AttrTester2' which isn't marked as consumable}}
+ bool testUnconsumed() TEST_TYPESTATE(consumed); // expected-warning {{consumed analysis attribute is attached to member of class 'AttrTester2' which isn't marked as consumable}}
+};
+
+class CONSUMABLE(42) AttrTester3; // expected-error {{'consumable' attribute requires an identifier}}
diff --git a/test/SemaCXX/warn-dangling-field.cpp b/test/SemaCXX/warn-dangling-field.cpp
index 95f8c61ebb77..eb65bd06692c 100644
--- a/test/SemaCXX/warn-dangling-field.cpp
+++ b/test/SemaCXX/warn-dangling-field.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wdangling-field -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wdangling-field -verify -std=c++11 %s
struct X {
X(int);
@@ -35,3 +35,17 @@ template <typename T> struct S4 {
template struct S4<int>; // no warning from this instantiation
template struct S4<int&>; // expected-note {{in instantiation}}
+
+struct S5 {
+ const X &x; // expected-note {{here}}
+};
+S5 s5 = { 0 }; // ok, lifetime-extended
+
+struct S6 {
+ S5 s5; // expected-note {{here}}
+ S6() : s5 { 0 } {} // expected-warning {{binding reference subobject of member 's5' to a temporary}}
+};
+
+struct S7 : S5 {
+ S7() : S5 { 0 } {} // expected-warning {{binding reference member 'x' to a temporary}}
+};
diff --git a/test/SemaCXX/warn-div-or-rem-by-zero.cpp b/test/SemaCXX/warn-div-or-rem-by-zero.cpp
new file mode 100644
index 000000000000..44b877eb1bc4
--- /dev/null
+++ b/test/SemaCXX/warn-div-or-rem-by-zero.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -verify %s
+// RUN: %clang_cc1 -std=c++11 -verify %s
+// RUN: %clang_cc1 -std=c++1y -verify %s
+
+void div() {
+ (void)(42 / 0); // expected-warning{{division by zero is undefined}}
+ (void)(42 / false); // expected-warning{{division by zero is undefined}}
+ (void)(42 / !1); // expected-warning{{division by zero is undefined}}
+ (void)(42 / (1 - 1)); // expected-warning{{division by zero is undefined}}
+ (void)(42 / !(1 + 1)); // expected-warning{{division by zero is undefined}}
+ (void)(42 / (int)(0.0)); // expected-warning{{division by zero is undefined}}
+}
+
+void rem() {
+ (void)(42 % 0); // expected-warning{{remainder by zero is undefined}}
+ (void)(42 % false); // expected-warning{{remainder by zero is undefined}}
+ (void)(42 % !1); // expected-warning{{remainder by zero is undefined}}
+ (void)(42 % (1 - 1)); // expected-warning{{remainder by zero is undefined}}
+ (void)(42 % !(1 + 1)); // expected-warning{{remainder by zero is undefined}}
+ (void)(42 % (int)(0.0)); // expected-warning{{remainder by zero is undefined}}
+}
diff --git a/test/SemaCXX/warn-empty-body.cpp b/test/SemaCXX/warn-empty-body.cpp
index d643cedf09cc..d3aaac1d8c36 100644
--- a/test/SemaCXX/warn-empty-body.cpp
+++ b/test/SemaCXX/warn-empty-body.cpp
@@ -269,3 +269,8 @@ void test_template_inst(int x) {
test_template<double>(x);
}
+#define IDENTITY(a) a
+void test7(int x, int y) {
+ if (x) IDENTITY(); // no-warning
+}
+
diff --git a/test/SemaCXX/warn-func-not-needed.cpp b/test/SemaCXX/warn-func-not-needed.cpp
index d51c17356632..65721f44f570 100644
--- a/test/SemaCXX/warn-func-not-needed.cpp
+++ b/test/SemaCXX/warn-func-not-needed.cpp
@@ -42,3 +42,12 @@ namespace test4 {
g<int>();
}
}
+
+namespace test4 {
+ static void func();
+ void bar() {
+ void func();
+ func();
+ }
+ static void func() {}
+}
diff --git a/test/SemaCXX/warn-global-constructors.cpp b/test/SemaCXX/warn-global-constructors.cpp
index 6330958df703..f57f0de70812 100644
--- a/test/SemaCXX/warn-global-constructors.cpp
+++ b/test/SemaCXX/warn-global-constructors.cpp
@@ -95,3 +95,9 @@ namespace pr8095 {
static Bar b;
}
}
+
+namespace referencemember {
+ struct A { int &a; };
+ int a;
+ A b = { a };
+}
diff --git a/test/SemaCXX/warn-logical-not-compare.cpp b/test/SemaCXX/warn-logical-not-compare.cpp
new file mode 100644
index 000000000000..3ecce474f149
--- /dev/null
+++ b/test/SemaCXX/warn-logical-not-compare.cpp
@@ -0,0 +1,194 @@
+// RUN: %clang_cc1 -fsyntax-only -Wlogical-not-parentheses -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wlogical-not-parentheses -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+
+bool getBool();
+int getInt();
+
+bool test1(int i1, int i2, bool b1, bool b2) {
+ bool ret;
+
+ ret = !i1 == i2;
+ // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{10:10-10:10}:"("
+ // CHECK: fix-it:"{{.*}}":{10:18-10:18}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{10:9-10:9}:"("
+ // CHECK: fix-it:"{{.*}}":{10:12-10:12}:")"
+
+ ret = !i1 != i2;
+ //expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{21:10-21:10}:"("
+ // CHECK: fix-it:"{{.*}}":{21:18-21:18}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{21:9-21:9}:"("
+ // CHECK: fix-it:"{{.*}}":{21:12-21:12}:")"
+
+ ret = !i1 < i2;
+ //expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{32:10-32:10}:"("
+ // CHECK: fix-it:"{{.*}}":{32:17-32:17}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{32:9-32:9}:"("
+ // CHECK: fix-it:"{{.*}}":{32:12-32:12}:")"
+
+ ret = !i1 > i2;
+ //expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{43:10-43:10}:"("
+ // CHECK: fix-it:"{{.*}}":{43:17-43:17}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{43:9-43:9}:"("
+ // CHECK: fix-it:"{{.*}}":{43:12-43:12}:")"
+
+ ret = !i1 <= i2;
+ //expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{54:10-54:10}:"("
+ // CHECK: fix-it:"{{.*}}":{54:18-54:18}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{54:9-54:9}:"("
+ // CHECK: fix-it:"{{.*}}":{54:12-54:12}:")"
+
+ ret = !i1 >= i2;
+ //expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{65:10-65:10}:"("
+ // CHECK: fix-it:"{{.*}}":{65:18-65:18}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{65:9-65:9}:"("
+ // CHECK: fix-it:"{{.*}}":{65:12-65:12}:")"
+
+ ret = i1 == i2;
+ ret = i1 != i2;
+ ret = i1 < i2;
+ ret = i1 > i2;
+ ret = i1 <= i2;
+ ret = i1 >= i2;
+
+ // Warning silenced by parens.
+ ret = (!i1) == i2;
+ ret = (!i1) != i2;
+ ret = (!i1) < i2;
+ ret = (!i1) > i2;
+ ret = (!i1) <= i2;
+ ret = (!i1) >= i2;
+
+ ret = !b1 == b2;
+ ret = !b1 != b2;
+ ret = !b1 < b2;
+ ret = !b1 > b2;
+ ret = !b1 <= b2;
+ ret = !b1 >= b2;
+
+ ret = !getInt() == i1;
+ // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{98:10-98:10}:"("
+ // CHECK: fix-it:"{{.*}}":{98:24-98:24}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{98:9-98:9}:"("
+ // CHECK: fix-it:"{{.*}}":{98:18-98:18}:")"
+
+ ret = (!getInt()) == i1;
+ ret = !getBool() == b1;
+ return ret;
+}
+
+enum E {e1, e2};
+E getE();
+
+bool test2 (E e) {
+ bool ret;
+ ret = e == e1;
+ ret = e == getE();
+ ret = getE() == e1;
+ ret = getE() == getE();
+
+ ret = !e == e1;
+ // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{124:10-124:10}:"("
+ // CHECK: fix-it:"{{.*}}":{124:17-124:17}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{124:9-124:9}:"("
+ // CHECK: fix-it:"{{.*}}":{124:11-124:11}:")"
+
+ ret = !e == getE();
+ // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{135:10-135:10}:"("
+ // CHECK: fix-it:"{{.*}}":{135:21-135:21}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{135:9-135:9}:"("
+ // CHECK: fix-it:"{{.*}}":{135:11-135:11}:")"
+
+ ret = !getE() == e1;
+ // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{146:10-146:10}:"("
+ // CHECK: fix-it:"{{.*}}":{146:22-146:22}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{146:9-146:9}:"("
+ // CHECK: fix-it:"{{.*}}":{146:16-146:16}:")"
+
+ ret = !getE() == getE();
+ // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK: fix-it:"{{.*}}":{157:10-157:10}:"("
+ // CHECK: fix-it:"{{.*}}":{157:26-157:26}:")"
+ // CHECK: to silence this warning
+ // CHECK: fix-it:"{{.*}}":{157:9-157:9}:"("
+ // CHECK: fix-it:"{{.*}}":{157:16-157:16}:")"
+
+ ret = !(e == e1);
+ ret = !(e == getE());
+ ret = !(getE() == e1);
+ ret = !(getE() == getE());
+
+ ret = (!e) == e1;
+ ret = (!e) == getE();
+ ret = (!getE()) == e1;
+ ret = (!getE()) == getE();
+
+ return ret;
+}
+
+bool PR16673(int x) {
+ bool ret;
+ // Make sure we don't emit a fixit for the left paren, but not the right paren.
+#define X(x) x
+ ret = X(!x == 1 && 1);
+ // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}}
+ // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}}
+ // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}}
+ // CHECK: to evaluate the comparison first
+ // CHECK-NOT: fix-it
+ // CHECK: to silence this warning
+ // CHECK-NOT: fix-it
+ return ret;
+}
diff --git a/test/SemaCXX/warn-loop-analysis.cpp b/test/SemaCXX/warn-loop-analysis.cpp
index 627bc51d1b0f..c666c48fc017 100644
--- a/test/SemaCXX/warn-loop-analysis.cpp
+++ b/test/SemaCXX/warn-loop-analysis.cpp
@@ -152,3 +152,111 @@ void test6() {
for (;x6;);
for (;y;);
}
+
+void test7() {
+ int i;
+ for (;;i++) { // expected-note{{incremented here}}
+ if (true) test7();
+ i++; // expected-warning{{incremented both}}
+ }
+ for (;;i++) { // expected-note{{incremented here}}
+ if (true) break;
+ ++i; // expected-warning{{incremented both}}
+ }
+ for (;;++i) { // expected-note{{incremented here}}
+ while (true) return;
+ i++; // expected-warning{{incremented both}}
+ }
+ for (;;++i) { // expected-note{{incremented here}}
+ ++i; // expected-warning{{incremented both}}
+ }
+
+ for (;;i--) { // expected-note{{decremented here}}
+ if (true) test7();
+ i--; // expected-warning{{decremented both}}
+ }
+ for (;;i--) { // expected-note{{decremented here}}
+ if (true) break;
+ --i; // expected-warning{{decremented both}}
+ }
+ for (;;--i) { // expected-note{{decremented here}}
+ while (true) return;
+ i--; // expected-warning{{decremented both}}
+ }
+ for (;;--i) { // expected-note{{decremented here}}
+ --i; // expected-warning{{decremented both}}
+ }
+
+ // Don't warn when loop is only one statement.
+ for (;;++i)
+ i++;
+ for (;;--i)
+ --i;
+
+ // Don't warn when loop has continue statement.
+ for (;;i++) {
+ if (true) continue;
+ i++;
+ }
+ for (;;i--) {
+ if (true) continue;
+ i--;
+ }
+}
+
+struct iterator {
+ iterator operator++() { return *this; }
+ iterator operator++(int) { return *this; }
+ iterator operator--() { return *this; }
+ iterator operator--(int) { return *this; }
+};
+void test8() {
+ iterator i;
+ for (;;i++) { // expected-note{{incremented here}}
+ if (true) test7();
+ i++; // expected-warning{{incremented both}}
+ }
+ for (;;i++) { // expected-note{{incremented here}}
+ if (true) break;
+ ++i; // expected-warning{{incremented both}}
+ }
+ for (;;++i) { // expected-note{{incremented here}}
+ while (true) return;
+ i++; // expected-warning{{incremented both}}
+ }
+ for (;;++i) { // expected-note{{incremented here}}
+ ++i; // expected-warning{{incremented both}}
+ }
+
+ for (;;i--) { // expected-note{{decremented here}}
+ if (true) test7();
+ i--; // expected-warning{{decremented both}}
+ }
+ for (;;i--) { // expected-note{{decremented here}}
+ if (true) break;
+ --i; // expected-warning{{decremented both}}
+ }
+ for (;;--i) { // expected-note{{decremented here}}
+ while (true) return;
+ i--; // expected-warning{{decremented both}}
+ }
+ for (;;--i) { // expected-note{{decremented here}}
+ --i; // expected-warning{{decremented both}}
+ }
+
+ // Don't warn when loop is only one statement.
+ for (;;++i)
+ i++;
+ for (;;--i)
+ --i;
+
+ // Don't warn when loop has continue statement.
+ for (;;i++) {
+ if (true) continue;
+ i++;
+ }
+ for (;;i--) {
+ if (true) continue;
+ i--;
+ }
+}
diff --git a/test/SemaCXX/warn-member-not-needed.cpp b/test/SemaCXX/warn-member-not-needed.cpp
new file mode 100644
index 000000000000..61bb3488c611
--- /dev/null
+++ b/test/SemaCXX/warn-member-not-needed.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wunneeded-member-function %s
+
+namespace {
+ class A {
+ void g() {} // expected-warning {{is not needed and will not be emitted}}
+ template <typename T>
+ void foo() {
+ g();
+ }
+ };
+}
diff --git a/test/SemaCXX/warn-missing-variable-declarations.cpp b/test/SemaCXX/warn-missing-variable-declarations.cpp
index 12af9735d1a9..ad23e0429bbd 100644
--- a/test/SemaCXX/warn-missing-variable-declarations.cpp
+++ b/test/SemaCXX/warn-missing-variable-declarations.cpp
@@ -41,3 +41,9 @@ int CGood1::MGood1;
namespace {
int mgood4;
}
+
+class C {
+ void test() {
+ static int x = 0; // no-warn
+ }
+};
diff --git a/test/SemaCXX/warn-reinterpret-base-class.cpp b/test/SemaCXX/warn-reinterpret-base-class.cpp
index 67902f7a90d8..36b8fda55306 100644
--- a/test/SemaCXX/warn-reinterpret-base-class.cpp
+++ b/test/SemaCXX/warn-reinterpret-base-class.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fdiagnostics-parseable-fixits -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -fdiagnostics-parseable-fixits -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s 2>&1 | FileCheck %s
// PR 13824
class A {
diff --git a/test/SemaCXX/warn-thread-safety-analysis.cpp b/test/SemaCXX/warn-thread-safety-analysis.cpp
index bc4b40ead73d..ce6250d6da90 100644
--- a/test/SemaCXX/warn-thread-safety-analysis.cpp
+++ b/test/SemaCXX/warn-thread-safety-analysis.cpp
@@ -11,8 +11,10 @@
#define PT_GUARDED_VAR __attribute__ ((pt_guarded_var))
#define ACQUIRED_AFTER(...) __attribute__ ((acquired_after(__VA_ARGS__)))
#define ACQUIRED_BEFORE(...) __attribute__ ((acquired_before(__VA_ARGS__)))
-#define EXCLUSIVE_LOCK_FUNCTION(...) __attribute__ ((exclusive_lock_function(__VA_ARGS__)))
-#define SHARED_LOCK_FUNCTION(...) __attribute__ ((shared_lock_function(__VA_ARGS__)))
+#define EXCLUSIVE_LOCK_FUNCTION(...) __attribute__ ((exclusive_lock_function(__VA_ARGS__)))
+#define SHARED_LOCK_FUNCTION(...) __attribute__ ((shared_lock_function(__VA_ARGS__)))
+#define ASSERT_EXCLUSIVE_LOCK(...) __attribute__ ((assert_exclusive_lock(__VA_ARGS__)))
+#define ASSERT_SHARED_LOCK(...) __attribute__ ((assert_shared_lock(__VA_ARGS__)))
#define EXCLUSIVE_TRYLOCK_FUNCTION(...) __attribute__ ((exclusive_trylock_function(__VA_ARGS__)))
#define SHARED_TRYLOCK_FUNCTION(...) __attribute__ ((shared_trylock_function(__VA_ARGS__)))
#define UNLOCK_FUNCTION(...) __attribute__ ((unlock_function(__VA_ARGS__)))
@@ -33,6 +35,9 @@ class __attribute__((lockable)) Mutex {
bool TryLock() __attribute__((exclusive_trylock_function(true)));
bool ReaderTryLock() __attribute__((shared_trylock_function(true)));
void LockWhen(const int &cond) __attribute__((exclusive_lock_function));
+
+ void AssertHeld() ASSERT_EXCLUSIVE_LOCK();
+ void AssertReaderHeld() ASSERT_SHARED_LOCK();
};
class __attribute__((scoped_lockable)) MutexLock {
@@ -75,6 +80,7 @@ public:
T* get() const { return ptr_; }
T* operator->() const { return ptr_; }
T& operator*() const { return *ptr_; }
+ T& operator[](int i) const { return ptr_[i]; }
private:
T* ptr_;
@@ -102,14 +108,14 @@ class MutexWrapper {
public:
Mutex mu;
int x __attribute__((guarded_by(mu)));
- void MyLock() __attribute__((exclusive_lock_function(mu)));
+ void MyLock() __attribute__((exclusive_lock_function(mu)));
};
MutexWrapper sls_mw;
void sls_fun_0() {
sls_mw.mu.Lock();
- sls_mw.x = 5;
+ sls_mw.x = 5;
sls_mw.mu.Unlock();
}
@@ -3069,44 +3075,6 @@ void Foo::test1() {
#endif
}
-
-void Foo::test2() {
-/* FIXME: these tests depend on changes to the CFG.
- *
- if (mu_.TryLock() && c) {
- a = 0;
- unlock();
- }
- else return;
-
- if (c && mu_.TryLock()) {
- a = 0;
- unlock();
- }
- else return;
-
- if (!(mu_.TryLock() && c))
- return;
- a = 0;
- unlock();
-
- if (!(c && mu_.TryLock()))
- return;
- a = 0;
- unlock();
-
- if (!(mu_.TryLock() == 0) && c) {
- a = 0;
- unlock();
- }
-
- if (!mu_.TryLock() || c)
- return;
- a = 0;
- unlock();
-*/
-}
-
} // end namespace TryLockEqTest
@@ -3985,3 +3953,364 @@ private:
} // end namespace LockUnlockFunctionTest
+
+namespace AssertHeldTest {
+
+class Foo {
+public:
+ int c;
+ int a GUARDED_BY(mu_);
+ Mutex mu_;
+
+ void test1() {
+ mu_.AssertHeld();
+ int b = a;
+ a = 0;
+ }
+
+ void test2() {
+ mu_.AssertReaderHeld();
+ int b = a;
+ a = 0; // expected-warning {{writing variable 'a' requires locking 'mu_' exclusively}}
+ }
+
+ void test3() {
+ if (c) {
+ mu_.AssertHeld();
+ }
+ else {
+ mu_.AssertHeld();
+ }
+ int b = a;
+ a = 0;
+ }
+
+ void test4() EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ mu_.AssertHeld();
+ int b = a;
+ a = 0;
+ }
+
+ void test5() UNLOCK_FUNCTION(mu_) {
+ mu_.AssertHeld();
+ mu_.Unlock();
+ }
+
+ void test6() {
+ mu_.AssertHeld();
+ mu_.Unlock();
+ } // should this be a warning?
+
+ void test7() {
+ if (c) {
+ mu_.AssertHeld();
+ }
+ else {
+ mu_.Lock();
+ }
+ int b = a;
+ a = 0;
+ mu_.Unlock();
+ }
+
+ void test8() {
+ if (c) {
+ mu_.Lock();
+ }
+ else {
+ mu_.AssertHeld();
+ }
+ int b = a;
+ a = 0;
+ mu_.Unlock();
+ }
+
+ void test9() {
+ if (c) {
+ mu_.AssertHeld();
+ }
+ else {
+ mu_.Lock(); // expected-note {{mutex acquired here}}
+ }
+ } // expected-warning {{mutex 'mu_' is still locked at the end of function}}
+
+ void test10() {
+ if (c) {
+ mu_.Lock(); // expected-note {{mutex acquired here}}
+ }
+ else {
+ mu_.AssertHeld();
+ }
+ } // expected-warning {{mutex 'mu_' is still locked at the end of function}}
+
+ void assertMu() ASSERT_EXCLUSIVE_LOCK(mu_);
+
+ void test11() {
+ assertMu();
+ int b = a;
+ a = 0;
+ }
+};
+
+} // end namespace AssertHeldTest
+
+
+namespace LogicalConditionalTryLock {
+
+class Foo {
+public:
+ Mutex mu;
+ int a GUARDED_BY(mu);
+ bool c;
+
+ bool newc();
+
+ void test1() {
+ if (c && mu.TryLock()) {
+ a = 0;
+ mu.Unlock();
+ }
+ }
+
+ void test2() {
+ bool b = mu.TryLock();
+ if (c && b) {
+ a = 0;
+ mu.Unlock();
+ }
+ }
+
+ void test3() {
+ if (c || !mu.TryLock())
+ return;
+ a = 0;
+ mu.Unlock();
+ }
+
+ void test4() {
+ while (c && mu.TryLock()) {
+ a = 0;
+ c = newc();
+ mu.Unlock();
+ }
+ }
+
+ void test5() {
+ while (c) {
+ if (newc() || !mu.TryLock())
+ break;
+ a = 0;
+ mu.Unlock();
+ }
+ }
+
+ void test6() {
+ mu.Lock();
+ do {
+ a = 0;
+ mu.Unlock();
+ } while (newc() && mu.TryLock());
+ }
+
+ void test7() {
+ for (bool b = mu.TryLock(); c && b;) {
+ a = 0;
+ mu.Unlock();
+ }
+ }
+
+ void test8() {
+ if (c && newc() && mu.TryLock()) {
+ a = 0;
+ mu.Unlock();
+ }
+ }
+
+ void test9() {
+ if (!(c && newc() && mu.TryLock()))
+ return;
+ a = 0;
+ mu.Unlock();
+ }
+
+ void test10() {
+ if (!(c || !mu.TryLock())) {
+ a = 0;
+ mu.Unlock();
+ }
+ }
+};
+
+} // end namespace LogicalConditionalTryLock
+
+
+
+namespace PtGuardedByTest {
+
+void doSomething();
+
+class Cell {
+ public:
+ int a;
+};
+
+
+// This mainly duplicates earlier tests, but just to make sure...
+class PtGuardedBySanityTest {
+ Mutex mu1;
+ Mutex mu2;
+ int* a GUARDED_BY(mu1) PT_GUARDED_BY(mu2);
+ Cell* c GUARDED_BY(mu1) PT_GUARDED_BY(mu2);
+ int sa[10] GUARDED_BY(mu1);
+ Cell sc[10] GUARDED_BY(mu1);
+
+ void test1() {
+ mu1.Lock();
+ if (a == 0) doSomething(); // OK, we don't dereference.
+ a = 0;
+ c = 0;
+ if (sa[0] == 42) doSomething();
+ sa[0] = 57;
+ if (sc[0].a == 42) doSomething();
+ sc[0].a = 57;
+ mu1.Unlock();
+ }
+
+ void test2() {
+ mu1.ReaderLock();
+ if (*a == 0) doSomething(); // expected-warning {{reading the value pointed to by 'a' requires locking 'mu2'}}
+ *a = 0; // expected-warning {{writing the value pointed to by 'a' requires locking 'mu2' exclusively}}
+
+ if (c->a == 0) doSomething(); // expected-warning {{reading the value pointed to by 'c' requires locking 'mu2'}}
+ c->a = 0; // expected-warning {{writing the value pointed to by 'c' requires locking 'mu2' exclusively}}
+
+ if ((*c).a == 0) doSomething(); // expected-warning {{reading the value pointed to by 'c' requires locking 'mu2'}}
+ (*c).a = 0; // expected-warning {{writing the value pointed to by 'c' requires locking 'mu2' exclusively}}
+
+ if (a[0] == 42) doSomething(); // expected-warning {{reading the value pointed to by 'a' requires locking 'mu2'}}
+ a[0] = 57; // expected-warning {{writing the value pointed to by 'a' requires locking 'mu2' exclusively}}
+ if (c[0].a == 42) doSomething(); // expected-warning {{reading the value pointed to by 'c' requires locking 'mu2'}}
+ c[0].a = 57; // expected-warning {{writing the value pointed to by 'c' requires locking 'mu2' exclusively}}
+ mu1.Unlock();
+ }
+
+ void test3() {
+ mu2.Lock();
+ if (*a == 0) doSomething(); // expected-warning {{reading variable 'a' requires locking 'mu1'}}
+ *a = 0; // expected-warning {{reading variable 'a' requires locking 'mu1'}}
+
+ if (c->a == 0) doSomething(); // expected-warning {{reading variable 'c' requires locking 'mu1'}}
+ c->a = 0; // expected-warning {{reading variable 'c' requires locking 'mu1'}}
+
+ if ((*c).a == 0) doSomething(); // expected-warning {{reading variable 'c' requires locking 'mu1'}}
+ (*c).a = 0; // expected-warning {{reading variable 'c' requires locking 'mu1'}}
+
+ if (a[0] == 42) doSomething(); // expected-warning {{reading variable 'a' requires locking 'mu1'}}
+ a[0] = 57; // expected-warning {{reading variable 'a' requires locking 'mu1'}}
+ if (c[0].a == 42) doSomething(); // expected-warning {{reading variable 'c' requires locking 'mu1'}}
+ c[0].a = 57; // expected-warning {{reading variable 'c' requires locking 'mu1'}}
+ mu2.Unlock();
+ }
+
+ void test4() { // Literal arrays
+ if (sa[0] == 42) doSomething(); // expected-warning {{reading variable 'sa' requires locking 'mu1'}}
+ sa[0] = 57; // expected-warning {{writing variable 'sa' requires locking 'mu1' exclusively}}
+ if (sc[0].a == 42) doSomething(); // expected-warning {{reading variable 'sc' requires locking 'mu1'}}
+ sc[0].a = 57; // expected-warning {{writing variable 'sc' requires locking 'mu1' exclusively}}
+
+ if (*sa == 42) doSomething(); // expected-warning {{reading variable 'sa' requires locking 'mu1'}}
+ *sa = 57; // expected-warning {{writing variable 'sa' requires locking 'mu1' exclusively}}
+ if ((*sc).a == 42) doSomething(); // expected-warning {{reading variable 'sc' requires locking 'mu1'}}
+ (*sc).a = 57; // expected-warning {{writing variable 'sc' requires locking 'mu1' exclusively}}
+ if (sc->a == 42) doSomething(); // expected-warning {{reading variable 'sc' requires locking 'mu1'}}
+ sc->a = 57; // expected-warning {{writing variable 'sc' requires locking 'mu1' exclusively}}
+ }
+
+ void test5() {
+ mu1.ReaderLock(); // OK -- correct use.
+ mu2.Lock();
+ if (*a == 0) doSomething();
+ *a = 0;
+
+ if (c->a == 0) doSomething();
+ c->a = 0;
+
+ if ((*c).a == 0) doSomething();
+ (*c).a = 0;
+ mu2.Unlock();
+ mu1.Unlock();
+ }
+};
+
+
+class SmartPtr_PtGuardedBy_Test {
+ Mutex mu1;
+ Mutex mu2;
+ SmartPtr<int> sp GUARDED_BY(mu1) PT_GUARDED_BY(mu2);
+ SmartPtr<Cell> sq GUARDED_BY(mu1) PT_GUARDED_BY(mu2);
+
+ void test1() {
+ mu1.ReaderLock();
+ mu2.Lock();
+
+ sp.get();
+ if (*sp == 0) doSomething();
+ *sp = 0;
+ sq->a = 0;
+
+ if (sp[0] == 0) doSomething();
+ sp[0] = 0;
+
+ mu2.Unlock();
+ mu1.Unlock();
+ }
+
+ void test2() {
+ mu2.Lock();
+
+ sp.get(); // expected-warning {{reading variable 'sp' requires locking 'mu1'}}
+ if (*sp == 0) doSomething(); // expected-warning {{reading variable 'sp' requires locking 'mu1'}}
+ *sp = 0; // expected-warning {{reading variable 'sp' requires locking 'mu1'}}
+ sq->a = 0; // expected-warning {{reading variable 'sq' requires locking 'mu1'}}
+
+ if (sp[0] == 0) doSomething(); // expected-warning {{reading variable 'sp' requires locking 'mu1'}}
+ sp[0] = 0; // expected-warning {{reading variable 'sp' requires locking 'mu1'}}
+ if (sq[0].a == 0) doSomething(); // expected-warning {{reading variable 'sq' requires locking 'mu1'}}
+ sq[0].a = 0; // expected-warning {{reading variable 'sq' requires locking 'mu1'}}
+
+ mu2.Unlock();
+ }
+
+ void test3() {
+ mu1.Lock();
+
+ sp.get();
+ if (*sp == 0) doSomething(); // expected-warning {{reading the value pointed to by 'sp' requires locking 'mu2'}}
+ *sp = 0; // expected-warning {{reading the value pointed to by 'sp' requires locking 'mu2'}}
+ sq->a = 0; // expected-warning {{reading the value pointed to by 'sq' requires locking 'mu2'}}
+
+ if (sp[0] == 0) doSomething(); // expected-warning {{reading the value pointed to by 'sp' requires locking 'mu2'}}
+ sp[0] = 0; // expected-warning {{reading the value pointed to by 'sp' requires locking 'mu2'}}
+ if (sq[0].a == 0) doSomething(); // expected-warning {{reading the value pointed to by 'sq' requires locking 'mu2'}}
+ sq[0].a = 0; // expected-warning {{reading the value pointed to by 'sq' requires locking 'mu2'}}
+
+ mu1.Unlock();
+ }
+};
+
+} // end namespace PtGuardedByTest
+
+
+namespace NonMemberCalleeICETest {
+
+class A {
+ void Run() {
+ (RunHelper)(); // expected-warning {{calling function 'RunHelper' requires exclusive lock on 'M'}}
+ }
+
+ void RunHelper() __attribute__((exclusive_locks_required(M)));
+ Mutex M;
+};
+
+} // end namespace NonMemberCalleeICETest
+
diff --git a/test/SemaCXX/warn-thread-safety-parsing.cpp b/test/SemaCXX/warn-thread-safety-parsing.cpp
index df9415cf8601..1bd4e439b7b0 100644
--- a/test/SemaCXX/warn-thread-safety-parsing.cpp
+++ b/test/SemaCXX/warn-thread-safety-parsing.cpp
@@ -8,8 +8,10 @@
#define PT_GUARDED_VAR __attribute__ ((pt_guarded_var))
#define ACQUIRED_AFTER(...) __attribute__ ((acquired_after(__VA_ARGS__)))
#define ACQUIRED_BEFORE(...) __attribute__ ((acquired_before(__VA_ARGS__)))
-#define EXCLUSIVE_LOCK_FUNCTION(...) __attribute__ ((exclusive_lock_function(__VA_ARGS__)))
-#define SHARED_LOCK_FUNCTION(...) __attribute__ ((shared_lock_function(__VA_ARGS__)))
+#define EXCLUSIVE_LOCK_FUNCTION(...) __attribute__ ((exclusive_lock_function(__VA_ARGS__)))
+#define SHARED_LOCK_FUNCTION(...) __attribute__ ((shared_lock_function(__VA_ARGS__)))
+#define ASSERT_EXCLUSIVE_LOCK(...) __attribute__ ((assert_exclusive_lock(__VA_ARGS__)))
+#define ASSERT_SHARED_LOCK(...) __attribute__ ((assert_shared_lock(__VA_ARGS__)))
#define EXCLUSIVE_TRYLOCK_FUNCTION(...) __attribute__ ((exclusive_trylock_function(__VA_ARGS__)))
#define SHARED_TRYLOCK_FUNCTION(...) __attribute__ ((shared_trylock_function(__VA_ARGS__)))
#define UNLOCK_FUNCTION(...) __attribute__ ((unlock_function(__VA_ARGS__)))
@@ -24,7 +26,15 @@
class LOCKABLE Mutex {
public:
- void Lock();
+ void Lock() EXCLUSIVE_LOCK_FUNCTION();
+ void ReaderLock() SHARED_LOCK_FUNCTION();
+ void Unlock() UNLOCK_FUNCTION();
+
+ bool TryLock() EXCLUSIVE_TRYLOCK_FUNCTION(true);
+ bool ReaderTryLock() SHARED_TRYLOCK_FUNCTION(true);
+
+ void AssertHeld() ASSERT_EXCLUSIVE_LOCK();
+ void AssertReaderHeld() ASSERT_SHARED_LOCK();
};
class UnlockableMu{
@@ -93,7 +103,7 @@ class Bar {
void noanal_fun() NO_THREAD_SAFETY_ANALYSIS;
void noanal_fun_args() __attribute__((no_thread_safety_analysis(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'no_thread_safety_analysis' attribute takes no arguments}}
int noanal_testfn(int y) NO_THREAD_SAFETY_ANALYSIS;
@@ -132,13 +142,13 @@ void noanal_fun_params(int lvar NO_THREAD_SAFETY_ANALYSIS); // \
int gv_var_noargs GUARDED_VAR;
int gv_var_args __attribute__((guarded_var(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'guarded_var' attribute takes no arguments}}
class GVFoo {
private:
int gv_field_noargs GUARDED_VAR;
int gv_field_args __attribute__((guarded_var(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'guarded_var' attribute takes no arguments}}
};
class GUARDED_VAR GV { // \
@@ -178,7 +188,7 @@ class PGVFoo {
int field_noargs PT_GUARDED_VAR; // \
// expected-warning {{'pt_guarded_var' only applies to pointer types; type here is 'int'}}
int *gv_field_args __attribute__((pt_guarded_var(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'pt_guarded_var' attribute takes no arguments}}
};
class PT_GUARDED_VAR PGV { // \
@@ -186,7 +196,7 @@ class PT_GUARDED_VAR PGV { // \
};
int *pgv_var_args __attribute__((pt_guarded_var(1))); // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'pt_guarded_var' attribute takes no arguments}}
void pgv_function() PT_GUARDED_VAR; // \
@@ -215,7 +225,7 @@ class LOCKABLE LTestClass {
};
class __attribute__((lockable (1))) LTestClass_args { // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'lockable' attribute takes no arguments}}
};
void l_test_function() LOCKABLE; // \
@@ -255,7 +265,7 @@ class SCOPED_LOCKABLE SLTestClass {
};
class __attribute__((scoped_lockable (1))) SLTestClass_args { // \
- // expected-error {{attribute takes no arguments}}
+ // expected-error {{'scoped_lockable' attribute takes no arguments}}
};
void sl_test_function() SCOPED_LOCKABLE; // \
@@ -297,16 +307,18 @@ void sl_function_params(int lvar SCOPED_LOCKABLE); // \
int gb_var_arg GUARDED_BY(mu1);
+int gb_non_ascii GUARDED_BY(L"wide"); // expected-warning {{ignoring 'guarded_by' attribute because its argument is invalid}}
+
int gb_var_args __attribute__((guarded_by(mu1, mu2))); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'guarded_by' attribute takes one argument}}
int gb_var_noargs __attribute__((guarded_by)); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'guarded_by' attribute takes one argument}}
class GBFoo {
private:
int gb_field_noargs __attribute__((guarded_by)); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'guarded_by' attribute takes one argument}}
int gb_field_args GUARDED_BY(mu1);
};
@@ -364,12 +376,12 @@ int gb_var_arg_bad_4 GUARDED_BY(umu); // \
//1. Check applied to the right types & argument number
int *pgb_var_noargs __attribute__((pt_guarded_by)); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'pt_guarded_by' attribute takes one argument}}
int *pgb_ptr_var_arg PT_GUARDED_BY(mu1);
int *pgb_ptr_var_args __attribute__((pt_guarded_by(mu1, mu2))); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'pt_guarded_by' attribute takes one argument}}
int pgb_var_args PT_GUARDED_BY(mu1); // \
// expected-warning {{'pt_guarded_by' only applies to pointer types; type here is 'int'}}
@@ -377,7 +389,7 @@ int pgb_var_args PT_GUARDED_BY(mu1); // \
class PGBFoo {
private:
int *pgb_field_noargs __attribute__((pt_guarded_by)); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'pt_guarded_by' attribute takes one argument}}
int *pgb_field_args PT_GUARDED_BY(mu1);
};
@@ -750,11 +762,11 @@ int etf_function_9() EXCLUSIVE_TRYLOCK_FUNCTION(true);
// illegal attribute arguments
int etf_function_bad_1() EXCLUSIVE_TRYLOCK_FUNCTION(mu1); // \
- // expected-error {{'exclusive_trylock_function' attribute first argument must be of int or bool type}}
+ // expected-error {{'exclusive_trylock_function' attribute requires parameter 1 to be int or bool}}
int etf_function_bad_2() EXCLUSIVE_TRYLOCK_FUNCTION("mu"); // \
- // expected-error {{'exclusive_trylock_function' attribute first argument must be of int or bool type}}
+ // expected-error {{'exclusive_trylock_function' attribute requires parameter 1 to be int or bool}}
int etf_function_bad_3() EXCLUSIVE_TRYLOCK_FUNCTION(muDoublePointer); // \
- // expected-error {{'exclusive_trylock_function' attribute first argument must be of int or bool type}}
+ // expected-error {{'exclusive_trylock_function' attribute requires parameter 1 to be int or bool}}
int etf_function_bad_4() EXCLUSIVE_TRYLOCK_FUNCTION(1, "mu"); // \
// expected-warning {{ignoring 'exclusive_trylock_function' attribute because its argument is invalid}}
@@ -824,11 +836,11 @@ int stf_function_9() SHARED_TRYLOCK_FUNCTION(true);
// illegal attribute arguments
int stf_function_bad_1() SHARED_TRYLOCK_FUNCTION(mu1); // \
- // expected-error {{'shared_trylock_function' attribute first argument must be of int or bool type}}
+ // expected-error {{'shared_trylock_function' attribute requires parameter 1 to be int or bool}}
int stf_function_bad_2() SHARED_TRYLOCK_FUNCTION("mu"); // \
- // expected-error {{'shared_trylock_function' attribute first argument must be of int or bool type}}
+ // expected-error {{'shared_trylock_function' attribute requires parameter 1 to be int or bool}}
int stf_function_bad_3() SHARED_TRYLOCK_FUNCTION(muDoublePointer); // \
- // expected-error {{'shared_trylock_function' attribute first argument must be of int or bool type}}
+ // expected-error {{'shared_trylock_function' attribute requires parameter 1 to be int or bool}}
int stf_function_bad_4() SHARED_TRYLOCK_FUNCTION(1, "mu"); // \
// expected-warning {{ignoring 'shared_trylock_function' attribute because its argument is invalid}}
@@ -921,12 +933,12 @@ int uf_function_bad_7() UNLOCK_FUNCTION(0); // \
// Takes exactly one argument, a var/field
void lr_function() __attribute__((lock_returned)); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'lock_returned' attribute takes one argument}}
void lr_function_arg() LOCK_RETURNED(mu1);
void lr_function_args() __attribute__((lock_returned(mu1, mu2))); // \
- // expected-error {{attribute takes one argument}}
+ // expected-error {{'lock_returned' attribute takes one argument}}
int lr_testfn(int y) LOCK_RETURNED(mu1);
diff --git a/test/SemaCXX/warn-unreachable.cpp b/test/SemaCXX/warn-unreachable.cpp
index f36300af4d38..dd071258e29d 100644
--- a/test/SemaCXX/warn-unreachable.cpp
+++ b/test/SemaCXX/warn-unreachable.cpp
@@ -62,8 +62,8 @@ void test5() {
struct S {
int mem;
} s;
- S &foor() __attribute__((noreturn));
- foor()
+ S &foonr() __attribute__((noreturn));
+ foonr()
.mem; // expected-warning {{will never be executed}}
}
diff --git a/test/SemaCXX/warn-unsequenced.cpp b/test/SemaCXX/warn-unsequenced.cpp
index c7acfca6db31..54e16a5e6d50 100644
--- a/test/SemaCXX/warn-unsequenced.cpp
+++ b/test/SemaCXX/warn-unsequenced.cpp
@@ -1,12 +1,13 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wno-unused %s
-int f(int, int);
+int f(int, int = 0);
struct A {
int x, y;
};
struct S {
S(int, int);
+ int n;
};
void test() {
@@ -32,6 +33,9 @@ void test() {
f(a = 0, a); // expected-warning {{unsequenced modification and access}}
f(a, a += 0); // expected-warning {{unsequenced modification and access}}
f(a = 0, a = 0); // expected-warning {{multiple unsequenced modifications}}
+ a = f(++a); // ok
+ a = f(a++); // ok
+ a = f(++a, a++); // expected-warning {{multiple unsequenced modifications}}
// Compound assignment "A OP= B" is equivalent to "A = A OP B" except that A
// is evaluated only once.
@@ -47,6 +51,12 @@ void test() {
S str2 = { a++, a++ }; // ok
S str3 = { a++ + a, a++ }; // expected-warning {{unsequenced modification and access}}
+ struct Z { A a; S s; } z = { { ++a, ++a }, { ++a, ++a } }; // ok
+ a = S { ++a, a++ }.n; // ok
+ A { ++a, a++ }.x; // ok
+ a = A { ++a, a++ }.x; // expected-warning {{unsequenced modifications}}
+ A { ++a, a++ }.x + A { ++a, a++ }.y; // expected-warning {{unsequenced modifications}}
+
(xs[2] && (a = 0)) + a; // ok
(0 && (a = 0)) + a; // ok
(1 && (a = 0)) + a; // expected-warning {{unsequenced modification and access}}
@@ -58,6 +68,8 @@ void test() {
(xs[4] ? a : ++a) + a; // ok
(0 ? a : ++a) + a; // expected-warning {{unsequenced modification and access}}
(1 ? a : ++a) + a; // ok
+ (0 ? a : a++) + a; // expected-warning {{unsequenced modification and access}}
+ (1 ? a : a++) + a; // ok
(xs[5] ? ++a : ++a) + a; // FIXME: warn here
(++a, xs[6] ? ++a : 0) + a; // expected-warning {{unsequenced modification and access}}
diff --git a/test/SemaCXX/warn-unused-attribute.cpp b/test/SemaCXX/warn-unused-attribute.cpp
new file mode 100644
index 000000000000..72f96eea0b31
--- /dev/null
+++ b/test/SemaCXX/warn-unused-attribute.cpp
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -verify %s
+struct __attribute__((warn_unused)) Test
+{
+ Test();
+ ~Test();
+ void use();
+};
+
+struct TestNormal
+{
+ TestNormal();
+};
+
+int main()
+{
+ Test unused; // expected-warning {{unused variable 'unused'}}
+ Test used;
+ TestNormal normal;
+ used.use();
+}
diff --git a/test/SemaCXX/warn-unused-filescoped.cpp b/test/SemaCXX/warn-unused-filescoped.cpp
index 9fb601130d3b..b0af5b332270 100644
--- a/test/SemaCXX/warn-unused-filescoped.cpp
+++ b/test/SemaCXX/warn-unused-filescoped.cpp
@@ -1,6 +1,41 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wunused -Wunused-member-function -Wno-c++11-extensions -std=c++98 %s
// RUN: %clang_cc1 -fsyntax-only -verify -Wunused -Wunused-member-function -std=c++11 %s
+#ifdef HEADER
+
+static void headerstatic() {} // expected-warning{{unused}}
+static inline void headerstaticinline() {}
+
+namespace {
+ void headeranon() {} // expected-warning{{unused}}
+ inline void headerinlineanon() {}
+}
+
+namespace test7
+{
+ template<typename T>
+ static inline void foo(T) { }
+
+ // This should not emit an unused-function warning since it inherits
+ // the static storage type from the base template.
+ template<>
+ inline void foo(int) { }
+
+ // Partial specialization
+ template<typename T, typename U>
+ static inline void bar(T, U) { }
+
+ template<typename U>
+ inline void bar(int, U) { }
+
+ template<>
+ inline void bar(int, int) { }
+};
+
+#else
+#define HEADER
+#include "warn-unused-filescoped.cpp"
+
static void f1(); // expected-warning{{unused}}
namespace {
@@ -37,8 +72,10 @@ namespace {
void S::m3() { } // expected-warning{{unused}}
-static inline void f4() { }
-const unsigned int cx = 0;
+static inline void f4() { } // expected-warning{{unused}}
+const unsigned int cx = 0; // expected-warning{{unused}}
+const unsigned int cy = 0;
+int f5() { return cy; }
static int x1; // expected-warning{{unused}}
@@ -98,7 +135,7 @@ namespace test5 {
// FIXME: We should produce warnings for both of these.
static const int m = n;
int x = sizeof(m);
- static const double d = 0.0;
+ static const double d = 0.0; // expected-warning{{not needed and will not be emitted}}
int y = sizeof(d);
}
@@ -133,27 +170,6 @@ namespace test6 {
};
}
-namespace test7
-{
- template<typename T>
- static inline void foo(T) { }
-
- // This should not emit an unused-function warning since it inherits
- // the static storage type from the base template.
- template<>
- inline void foo(int) { }
-
- // Partial specialization
- template<typename T, typename U>
- static inline void bar(T, U) { }
-
- template<typename U>
- inline void bar(int, U) { }
-
- template<>
- inline void bar(int, int) { }
-};
-
namespace pr14776 {
namespace {
struct X {};
@@ -161,3 +177,20 @@ namespace pr14776 {
X a = X(); // expected-warning {{unused variable 'a'}}
auto b = X(); // expected-warning {{unused variable 'b'}}
}
+
+namespace UndefinedInternalStaticMember {
+ namespace {
+ struct X {
+ static const unsigned x = 3;
+ int y[x];
+ };
+ }
+}
+
+namespace test8 {
+static void func();
+void bar() { void func() __attribute__((used)); }
+static void func() {}
+}
+
+#endif
diff --git a/test/SemaCXX/warn-unused-private-field.cpp b/test/SemaCXX/warn-unused-private-field.cpp
index 661442db9e9d..932a7dcea1da 100644
--- a/test/SemaCXX/warn-unused-private-field.cpp
+++ b/test/SemaCXX/warn-unused-private-field.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wunused-private-field -Wused-but-marked-unused -verify -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -Wunused-private-field -Wused-but-marked-unused -Wno-uninitialized -verify -std=c++11 %s
class NotFullyDefined {
public:
diff --git a/test/SemaCXX/warn-unused-result.cpp b/test/SemaCXX/warn-unused-result.cpp
index b0bf61f38180..581af09080db 100644
--- a/test/SemaCXX/warn-unused-result.cpp
+++ b/test/SemaCXX/warn-unused-result.cpp
@@ -78,3 +78,19 @@ void lazy() {
DoYetAnotherThing();
}
}
+
+namespace PR17587 {
+struct [[clang::warn_unused_result]] Status;
+
+struct Foo {
+ Status Bar();
+};
+
+struct Status {};
+
+void Bar() {
+ Foo f;
+ f.Bar(); // expected-warning {{ignoring return value}}
+};
+
+}
diff --git a/test/SemaCXX/warn-unused-value.cpp b/test/SemaCXX/warn-unused-value.cpp
index 072ee60f1f35..5e43d3ec0422 100644
--- a/test/SemaCXX/warn-unused-value.cpp
+++ b/test/SemaCXX/warn-unused-value.cpp
@@ -49,3 +49,23 @@ namespace test2 {
}
}
+namespace test3 {
+struct Used {
+ Used();
+ Used(int);
+ Used(int, int);
+};
+struct __attribute__((warn_unused)) Unused {
+ Unused();
+ Unused(int);
+ Unused(int, int);
+};
+void f() {
+ Used();
+ Used(1);
+ Used(1, 1);
+ Unused(); // expected-warning {{expression result unused}}
+ Unused(1); // expected-warning {{expression result unused}}
+ Unused(1, 1); // expected-warning {{expression result unused}}
+}
+}
diff --git a/test/SemaCXX/warn-unused-variables.cpp b/test/SemaCXX/warn-unused-variables.cpp
index 00597f929b25..93d2f6f9563b 100644
--- a/test/SemaCXX/warn-unused-variables.cpp
+++ b/test/SemaCXX/warn-unused-variables.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wunused-label -verify %s
template<typename T> void f() {
T t;
t = 17;
@@ -128,3 +128,26 @@ namespace ctor_with_cleanups {
}
#include "Inputs/warn-unused-variables.h"
+
+namespace PR8455 {
+ void f() {
+ A: // expected-warning {{unused label 'A'}}
+ __attribute__((unused)) int i; // attribute applies to variable
+ B: // attribute applies to label
+ __attribute__((unused)); int j; // expected-warning {{unused variable 'j'}}
+ }
+
+ void g() {
+ C: // unused label 'C' will not appear here because an error occurs
+ __attribute__((unused))
+ #pragma weak unused_local_static // expected-error {{expected ';' after __attribute__}}
+ ;
+ }
+
+ void h() {
+ D: // expected-warning {{unused label 'D'}}
+ #pragma weak unused_local_static
+ __attribute__((unused)) // expected-warning {{declaration does not declare anything}}
+ ;
+ }
+}
diff --git a/test/SemaCXX/warn-using-namespace-in-header.cpp b/test/SemaCXX/warn-using-namespace-in-header.cpp
index f68b99893aae..6b84e6e70a50 100644
--- a/test/SemaCXX/warn-using-namespace-in-header.cpp
+++ b/test/SemaCXX/warn-using-namespace-in-header.cpp
@@ -57,4 +57,13 @@ using namespace dont_warn;
// cc file.
USING_MACRO
+// Check behavior of line markers.
+namespace warn_header_with_line_marker {}
+# 1 "XXX.h" 1
+using namespace warn_header_with_line_marker; // expected-warning {{using namespace directive in global context in header}}
+# 70 "warn-using-namespace-in-header.cpp" 2
+
+namespace nowarn_after_line_marker {}
+using namespace nowarn_after_line_marker;
+
#endif
diff --git a/test/SemaCXX/writable-strings-deprecated.cpp b/test/SemaCXX/writable-strings-deprecated.cpp
index 829540149563..b8f605b63d66 100644
--- a/test/SemaCXX/writable-strings-deprecated.cpp
+++ b/test/SemaCXX/writable-strings-deprecated.cpp
@@ -1,11 +1,15 @@
// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-writable-strings -verify %s
// RUN: %clang_cc1 -fsyntax-only -fwritable-strings -verify %s
// RUN: %clang_cc1 -fsyntax-only -Wno-write-strings -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Werror=c++11-compat -verify %s -DERROR
// rdar://8827606
char *fun(void)
{
return "foo";
+#ifdef ERROR
+ // expected-error@-2 {{deprecated}}
+#endif
}
void test(bool b)
diff --git a/test/SemaObjC/arc-bridged-cast.m b/test/SemaObjC/arc-bridged-cast.m
index b5ec36af3838..439d3821165d 100644
--- a/test/SemaObjC/arc-bridged-cast.m
+++ b/test/SemaObjC/arc-bridged-cast.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
typedef const void *CFTypeRef;
CFTypeRef CFBridgingRetain(id X);
diff --git a/test/SemaObjC/arc-cf.m b/test/SemaObjC/arc-cf.m
index 57547208c6c5..d71d274dfb81 100644
--- a/test/SemaObjC/arc-cf.m
+++ b/test/SemaObjC/arc-cf.m
@@ -45,3 +45,15 @@ void test2() {
x = (id) CFMakeString3(); // expected-error {{requires a bridged cast}} expected-note {{CFBridgingRelease call to transfer}}
x = (id) CFCreateString3(); // expected-error {{requires a bridged cast}} expected-note {{CFBridgingRelease call to transfer}}
}
+
+// rdar://14569171
+@interface NSString @end
+typedef signed int SInt32;
+#pragma clang arc_cf_code_audited begin
+extern SInt32 CFStringGetIntValue(CFStringRef str); // expected-note {{passing argument to parameter 'str' here}}
+#pragma clang arc_cf_code_audited end
+
+void test3() {
+ NSString* answer = @"42";
+ int ans = CFStringGetIntValue(answer); // expected-error {{incompatible pointer types passing retainable parameter of type 'NSString *__strong'to a CF function expecting 'CFStringRef'}}
+}
diff --git a/test/SemaObjC/arc-decls.m b/test/SemaObjC/arc-decls.m
index cdf6cc64ff2d..903cea2a0e8a 100644
--- a/test/SemaObjC/arc-decls.m
+++ b/test/SemaObjC/arc-decls.m
@@ -99,3 +99,27 @@ void test7(void) {
I *y;
J **py = &y; // expected-error {{pointer to non-const type 'J *' with no explicit ownership}} expected-warning {{incompatible pointer types initializing}}
}
+
+void func(void) __attribute__((objc_ownership(none))); // expected-warning {{'objc_ownership' only applies to Objective-C object or block pointer types; type here is 'void (void)'}}
+struct __attribute__((objc_ownership(none))) S2 {}; // expected-error {{'objc_ownership' attribute only applies to variables}}
+@interface I2
+ @property __attribute__((objc_ownership(frob))) id i; // expected-warning {{'objc_ownership' attribute argument not supported: 'frob'}}
+@end
+
+// rdar://15304886
+@interface NSObject @end
+
+@interface ControllerClass : NSObject @end
+
+@interface SomeClassOwnedByController
+@property (readonly) ControllerClass *controller; // expected-note {{property declared here}}
+
+// rdar://15465916
+@property (readonly, weak) ControllerClass *weak_controller;
+@end
+
+@interface SomeClassOwnedByController ()
+@property (readwrite, weak) ControllerClass *controller; // expected-warning {{primary property declaration is implicitly strong while redeclaration in class extension is weak}}
+
+@property (readwrite, weak) ControllerClass *weak_controller;
+@end
diff --git a/test/SemaObjC/arc-dict-bridged-cast.m b/test/SemaObjC/arc-dict-bridged-cast.m
index ea648401af0c..e00c47fca393 100644
--- a/test/SemaObjC/arc-dict-bridged-cast.m
+++ b/test/SemaObjC/arc-dict-bridged-cast.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
// rdar://11913153
typedef const struct __CFString * CFStringRef;
diff --git a/test/SemaObjC/arc-property-lifetime.m b/test/SemaObjC/arc-property-lifetime.m
index b824b2a4565c..ed72e8c7d811 100644
--- a/test/SemaObjC/arc-property-lifetime.m
+++ b/test/SemaObjC/arc-property-lifetime.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-default-synthesize-properties -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -verify -Wno-objc-root-class %s
// rdar://9340606
@interface Foo {
@@ -171,7 +171,12 @@ void foo(Baz *f) {
// rdar://11253688
@interface Boom
-@property (readonly) const void * innerPointer __attribute__((objc_returns_inner_pointer)); // expected-error {{'objc_returns_inner_pointer' attribute only applies to methods}}
+{
+ const void * innerPointerIvar __attribute__((objc_returns_inner_pointer)); // expected-error {{'objc_returns_inner_pointer' attribute only applies to methods and properties}}
+}
+@property (readonly) Boom * NotInnerPointer __attribute__((objc_returns_inner_pointer)); // expected-warning {{'objc_returns_inner_pointer' attribute only applies to properties that return a non-retainable pointer}}
+- (Boom *) NotInnerPointerMethod __attribute__((objc_returns_inner_pointer)); // expected-warning {{'objc_returns_inner_pointer' attribute only applies to methods that return a non-retainable pointer}}
+@property (readonly) const void * innerPointer __attribute__((objc_returns_inner_pointer));
@end
@interface Foo2 {
@@ -182,3 +187,26 @@ void foo(Baz *f) {
@implementation Foo2
@end
+
+// rdar://13885083
+@interface NSObject
+-(id)init;
+@end
+
+typedef char BOOL;
+@interface Test13885083 : NSObject
+
+@property (nonatomic, assign) BOOL retain; // expected-error {{ARC forbids synthesis of 'retain'}}
+
+-(id)init;
+
+@end
+
+@implementation Test13885083
+-(id) init
+{
+ self = [super init];
+ return self;
+}
+@end
+
diff --git a/test/SemaObjC/arc-readonly-property-ivar-1.m b/test/SemaObjC/arc-readonly-property-ivar-1.m
index 418f90d38a8b..2b98f01e914f 100644
--- a/test/SemaObjC/arc-readonly-property-ivar-1.m
+++ b/test/SemaObjC/arc-readonly-property-ivar-1.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fobjc-default-synthesize-properties -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
-// RUN: %clang_cc1 -x objective-c++ -fobjc-default-synthesize-properties -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
// expected-no-diagnostics
// rdar:// 10558871
diff --git a/test/SemaObjC/arc-repeated-weak.mm b/test/SemaObjC/arc-repeated-weak.mm
index b5d9002130d2..64df92a9afa9 100644
--- a/test/SemaObjC/arc-repeated-weak.mm
+++ b/test/SemaObjC/arc-repeated-weak.mm
@@ -410,3 +410,18 @@ void doubleLevelAccessIvar(Test *a, Test *b) {
use(a.strongProp.weakProp); // no-warning
}
+// rdar://13942025
+@interface X
+@end
+
+@implementation X
+- (int) warningAboutWeakVariableInsideTypeof {
+ __typeof__(self) __weak weakSelf = self;
+ ^(){
+ __typeof__(weakSelf) blockSelf = weakSelf;
+ use(blockSelf);
+ }();
+ return sizeof(weakSelf);
+}
+@end
+
diff --git a/test/SemaObjC/arc-unavailable-for-weakref.m b/test/SemaObjC/arc-unavailable-for-weakref.m
index b9b5cc516dea..eab5f2ca746e 100644
--- a/test/SemaObjC/arc-unavailable-for-weakref.m
+++ b/test/SemaObjC/arc-unavailable-for-weakref.m
@@ -86,3 +86,7 @@ __attribute__((objc_arc_weak_reference_unavailable))
@implementation I2 // expected-note {{when implemented by class I2}}
@synthesize font = _font;
@end
+
+__attribute__((objc_arc_weak_reference_unavailable(1))) // expected-error {{'objc_arc_weak_reference_unavailable' attribute takes no arguments}}
+@interface I3
+@end
diff --git a/test/SemaObjC/arc.m b/test/SemaObjC/arc.m
index 1d4e42de649d..060af24fa0d9 100644
--- a/test/SemaObjC/arc.m
+++ b/test/SemaObjC/arc.m
@@ -84,14 +84,19 @@ void test1(A *a) {
// rdar://8861761
@interface B
--(id)alloc;
++ (id)alloc;
- (id)initWithInt: (int) i;
+- (id)myInit __attribute__((objc_method_family(init)));
+- (id)myBadInit __attribute__((objc_method_family(12))); // expected-error {{'objc_method_family' attribute requires parameter 1 to be an identifier}}
+
@end
void rdar8861761() {
B *o1 = [[B alloc] initWithInt:0];
B *o2 = [B alloc];
[o2 initWithInt:0]; // expected-warning {{expression result unused}}
+ B *o3 = [[B alloc] myInit];
+ [[B alloc] myInit]; // expected-warning {{expression result unused}}
}
// rdar://8925835
@@ -411,7 +416,7 @@ void test17(void) {
void test18(void) {
id x;
- [x test18]; // expected-error {{no known instance method for selector 'test18'}}
+ [x test18]; // expected-error {{instance method 'test18' not found ; did you mean 'test17'?}}
}
extern struct Test19 *test19a;
@@ -767,3 +772,13 @@ void test(NSArray *x) {
__strong NSMutableArray *y1 = x; // expected-warning {{incompatible pointer types initializing 'NSMutableArray *' with an expression of type 'NSArray *'}}
PSNS y2 = x; // expected-warning {{incompatible pointer types initializing 'NSMutableArray *' with an expression of type 'NSArray *'}}
}
+
+// rdar://15123684
+@class NSString;
+
+void foo(NSArray *array) {
+ for (NSString *string in array) {
+ for (string in @[@"blah", @"more blah", string]) { // expected-error {{selector element of type 'NSString *const __strong' cannot be a constant l-value}}
+ }
+ }
+}
diff --git a/test/SemaObjC/attr-objc-exception.m b/test/SemaObjC/attr-objc-exception.m
index b497271521e2..dd8ac573deed 100644
--- a/test/SemaObjC/attr-objc-exception.m
+++ b/test/SemaObjC/attr-objc-exception.m
@@ -8,9 +8,9 @@ __attribute__((__objc_exception__))
@end
-__attribute__((__objc_exception__)) // expected-error {{attribute may only be applied to an Objective-C interface}}
+__attribute__((__objc_exception__)) // expected-error {{'__objc_exception__' attribute only applies to Objective-C interfaces}}
int X;
-__attribute__((__objc_exception__)) // expected-error {{attribute may only be applied to an Objective-C interface}}
+__attribute__((__objc_exception__)) // expected-error {{'__objc_exception__' attribute only applies to Objective-C interfaces}}
void foo();
diff --git a/test/SemaObjC/attr-objc-gc.m b/test/SemaObjC/attr-objc-gc.m
index 9ca12c9315a1..827945c668cb 100644
--- a/test/SemaObjC/attr-objc-gc.m
+++ b/test/SemaObjC/attr-objc-gc.m
@@ -2,9 +2,9 @@
static id __attribute((objc_gc(weak))) a;
static id __attribute((objc_gc(strong))) b;
-static id __attribute((objc_gc())) c; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}}
-static id __attribute((objc_gc(123))) d; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}}
-static id __attribute((objc_gc(foo, 456))) e; // expected-error{{attribute takes one argument}}
+static id __attribute((objc_gc())) c; // expected-error{{'objc_gc' attribute requires a string}}
+static id __attribute((objc_gc(123))) d; // expected-error{{'objc_gc' attribute requires a string}}
+static id __attribute((objc_gc(foo, 456))) e; // expected-error{{'objc_gc' attribute takes one argument}}
static id __attribute((objc_gc(hello))) f; // expected-warning{{'objc_gc' attribute argument not supported: 'hello'}}
static int __attribute__((objc_gc(weak))) g; // expected-warning {{'objc_gc' only applies to pointer types; type here is 'int'}}
diff --git a/test/SemaObjC/attr-print.m b/test/SemaObjC/attr-print.m
new file mode 100644
index 000000000000..e3405d239e36
--- /dev/null
+++ b/test/SemaObjC/attr-print.m
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -fobjc-arc -ast-print | FileCheck %s
+
+__strong id x;
+id y;
+__strong id z;
+
+// CHECK: __strong id x;
+// CHECK-NOT: __strong id y;
+// CHECK: __strong id z;
diff --git a/test/SemaObjC/attr-root-class.m b/test/SemaObjC/attr-root-class.m
index 195cd663acda..6be1c09d4dc7 100644
--- a/test/SemaObjC/attr-root-class.m
+++ b/test/SemaObjC/attr-root-class.m
@@ -11,6 +11,10 @@ __attribute__((objc_root_class))
@implementation NonRootClass
@end
-__attribute__((objc_root_class)) static void nonClassDeclaration() // expected-error {{attribute may only be applied to an Objective-C interface}}
+__attribute__((objc_root_class)) static void nonClassDeclaration() // expected-error {{'objc_root_class' attribute only applies to Objective-C interfaces}}
{
}
+
+__attribute__((objc_root_class(1))) // expected-error {{'objc_root_class' attribute takes no arguments}}
+@interface I1
+@end
diff --git a/test/SemaObjC/bad-property-synthesis-crash.m b/test/SemaObjC/bad-property-synthesis-crash.m
index ea4e0045dc4b..94c680489d91 100644
--- a/test/SemaObjC/bad-property-synthesis-crash.m
+++ b/test/SemaObjC/bad-property-synthesis-crash.m
@@ -13,7 +13,7 @@
__what; // expected-error {{use of undeclared identifier}} \
// expected-warning {{expression result unused}}
}
-@synthesize what; // expected-note 2 {{'what' declared here}}
+@synthesize what; // expected-note {{'what' declared here}}
@end
@implementation Bar // expected-warning {{cannot find interface declaration for}}
diff --git a/test/SemaObjC/blocks.m b/test/SemaObjC/blocks.m
index b523e4c91635..d6681d051de1 100644
--- a/test/SemaObjC/blocks.m
+++ b/test/SemaObjC/blocks.m
@@ -86,9 +86,11 @@ typedef enum CStyleEnum (^cse_block_t)();
void testCStyleEnumInference(bool arg) {
cse_block_t a;
+ enum CStyleEnum value;
// No warnings here.
a = ^{ return getCSE(); };
+ a = ^{ return value; };
a = ^{ // expected-error {{incompatible block pointer types assigning to 'cse_block_t' (aka 'enum CStyleEnum (^)()') from 'int (^)(void)'}}
return 1;
@@ -102,6 +104,7 @@ void testCStyleEnumInference(bool arg) {
// No warnings here.
a = ^{ if (arg) return CSE_Value; else return getCSE(); };
a = ^{ if (arg) return getCSE(); else return CSE_Value; };
+ a = ^{ if (arg) return value; else return CSE_Value; };
// These two blocks actually return 'int'
a = ^{ // expected-error {{incompatible block pointer types assigning to 'cse_block_t' (aka 'enum CStyleEnum (^)()') from 'int (^)(void)'}}
@@ -118,6 +121,13 @@ void testCStyleEnumInference(bool arg) {
return 1;
};
+ a = ^{ // expected-error {{incompatible block pointer types assigning to 'cse_block_t' (aka 'enum CStyleEnum (^)()') from 'int (^)(void)'}}
+ if (arg)
+ return 1;
+ else
+ return value; // expected-error {{return type 'enum CStyleEnum' must match previous return type 'int'}}
+ };
+
// rdar://13200889
extern void check_enum(void);
a = ^{
@@ -206,3 +216,8 @@ void testAnonymousEnumTypes(int arg) {
SB = ^{ if (arg) return TDFTE_Value; else return getTDFTE(); };
SB = ^{ if (arg) return getTDFTE(); else return TDFTE_Value; };
}
+
+static inline void inlinefunc() {
+ ^{}();
+}
+void inlinefunccaller() { inlinefunc(); }
diff --git a/test/SemaObjC/call-super-2.m b/test/SemaObjC/call-super-2.m
index 3c45a2c73238..8927f3b52864 100644
--- a/test/SemaObjC/call-super-2.m
+++ b/test/SemaObjC/call-super-2.m
@@ -14,7 +14,7 @@ id objc_getClass(const char *s);
- (int) instance_func0;
@end
-@interface Derived: Object
+@interface Derived: Object // expected-note {{receiver is instance of class declared here}}
+ (int) class_func1;
+ (int) class_func2;
+ (int) class_func3;
@@ -35,7 +35,7 @@ id objc_getClass(const char *s);
@implementation Derived
+ (int) class_func1
{
- int i = (size_t)[self class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id')}}
+ int i = (size_t)[self class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id'); did you mean '+class_func}}
return i + (size_t)[super class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id')}}
}
+ (int) class_func2
@@ -68,7 +68,7 @@ id objc_getClass(const char *s);
}
- (int) instance_func1
{
- int i = (size_t)[self instance_func0]; // expected-warning {{instance method '-instance_func0' not found (return type defaults to 'id')}}
+ int i = (size_t)[self instance_func0]; // expected-warning {{instance method '-instance_func0' not found (return type defaults to 'id'); did you mean}}
return i + (size_t)[super instance_func0]; // expected-warning {{'Object' may not respond to 'instance_func0'}}
}
- (int) instance_func2
diff --git a/test/SemaObjC/class-def-test-1.m b/test/SemaObjC/class-def-test-1.m
index 0d114b99fb6d..7931cc3fdce4 100644
--- a/test/SemaObjC/class-def-test-1.m
+++ b/test/SemaObjC/class-def-test-1.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
@protocol SUPER;
@@ -16,9 +16,10 @@ typedef int INTF; // expected-note {{previous definition is here}}
typedef int OBJECT; // expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
-typedef int OBJECT2; // expected-note {{previous definition is here}}
+typedef int OBJECT2; // expected-note 2 {{previous definition is here}}
@interface INTF2 : OBJECT2 @end // expected-error {{redefinition of 'OBJECT2' as different kind of symbol}}
+@implementation INTF2 : OBJECT2 @end // expected-error {{redefinition of 'OBJECT2' as different kind of symbol}}
@protocol PROTO;
diff --git a/test/SemaObjC/compare-qualified-id.m b/test/SemaObjC/compare-qualified-id.m
index 82868f8a1613..02fa86ec8d9e 100644
--- a/test/SemaObjC/compare-qualified-id.m
+++ b/test/SemaObjC/compare-qualified-id.m
@@ -12,7 +12,7 @@ typedef struct _NSZone NSZone;
typedef struct {} NSFastEnumerationState;
@protocol NSFastEnumeration - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; @end
@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration> - (NSUInteger)count; @end
-@interface NSMutableDictionary : NSDictionary - (void)removeObjectForKey:(id)aKey; @end
+@interface NSMutableDictionary : NSDictionary - (void)removeObjectForKey:(id)aKey; @end // expected-note {{receiver is instance of class declared here}}
extern NSString * const NSTaskDidTerminateNotification;
@interface XCPropertyExpansionContext : NSObject <NSCopying> { // expected-note {{required for direct or indirect protocol 'NSCopying'}}
diff --git a/test/SemaObjC/conditional-expr.m b/test/SemaObjC/conditional-expr.m
index ec1305dbe8b3..049a095ce37c 100644
--- a/test/SemaObjC/conditional-expr.m
+++ b/test/SemaObjC/conditional-expr.m
@@ -33,7 +33,8 @@
@end
// No @interface declaration for DTFilterOutputStream3
-@implementation DTFilterOutputStream3 // expected-warning {{cannot find interface declaration for 'DTFilterOutputStream3'}}
+@implementation DTFilterOutputStream3 // expected-warning {{cannot find interface declaration for 'DTFilterOutputStream3'}} \
+ // expected-note {{receiver is instance of class declared here}}
- (id)initWithNextOutputStream:(id <DTOutputStreams>) outputStream {
id <DTOutputStreams> nextOutputStream = [self nextOutputStream]; // expected-warning {{method '-nextOutputStream' not found (return type defaults to 'id')}}
self = nextOutputStream; // expected-warning {{assigning to 'DTFilterOutputStream3 *' from incompatible type 'id<DTOutputStreams>'}}
diff --git a/test/SemaObjC/conversion.m b/test/SemaObjC/conversion.m
new file mode 100644
index 000000000000..88a1a44b2177
--- /dev/null
+++ b/test/SemaObjC/conversion.m
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -Wconversion -fsyntax-only %s -verify
+
+typedef signed char BOOL;
+__attribute__((objc_root_class)) @interface RDar14415662
+@property (readonly) BOOL stuff;
+@property (readwrite) BOOL otherStuff;
+@end
+
+void radar14415662(RDar14415662 *f, char x, int y) {
+ f.otherStuff = !f.stuff; // no-warning
+ BOOL b = !f.stuff; // no-warning
+
+ // True positive to sanity check warning is working.
+ x = y; // expected-warning {{implicit conversion loses integer precision: 'int' to 'char'}}
+}
+
+
diff --git a/test/SemaObjC/dealloc.m b/test/SemaObjC/dealloc.m
index feafafd3753f..59218d2d0733 100644
--- a/test/SemaObjC/dealloc.m
+++ b/test/SemaObjC/dealloc.m
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
// rdar://11987838
@protocol NSObject
diff --git a/test/SemaObjC/default-synthesize-1.m b/test/SemaObjC/default-synthesize-1.m
index 5aaca9a1c291..f9f2e72eaf94 100644
--- a/test/SemaObjC/default-synthesize-1.m
+++ b/test/SemaObjC/default-synthesize-1.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -Wobjc-missing-property-synthesis -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -Wobjc-missing-property-synthesis -verify -Wno-objc-root-class %s
// rdar://11295716
@interface NSObject
diff --git a/test/SemaObjC/default-synthesize-2.m b/test/SemaObjC/default-synthesize-2.m
index 20c045e60e06..1980b91dbe98 100644
--- a/test/SemaObjC/default-synthesize-2.m
+++ b/test/SemaObjC/default-synthesize-2.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -x objective-c -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
-// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -x objective-c -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
// rdar://8843851
@interface StopAccessingIvarsDirectlyExample
diff --git a/test/SemaObjC/default-synthesize-3.m b/test/SemaObjC/default-synthesize-3.m
index 82f968da0009..1c32665a2dd7 100644
--- a/test/SemaObjC/default-synthesize-3.m
+++ b/test/SemaObjC/default-synthesize-3.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -x objective-c -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
-// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -x objective-c -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
#if __has_attribute(objc_requires_property_definitions)
__attribute ((objc_requires_property_definitions))
@@ -111,3 +111,73 @@ __attribute ((objc_requires_property_definitions)) // expected-error {{objc_requ
@implementation S
@end
+
+// rdar://14085456
+// No warning must be issued in this test.
+@interface ParentObject
+@end
+
+@protocol TestObject
+@property (readonly) int six;
+@end
+
+@interface TestObject : ParentObject <TestObject>
+@property int six;
+@end
+
+@implementation TestObject
+@synthesize six;
+@end
+
+// rdar://14094682
+// no warning in this test
+@interface ISAChallenge : NSObject {
+}
+
+@property (assign, readonly) int failureCount;
+@end
+
+@interface ISSAChallenge : ISAChallenge {
+ int _failureCount;
+}
+@property (assign, readwrite) int failureCount;
+@end
+
+@implementation ISAChallenge
+- (int)failureCount {
+ return 0;
+}
+@end
+
+@implementation ISSAChallenge
+
+@synthesize failureCount = _failureCount;
+@end
+
+__attribute ((objc_requires_property_definitions(1))) // expected-error {{'objc_requires_property_definitions' attribute takes no arguments}}
+@interface I1
+@end
+
+// rdar://15051465
+@protocol SubFooling
+ @property(nonatomic, readonly) id hoho; // expected-note 2 {{property declared here}}
+@end
+
+@protocol Fooing<SubFooling>
+ @property(nonatomic, readonly) id muahahaha; // expected-note 2 {{property declared here}}
+@end
+
+typedef NSObject<Fooing> FooObject;
+
+@interface Okay : NSObject<Fooing>
+@end
+
+@implementation Okay // expected-warning 2 {{auto property synthesis will not synthesize property declared in a protocol}}
+@end
+
+@interface Fail : FooObject
+@end
+
+@implementation Fail // expected-warning 2 {{auto property synthesis will not synthesize property declared in a protocol}}
+@end
+
diff --git a/test/SemaObjC/default-synthesize.m b/test/SemaObjC/default-synthesize.m
index e6ea0a5eafb3..dd16c1361d89 100644
--- a/test/SemaObjC/default-synthesize.m
+++ b/test/SemaObjC/default-synthesize.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
@interface NSString @end
diff --git a/test/SemaObjC/deprecated-objc-introspection.m b/test/SemaObjC/deprecated-objc-introspection.m
index faaef254d596..4f7484145865 100644
--- a/test/SemaObjC/deprecated-objc-introspection.m
+++ b/test/SemaObjC/deprecated-objc-introspection.m
@@ -14,9 +14,11 @@ typedef struct objc_object {
id firstobj;
struct objc_class *isa;
}
+- (id)performSelector:(SEL)aSelector;;
@end
@interface Whatever : NSObject
+self;
+-(id)foo;
@end
static void func() {
@@ -94,4 +96,9 @@ void testBitmasking(NSObject *p) {
(void) (0x1 & ((NSUInteger) p)); // expected-warning {{bitmasking for introspection of Objective-C object pointers is strongly discouraged}}
(void) (((NSUInteger) p) ^ 0x1); // no-warning
(void) (0x1 ^ ((NSUInteger) p)); // no-warning
+ (void) (0x1 & ((NSUInteger) [p performSelector:@selector(foo)])); // expected-warning {{bitmasking for introspection of Objective-C object pointers is strongly discouraged}}
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-objc-pointer-introspection-performSelector"
+ (void) (0x1 & ((NSUInteger) [p performSelector:@selector(foo)])); // no-warning
+#pragma clang diagnostic pop
} \ No newline at end of file
diff --git a/test/SemaObjC/direct-synthesized-ivar-access.m b/test/SemaObjC/direct-synthesized-ivar-access.m
index a276a64913b3..7ec333723b66 100644
--- a/test/SemaObjC/direct-synthesized-ivar-access.m
+++ b/test/SemaObjC/direct-synthesized-ivar-access.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
// expected-no-diagnostics
// rdar://8673791
// rdar://9943851
diff --git a/test/SemaObjC/error-outof-scope-property-use.m b/test/SemaObjC/error-outof-scope-property-use.m
index c69a4055df21..c480e2df0b7e 100644
--- a/test/SemaObjC/error-outof-scope-property-use.m
+++ b/test/SemaObjC/error-outof-scope-property-use.m
@@ -1,12 +1,12 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
-// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
// rdar://13178483
-@class NSMutableDictionary;
+@class NSMutableDictionary; // expected-note {{receiver is instance of class declared here}}
@interface LaunchdJobs
-@property (nonatomic,retain) NSMutableDictionary *uuids_jobs; // expected-note 2 {{'_uuids_jobs' declared here}}
+@property (nonatomic,retain) NSMutableDictionary *uuids_jobs; // expected-note {{'_uuids_jobs' declared here}}
@end
diff --git a/test/SemaObjC/foreach.m b/test/SemaObjC/foreach.m
index d0e0f7b9e214..91ea2ec4e0d4 100644
--- a/test/SemaObjC/foreach.m
+++ b/test/SemaObjC/foreach.m
@@ -13,8 +13,8 @@ void f(NSArray *a) {
* and no diagnostics even in pedantic mode should happen.
* rdar://6814674
*/
- for (id thisKey in keys);
- for (id thisKey in keys);
+ for (id thisKey in keys); /* expected-warning {{unused variable 'thisKey'}} */
+ for (id thisKey in keys); /* expected-warning {{unused variable 'thisKey'}} */
}
/* // rdar://9072298 */
@@ -41,7 +41,7 @@ typedef struct {
int main ()
{
NSObject<NSFastEnumeration>* collection = ((void*)0);
- for (id thing in collection) { }
+ for (id thing in collection) { } /* expected-warning {{unused variable 'thing'}} */
return 0;
}
diff --git a/test/SemaObjC/format-arg-attribute.m b/test/SemaObjC/format-arg-attribute.m
index dede433f37a2..e770373a055b 100644
--- a/test/SemaObjC/format-arg-attribute.m
+++ b/test/SemaObjC/format-arg-attribute.m
@@ -1,17 +1,17 @@
-// RUN: %clang_cc1 -verify -fsyntax-only %s
+// RUN: %clang_cc1 -Werror -Wformat-nonliteral -verify -fsyntax-only %s
@class NSString;
extern NSString *fa2 (const NSString *) __attribute__((format_arg(1)));
extern NSString *fa3 (NSString *) __attribute__((format_arg(1)));
-extern void fc1 (const NSString *) __attribute__((format_arg)); // expected-error {{attribute takes one argument}}
-extern void fc2 (const NSString *) __attribute__((format_arg())); // expected-error {{attribute takes one argument}}
-extern void fc3 (const NSString *) __attribute__((format_arg(1, 2))); // expected-error {{attribute takes one argument}}
+extern void fc1 (const NSString *) __attribute__((format_arg)); // expected-error {{'format_arg' attribute takes one argument}}
+extern void fc2 (const NSString *) __attribute__((format_arg())); // expected-error {{'format_arg' attribute takes one argument}}
+extern void fc3 (const NSString *) __attribute__((format_arg(1, 2))); // expected-error {{'format_arg' attribute takes one argument}}
-struct s1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to functions}}
-union u1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to functions}}
-enum e1 { E1V0 } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to functions}}
+struct s1 { int i; } __attribute__((format_arg(1))); // expected-error {{'format_arg' attribute only applies to functions}}
+union u1 { int i; } __attribute__((format_arg(1))); // expected-error {{'format_arg' attribute only applies to functions}}
+enum e1 { E1V0 } __attribute__((format_arg(1))); // expected-error {{'format_arg' attribute only applies to functions}}
extern NSString *ff3 (const NSString *) __attribute__((format_arg(3-2)));
extern NSString *ff4 (const NSString *) __attribute__((format_arg(foo))); // expected-error {{use of undeclared identifier 'foo'}}
@@ -25,3 +25,23 @@ extern NSString *fi2 (NSString *) __attribute__((format_arg(1)));
extern int fi3 (const NSString *) __attribute__((format_arg(1))); // expected-error {{function does not return NSString}}
extern NSString *fi4 (const NSString *) __attribute__((format_arg(1)));
extern NSString *fi5 (const NSString *) __attribute__((format_arg(1)));
+
+// rdar://15242010
+@interface NSString
++ (id)stringWithFormat:(NSString *)format, ... __attribute__((format(__NSString__, 1, 2)));
+@end
+
+@interface NSBundle
+- (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)value table:(NSString *)tableName __attribute__ ((format_arg(1)));
++ (NSBundle *)mainBundle;
+@end
+
+
+NSString* localizedFormat(NSString* string) __attribute__ ((format_arg(1)));
+
+int main()
+{
+ [NSString stringWithFormat:[[NSBundle mainBundle] localizedStringForKey:@"foo %d" value:@"bar %d" table:0], 42];
+
+ [NSString stringWithFormat:localizedFormat(@"foo %d"), 42];
+}
diff --git a/test/SemaObjC/format-strings-objc.m b/test/SemaObjC/format-strings-objc.m
index 849013022433..2667e3047aae 100644
--- a/test/SemaObjC/format-strings-objc.m
+++ b/test/SemaObjC/format-strings-objc.m
@@ -232,6 +232,8 @@ void testInvalidFormatArgument(NSDictionary *dict) {
// <rdar://problem/11825593>
void testByValueObjectInFormat(Foo *obj) {
printf("%d %d %d", 1L, *obj, 1L); // expected-error {{cannot pass object with interface type 'Foo' by value to variadic function; expected type from format string was 'int'}} expected-warning 2 {{format specifies type 'int' but the argument has type 'long'}}
+ printf("%!", *obj); // expected-error {{cannot pass object with interface type 'Foo' by value through variadic function}} expected-warning {{invalid conversion specifier}}
+ printf(0, *obj); // expected-error {{cannot pass object with interface type 'Foo' by value through variadic function}}
[Bar log2:@"%d", *obj]; // expected-error {{cannot pass object with interface type 'Foo' by value to variadic method; expected type from format string was 'int'}}
}
@@ -241,3 +243,8 @@ void testTypeOf(NSInteger dW, NSInteger dH) {
NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
}
+void testUnicode() {
+ NSLog(@"%C", 0x2022); // no-warning
+ NSLog(@"%C", 0x202200); // expected-warning{{format specifies type 'unichar' (aka 'unsigned short') but the argument has type 'int'}}
+}
+
diff --git a/test/SemaObjC/forward-protocol-incomplete-impl-warn.m b/test/SemaObjC/forward-protocol-incomplete-impl-warn.m
index 01fedec3cffe..c3efeba4f9ec 100644
--- a/test/SemaObjC/forward-protocol-incomplete-impl-warn.m
+++ b/test/SemaObjC/forward-protocol-incomplete-impl-warn.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-default-synthesize-properties %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
// rdar://12958878
@interface NSObject @end
diff --git a/test/SemaObjC/iboutlet.m b/test/SemaObjC/iboutlet.m
index 01e1bfc13bea..3c7f9581e663 100644
--- a/test/SemaObjC/iboutlet.m
+++ b/test/SemaObjC/iboutlet.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -Wno-objc-root-class -verify %s
-// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -Wno-objc-root-class -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-objc-root-class -verify %s
+// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -Wno-objc-root-class -verify %s
// rdar://11448209
#define READONLY readonly
diff --git a/test/SemaObjC/iboutletcollection-attr.m b/test/SemaObjC/iboutletcollection-attr.m
index 82cb96fbede7..f088ca32b6ad 100644
--- a/test/SemaObjC/iboutletcollection-attr.m
+++ b/test/SemaObjC/iboutletcollection-attr.m
@@ -18,15 +18,15 @@
typedef void *PV;
@interface BAD {
- __attribute__((iboutletcollection(I, 1))) id ivar1; // expected-error {{attribute takes one argument}}
- __attribute__((iboutletcollection(B))) id ivar2; // expected-error {{invalid type 'B' as argument of iboutletcollection attribute}}
- __attribute__((iboutletcollection(PV))) id ivar3; // expected-error {{invalid type 'PV' as argument of iboutletcollection attribute}}
+ __attribute__((iboutletcollection(I, 1))) id ivar1; // expected-error {{expected ')'}} expected-note {{to match}}
+ __attribute__((iboutletcollection(B))) id ivar2; // expected-error {{unknown type name 'B'}}
+ __attribute__((iboutletcollection(PV))) id ivar3; // expected-error {{invalid type 'PV' (aka 'void *') as argument of iboutletcollection attribute}}
__attribute__((iboutletcollection(PV))) void *ivar4; // expected-warning {{instance variable with 'iboutletcollection' attribute must be an object type (invalid 'void *')}}
__attribute__((iboutletcollection(int))) id ivar5; // expected-error {{type argument of iboutletcollection attribute cannot be a builtin type}}
__attribute__((iboutlet)) int ivar6; // expected-warning {{instance variable with 'iboutlet' attribute must be an object type}}
}
-@property (nonatomic, retain) __attribute__((iboutletcollection(I,2,3))) id prop1; // expected-error {{attribute takes one argument}}
-@property (nonatomic, retain) __attribute__((iboutletcollection(B))) id prop2; // expected-error {{invalid type 'B' as argument of iboutletcollection attribute}}
+@property (nonatomic, retain) __attribute__((iboutletcollection(I,2,3))) id prop1; // expected-error {{expected ')'}} expected-note {{to match}}
+@property (nonatomic, retain) __attribute__((iboutletcollection(B))) id prop2; // expected-error {{unknown type name 'B'}}
@property __attribute__((iboutletcollection(BAD))) int prop3; // expected-warning {{property with 'iboutletcollection' attribute must be an object type (invalid 'int')}}
@end
@@ -41,3 +41,10 @@ typedef void *PV;
@property (nonatomic, strong)
__attribute__((iboutletcollection(RDar10296078_OtherClass<RDar10296078_Protocol>))) NSArray *stuff;
@end
+
+// rdar://14212998
+@class UILabel;
+@class NSArray;
+@interface OCTViewController
+@property (nonatomic, assign) __attribute__((iboutletcollection(UILabel))) NSArray *labels; // expected-warning {{IBOutletCollection properties should be copy/strong and not assign}}
+@end
diff --git a/test/SemaObjC/idiomatic-parentheses.m b/test/SemaObjC/idiomatic-parentheses.m
index 801db5944f10..c6281f0987de 100644
--- a/test/SemaObjC/idiomatic-parentheses.m
+++ b/test/SemaObjC/idiomatic-parentheses.m
@@ -9,6 +9,7 @@
}
- (id) init;
- (id) initWithInt: (int) i;
+- (id) myInit __attribute__((objc_method_family(init)));
- (void) iterate: (id) coll;
- (id) nextObject;
@property unsigned uid;
@@ -34,6 +35,12 @@
return self;
}
+- (id) myInit {
+ if (self = [self myInit]) {
+ }
+ return self;
+}
+
- (void) iterate: (id) coll {
id cur;
while (cur = [coll nextObject]) {
diff --git a/test/SemaObjC/instancetype.m b/test/SemaObjC/instancetype.m
index 8137964737e4..7811d3eba583 100644
--- a/test/SemaObjC/instancetype.m
+++ b/test/SemaObjC/instancetype.m
@@ -25,7 +25,7 @@
- (instancetype)otherMethodInProto2; // expected-note{{overridden method returns an instance of its class type}}
@end
-@interface Subclass1 : Root
+@interface Subclass1 : Root // expected-note 4 {{receiver is instance of class declared here}}
- (instancetype)initSubclass1;
- (void)methodOnSubclass1;
+ (instancetype)allocSubclass1;
diff --git a/test/SemaObjC/ivar-lookup.m b/test/SemaObjC/ivar-lookup.m
index df9d8bac9077..938c8eb189a5 100644
--- a/test/SemaObjC/ivar-lookup.m
+++ b/test/SemaObjC/ivar-lookup.m
@@ -80,3 +80,77 @@ extern struct foo x;
int IVAR; // expected-error {{instance variable is already declared}}
}
@end
+
+// PR5984
+// rdar://14037151
+@interface Radar14037151 {
+ int myStatus;
+}
+- (int) test;
+@end
+
+@implementation Radar14037151
+- (int) test
+{
+ myStatus = 1; // works
+ __typeof(myStatus) __in; // works.
+ union U {
+ __typeof(myStatus) __in; // fails.
+ };
+ struct S {
+ __typeof(myStatus) __in; // fails.
+ struct S1 {
+ __typeof(myStatus) __in; // fails.
+ struct S {
+ __typeof(myStatus) __in; // fails.
+ };
+ };
+ };
+
+ return 0;
+}
+@end
+
+// rdar://14278560
+@class NSString, NSData, NSNumber;
+
+@interface NSObject
+{
+ Class isa;
+}
+@end
+
+@interface Foo
+{
+ int a;
+ NSString* b;
+ NSData* c;
+}
+@end
+
+@interface Bar : Foo
+@end
+
+@interface Bar () {
+ NSString *q_strong;
+ NSNumber *r_strong;
+ int d; // expected-note {{previous definition is here}}
+ NSString *e_strong; // expected-note {{previous definition is here}}
+ NSData *f_weak; // expected-note {{previous definition is here}}
+ int g; // expected-note 2 {{previous definition is here}}
+}
+@end
+
+@interface Bar () {
+ int g; // expected-note {{previous definition is here}} \
+ // expected-error {{instance variable is already declared}}
+}
+@end
+
+@implementation Bar {
+ int d; // expected-error {{instance variable is already declared}}
+ NSString *e_strong; // expected-error {{instance variable is already declared}}
+ NSData *f_weak; // expected-error {{instance variable is already declared}}
+ NSData *g; // expected-error 2 {{instance variable is already declared}}
+}
+@end
diff --git a/test/SemaObjC/ivar-ref-misuse.m b/test/SemaObjC/ivar-ref-misuse.m
index 3115f5bd2332..2c2fb2f4618f 100644
--- a/test/SemaObjC/ivar-ref-misuse.m
+++ b/test/SemaObjC/ivar-ref-misuse.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
-@interface Sprite { // expected-note{{'Sprite' declared here}}
+@interface Sprite {
int sprite, spree;
int UseGlobalBar;
}
@@ -17,8 +17,7 @@ int UseGlobalBar;
+ (void)setFoo:(int)foo {
sprite = foo; // expected-error {{instance variable 'sprite' accessed in class method}}
spree = foo;
- Xsprite = foo; // expected-error {{unknown type name 'Xsprite'; did you mean 'Sprite'?}} \
- // expected-error{{expected identifier or '('}}
+ Xsprite = foo; // expected-error {{use of undeclared identifier 'Xsprite'}}
UseGlobalBar = 10;
}
+ (void)setSprite:(int)sprite {
diff --git a/test/SemaObjC/message.m b/test/SemaObjC/message.m
index 40fa102f35d2..2c4d8066f604 100644
--- a/test/SemaObjC/message.m
+++ b/test/SemaObjC/message.m
@@ -107,7 +107,7 @@ void foo5(id p) {
// expected-warning {{instance method '-bar' not found}}
}
-@interface I1
+@interface I1 // expected-note {{receiver is instance of class declared here}}
-(void)unavail_meth __attribute__((unavailable)); // expected-note {{marked unavailable here}}
@end
diff --git a/test/SemaObjC/method-bad-param.m b/test/SemaObjC/method-bad-param.m
index d44b53614aa4..ad67a34edb00 100644
--- a/test/SemaObjC/method-bad-param.m
+++ b/test/SemaObjC/method-bad-param.m
@@ -42,3 +42,17 @@ enum bogus; // expected-note {{forward declaration of 'enum bogus'}}
}
@end
+@interface arrayfun
+- (int[6])arrayRet; // expected-error {{function cannot return array type 'int [6]'}}
+- (int())funcRet; // expected-error {{function cannot return function type 'int ()'}}
+@end
+
+@interface qux
+- (void) my_method: (int)arg; // expected-note {{method 'my_method:' declared here}}
+@end
+
+// FIXME: The diagnostic and recovery here could probably be improved.
+@implementation qux // expected-warning {{method definition for 'my_method:' not found}}
+- (void) my_method: (int) { // expected-error {{expected identifier}}
+}
+@end
diff --git a/test/SemaObjC/method-conflict-2.m b/test/SemaObjC/method-conflict-2.m
index ec80a433cc77..47c3d6c2c23c 100644
--- a/test/SemaObjC/method-conflict-2.m
+++ b/test/SemaObjC/method-conflict-2.m
@@ -64,3 +64,52 @@ typedef long long int64_t;
return 0;
}
@end
+
+// rdar://14650159
+// Tests that property inherited indirectly from a nested protocol
+// is seen by the method implementation type matching logic before
+// method in super class is seen. This fixes the warning coming
+// out of that method mismatch.
+@interface NSObject (NSDict)
+- (void)setValue:(id)value;
+- (id)value;
+@end
+
+@protocol ProtocolWithValue
+@property (nonatomic) unsigned value;
+@end
+
+@protocol InterveningProtocol <ProtocolWithValue>
+@end
+
+@interface UsesProtocolWithValue : NSObject <ProtocolWithValue>
+@end
+
+@implementation UsesProtocolWithValue
+@synthesize value=_value;
+- (unsigned) value
+{
+ return _value;
+}
+- (void) setValue:(unsigned)value
+{
+ _value = value;
+}
+@end
+
+
+@interface UsesInterveningProtocol : NSObject <InterveningProtocol>
+@end
+
+@implementation UsesInterveningProtocol
+
+@synthesize value=_value;
+- (unsigned) value
+{
+ return _value;
+}
+- (void) setValue:(unsigned)value
+{
+ _value = value;
+}
+@end
diff --git a/test/SemaObjC/method-not-defined.m b/test/SemaObjC/method-not-defined.m
index 22466f7dc342..792469b719c6 100644
--- a/test/SemaObjC/method-not-defined.m
+++ b/test/SemaObjC/method-not-defined.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-@interface Foo
+@interface Foo // expected-note {{receiver is instance of class declared here}}
@end
void test() {
diff --git a/test/SemaObjC/method-sentinel-attr.m b/test/SemaObjC/method-sentinel-attr.m
index 274e93660653..d230be5805be 100644
--- a/test/SemaObjC/method-sentinel-attr.m
+++ b/test/SemaObjC/method-sentinel-attr.m
@@ -10,7 +10,7 @@
- (void) foo5 : (int)x, ... __attribute__ ((__sentinel__(1))); // expected-note {{method has been explicitly marked sentinel here}}
- (void) foo6 : (int)x, ... __attribute__ ((__sentinel__(5))); // expected-note {{method has been explicitly marked sentinel here}}
- (void) foo7 : (int)x, ... __attribute__ ((__sentinel__(0))); // expected-note {{method has been explicitly marked sentinel here}}
-- (void) foo8 : (int)x, ... __attribute__ ((__sentinel__("a"))); // expected-error {{'sentinel' attribute requires parameter 1 to be an integer constant}}
+- (void) foo8 : (int)x, ... __attribute__ ((__sentinel__("a"))); // expected-error {{'__sentinel__' attribute requires parameter 1 to be an integer constant}}
- (void) foo9 : (int)x, ... __attribute__ ((__sentinel__(-1))); // expected-error {{'sentinel' parameter 1 less than zero}}
- (void) foo10 : (int)x, ... __attribute__ ((__sentinel__(1,1)));
- (void) foo11 : (int)x, ... __attribute__ ((__sentinel__(1,1,3))); // expected-error {{attribute takes no more than 2 arguments}}
diff --git a/test/SemaObjC/missing-atend-metadata.m b/test/SemaObjC/missing-atend-metadata.m
index f072981dc1bf..f235ab94d821 100644
--- a/test/SemaObjC/missing-atend-metadata.m
+++ b/test/SemaObjC/missing-atend-metadata.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s
-@interface I0
+@interface I0 // expected-note {{receiver is instance of class declared here}}
@end
@implementation I0 // expected-note {{implementation started here}}
diff --git a/test/SemaObjC/nsobject-attribute.m b/test/SemaObjC/nsobject-attribute.m
index b794eafc9ed7..ead222c3310b 100644
--- a/test/SemaObjC/nsobject-attribute.m
+++ b/test/SemaObjC/nsobject-attribute.m
@@ -1,6 +1,8 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
typedef struct CGColor * __attribute__ ((NSObject)) CGColorRef;
+typedef struct CGColor * __attribute__((NSObject(12))) Illegal; // expected-error {{'NSObject' attribute takes no arguments}}
+
static int count;
static CGColorRef tmp = 0;
diff --git a/test/SemaObjC/objc-array-literal.m b/test/SemaObjC/objc-array-literal.m
index 9f59316219c7..706207df7482 100644
--- a/test/SemaObjC/objc-array-literal.m
+++ b/test/SemaObjC/objc-array-literal.m
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// rdar://10111397
+// RUN: %clang_cc1 -fsyntax-only -triple i386-apple-macosx10.9.0 -fobjc-runtime=macosx-fragile-10.9.0 -fobjc-subscripting-legacy-runtime -verify %s
+// rdar://15363492
#if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64
typedef unsigned long NSUInteger;
@@ -39,3 +41,17 @@ int main() {
const char *blah;
NSArray *array2 = @[blah]; // expected-error{{collection element of type 'const char *' is not an Objective-C object}}
}
+
+// rdar://14303083
+id Test14303083() {
+ id obj = @[ @"A", (@"B" @"C")];
+ return @[ @"A", @"B" @"C"]; // expected-warning {{concatenated NSString literal for an NSArray expression - possibly missing a comma}}
+}
+id radar15147688() {
+#define R15147688_A @"hello"
+#define R15147688_B "world"
+#define CONCATSTR R15147688_A R15147688_B
+ id x = @[ @"stuff", CONCATSTR ]; // no-warning
+ x = @[ @"stuff", @"hello" "world"]; // expected-warning {{concatenated NSString literal for an NSArray expression}}
+ return x;
+}
diff --git a/test/SemaObjC/objc-dictionary-literal.m b/test/SemaObjC/objc-dictionary-literal.m
index 0b6da4a77ba4..9d86d88bcbec 100644
--- a/test/SemaObjC/objc-dictionary-literal.m
+++ b/test/SemaObjC/objc-dictionary-literal.m
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// rdar://11062080
+// RUN: %clang_cc1 -fsyntax-only -triple i386-apple-macosx10.9.0 -fobjc-runtime=macosx-fragile-10.9.0 -fobjc-subscripting-legacy-runtime -verify %s
+// rdar://15363492
@interface NSNumber
+ (NSNumber *)numberWithChar:(char)value;
diff --git a/test/SemaObjC/objcbridge-attribute.m b/test/SemaObjC/objcbridge-attribute.m
new file mode 100644
index 000000000000..2db2ff4929e8
--- /dev/null
+++ b/test/SemaObjC/objcbridge-attribute.m
@@ -0,0 +1,66 @@
+// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -verify -Wno-objc-root-class %s
+// rdar://15454846
+
+typedef struct __attribute__ ((objc_bridge(NSError))) __CFErrorRef * CFErrorRef; // expected-note 2 {{declared here}}
+
+typedef struct __attribute__((objc_bridge(12))) __CFMyColor *CFMyColorRef; // expected-error {{parameter of 'objc_bridge' attribute must be a single name of an Objective-C class}}
+
+typedef struct __attribute__ ((objc_bridge)) __CFArray *CFArrayRef; // expected-error {{parameter of 'objc_bridge' attribute must be a single name of an Objective-C class}}
+
+typedef void * __attribute__ ((objc_bridge(NSURL))) CFURLRef; // expected-error {{'objc_bridge' attribute only applies to struct or union}}
+
+typedef void * CFStringRef __attribute__ ((objc_bridge(NSString))); // expected-error {{'objc_bridge' attribute only applies to struct or union}}
+
+typedef struct __attribute__((objc_bridge(NSLocale, NSError))) __CFLocale *CFLocaleRef;// expected-error {{use of undeclared identifier 'NSError'}}
+
+typedef struct __CFData __attribute__((objc_bridge(NSData))) CFDataRef; // expected-error {{'objc_bridge' attribute only applies to struct or union}}
+
+typedef struct __attribute__((objc_bridge(NSDictionary))) __CFDictionary * CFDictionaryRef;
+
+typedef struct __CFSetRef * CFSetRef __attribute__((objc_bridge(NSSet))); // expected-error {{'objc_bridge' attribute only applies to struct or union}};
+
+typedef union __CFUColor __attribute__((objc_bridge(NSUColor))) * CFUColorRef; // expected-error {{'objc_bridge' attribute only applies to struct or union}};
+
+typedef union __CFUColor __attribute__((objc_bridge(NSUColor))) *CFUColor1Ref; // expected-error {{'objc_bridge' attribute only applies to struct or union}};
+
+typedef union __attribute__((objc_bridge(NSUColor))) __CFUPrimeColor XXX;
+typedef XXX *CFUColor2Ref;
+
+@interface I
+{
+ __attribute__((objc_bridge(NSError))) void * color; // expected-error {{'objc_bridge' attribute only applies to struct or union}};
+}
+@end
+
+@protocol NSTesting @end
+@class NSString;
+
+typedef struct __attribute__((objc_bridge(NSTesting))) __CFError *CFTestingRef; // expected-note {{declared here}}
+
+id Test1(CFTestingRef cf) {
+ return (NSString *)cf; // expected-error {{CF object of type 'CFTestingRef' (aka 'struct __CFError *') is bridged to 'NSTesting', which is not an Objective-C class}}
+}
+
+typedef CFErrorRef CFErrorRef1;
+
+typedef CFErrorRef1 CFErrorRef2;
+
+@interface NSError @end
+
+@interface MyError : NSError
+@end
+
+@interface NSUColor @end
+
+@class NSString;
+
+void Test2(CFErrorRef2 cf, NSError *ns, NSString *str, Class c, CFUColor2Ref cf2) {
+ (void)(NSString *)cf; // expected-warning {{'CFErrorRef2' (aka 'struct __CFErrorRef *') bridges to NSError, not 'NSString'}}
+ (void)(NSError *)cf; // okay
+ (void)(MyError*)cf; // okay,
+ (void)(NSUColor *)cf2; // okay
+ (void)(CFErrorRef)ns; // okay
+ (void)(CFErrorRef)str; // expected-warning {{'NSString' cannot bridge to 'CFErrorRef' (aka 'struct __CFErrorRef *')}}
+ (void)(Class)cf; // expected-warning {{'CFErrorRef2' (aka 'struct __CFErrorRef *') bridges to NSError, not 'Class'}}
+ (void)(CFErrorRef)c; // expected-warning {{'Class' cannot bridge to 'CFErrorRef'}}
+}
diff --git a/test/SemaObjC/overriding-property-in-class-extension.m b/test/SemaObjC/overriding-property-in-class-extension.m
index 77efd556928c..8c0e1b98a572 100644
--- a/test/SemaObjC/overriding-property-in-class-extension.m
+++ b/test/SemaObjC/overriding-property-in-class-extension.m
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Weverything %s
-// expected-no-diagnostics
// rdar://12103434
@class NSString;
@@ -8,7 +7,7 @@
@interface MyClass : NSObject
-@property (nonatomic, copy, readonly) NSString* name;
+@property (nonatomic, copy, readonly) NSString* name; // expected-warning {{property attributes 'readonly' and 'copy' are mutually exclusive}}
@end
diff --git a/test/SemaObjC/property-5.m b/test/SemaObjC/property-5.m
index cd7cc2487acc..cf4f87392b6a 100644
--- a/test/SemaObjC/property-5.m
+++ b/test/SemaObjC/property-5.m
@@ -8,7 +8,7 @@
@interface MutableNSData : NSData @end
-@interface Base : NSData <P1>
+@interface Base : NSData <P1> // expected-note {{receiver is instance of class declared here}}
@property(readonly) id ref;
@property(readonly) Base *p_base;
@property(readonly) NSData *nsdata;
diff --git a/test/SemaObjC/property-ambiguous-synthesis.m b/test/SemaObjC/property-ambiguous-synthesis.m
new file mode 100644
index 000000000000..98f59450744c
--- /dev/null
+++ b/test/SemaObjC/property-ambiguous-synthesis.m
@@ -0,0 +1,48 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// rdar://13075400
+
+@protocol FooAsID
+@property (copy) id foo; // expected-note 2 {{it could also be property of type 'id' declared here}} \\
+ // expected-warning {{property of type 'id' was selected for synthesis}}
+@end
+
+@protocol FooAsDouble
+@property double foo; // expected-warning 2 {{property of type 'double' was selected for synthesis}} \
+ // expected-note {{it could also be property of type 'double' declared here}}
+@end
+
+@protocol FooAsShort
+@property short foo; // expected-note {{it could also be property of type 'short' declared here}}
+@end
+
+@interface NSObject @end
+
+@interface AnObject : NSObject<FooAsDouble,FooAsID>
+@end
+
+@interface Sub : AnObject
+@end
+
+@implementation Sub
+@synthesize foo=_MyFooIvar; // expected-note {{property synthesized here}}
+@end
+
+
+@interface AnotherObject : NSObject<FooAsDouble, FooAsID,FooAsDouble, FooAsID, FooAsDouble,FooAsID>
+@end
+
+@implementation AnotherObject
+@synthesize foo=_MyFooIvar; // expected-note {{property synthesized here}}
+@end
+
+
+@interface YetAnotherObject : NSObject<FooAsID,FooAsShort, FooAsDouble,FooAsID, FooAsShort>
+@end
+
+@implementation YetAnotherObject
+@synthesize foo=_MyFooIvar; // expected-note {{property synthesized here}}
+@end
+
+double func(YetAnotherObject *object) {
+ return [object foo]; // expected-error {{returning 'id' from a function with incompatible result type 'double'}}
+}
diff --git a/test/SemaObjC/property-category-1.m b/test/SemaObjC/property-category-1.m
index 3788bc90ddf0..0e8c3fcd85df 100644
--- a/test/SemaObjC/property-category-1.m
+++ b/test/SemaObjC/property-category-1.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -disable-objc-default-synthesize-properties -Wno-objc-root-class %s
@interface Object
+ (id)new;
diff --git a/test/SemaObjC/property-choose-expr.m b/test/SemaObjC/property-choose-expr.m
new file mode 100644
index 000000000000..71265e5f8c20
--- /dev/null
+++ b/test/SemaObjC/property-choose-expr.m
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
+
+@interface NSArray
+-(int)count;
+@end
+
+// <rdar://problem/14438917>
+char* f(NSArray *array) {
+ return _Generic(__builtin_choose_expr(__builtin_types_compatible_p(__typeof__(array.count), void), 0.f, array.count),
+ unsigned int:"uint",
+ float:"void",
+ default: "ignored");
+}
diff --git a/test/SemaObjC/property-in-class-extension-1.m b/test/SemaObjC/property-in-class-extension-1.m
index ab461ef6c191..51837fd212ca 100644
--- a/test/SemaObjC/property-in-class-extension-1.m
+++ b/test/SemaObjC/property-in-class-extension-1.m
@@ -8,19 +8,20 @@
@property (nonatomic, readonly) NSString* addingMemoryModel;
-@property (nonatomic, copy, readonly) NSString* matchingMemoryModel;
+@property (nonatomic, copy, readonly) NSString* matchingMemoryModel; // expected-warning {{property attributes 'readonly' and 'copy' are mutually exclusive}}
-@property (nonatomic, retain, readonly) NSString* addingNoNewMemoryModel;
+@property (nonatomic, retain, readonly) NSString* addingNoNewMemoryModel; // expected-warning {{property attributes 'readonly' and 'retain' are mutually exclusive}}
@property (readonly) NSString* none;
@property (readonly) NSString* none1;
-@property (assign, readonly) NSString* changeMemoryModel; // expected-note {{property declared here}}
+@property (assign, readonly) NSString* changeMemoryModel; // expected-note {{property declared here}} \
+ // expected-warning {{property attributes 'readonly' and 'assign' are mutually exclusive}}
@property (readonly) __weak id weak_prop;
@property (readonly) __weak id weak_prop1;
-@property (assign, readonly) NSString* assignProperty;
+@property (assign, readonly) NSString* assignProperty; // expected-warning {{property attributes 'readonly' and 'assign' are mutually exclusive}}
@property (readonly) NSString* readonlyProp;
diff --git a/test/SemaObjC/property-ownership-attr.m b/test/SemaObjC/property-ownership-attr.m
new file mode 100644
index 000000000000..f83c560acb3f
--- /dev/null
+++ b/test/SemaObjC/property-ownership-attr.m
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// rdar://15014468
+
+@protocol P
+ @property(readonly) id z;
+@end
+
+@interface Foo
+ @property (readonly) id x;
+@end
+
+@interface MutableFoo : Foo
+ @property (copy) id x;
+@end
+
+@interface Foo (Cat) <P>
+@property (copy) id z; // expected-warning {{'copy' attribute on property 'z' does not match the property inherited from 'P'}}
+@end
+
diff --git a/test/SemaObjC/protocol-id-test-1.m b/test/SemaObjC/protocol-id-test-1.m
index 19a4432de619..2366f7326550 100644
--- a/test/SemaObjC/protocol-id-test-1.m
+++ b/test/SemaObjC/protocol-id-test-1.m
@@ -7,10 +7,10 @@
@protocol P
@end
-@interface INTF<P>
+@interface INTF<P> // expected-note {{receiver is instance of class declared here}}
- (void)IMeth;
@end
@implementation INTF
-- (void)IMeth {INTF<P> *pi; [pi Meth]; } // expected-warning {{method '-Meth' not found (return type defaults to 'id')}}
+- (void)IMeth {INTF<P> *pi; [pi Meth]; } // expected-warning {{instance method '-Meth' not found (return type defaults to 'id'); did you mean '-IMeth'?}}
@end
diff --git a/test/SemaObjC/protocol-id-test-2.m b/test/SemaObjC/protocol-id-test-2.m
index 6bd2feeeaf1f..4c1befb97f62 100644
--- a/test/SemaObjC/protocol-id-test-2.m
+++ b/test/SemaObjC/protocol-id-test-2.m
@@ -8,5 +8,5 @@
@end
@implementation INTF
-- (void)IMeth { [(id<P>)self Meth]; } // expected-warning {{method '-Meth' not found (return type defaults to 'id')}}
+- (void)IMeth { [(id<P>)self Meth]; } // expected-warning {{instance method '-Meth' not found (return type defaults to 'id'); did you mean '-IMeth'?}}
@end
diff --git a/test/SemaObjC/provisional-ivar-lookup.m b/test/SemaObjC/provisional-ivar-lookup.m
index 7460fc2e2067..a6276b816d76 100644
--- a/test/SemaObjC/provisional-ivar-lookup.m
+++ b/test/SemaObjC/provisional-ivar-lookup.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
// rdar:// 8565343
@interface Foo {
diff --git a/test/SemaObjC/related-result-type-inference.m b/test/SemaObjC/related-result-type-inference.m
index 50aaf2da4d9e..547e83fd0135 100644
--- a/test/SemaObjC/related-result-type-inference.m
+++ b/test/SemaObjC/related-result-type-inference.m
@@ -173,7 +173,7 @@ void test_inference() {
@interface Fail @end
@protocol X @end
@implementation Fail
-- (id<X>) initWithX
+- (id<X>) initWithX // expected-note {{compiler has implicitly changed method 'initWithX' return type}}
{
return (id)self; // expected-warning {{casting 'Fail *' to incompatible type 'id<X>'}}
}
@@ -184,3 +184,19 @@ void test_inference() {
@interface WeirdNSString : NSString
- (id)initWithCString:(const char*)string, void *blah;
@end
+
+
+// rdar://14121570
+@protocol PMFilterManager
+@end
+
+@interface UIViewController : NSObject
+@end
+
+@implementation UIViewController
++ (UIViewController<PMFilterManager> *)newFilterViewControllerForType // expected-note {{compiler has implicitly changed method 'newFilterViewControllerForType' return type}}
+{
+ UIViewController<PMFilterManager> *filterVC;
+ return filterVC; // expected-warning {{incompatible pointer types casting 'UIViewController *' to type 'UIViewController<PMFilterManager> *'}}
+}
+@end
diff --git a/test/SemaObjC/selector-3.m b/test/SemaObjC/selector-3.m
index f968aeb278c2..d782c784f1de 100644
--- a/test/SemaObjC/selector-3.m
+++ b/test/SemaObjC/selector-3.m
@@ -14,7 +14,7 @@
- (void) foo
{
SEL a,b,c;
- a = @selector(b1ar); // expected-warning {{unimplemented selector 'b1ar'}}
+ a = @selector(b1ar); // expected-warning {{creating selector for nonexistent method 'b1ar'}}
b = @selector(bar);
}
@end
@@ -25,7 +25,7 @@
SEL func()
{
- return @selector(length); // expected-warning {{unimplemented selector 'length'}}
+ return @selector(length); // expected-warning {{creating selector for nonexistent method 'length'}}
}
// rdar://9545564
@@ -69,7 +69,7 @@ extern SEL MySelector(SEL s);
@implementation INTF
- (void) Meth {
- if( [cnx respondsToSelector:MySelector(@selector( _setQueue: ))] ) // expected-warning {{unimplemented selector '_setQueue:'}}
+ if( [cnx respondsToSelector:MySelector(@selector( _setQueue: ))] ) // expected-warning {{creating selector for nonexistent method '_setQueue:'}}
{
}
@@ -81,3 +81,32 @@ extern SEL MySelector(SEL s);
}
}
@end
+
+// rdar://14007194
+@interface UxTechTest : NSObject
+- (int) invalidate : (id)Arg; // expected-warning {{multiple selectors named 'invalidate:' found}}
++ (int) C_invalidate : (int)arg; // expected-warning {{multiple selectors named 'C_invalidate:' found}}
+@end
+
+@interface UxTechTest(CAT)
+- (char) invalidate : (int)arg; // expected-note {{also found}}
++ (int) C_invalidate : (char)arg; // expected-note {{also found}}
+@end
+
+@interface NSPort : NSObject
+- (double) invalidate : (void*)Arg1; // expected-note {{also found}}
++ (int) C_invalidate : (id*)arg; // expected-note {{also found}}
+@end
+
+
+@interface USEText : NSPort
+- (int) invalidate : (int)arg; // expected-note {{also found}}
+@end
+
+@implementation USEText
+- (int) invalidate :(int) arg { return 0; }
+@end
+
+@interface USETextSub : USEText
+- (int) invalidate : (id)arg;
+@end
diff --git a/test/SemaObjC/self-comparison.m b/test/SemaObjC/self-comparison.m
new file mode 100644
index 000000000000..00137ee0b572
--- /dev/null
+++ b/test/SemaObjC/self-comparison.m
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+
+@interface A {
+ id xxx;
+}
+-(int)bar;
+@end
+@implementation A
+-(int)bar {
+ return xxx == xxx; // expected-warning {{self-comparison always evaluates to true}}
+}
+@end
diff --git a/test/SemaObjC/sign-conversion.m b/test/SemaObjC/sign-conversion.m
new file mode 100644
index 000000000000..584ea1920271
--- /dev/null
+++ b/test/SemaObjC/sign-conversion.m
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wsign-conversion %s
+// rdar://13855394
+
+typedef unsigned int NSUInteger;
+
+@interface NSObject
+- new;
+- (NSUInteger)hash;
+@end
+
+@interface X : NSObject
+@property NSUInteger uint;
+@end
+
+@interface NSArray : NSObject
+
+- (NSUInteger)count;
+- (id)objectAtIndex:(NSUInteger)index;
+- (id)objectAtIndexedSubscript:(NSUInteger)index;
+
+@end
+
+void foo() {
+ X *x = [X new];
+ signed int sint = -1;
+ [x setUint:sint]; // expected-warning {{implicit conversion changes signedness: 'int' to 'NSUInteger'}}
+ x.uint = sint; // expected-warning {{implicit conversion changes signedness: 'int' to 'NSUInteger'}}
+}
+
+// rdar://13855682
+void Test1() {
+signed int si = -1;
+NSArray *array;
+
+(void)((NSObject*)array[si]).hash; // expected-warning {{implicit conversion changes signedness: 'int' to 'NSUInteger'}}
+
+(void)[((NSObject*)array[si]) hash]; // expected-warning {{implicit conversion changes signedness: 'int' to 'NSUInteger'}}
+(void)array[si]; // expected-warning {{implicit conversion changes signedness: 'int' to 'NSUInteger'}}
+}
diff --git a/test/SemaObjC/super-class-protocol-conformance.m b/test/SemaObjC/super-class-protocol-conformance.m
index 32d5392ad4e0..1e2d56fe1d98 100644
--- a/test/SemaObjC/super-class-protocol-conformance.m
+++ b/test/SemaObjC/super-class-protocol-conformance.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -disable-objc-default-synthesize-properties %s
// rdar://7884086
@interface NSObject @end
diff --git a/test/SemaObjC/super-dealloc-attribute.m b/test/SemaObjC/super-dealloc-attribute.m
index 35f6dac9bf42..ecab109d3089 100644
--- a/test/SemaObjC/super-dealloc-attribute.m
+++ b/test/SemaObjC/super-dealloc-attribute.m
@@ -40,9 +40,9 @@
[super MyDealloc];
} // expected-warning {{method possibly missing a [super XXX] call}}
-- (void) MyDeallocMeth {} // No warning here.
+- (void) MyDeallocMeth {}
- (void) AnnotMyDeallocMeth{} // expected-warning {{method possibly missing a [super AnnotMyDeallocMeth] call}}
-- (void) AnnotMeth{}; // No warning here. Annotation is in its class.
+- (void) AnnotMeth{};
+ (void)registerClass:(id)name {} // expected-warning {{method possibly missing a [super registerClass:] call}}
@end
@@ -85,3 +85,48 @@
}
@end
+
+// rdar://14251387
+#define IBAction void)__attribute__((ibaction)
+
+@interface UIViewController @end
+
+@interface ViewController : UIViewController
+- (void) someMethodRequiringSuper NS_REQUIRES_SUPER;
+- (IBAction) someAction;
+- (IBAction) someActionRequiringSuper NS_REQUIRES_SUPER;
+@end
+
+
+@implementation ViewController
+- (void) someMethodRequiringSuper
+{
+}
+- (IBAction) someAction
+{
+}
+- (IBAction) someActionRequiringSuper
+{
+}
+@end
+
+// rdar://15385981
+@interface Barn
+- (void)openDoor __attribute__((objc_requires_super));
+@end
+
+@implementation Barn
+- (void) openDoor
+{
+ ;
+}
+@end
+
+@interface HorseBarn:Barn @end
+
+@implementation HorseBarn
+- (void) openDoor
+{
+ ;
+} // expected-warning {{method possibly missing a [super openDoor] call}}
+@end
diff --git a/test/SemaObjC/super-property-notation.m b/test/SemaObjC/super-property-notation.m
index 4741d1b5a870..aa67f0af39dc 100644
--- a/test/SemaObjC/super-property-notation.m
+++ b/test/SemaObjC/super-property-notation.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
@interface B
+(int) classGetter;
diff --git a/test/SemaObjC/synth-provisional-ivars-1.m b/test/SemaObjC/synth-provisional-ivars-1.m
index 92a9d7165f13..39f474727b7b 100644
--- a/test/SemaObjC/synth-provisional-ivars-1.m
+++ b/test/SemaObjC/synth-provisional-ivars-1.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
// expected-no-diagnostics
// rdar://8913053
diff --git a/test/SemaObjC/synth-provisional-ivars.m b/test/SemaObjC/synth-provisional-ivars.m
index 9d7abd566d7a..d2eb61a05697 100644
--- a/test/SemaObjC/synth-provisional-ivars.m
+++ b/test/SemaObjC/synth-provisional-ivars.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
int bar;
diff --git a/test/SemaObjC/synthesized-ivar.m b/test/SemaObjC/synthesized-ivar.m
index 8c9d90587f4d..884a3caf0f64 100644
--- a/test/SemaObjC/synthesized-ivar.m
+++ b/test/SemaObjC/synthesized-ivar.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
@interface I
{
}
diff --git a/test/SemaObjC/tentative-property-decl.m b/test/SemaObjC/tentative-property-decl.m
index f69ac6dace43..aa7df5294a8a 100644
--- a/test/SemaObjC/tentative-property-decl.m
+++ b/test/SemaObjC/tentative-property-decl.m
@@ -14,7 +14,7 @@
@class NSString;
@interface MyClass : Super
-@property(nonatomic, copy, readonly) NSString *prop;
+@property(nonatomic, copy, readonly) NSString *prop; // expected-warning {{property attributes 'readonly' and 'copy' are mutually exclusive}}
@property(nonatomic, copy, readonly) id warnProp; // expected-warning {{property attributes 'readonly' and 'copy' are mutually exclusive}}
@end
@@ -29,7 +29,7 @@
@protocol P
-@property(nonatomic, copy, readonly) NSString *prop;
+@property(nonatomic, copy, readonly) NSString *prop; // expected-warning {{property attributes 'readonly' and 'copy' are mutually exclusive}}
@property(nonatomic, copy, readonly) id warnProp; // expected-warning {{property attributes 'readonly' and 'copy' are mutually exclusive}}
@end
diff --git a/test/SemaObjC/unimplemented-protocol-prop.m b/test/SemaObjC/unimplemented-protocol-prop.m
index 1438cf595d1f..270d879a7c68 100644
--- a/test/SemaObjC/unimplemented-protocol-prop.m
+++ b/test/SemaObjC/unimplemented-protocol-prop.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class -disable-objc-default-synthesize-properties %s
@protocol PROTOCOL0
@required
diff --git a/test/SemaObjC/unsued-backing-ivar-warning.m b/test/SemaObjC/unsued-backing-ivar-warning.m
new file mode 100644
index 000000000000..c07dea71a7e1
--- /dev/null
+++ b/test/SemaObjC/unsued-backing-ivar-warning.m
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -fsyntax-only -Wunused-property-ivar -verify -Wno-objc-root-class %s
+// rdar://14989999
+
+@interface NSObject @end
+
+@interface Example : NSObject
+@property (nonatomic, copy) id t; // expected-note {{property declared here}}
+@property (nonatomic, copy) id u; // expected-note {{property declared here}}
+@property (nonatomic, copy) id v; // expected-note {{property declared here}}
+@property (nonatomic, copy) id w;
+@property (nonatomic, copy) id x; // expected-note {{property declared here}}
+@property (nonatomic, copy) id y; // expected-note {{property declared here}}
+@property (nonatomic, copy) id z;
+@property (nonatomic, copy) id ok;
+@end
+
+@implementation Example
+- (void) setX:(id)newX { // expected-warning {{ivar '_x' which backs the property is not referenced in this property's accessor}}
+ _y = newX;
+}
+- (id) y { // expected-warning {{ivar '_y' which backs the property is not referenced in this property's accessor}}
+ return _v;
+}
+
+- (void) setV:(id)newV { // expected-warning {{ivar '_v' which backs the property is not referenced in this property's accessor}}
+ _y = newV;
+}
+
+// No warning here because there is no backing ivar.
+// both setter/getter are user defined.
+- (void) setW:(id)newW {
+ _y = newW;
+}
+- (id) w {
+ return _v;
+}
+
+- (id) u { // expected-warning {{ivar '_u' which backs the property is not referenced in this property's accessor}}
+ return _v;
+}
+
+@synthesize ok = okIvar;
+- (void) setOk:(id)newOk {
+ okIvar = newOk;
+}
+
+@synthesize t = tIvar;
+- (void) setT:(id)newT { // expected-warning {{ivar 'tIvar' which backs the property is not referenced in this property's accessor}}
+ okIvar = newT;
+}
+@end
+
+// rdar://15473432
+typedef char BOOL;
+@interface CalDAVServerVersion {
+ BOOL _supportsTimeRangeFilterWithoutEndDate;
+}
+@property (nonatomic, readonly,nonatomic) BOOL supportsTimeRangeFilterWithoutEndDate;
+@end
+
+@interface CalDAVConcreteServerVersion : CalDAVServerVersion {
+}
+@end
+
+@interface CalendarServerVersion : CalDAVConcreteServerVersion
+@end
+
+@implementation CalDAVServerVersion
+@synthesize supportsTimeRangeFilterWithoutEndDate=_supportsTimeRangeFilterWithoutEndDate;
+@end
+
+@implementation CalendarServerVersion
+-(BOOL)supportsTimeRangeFilterWithoutEndDate {
+ return 0;
+}
+@end
diff --git a/test/SemaObjC/warn-direct-ivar-access.m b/test/SemaObjC/warn-direct-ivar-access.m
index 283a00faee8c..d34e5f1894d2 100644
--- a/test/SemaObjC/warn-direct-ivar-access.m
+++ b/test/SemaObjC/warn-direct-ivar-access.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -fobjc-default-synthesize-properties -Wdirect-ivar-access -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -Wdirect-ivar-access -verify -Wno-objc-root-class %s
// rdar://6505197
__attribute__((objc_root_class)) @interface MyObject {
diff --git a/test/SemaObjC/warn-implicit-atomic-property.m b/test/SemaObjC/warn-implicit-atomic-property.m
index 887a2862250a..7d5934f481b3 100644
--- a/test/SemaObjC/warn-implicit-atomic-property.m
+++ b/test/SemaObjC/warn-implicit-atomic-property.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wimplicit-atomic-properties -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -Wimplicit-atomic-properties -verify -Wno-objc-root-class %s
// rdar://8774580
@interface Super
diff --git a/test/SemaObjC/warn-missing-super.m b/test/SemaObjC/warn-missing-super.m
index e9769a9db176..e3f2f418ffff 100644
--- a/test/SemaObjC/warn-missing-super.m
+++ b/test/SemaObjC/warn-missing-super.m
@@ -53,6 +53,6 @@ __attribute__((objc_root_class))
// CHECK-GC-ONLY: warn-missing-super.m:26:1: warning: method possibly missing a [super finalize] call
// CHECK-GC-ONLY: 1 warning generated.
-// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-arc %s 2>&1 | FileCheck --check-prefix=CHECK-ARC %s
+// RUN: not %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-arc %s 2>&1 | FileCheck --check-prefix=CHECK-ARC %s
// CHECK-ARC: warn-missing-super.m:36:10: error: ARC forbids explicit message send of 'dealloc'
// CHECK-ARC: 1 error generated.
diff --git a/test/SemaObjC/warn-retain-block-property.m b/test/SemaObjC/warn-retain-block-property.m
index 45823e33b486..84cdd9ff419c 100644
--- a/test/SemaObjC/warn-retain-block-property.m
+++ b/test/SemaObjC/warn-retain-block-property.m
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -fsyntax-only -fblocks -fobjc-arc -Wno-objc-root-class %s 2>&1 | FileCheck --check-prefix=CHECK-ARC %s
+// RUN: not %clang_cc1 -fsyntax-only -fblocks -fobjc-arc -Wno-objc-root-class %s 2>&1 | FileCheck --check-prefix=CHECK-ARC %s
// rdar://9829425
-// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-objc-root-class %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fblocks -Wno-objc-root-class %s 2>&1 | FileCheck %s
// rdar://11761511
extern void doSomething();
diff --git a/test/SemaObjCXX/abstract-class-type-ivar.mm b/test/SemaObjCXX/abstract-class-type-ivar.mm
index 990ba1c2abd5..aaf4eb83735c 100644
--- a/test/SemaObjCXX/abstract-class-type-ivar.mm
+++ b/test/SemaObjCXX/abstract-class-type-ivar.mm
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
// rdar://12095239
+// rdar://14261999
class CppAbstractBase {
public:
@@ -16,11 +17,14 @@ class CppConcreteSub : public CppAbstractBase {
CppConcreteSub _concrete; // expected-error{{instance variable type 'CppConcreteSub' is an abstract class}}
}
- (CppAbstractBase*)abstract;
+@property (nonatomic, readonly) const CppConcreteSub Prop; // expected-note {{property declared here}}
@end
+
@implementation Objc
- (CppAbstractBase*)abstract {
return &_concrete;
}
+@synthesize Prop; // expected-error {{synthesized instance variable type 'const CppConcreteSub' is an abstract class}}
@end
class Cpp {
diff --git a/test/SemaObjCXX/arc-nsconsumed-errors.mm b/test/SemaObjCXX/arc-nsconsumed-errors.mm
index 10ae10d04988..c78d8a5f4add 100644
--- a/test/SemaObjCXX/arc-nsconsumed-errors.mm
+++ b/test/SemaObjCXX/arc-nsconsumed-errors.mm
@@ -29,11 +29,12 @@ void releaser(__attribute__((ns_consumed)) id);
releaser_t r2 = releaser; // no-warning
template <typename T>
-void templateFunction(T) {} // expected-note {{candidate function}}
+void templateFunction(T) { } // expected-note {{candidate template ignored: could not match 'void (__strong id)' against 'void (id)'}} \
+ // expected-note {{candidate template ignored: failed template argument deduction}}
releaser_t r3 = templateFunction<id>; // expected-error {{address of overloaded function 'templateFunction' does not match required type 'void (id)'}}
template <typename T>
-void templateReleaser(__attribute__((ns_consumed)) T) {}
+void templateReleaser(__attribute__((ns_consumed)) T) { } // expected-note 2{{candidate template ignored: failed template argument deduction}}
releaser_t r4 = templateReleaser<id>; // no-warning
diff --git a/test/SemaObjCXX/arc-templates.mm b/test/SemaObjCXX/arc-templates.mm
index ef68b94e7284..b3519b957372 100644
--- a/test/SemaObjCXX/arc-templates.mm
+++ b/test/SemaObjCXX/arc-templates.mm
@@ -292,3 +292,13 @@ namespace rdar12367446 {
A<id()> value;
}
}
+
+namespace rdar14467941 {
+ template<typename T> int &takePtr(const T &);
+ template<typename T> float &takePtr(T * const &);
+
+ void testTakePtr(A *a) {
+ float &fr1 = takePtr(a);
+ float &fr2 = takePtr<A>(a);
+ }
+}
diff --git a/test/SemaObjCXX/contextual-convert-to-id.mm b/test/SemaObjCXX/contextual-convert-to-id.mm
new file mode 100644
index 000000000000..602d6c24a8d6
--- /dev/null
+++ b/test/SemaObjCXX/contextual-convert-to-id.mm
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only %s -verify
+
+@interface A
+- knownMethod;
+@end
+
+@interface B
+- unknownMethod;
+@end
+
+template<typename T> struct RetainPtr {
+ explicit operator T*() const;
+};
+
+void methodCallToSpecific(RetainPtr<A> a) {
+ [a knownMethod];
+ [a unknownMethod]; // expected-warning{{'A' may not respond to 'unknownMethod'}}
+}
+
+struct Incomplete; // expected-note{{forward declaration}}
+
+void methodCallToIncomplete(Incomplete &incomplete) {
+ [incomplete knownMethod]; // expected-error{{incomplete receiver type 'Incomplete'}}
+}
+
+struct IdPtr {
+ explicit operator id() const;
+};
+
+void methodCallToId(IdPtr a) {
+ [a knownMethod];
+ [a unknownMethod];
+}
diff --git a/test/SemaObjCXX/exceptions.mm b/test/SemaObjCXX/exceptions.mm
new file mode 100644
index 000000000000..37e6def35b04
--- /dev/null
+++ b/test/SemaObjCXX/exceptions.mm
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin11 -fsyntax-only -verify %s
+
+@interface NSException @end
+
+namespace test0 {
+ void test() {
+ try {
+ } catch (NSException e) { // expected-error {{can't catch an Objective-C object by value}}
+ }
+ }
+}
diff --git a/test/SemaObjCXX/instancetype.mm b/test/SemaObjCXX/instancetype.mm
index bbf100ef0458..89ff2b4b0326 100644
--- a/test/SemaObjCXX/instancetype.mm
+++ b/test/SemaObjCXX/instancetype.mm
@@ -25,7 +25,7 @@
- (instancetype)otherMethodInProto2; // expected-note{{overridden method returns an instance of its class type}}
@end
-@interface Subclass1 : Root
+@interface Subclass1 : Root // expected-note 4 {{receiver is instance of class declared here}}
- (instancetype)initSubclass1;
- (void)methodOnSubclass1;
+ (instancetype)allocSubclass1;
diff --git a/test/SemaObjCXX/ivar-construct.mm b/test/SemaObjCXX/ivar-construct.mm
index a066fca3595a..473c0bf4b02d 100644
--- a/test/SemaObjCXX/ivar-construct.mm
+++ b/test/SemaObjCXX/ivar-construct.mm
@@ -12,7 +12,7 @@ struct X : T { }; // expected-error 2{{private destructor}}
struct Z; // expected-note{{forward declaration}}
@interface A {
- X<Y> x; // expected-note{{implicit default destructor}}
+ X<Y> x; // expected-note{{implicit destructor}}
Y y; // expected-error{{private destructor}}
}
@end
diff --git a/test/SemaObjCXX/microsoft-abi-byval.mm b/test/SemaObjCXX/microsoft-abi-byval.mm
new file mode 100644
index 000000000000..f0c4caa9e06d
--- /dev/null
+++ b/test/SemaObjCXX/microsoft-abi-byval.mm
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -cxx-abi microsoft -Wno-objc-root-class %s
+
+class Foo {
+ ~Foo(); // expected-note {{implicitly declared private here}}
+};
+
+@interface bar
+- (void) my_method: (Foo)arg;
+@end
+
+@implementation bar
+- (void) my_method: (Foo)arg { // expected-error {{variable of type 'Foo' has private destructor}}
+}
+@end
diff --git a/test/SemaObjCXX/missing-lhs-gun-extension.mm b/test/SemaObjCXX/missing-lhs-gun-extension.mm
new file mode 100644
index 000000000000..0b5c998bd755
--- /dev/null
+++ b/test/SemaObjCXX/missing-lhs-gun-extension.mm
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
+// rdar://13749180
+
+@interface NSDictionary
+- (id)objectForKeyedSubscript:(id)key;
+- (void)setObject:(id)object forKeyedSubscript:(id)key;
+- (int &) random;
+@end
+
+@class NSString;
+
+template <class T, class U = T> T tfoo(U x) { return x; }
+
+void func() {
+ NSDictionary* foo;
+ NSString* result = foo[@"bar"] ? : foo[@"baz"];
+
+ int (*fn)(int) = (&tfoo<int> ?: 0);
+
+ int x = 0;
+ const int &y = foo.random ?: x;
+}
diff --git a/test/SemaObjCXX/overload-1.mm b/test/SemaObjCXX/overload-1.mm
deleted file mode 100644
index fc17ca2be98d..000000000000
--- a/test/SemaObjCXX/overload-1.mm
+++ /dev/null
@@ -1,25 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-
-@protocol Proto1 @end
-
-@protocol Proto2 @end
-
-void f(id<Proto1> *) { } // expected-note {{previous definition is here}}
-
-void f(id<Proto1, Proto2> *) { } // expected-error {{conflicting types for 'f'}}
-
-void f(Class<Proto1> *) { } // expected-note {{previous definition is here}}
-
-void f(Class<Proto1, Proto2> *) { } // expected-error {{conflicting types for 'f'}}
-
-@interface I @end
-
-void f(I<Proto1> *) { } // expected-note {{previous definition is here}}
-
-void f(I<Proto1, Proto2> *) { } // expected-error {{conflicting types for 'f'}}
-
-@interface I1 @end
-
-void f1(I<Proto1> *) { }
-
-void f1(I1<Proto1, Proto2> *) { }
diff --git a/test/SemaObjCXX/overload.mm b/test/SemaObjCXX/overload.mm
index 6f24c59e3a73..bb94d9ed92c3 100644
--- a/test/SemaObjCXX/overload.mm
+++ b/test/SemaObjCXX/overload.mm
@@ -60,9 +60,8 @@ void test2(A** ap) {
bp = ap; // expected-warning{{incompatible pointer types assigning to 'B **' from 'A **'}}
}
-// FIXME: we should either allow overloading here or give a better diagnostic
-int& cv(A*); // expected-note {{previous declaration}} expected-note 2 {{not viable}}
-float& cv(const A*); // expected-error {{cannot be overloaded}}
+int& cv(A*);
+float& cv(const A*);
int& cv2(void*);
float& cv2(const void*);
@@ -70,22 +69,20 @@ float& cv2(const void*);
void cv_test(A* a, B* b, const A* ac, const B* bc) {
int &i1 = cv(a);
int &i2 = cv(b);
- float &f1 = cv(ac); // expected-error {{no matching function}}
- float &f2 = cv(bc); // expected-error {{no matching function}}
+ float &f1 = cv(ac);
+ float &f2 = cv(bc);
int& i3 = cv2(a);
float& f3 = cv2(ac);
}
-// We agree with GCC that these can't be overloaded.
-int& qualid(id<P0>); // expected-note {{previous declaration}} expected-note {{not viable}}
-float& qualid(id<P1>); // expected-error {{cannot be overloaded}}
+int& qualid(id<P0>);
+float& qualid(id<P1>);
void qualid_test(A *a, B *b, C *c) {
int& i1 = qualid(a);
int& i2 = qualid(b);
- // This doesn't work only because the overload was rejected above.
- float& f1 = qualid(c); // expected-error {{no matching function}}
+ float& f1 = qualid(c);
id<P0> p1 = 0;
p1 = 0;
diff --git a/test/SemaObjCXX/properties.mm b/test/SemaObjCXX/properties.mm
index abd4db998bcc..7bb4fab3d3fd 100644
--- a/test/SemaObjCXX/properties.mm
+++ b/test/SemaObjCXX/properties.mm
@@ -164,3 +164,42 @@ namespace test10 {
(void) t.index[t.b];
}
}
+
+// <rdar://problem/14354144>
+@interface PropertyOfItself
+@property (readonly, nonatomic) PropertyOfItself x; // expected-error {{interface type cannot be statically allocated}}
+@end
+@implementation PropertyOfItself
+@synthesize x;
+@end
+
+// rdar://14654207
+struct CGSize {
+ double width;
+ double height;
+};
+typedef struct CGSize CGSize;
+
+struct CGRect {
+ CGSize origin;
+ CGSize size;
+};
+typedef struct CGRect CGRect;
+
+typedef CGRect NSRect;
+void HappySetFrame(NSRect frame) {}
+
+__attribute__((objc_root_class))
+@interface NSObject
+@property CGRect frame;
+@end
+
+@implementation NSObject
+- (void) nothing
+{
+ HappySetFrame({{0,0}, {13,14}});
+ [self setFrame: {{0,0}, {13,14}}];
+ self.frame = {{0,0}, {13,14}};
+ self.frame = (CGRect){{3,5}, {13,14}};
+}
+@end
diff --git a/test/SemaObjCXX/property-synthesis-error.mm b/test/SemaObjCXX/property-synthesis-error.mm
index b6ab85ccab0d..dcd40eb66f69 100644
--- a/test/SemaObjCXX/property-synthesis-error.mm
+++ b/test/SemaObjCXX/property-synthesis-error.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class -fobjc-default-synthesize-properties %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
// rdar: //8550657
@interface NSArray @end
diff --git a/test/SemaOpenCL/endian-attr.cl b/test/SemaOpenCL/endian-attr.cl
index e851cdf90b3b..f77664310041 100644
--- a/test/SemaOpenCL/endian-attr.cl
+++ b/test/SemaOpenCL/endian-attr.cl
@@ -1,9 +1,3 @@
// RUN: %clang_cc1 -verify %s
-constant long a __attribute__((endian(host))) = 100;
-
-constant long b __attribute__((endian(device))) = 100;
-
-constant long c __attribute__((endian(none))) = 100; // expected-warning {{unknown endian 'none'}}
-
-void func() __attribute__((endian(host))); // expected-warning {{endian attribute only applies to variables}}
+constant long a __attribute__((endian(host))) = 100; // expected-warning {{unknown attribute 'endian' ignored}}
diff --git a/test/SemaOpenCL/event_t.cl b/test/SemaOpenCL/event_t.cl
index 06197d0c1796..5ab5c1011a62 100644
--- a/test/SemaOpenCL/event_t.cl
+++ b/test/SemaOpenCL/event_t.cl
@@ -8,10 +8,11 @@ constant struct evt_s {
void foo(event_t evt); // expected-note {{passing argument to parameter 'evt' here}}
-void kernel ker(event_t argevt) { // expected-error {{the event_t type cannot be used to declare a kernel function argument}}
+void kernel ker(event_t argevt) { // expected-error {{'event_t' cannot be used as the type of a kernel parameter}}
event_t e;
constant event_t const_evt; // expected-error {{the event_t type can only be used with __private address space qualifier}}
foo(e);
foo(0);
foo(5); // expected-error {{passing 'int' to parameter of incompatible type 'event_t'}}
}
+
diff --git a/test/SemaOpenCL/invalid-kernel-attrs.cl b/test/SemaOpenCL/invalid-kernel-attrs.cl
index d242eaf69296..668dc2a54d00 100644
--- a/test/SemaOpenCL/invalid-kernel-attrs.cl
+++ b/test/SemaOpenCL/invalid-kernel-attrs.cl
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -verify %s
-kernel __attribute__((vec_type_hint)) void kernel1() {} //expected-error{{attribute takes one argument}}
+kernel __attribute__((vec_type_hint)) void kernel1() {} //expected-error{{'vec_type_hint' attribute takes one argument}}
kernel __attribute__((vec_type_hint(not_type))) void kernel2() {} //expected-error{{unknown type name 'not_type'}}
@@ -10,7 +10,7 @@ kernel __attribute__((vec_type_hint(bool))) void kernel4() {} //expected-error{{
kernel __attribute__((vec_type_hint(int))) __attribute__((vec_type_hint(float))) void kernel5() {} //expected-warning{{attribute 'vec_type_hint' is already applied with different parameters}}
-kernel __attribute__((work_group_size_hint(8,16,32,4))) void kernel6() {} //expected-error{{attribute requires exactly 3 arguments}}
+kernel __attribute__((work_group_size_hint(8,16,32,4))) void kernel6() {} //expected-error{{'work_group_size_hint' attribute requires exactly 3 arguments}}
kernel __attribute__((work_group_size_hint(1,2,3))) __attribute__((work_group_size_hint(3,2,1))) void kernel7() {} //expected-warning{{attribute 'work_group_size_hint' is already applied with different parameters}}
diff --git a/test/SemaOpenCL/invalid-kernel-parameters.cl b/test/SemaOpenCL/invalid-kernel-parameters.cl
new file mode 100644
index 000000000000..de32eae8821e
--- /dev/null
+++ b/test/SemaOpenCL/invalid-kernel-parameters.cl
@@ -0,0 +1,132 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+
+
+// Disallowed: parameters with type
+// bool, half, size_t, ptrdiff_t, intptr_t, and uintptr_t
+// or a struct / union with any of these types in them
+
+// TODO: Ban int types, size_t, ptrdiff_t ...
+
+kernel void bool_arg(bool x) { } // expected-error{{'bool' cannot be used as the type of a kernel parameter}}
+
+kernel void half_arg(half x) { } // expected-error{{'half' cannot be used as the type of a kernel parameter}}
+
+typedef struct ContainsBool // expected-note{{within field of type 'ContainsBool' declared here}}
+{
+ bool x; // expected-note{{field of illegal type 'bool' declared here}}
+} ContainsBool;
+
+kernel void bool_in_struct_arg(ContainsBool x) { } // expected-error{{'ContainsBool' (aka 'struct ContainsBool') cannot be used as the type of a kernel parameter}}
+
+
+
+typedef struct FooImage2D // expected-note{{within field of type 'FooImage2D' declared here}}
+{
+ image2d_t imageField; // expected-note{{field of illegal type 'image2d_t' declared here}}
+} FooImage2D;
+
+kernel void image_in_struct_arg(FooImage2D arg) { } // expected-error{{struct kernel parameters may not contain pointers}}
+
+typedef struct Foo // expected-note{{within field of type 'Foo' declared here}}
+{
+ int* ptrField; // expected-note{{field of illegal pointer type 'int *' declared here}}
+} Foo;
+
+kernel void pointer_in_struct_arg(Foo arg) { } // expected-error{{struct kernel parameters may not contain pointers}}
+
+typedef union FooUnion // expected-note{{within field of type 'FooUnion' declared here}}
+{
+ int* ptrField; // expected-note{{field of illegal pointer type 'int *' declared here}}
+} FooUnion;
+
+kernel void pointer_in_union_arg(FooUnion arg) { }// expected-error{{union kernel parameters may not contain pointers}}
+
+typedef struct NestedPointer // expected-note 2 {{within field of type 'NestedPointer' declared here}}
+{
+ int x;
+ struct InnerNestedPointer
+ {
+ int* ptrField; // expected-note 3 {{field of illegal pointer type 'int *' declared here}}
+ } inner; // expected-note 3 {{within field of type 'struct InnerNestedPointer' declared here}}
+} NestedPointer;
+
+kernel void pointer_in_nested_struct_arg(NestedPointer arg) { }// expected-error{{struct kernel parameters may not contain pointers}}
+
+struct NestedPointerComplex // expected-note{{within field of type 'NestedPointerComplex' declared here}}
+{
+ int foo;
+ float bar;
+
+ struct InnerNestedPointerComplex
+ {
+ int innerFoo;
+ int* innerPtrField; // expected-note{{field of illegal pointer type 'int *' declared here}}
+ } inner; // expected-note{{within field of type 'struct InnerNestedPointerComplex' declared here}}
+
+ float y;
+ float z[4];
+};
+
+kernel void pointer_in_nested_struct_arg_complex(struct NestedPointerComplex arg) { }// expected-error{{struct kernel parameters may not contain pointers}}
+
+typedef struct NestedBool // expected-note 2 {{within field of type 'NestedBool' declared here}}
+{
+ int x;
+ struct InnerNestedBool
+ {
+ bool boolField; // expected-note 2 {{field of illegal type 'bool' declared here}}
+ } inner; // expected-note 2 {{within field of type 'struct InnerNestedBool' declared here}}
+} NestedBool;
+
+kernel void bool_in_nested_struct_arg(NestedBool arg) { } // expected-error{{'NestedBool' (aka 'struct NestedBool') cannot be used as the type of a kernel parameter}}
+
+// Warning emitted again for argument used in other kernel
+kernel void bool_in_nested_struct_arg_again(NestedBool arg) { } // expected-error{{'NestedBool' (aka 'struct NestedBool') cannot be used as the type of a kernel parameter}}
+
+
+// Check for note with a struct not defined inside the struct
+typedef struct NestedBool2Inner
+{
+ bool boolField; // expected-note{{field of illegal type 'bool' declared here}}
+} NestedBool2Inner;
+
+typedef struct NestedBool2 // expected-note{{within field of type 'NestedBool2' declared here}}
+{
+ int x;
+ NestedBool2Inner inner; // expected-note{{within field of type 'NestedBool2Inner' (aka 'struct NestedBool2Inner') declared here}}
+} NestedBool2;
+
+kernel void bool_in_nested_struct_2_arg(NestedBool2 arg) { } // expected-error{{'NestedBool2' (aka 'struct NestedBool2') cannot be used as the type of a kernel parameter}}
+
+
+struct InnerInner
+{
+ int* foo;
+ bool x;
+};
+
+struct Valid
+{
+ float c;
+ float d;
+};
+
+struct Inner
+{
+ struct Valid v;
+ struct InnerInner a;
+ struct Valid g;
+ struct InnerInner b;
+};
+
+struct AlsoUser // expected-note{{within field of type 'AlsoUser' declared here}}
+{
+ float x;
+ struct Valid valid1;
+ struct Valid valid2;
+ struct NestedPointer aaaa; // expected-note{{within field of type 'struct NestedPointer' declared here}}
+};
+
+kernel void pointer_in_nested_struct_arg_2(struct Valid valid, struct NestedPointer arg, struct AlsoUser also) { } // expected-error 2 {{struct kernel parameters may not contain pointers}}
diff --git a/test/SemaOpenCL/invalid-kernel.cl b/test/SemaOpenCL/invalid-kernel.cl
index fb8ce5876f93..c12bd8414e27 100644
--- a/test/SemaOpenCL/invalid-kernel.cl
+++ b/test/SemaOpenCL/invalid-kernel.cl
@@ -1,7 +1,15 @@
// RUN: %clang_cc1 -verify %s
-kernel void no_ptrptr(global int **i) { } // expected-error{{kernel argument cannot be declared as a pointer to a pointer}}
+kernel void no_ptrptr(global int **i) { } // expected-error{{kernel parameter cannot be declared as a pointer to a pointer}}
kernel int bar() { // expected-error {{kernel must have void return type}}
return 6;
}
+
+kernel void main() { // expected-error {{kernel cannot be called 'main'}}
+
+}
+
+int main() { // expected-error {{function cannot be called 'main'}}
+ return 0;
+}
diff --git a/test/SemaOpenCL/str_literals.cl b/test/SemaOpenCL/str_literals.cl
new file mode 100644
index 000000000000..da665c3fd130
--- /dev/null
+++ b/test/SemaOpenCL/str_literals.cl
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -verify
+// expected-no-diagnostics
+
+constant char * __constant x = "hello world";
+
+void foo(__constant char * a) {
+
+}
+
+void bar() {
+ foo("hello world");
+ foo(x);
+}
diff --git a/test/SemaOpenCL/vector_inc_dec_ops.cl b/test/SemaOpenCL/vector_inc_dec_ops.cl
new file mode 100644
index 000000000000..c65bbcb5b749
--- /dev/null
+++ b/test/SemaOpenCL/vector_inc_dec_ops.cl
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// expected-no-diagnostics
+
+typedef __attribute__((ext_vector_type(2))) char char2;
+typedef __attribute__((ext_vector_type(4))) unsigned int uint4;
+typedef __attribute__((ext_vector_type(8))) long long8;
+
+void vectorIncrementDecrementOps()
+{
+ char2 A = (char2)(1);
+ uint4 B = (uint4)(1);
+ long8 C = (long8)(1);
+
+ A++;
+ --A;
+ B--;
+ ++B;
+ C++;
+}
diff --git a/test/SemaTemplate/alias-nested-nontag.cpp b/test/SemaTemplate/alias-nested-nontag.cpp
index 4b5226b26ebb..2d0f0874e5e7 100644
--- a/test/SemaTemplate/alias-nested-nontag.cpp
+++ b/test/SemaTemplate/alias-nested-nontag.cpp
@@ -2,5 +2,4 @@
template<typename T> using Id = T; // expected-note {{type alias template 'Id' declared here}}
struct U { static Id<int> V; };
-Id<int> ::U::V; // expected-error {{type 'Id<int>' (aka 'int') cannot be used prior to '::' because it has no members}} \
- expected-error {{C++ requires a type specifier}}
+Id<int> ::U::V; // expected-error {{type 'Id<int>' (aka 'int') cannot be used prior to '::' because it has no members}}
diff --git a/test/SemaTemplate/alias-templates.cpp b/test/SemaTemplate/alias-templates.cpp
index 20ba6e0cb7bc..e7be184db3d6 100644
--- a/test/SemaTemplate/alias-templates.cpp
+++ b/test/SemaTemplate/alias-templates.cpp
@@ -166,3 +166,38 @@ namespace PR13136 {
return 0;
}
}
+
+namespace PR16646 {
+ namespace test1 {
+ template <typename T> struct DefaultValue { const T value=0;};
+ template <typename ... Args> struct tuple {};
+ template <typename ... Args> using Zero = tuple<DefaultValue<Args> ...>;
+ template <typename ... Args> void f(const Zero<Args ...> &t);
+ void f() {
+ f(Zero<int,double,double>());
+ }
+ }
+
+ namespace test2 {
+ template<int x> struct X {};
+ template <template<int x> class temp> struct DefaultValue { const temp<0> value; };
+ template <typename ... Args> struct tuple {};
+ template <template<int x> class... Args> using Zero = tuple<DefaultValue<Args> ...>;
+ template <template<int x> class... Args> void f(const Zero<Args ...> &t);
+ void f() {
+ f(Zero<X,X,X>());
+ }
+ }
+}
+
+namespace PR16904 {
+ template <typename,typename>
+ struct base {
+ template <typename> struct derived;
+ };
+ // FIXME: The diagnostics here are terrible.
+ template <typename T, typename U, typename V>
+ using derived = base<T, U>::template derived<V>; // expected-error {{expected a type}} expected-error {{expected ';'}}
+ template <typename T, typename U, typename V>
+ using derived2 = ::PR16904::base<T, U>::template derived<V>; // expected-error {{expected a type}} expected-error {{expected ';'}}
+}
diff --git a/test/SemaTemplate/array-to-pointer-decay.cpp b/test/SemaTemplate/array-to-pointer-decay.cpp
index 26d277d7dc05..dcf090161040 100644
--- a/test/SemaTemplate/array-to-pointer-decay.cpp
+++ b/test/SemaTemplate/array-to-pointer-decay.cpp
@@ -24,3 +24,15 @@ template <typename Type> static bool sanitize() {
return !c->start;
}
bool closure = sanitize<int>();
+
+// PR16206
+typedef struct {
+ char x[4];
+} chars;
+
+chars getChars();
+void use(char *);
+
+void test() {
+ use(getChars().x);
+}
diff --git a/test/SemaTemplate/canonical-expr-type.cpp b/test/SemaTemplate/canonical-expr-type.cpp
index 7582df5e66aa..4770c4fa3ed6 100644
--- a/test/SemaTemplate/canonical-expr-type.cpp
+++ b/test/SemaTemplate/canonical-expr-type.cpp
@@ -22,14 +22,10 @@ void f0a(T x, __typeof__(f(N)) y) { } // expected-note{{previous}}
void f(int);
template<typename T, T N>
-void f0a(T x, __typeof__(f(N)) y) { } // expected-error{{redefinition}} \
- // expected-note{{previous}}
+void f0a(T x, __typeof__(f(N)) y) { } // expected-error{{redefinition}}
void f(float);
-template<typename T, T N>
-void f0a(T x, __typeof__(f(N)) y) { } // expected-error{{redefinition}}
-
// Test dependently-sized array canonicalization
template<typename T, int N, int M>
void f1(T (&array)[N + M]) { } // expected-note{{previous}}
diff --git a/test/SemaTemplate/class-template-decl.cpp b/test/SemaTemplate/class-template-decl.cpp
index fe23d9241108..e65da2b312f6 100644
--- a/test/SemaTemplate/class-template-decl.cpp
+++ b/test/SemaTemplate/class-template-decl.cpp
@@ -50,7 +50,9 @@ void f() {
template<typename T> class X; // expected-error{{expression}}
}
-template<typename T> class X1 var; // expected-error{{declared as a template}}
+template<typename T> class X1 var; // expected-warning{{variable templates are a C++1y extension}} \
+ // expected-error {{variable has incomplete type 'class X1'}} \
+ // expected-note {{forward declaration of 'X1'}}
namespace M {
}
diff --git a/test/SemaTemplate/constexpr-instantiate.cpp b/test/SemaTemplate/constexpr-instantiate.cpp
index 80c4aaf85601..95d6c23b9e98 100644
--- a/test/SemaTemplate/constexpr-instantiate.cpp
+++ b/test/SemaTemplate/constexpr-instantiate.cpp
@@ -201,8 +201,8 @@ namespace NoInstantiationWhenSelectingOverload {
int n;
};
- void f(S);
- void f(int);
+ int f(S);
+ int f(int);
void g() { f(0); }
void h() { (void)sizeof(f(0)); }
diff --git a/test/SemaTemplate/deduction-crash.cpp b/test/SemaTemplate/deduction-crash.cpp
index 0714c5e51648..ff7421a910bd 100644
--- a/test/SemaTemplate/deduction-crash.cpp
+++ b/test/SemaTemplate/deduction-crash.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only %s 2>&1| FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only %s -std=c++11 2>&1| FileCheck %s
// Note that the error count below doesn't matter. We just want to
// make sure that the parser doesn't crash.
-// CHECK: 15 errors
+// CHECK: 16 errors
// PR7511
template<a>
@@ -110,3 +110,35 @@ namespace libcxx_test {
template <class T> struct B {};
__pointer_traits_element_type<B<int>, true>::type x;
}
+
+namespace PR14281_part1 {
+ template <class P, int> struct A;
+ template <class P> struct A<P, 1>;
+ template <template <class, int> class S, class T> struct A<S<T, 1>, 1> {
+ typedef char type;
+ };
+ template <class T, int i> struct B {};
+ A<B<int, 1>, 1>::type x;
+}
+
+namespace PR14281_part2 {
+ typedef decltype(nullptr) nullptr_t;
+ template <class P, nullptr_t> struct A;
+ template <class P> struct A<P, nullptr>;
+ template <template <class, nullptr_t> class S, class T> struct A<S<T, nullptr>, nullptr> {
+ typedef char type;
+ };
+ template <class T, nullptr_t i> struct B {};
+ A<B<int, nullptr>, nullptr>::type x;
+}
+
+namespace PR14281_part3 {
+ extern int some_decl;
+ template <class P, int*> struct A;
+ template <class P> struct A<P, &some_decl>;
+ template <template <class, int*> class S, class T> struct A<S<T, &some_decl>, &some_decl> {
+ typedef char type;
+ };
+ template <class T, int* i> struct B {};
+ A<B<int, &some_decl>, &some_decl>::type x;
+}
diff --git a/test/SemaTemplate/default-arguments-cxx0x.cpp b/test/SemaTemplate/default-arguments-cxx0x.cpp
index 4c815f655875..4cfd7a5843f0 100644
--- a/test/SemaTemplate/default-arguments-cxx0x.cpp
+++ b/test/SemaTemplate/default-arguments-cxx0x.cpp
@@ -25,3 +25,34 @@ void g1() {
float &fr = f1(15);
int &ir = f1(HasValue());
}
+
+namespace PR16689 {
+ template <typename T1, typename T2> class tuple {
+ public:
+ template <typename = T2>
+ constexpr tuple() {}
+ };
+ template <class X, class... Y> struct a : public X {
+ using X::X;
+ };
+ auto x = a<tuple<int, int> >();
+}
+
+namespace PR16975 {
+ template <typename...> struct is {
+ constexpr operator bool() const { return false; }
+ };
+
+ template <typename... Types>
+ struct bar {
+ template <typename T,
+ bool = is<Types...>()>
+ bar(T);
+ };
+
+ struct baz : public bar<> {
+ using bar::bar;
+ };
+
+ baz data{0};
+}
diff --git a/test/SemaTemplate/default-arguments.cpp b/test/SemaTemplate/default-arguments.cpp
index 6391369aa5c4..439a30392118 100644
--- a/test/SemaTemplate/default-arguments.cpp
+++ b/test/SemaTemplate/default-arguments.cpp
@@ -47,11 +47,13 @@ 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<typename U = typename X1<T>::type> // expected-error{{no type named 'type' in 'X1<int>'}} \
+ // expected-error{{no type named 'type' in 'X1<char>'}}
+ struct Inner1 { }; // expected-note{{template is declared here}}
- template<T Value = X1<T>::value> // expected-error{{no member named 'value'}}
- struct NonType1 { };
+ template<T Value = X1<T>::value> // expected-error{{no member named 'value' in 'X1<int>'}} \
+ // expected-error{{no member named 'value' in 'X1<char>'}}
+ struct NonType1 { }; // expected-note{{template is declared here}}
template<T Value>
struct Inner2 { };
@@ -67,17 +69,17 @@ struct X2 {
};
};
-X2<int> x2i;
+X2<int> x2i; // expected-note{{in instantiation of template class 'X2<int>' requested here}}
X2<int>::Inner1<float> x2iif;
-X2<int>::Inner1<> x2bad; // expected-note{{instantiation of default argument}}
+X2<int>::Inner1<> x2bad; // expected-error{{too few template arguments for class template 'Inner1'}}
X2<int>::NonType1<'a'> x2_nontype1;
-X2<int>::NonType1<> x2_nontype1_bad; // expected-note{{instantiation of default argument}}
+X2<int>::NonType1<> x2_nontype1_bad; // expected-error{{too few template arguments for class template 'NonType1'}}
// Check multi-level substitution into template type arguments
X2<int>::Inner3<float>::VeryInner<> vi;
-X2<char>::Inner3<int>::NonType2<> x2_deep_nontype;
+X2<char>::Inner3<int>::NonType2<> x2_deep_nontype; // expected-note{{in instantiation of template class 'X2<char>' requested here}}
template<typename T, typename U>
struct is_same { static const bool value = false; };
@@ -136,3 +138,24 @@ namespace PR9643 {
vector<int, allocator<int> > v = initializer<vector>(5);
}
}
+
+namespace PR16288 {
+ template<typename X>
+ struct S {
+ template<typename T = int, typename U> // expected-warning {{C++11}}
+ void f();
+ };
+ template<typename X>
+ template<typename T, typename U>
+ void S<X>::f() {}
+}
+
+namespace DR1635 {
+ template <class T> struct X {
+ template <class U = typename T::type> static void f(int) {} // expected-error {{type 'int' cannot be used prior to '::' because it has no members}} \
+ // expected-warning {{C++11}}
+ static void f(...) {}
+ };
+
+ int g() { X<int>::f(0); } // expected-note {{in instantiation of template class 'DR1635::X<int>' requested here}}
+}
diff --git a/test/SemaTemplate/dependent-expr.cpp b/test/SemaTemplate/dependent-expr.cpp
index d75b0f3e3029..2c26ec53a0ae 100644
--- a/test/SemaTemplate/dependent-expr.cpp
+++ b/test/SemaTemplate/dependent-expr.cpp
@@ -72,3 +72,24 @@ namespace PR8795 {
return data[0];
}
}
+
+template<typename T> struct CastDependentIntToPointer {
+ static void* f() {
+ T *x;
+ return ((void*)(((unsigned long)(x)|0x1ul)));
+ }
+};
+
+// Regression test for crasher in r194540.
+namespace PR10837 {
+ typedef void t(int);
+ template<typename> struct A {
+ void f();
+ static t g;
+ };
+ t *p;
+ template<typename T> void A<T>::f() {
+ p = g;
+ }
+ template struct A<int>;
+}
diff --git a/test/SemaTemplate/dependent-names.cpp b/test/SemaTemplate/dependent-names.cpp
index fa47ef535815..4d4aafa918cb 100644
--- a/test/SemaTemplate/dependent-names.cpp
+++ b/test/SemaTemplate/dependent-names.cpp
@@ -354,7 +354,6 @@ namespace rdar12629723 {
struct A : public B { // expected-note{{'rdar12629723::X::A' declared here}}
virtual void foo() { }
};
- struct B;
struct D : T::foo { };
struct E : D { };
@@ -388,3 +387,15 @@ namespace PR14695_A { void PR14695_f(PR14695_X); } // expected-note {{'PR14695_f
template<typename T> void PR14695_g(T t) { PR14695_f(t); } // expected-error {{call to function 'PR14695_f' that is neither visible in the template definition nor found by argument-dependent lookup}}
using namespace PR14695_A;
template void PR14695_g(PR14695_X); // expected-note{{requested here}}
+
+namespace OperatorNew {
+ template<typename T> void f(T t) {
+ operator new(100, t); // expected-error{{call to function 'operator new' that is neither visible in the template definition nor found by argument-dependent lookup}}
+ // FIXME: This should give the same error.
+ new (t) int;
+ }
+ struct X {};
+};
+using size_t = decltype(sizeof(0));
+void *operator new(size_t, OperatorNew::X); // expected-note-re {{should be declared prior to the call site$}}
+template void OperatorNew::f(OperatorNew::X); // expected-note {{instantiation of}}
diff --git a/test/SemaTemplate/derived.cpp b/test/SemaTemplate/derived.cpp
index 7b91f9a3ed3f..ce20cea7dcc5 100644
--- a/test/SemaTemplate/derived.cpp
+++ b/test/SemaTemplate/derived.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
template<typename T> class vector2 {};
template<typename T> class vector : vector2<T> {};
@@ -28,3 +29,26 @@ namespace rdar13267210 {
}
};
}
+
+namespace PR16292 {
+ class IncompleteClass; // expected-note{{forward declaration}}
+ class BaseClass {
+ IncompleteClass Foo; // expected-error{{field has incomplete type}}
+ };
+ template<class T> class DerivedClass : public BaseClass {};
+ void* p = new DerivedClass<void>;
+}
+
+namespace rdar14183893 {
+ class Typ { // expected-note {{not complete}}
+ Typ x; // expected-error {{incomplete type}}
+ };
+
+ template <unsigned C> class B : Typ {};
+ typedef B<0> TFP;
+
+ class A {
+ TFP m_p;
+ void Enable() { 0, A(); } // expected-warning {{unused}}
+ };
+}
diff --git a/test/SemaTemplate/destructor-template.cpp b/test/SemaTemplate/destructor-template.cpp
index 6806c24a84eb..4e1af9ad1f96 100644
--- a/test/SemaTemplate/destructor-template.cpp
+++ b/test/SemaTemplate/destructor-template.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
template<typename A> class s0 {
@@ -76,3 +76,9 @@ namespace rdar13140795 {
Marshal<int>::gc();
}
}
+
+namespace PR16852 {
+ template<typename T> struct S { int a; T x; };
+ template<typename T> decltype(S<T>().~S()) f(); // expected-note {{candidate template ignored: couldn't infer template argument 'T'}}
+ void g() { f(); } // expected-error {{no matching function for call to 'f'}}
+}
diff --git a/test/SemaTemplate/exception-spec-crash.cpp b/test/SemaTemplate/exception-spec-crash.cpp
new file mode 100644
index 000000000000..4d9355974c9e
--- /dev/null
+++ b/test/SemaTemplate/exception-spec-crash.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -DCXX_EXCEPTIONS -fsyntax-only -verify %s
+
+template <class _Tp> struct is_nothrow_move_constructible {
+ static const bool value = false;
+};
+
+template <class _Tp>
+class allocator;
+
+template <>
+class allocator<char> {};
+
+template <class _Allocator>
+class basic_string {
+ typedef _Allocator allocator_type;
+ basic_string(basic_string &&__str)
+ noexcept(is_nothrow_move_constructible<allocator_type>::value);
+};
+
+class Foo {
+ Foo(Foo &&) noexcept = default;
+#ifdef CXX_EXCEPTIONS
+// expected-error@-2 {{does not match the calculated}}
+#else
+// expected-no-diagnostics
+#endif
+ Foo &operator=(Foo &&) noexcept = default;
+ basic_string<allocator<char> > vectorFoo_;
+};
diff --git a/test/SemaTemplate/explicit-instantiation.cpp b/test/SemaTemplate/explicit-instantiation.cpp
index e3e77d082844..d04046462a04 100644
--- a/test/SemaTemplate/explicit-instantiation.cpp
+++ b/test/SemaTemplate/explicit-instantiation.cpp
@@ -15,9 +15,9 @@ struct X0 {
return x + 1; // expected-error{{invalid operands}}
}
T* f0(T*, T*) { return T(); } // expected-warning{{expression which evaluates to zero treated as a null pointer constant of type 'int *'}}
-
- template<typename U>
- T f0(T, U) { return T(); }
+
+ template <typename U> T f0(T, U) { return T(); } // expected-note {{candidate template ignored: could not match 'int (int, U)' against 'int (int) const'}} \
+ // expected-note {{candidate template ignored: could not match 'int' against 'int *'}}
};
template<typename T>
@@ -59,13 +59,14 @@ template int *X2::f1(int *); // okay
template void X2::f2(int *, int *); // expected-error{{ambiguous}}
-
-template<typename T> void print_type() { }
+template <typename T>
+void print_type() {} // expected-note {{candidate template ignored: could not match 'void ()' against 'void (float *)'}}
template void print_type<int>();
template void print_type<float>();
-template<typename T> void print_type(T*) { }
+template <typename T>
+void print_type(T *) {} // expected-note {{candidate template ignored: could not match 'void (int *)' against 'void (float *)'}}
template void print_type(int*);
template void print_type<int>(float*); // expected-error{{does not refer}}
@@ -94,7 +95,7 @@ namespace PR7622 {
template<typename,typename>
struct basic_streambuf{friend bob<>()}; // expected-error{{unknown type name 'bob'}} \
- // expected-error{{expected member name or ';' after declaration specifiers}}
+ // expected-error{{expected member name or ';' after declaration specifiers}}
template struct basic_streambuf<int>;
}
@@ -105,3 +106,46 @@ class TC1 {
void foo() { }
};
};
+
+namespace PR8020 {
+ template <typename T> struct X { X() {} };
+ template<> struct X<int> { X(); };
+ template X<int>::X() {} // expected-error{{function cannot be defined in an explicit instantiation}}
+}
+
+namespace PR10086 {
+ template void foobar(int i) {} // expected-error{{function cannot be defined in an explicit instantiation}}
+ int func() {
+ foobar(5);
+ }
+}
+
+namespace undefined_static_data_member {
+ template<typename T> struct A {
+ static int a; // expected-note {{here}}
+ template<typename U> static int b; // expected-note {{here}} expected-warning {{extension}}
+ };
+ struct B {
+ template<typename U> static int c; // expected-note {{here}} expected-warning {{extension}}
+ };
+
+ template int A<int>::a; // expected-error {{explicit instantiation of undefined static data member 'a' of class template 'undefined_static_data_member::A<int>'}}
+ template int A<int>::b<int>; // expected-error {{explicit instantiation of undefined variable template 'undefined_static_data_member::A<int>::b<int>'}}
+ template int B::c<int>; // expected-error {{explicit instantiation of undefined variable template 'undefined_static_data_member::B::c<int>'}}
+
+
+ template<typename T> struct C {
+ static int a;
+ template<typename U> static int b; // expected-warning {{extension}}
+ };
+ struct D {
+ template<typename U> static int c; // expected-warning {{extension}}
+ };
+ template<typename T> int C<T>::a;
+ template<typename T> template<typename U> int C<T>::b; // expected-warning {{extension}}
+ template<typename U> int D::c; // expected-warning {{extension}}
+
+ template int C<int>::a;
+ template int C<int>::b<int>;
+ template int D::c<int>;
+}
diff --git a/test/SemaTemplate/explicit-specialization-member.cpp b/test/SemaTemplate/explicit-specialization-member.cpp
index 7fe6bf37d752..07d73894468f 100644
--- a/test/SemaTemplate/explicit-specialization-member.cpp
+++ b/test/SemaTemplate/explicit-specialization-member.cpp
@@ -19,3 +19,31 @@ namespace PR6161 {
};
numpunct<char>::~numpunct(); // expected-error{{expected the class name after '~' to name a destructor}}
}
+
+namespace PR12331 {
+ template<typename T> struct S {
+ struct U { static const int n = 5; };
+ enum E { e = U::n }; // expected-note {{implicit instantiation first required here}}
+ int arr[e];
+ };
+ template<> struct S<int>::U { static const int n = sizeof(int); }; // expected-error {{explicit specialization of 'U' after instantiation}}
+}
+
+namespace PR18246 {
+ template<typename T>
+ class Baz {
+ public:
+ template<int N> void bar();
+ };
+
+ template<typename T>
+ template<int N>
+ void Baz<T>::bar() {
+ }
+
+ // FIXME: Don't suggest the 'template<>' correction here, because this cannot
+ // be an explicit specialization.
+ template<typename T>
+ void Baz<T>::bar<0>() { // expected-error {{requires 'template<>'}}
+ }
+}
diff --git a/test/SemaTemplate/extension-sfinae.cpp b/test/SemaTemplate/extension-sfinae.cpp
new file mode 100644
index 000000000000..b745e0d9896f
--- /dev/null
+++ b/test/SemaTemplate/extension-sfinae.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -verify %s -pedantic-errors -DPEDANTIC
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -verify %s -Wno-c++11-narrowing
+
+namespace cce_narrowing {
+ decltype(short{123456}) a;
+#if PEDANTIC
+ // expected-error@-2 {{cannot be narrowed}} expected-note@-2 {{cast}}
+#endif
+
+ template<typename T> int f(decltype(T{123456})); // expected-note {{cannot be narrowed}}
+ int b = f<short>(0); // expected-error {{no match}}
+}
diff --git a/test/SemaTemplate/friend-template.cpp b/test/SemaTemplate/friend-template.cpp
index 8a478777eb7e..e9b2b9b8e64e 100644
--- a/test/SemaTemplate/friend-template.cpp
+++ b/test/SemaTemplate/friend-template.cpp
@@ -232,16 +232,23 @@ namespace PR10660 {
}
namespace rdar11147355 {
- template <class T>
+ template <class T>
struct A {
template <class U> class B;
- template <class S> template <class U> friend class A<S>::B;
+ template <class S> template <class U> friend class A<S>::B; // expected-warning {{dependent nested name specifier 'A<S>::' for friend template declaration is not supported; ignoring this friend declaration}}
+ private:
+ int n; // expected-note {{here}}
};
-
+
template <class S> template <class U> class A<S>::B {
- };
-
+ public:
+ // FIXME: This should be permitted.
+ int f(A<S*> a) { return a.n; } // expected-error {{private}}
+ };
+
A<double>::B<double> ab;
+ A<double*> a;
+ int k = ab.f(a); // expected-note {{instantiation of}}
}
namespace RedeclUnrelated {
diff --git a/test/SemaTemplate/function-template-specialization-noreturn.cpp b/test/SemaTemplate/function-template-specialization-noreturn.cpp
new file mode 100644
index 000000000000..3e1f61855a50
--- /dev/null
+++ b/test/SemaTemplate/function-template-specialization-noreturn.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// Split from function-template-specialization.cpp because the noreturn warning
+// requires analysis-based warnings, which the other errors in that test case
+// disable.
+
+template <int N> void __attribute__((noreturn)) f3() { __builtin_unreachable(); }
+template <> void f3<1>() { } // expected-warning {{function declared 'noreturn' should not return}}
diff --git a/test/SemaTemplate/function-template-specialization.cpp b/test/SemaTemplate/function-template-specialization.cpp
index a0d41b205344..6327ff64c336 100644
--- a/test/SemaTemplate/function-template-specialization.cpp
+++ b/test/SemaTemplate/function-template-specialization.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-template<int N> void f0(int (&array)[N]);
+template <int N>
+void f0(int (&array)[N]); // expected-note {{candidate template ignored: could not match 'int' against 'char'}}
// Simple function template specialization (using overloading)
template<> void f0(int (&array)[1]);
@@ -46,3 +47,12 @@ namespace PR8295 {
template <typename T> void f(T t) {}
template <typename T> void f<T*>(T* t) {} // expected-error{{function template partial specialization is not allowed}}
}
+
+class Foo {
+ template<class T>
+ static void Bar(const T& input);
+
+ // Don't crash here.
+ template<>
+ static void Bar(const long& input) {} // expected-error{{explicit specialization of 'Bar' in class scope}}
+};
diff --git a/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp b/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
index 97bf00303bbe..5f43ea2c27a1 100644
--- a/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
+++ b/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
@@ -44,13 +44,14 @@ namespace dr1330_example {
A<int>().f(42);
}
+ struct S {
+ template<typename T>
+ static int f() noexcept(noexcept(A<T>().f("boo!"))) { return 0; } // \
+ // expected-note {{instantiation of exception spec}}
+ typedef decltype(f<S>()) X;
+ };
+
int test2() {
- struct S {
- template<typename T>
- static int f() noexcept(noexcept(A<T>().f("boo!"))) { return 0; } // \
- // expected-note {{instantiation of exception spec}}
- typedef decltype(f<S>()) X;
- };
S().f<S>(); // ok
S().f<int>(); // expected-note {{instantiation of exception spec}}
}
diff --git a/test/SemaTemplate/instantiate-expr-5.cpp b/test/SemaTemplate/instantiate-expr-5.cpp
index 13b7eae21fd4..c42c2a964dc2 100644
--- a/test/SemaTemplate/instantiate-expr-5.cpp
+++ b/test/SemaTemplate/instantiate-expr-5.cpp
@@ -36,3 +36,13 @@ namespace PR5880 {
template void test_anon_union<int>();
}
+
+namespace AddrOfClassMember {
+ template <typename T> struct S {
+ int n;
+ static void f() {
+ +T::n; // expected-error {{invalid use of member}}
+ }
+ };
+ void g() { S<S<int> >::f(); } // expected-note {{in instantiation of}}
+}
diff --git a/test/SemaTemplate/instantiate-function-params.cpp b/test/SemaTemplate/instantiate-function-params.cpp
index 54847e419086..5bfae537c04d 100644
--- a/test/SemaTemplate/instantiate-function-params.cpp
+++ b/test/SemaTemplate/instantiate-function-params.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple i686-unknown-unknown -fsyntax-only -verify %s
// PR6619
template<bool C> struct if_c { };
@@ -81,10 +81,21 @@ namespace InstantiateFunctionTypedef {
template<typename T>
struct X {
typedef int functype(int, int);
- functype func;
+ functype func1;
+ __attribute__((noreturn)) functype func2;
+
+ typedef int stdfunctype(int, int) __attribute__((stdcall));
+ __attribute__((stdcall)) functype stdfunc1;
+ stdfunctype stdfunc2;
+
+ __attribute__((pcs("aapcs"))) functype pcsfunc; // expected-warning {{calling convention 'pcs' ignored for this target}}
};
void f(X<int> x) {
- (void)x.func(1, 2);
+ (void)x.func1(1, 2);
+ (void)x.func2(1, 2);
+ (void)x.stdfunc1(1, 2);
+ (void)x.stdfunc2(1, 2);
+ (void)x.pcsfunc(1, 2);
}
}
diff --git a/test/SemaTemplate/instantiate-init.cpp b/test/SemaTemplate/instantiate-init.cpp
index 6a1a57ca659e..22c70be3a8dc 100644
--- a/test/SemaTemplate/instantiate-init.cpp
+++ b/test/SemaTemplate/instantiate-init.cpp
@@ -118,3 +118,18 @@ namespace PR13064 {
template<typename T> struct C { T a = { 0 }; }; // expected-error{{explicit}}
C<A> c; // expected-note{{here}}
}
+
+namespace PR16903 {
+ // Make sure we properly instantiate list-initialization.
+ template<typename T>
+ void fun (T it) {
+ int m = 0;
+ for (int i = 0; i < 4; ++i, ++it){
+ m |= long{char{*it}};
+ }
+ }
+ int test() {
+ char in[4] = {0,0,0,0};
+ fun(in);
+ }
+}
diff --git a/test/SemaTemplate/instantiate-local-class.cpp b/test/SemaTemplate/instantiate-local-class.cpp
index c151fbb9a5ba..2bf24c2188e6 100644
--- a/test/SemaTemplate/instantiate-local-class.cpp
+++ b/test/SemaTemplate/instantiate-local-class.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify %s
+// RUN: %clang_cc1 -verify -std=c++11 %s
// expected-no-diagnostics
template<typename T>
void f0() {
@@ -66,3 +66,118 @@ namespace PR8801 {
template void foo<Y>();
}
+
+namespace TemplatePacksAndLambdas {
+ template <typename ...T> int g(T...);
+ struct S {
+ template <typename ...T> static void f(int f = g([]{ static T t; return ++t; }()...)) {}
+ };
+ void h() { S::f<int, int, int>(); }
+}
+
+namespace PR9685 {
+ template <class Thing> void forEach(Thing t) { t.func(); }
+
+ template <typename T> void doIt() {
+ struct Functor {
+ void func() { (void)i; }
+ int i;
+ };
+
+ forEach(Functor());
+ }
+
+ void call() {
+ doIt<int>();
+ }
+}
+
+namespace PR12702 {
+ struct S {
+ template <typename F> bool apply(F f) { return f(); }
+ };
+
+ template <typename> struct T {
+ void foo() {
+ struct F {
+ int x;
+
+ bool operator()() { return x == 0; }
+ };
+
+ S().apply(F());
+ }
+ };
+
+ void call() { T<int>().foo(); }
+}
+
+namespace PR17139 {
+ template <class T> void foo(const T &t) { t.foo(); }
+
+ template <class F> void bar(F *f) {
+ struct B {
+ F *fn;
+ void foo() const { fn(); }
+ } b = { f };
+ foo(b);
+ }
+
+ void go() {}
+
+ void test() { bar(go); }
+}
+
+namespace PR17740 {
+class C {
+public:
+ template <typename T> static void foo(T function);
+ template <typename T> static void bar(T function);
+ template <typename T> static void func(T function);
+};
+
+template <typename T> void C::foo(T function) { function(); }
+
+template <typename T> void C::bar(T function) {
+ foo([&function]() { function(); });
+}
+
+template <typename T> void C::func(T function) {
+ struct Struct {
+ T mFunction;
+
+ Struct(T function) : mFunction(function) {};
+
+ void operator()() {
+ mFunction();
+ };
+ };
+
+ bar(Struct(function));
+}
+
+void call() {
+ C::func([]() {});
+}
+}
+
+namespace PR14373 {
+ struct function {
+ template <typename _Functor> function(_Functor __f) { __f(); }
+ };
+ template <typename Func> function exec_func(Func f) {
+ struct functor {
+ functor(Func f) : func(f) {}
+ void operator()() const { func(); }
+ Func func;
+ };
+ return functor(f);
+ }
+ struct Type {
+ void operator()() const {}
+ };
+ int call() {
+ exec_func(Type());
+ return 0;
+ }
+}
diff --git a/test/SemaTemplate/instantiate-member-class.cpp b/test/SemaTemplate/instantiate-member-class.cpp
index 7b42a27d6b2c..3f49606b86e5 100644
--- a/test/SemaTemplate/instantiate-member-class.cpp
+++ b/test/SemaTemplate/instantiate-member-class.cpp
@@ -91,13 +91,11 @@ namespace test2 {
typedef int X;
};
typename Foo::X x;
- class Foo;
};
template class B<int>;
template <typename T> class C {
class Foo;
- class Foo;
};
template <typename T> class C<T>::Foo {
int x;
diff --git a/test/SemaTemplate/instantiate-member-pointers.cpp b/test/SemaTemplate/instantiate-member-pointers.cpp
index 0db90e3cbf12..4757870d13b7 100644
--- a/test/SemaTemplate/instantiate-member-pointers.cpp
+++ b/test/SemaTemplate/instantiate-member-pointers.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
struct Y {
int x;
};
@@ -65,3 +65,10 @@ namespace ValueDepMemberPointer {
}
S<int> s;
}
+
+namespace PR18192 {
+ struct A { struct { int n; }; };
+ template<int A::*> struct X {};
+ constexpr int A::*p = &A::n;
+ X<p> x; // expected-error{{not a pointer to member constant}}
+}
diff --git a/test/SemaTemplate/instantiate-overload-candidates.cpp b/test/SemaTemplate/instantiate-overload-candidates.cpp
index 7542dbd8ab9b..6b156a20a4cb 100644
--- a/test/SemaTemplate/instantiate-overload-candidates.cpp
+++ b/test/SemaTemplate/instantiate-overload-candidates.cpp
@@ -26,7 +26,7 @@ template<typename T> struct X {
static T f() { T::error; } // expected-error {{has no members}}
static T f(bool);
};
-void (*p)() = &X<void>().f; // expected-note {{instantiation of}}
+void (*p)() = &X<void>::f; // expected-note {{instantiation of}}
namespace PR13098 {
struct A {
diff --git a/test/SemaTemplate/instantiate-partial-spec.cpp b/test/SemaTemplate/instantiate-partial-spec.cpp
new file mode 100644
index 000000000000..1e820e411ae3
--- /dev/null
+++ b/test/SemaTemplate/instantiate-partial-spec.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -std=c++1y -verify %s
+// expected-no-diagnostics
+
+template<typename T> struct A {
+ template<typename U> struct B;
+ template<typename U> struct B<U*>;
+};
+template<typename T> template<typename U> struct A<T>::B<U*> {};
+template struct A<int>;
+A<int>::B<int*> b;
+
+
+template<typename T> struct B {
+ template<typename U> static const int var1;
+ template<typename U> static const int var1<U*>;
+
+ template<typename U> static const int var2;
+};
+template<typename T> template<typename U> const int B<T>::var1<U*> = 1;
+template<typename T> template<typename U> const int B<T>::var2<U*> = 1;
+template struct B<int>;
+int b_test1[B<int>::var1<int*>];
+int b_test2[B<int>::var2<int*>];
diff --git a/test/SemaTemplate/instantiate-using-decl.cpp b/test/SemaTemplate/instantiate-using-decl.cpp
index 1bfcb7a86508..a6a4ea0e0f6d 100644
--- a/test/SemaTemplate/instantiate-using-decl.cpp
+++ b/test/SemaTemplate/instantiate-using-decl.cpp
@@ -80,3 +80,27 @@ namespace test3 {
b.f1();
}
}
+
+namespace PR16936 {
+ // Make sure both using decls are properly considered for
+ // overload resolution.
+ template<class> struct A {
+ void access(int);
+ };
+ template<class> struct B {
+ void access();
+ };
+ template<class CELL> struct X : public A<CELL>, public B<CELL> {
+ using A<CELL>::access;
+ using B<CELL>::access;
+
+ void f() {
+ access(0);
+ }
+ };
+
+ void f() {
+ X<int> x;
+ x.f();
+ }
+}
diff --git a/test/SemaTemplate/local-member-templates.cpp b/test/SemaTemplate/local-member-templates.cpp
deleted file mode 100644
index 3cdf5df8d143..000000000000
--- a/test/SemaTemplate/local-member-templates.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-// RUN: %clang_cc1 -std=c++1y -verify %s
-// RUN: %clang_cc1 -std=c++1y -verify %s -fdelayed-template-parsing
-
-namespace nested_local_templates_1 {
-
-template <class T> struct Outer {
- template <class U> int outer_mem(T t, U u) {
- struct Inner {
- template <class V> int inner_mem(T t, U u, V v) {
- struct InnerInner {
- template <class W> int inner_inner_mem(W w, T t, U u, V v) {
- return 0;
- }
- };
- InnerInner().inner_inner_mem("abc", t, u, v);
- return 0;
- }
- };
- Inner i;
- i.inner_mem(t, u, 3.14);
- return 0;
- }
-
- template <class U> int outer_mem(T t, U *u);
-};
-
-template int Outer<int>::outer_mem(int, char);
-
-template <class T> template <class U> int Outer<T>::outer_mem(T t, U *u) {
- struct Inner {
- template <class V>
- int inner_mem(T t, U u, V v) { //expected-note{{candidate function}}
- struct InnerInner {
- template <class W> int inner_inner_mem(W w, T t, U u, V v) { return 0; }
- };
- InnerInner().inner_inner_mem("abc", t, u, v);
- return 0;
- }
- };
- Inner i;
- i.inner_mem(t, U{}, i);
- i.inner_mem(t, u, 3.14); //expected-error{{no matching member function for call to 'inner}}
- return 0;
-}
-
-template int Outer<int>::outer_mem(int, char *); //expected-note{{in instantiation of function}}
-
-} // end ns
-
-namespace nested_local_templates_2 {
-
-template <class T> struct Outer {
- template <class U> void outer_mem(T t, U u) {
- struct Inner {
- template <class V> struct InnerTemplateClass {
- template <class W>
- void itc_mem(T t, U u, V v, W w) { //expected-note{{candidate function}}
- struct InnerInnerInner {
- template <class X> void iii_mem(X x) {}
- };
- InnerInnerInner i;
- i.iii_mem("abc");
- }
- };
- };
- Inner i;
- typename Inner::template InnerTemplateClass<Inner> ii;
- ii.itc_mem(t, u, i, "jim");
- ii.itc_mem(t, u, 0, "abd"); //expected-error{{no matching member function}}
- }
-};
-
-template void
-Outer<int>::outer_mem(int, char); //expected-note{{in instantiation of}}
-
-}
diff --git a/test/SemaTemplate/lookup-dependent-bases.cpp b/test/SemaTemplate/lookup-dependent-bases.cpp
index 4fcfbd196407..61fca4a2a45f 100644
--- a/test/SemaTemplate/lookup-dependent-bases.cpp
+++ b/test/SemaTemplate/lookup-dependent-bases.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fms-extensions -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fms-compatibility -fsyntax-only -verify %s
// expected-no-diagnostics
class C {
diff --git a/test/SemaTemplate/ms-class-specialization-class-scope.cpp b/test/SemaTemplate/ms-class-specialization-class-scope.cpp
new file mode 100644
index 000000000000..3ebb1c9c555e
--- /dev/null
+++ b/test/SemaTemplate/ms-class-specialization-class-scope.cpp
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -fms-extensions -fsyntax-only -verify %s -Wno-microsoft
+// RUN: %clang_cc1 -fms-extensions -fdelayed-template-parsing -fsyntax-only -verify %s -Wno-microsoft
+
+class A {
+public:
+ template<typename T> struct X { typedef int x; };
+
+ X<int>::x a; // expected-note {{implicit instantiation first required here}}
+
+ template<> struct X<int>; // expected-error {{explicit specialization of 'A::X<int>' after instantiation}}
+ template<> struct X<char>; // expected-note {{forward declaration}}
+
+ X<char>::x b; // expected-error {{incomplete type 'A::X<char>' named in nested name specifier}}
+
+ template<> struct X<double> {
+ typedef int y;
+ };
+
+ X<double>::y c;
+
+ template<> struct X<float> {}; // expected-note {{previous definition is here}}
+ template<> struct X<float> {}; // expected-error {{redefinition of 'A::X<float>'}}
+};
+
+A::X<void>::x axv;
+A::X<float>::x axf; // expected-error {{no type named 'x'}}
+
+template<class T> class B {
+public:
+ template<typename U> struct X { typedef int x; };
+
+ typename X<int>::x a; // expected-note {{implicit instantiation first required here}}
+
+ template<> struct X<int>; // expected-error {{explicit specialization of 'X<int>' after instantiation}}
+ template<> struct X<char>; // expected-note {{forward declaration}}
+
+ typename X<char>::x b; // expected-error {{incomplete type 'B<float>::X<char>' named in nested name specifier}}
+
+ template<> struct X<double> {
+ typedef int y;
+ };
+
+ typename X<double>::y c;
+
+ template<> struct X<float> {}; // expected-note {{previous definition is here}}
+ template<> struct X<T> {}; // expected-error {{redefinition of 'X<float>'}}
+};
+
+B<float> b; // expected-note {{in instantiation of}}
diff --git a/test/SemaTemplate/ms-lookup-template-base-classes.cpp b/test/SemaTemplate/ms-lookup-template-base-classes.cpp
index cb1a7f50b719..72ce056063ea 100644
--- a/test/SemaTemplate/ms-lookup-template-base-classes.cpp
+++ b/test/SemaTemplate/ms-lookup-template-base-classes.cpp
@@ -196,3 +196,43 @@ void f() {
}
} // namespace PR12701
+
+namespace PR16014 {
+
+struct A {
+ int a;
+ static int sa;
+};
+template <typename T> struct B : T {
+ int foo() { return a; }
+ int *bar() { return &a; }
+ int baz() { return T::a; }
+ int T::*qux() { return &T::a; }
+ static int T::*stuff() { return &T::a; }
+ static int stuff1() { return T::sa; }
+ static int *stuff2() { return &T::sa; }
+};
+
+template <typename T> struct C : T {
+ int foo() { return b; } // expected-error {{no member named 'b' in 'PR16014::C<PR16014::A>'}}
+ int *bar() { return &b; } // expected-error {{no member named 'b' in 'PR16014::C<PR16014::A>'}}
+ int baz() { return T::b; } // expected-error {{no member named 'b' in 'PR16014::A'}}
+ int T::*qux() { return &T::b; } // expected-error {{no member named 'b' in 'PR16014::A'}}
+ int T::*fuz() { return &U::a; } // expected-error {{use of undeclared identifier 'U'}}
+};
+
+template struct B<A>;
+template struct C<A>; // expected-note-re 1+ {{in instantiation of member function 'PR16014::C<PR16014::A>::.*' requested here}}
+
+template <typename T> struct D : T {
+ struct Inner {
+ int foo() {
+ // FIXME: MSVC can find this in D's base T! Even worse, if ::sa exists,
+ // clang will use it instead.
+ return sa; // expected-error {{use of undeclared identifier 'sa'}}
+ }
+ };
+};
+template struct D<A>;
+
+}
diff --git a/test/SemaTemplate/nested-template.cpp b/test/SemaTemplate/nested-template.cpp
index 47502536caf7..44cb82e95bbf 100644
--- a/test/SemaTemplate/nested-template.cpp
+++ b/test/SemaTemplate/nested-template.cpp
@@ -135,6 +135,7 @@ namespace PR10896 {
template<typename T>
T SomeField; // expected-error {{member 'SomeField' declared as a template}}
+ template<> int SomeField2; // expected-error {{extraneous 'template<>' in declaration of member 'SomeField2'}}
};
void g() {
diff --git a/test/SemaTemplate/overload-candidates.cpp b/test/SemaTemplate/overload-candidates.cpp
index ad65397865ad..544d897e2449 100644
--- a/test/SemaTemplate/overload-candidates.cpp
+++ b/test/SemaTemplate/overload-candidates.cpp
@@ -79,3 +79,48 @@ void foo(NS2::array<A>); // expected-note{{candidate template ignored: could not
void test() {
foo(NS1::array<int>()); // expected-error{{no matching function for call to 'foo'}}
}
+
+namespace std {
+ template<bool, typename = void> struct enable_if {};
+ template<typename T> struct enable_if<true, T> { typedef T type; };
+
+ template<typename T, T V> struct integral_constant { static const T value = V; };
+ typedef integral_constant<bool, false> false_type;
+ typedef integral_constant<bool, true> true_type;
+};
+
+namespace PR15673 {
+ template<typename T>
+ struct a_trait : std::false_type {};
+
+ template<typename T,
+ typename Requires = typename std::enable_if<a_trait<T>::value>::type> // expected-warning {{C++11 extension}}
+ // expected-note@-1 {{candidate template ignored: disabled by 'enable_if' [with T = int]}}
+ void foo() {}
+ void bar() { foo<int>(); } // expected-error {{no matching function for call to 'foo'}}
+
+
+ template<typename T>
+ struct some_trait : std::false_type {};
+
+ // FIXME: It would be nice to tunnel the 'disabled by enable_if' diagnostic through here.
+ template<typename T>
+ struct a_pony : std::enable_if<some_trait<T>::value> {};
+
+ template<typename T,
+ typename Requires = typename a_pony<T>::type> // expected-warning {{C++11 extension}}
+ // FIXME: The source location here is poor.
+ void baz() { } // expected-note {{candidate template ignored: substitution failure [with T = int]: no type named 'type' in 'PR15673::a_pony<int>'}}
+ void quux() { baz<int>(); } // expected-error {{no matching function for call to 'baz'}}
+
+
+ // FIXME: This note doesn't make it clear which candidate we rejected.
+ template <typename T>
+ using unicorns = typename std::enable_if<some_trait<T>::value>::type; // expected-warning {{C++11 extension}}
+ // expected-note@-1 {{candidate template ignored: disabled by 'enable_if' [with T = int]}}
+
+ template<typename T,
+ typename Requires = unicorns<T> > // expected-warning {{C++11 extension}}
+ void wibble() {}
+ void wobble() { wibble<int>(); } // expected-error {{no matching function for call to 'wibble'}}
+}
diff --git a/test/SemaTemplate/recovery-crash.cpp b/test/SemaTemplate/recovery-crash.cpp
index 61e880bf5b03..78f6db40d5c8 100644
--- a/test/SemaTemplate/recovery-crash.cpp
+++ b/test/SemaTemplate/recovery-crash.cpp
@@ -16,3 +16,22 @@ void Test() {
B<int> b(0); // expected-note{{in instantiation of function template}}
}
+
+// Don't crash here.
+namespace PR16134 {
+ template <class P> struct S // expected-error {{expected ';'}}
+ template <> static S<Q>::f() // expected-error +{{}}
+}
+
+namespace PR16225 {
+ template <typename T> void f();
+ template<typename C> void g(C*) {
+ struct LocalStruct : UnknownBase<Mumble, C> { }; // expected-error {{unknown template name 'UnknownBase'}} \
+ // expected-error {{use of undeclared identifier 'Mumble'}}
+ f<LocalStruct>(); // expected-warning {{template argument uses local type 'LocalStruct'}}
+ }
+ struct S;
+ void h() {
+ g<S>(0); // expected-note {{in instantiation of function template specialization}}
+ }
+}
diff --git a/test/SemaTemplate/resolve-single-template-id.cpp b/test/SemaTemplate/resolve-single-template-id.cpp
index 0c9bacca3edd..7fb16eb46745 100644
--- a/test/SemaTemplate/resolve-single-template-id.cpp
+++ b/test/SemaTemplate/resolve-single-template-id.cpp
@@ -33,7 +33,7 @@ int main()
oneT<int>; // expected-warning {{expression result unused}}
twoT<int>; // expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}}
typeid(oneT<int>); // expected-warning{{expression result unused}}
- sizeof(oneT<int>); // expected-warning {{expression result unused}}
+ sizeof(oneT<int>); // expected-error {{invalid application of 'sizeof' to a function type}}
sizeof(twoT<int>); //expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}}
decltype(oneT<int>)* fun = 0;
@@ -74,7 +74,7 @@ int main()
}
struct rdar9108698 {
- template<typename> void f();
+ template<typename> void f(); // expected-note{{possible target for call}}
};
void test_rdar9108698(rdar9108698 x) {
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp
index 24509524b294..8f6cc192fa8b 100644
--- a/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/test/SemaTemplate/temp_arg_nontype.cpp
@@ -75,6 +75,9 @@ struct Z {
int int_member;
float float_member;
+ union {
+ int union_member;
+ };
};
template<int (Z::*pmf)(int)> struct A6; // expected-note{{template parameter is declared here}}
A6<&Z::foo> *a17_1;
@@ -88,6 +91,7 @@ A7<&Z::int_member> *a18_1;
A7c<&Z::int_member> *a18_2;
A7<&Z::float_member> *a18_3; // expected-error{{non-type template argument of type 'float Z::*' cannot be converted to a value of type 'int Z::*'}}
A7c<(&Z::int_member)> *a18_4; // expected-warning{{address non-type template argument cannot be surrounded by parentheses}}
+A7c<&Z::union_member> *a18_5;
template<unsigned char C> struct Overflow; // expected-note{{template parameter is declared here}}
@@ -252,16 +256,16 @@ namespace PR8372 {
namespace PR9227 {
template <bool B> struct enable_if_bool { };
- template <> struct enable_if_bool<true> { typedef int type; };
- void test_bool() { enable_if_bool<false>::type i; } // expected-error{{enable_if_bool<false>}}
+ template <> struct enable_if_bool<true> { typedef int type; }; // expected-note{{'enable_if_bool<true>::type' declared here}}
+ void test_bool() { enable_if_bool<false>::type i; } // expected-error{{enable_if_bool<false>'; did you mean 'enable_if_bool<true>::type'?}}
template <char C> struct enable_if_char { };
- template <> struct enable_if_char<'a'> { typedef int type; };
- void test_char_0() { enable_if_char<0>::type i; } // expected-error{{enable_if_char<'\x00'>}}
- void test_char_b() { enable_if_char<'b'>::type i; } // expected-error{{enable_if_char<'b'>}}
- void test_char_possibly_negative() { enable_if_char<'\x02'>::type i; } // expected-error{{enable_if_char<'\x02'>}}
- void test_char_single_quote() { enable_if_char<'\''>::type i; } // expected-error{{enable_if_char<'\''>}}
- void test_char_backslash() { enable_if_char<'\\'>::type i; } // expected-error{{enable_if_char<'\\'>}}
+ template <> struct enable_if_char<'a'> { typedef int type; }; // expected-note 5{{'enable_if_char<'a'>::type' declared here}}
+ void test_char_0() { enable_if_char<0>::type i; } // expected-error{{enable_if_char<'\x00'>'; did you mean 'enable_if_char<'a'>::type'?}}
+ void test_char_b() { enable_if_char<'b'>::type i; } // expected-error{{enable_if_char<'b'>'; did you mean 'enable_if_char<'a'>::type'?}}
+ void test_char_possibly_negative() { enable_if_char<'\x02'>::type i; } // expected-error{{enable_if_char<'\x02'>'; did you mean 'enable_if_char<'a'>::type'?}}
+ void test_char_single_quote() { enable_if_char<'\''>::type i; } // expected-error{{enable_if_char<'\''>'; did you mean 'enable_if_char<'a'>::type'?}}
+ void test_char_backslash() { enable_if_char<'\\'>::type i; } // expected-error{{enable_if_char<'\\'>'; did you mean 'enable_if_char<'a'>::type'?}}
}
namespace PR10579 {
@@ -346,3 +350,17 @@ namespace rdar13806270 {
};
void foo() {}
}
+
+namespace PR17696 {
+ struct a {
+ union {
+ int i;
+ };
+ };
+
+ template <int (a::*p)> struct b : a {
+ b() { this->*p = 0; }
+ };
+
+ b<&a::i> c; // okay
+}
diff --git a/test/SemaTemplate/temp_arg_template.cpp b/test/SemaTemplate/temp_arg_template.cpp
index c9ce1b694363..dec5dd37d484 100644
--- a/test/SemaTemplate/temp_arg_template.cpp
+++ b/test/SemaTemplate/temp_arg_template.cpp
@@ -60,3 +60,14 @@ template <typename Primitive, template <Primitive...> class F> // expected-warni
struct unbox_args {
typedef typename Primitive::template call<F> x;
};
+
+template <template <typename> class... Templates> // expected-warning {{variadic templates are a C++11 extension}}
+struct template_tuple {};
+template <typename T>
+struct identity {};
+template <template <typename> class... Templates> // expected-warning {{variadic templates are a C++11 extension}}
+template_tuple<Templates...> f7() {}
+
+void foo() {
+ f7<identity>();
+}
diff --git a/test/SemaTemplate/virtual-member-functions.cpp b/test/SemaTemplate/virtual-member-functions.cpp
index 974f66484ba1..439d8f836f9f 100644
--- a/test/SemaTemplate/virtual-member-functions.cpp
+++ b/test/SemaTemplate/virtual-member-functions.cpp
@@ -72,7 +72,7 @@ namespace PR7114 {
int f() { return B<int>::value; }
void test_typeid(B<float>::Inner bfi) {
- (void)typeid(bfi); // expected-note{{implicit default destructor}}
+ (void)typeid(bfi); // expected-note{{implicit destructor}}
}
template<typename T>
@@ -84,3 +84,15 @@ namespace PR7114 {
xi.f();
}
}
+
+namespace DynamicCast {
+ struct Y {};
+ template<typename T> struct X : virtual Y {
+ virtual void foo() { T x; } // expected-error {{variable has incomplete type 'void'}}
+ };
+ template<typename T> struct X2 : virtual Y {
+ virtual void foo() { T x; }
+ };
+ Y* f(X<void>* x) { return dynamic_cast<Y*>(x); } // expected-note {{in instantiation of member function 'DynamicCast::X<void>::foo' requested here}}
+ Y* f2(X<void>* x) { return dynamic_cast<Y*>(x); }
+}
diff --git a/test/Tooling/Inputs/lit.local.cfg b/test/Tooling/Inputs/lit.local.cfg
deleted file mode 100644
index e6f55eef7af5..000000000000
--- a/test/Tooling/Inputs/lit.local.cfg
+++ /dev/null
@@ -1 +0,0 @@
-config.suffixes = []
diff --git a/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp b/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
index 6b632b0a0d81..d7ec3f60ac7c 100644
--- a/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
+++ b/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
@@ -2,11 +2,15 @@
// RUN: mkdir -p %t/abc/def/ijk/qwe
// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c %t/abc/def/ijk/qwe/test.cpp\",\"file\":\"%t/abc/def/ijk/qwe/test.cpp\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
// RUN: cp "%s" "%t/abc/def/ijk/qwe/test.cpp"
-// RUN: PWD="%t/abc/def" clang-check "ijk/qwe/test.cpp" 2>&1 | FileCheck %s
+// RUN: ln -sf %t/abc/def %t/abc/def2
+// RUN: cd %t/abc/def2
+// RUN: not env PWD="%t/abc/def" clang-check "ijk/qwe/test.cpp" 2>&1 | FileCheck %s
// CHECK: C++ requires
+// CHECK: /abc/def/ijk/qwe/test.cpp
invalid;
// REQUIRES: shell
// PR15590
// XFAIL: win64
+// XFAIL: mingw
diff --git a/test/Tooling/auto-detect-from-source-parent.cpp b/test/Tooling/auto-detect-from-source-parent.cpp
index f1dbc0fa6743..5f27d5ab8051 100644
--- a/test/Tooling/auto-detect-from-source-parent.cpp
+++ b/test/Tooling/auto-detect-from-source-parent.cpp
@@ -2,7 +2,7 @@
// RUN: mkdir -p %t/abc/def/ijk/qwe
// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c %t/abc/def/ijk/qwe/test.cpp\",\"file\":\"%t/abc/def/ijk/qwe/test.cpp\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
// RUN: cp "%s" "%t/abc/def/ijk/qwe/test.cpp"
-// RUN: clang-check "%t/abc/def/ijk/qwe/test.cpp" 2>&1 | FileCheck %s
+// RUN: not clang-check "%t/abc/def/ijk/qwe/test.cpp" 2>&1 | FileCheck %s
// CHECK: C++ requires
invalid;
diff --git a/test/Tooling/auto-detect-from-source.cpp b/test/Tooling/auto-detect-from-source.cpp
index 77e06e781c93..6ff39acdc8c2 100644
--- a/test/Tooling/auto-detect-from-source.cpp
+++ b/test/Tooling/auto-detect-from-source.cpp
@@ -2,7 +2,7 @@
// RUN: mkdir %t
// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c %t/test.cpp\",\"file\":\"%t/test.cpp\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
-// RUN: clang-check "%t/test.cpp" 2>&1 | FileCheck %s
+// RUN: not clang-check "%t/test.cpp" 2>&1 | FileCheck %s
// CHECK: C++ requires
invalid;
diff --git a/test/Tooling/clang-check-analyzer.cpp b/test/Tooling/clang-check-analyzer.cpp
new file mode 100644
index 000000000000..16cf7ce603ba
--- /dev/null
+++ b/test/Tooling/clang-check-analyzer.cpp
@@ -0,0 +1,4 @@
+// RUN: clang-check -analyze "%s" -- -c 2>&1 | FileCheck %s
+
+// CHECK: Dereference of null pointer
+int a(int *x) { if(x){} *x = 47; }
diff --git a/test/Tooling/clang-check-args.cpp b/test/Tooling/clang-check-args.cpp
index 66950ae10391..202b23711865 100644
--- a/test/Tooling/clang-check-args.cpp
+++ b/test/Tooling/clang-check-args.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-check "%s" -- -c 2>&1 | FileCheck %s
+// RUN: not clang-check "%s" -- -c 2>&1 | FileCheck %s
// CHECK: C++ requires
invalid;
diff --git a/test/Tooling/clang-check-autodetect-dir.cpp b/test/Tooling/clang-check-autodetect-dir.cpp
index 39a0c386fe8e..8ef3f3d01734 100644
--- a/test/Tooling/clang-check-autodetect-dir.cpp
+++ b/test/Tooling/clang-check-autodetect-dir.cpp
@@ -2,7 +2,7 @@
// RUN: mkdir -p %t/abc/def
// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c %t/test.cpp\",\"file\":\"%t/test.cpp\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
-// RUN: clang-check -p "%t/abc/def" "%t/test.cpp" 2>&1|FileCheck %s
+// RUN: not clang-check -p "%t/abc/def" "%t/test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
// CHECK: C++ requires
diff --git a/test/Tooling/clang-check-builtin-headers.cpp b/test/Tooling/clang-check-builtin-headers.cpp
index ed2bea0d656d..76fc9c4b3d01 100644
--- a/test/Tooling/clang-check-builtin-headers.cpp
+++ b/test/Tooling/clang-check-builtin-headers.cpp
@@ -3,7 +3,7 @@
// Add a path that doesn't exist as argv[0] for the compile command line:
// RUN: echo '[{"directory":".","command":"/random/tool -c %t/test.cpp","file":"%t/test.cpp"}]' | sed -e 's/\\/\//g' > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
-// RUN: clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
+// RUN: not clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
#include <stddef.h>
diff --git a/test/Tooling/clang-check-chdir.cpp b/test/Tooling/clang-check-chdir.cpp
index c8113233fa25..fbe8a19aa152 100644
--- a/test/Tooling/clang-check-chdir.cpp
+++ b/test/Tooling/clang-check-chdir.cpp
@@ -5,7 +5,7 @@
// RUN: echo "[{\"directory\":\"%t\",\"command\":\"clang -c test.cpp -I.\",\"file\":\"%t/test.cpp\"}]" | sed -e 's/\\/\//g' > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
// RUN: touch "%t/clang-check-test.h"
-// RUN: clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
+// RUN: not clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
#include "clang-check-test.h"
diff --git a/test/Tooling/clang-check-extra-arg.cpp b/test/Tooling/clang-check-extra-arg.cpp
new file mode 100644
index 000000000000..f6715358453f
--- /dev/null
+++ b/test/Tooling/clang-check-extra-arg.cpp
@@ -0,0 +1,5 @@
+// RUN: clang-check "%s" -extra-arg=-Wunimplemented-warning -extra-arg-before=-Wunimplemented-warning-before -- -c 2>&1 | FileCheck %s
+
+// CHECK: unknown warning option '-Wunimplemented-warning-before'
+// CHECK: unknown warning option '-Wunimplemented-warning'
+int a(){}
diff --git a/test/Tooling/clang-check-pwd.cpp b/test/Tooling/clang-check-pwd.cpp
index 463ed40b3e50..d85b9b1ae472 100644
--- a/test/Tooling/clang-check-pwd.cpp
+++ b/test/Tooling/clang-check-pwd.cpp
@@ -2,12 +2,16 @@
// RUN: mkdir %t
// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c %t/test.cpp\",\"file\":\"%t/test.cpp\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
-// RUN: PWD="%t" clang-check -p "%t" "test.cpp" 2>&1|FileCheck %s
+// RUN: ln -sf %t %t.foobar
+// RUN: cd %t
+// RUN: not env PWD="%t.foobar" clang-check -p "%t" "test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
// CHECK: C++ requires
+// CHECK: .foobar/test.cpp
invalid;
// REQUIRES: shell
// PR15590
// XFAIL: win64
+// XFAIL: mingw
diff --git a/test/Tooling/clang-check-rel-path.cpp b/test/Tooling/clang-check-rel-path.cpp
new file mode 100644
index 000000000000..23a9345b99b3
--- /dev/null
+++ b/test/Tooling/clang-check-rel-path.cpp
@@ -0,0 +1,10 @@
+// This block test a compilation database with files relative to the directory
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo '[{"directory":"%t","command":"clang++ -c test.cpp","file":"test.cpp"}]' | sed -e 's/\\/\//g' > %t/compile_commands.json
+// RUN: cp "%s" "%t/test.cpp"
+// RUN: not clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
+// FIXME: Make the above easier.
+
+// CHECK: C++ requires
+invalid;
diff --git a/test/Tooling/clang-check-strip-o.cpp b/test/Tooling/clang-check-strip-o.cpp
new file mode 100644
index 000000000000..e33367bea54b
--- /dev/null
+++ b/test/Tooling/clang-check-strip-o.cpp
@@ -0,0 +1,11 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo '[{"directory":".","command":"clang++ -c %t/test.cpp -o foo -ofoo","file":"%t/test.cpp"}]' | sed -e 's/\\/\//g' > %t/compile_commands.json
+// RUN: cp "%s" "%t/test.cpp"
+// RUN: not clang-check -p "%t" "%t/test.cpp" -extra-arg=-v 2>&1|FileCheck %s
+// FIXME: Make the above easier.
+
+// CHECK: Invocation
+// CHECK-NOT: {{ -v}}
+// CHECK: C++ requires
+invalid;
diff --git a/test/Tooling/clang-check.cpp b/test/Tooling/clang-check.cpp
index 56835b3bf986..e3fb49c41772 100644
--- a/test/Tooling/clang-check.cpp
+++ b/test/Tooling/clang-check.cpp
@@ -2,7 +2,7 @@
// RUN: mkdir %t
// RUN: echo '[{"directory":".","command":"clang++ -c %t/test.cpp","file":"%t/test.cpp"}]' | sed -e 's/\\/\//g' > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
-// RUN: clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
+// RUN: not clang-check -p "%t" "%t/test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
// CHECK: C++ requires
diff --git a/test/Tooling/ms-asm-no-target.cpp b/test/Tooling/ms-asm-no-target.cpp
new file mode 100644
index 000000000000..68930b159680
--- /dev/null
+++ b/test/Tooling/ms-asm-no-target.cpp
@@ -0,0 +1,13 @@
+// RUN: not clang-check "%s" -- -fasm-blocks -target x86_64-apple-darwin10 2>&1 | FileCheck -check-prefix=CHECK-X86 %s
+// RUN: not clang-check "%s" -- -fasm-blocks -target powerpc-apple-darwin10 2>&1 | FileCheck -check-prefix=CHECK-PPC %s
+
+// Test that we diagnose instead of crashing when the application hasn't
+// initialized LLVM targets supporting the MS-style inline asm parser.
+// Also test that the ordinary error is emitted on unsupported architectures.
+
+void Break() {
+ __asm { int 3 }
+}
+
+// CHECK-X86: error: MS-style inline assembly is not available
+// CHECK-PPC: error: Unsupported architecture 'powerpc' for MS-style inline assembly
diff --git a/test/Tooling/multi-jobs.cpp b/test/Tooling/multi-jobs.cpp
index 1e6bce113fd5..cef84439f0da 100644
--- a/test/Tooling/multi-jobs.cpp
+++ b/test/Tooling/multi-jobs.cpp
@@ -1,4 +1,7 @@
-// RUN: clang-check "%s" -- -no-integrated-as -c 2>&1 | FileCheck %s
+// RUN: not clang-check "%s" -- -no-integrated-as -c 2>&1 | FileCheck %s
// CHECK: C++ requires
invalid;
+
+// MSVC targeted drivers (*-win32) are incapable of invoking external assembler.
+// XFAIL: win32
diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
index d58337c8f799..f39fded3acc7 100644
--- a/test/Unit/lit.cfg
+++ b/test/Unit/lit.cfg
@@ -4,6 +4,9 @@
import os
+import lit.formats
+import lit.util
+
# name: The name of this test suite.
config.name = 'Clang-Unit'
@@ -43,9 +46,9 @@ if config.test_exec_root is None:
# out-of-tree build situation).
# Check for 'clang_unit_site_config' user parameter, and use that if available.
- site_cfg = lit.params.get('clang_unit_site_config', None)
+ site_cfg = lit_config.params.get('clang_unit_site_config', None)
if site_cfg and os.path.exists(site_cfg):
- lit.load_config(config, site_cfg)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
# Try to detect the situation where we are using an out-of-tree build by
@@ -58,7 +61,7 @@ if config.test_exec_root is None:
llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
if not llvm_config:
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Get the source and object roots.
llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
@@ -70,16 +73,16 @@ if config.test_exec_root is None:
# tools/clang layout.
this_src_root = os.path.join(os.path.dirname(__file__),'..','..')
if os.path.realpath(clang_src_root) != os.path.realpath(this_src_root):
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Check that the site specific configuration exists.
site_cfg = os.path.join(clang_obj_root, 'test', 'Unit', 'lit.site.cfg')
if not os.path.exists(site_cfg):
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Okay, that worked. Notify the user of the automagic, and reconfigure.
- lit.note('using out-of-tree build at %r' % clang_obj_root)
- lit.load_config(config, site_cfg)
+ lit_config.note('using out-of-tree build at %r' % clang_obj_root)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
# If necessary, point the dynamic loader at libLLVM.so.
diff --git a/test/Unit/lit.site.cfg.in b/test/Unit/lit.site.cfg.in
index 9f4d224eb655..a255cdce0de8 100644
--- a/test/Unit/lit.site.cfg.in
+++ b/test/Unit/lit.site.cfg.in
@@ -1,3 +1,5 @@
+import sys
+
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
@@ -15,12 +17,13 @@ config.target_triple = "@TARGET_TRIPLE@"
# 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
- config.llvm_build_mode = config.llvm_build_mode % lit.params
-except KeyError,e:
+ config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
+ config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
+ config.llvm_build_mode = config.llvm_build_mode % lit_config.params
+except KeyError:
+ e = sys.exc_info()[1]
key, = e.args
- lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
+ lit_config.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/Unit/lit.cfg")
+lit_config.load_config(config, "@CLANG_SOURCE_DIR@/test/Unit/lit.cfg")
diff --git a/test/lit.cfg b/test/lit.cfg
index 6b0ad59c9f1f..19daa61a64ff 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -6,6 +6,8 @@ import re
import subprocess
import tempfile
+import lit.formats
+import lit.util
# Configuration file for the 'lit' test runner.
@@ -16,9 +18,9 @@ config.name = 'Clang'
if platform.system() == 'Windows':
# Seek sane tools in directories and set to $PATH.
path = getattr(config, 'lit_tools_dir', None)
- path = lit.getToolsPath(path,
- config.environment['PATH'],
- ['cmp.exe', 'grep.exe', 'sed.exe'])
+ path = lit_config.getToolsPath(path,
+ config.environment['PATH'],
+ ['cmp.exe', 'grep.exe', 'sed.exe'])
if path is not None:
path = os.path.pathsep.join((path,
config.environment['PATH']))
@@ -44,6 +46,11 @@ 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', '.cu', '.ll', '.cl', '.s']
+# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
+# subdirectories contain auxiliary inputs for various tests in their parent
+# directories.
+config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']
+
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
@@ -89,12 +96,12 @@ for name in possibly_dangerous_env_vars:
if clang_obj_root is not None:
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
if not llvm_tools_dir:
- lit.fatal('No LLVM tools dir set!')
+ lit_config.fatal('No LLVM tools dir set!')
path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
config.environment['PATH'] = path
llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
if not llvm_libs_dir:
- lit.fatal('No LLVM libs dir set!')
+ lit_config.fatal('No LLVM libs dir set!')
path = os.path.pathsep.join((llvm_libs_dir,
config.environment.get('LD_LIBRARY_PATH','')))
config.environment['LD_LIBRARY_PATH'] = path
@@ -114,9 +121,9 @@ if config.test_exec_root is None:
# out-of-tree build situation).
# Check for 'clang_site_config' user parameter, and use that if available.
- site_cfg = lit.params.get('clang_site_config', None)
+ site_cfg = lit_config.params.get('clang_site_config', None)
if site_cfg and os.path.exists(site_cfg):
- lit.load_config(config, site_cfg)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
# Try to detect the situation where we are using an out-of-tree build by
@@ -130,7 +137,7 @@ if config.test_exec_root is None:
llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
if not llvm_config:
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Get the source and object roots.
llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
@@ -142,17 +149,18 @@ if config.test_exec_root is None:
# tools/clang layout.
this_src_root = os.path.dirname(config.test_source_root)
if os.path.realpath(clang_src_root) != os.path.realpath(this_src_root):
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Check that the site specific configuration exists.
site_cfg = os.path.join(clang_obj_root, 'test', 'lit.site.cfg')
if not os.path.exists(site_cfg):
- lit.fatal('No site specific configuration available! You may need to '
- 'run "make test" in your Clang build directory.')
+ lit_config.fatal(
+ 'No site specific configuration available! You may need to '
+ 'run "make test" in your Clang build directory.')
# Okay, that worked. Notify the user of the automagic, and reconfigure.
- lit.note('using out-of-tree build at %r' % clang_obj_root)
- lit.load_config(config, site_cfg)
+ lit_config.note('using out-of-tree build at %r' % clang_obj_root)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
###
@@ -174,14 +182,14 @@ def inferClang(PATH):
clang = lit.util.which('clang', PATH)
if not clang:
- lit.fatal("couldn't find 'clang' program, try setting "
- "CLANG in your environment")
+ lit_config.fatal("couldn't find 'clang' program, try setting "
+ "CLANG in your environment")
return clang
config.clang = inferClang(config.environment['PATH']).replace('\\', '/')
-if not lit.quiet:
- lit.note('using clang: %r' % config.clang)
+if not lit_config.quiet:
+ lit_config.note('using clang: %r' % config.clang)
# Note that when substituting %clang_cc1 also fill in the include directory of
# the builtin headers. Those are part of even a freestanding environment, but
@@ -192,15 +200,23 @@ def getClangBuiltinIncludeDir(clang):
cmd = subprocess.Popen([clang, '-print-file-name=include'],
stdout=subprocess.PIPE)
if not cmd.stdout:
- lit.fatal("Couldn't find the include dir for Clang ('%s')" % clang)
- return cmd.stdout.read().strip()
+ lit_config.fatal("Couldn't find the include dir for Clang ('%s')" % clang)
+ dir = cmd.stdout.read().strip()
+ if sys.platform in ['win32'] and execute_external:
+ # Don't pass dosish path separator to msys bash.exe.
+ dir = dir.replace('\\', '/')
+ # Ensure the result is an ascii string, across Python2.5+ - Python3.
+ return str(dir.decode('ascii'))
config.substitutions.append( ('%clang_cc1', '%s -cc1 -internal-isystem %s'
% (config.clang,
getClangBuiltinIncludeDir(config.clang))) )
-
+config.substitutions.append( ('%clang_cpp', ' ' + config.clang +
+ ' --driver-mode=cpp '))
+config.substitutions.append( ('%clang_cl', ' ' + config.clang +
+ ' --driver-mode=cl '))
config.substitutions.append( ('%clangxx', ' ' + config.clang +
- ' -ccc-cxx '))
+ ' --driver-mode=g++ '))
config.substitutions.append( ('%clang', ' ' + config.clang + ' ') )
config.substitutions.append( ('%test_debuginfo', ' ' + config.llvm_src_root + '/utils/test_debuginfo.pl ') )
@@ -218,6 +234,12 @@ config.substitutions.append(
config.substitutions.append(
(' %clang-cc1 ',
"""*** invalid substitution, use '%clang_cc1'. ***""") )
+config.substitutions.append(
+ (' %clang-cpp ',
+ """*** invalid substitution, use '%clang_cpp'. ***""") )
+config.substitutions.append(
+ (' %clang-cl ',
+ """*** invalid substitution, use '%clang_cl'. ***""") )
###
@@ -232,17 +254,25 @@ if execute_external:
config.available_features.add('shell')
# Exclude MSYS due to transforming '/' to 'X:/mingwroot/'.
-if not platform.system() in ['Windows'] or lit.getBashPath() == '':
+if not platform.system() in ['Windows'] or not execute_external:
config.available_features.add('shell-preserves-root')
# ANSI escape sequences in non-dumb terminal
if platform.system() not in ['Windows']:
config.available_features.add('ansi-escape-sequences')
+# Native compilation: host arch == target arch
+if config.host_arch in config.target_triple:
+ config.available_features.add("native")
+
# Case-insensitive file system
def is_filesystem_case_insensitive():
handle, path = tempfile.mkstemp(prefix='case-test', dir=config.test_exec_root)
- isInsensitive = os.path.exists(path.upper())
+ isInsensitive = os.path.exists(
+ os.path.join(
+ os.path.dirname(path),
+ os.path.basename(path).upper()
+ ))
os.close(handle)
os.remove(path)
return isInsensitive
@@ -272,6 +302,7 @@ def get_llc_props(tool):
# Parse the stdout to get the list of registered targets.
parse_targets = False
for line in cmd.stdout:
+ line = line.decode('ascii')
if parse_targets:
m = re.match( r'(.*) - ', line)
if m is not None:
@@ -291,7 +322,7 @@ llc_props = get_llc_props(os.path.join(llvm_tools_dir, 'llc'))
if len(llc_props['set_of_targets']) > 0:
config.available_features.update(llc_props['set_of_targets'])
else:
- lit.fatal('No Targets Registered with the LLVM Tools!')
+ lit_config.fatal('No Targets Registered with the LLVM Tools!')
if llc_props['enable_assertions']:
config.available_features.add('asserts')
@@ -305,3 +336,43 @@ if config.llvm_use_sanitizer == "Address":
if (config.llvm_use_sanitizer == "Memory" or
config.llvm_use_sanitizer == "MemoryWithOrigins"):
config.available_features.add("msan")
+
+# Check if we should run long running tests.
+if lit_config.params.get("run_long_tests", None) == "true":
+ config.available_features.add("long_tests")
+
+# Check if we should use gmalloc.
+use_gmalloc_str = lit_config.params.get('use_gmalloc', None)
+if use_gmalloc_str is not None:
+ if use_gmalloc_str.lower() in ('1', 'true'):
+ use_gmalloc = True
+ elif use_gmalloc_str.lower() in ('', '0', 'false'):
+ use_gmalloc = False
+ else:
+ lit_config.fatal('user parameter use_gmalloc should be 0 or 1')
+else:
+ # Default to not using gmalloc
+ use_gmalloc = False
+
+# Allow use of an explicit path for gmalloc library.
+# Will default to '/usr/lib/libgmalloc.dylib' if not set.
+gmalloc_path_str = lit_config.params.get('gmalloc_path',
+ '/usr/lib/libgmalloc.dylib')
+if use_gmalloc:
+ config.environment.update({'DYLD_INSERT_LIBRARIES' : gmalloc_path_str})
+
+# On Darwin, support relocatable SDKs by providing Clang with a
+# default system root path.
+if 'darwin' in config.target_triple:
+ try:
+ cmd = subprocess.Popen(['xcrun', '--show-sdk-path'],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ out, err = cmd.communicate()
+ out = out.strip()
+ res = cmd.wait()
+ except OSError:
+ res = -1
+ if res == 0 and out:
+ sdk_path = out
+ lit_config.note('using SDKROOT: %r' % sdk_path)
+ config.environment['SDKROOT'] = sdk_path
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 23eb8e228cce..9a4fa33cdc1c 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -1,3 +1,5 @@
+import sys
+
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
@@ -8,15 +10,20 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.clang_obj_root = "@CLANG_BINARY_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
+config.clang_arcmt = @ENABLE_CLANG_ARCMT@
+config.clang_staticanalyzer = @ENABLE_CLANG_STATIC_ANALYZER@
+config.clang_rewriter = @ENABLE_CLANG_REWRITER@
+config.host_arch = "@HOST_ARCH@"
# 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:
+ config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
+ config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
+except KeyError:
+ e = sys.exc_info()[1]
key, = e.args
- lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
+ lit_config.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")
+lit_config.load_config(config, "@CLANG_SOURCE_DIR@/test/lit.cfg")